diff --git a/Cesium/Cesium.js b/Cesium/Cesium.js index 795ea6a..8719b42 100644 --- a/Cesium/Cesium.js +++ b/Cesium/Cesium.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2013 Cesium Contributors + * Copyright 2011-2014 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -286,26 +286,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** - * @license - * Cellular noise ("Worley noise") in 2D in GLSL. - * Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved. - * This code is released under the conditions of the MIT license. - * See LICENSE file for details. - */ - -/** - * @license - * Description : Array and textureless GLSL 2D/3D/4D simplex - * noise functions. - * Author : Ian McEwan, Ashima Arts. - * Maintainer : ijm - * Lastmod : 20110822 (ijm) - * License : Copyright (C) 2011 Ashima Arts. All rights reserved. - * Distributed under the MIT License. See LICENSE file. - * https://github.com/ashima/webgl-noise - */ - /** @license tween.js - https://github.com/sole/tween.js @@ -333,6 +313,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// Copyright 2012 Google Inc., Apache 2.0 license. + /** * @license * Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com) @@ -372,29 +354,6 @@ Knockout JavaScript library v3.0.0 License: MIT (http://www.opensource.org/licenses/mit-license.php) */ -/** - * @license - * WeakMap shim - * (The MIT License) - * - * Copyright (c) 2012 Brandon Benvie - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the 'Software'), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included with all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - /** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 @@ -402,42 +361,43 @@ License: MIT (http://www.opensource.org/licenses/mit-license.php) * MIT license */ -!function(){var e,t,r;!function(i){function n(e,t){return w.call(e,t)}function o(e,t){var r,i,n,o,a,s,l,u,c,h,d=t&&t.split("/"),m=g.map,p=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),u=0;u0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||p)&&m){for(r=e.split("/"),u=r.length;u>0;u-=1){if(i=r.slice(0,u).join("/"),d)for(c=d.length;c>0;c-=1)if(n=m[d.slice(0,c).join("/")],n&&(n=n[i])){o=n,a=u;break}if(o)break;!s&&p&&p[i]&&(s=p[i],l=u)}!o&&s&&(o=s,a=l),o&&(r.splice(0,a,o),e=r.join("/"))}return e}function a(e,t){return function(){return m.apply(i,C.call(arguments,0).concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(y,e)){var t=y[e];delete y[e],_[e]=!0,d.apply(i,t)}if(!n(v,e)&&!n(_,e))throw new Error("No "+e);return v[e]}function c(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function h(e){return function(){return g&&g.config&&g.config[e]||{}}}var d,m,p,f,v={},y={},g={},_={},w=Object.prototype.hasOwnProperty,C=[].slice;p=function(e,t){var r,i=c(e),n=i[0];return e=i[1],n&&(n=o(n,t),r=u(n)),n?e=r&&r.normalize?r.normalize(e,s(t)):o(e,t):(e=o(e,t),i=c(e),n=i[0],e=i[1],n&&(r=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:r}},f={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,r,o){var s,c,h,d,m,g,w=[];if(o=o||e,"function"==typeof r){for(t=!t.length&&r.length?["require","exports","module"]:t,m=0;md;d++){var m=e[d],p=m.x,f=m.y,v=m.z;n=Math.min(p,n),l=Math.max(p,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(v,s),c=Math.max(v,c)}var y=r.minimum;y.x=n,y.y=a,y.z=s;var g=r.maximum;g.x=l,g.y=u,g.z=c;var _=i.add(y,g,r.center);return i.multiplyByScalar(_,.5,_),r},o.clone=function(e,r){return t(e)?t(r)?(r.minimum=i.clone(e.minimum,r.minimum),r.maximum=i.clone(e.maximum,r.maximum),r.center=i.clone(e.center,r.center),r):new o(e.minimum,e.maximum):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&i.equals(e.center,r.center)&&i.equals(e.minimum,r.minimum)&&i.equals(e.maximum,r.maximum)};var a=new i;return o.intersect=function(e,o){if(!t(e))throw new r("box is required.");if(!t(o))throw new r("plane is required.");a=i.subtract(e.maximum,e.minimum,a);var s=i.multiplyByScalar(a,.5,a),l=s.x*Math.abs(o.x)+s.y*Math.abs(o.y)+s.z*Math.abs(o.z),u=i.dot(e.center,o)+o.w;return u-l>0?n.INSIDE:0>u+l?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersect=function(e){return o.intersect(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),r("Core/BingMapsApi",["./defined"],function(e){"use strict";var t={};t.defaultKey=void 0;var r=!1;return t.getKey=function(i){return e(i)?i:e(t.defaultKey)?t.defaultKey:(r||(console.log("This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API."),r=!0),"Aj1ony_-Typ-KjG9SJWiKSHY23U1KmK7yAmZa9lDmuF2osXWkcZ22VPsqmCt0TCt")},t}),r("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";var n=function(t,r){this.x=e(t,0),this.y=e(r,0)};n.fromElements=function(e,r,i){return t(i)?(i.x=e,i.y=r,i):new n(e,r)},n.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new n(e.x,e.y):void 0},n.fromCartesian3=n.clone,n.fromCartesian4=n.clone,n.packedLength=2,n.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i]=t.y},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.x=r[i++],o.y=r[i],o},n.fromArray=n.unpack,n.getMaximumComponent=function(e){return Math.max(e.x,e.y)},n.getMinimumComponent=function(e){return Math.min(e.x,e.y)},n.getMinimumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.min(e.x,r.x),i.y=Math.min(e.y,r.y),i},n.getMaximumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.max(e.x,r.x),i.y=Math.max(e.y,r.y),i},n.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},n.magnitude=function(e){return Math.sqrt(n.magnitudeSquared(e))};var o=new n;n.distance=function(e,t){return n.subtract(e,t,o),n.magnitude(o)},n.normalize=function(e,r){var i=n.magnitude(e);return t(r)?(r.x=e.x/i,r.y=e.y/i,r):new n(e.x/i,e.y/i)},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.multiplyComponents=function(e,r,i){return t(i)?(i.x=e.x*r.x,i.y=e.y*r.y,i):new n(e.x*r.x,e.y*r.y)},n.add=function(e,r,i){return t(i)?(i.x=e.x+r.x,i.y=e.y+r.y,i):new n(e.x+r.x,e.y+r.y)},n.subtract=function(e,r,i){return t(i)?(i.x=e.x-r.x,i.y=e.y-r.y,i):new n(e.x-r.x,e.y-r.y)},n.multiplyByScalar=function(e,r,i){return t(i)?(i.x=e.x*r,i.y=e.y*r,i):new n(e.x*r,e.y*r)},n.divideByScalar=function(e,r,i){return t(i)?(i.x=e.x/r,i.y=e.y/r,i):new n(e.x/r,e.y/r)},n.negate=function(e,r){return t(r)?(r.x=-e.x,r.y=-e.y,r):new n(-e.x,-e.y)},n.abs=function(e,r){return t(r)?(r.x=Math.abs(e.x),r.y=Math.abs(e.y),r):new n(Math.abs(e.x),Math.abs(e.y))};var a=new n;n.lerp=function(e,t,r,i){return n.multiplyByScalar(t,r,a),i=n.multiplyByScalar(e,1-r,i),n.add(a,i,i)};var s=new n,l=new n;n.angleBetween=function(e,t){return n.normalize(e,s),n.normalize(t,l),Math.acos(n.dot(s,l))};var u=new n;return n.mostOrthogonalAxis=function(e,t){var r=n.normalize(e,u);return n.abs(r,r),t=r.x<=r.y?n.clone(n.UNIT_X,t):n.clone(n.UNIT_Y,t)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},n.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i},n.ZERO=i(new n(0,0)),n.UNIT_X=i(new n(1,0)),n.UNIT_Y=i(new n(0,1)),n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.x+", "+this.y+")"},n}),r("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r>>1^t[1&e];for(;r>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),r("Core/Math",["./defaultValue","./defined","./DeveloperError","../ThirdParty/mersenne-twister"],function(e,t,r,i){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},n.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},n.lerp=function(e,t,r){return(1-r)*e+r*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+t)>e;)e+=i;if(-r>e)return-r;for(;e>r+t;)e-=i;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(t,r,i){return i=e(i,0),Math.abs(t-r)<=i};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var r=o[t-1],i=t;e>=i;i++)o.push(r*i);return o[e]},n.incrementWrap=function(t,r,i){return i=e(i,0),++t,t>r&&(t=i),t},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new i;return n.setRandomNumberSeed=function(e){a=new i(e)},n.nextRandomNumber=function(){return a.random()},n}),r("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(i,0)};return o.fromDegrees=function(r,i,a,s){return r=n.toRadians(e(r,0)),i=n.toRadians(e(i,0)),a=e(a,0),t(s)?(s.longitude=r,s.latitude=i,s.height=a,s):new o(r,i,a)},o.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new o(e.longitude,e.latitude,e.height):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},o.equalsEpsilon=function(e,i,n){if("number"!=typeof n)throw new r("epsilon is required and must be a number.");return e===i||t(e)&&t(i)&&Math.abs(e.longitude-i.longitude)<=n&&Math.abs(e.latitude-i.latitude)<=n&&Math.abs(e.height-i.height)<=n},o.toString=function(e){if(!t(e))throw new r("cartographic is required");return"("+e.longitude+", "+e.latitude+", "+e.height+")"},o.ZERO=i(new o(0,0,0)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return o.toString(this)},o}),r("Core/Ellipsoid",["./freezeObject","./defaultValue","./defined","./DeveloperError","./Math","./Cartesian3","./Cartographic"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,a){if(e=t(e,0),r=t(r,0),a=t(a,0),0>e||0>r||0>a)throw new i("All radii components must be greater than or equal to zero.");this._radii=new o(e,r,a),this._radiiSquared=new o(e*e,r*r,a*a),this._radiiToTheFourth=new o(e*e*e*e,r*r*r*r,a*a*a*a),this._oneOverRadii=new o(0===e?0:1/e,0===r?0:1/r,0===a?0:1/a),this._oneOverRadiiSquared=new o(0===e?0:1/(e*e),0===r?0:1/(r*r),0===a?0:1/(a*a)),this._minimumRadius=Math.min(e,r,a),this._maximumRadius=Math.max(e,r,a),this._centerToleranceSquared=n.EPSILON1};s.clone=function(e,t){if(!r(e))return void 0;var i=e._radii;return r(t)?(o.clone(i,t._radii),o.clone(e._radiiSquared,t._radiiSquared),o.clone(e._radiiToTheFourth,t._radiiToTheFourth),o.clone(e._oneOverRadii,t._oneOverRadii),o.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new s(i.x,i.y,i.z)},s.fromCartesian3=function(e){return r(e)?new s(e.x,e.y,e.z):new s},s.WGS84=e(new s(6378137,6378137,6356752.314245179)),s.UNIT_SPHERE=e(new s(1,1,1)),s.MOON=e(new s(n.LUNAR_RADIUS,n.LUNAR_RADIUS,n.LUNAR_RADIUS)),s.prototype.getRadii=function(){return this._radii},s.prototype.getRadiiSquared=function(){return this._radiiSquared},s.prototype.getRadiiToTheFourth=function(){return this._radiiToTheFourth},s.prototype.getOneOverRadii=function(){return this._oneOverRadii},s.prototype.getOneOverRadiiSquared=function(){return this._oneOverRadiiSquared},s.prototype.getMinimumRadius=function(){return this._minimumRadius},s.prototype.getMaximumRadius=function(){return this._maximumRadius},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.geocentricSurfaceNormal=o.normalize,s.prototype.geodeticSurfaceNormalCartographic=function(e,t){if(!r(e))throw new i("cartographic is required.");var n=e.longitude,a=e.latitude,s=Math.cos(a),l=s*Math.cos(n),u=s*Math.sin(n),c=Math.sin(a);return r(t)||(t=new o),t.x=l,t.y=u,t.z=c,o.normalize(t,t)},s.prototype.geodeticSurfaceNormal=function(e,t){return t=o.multiplyComponents(e,this._oneOverRadiiSquared,t),o.normalize(t,t)};var l=new o,u=new o;s.prototype.cartographicToCartesian=function(e,t){var r=l,i=u;this.geodeticSurfaceNormalCartographic(e,r),o.multiplyComponents(this._radiiSquared,r,i);var n=Math.sqrt(o.dot(r,i));return o.divideByScalar(i,n,i),o.multiplyByScalar(r,e.height,r),o.add(i,r,t)},s.prototype.cartographicArrayToCartesianArray=function(e,t){if(!r(e))throw new i("cartographics is required.");var n=e.length;r(t)?t.length=n:t=new Array(n);for(var o=0;n>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var c=new o,h=new o,d=new o;s.prototype.cartesianToCartographic=function(e,t){var i=this.scaleToGeodeticSurface(e,h);if(!r(i))return void 0;var s=this.geodeticSurfaceNormal(i,c),l=o.subtract(e,i,d),u=Math.atan2(s.y,s.x),m=Math.asin(s.z),p=n.sign(o.dot(l,e))*o.magnitude(l);return r(t)?(t.longitude=u,t.latitude=m,t.height=p,t):new a(u,m,p)},s.prototype.cartesianArrayToCartographicArray=function(e,t){if(!r(e))throw new i("cartesians is required.");var n=e.length;r(t)?t.length=n:t=new Array(n);for(var o=0;n>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t};var m=new o,p=new o;return s.prototype.scaleToGeodeticSurface=function(e,t){if(!r(e))throw new i("cartesian is required.");var a=e.x,s=e.y,l=e.z,u=this._oneOverRadii,c=u.x,h=u.y,d=u.z,f=a*a*c*c,v=s*s*h*h,y=l*l*d*d,g=f+v+y,_=Math.sqrt(1/g),w=o.multiplyByScalar(e,_,m);if(gn.EPSILON12);return r(t)?(t.x=a*D,t.y=s*P,t.z=l*M,t):new o(a*D,s*P,l*M)},s.prototype.scaleToGeocentricSurface=function(e,t){if(!r(e))throw new i("cartesian is required.");var n=e.x,a=e.y,s=e.z,l=this._oneOverRadiiSquared,u=1/Math.sqrt(n*n*l.x+a*a*l.y+s*s*l.z);return o.multiplyByScalar(e,u,t)},s.prototype.transformPositionToScaledSpace=function(e,t){return o.multiplyComponents(e,this._oneOverRadii,t)},s.prototype.transformPositionFromScaledSpace=function(e,t){return o.multiplyComponents(e,this._radii,t)},s.prototype.equals=function(e){return this===e||r(e)&&o.equals(this._radii,e._radii)},s.prototype.toString=function(){return this._radii.toString()},s}),r("Core/GeographicProjection",["./defaultValue","./defined","./Cartesian3","./Cartographic","./Ellipsoid"],function(e,t,r,i,n){"use strict";var o=function(t){this._ellipsoid=e(t,n.WGS84),this._semimajorAxis=this._ellipsoid.getMaximumRadius(),this._oneOverSemimajorAxis=1/this._semimajorAxis};return o.prototype.getEllipsoid=function(){return this._ellipsoid},o.prototype.project=function(e,i){var n=this._semimajorAxis,o=e.longitude*n,a=e.latitude*n,s=e.height;return t(i)?(i.x=o,i.y=a,i.z=s,i):new r(o,a,s)},o.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return t(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new i(o,a,s)},o}),r("Core/BoundingRectangle",["./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartographic","./GeographicProjection","./Intersect"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r,i,n){this.x=e(t,0),this.y=e(r,0),this.width=e(i,0),this.height=e(n,0)};s.fromPoints=function(e,r){if(t(r)||(r=new s),!t(e)||0===e.length)return r.x=0,r.y=0,r.width=0,r.height=0,r;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,l=e[0].y,u=1;i>u;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),l=Math.max(d,l)}return r.x=n,r.y=o,r.width=a-n,r.height=l-o,r};var l=new o,u=new n,c=new n;return s.fromExtent=function(r,n,o){if(t(o)||(o=new s),!t(r))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=e(n,l);var a=n.project(r.getSouthwest(u)),h=n.project(r.getNortheast(c));return i.subtract(h,a,h),o.x=a.x,o.y=a.y,o.width=h.x,o.height=h.y,o},s.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.width=e.width,r.height=e.height,r):new s(e.x,e.y,e.width,e.height):void 0},s.union=function(e,i,n){if(!t(e))throw new r("left is required.");if(!t(i))throw new r("right is required.");t(n)||(n=new s);var o=Math.min(e.x,i.x),a=Math.min(e.y,i.y),l=Math.max(e.x+e.width,i.x+i.width),u=Math.max(e.y+e.height,i.y+i.height);return n.x=o,n.y=a,n.width=l-o,n.height=u-a,n},s.expand=function(e,i,n){if(!t(e))throw new r("rectangle is required.");if(!t(i))throw new r("point is required.");n=s.clone(e,n);var o=i.x-n.x,a=i.y-n.y;return o>n.width?n.width=o:0>o&&(n.width-=o,n.x=i.x),a>n.height?n.height=a:0>a&&(n.height-=a,n.y=i.y),n},s.intersect=function(e,i){if(!t(e))throw new r("left is required.");if(!t(i))throw new r("right is required.");var n=e.x,o=e.y,s=i.x,l=i.y;return n>s+i.width||n+e.widthl+i.height?a.OUTSIDE:a.INTERSECTING},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.union=function(e,t){return s.union(this,e,t)},s.prototype.expand=function(e,t){return s.expand(this,e,t)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),r("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";var n=function(t,r,i,n){this.x=e(t,0),this.y=e(r,0),this.z=e(i,0),this.w=e(n,0)};n.fromElements=function(e,r,i,o,a){return t(a)?(a.x=e,a.y=r,a.z=i,a.w=o,a):new n(e,r,i,o)},n.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new n(e.x,e.y,e.z,e.w):void 0},n.packedLength=4,n.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i++]=t.y,r[i++]=t.z,r[i]=t.w},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.x=r[i++],o.y=r[i++],o.z=r[i++],o.w=r[i],o},n.fromArray=n.unpack,n.getMaximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},n.getMinimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},n.getMinimumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.min(e.x,r.x),i.y=Math.min(e.y,r.y),i.z=Math.min(e.z,r.z),i.w=Math.min(e.w,r.w),i},n.getMaximumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.max(e.x,r.x),i.y=Math.max(e.y,r.y),i.z=Math.max(e.z,r.z),i.w=Math.max(e.w,r.w),i},n.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},n.magnitude=function(e){return Math.sqrt(n.magnitudeSquared(e))};var o=new n;n.distance=function(e,t){return n.subtract(e,t,o),n.magnitude(o)},n.normalize=function(e,r){var i=n.magnitude(e);return t(r)?(r.x=e.x/i,r.y=e.y/i,r.z=e.z/i,r.w=e.w/i,r):new n(e.x/i,e.y/i,e.z/i,e.w/i)},n.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},n.multiplyComponents=function(e,r,i){return t(i)?(i.x=e.x*r.x,i.y=e.y*r.y,i.z=e.z*r.z,i.w=e.w*r.w,i):new n(e.x*r.x,e.y*r.y,e.z*r.z,e.w*r.w)},n.add=function(e,r,i){return t(i)?(i.x=e.x+r.x,i.y=e.y+r.y,i.z=e.z+r.z,i.w=e.w+r.w,i):new n(e.x+r.x,e.y+r.y,e.z+r.z,e.w+r.w)},n.subtract=function(e,r,i){return t(i)?(i.x=e.x-r.x,i.y=e.y-r.y,i.z=e.z-r.z,i.w=e.w-r.w,i):new n(e.x-r.x,e.y-r.y,e.z-r.z,e.w-r.w)},n.multiplyByScalar=function(e,r,i){return t(i)?(i.x=e.x*r,i.y=e.y*r,i.z=e.z*r,i.w=e.w*r,i):new n(e.x*r,e.y*r,e.z*r,e.w*r)},n.divideByScalar=function(e,r,i){return t(i)?(i.x=e.x/r,i.y=e.y/r,i.z=e.z/r,i.w=e.w/r,i):new n(e.x/r,e.y/r,e.z/r,e.w/r)},n.negate=function(e,r){return t(r)?(r.x=-e.x,r.y=-e.y,r.z=-e.z,r.w=-e.w,r):new n(-e.x,-e.y,-e.z,-e.w)},n.abs=function(e,r){return t(r)?(r.x=Math.abs(e.x),r.y=Math.abs(e.y),r.z=Math.abs(e.z),r.w=Math.abs(e.w),r):new n(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z),Math.abs(e.w))};var a=new n;n.lerp=function(e,t,r,i){return n.multiplyByScalar(t,r,a),i=n.multiplyByScalar(e,1-r,i),n.add(a,i,i)};var s=new n;return n.mostOrthogonalAxis=function(e,t){var r=n.normalize(e,s);return n.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?n.clone(n.UNIT_X,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t):r.y<=r.z?r.y<=r.w?n.clone(n.UNIT_Y,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},n.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i&&Math.abs(e.z-r.z)<=i&&Math.abs(e.w-r.w)<=i},n.ZERO=i(new n(0,0,0,0)),n.UNIT_X=i(new n(1,0,0,0)),n.UNIT_Y=i(new n(0,1,0,0)),n.UNIT_Z=i(new n(0,0,1,0)),n.UNIT_W=i(new n(0,0,0,1)),n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},n}),r("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),r("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e){for(var t=0,r=0;9>r;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var i=e[u.getElementIndex(h[r],c[r])];t+=2*i*i}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,i=0,n=1,a=0;3>a;++a){var s=Math.abs(e[u.getElementIndex(h[a],c[a])]);s>i&&(n=a,i=s)}var l=1,d=0,m=c[n],p=h[n];if(Math.abs(e[u.getElementIndex(p,m)])>r){var f,v=e[u.getElementIndex(p,p)],y=e[u.getElementIndex(m,m)],g=e[u.getElementIndex(p,m)],_=(v-y)/2/g;f=0>_?-1/(-_+Math.sqrt(1+_*_)):1/(_+Math.sqrt(1+_*_)),l=1/Math.sqrt(1+f*f),d=f*l}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(m,m)]=t[u.getElementIndex(p,p)]=l,t[u.getElementIndex(p,m)]=d,t[u.getElementIndex(m,p)]=-d,t}var u=function(e,r,i,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(r,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(i,0),this[7]=t(a,0),this[8]=t(u,0)};u.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},u.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new u),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n[4]=e[i+4],n[5]=e[i+5],n[6]=e[i+6],n[7]=e[i+7],n[8]=e[i+8],n[9]=e[i+9],n},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var i=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,l=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,m=e.w*e.w,p=i-s-h+m,f=2*(n-d),v=2*(o+c),y=2*(n+d),g=-i+s-h+m,_=2*(l-a),w=2*(o-c),C=2*(l+a),x=-i-s+h+m;return r(t)?(t[0]=p,t[1]=y,t[2]=w,t[3]=f,t[4]=g,t[5]=C,t[6]=v,t[7]=_,t[8]=x,t):new u(p,f,v,y,g,_,w,C,x)},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new u(e,0,0,0,e,0,0,0,e)},u.fromRotationX=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=n,t[6]=0,t[7]=-n,t[8]=i,t):new u(1,0,0,0,i,-n,0,n,i)},u.fromRotationY=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=i,t):new u(i,0,n,0,1,0,-n,0,i)},u.fromRotationZ=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(i,-n,0,n,i,0,0,0,1)},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(t,i,n){var o=3*i,a=t[o],s=t[o+1],l=t[o+2];return r(n)?(n.x=a,n.y=s,n.z=l,n):new e(a,s,l)},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},u.getRow=function(t,i,n){var o=t[i],a=t[i+3],s=t[i+6];return r(n)?(n.x=o,n.y=a,n.z=s,n):new e(o,a,s)},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i},u.multiply=function(e,t,i){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],l=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],h=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],m=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r(i)?(i[0]=n,i[1]=o,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i[6]=h,i[7]=d,i[8]=m,i):new u(n,s,h,o,l,d,a,c,m)},u.multiplyByVector=function(t,i,n){var o=i.x,a=i.y,s=i.z,l=t[0]*o+t[3]*a+t[6]*s,u=t[1]*o+t[4]*a+t[7]*s,c=t[2]*o+t[5]*a+t[8]*s;return r(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByScalar=function(e,t,i){return r(i)?(i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i):new u(e[0]*t,e[3]*t,e[6]*t,e[1]*t,e[4]*t,e[7]*t,e[2]*t,e[5]*t,e[8]*t) -},u.negate=function(e,t){return r(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t):new u(-e[0],-e[3],-e[6],-e[1],-e[4],-e[7],-e[2],-e[5],-e[8])},u.transpose=function(e,t){var i=e[0],n=e[3],o=e[6],a=e[1],s=e[4],l=e[7],c=e[2],h=e[5],d=e[8];return r(t)?(t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=h,t[8]=d,t):new u(i,a,c,n,s,h,o,l,d)};var c=[1,0,0],h=[2,2,1],d=new u,m=new u;return u.getEigenDecomposition=function(e,t){var i=o.EPSILON20,n=10,c=0,h=0;r(t)||(t={});for(var p=t.unitary=u.clone(u.IDENTITY,t.unitary),f=t.diagonal=u.clone(e,t.diagonal),v=i*a(f);n>h&&s(f)>v;)l(f,d),u.transpose(d,m),u.multiply(f,d,f),u.multiply(m,f,f),u.multiply(p,d,p),++c>2&&(++h,c=0);return t},u.abs=function(e,t){return r(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t):new u(Math.abs(e[0]),Math.abs(e[3]),Math.abs(e[6]),Math.abs(e[1]),Math.abs(e[4]),Math.abs(e[7]),Math.abs(e[2]),Math.abs(e[5]),Math.abs(e[8]))},u.determinant=function(e){if(!r(e))throw new i("matrix is required");var t=e[0],n=e[3],o=e[6],a=e[1],s=e[4],l=e[7],u=e[2],c=e[5],h=e[8];return t*(s*h-c*l)+a*(c*o-n*h)+u*(n*l-s*o)},u.inverse=function(e,t){if(!r(e))throw new i("matrix is required");var n=e[0],a=e[1],s=e[2],l=e[3],c=e[4],h=e[5],d=e[6],m=e[7],p=e[8],f=u.determinant(e);if(Math.abs(f)<=o.EPSILON15)throw new i("matrix is not invertible");var v=new u(c*p-m*h,d*h-l*p,l*m-d*c,m*s-a*p,n*p-d*s,d*a-n*m,a*h-c*s,l*s-n*h,n*c-l*a),y=1/f;return u.multiplyByScalar(v,y,t)},u.equals=function(e,t){return e===t||r(e)&&r(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]},u.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},u.IDENTITY=n(new u(1,0,0,0,1,0,0,0,1)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},u}),r("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t=new Error;this.stack=t.stack};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),r("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(e,t,i,n,o,a,s,l,u,c,h,d,m,p,f,v){this[0]=r(e,0),this[1]=r(o,0),this[2]=r(u,0),this[3]=r(m,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(c,0),this[7]=r(p,0),this[8]=r(i,0),this[9]=r(s,0),this[10]=r(h,0),this[11]=r(f,0),this[12]=r(n,0),this[13]=r(l,0),this[14]=r(d,0),this[15]=r(v,0)};u.clone=function(e,t){return i(e)?i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},u.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new u),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n[9]=e[t+9],n[10]=e[t+10],n[11]=e[t+11],n[12]=e[t+12],n[13]=e[t+13],n[14]=e[t+14],n[15]=e[t+15],n},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},u.fromRotationTranslation=function(e,t,r){return i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=0,r[4]=e[3],r[5]=e[4],r[6]=e[5],r[7]=0,r[8]=e[6],r[9]=e[7],r[10]=e[8],r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r):new u(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},new s,u.fromTranslationQuaternionRotationScale=function(e,t,r,n){i(n)||(n=new u);var o=r.x,a=r.y,s=r.z,l=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,m=t.y*t.y,p=t.y*t.z,f=t.y*t.w,v=t.z*t.z,y=t.z*t.w,g=t.w*t.w,_=l-m-v+g,w=2*(c-y),C=2*(h+f),x=2*(c+y),S=-l+m-v+g,E=2*(p-d),b=2*(h-f),T=2*(p+d),A=-l-m+v+g;return n[0]=_*o,n[1]=x*o,n[2]=b*o,n[3]=0,n[4]=w*a,n[5]=S*a,n[6]=T*a,n[7]=0,n[8]=C*s,n[9]=E*s,n[10]=A*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},u.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,d=new e;u.fromCamera=function(t,r){var n=t.eye,o=t.target,a=t.up;e.normalize(e.subtract(o,n,c),c),e.normalize(e.cross(c,a,h),h),e.normalize(e.cross(h,c,d),d);var s=h.x,l=h.y,m=h.z,p=c.x,f=c.y,v=c.z,y=d.x,g=d.y,_=d.z,w=n.x,C=n.y,x=n.z,S=s*-w+l*-C+m*-x,E=y*-w+g*-C+_*-x,b=p*w+f*C+v*x;return i(r)?(r[0]=s,r[1]=y,r[2]=-p,r[3]=0,r[4]=l,r[5]=g,r[6]=-f,r[7]=0,r[8]=m,r[9]=_,r[10]=-v,r[11]=0,r[12]=S,r[13]=E,r[14]=b,r[15]=1,r):new u(s,l,m,S,y,g,_,E,-p,-f,-v,b,0,0,0,1)},u.computePerspectiveFieldOfView=function(e,t,r,n,o){var a=Math.tan(.5*e),s=1/a,l=s/t,c=(n+r)/(r-n),h=2*n*r/(r-n);return i(o)?(o[0]=l,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o):new u(l,0,0,0,0,s,0,0,0,0,c,h,0,0,-1,0)},u.computeOrthographicOffCenter=function(e,t,r,n,o,a,s){var l=1/(t-e),c=1/(n-r),h=1/(a-o),d=-(t+e)*l,m=-(n+r)*c,p=-(a+o)*h;return l*=2,c*=2,h*=-2,i(s)?(s[0]=l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=h,s[11]=0,s[12]=d,s[13]=m,s[14]=p,s[15]=1,s):new u(l,0,0,d,0,c,0,m,0,0,h,p,0,0,0,1)},u.computePerspectiveOffCenter=function(e,t,r,n,o,a,s){var l=2*o/(t-e),c=2*o/(n-r),h=(t+e)/(t-e),d=(n+r)/(n-r),m=-(a+o)/(a-o),p=-1,f=-2*a*o/(a-o);return i(s)?(s[0]=l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=h,s[9]=d,s[10]=m,s[11]=p,s[12]=0,s[13]=0,s[14]=f,s[15]=0,s):new u(l,0,h,0,0,c,d,0,0,0,m,f,0,0,p,0)},u.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,a){var s=2*o/(t-e),l=2*o/(n-r),c=(t+e)/(t-e),h=(n+r)/(n-r),d=-1,m=-1,p=-2*o;return i(a)?(a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=c,a[9]=h,a[10]=d,a[11]=m,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a):new u(s,0,c,0,0,l,h,0,0,0,d,p,0,0,m,0)},u.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),s=r(e.y,0),l=r(e.width,0),c=r(e.height,0);t=r(t,0),n=r(n,1);var h=.5*l,d=.5*c,m=.5*(n-t),p=h,f=d,v=m,y=a+h,g=s+d,_=t+m,w=1;return i(o)?(o[0]=p,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=f,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=v,o[11]=0,o[12]=y,o[13]=g,o[14]=_,o[15]=w,o):new u(p,0,0,y,0,f,0,g,0,0,v,_,0,0,0,w)},u.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},u.getElementIndex=function(e,t){return 4*e+t},u.getColumn=function(e,r,n){var o=4*r,a=e[o],s=e[o+1],l=e[o+2],u=e[o+3];return i(n)?(n.x=a,n.y=s,n.z=l,n.w=u,n):new t(a,s,l,u)},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=4*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i[n+3]=r.w,i},u.getRow=function(e,r,n){var o=e[r],a=e[r+4],s=e[r+8],l=e[r+12];return i(n)?(n.x=o,n.y=a,n.z=s,n.w=l,n):new t(o,a,s,l)},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+4]=r.y,i[t+8]=r.z,i[t+12]=r.w,i},u.multiply=function(e,t,r){var n=e[0],o=e[1],a=e[2],s=e[3],l=e[4],c=e[5],h=e[6],d=e[7],m=e[8],p=e[9],f=e[10],v=e[11],y=e[12],g=e[13],_=e[14],w=e[15],C=t[0],x=t[1],S=t[2],E=t[3],b=t[4],T=t[5],A=t[6],D=t[7],P=t[8],M=t[9],I=t[10],O=t[11],R=t[12],L=t[13],z=t[14],N=t[15],B=n*C+l*x+m*S+y*E,F=o*C+c*x+p*S+g*E,V=a*C+h*x+f*S+_*E,k=s*C+d*x+v*S+w*E,U=n*b+l*T+m*A+y*D,W=o*b+c*T+p*A+g*D,q=a*b+h*T+f*A+_*D,G=s*b+d*T+v*A+w*D,H=n*P+l*M+m*I+y*O,j=o*P+c*M+p*I+g*O,Y=a*P+h*M+f*I+_*O,X=s*P+d*M+v*I+w*O,Z=n*R+l*L+m*z+y*N,J=o*R+c*L+p*z+g*N,K=a*R+h*L+f*z+_*N,Q=s*R+d*L+v*z+w*N;return i(r)?(r[0]=B,r[1]=F,r[2]=V,r[3]=k,r[4]=U,r[5]=W,r[6]=q,r[7]=G,r[8]=H,r[9]=j,r[10]=Y,r[11]=X,r[12]=Z,r[13]=J,r[14]=K,r[15]=Q,r):new u(B,U,H,Z,F,W,j,J,V,q,Y,K,k,G,X,Q)},u.multiplyTransformation=function(e,t,r){var n=e[0],o=e[1],a=e[2],s=e[4],l=e[5],c=e[6],h=e[8],d=e[9],m=e[10],p=e[12],f=e[13],v=e[14],y=t[0],g=t[1],_=t[2],w=t[4],C=t[5],x=t[6],S=t[8],E=t[9],b=t[10],T=t[12],A=t[13],D=t[14],P=n*y+s*g+h*_,M=o*y+l*g+d*_,I=a*y+c*g+m*_,O=n*w+s*C+h*x,R=o*w+l*C+d*x,L=a*w+c*C+m*x,z=n*S+s*E+h*b,N=o*S+l*E+d*b,B=a*S+c*E+m*b,F=n*T+s*A+h*D+p,V=o*T+l*A+d*D+f,k=a*T+c*A+m*D+v;return i(r)?(r[0]=P,r[1]=M,r[2]=I,r[3]=0,r[4]=O,r[5]=R,r[6]=L,r[7]=0,r[8]=z,r[9]=N,r[10]=B,r[11]=0,r[12]=F,r[13]=V,r[14]=k,r[15]=1,r):new u(P,O,z,F,M,R,N,V,I,L,B,k,0,0,0,1)},u.multiplyByTranslation=function(e,t,r){var n=t.x,o=t.y,a=t.z,s=n*e[0]+o*e[4]+a*e[8]+e[12],l=n*e[1]+o*e[5]+a*e[9]+e[13],c=n*e[2]+o*e[6]+a*e[10]+e[14];return i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=s,r[13]=l,r[14]=c,r[15]=e[15],r):new u(e[0],e[4],e[8],s,e[1],e[5],e[9],l,e[2],e[6],e[10],c,e[3],e[7],e[11],e[15])};var m=new e;return u.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,u.multiplyByScale(e,m,r)},u.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,a=t.z;return 1===n&&1===o&&1===a?u.clone(e,r):i(r)?(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r):new u(n*e[0],o*e[4],a*e[8],e[12],n*e[1],o*e[5],a*e[9],e[13],n*e[2],o*e[6],a*e[10],e[14],0,0,0,1)},u.multiplyByVector=function(e,r,n){var o=r.x,a=r.y,s=r.z,l=r.w,u=e[0]*o+e[4]*a+e[8]*s+e[12]*l,c=e[1]*o+e[5]*a+e[9]*s+e[13]*l,h=e[2]*o+e[6]*a+e[10]*s+e[14]*l,d=e[3]*o+e[7]*a+e[11]*s+e[15]*l;return i(n)?(n.x=u,n.y=c,n.z=h,n.w=d,n):new t(u,c,h,d)},u.multiplyByPointAsVector=function(t,r,n){var o=r.x,a=r.y,s=r.z,l=t[0]*o+t[4]*a+t[8]*s,u=t[1]*o+t[5]*a+t[9]*s,c=t[2]*o+t[6]*a+t[10]*s;return i(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByPoint=function(t,r,n){var o=r.x,a=r.y,s=r.z,l=t[0]*o+t[4]*a+t[8]*s+t[12],u=t[1]*o+t[5]*a+t[9]*s+t[13],c=t[2]*o+t[6]*a+t[10]*s+t[14];return i(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByScalar=function(e,t,r){return i(r)?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r):new u(e[0]*t,e[4]*t,e[8]*t,e[12]*t,e[1]*t,e[5]*t,e[9]*t,e[13]*t,e[2]*t,e[6]*t,e[10]*t,e[14]*t,e[3]*t,e[7]*t,e[11]*t,e[15]*t)},u.negate=function(e,t){return i(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t):new u(-e[0],-e[4],-e[8],-e[12],-e[1],-e[5],-e[9],-e[13],-e[2],-e[6],-e[10],-e[14],-e[3],-e[7],-e[11],-e[15])},u.transpose=function(e,t){if(!i(t))return new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);var r=e[1],n=e[2],o=e[3],a=e[6],s=e[7],l=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=l,t[15]=e[15],t},u.abs=function(e,t){return i(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t):new u(Math.abs(e[0]),Math.abs(e[4]),Math.abs(e[8]),Math.abs(e[12]),Math.abs(e[1]),Math.abs(e[5]),Math.abs(e[9]),Math.abs(e[13]),Math.abs(e[2]),Math.abs(e[6]),Math.abs(e[10]),Math.abs(e[14]),Math.abs(e[3]),Math.abs(e[7]),Math.abs(e[11]),Math.abs(e[15]))},u.equals=function(e,t){return e===t||i(e)&&i(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]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},u.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(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&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},u.getTranslation=function(t,r){return i(r)?(r.x=t[12],r.y=t[13],r.z=t[14],r):new e(t[12],t[13],t[14])},u.getRotation=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t):new s(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10])},u.inverse=function(e,t){var r=e[0],n=e[4],o=e[8],s=e[12],c=e[1],h=e[5],d=e[9],m=e[13],p=e[2],f=e[6],v=e[10],y=e[14],g=e[3],_=e[7],w=e[11],C=e[15],x=v*C,S=y*w,E=f*C,b=y*_,T=f*w,A=v*_,D=p*C,P=y*g,M=p*w,I=v*g,O=p*_,R=f*g,L=x*h+b*d+T*m-(S*h+E*d+A*m),z=S*c+D*d+I*m-(x*c+P*d+M*m),N=E*c+P*h+O*m-(b*c+D*h+R*m),B=A*c+M*h+R*d-(T*c+I*h+O*d),F=S*n+E*o+A*s-(x*n+b*o+T*s),V=x*r+P*o+M*s-(S*r+D*o+I*s),k=b*r+D*n+R*s-(E*r+P*n+O*s),U=T*r+I*n+O*o-(A*r+M*n+R*o);x=o*m,S=s*d,E=n*m,b=s*h,T=n*d,A=o*h,D=r*m,P=s*c,M=r*d,I=o*c,O=r*h,R=n*c;var W=x*_+b*w+T*C-(S*_+E*w+A*C),q=S*g+D*w+I*C-(x*g+P*w+M*C),G=E*g+P*_+O*C-(b*g+D*_+R*C),H=A*g+M*_+R*w-(T*g+I*_+O*w),j=E*v+A*y+S*f-(T*y+x*f+b*v),Y=M*y+x*p+P*v-(D*v+I*y+S*p),X=D*f+R*y+b*p-(O*y+E*p+P*f),Z=O*v+T*p+I*f-(M*f+R*v+A*p),J=r*L+n*z+o*N+s*B;if(Math.abs(J)b;b++){i.clone(e[b],n);var T=n.x,A=n.y,D=n.z;Tl.x&&i.clone(n,l),Au.y&&i.clone(n,u),Dc.z&&i.clone(n,c)}var P=i.magnitudeSquared(i.subtract(l,o,_)),M=i.magnitudeSquared(i.subtract(u,a,_)),I=i.magnitudeSquared(i.subtract(c,s,_)),O=o,R=l,L=P;M>L&&(L=M,O=a,R=u),I>L&&(L=I,O=s,R=c);var z=w;z.x=.5*(O.x+R.x),z.y=.5*(O.y+R.y),z.z=.5*(O.z+R.z);var N=i.magnitudeSquared(i.subtract(R,z,_)),B=Math.sqrt(N),F=C;F.x=o.x,F.y=a.y,F.z=s.z;var V=x;V.x=l.x,V.y=u.y,V.z=c.z;var k=i.multiplyByScalar(i.add(F,V,_),.5,S),U=0;for(b=0;E>b;b++){i.clone(e[b],n);var W=i.magnitude(i.subtract(n,k,_));W>U&&(U=W);var q=i.magnitudeSquared(i.subtract(n,z,_));if(q>N){var G=Math.sqrt(q);B=.5*(B+G),N=B*B;var H=G-B;z.x=(B*z.x+H*n.x)/G,z.y=(B*z.y+H*n.y)/G,z.z=(B*z.z+H*n.z)/G}}return U>B?(i.clone(z,r.center),r.radius=B):(i.clone(k,r.center),r.radius=U),r};var E=new s,b=new i,T=new i,A=new o,D=new o;h.fromExtent2D=function(e,t,r){return h.fromExtentWithHeights2D(e,t,0,0,r)},h.fromExtentWithHeights2D=function(r,n,o,a,s){if(t(s)||(s=new h),!t(r))return s.center=i.clone(i.ZERO,s.center),s.radius=0,s;n=e(n,E),r.getSouthwest(A),A.height=o,r.getNortheast(D),D.height=a;var l=n.project(A,b),u=n.project(D,T),c=u.x-l.x,d=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(c*c+d*d+m*m);var p=s.center;return p.x=l.x+.5*c,p.y=l.y+.5*d,p.z=l.z+.5*m,s};var P=[];h.fromExtent3D=function(r,i,n,o){i=e(i,a.WGS84),n=e(n,0);var s;return t(r)&&(s=r.subsample(i,n,P)),h.fromPoints(s,o)},h.fromVertices=function(r,n,o,a){if(t(a)||(a=new h),!t(r)||0===r.length)return a.center=i.clone(i.ZERO,a.center),a.radius=0,a;n=e(n,i.ZERO),o=e(o,3);var s=g;s.x=r[0]+n.x,s.y=r[1]+n.y,s.z=r[2]+n.z;for(var l=i.clone(s,d),u=i.clone(s,m),c=i.clone(s,p),E=i.clone(s,f),b=i.clone(s,v),T=i.clone(s,y),A=r.length,D=0;A>D;D+=o){var P=r[D]+n.x,M=r[D+1]+n.y,I=r[D+2]+n.z;s.x=P,s.y=M,s.z=I,PE.x&&i.clone(s,E),Mb.y&&i.clone(s,b),IT.z&&i.clone(s,T)}var O=i.magnitudeSquared(i.subtract(E,l,_)),R=i.magnitudeSquared(i.subtract(b,u,_)),L=i.magnitudeSquared(i.subtract(T,c,_)),z=l,N=E,B=O;R>B&&(B=R,z=u,N=b),L>B&&(B=L,z=c,N=T);var F=w;F.x=.5*(z.x+N.x),F.y=.5*(z.y+N.y),F.z=.5*(z.z+N.z);var V=i.magnitudeSquared(i.subtract(N,F,_)),k=Math.sqrt(V),U=C;U.x=l.x,U.y=u.y,U.z=c.z;var W=x;W.x=E.x,W.y=b.y,W.z=T.z;var q=i.multiplyByScalar(i.add(U,W,_),.5,S),G=0;for(D=0;A>D;D+=o){s.x=r[D]+n.x,s.y=r[D+1]+n.y,s.z=r[D+2]+n.z;var H=i.magnitude(i.subtract(s,q,_));H>G&&(G=H);var j=i.magnitudeSquared(i.subtract(s,F,_));if(j>V){var Y=Math.sqrt(j);k=.5*(k+Y),V=k*k;var X=Y-k;F.x=(k*F.x+X*s.x)/Y,F.y=(k*F.y+X*s.y)/Y,F.z=(k*F.z+X*s.z)/Y}}return G>k?(i.clone(F,a.center),a.radius=k):(i.clone(q,a.center),a.radius=G),a},h.fromCornerPoints=function(e,r,n){t(n)||(n=new h);var o=n.center;return i.add(e,r,o),i.multiplyByScalar(o,.5,o),n.radius=i.distance(o,r),n},h.fromEllipsoid=function(e,r){return t(r)||(r=new h),i.clone(i.ZERO,r.center),r.radius=e.getMaximumRadius(),r},h.clone=function(e,r){return t(e)?t(r)?(r.center=i.clone(e.center,r.center),r.radius=e.radius,r):new h(e.center,e.radius):void 0};var M=new i,I=new i;h.union=function(e,r,n){t(n)||(n=new h);var o=e.center,a=r.center;i.add(o,a,I);var s=i.multiplyByScalar(I,.5,I),l=i.magnitude(i.subtract(o,s,M))+e.radius,u=i.magnitude(i.subtract(a,s,M))+r.radius;return n.radius=Math.max(l,u),i.clone(s,n.center),n};var O=new i;h.expand=function(e,t,r){r=h.clone(e,r);var n=i.magnitude(i.subtract(t,r.center,O));return n>r.radius&&(r.radius=n),r},h.intersect=function(e,t){var r=e.center,n=e.radius,o=i.dot(t,r)+t.w;return-n>o?l.OUTSIDE:n>o?l.INTERSECTING:l.INSIDE};var R=new i;h.transform=function(e,r,n){return t(n)||(n=new h),n.center=c.multiplyByPoint(r,e.center,n.center),n.radius=Math.max(i.magnitude(c.getColumn(r,0,R)),i.magnitude(c.getColumn(r,1,R)),i.magnitude(c.getColumn(r,2,R)))*e.radius,n},h.transformWithoutScale=function(e,r,i){return t(i)||(i=new h),i.center=c.multiplyByPoint(r,e.center,i.center),i.radius=e.radius,i};var L=new i;h.getPlaneDistances=function(e,r,n,o){t(o)||(o=new u);var a=i.subtract(e.center,r,L),s=i.multiplyByScalar(n,i.dot(n,a),L),l=i.magnitude(s);return o.start=l-e.radius,o.stop=l+e.radius,o};for(var z=new i,N=new i,B=new i,F=new i,V=new i,k=new o,U=new Array(8),W=0;8>W;++W)U[W]=new i;var q=new s;return h.projectTo2D=function(t,r,n){r=e(r,q);var o=r.getEllipsoid(),a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,z),u=i.cross(i.UNIT_Z,l,N);i.normalize(u,u);var c=i.cross(l,u,B);i.normalize(c,c),i.multiplyByScalar(l,s,l),i.multiplyByScalar(c,s,c),i.multiplyByScalar(u,s,u);var d=i.negate(c,V),m=i.negate(u,F),p=U,f=p[0];i.add(l,c,f),i.add(f,u,f),f=p[1],i.add(l,c,f),i.add(f,m,f),f=p[2],i.add(l,d,f),i.add(f,m,f),f=p[3],i.add(l,d,f),i.add(f,u,f),i.negate(l,l),f=p[4],i.add(l,c,f),i.add(f,u,f),f=p[5],i.add(l,c,f),i.add(f,m,f),f=p[6],i.add(l,d,f),i.add(f,m,f),f=p[7],i.add(l,d,f),i.add(f,u,f);for(var v=p.length,y=0;v>y;++y){var g=p[y];i.add(a,g,g);var _=o.cartesianToCartographic(g,k);r.project(_,g)}n=h.fromPoints(p,n),a=n.center;var w=a.x,C=a.y,x=a.z;return a.x=x,a.y=w,a.z=C,n},h.equals=function(e,r){return e===r||t(e)&&t(r)&&i.equals(e.center,r.center)&&e.radius===r.radius},h.prototype.clone=function(e){return h.clone(this,e)},h.prototype.union=function(e,t){return h.union(this,e,t)},h.prototype.expand=function(e,t){return h.expand(this,e,t)},h.prototype.intersect=function(e){return h.intersect(this,e)},h.prototype.getPlaneDistances=function(e,t,r){return h.getPlaneDistances(this,e,t,r)},h.prototype.projectTo2D=function(e,t){return h.projectTo2D(this,e,t)},h.prototype.equals=function(e){return h.equals(this,e)},h}),r("Core/Fullscreen",["./defined"],function(e){"use strict";var t,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return i.supportsFullscreen=function(){if(e(t))return t;t=!1;var i=document.body;if("function"==typeof i.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",t=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;s>a;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof i[n]?(r.requestFullscreen=n,t=!0):(n=l+"RequestFullScreen","function"==typeof i[n]&&(r.requestFullscreen=n,t=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",e(document[n])?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?r.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(r.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return t},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[r.requestFullscreen]()},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i.isFullscreenEnabled=function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0},i.getFullscreenElement=function(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0},i.isFullscreen=function(){return i.supportsFullscreen()?null!==i.getFullscreenElement():void 0},i.getFullscreenChangeEventName=function(){return i.supportsFullscreen()?r.fullscreenchange:void 0},i.getFullscreenErrorEventName=function(){return i.supportsFullscreen()?r.fullscreenerror:void 0},i}),r("Core/FeatureDetection",["./defined","./Fullscreen"],function(e,t){"use strict";function r(e){for(var t=e.split("."),r=0,i=t.length;i>r;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!e(h)){var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null===t?h=!1:(h=!0,d=r(t[1]))}return h}function n(){return i()&&d}function o(){if(!e(m))if(i()||!/ Safari\/[\.0-9]+/.test(navigator.userAgent))m=!1;else{var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null===t?m=!1:(m=!0,p=r(t[1]))}return m}function a(){return o()&&p}function s(){if(!e(f)){var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null===t?f=!1:(f=!0,v=r(t[1]),v.isNightly=!!t[2])}return f}function l(){return s()&&v}function u(){if(!e(y)){var t=/ MSIE ([\.0-9]+)/.exec(navigator.userAgent);null===t?y=!1:(y=!0,g=r(t[1]))}return y}function c(){return u()&&g}var h,d,m,p,f,v,y,g,_,w={isChrome:i,chromeVersion:n,isSafari:o,safariVersion:a,isWebkit:s,webkitVersion:l,isInternetExplorer:u,internetExplorerVersion:c};return w.supportsCrossOriginImagery=function(){return e(_)||(_=o()&&l()[0]<536?!1:"withCredentials"in new XMLHttpRequest),_},w.supportsFullscreen=function(){return t.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w}),r("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./Enumeration"],function(e,t,r,i,n){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:new n(5120,"BYTE",{sizeInBytes:Int8Array.BYTES_PER_ELEMENT}),UNSIGNED_BYTE:new n(5121,"UNSIGNED_BYTE",{sizeInBytes:Uint8Array.BYTES_PER_ELEMENT}),SHORT:new n(5122,"SHORT",{sizeInBytes:Int16Array.BYTES_PER_ELEMENT}),UNSIGNED_SHORT:new n(5123,"UNSIGNED_SHORT",{sizeInBytes:Uint16Array.BYTES_PER_ELEMENT}),FLOAT:new n(5126,"FLOAT",{sizeInBytes:Float32Array.BYTES_PER_ELEMENT}),DOUBLE:new n(5130,"DOUBLE",{sizeInBytes:Float64Array.BYTES_PER_ELEMENT})};return o.validate=function(e){return t(e)&&t(e.value)&&(e.value===o.BYTE.value||e.value===o.UNSIGNED_BYTE.value||e.value===o.SHORT.value||e.value===o.UNSIGNED_SHORT.value||e.value===o.FLOAT.value||e.value===o.DOUBLE.value)},o.createTypedArray=function(e,i){if(!t(e))throw new r("componentDatatype is required.");if(!t(i))throw new r("valuesOrLength is required.");switch(e.value){case o.BYTE.value:return new Int8Array(i);case o.UNSIGNED_BYTE.value:return new Uint8Array(i);case o.SHORT.value:return new Int16Array(i);case o.UNSIGNED_SHORT.value:return new Uint16Array(i);case o.FLOAT.value:return new Float32Array(i);case o.DOUBLE.value:return new Float64Array(i);default:throw new r("componentDatatype is not a valid enumeration value.")}},o.createArrayBufferView=function(i,n,a,s){if(!t(i))throw new r("componentDatatype is required.");if(!t(n))throw new r("buffer is required.");switch(a=e(a,0),s=e(s,(n.byteLength-a)/i.sizeInBytes),i.value){case o.BYTE.value:return new Int8Array(n,a,s);case o.UNSIGNED_BYTE.value:return new Uint8Array(n,a,s);case o.SHORT.value:return new Int16Array(n,a,s);case o.UNSIGNED_SHORT.value:return new Uint16Array(n,a,s);case o.FLOAT.value:return new Float32Array(n,a,s);case o.DOUBLE.value:return new Float64Array(n,a,s);default:throw new r("componentDatatype is not a valid enumeration value.")}},o}),r("Core/PrimitiveType",[],function(){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return e}),r("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(i){if(i=e(i,e.EMPTY_OBJECT),!t(i.componentDatatype))throw new r("options.componentDatatype is required.");if(!t(i.componentsPerAttribute))throw new r("options.componentsPerAttribute is required.");if(i.componentsPerAttribute<1||i.componentsPerAttribute>4)throw new r("options.componentsPerAttribute must be between 1 and 4.");if(!t(i.values))throw new r("options.values is required.");this.componentDatatype=i.componentDatatype,this.componentsPerAttribute=i.componentsPerAttribute,this.normalize=e(i.normalize,!1),this.values=i.values};return i}),r("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color};return t}),r("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1)};return r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),r("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./BoundingSphere"],function(e,t,r){"use strict";var i=function(i){if(i=e(i,e.EMPTY_OBJECT),!t(i.attributes))throw new r("options.attributes is required.");if(!t(i.primitiveType))throw new r("options.primitiveType is required.");this.attributes=i.attributes,this.indices=i.indices,this.primitiveType=i.primitiveType,this.boundingSphere=i.boundingSphere};return i.computeNumberOfVertices=function(e){if(!t(e))throw new r("geometry is required.");var i=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(i!==a&&-1!==i)throw new r("All attribute lists must have the same number of attributes.");i=a}return i},i}),r("Core/BoxGeometry",["./defined","./DeveloperError","./Cartesian3","./ComponentDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./GeometryAttribute","./GeometryAttributes","./VertexFormat","./Geometry"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=new r,d=function(i){i=o(i,o.EMPTY_OBJECT);var n=i.minimumCorner,a=i.maximumCorner;if(!e(n))throw new t("options.minimumCorner is required.");if(!e(a))throw new t("options.maximumCorner is required");var s=o(i.vertexFormat,u.DEFAULT);this._minimumCorner=r.clone(n),this._maximumCorner=r.clone(a),this._vertexFormat=s,this._workerName="createBoxGeometry"};return d.fromDimensions=function(i){i=o(i,o.EMPTY_OBJECT);var n=i.dimensions;if(!e(n))throw new t("options.dimensions is required.");if(n.x<0||n.y<0||n.z<0)throw new t("All dimensions components must be greater than or equal to zero.");var a=r.multiplyByScalar(n,.5),s=r.negate(a),l=a,u={minimumCorner:s,maximumCorner:l,vertexFormat:i.vertexFormat};return new d(u)},d.createGeometry=function(e){var t,o,u=e._minimumCorner,d=e._maximumCorner,m=e._vertexFormat,p=new l;if(m.position&&(m.st||m.normal||m.binormal||m.tangent)){if(m.position&&(o=new Float64Array(72),o[0]=u.x,o[1]=u.y,o[2]=d.z,o[3]=d.x,o[4]=u.y,o[5]=d.z,o[6]=d.x,o[7]=d.y,o[8]=d.z,o[9]=u.x,o[10]=d.y,o[11]=d.z,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=d.x,o[16]=u.y,o[17]=u.z,o[18]=d.x,o[19]=d.y,o[20]=u.z,o[21]=u.x,o[22]=d.y,o[23]=u.z,o[24]=d.x,o[25]=u.y,o[26]=u.z,o[27]=d.x,o[28]=d.y,o[29]=u.z,o[30]=d.x,o[31]=d.y,o[32]=d.z,o[33]=d.x,o[34]=u.y,o[35]=d.z,o[36]=u.x,o[37]=u.y,o[38]=u.z,o[39]=u.x,o[40]=d.y,o[41]=u.z,o[42]=u.x,o[43]=d.y,o[44]=d.z,o[45]=u.x,o[46]=u.y,o[47]=d.z,o[48]=u.x,o[49]=d.y,o[50]=u.z,o[51]=d.x,o[52]=d.y,o[53]=u.z,o[54]=d.x,o[55]=d.y,o[56]=d.z,o[57]=u.x,o[58]=d.y,o[59]=d.z,o[60]=u.x,o[61]=u.y,o[62]=u.z,o[63]=d.x,o[64]=u.y,o[65]=u.z,o[66]=d.x,o[67]=u.y,o[68]=d.z,o[69]=u.x,o[70]=u.y,o[71]=d.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o})),m.normal){var f=new Float32Array(72); -f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,p.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})}if(m.st){var v=new Float32Array(48);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=1,v[5]=1,v[6]=0,v[7]=1,v[8]=1,v[9]=0,v[10]=0,v[11]=0,v[12]=0,v[13]=1,v[14]=1,v[15]=1,v[16]=0,v[17]=0,v[18]=1,v[19]=0,v[20]=1,v[21]=1,v[22]=0,v[23]=1,v[24]=1,v[25]=0,v[26]=0,v[27]=0,v[28]=0,v[29]=1,v[30]=1,v[31]=1,v[32]=1,v[33]=0,v[34]=0,v[35]=0,v[36]=0,v[37]=1,v[38]=1,v[39]=1,v[40]=0,v[41]=0,v[42]=1,v[43]=0,v[44]=1,v[45]=1,v[46]=0,v[47]=1,p.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:v})}if(m.tangent){var y=new Float32Array(72);y[0]=1,y[1]=0,y[2]=0,y[3]=1,y[4]=0,y[5]=0,y[6]=1,y[7]=0,y[8]=0,y[9]=1,y[10]=0,y[11]=0,y[12]=-1,y[13]=0,y[14]=0,y[15]=-1,y[16]=0,y[17]=0,y[18]=-1,y[19]=0,y[20]=0,y[21]=-1,y[22]=0,y[23]=0,y[24]=0,y[25]=1,y[26]=0,y[27]=0,y[28]=1,y[29]=0,y[30]=0,y[31]=1,y[32]=0,y[33]=0,y[34]=1,y[35]=0,y[36]=0,y[37]=-1,y[38]=0,y[39]=0,y[40]=-1,y[41]=0,y[42]=0,y[43]=-1,y[44]=0,y[45]=0,y[46]=-1,y[47]=0,y[48]=-1,y[49]=0,y[50]=0,y[51]=-1,y[52]=0,y[53]=0,y[54]=-1,y[55]=0,y[56]=0,y[57]=-1,y[58]=0,y[59]=0,y[60]=1,y[61]=0,y[62]=0,y[63]=1,y[64]=0,y[65]=0,y[66]=1,y[67]=0,y[68]=0,y[69]=1,y[70]=0,y[71]=0,p.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:y})}if(m.binormal){var g=new Float32Array(72);g[0]=0,g[1]=1,g[2]=0,g[3]=0,g[4]=1,g[5]=0,g[6]=0,g[7]=1,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=1,g[14]=0,g[15]=0,g[16]=1,g[17]=0,g[18]=0,g[19]=1,g[20]=0,g[21]=0,g[22]=1,g[23]=0,g[24]=0,g[25]=0,g[26]=1,g[27]=0,g[28]=0,g[29]=1,g[30]=0,g[31]=0,g[32]=1,g[33]=0,g[34]=0,g[35]=1,g[36]=0,g[37]=0,g[38]=1,g[39]=0,g[40]=0,g[41]=1,g[42]=0,g[43]=0,g[44]=1,g[45]=0,g[46]=0,g[47]=1,g[48]=0,g[49]=0,g[50]=1,g[51]=0,g[52]=0,g[53]=1,g[54]=0,g[55]=0,g[56]=1,g[57]=0,g[58]=0,g[59]=1,g[60]=0,g[61]=0,g[62]=1,g[63]=0,g[64]=0,g[65]=1,g[66]=0,g[67]=0,g[68]=1,g[69]=0,g[70]=0,g[71]=1,p.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}t=new Uint16Array(36),t[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3,t[6]=6,t[7]=5,t[8]=4,t[9]=7,t[10]=6,t[11]=4,t[12]=8,t[13]=9,t[14]=10,t[15]=8,t[16]=10,t[17]=11,t[18]=14,t[19]=13,t[20]=12,t[21]=15,t[22]=14,t[23]=12,t[24]=18,t[25]=17,t[26]=16,t[27]=19,t[28]=18,t[29]=16,t[30]=20,t[31]=21,t[32]=22,t[33]=20,t[34]=22,t[35]=23}else o=new Float64Array(24),o[0]=u.x,o[1]=u.y,o[2]=u.z,o[3]=d.x,o[4]=u.y,o[5]=u.z,o[6]=d.x,o[7]=d.y,o[8]=u.z,o[9]=u.x,o[10]=d.y,o[11]=u.z,o[12]=u.x,o[13]=u.y,o[14]=d.z,o[15]=d.x,o[16]=u.y,o[17]=d.z,o[18]=d.x,o[19]=d.y,o[20]=d.z,o[21]=u.x,o[22]=d.y,o[23]=d.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),t=new Uint16Array(36),t[0]=4,t[1]=5,t[2]=6,t[3]=4,t[4]=6,t[5]=7,t[6]=1,t[7]=0,t[8]=3,t[9]=1,t[10]=3,t[11]=2,t[12]=1,t[13]=6,t[14]=5,t[15]=1,t[16]=2,t[17]=6,t[18]=2,t[19]=3,t[20]=7,t[21]=2,t[22]=7,t[23]=6,t[24]=3,t[25]=0,t[26]=4,t[27]=3,t[28]=4,t[29]=7,t[30]=0,t[31]=1,t[32]=5,t[33]=0,t[34]=5,t[35]=4;var _=r.subtract(d,u,h),w=.5*r.magnitude(_);return new c({attributes:p,indices:t,primitiveType:n.TRIANGLES,boundingSphere:new a(r.ZERO,w)})},d}),r("Core/BoxOutlineGeometry",["./defined","./DeveloperError","./Cartesian3","./ComponentDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=new r,h=function(i){i=o(i,o.EMPTY_OBJECT);var n=i.minimumCorner,a=i.maximumCorner;if(!e(n))throw new t("options.minimumCorner is required.");if(!e(a))throw new t("options.maximumCorner is required");this._min=r.clone(n),this._max=r.clone(a),this._workerName="createBoxOutlineGeometry"};return h.fromDimensions=function(i){i=o(i,o.EMPTY_OBJECT);var n=i.dimensions;if(!e(n))throw new t("options.dimensions is required.");if(n.x<0||n.y<0||n.z<0)throw new t("All dimensions components must be greater than or equal to zero.");var a=r.multiplyByScalar(n,.5),s=r.negate(a),l=a,u={minimumCorner:s,maximumCorner:l};return new h(u)},h.createGeometry=function(e){var t=e._min,o=e._max,h=new u,d=new Uint16Array(24),m=new Float64Array(24);m[0]=t.x,m[1]=t.y,m[2]=t.z,m[3]=o.x,m[4]=t.y,m[5]=t.z,m[6]=o.x,m[7]=o.y,m[8]=t.z,m[9]=t.x,m[10]=o.y,m[11]=t.z,m[12]=t.x,m[13]=t.y,m[14]=o.z,m[15]=o.x,m[16]=t.y,m[17]=o.z,m[18]=o.x,m[19]=o.y,m[20]=o.z,m[21]=t.x,m[22]=o.y,m[23]=o.z,h.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var p=r.subtract(o,t,c),f=.5*r.magnitude(p);return new s({attributes:h,indices:d,primitiveType:n.LINES,boundingSphere:new a(r.ZERO,f)})},h}),r("Core/Spline",["../Core/defaultValue","../Core/defined","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(){throw this.times=void 0,this.points=void 0,new r("This type should not be instantiated directly.")};return i.prototype.evaluate=function(){throw new r("This type should not be instantiated directly.")},i.prototype.findTimeInterval=function(i,n){if(!t(i))throw new r("time is required.");var o=this.times,a=o.length;if(io[a-1])throw new r("time is out of range.");if(n=e(n,0),i>=o[n]){if(a>n+1&&in+2&&i=0&&i>=o[n-1])return n-1;var s;if(i>o[n])for(s=n;a-1>s&&!(i>=o[s]&&i=0&&!(i>=o[s]&&i=0;--h)u[h]=r.subtract(l[h],r.multiplyByScalar(u[h+1],s[h]));return u},i}),r("Core/HermiteSpline",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./Matrix4","./Cartesian4","./Spline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r,n){var o=h,a=m,l=d,u=p;o.length=a.length=e.length-1,l.length=u.length=e.length;var c;o[0]=l[0]=1,a[0]=0;var f=u[0];for(t(f)||(f=u[0]=new i),i.clone(r,f),c=1;c2&&(t(s)||(s=d,n.multiplyByScalar(o[1],2,s),n.subtract(s,o[2],s),n.subtract(s,o[0],s),n.multiplyByScalar(s,.5,s)),!t(u))){var c=o.length-1;u=m,n.multiplyByScalar(o[c-1],2,u),n.subtract(o[c],u,u),n.add(u,o[c-2],u),n.multiplyByScalar(u,.5,u)}this.times=a,this.points=o,this.firstTangent=n.clone(s),this.lastTangent=n.clone(u),this._evaluateFunction=l(this),this._lastTimeIndex=0};return p.catmullRomCoefficientMatrix=new i(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),p.prototype.findTimeInterval=a.prototype.findTimeInterval,p.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},p}),r("Core/IndexDatatype",["./defined","./DeveloperError","./Math"],function(e,t,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(i,n){if(!e(i))throw new t("numberOfVertices is required.");return i>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)},i}),r("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3"],function(e,t,r,i,n,o,a){"use strict";var s,l=function(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)};l.fromAxisAngle=function(t,i,n){var o=i/2,a=Math.sin(o);s=e.normalize(t,s);var u=s.x*a,c=s.y*a,h=s.z*a,d=Math.cos(o);return r(n)?(n.x=u,n.y=c,n.z=h,n.w=d,n):new l(u,c,h,d)};var u=[1,2,0],c=new Array(3);l.fromRotationMatrix=function(e,t){var i,n,o,s,h,d=e[a.COLUMN0ROW0],m=e[a.COLUMN1ROW1],p=e[a.COLUMN2ROW2],f=d+m+p;if(f>0)i=Math.sqrt(f+1),h=.5*i,i=.5/i,n=(e[a.COLUMN1ROW2]-e[a.COLUMN2ROW1])*i,o=(e[a.COLUMN2ROW0]-e[a.COLUMN0ROW2])*i,s=(e[a.COLUMN0ROW1]-e[a.COLUMN1ROW0])*i;else{var v=u,y=0;m>d&&(y=1),p>d&&p>m&&(y=2);var g=v[y],_=v[g];i=Math.sqrt(e[a.getElementIndex(y,y)]-e[a.getElementIndex(g,g)]-e[a.getElementIndex(_,_)]+1);var w=c;w[y]=.5*i,i=.5/i,h=(e[a.getElementIndex(_,g)]-e[a.getElementIndex(g,_)])*i,w[g]=(e[a.getElementIndex(g,y)]+e[a.getElementIndex(y,g)])*i,w[_]=(e[a.getElementIndex(_,y)]+e[a.getElementIndex(y,_)])*i,n=-w[0],o=-w[1],s=-w[2]}return r(t)?(t.x=n,t.y=o,t.z=s,t.w=h,t):new l(n,o,s,h)};var h=new e,d=new e,m=new l,p=new l,f=new l;l.packedLength=4,l.pack=function(e,r,i){i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w},l.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new l),n.x=e[i],n.y=e[i+1],n.z=e[i+2],n.w=e[i+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,i){l.unpack(e,4*r,f),l.conjugate(f,f);for(var n=0,o=r-t+1;o>n;n++){var a=3*n;l.unpack(e,4*(t+n),m),l.multiply(m,f,m),m.w<0&&l.negate(m,m),l.getAxis(m,h);var s=l.getAngle(m);i[a]=h.x*s,i[a+1]=h.y*s,i[a+2]=h.z*s}},l.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new l),e.fromArray(t,0,d);var s=e.magnitude(d);return l.unpack(i,4*o,p),0===s?l.clone(l.IDENTITY,m):l.fromAxisAngle(d,s,m),l.multiply(m,p,a)},l.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w):void 0},l.conjugate=function(e,t){return r(t)?(t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t):new l(-e.x,-e.y,-e.z,e.w)},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var i=1/l.magnitude(e),n=e.x*i,o=e.y*i,a=e.z*i,s=e.w*i;return r(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new l(n,o,a,s)},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,i){return r(i)?(i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i):new l(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w)},l.subtract=function(e,t,i){return r(i)?(i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i):new l(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w)},l.negate=function(e,t){return r(t)?(t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t):new l(-e.x,-e.y,-e.z,-e.w)},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,i){var n=e.x,o=e.y,a=e.z,s=e.w,u=t.x,c=t.y,h=t.z,d=t.w,m=s*u+n*d+o*h-a*c,p=s*c-n*h+o*d+a*u,f=s*h+n*c-o*u+a*d,v=s*d-n*u-o*c-a*h;return r(i)?(i.x=m,i.y=p,i.z=f,i.w=v,i):new l(m,p,f,v)},l.multiplyByScalar=function(e,t,i){return r(i)?(i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i):new l(e.x*t,e.y*t,e.z*t,e.w*t)},l.divideByScalar=function(e,t,i){return r(i)?(i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i):new l(e.x/t,e.y/t,e.z/t,e.w/t)},l.getAxis=function(t,i){var n=t.w;if(Math.abs(n-1)n&&(n=-n,a=y=l.negate(t,y)),1-nv;v+=3){var y,g=v+1,_=v+2,w=e.fromArray(t,v,h);w=n.scaleToGeodeticSurface(w,w),y=e.clone(w,d),u=n.geodeticSurfaceNormal(w,u);var C=e.multiplyByScalar(u,o,m);w=e.add(w,C,w),i&&(C=e.multiplyByScalar(u,a,C),y=e.add(y,C,y),l[v+f]=y.x,l[g+f]=y.y,l[_+f]=y.z),l[v]=w.x,l[g]=w.y,l[_]=w.z}return l};var f=new e,v=new e,y=new e;return a.computeEllipsePositions=function(t,i,n){var a=t.semiMinorAxis,s=t.semiMajorAxis,l=t.rotation,u=t.center,c=t.granularity,p=2.31,g=a*a,_=s*s,w=s*a,C=e.magnitude(u),x=e.normalize(u,f),S=e.cross(e.UNIT_Z,u,v);S=e.normalize(S,S);var E,b,T,A,D,P=e.cross(x,S,y),M=1+Math.ceil(r.PI_OVER_TWO/c),I=p/(M-1),O=2*M*(M+1),R=i?new Array(3*O):void 0,L=0,z=h,N=d,B=n?[]:void 0,F=n?[]:void 0,V=r.PI_OVER_TWO;for(E=0;M>E&&V>0;++E){if(z=o(V,l,P,S,g,w,_,C,x,z),N=o(Math.PI-V,l,P,S,g,w,_,C,x,N),i){for(R[L++]=z.x,R[L++]=z.y,R[L++]=z.z,T=2*E+2,b=1;T-1>b;++b)A=b/(T-1),D=e.lerp(z,N,A,m),R[L++]=D.x,R[L++]=D.y,R[L++]=D.z;R[L++]=N.x,R[L++]=N.y,R[L++]=N.z}n&&(F.unshift(z.x,z.y,z.z),0!==E&&B.push(N.x,N.y,N.z)),V=r.PI_OVER_TWO-(E+1)*I}for(M=E,E=M;E>0;--E){if(V=r.PI_OVER_TWO-(E-1)*I,z=o(-V,l,P,S,g,w,_,C,x,z),N=o(V+Math.PI,l,P,S,g,w,_,C,x,N),i){for(R[L++]=z.x,R[L++]=z.y,R[L++]=z.z,T=2*(E-1)+2,b=1;T-1>b;++b)A=b/(T-1),D=e.lerp(z,N,A,m),R[L++]=D.x,R[L++]=D.y,R[L++]=D.z;R[L++]=N.x,R[L++]=N.y,R[L++]=N.z}n&&(F.unshift(z.x,z.y,z.z),1!==E&&B.push(N.x,N.y,N.z))}var k={};return i&&(R.length!==L&&(O=L/3,R.length=L),k.positions=R,k.numPts=M),n&&(k.outerPositions=F.concat(B)),k},a}),r("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,i){"use strict";var n=new t,o=new t,a=new t,s=function(s,l,u,c,h){if(!(r(s)&&r(l)&&r(u)&&r(c)))throw new i("point, p0, p1, and p2 are required.");r(h)||(h=new t);var d,m,p,f,v,y,g,_;r(l.z)?(d=t.subtract(u,l,n),m=t.subtract(c,l,o),p=t.subtract(s,l,a),f=t.dot(d,d),v=t.dot(d,m),y=t.dot(d,p),g=t.dot(m,m),_=t.dot(m,p)):(d=e.subtract(u,l,n),m=e.subtract(c,l,o),p=e.subtract(s,l,a),f=e.dot(d,d),v=e.dot(d,m),y=e.dot(d,p),g=e.dot(m,m),_=e.dot(m,p));var w=1/(f*g-v*v);return h.y=(g*y-v*_)*w,h.z=(f*_-v*y)*w,h.x=1-h.y-h.z,h};return s}),r("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};i.encode=function(e,i){if(!t(e))throw new r("value is required");t(i)||(i={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),i.high=n,i.low=e-n):(n=65536*Math.floor(-e/65536),i.high=-n,i.low=e+n),i};var n={high:0,low:0};i.fromCartesian=function(e,o){if(!t(e))throw new r("cartesian is required");t(o)||(o=new i);var a=o.high,s=o.low;return i.encode(e.x,n),a.x=n.high,s.x=n.low,i.encode(e.y,n),a.y=n.high,s.y=n.low,i.encode(e.z,n),a.z=n.high,s.z=n.low,o};var o=new i;return i.writeElements=function(e,n,a){if(!t(e))throw new r("cartesian is required");if(!t(n))throw new r("cartesianArray is required");if("number"!=typeof a||0>a)throw new r("index must be a number greater than or equal to 0.");i.fromCartesian(e,o);var s=o.high,l=o.low;n[a]=s.x,n[a+1]=s.y,n[a+2]=s.z,n[a+3]=l.x,n[a+4]=l.y,n[a+5]=l.z},i}),r("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,i){var n=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))s&&s/ll&&l/sa)return[];var u=Math.sqrt(a);return[-u,u]}if(0===o)return a=-n/i,0>a?[a,0]:[0,a];var c=n*n,h=4*i*o,d=r(c,-h,t.EPSILON14);if(0>d)return[];var m=-.5*r(n,t.sign(n)*Math.sqrt(d),t.EPSILON14);return n>0?[m/i,o/m]:[o/m,m/i]},i}),r("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,h=s*u,d=s*s,m=l*l,p=a*l-d,f=a*u-s*l,v=s*u-m,y=4*p*v-f*f;if(0>y){var g,_,w;d*h>=c*m?(g=a,_=p,w=-2*s*p+a*f):(g=u,_=v,w=-u*f+2*l*v);var C=0>w?-1:1,x=-C*Math.abs(g)*Math.sqrt(-y);o=-w+x;var S=o/2,E=0>S?-Math.pow(-S,1/3):Math.pow(S,1/3),b=o===x?-E:-_/E;return n=0>=_?E+b:-w/(E*E+b*b+_),d*h>=c*m?[(n-s)/a]:[-u/(n+l)]}var T=p,A=-2*s*p+a*f,D=v,P=-u*f+2*l*v,M=Math.sqrt(y),I=Math.sqrt(3)/2,O=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-T);var R=Math.cos(O);o=n*R;var L=n*(-R/2-I*Math.sin(O)),z=o+L>2*s?o-s:L-s,N=a,B=z/N;O=Math.abs(Math.atan2(u*M,-P)/3),n=2*Math.sqrt(-D),R=Math.cos(O),o=n*R,L=n*(-R/2-I*Math.sin(O));var F=-u,V=2*l>o+L?o+l:L+l,k=F/V,U=N*V,W=-z*V-N*F,q=z*F,G=(l*W-s*q)/(-s*W+l*U);return G>=B?k>=B?k>=G?[B,G,k]:[B,k,G]:[k,B,G]:k>=B?[G,B,k]:k>=G?[G,k,B]:[k,G,B]}var i={};return i.discriminant=function(t,r,i,n){if("number"!=typeof t)throw new e("a is a required number.");if("number"!=typeof r)throw new e("b is a required number.");if("number"!=typeof i)throw new e("c is a required number.");if("number"!=typeof n)throw new e("d is a required number.");var o=t*t,a=r*r,s=i*i,l=n*n,u=18*t*r*i*n+a*s-27*o*l-4*(t*s*i+a*r*n);return u},i.realRoots=function(i,n,o,a){if("number"!=typeof i)throw new e("a is a required number.");if("number"!=typeof n)throw new e("b is a required number.");if("number"!=typeof o)throw new e("c is a required number.");if("number"!=typeof a)throw new e("d is a required number.");var s,l;if(0===i)return t.realRoots(n,o,a);if(0===n){if(0===o){if(0===a)return[0,0,0];l=-a/i;var u=0>l?-Math.pow(-l,1/3):Math.pow(l,1/3);return[u,u,u]}return 0===a?(s=t.realRoots(i,0,o),0===s.Length?[0]:[s[0],0,s[1]]):r(i,0,o,a)}return 0===o?0===a?(l=-n/i,0>l?[l,0,0]:[0,0,l]):r(i,n,0,a):0===a?(s=t.realRoots(i,n,o),0===s.length?[0]:s[1]<=0?[s[0],s[1],0]:s[0]>=0?[0,s[0],s[1]]:[s[0],0,s[1]]):r(i,n,o,a)},i}),r("Core/QuarticRealPolynomial",["./DeveloperError","./Math","./CubicRealPolynomial","./QuadraticRealPolynomial"],function(e,t,r,i){"use strict";function n(e,n,o,a){var s=e*e,l=n-3*s/8,u=o-n*e/2+s*e/8,c=a-o*e/4+n*s/16-3*s*s/256,h=r.realRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-e/4,m=h[h.length-1];if(Math.abs(m)=0&&y>=0){var g=Math.sqrt(v),_=Math.sqrt(y);return[d-_,d-g,d+g,d+_]}if(v>=0&&0>y)return f=Math.sqrt(v),[d-f,d+f];if(0>v&&y>=0)return f=Math.sqrt(y),[d-f,d+f]}return[]}if(m>0){var w=Math.sqrt(m),C=(l+m-u/w)/2,x=(l+m+u/w)/2,S=i.realRoots(1,w,C),E=i.realRoots(1,-w,x);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==E.length?(E[0]+=d,E[1]+=d,S[1]<=E[0]?[S[0],S[1],E[0],E[1]]:E[1]<=S[0]?[E[0],E[1],S[0],S[1]]:S[0]>=E[0]&&S[1]<=E[1]?[E[0],S[0],S[1],E[1]]:E[0]>=S[0]&&E[1]<=S[1]?[S[0],E[0],E[1],S[1]]:S[0]>E[0]&&S[0]0){var p,f,v=m[0],y=n-v,g=y*y,_=e/2,w=y/2,C=g-4*a,x=g+4*Math.abs(a),S=u-4*v,E=u+4*Math.abs(v);if(0>v||S*x>C*E){var b=Math.sqrt(S);p=b/2,f=0===b?0:(e*w-o)/b}else{var T=Math.sqrt(C);p=0===T?0:(e*w-o)/T,f=T/2}var A,D;0===_&&0===p?(A=0,D=0):t.sign(_)===t.sign(p)?(A=_+p,D=v/A):(D=_-p,A=v/D);var P,M;0===w&&0===f?(P=0,M=0):t.sign(w)===t.sign(f)?(P=w+f,M=a/P):(M=w-f,P=a/M);var I=i.realRoots(1,A,P),O=i.realRoots(1,D,M);if(0!==I.length)return 0!==O.length?I[1]<=O[0]?[I[0],I[1],O[0],O[1]]:O[1]<=I[0]?[O[0],O[1],I[0],I[1]]:I[0]>=O[0]&&I[1]<=O[1]?[O[0],I[0],I[1],O[1]]:O[0]>=I[0]&&O[1]<=I[1]?[I[0],O[0],O[1],I[1]]:I[0]>O[0]&&I[0]c?1:0;switch(p+=0>h?p+1:p,p+=0>d?p+1:p,p+=0>m?p+1:p){case 0:return n(c,h,d,m);case 1:return o(c,h,d,m);case 2:return o(c,h,d,m);case 3:return n(c,h,d,m);case 4:return n(c,h,d,m);case 5:return o(c,h,d,m);case 6:return n(c,h,d,m);case 7:return n(c,h,d,m);case 8:return o(c,h,d,m);case 9:return n(c,h,d,m);case 10:return n(c,h,d,m);case 11:return o(c,h,d,m);case 12:return n(c,h,d,m);case 13:return n(c,h,d,m);case 14:return n(c,h,d,m);case 15:return n(c,h,d,m);default:return void 0}},a}),r("Core/IntersectionTests",["./defined","./DeveloperError","./Math","./Cartesian3","./Cartographic","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i){var n=e+t;return r.sign(e)!==r.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))L;++L){var z,N=h[L],B=N*N,F=Math.max(1-B,0),V=Math.sqrt(F);z=r.sign(p)===r.sign(v)?l(p*B+v,f*N,r.EPSILON12):r.sign(v)===r.sign(f*N)?l(p*B,f*N+v,r.EPSILON12):l(p*B+f*N,v,r.EPSILON12);var k=l(y*N,g,r.EPSILON15),U=z*k;0>U?_.push(new i(u,c*N,c*V)):U>0?_.push(new i(u,c*N,c*-V)):0!==V?(_.push(new i(u,c*N,c*-V)),_.push(new i(u,c*N,c*V)),++L):_.push(new i(u,c*N,c*V))}return _}var c={};c.rayPlane=function(n,o,a){if(!e(n))throw new t("ray is required.");if(!e(o))throw new t("plane is required.");var s=n.origin,l=n.direction,u=o.normal,c=i.dot(u,l);if(Math.abs(c)h?void 0:(a=i.multiplyByScalar(l,h,a),i.add(s,a,a))};var h=new i,d=new i;c.rayEllipsoid=function(r,n){if(!e(r))throw new t("ray is required.");if(!e(n))throw new t("ellipsoid is required.");var o,a,s,l,u,c=n.getOneOverRadii(),m=i.multiplyComponents(c,r.origin,h),p=i.multiplyComponents(c,r.direction,d),f=i.magnitudeSquared(m),v=i.dot(m,p);if(f>1){if(v>=0)return void 0;var y=v*v;if(o=f-1,a=i.magnitudeSquared(p),s=a*o,s>y)return void 0;if(y>s){l=v*v-s,u=-v+Math.sqrt(l);var g=u/a,_=o/u;return _>g?{start:g,stop:_}:{start:_,stop:g}}var w=Math.sqrt(o/a);return{start:w,stop:w}}return 1>f?(o=f-1,a=i.magnitudeSquared(p),s=a*o,l=v*v-s,u=-v+Math.sqrt(l),{start:0,stop:u/a}):0>v?(a=i.magnitudeSquared(p),{start:0,stop:-v/a}):void 0},c.grazingAltitudeLocation=function(a,s){if(!e(a))throw new t("ray is required.");if(!e(s))throw new t("ellipsoid is required.");var l=a.origin,c=a.direction,h=s.geodeticSurfaceNormal(l);if(i.dot(c,h)>=0)return l;var d,m,p=e(this.rayEllipsoid(a,s)),f=s.transformPositionToScaledSpace(c),v=i.normalize(f),y=i.mostOrthogonalAxis(f),g=i.normalize(i.cross(y,v)),_=i.normalize(i.cross(v,g)),w=new o(v.x,g.x,_.x,v.y,g.y,_.y,v.z,g.z,_.z),C=o.transpose(w),x=o.fromScale(s.getRadii()),S=o.fromScale(s.getOneOverRadii()),E=new o(0,c.z,-c.y,-c.z,0,c.x,c.y,-c.x,0),b=o.multiply(o.multiply(C,S),E),T=o.multiply(o.multiply(b,x),w),A=o.multiplyByVector(b,l),D=u(T,i.negate(A),0,0,1),P=D.length;if(P>0){for(var M=i.ZERO,I=Number.NEGATIVE_INFINITY,O=0;P>O;++O){d=o.multiplyByVector(x,o.multiplyByVector(w,D[O]));var R=i.normalize(i.subtract(d,l)),L=i.dot(R,c);L>I&&(I=L,M=d)}var z=s.cartesianToCartographic(M);return I=r.clamp(I,0,1),m=i.magnitude(i.subtract(M,l))*Math.sqrt(1-I*I),m=p?-m:m,s.cartographicToCartesian(new n(z.longitude,z.latitude,m))}return void 0};var m=new i;return c.lineSegmentPlane=function(n,o,a,s){if(!e(n))throw new t("endPoint0 is required.");if(!e(o))throw new t("endPoint1 is required.");if(!e(a))throw new t("plane is required.");var l=i.subtract(o,n,m),u=a.normal,c=i.dot(u,l);if(Math.abs(c)d||d>1?void 0:(e(s)||(s=new i),i.multiplyByScalar(l,d,s),i.add(n,s,s),s)},c.trianglePlaneIntersection=function(r,n,o,a){if(!(e(r)&&e(n)&&e(o)&&e(a)))throw new t("p0, p1, p2, and plane are required.");var s=a.normal,l=a.distance,u=i.dot(s,r)+l<0,h=i.dot(s,n)+l<0,d=i.dot(s,o)+l<0,m=0;m+=u?1:0,m+=h?1:0,m+=d?1:0;var p,f;if((1===m||2===m)&&(p=new i,f=new i),1===m){if(u)return c.lineSegmentPlane(r,n,a,p),c.lineSegmentPlane(r,o,a,f),{positions:[r,n,o,p,f],indices:[0,3,4,1,2,4,1,4,3]}; -if(h)return c.lineSegmentPlane(n,o,a,p),c.lineSegmentPlane(n,r,a,f),{positions:[r,n,o,p,f],indices:[1,3,4,2,0,4,2,4,3]};if(d)return c.lineSegmentPlane(o,r,a,p),c.lineSegmentPlane(o,n,a,f),{positions:[r,n,o,p,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===m){if(!u)return c.lineSegmentPlane(n,r,a,p),c.lineSegmentPlane(o,r,a,f),{positions:[r,n,o,p,f],indices:[1,2,4,1,4,3,0,3,4]};if(!h)return c.lineSegmentPlane(o,n,a,p),c.lineSegmentPlane(r,n,a,f),{positions:[r,n,o,p,f],indices:[2,0,4,2,4,3,1,3,4]};if(!d)return c.lineSegmentPlane(r,o,a,p),c.lineSegmentPlane(n,o,a,f),{positions:[r,n,o,p,f],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},c}),r("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(i,n){if(!t(i))throw new r("normal is required.");if(!t(n))throw new r("distance is required.");this.normal=e.clone(i),this.distance=n};return i.fromPointNormal=function(n,o,a){if(!t(n))throw new r("point is required.");if(!t(o))throw new r("normal is required.");var s=-e.dot(o,n);return t(a)?(e.clone(o,a.normal),a.distance=s,a):new i(o,s)},i.getPointDistance=function(i,n){if(!t(i))throw new r("plane is required.");if(!t(n))throw new r("point is required.");return e.dot(i.normal,n)+i.distance},i.prototype.getPointDistance=function(e){return i.getPointDistance(this,e)},i}),r("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var n=i.indices,o=i.maximumIndex,a=e(i.cacheSize,24);if(!t(n))throw new r("indices is required.");var s=n.length;if(3>s||0!==s%3)throw new r("indices length must be a multiple of three.");if(0>=o)throw new r("maximumIndex must be greater than zero.");if(3>a)throw new r("cacheSize must be greater than two.");if(!t(o)){o=0;for(var l=0,u=n[l];s>l;)u>o&&(o=u),++l,u=n[l]}for(var c=[],h=0;o+1>h;h++)c[h]=0;for(var d=a+1,m=0;s>m;++m)d-c[n[m]]>a&&(c[n[m]]=d,++d);return(d-a+1)/(s/3)},i.tipsify=function(i){function n(e,t,r,i){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;i>a;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function o(e,t,r,i,o,a,s){for(var l,u=-1,c=-1,h=0;hc||-1===c)&&(c=l,u=d)),++h}return-1===u?n(i,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var a,s=i.indices,l=i.maximumIndex,u=e(i.cacheSize,24);if(!t(s))throw new r("indices is required.");var c=s.length;if(3>c||0!==c%3)throw new r("indices length must be a multiple of three.");if(0>=l)throw new r("maximumIndex must be greater than zero.");if(3>u)throw new r("cacheSize must be greater than two.");var h=0,d=0,m=s[d],p=c;if(t(l))h=l+1;else{for(;p>d;)m>h&&(h=m),++d,m=s[d];if(-1===h)return 0;++h}for(var f=[],v=0;h>v;v++)f[v]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;for(var y=0;p>d;)f[s[d]].vertexTriangles.push(y),++f[s[d]].numLiveTriangles,f[s[d+1]].vertexTriangles.push(y),++f[s[d+1]].numLiveTriangles,f[s[d+2]].vertexTriangles.push(y),++f[s[d+2]].numLiveTriangles,++y,d+=3;var g=0,_=u+1;a=1;var w,C,x=[],S=[],E=0,b=[],T=c/3,A=[];for(v=0;T>v;v++)A[v]=!1;for(var D,P;-1!==g;){x=[],C=f[g],P=C.vertexTriangles.length;for(var M=0;P>M;++M)if(y=C.vertexTriangles[M],!A[y]){A[y]=!0,d=y+y+y;for(var I=0;3>I;++I)D=s[d],x.push(D),S.push(D),b[E]=D,++E,w=f[D],--w.numLiveTriangles,_-w.timeStamp>u&&(w.timeStamp=_,++_),++d}g=o(s,u,x,f,_,S,h)}return b},i}),r("Core/GeometryPipeline",["./barycentricCoordinates","./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./EncodedCartesian3","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./GeographicProjection","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./Tipsify","./BoundingSphere","./Geometry","./GeometryAttribute"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x){"use strict";function S(e,t,r,i,n){e[t++]=r,e[t++]=i,e[t++]=i,e[t++]=n,e[t++]=n,e[t]=r}function E(e){for(var t=e.length,r=6*(t/3),i=y.createTypedArray(t,r),n=0,o=0;t>o;o+=3,n+=6)S(i,n,e[o],e[o+1],e[o+2]);return i}function b(e){var t=e.length;if(t>=3){var r=6*(t-2),i=y.createTypedArray(t,r);S(i,0,e[0],e[1],e[2]);for(var n=6,o=3;t>o;++o,n+=6)S(i,n,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function T(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=y.createTypedArray(t,r),n=e[0],o=0,a=1;t>a;++a,o+=6)S(i,o,n,e[a],e[a+1]);return i}return new Uint16Array}function A(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&r(e[i])&&r(e[i].values)){var n=e[i];t[i]=new x({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function D(e,t,i){for(var n in t)if(t.hasOwnProperty(n)&&r(t[n])&&r(t[n].values))for(var o=t[n],a=0;aa;a+=3)o.unpack(i,a,Z),m.multiplyByPoint(e,Z,Z),o.pack(Z,i,a)}function M(e,t){if(r(t))for(var i=t.values,n=i.length,a=0;n>a;a+=3)o.unpack(i,a,Z),d.multiplyByVector(e,Z,Z),Z=o.normalize(Z,Z),o.pack(Z,i,a)}function I(e){var t,i=e.length,n={},o=e[0].geometry.attributes;for(t in o)if(o.hasOwnProperty(t)&&r(o[t])&&r(o[t].values)){for(var a=o[t],s=a.values.length,l=!0,u=1;i>u;++u){var c=e[u].geometry.attributes[t];if(!r(c)||a.componentDatatype.value!==c.componentDatatype.value||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){l=!1;break}s+=c.values.length}l&&(n[t]=new x({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:v.createTypedArray(a.componentDatatype,s)}))}return n}function O(e){if(r(e.indices))return e;var t=C.computeNumberOfVertices(e);if(3>t)throw new i("The number of vertices must be at least three.");if(0!==t%3)throw new i("The number of vertices must be a multiple of three.");for(var n=y.createTypedArray(t,t),o=0;t>o;++o)n[o]=o;return e.indices=n,e}function R(e){var t=C.computeNumberOfVertices(e);if(3>t)throw new i("The number of vertices must be at least three.");var r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,o=3;t>o;++o)r[n++]=o-1,r[n++]=0,r[n++]=o;return e.indices=r,e.primitiveType=g.TRIANGLES,e}function L(e){var t=C.computeNumberOfVertices(e);if(3>t)throw new i("The number of vertices must be at least 3.");var r=y.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,o=3;t-1>o;o+=2)r[n++]=o,r[n++]=o-1,r[n++]=o+1,t>o+2&&(r[n++]=o,r[n++]=o+1,r[n++]=o+2);return e.indices=r,e.primitiveType=g.TRIANGLES,e}function z(e){if(r(e.indices))return e;var t=C.computeNumberOfVertices(e);if(2>t)throw new i("The number of vertices must be at least two.");if(0!==t%2)throw new i("The number of vertices must be a multiple of 2.");for(var n=y.createTypedArray(t,t),o=0;t>o;++o)n[o]=o;return e.indices=n,e}function N(e){var t=C.computeNumberOfVertices(e);if(2>t)throw new i("The number of vertices must be at least two.");var r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return e.indices=r,e.primitiveType=g.LINES,e}function B(e){var t=C.computeNumberOfVertices(e);if(2>t)throw new i("The number of vertices must be at least two.");var r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=g.LINES,e}function F(e){switch(e.primitiveType){case g.TRIANGLE_FAN:return R(e);case g.TRIANGLE_STRIP:return L(e);case g.TRIANGLES:return O(e);case g.LINE_STRIP:return N(e);case g.LINE_LOOP:return B(e);case g.LINES:return z(e)}return e}function V(e,t){Math.abs(e.y)=0||t.x>=0||r.x>=0)return void 0;var i=e.y<0,n=t.y<0,o=r.y<0;V(e,i),V(t,n),V(r,o);var a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=ct.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(k(e,t,at,lt),k(e,r,st,ut),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(k(t,r,at,lt),k(t,e,st,ut),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(k(r,e,at,lt),k(r,t,st,ut),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?n?o||(k(r,e,at,lt),k(r,t,st,ut),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(k(t,r,at,lt),k(t,e,st,ut),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(k(e,t,at,lt),k(e,r,st,ut),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=ct.positions;return l[0]=e,l[1]=t,l[2]=r,ct.length=3,(1===a||2===a)&&(l[3]=at,l[4]=st,l[5]=lt,l[6]=ut,ct.length=7),ct}function W(t,i,a,s,l,u,c,h){if(r(l)||r(u)||r(c)||r(h)){var d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M=s.positions,I=M[0],O=M[1],R=M[2];r(l)&&(d=o.fromArray(l,3*t),m=o.fromArray(l,3*i),p=o.fromArray(l,3*a)),r(u)&&(f=o.fromArray(u,3*t),v=o.fromArray(u,3*i),y=o.fromArray(u,3*a)),r(c)&&(g=o.fromArray(c,3*t),_=o.fromArray(c,3*i),w=o.fromArray(c,3*a)),r(h)&&(C=n.fromArray(h,2*t),x=n.fromArray(h,2*i),S=n.fromArray(h,2*a));for(var L=3;L_;_+=3){var w=u[_],x=u[_+1],S=u[_+2],E=o.fromArray(i,3*w),b=o.fromArray(i,3*x),T=o.fromArray(i,3*S),A=U(E,b,T);if(r(A))if(c[3*w+1]=A.positions[0].y,c[3*x+1]=A.positions[1].y,c[3*S+1]=A.positions[2].y,A.length>3){for(var D=c.length/3,P=0;PM?f.push(u[_+M]):f.push(M-3+D)}for(var I=3;Id;d+=2){var m=n[d],f=n[d+1],v=o.fromArray(i,3*m),g=o.fromArray(i,3*f);if(Math.abs(v.y)h;h+=3)u[c++]=a[h],u[c++]=a[h+1],u[c++]=a[h+2],u[c++]=a[h]+s[h]*o,u[c++]=a[h+1]+s[h+1]*o,u[c++]=a[h+2]+s[h+2]*o;var d,m=e.boundingSphere;return r(m)&&(d=new w(m.center,m.radius+o)),new C({attributes:{position:new x({componentDatatype:v.DOUBLE,componentsPerAttribute:3,values:u})},primitiveType:g.LINES,boundingSphere:d})},H.createAttributeIndices=function(e){if(!r(e))throw new i("geometry is required.");var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent"],o=e.attributes,a={},s=0,l=n.length;for(t=0;l>t;++t){var u=n[t];r(o[u])&&(a[u]=s++)}for(var c in o)o.hasOwnProperty(c)&&!r(a[c])&&(a[c]=s++);return a},H.reorderForPreVertexCache=function(e){if(!r(e))throw new i("geometry is required.");var t=C.computeNumberOfVertices(e),n=e.indices;if(r(n)){for(var o=new Int32Array(t),a=0;t>a;a++)o[a]=-1;for(var s,l=n,u=l.length,c=y.createTypedArray(t,u),h=0,d=0,m=0;u>h;)s=o[l[h]],-1!==s?c[d]=s:(s=l[h],o[s]=m,c[d]=m,++m),++h,++d;e.indices=c;var p=e.attributes;for(var f in p)if(p.hasOwnProperty(f)&&r(p[f])&&r(p[f].values)){for(var g=p[f],_=g.values,w=0,x=g.componentsPerAttribute,S=v.createTypedArray(g.componentDatatype,m*x);t>w;){var E=o[w];if(-1!==E)for(a=0;x>a;a++)S[x*E+a]=_[x*w+a];++w}g.values=S}}return e},H.reorderForPostVertexCache=function(e,t){if(!r(e))throw new i("geometry is required.");var n=e.indices;if(e.primitiveType===g.TRIANGLES&&r(n)){for(var o=n.length,a=0,s=0;o>s;s++)n[s]>a&&(a=n[s]);e.indices=_.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},H.fitToUnsignedShortIndices=function(e){if(!r(e))throw new i("geometry is required.");if(r(e.indices)&&e.primitiveType!==g.TRIANGLES&&e.primitiveType!==g.LINES&&e.primitiveType!==g.POINTS)throw new i("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");var t=[],n=C.computeNumberOfVertices(e);if(r(e.indices)&&n>h.SIXTY_FOUR_KILOBYTES){var o,a=[],s=[],l=0,u=A(e.attributes),c=e.indices,d=c.length;e.primitiveType===g.TRIANGLES?o=3:e.primitiveType===g.LINES?o=2:e.primitiveType===g.POINTS&&(o=1);for(var m=0;d>m;m+=o){for(var p=0;o>p;++p){var f=c[m+p],v=a[f];r(v)||(v=l++,a[f]=v,D(u,e.attributes,f)),s.push(v)}l+o>h.SIXTY_FOUR_KILOBYTES&&(t.push(new C({attributes:u,indices:s,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),a=[],s=[],l=0,u=A(e.attributes))}0!==s.length&&t.push(new C({attributes:u,indices:s,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var j=new o,Y=new s;H.projectTo2D=function(e,t,n,a,s){if(!r(e))throw new i("geometry is required.");if(!r(t))throw new i("attributeName is required.");if(!r(n))throw new i("attributeName3D is required.");if(!r(a))throw new i("attributeName2D is required.");var l=e.attributes[t];if(!r(l))throw new i("geometry must have attribute matching the attributeName argument: "+t+".");if(l.componentDatatype.value!==v.DOUBLE.value)throw new i("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");s=r(s)?s:new f;for(var u=s.getEllipsoid(),c=l.values,h=new Float64Array(c.length),d=0,m=0;md;++d)l.encode(s[d],X),c[d]=X.high,h[d]=X.low;var m=a.componentsPerAttribute;return e.attributes[n]=new x({componentDatatype:v.FLOAT,componentsPerAttribute:m,values:c}),e.attributes[o]=new x({componentDatatype:v.FLOAT,componentsPerAttribute:m,values:h}),delete e.attributes[t],e};var Z=new o,J=new m,K=new d;H.transformToWorldCoordinates=function(e){if(!r(e))throw new i("instance is required.");var t=e.modelMatrix;if(m.equals(t,m.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(r(n.normal)||r(n.binormal)||r(n.tangent))&&(m.inverse(t,J),m.transpose(J,J),m.getRotation(J,K),M(K,n.normal),M(K,n.binormal),M(K,n.tangent));var o=e.geometry.boundingSphere;return r(o)&&(e.geometry.boundingSphere=w.transform(o,t,o)),e.modelMatrix=m.clone(m.IDENTITY),e},H.combine=function(e){if(!r(e)||e.length<1)throw new i("instances is required and must have length greater than zero.");var t,n,a,s,l=e.length,u=e[0].modelMatrix,c=r(e[0].geometry.indices),h=e[0].geometry.primitiveType;for(n=1;l>n;++n){if(!m.equals(e[n].modelMatrix,u))throw new i("All instances must have the same modelMatrix.");if(r(e[n].geometry.indices)!==c)throw new i("All instance geometries must have an indices or not have one.");if(e[n].geometry.primitiveType!==h)throw new i("All instance geometries must have the same primitiveType.")}var d,p,f,v=I(e);for(t in v)if(v.hasOwnProperty(t))for(d=v[t].values,s=0,n=0;l>n;++n)for(p=e[n].geometry.attributes[t].values,f=p.length,a=0;f>a;++a)d[s++]=p[a];var _;if(c){var x=0;for(n=0;l>n;++n)x+=e[n].geometry.indices.length;var S=C.computeNumberOfVertices(new C({attributes:v,primitiveType:g.POINTS})),E=y.createTypedArray(S,x),b=0,T=0;for(n=0;l>n;++n){var A=e[n].geometry.indices,D=A.length;for(s=0;D>s;++s)E[b++]=T+A[s];T+=C.computeNumberOfVertices(e[n].geometry)}_=E}var P,M=new o,O=0;for(n=0;l>n;++n){if(P=e[n].geometry.boundingSphere,!r(P)){M=void 0;break}o.add(P.center,M,M)}if(r(M))for(o.divideByScalar(M,l,M),n=0;l>n;++n){P=e[n].geometry.boundingSphere;var R=o.magnitude(o.subtract(P.center,M))+P.radius;R>O&&(O=R)}return new C({attributes:v,indices:_,primitiveType:h,boundingSphere:r(M)?new w(M,O):void 0})};var Q=new o,$=new o,et=new o,tt=new o;H.computeNormal=function(e){if(!r(e))throw new i("geometry is required.");var t=e.attributes,n=e.indices;if(!r(t.position)||!r(t.position.values))throw new i("geometry.attributes.position.values is required.");if(!r(n))throw new i("geometry.indices is required.");if(n.length<2||0!==n.length%3)throw new i("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==g.TRIANGLES)throw new i("geometry.primitiveType must be PrimitiveType.TRIANGLES.");for(var a=e.attributes.position.values,s=e.attributes.position.values.length/3,l=n.length,u=new Array(s),c=new Array(l/3),h=new Array(l),d=0;s>d;d++)u[d]={indexOffset:0,count:0,currentCount:0};var m=0;for(d=0;l>d;d+=3){var p=n[d],f=n[d+1],y=n[d+2],_=3*p,w=3*f,C=3*y;$.x=a[_],$.y=a[_+1],$.z=a[_+2],et.x=a[w],et.y=a[w+1],et.z=a[w+2],tt.x=a[C],tt.y=a[C+1],tt.z=a[C+2],u[p].count++,u[f].count++,u[y].count++,o.subtract(et,$,et),o.subtract(tt,$,tt),c[m]=o.cross(et,tt),m++}var S=0;for(d=0;s>d;d++)u[d].indexOffset+=S,S+=u[d].count;m=0;var E;for(d=0;l>d;d+=3){E=u[n[d]];var b=E.indexOffset+E.currentCount;h[b]=m,E.currentCount++,E=u[n[d+1]],b=E.indexOffset+E.currentCount,h[b]=m,E.currentCount++,E=u[n[d+2]],b=E.indexOffset+E.currentCount,h[b]=m,E.currentCount++,m++}var T=new Float32Array(3*s);for(d=0;s>d;d++){var A=3*d;if(E=u[d],E.count>0){for(o.clone(o.ZERO,Q),m=0;md;d+=3){var y=n[d],_=n[d+1],w=n[d+2];m=3*y,p=3*_,f=3*w;var C=2*y,S=2*_,E=2*w,b=a[m],T=a[m+1],A=a[m+2],D=l[C],P=l[C+1],M=l[S+1]-P,I=l[E+1]-P,O=1/((l[S]-D)*I-(l[E]-D)*M),R=(I*(a[p]-b)-M*(a[f]-b))*O,L=(I*(a[p+1]-T)-M*(a[f+1]-T))*O,z=(I*(a[p+2]-A)-M*(a[f+2]-A))*O;h[m]+=R,h[m+1]+=L,h[m+2]+=z,h[p]+=R,h[p+1]+=L,h[p+2]+=z,h[f]+=R,h[f+1]+=L,h[f+2]+=z}var N=new Float32Array(3*u),B=new Float32Array(3*u);for(d=0;u>d;d++){m=3*d,p=m+1,f=m+2;var F=o.fromArray(s,m,rt),V=o.fromArray(h,m,nt),k=o.dot(F,V);o.multiplyByScalar(F,k,it),o.normalize(o.subtract(V,it,V),V),B[m]=V.x,B[p]=V.y,B[f]=V.z,o.normalize(o.cross(F,V,V),V),N[m]=V.x,N[p]=V.y,N[f]=V.z}return e.attributes.tangent=new x({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:B}),e.attributes.binormal=new x({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:N}),e};var ot=new o,at=new o,st=new o,lt=new o,ut=new o,ct={positions:new Array(7),indices:new Array(9)};return H.wrapLongitude=function(e){if(!r(e))throw new i("geometry is required.");var t=e.boundingSphere;if(r(t)){var n=t.center.x-t.radius;if(n>0||w.intersect(t,a.UNIT_Y)!==u.INTERSECTING)return e}return F(e),e.primitiveType===g.TRIANGLES?q(e):e.primitiveType===g.LINES&&G(e),e},H}),r("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(i){if(i=e(i,e.EMPTY_OBJECT),!t(i.componentDatatype))throw new r("options.componentDatatype is required.");if(!t(i.componentsPerAttribute))throw new r("options.componentsPerAttribute is required.");if(i.componentsPerAttribute<1||i.componentsPerAttribute>4)throw new r("options.componentsPerAttribute must be between 1 and 4.");if(!t(i.value))throw new r("options.value is required.");this.componentDatatype=i.componentDatatype,this.componentsPerAttribute=i.componentsPerAttribute,this.normalize=e(i.normalize,!1),this.value=i.value};return i}),r("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4","./Geometry","./GeometryInstanceAttribute"],function(e,t,r,i){"use strict";var n=function(n){if(n=e(n,e.EMPTY_OBJECT),!t(n.geometry))throw new r("options.geometry is required.");this.geometry=n.geometry,this.modelMatrix=i.clone(e(n.modelMatrix,i.IDENTITY)),this.id=n.id,this.pickPrimitive=n.pickPrimitive,this.attributes=e(n.attributes,{})};return n}),r("Core/EllipseGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./EllipseGeometryLibrary","./GeographicProjection","./Geometry","./GeometryPipeline","./GeometryInstance","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C){"use strict";function x(e,t,r){var i=t.vertexFormat,o=t.center,s=t.semiMajorAxis,l=t.ellipsoid,u=t.stRotation,d=r?2*(e.length/3):e.length/3,m=i.st?new Float32Array(2*d):void 0,p=i.normal?new Float32Array(3*d):void 0,y=i.tangent?new Float32Array(3*d):void 0,_=i.binormal?new Float32Array(3*d):void 0,C=0,x=z,S=N,E=B,b=new h(l),T=b.project(l.cartesianToCartographic(o,F),V),A=l.scaleToGeodeticSurface(o,D);l.geodeticSurfaceNormal(A,A);for(var I=w.fromAxisAngle(A,u,L),k=g.fromQuaternion(I,R),U=e.length,W=r?U:0,q=2*(W/3),G=0;U>G;G+=3){var H=G+1,j=G+2,Y=n.fromArray(e,G,D);if(i.st){var X=g.multiplyByVector(k,Y,P),Z=b.project(l.cartesianToCartographic(X,F),M);n.subtract(Z,T,Z),O.x=(Z.x+s)/(2*s),O.y=(Z.y+s)/(2*s),r&&(m[C+q]=O.x,m[C+1+q]=O.y),m[C++]=O.x,m[C++]=O.y}x=l.geodeticSurfaceNormal(Y,x),(i.normal||i.tangent||i.binormal)&&((i.tangent||i.binormal)&&(S=n.cross(n.UNIT_Z,x,S),g.multiplyByVector(k,S,S)),i.normal&&(p[G]=x.x,p[H]=x.y,p[j]=x.z,r&&(p[G+W]=-x.x,p[H+W]=-x.y,p[j+W]=-x.z)),i.tangent&&(y[G]=S.x,y[H]=S.y,y[j]=S.z,r&&(y[G+W]=-S.x,y[H+W]=-S.y,y[j+W]=-S.z)),i.binormal&&(E=n.cross(x,S,E),_[G]=E.x,_[H]=E.y,_[j]=E.z,r&&(_[G+W]=E.x,_[H+W]=E.y,_[j+W]=E.z)))}var J=new v;if(i.position){var K=c.raisePositionsToHeight(e,t,r);J.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:K})}return i.st&&(J.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(J.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(J.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:y})),i.binormal&&(J.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:_})),J}function S(e){var t,r,i,n,o,a=new Array(2*e*(e+1)),s=0;for(n=1;e>n;++n){for(i=n*(n+1),t=(n-1)*n,a[s++]=i++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=i++,a[s++]=t,a[s++]=i}for(r=2*e,++i,++t,n=0;r-1>n;++n)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;for(++t,++i,n=e-1;n>0;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=t++,a[s++]=t++,a[s++]=i++}return a}function E(e){var t=e.center;k=n.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,k),e.height,k),k=n.add(t,k,k);var i=new r(k,e.semiMajorAxis),o=c.computeEllipsePositions(e,!0,!1),a=o.positions,l=o.numPts,u=x(a,e,!1),h=S(l);return h=s.createTypedArray(a.length/3,h),{boundingSphere:i,attributes:u,indices:h}}function b(e,t){var r=t.vertexFormat,i=t.center,o=t.semiMajorAxis,s=t.ellipsoid,l=t.height,u=t.extrudedHeight,c=t.stRotation,d=2*(e.length/3),m=new Float64Array(3*d),p=r.st?new Float32Array(2*d):void 0,y=r.normal?new Float32Array(3*d):void 0,_=r.tangent?new Float32Array(3*d):void 0,C=r.binormal?new Float32Array(3*d):void 0,x=0,S=z,E=N,b=B,T=new h(s),A=T.project(s.cartesianToCartographic(i,F),V),k=s.scaleToGeodeticSurface(i,D);s.geodeticSurfaceNormal(k,k);for(var U=w.fromAxisAngle(k,c,L),W=g.fromQuaternion(U,R),q=e.length,G=2*(q/3),H=0;q>H;H+=3){var j,Y=H+1,X=H+2,Z=n.fromArray(e,H,D);if(r.st){var J=g.multiplyByVector(W,Z,P),K=T.project(s.cartesianToCartographic(J,F),M);n.subtract(K,A,K),O.x=(K.x+o)/(2*o),O.y=(K.y+o)/(2*o),p[x+G]=O.x,p[x+1+G]=O.y,p[x++]=O.x,p[x++]=O.y}Z=s.scaleToGeodeticSurface(Z,Z),j=n.clone(Z,P),S=s.geodeticSurfaceNormal(Z,S);var Q=n.multiplyByScalar(S,l,I);if(Z=n.add(Z,Q,Z),Q=n.multiplyByScalar(S,u,Q),j=n.add(j,Q,j),r.position&&(m[H+q]=j.x,m[Y+q]=j.y,m[X+q]=j.z,m[H]=Z.x,m[Y]=Z.y,m[X]=Z.z),r.normal||r.tangent||r.binormal){b=n.clone(S,b);var $=n.fromArray(e,(H+3)%q,I);n.subtract($,Z,$);var et=n.subtract(j,Z,M);S=n.normalize(n.cross(et,$,S),S),r.normal&&(y[H]=S.x,y[Y]=S.y,y[X]=S.z,y[H+q]=S.x,y[Y+q]=S.y,y[X+q]=S.z),r.tangent&&(E=n.normalize(n.cross(b,S,E),E),_[H]=E.x,_[Y]=E.y,_[X]=E.z,_[H+q]=E.x,_[H+1+q]=E.y,_[H+2+q]=E.z),r.binormal&&(C[H]=b.x,C[Y]=b.y,C[X]=b.z,C[H+q]=b.x,C[Y+q]=b.y,C[X+q]=b.z)}}var tt=new v;return r.position&&(tt.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:m})),r.st&&(tt.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:p})),r.normal&&(tt.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:y})),r.tangent&&(tt.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:_})),r.binormal&&(tt.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:C})),tt}function T(e){for(var t,r,i,n,o=e.length/3,a=s.createTypedArray(o,6*o),l=0,u=0;o-1>u;u++)t=u,i=u+o,r=t+1,n=r+o,a[l++]=t,a[l++]=i,a[l++]=r,a[l++]=r,a[l++]=i,a[l++]=n;return t=o-1,i=u+o,r=0,n=r+o,a[l++]=t,a[l++]=i,a[l++]=r,a[l++]=r,a[l++]=i,a[l++]=n,a}function A(e){var t=e.center,i=e.ellipsoid,o=e.semiMajorAxis,a=n.multiplyByScalar(i.geodeticSurfaceNormal(t,D),e.height,D);U.center=n.add(t,a,U.center),U.radius=o,a=n.multiplyByScalar(i.geodeticSurfaceNormal(t,a),e.extrudedHeight,a),W.center=n.add(t,a,W.center),W.radius=o;var l=c.computeEllipsePositions(e,!0,!0),u=l.positions,h=l.numPts,f=l.outerPositions,v=r.union(U,W),y=x(u,e,!0),g=S(h),w=g.length;g.length=2*w;for(var C=u.length/3,E=0;w>E;E+=3)g[E+w]=g[E+2]+C,g[E+1+w]=g[E+1]+C,g[E+2+w]=g[E]+C;var A=s.createTypedArray(2*C/3,g),P=new d({attributes:y,indices:A,primitiveType:_.TRIANGLES}),M=b(f,e);g=T(f);var I=s.createTypedArray(2*f.length/3,g),O=new d({attributes:M,indices:I,primitiveType:_.TRIANGLES}),R=m.combine([new p({geometry:P}),new p({geometry:O})]);return{boundingSphere:v,attributes:R.attributes,indices:R.indices}}var D=new n,P=new n,M=new n,I=new n,O=new i,R=new g,L=new w,z=new n,N=new n,B=new n,F=new o,V=new n,k=new n,U=new r,W=new r,q=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.center,o=r.semiMajorAxis,a=r.semiMinorAxis,s=e(r.granularity,y.RADIANS_PER_DEGREE),c=e(r.height,0),h=r.extrudedHeight,d=t(h)&&!y.equalsEpsilon(c,h,1);if(!t(i))throw new l("center is required.");if(!t(o))throw new l("semiMajorAxis is required.");if(!t(a))throw new l("semiMinorAxis is required.");if(0>=o||0>=a)throw new l("Semi-major and semi-minor axes must be greater than zero.");if(a>o)throw new l("semiMajorAxis must be larger than the semiMajorAxis.");if(0>=s)throw new l("granularity must be greater than zero.");this._center=n.clone(i),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=e(r.ellipsoid,u.WGS84),this._rotation=e(r.rotation,0),this._stRotation=e(r.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=e(r.vertexFormat,C.DEFAULT),this._extrudedHeight=h,this._extrude=d,this._workerName="createEllipseGeometry"};return q.createGeometry=function(e){var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=A(r)):t=E(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:_.TRIANGLES,boundingSphere:t.boundingSphere})},q}),r("Core/CircleGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseGeometry"],function(e,t,r,i){"use strict";var n=function(n){n=e(n,e.EMPTY_OBJECT);var o=n.radius;if(!t(o))throw new r("radius is required.");if(0>=o)throw new r("radius must be greater than zero.");var a={center:n.center,semiMajorAxis:o,semiMinorAxis:o,ellipsoid:n.ellipsoid,height:n.height,extrudedHeight:n.extrudedHeight,granularity:n.granularity,vertexFormat:n.vertexFormat,stRotation:n.stRotation};this._ellipseGeometry=new i(a),this._workerName="createCircleGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/EllipseOutlineGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./EllipseGeometryLibrary","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict"; -function p(e){var t=e.center;y=i.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,y),e.height,y),y=i.add(t,y,y);for(var a=new r(y,e.semiMajorAxis),s=l.computeEllipsePositions(e,!1,!0).outerPositions,u=new h({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l.raisePositionsToHeight(s,e,!1)})}),d=s.length/3,m=o.createTypedArray(d,2*d),p=0,f=0;d-1>f;f++)m[p++]=f,m[p++]=f+1;return m[p++]=d-1,m[p++]=0,{boundingSphere:a,attributes:u,indices:m}}function f(t){var a=e(t.numberOfVerticalLines,16);a=Math.max(a,0);var s=t.center,u=t.ellipsoid,d=t.semiMajorAxis,m=i.multiplyByScalar(u.geodeticSurfaceNormal(s,v),t.height,v);g.center=i.add(s,m,g.center),g.radius=d,m=i.multiplyByScalar(u.geodeticSurfaceNormal(s,m),t.extrudedHeight,m),_.center=i.add(s,m,_.center),_.radius=d;var p=l.computeEllipsePositions(t,!1,!0).outerPositions,f=new h({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l.raisePositionsToHeight(p,t,!0)})});p=f.position.values;var y=r.union(g,_),w=p.length/3,C=o.createTypedArray(w,2*w+2*a);w/=2;for(var x=0,S=0;w-1>S;S++)C[x++]=S,C[x++]=S+1,C[x++]=S+w,C[x++]=S+w+1;C[x++]=w-1,C[x++]=0,C[x++]=w+w-1,C[x++]=w;var E;if(a>0){var b=Math.min(a,w);E=Math.round(w/b)}var T=Math.min(E*a,w);if(a>0)for(S=0;T>S;S+=E)C[x++]=S,C[x++]=S+w;return{boundingSphere:y,attributes:f,indices:C}}var v=new i,y=new i,g=new r,_=new r,w=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.center,o=r.semiMajorAxis,l=r.semiMinorAxis,u=e(r.granularity,d.RADIANS_PER_DEGREE),c=e(r.height,0),h=r.extrudedHeight,m=t(h)&&!d.equalsEpsilon(c,h,1);if(!t(n))throw new a("center is required.");if(!t(o))throw new a("semiMajorAxis is required.");if(!t(l))throw new a("semiMinorAxis is required.");if(0>=o||0>=l)throw new a("Semi-major and semi-minor axes must be greater than zero.");if(l>o)throw new a("semiMajorAxis must be larger than the semiMajorAxis.");if(0>=u)throw new a("granularity must be greater than zero.");this._center=i.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=l,this._ellipsoid=e(r.ellipsoid,s.WGS84),this._rotation=e(r.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=m,this._numberOfVerticalLines=Math.max(e(r.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"};return w.createGeometry=function(e){var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=f(r)):t=p(r),new u({attributes:t.attributes,indices:t.indices,primitiveType:m.LINES,boundingSphere:t.boundingSphere})},w}),r("Core/CircleOutlineGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry"],function(e,t,r,i){"use strict";var n=function(n){n=e(n,e.EMPTY_OBJECT);var o=n.radius;if(!t(o))throw new r("radius is required.");if(0>=o)throw new r("radius must be greater than zero.");var a={center:n.center,semiMajorAxis:o,semiMinorAxis:o,ellipsoid:n.ellipsoid,height:n.height,extrudedHeight:n.extrudedHeight,granularity:n.granularity,numberOfVerticalLines:n.numberOfVerticalLines};this._ellipseGeometry=new i(a),this._workerName="createCircleOutlineGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";var r=function(r,i,n){if(!e(r))throw new t("array is required.");if(!e(i))throw new t("itemToFind is required.");if(!e(n))throw new t("comparator is required.");for(var o,a,s=0,l=r.length-1;l>=s;)if(o=~~((s+l)/2),a=n(r[o],i),0>a)s=o+1;else{if(!(a>0))return o;l=o-1}return~(l+1)};return r}),r("Core/TimeConstants",[],function(){"use strict";var e={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e}),r("Core/LeapSecond",["./defined","./DeveloperError"],function(e,t){"use strict";var r=function(r,i){if(!e(r))throw new t("date is required.");if(null===i||isNaN(i))throw new t("offset is required and must be a number.");this.julianDate=r,this.offset=i};return r.setLeapSeconds=function(e){if(!Array.isArray(e))throw new t("leapSeconds is required and must be an array.");r._leapSeconds=e,r._leapSeconds.sort(r.compareLeapSecondDate)},r.getLeapSeconds=function(){return r._leapSeconds},r.prototype.equals=function(e){return this.julianDate.equals(e.julianDate)&&this.offset===e.offset},r.compareLeapSecondDate=function(e,t){return e.julianDate.compareTo(t.julianDate)},r._leapSeconds=[],r}),r("Core/TimeStandard",[],function(){"use strict";var e={UTC:0,TAI:1};return e}),r("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(t){if(null===t||isNaN(t))throw new e("year is required and must be a number.");return 0===t%4&&0!==t%100||0===t%400}return t}),r("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,i=t[r++],n=function(e,t,r,i){r||(r=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return i?e+n:n+e},o=function(e,t,r,i,o,a){var s=i-e.length;return s>0&&(e=r||!o?n(e,i,a,r):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,i,a,s,l){var u=e>>>0;return r=r&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+n(u.toString(t),s||0,"0",!1),o(e,r,i,a,l)},s=function(e,t,r,i,n,a){return null!=i&&(e=e.slice(0,i)),o(e,"",t,r,n,a)},l=function(e,i,l,u,c,h,d){var m,p,f,v,y;if("%%"==e)return"%";for(var g=!1,_="",w=!1,C=!1,x=" ",S=l.length,E=0;l&&S>E;E++)switch(l.charAt(E)){case" ":_=" ";break;case"+":_="+";break;case"-":g=!0;break;case"'":x=l.charAt(E+1);break;case"0":w=!0;break;case"#":C=!0}if(u=u?"*"==u?+t[r++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,0>u&&(u=-u,g=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[r++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=i?t[i.slice(0,-1)]:t[r++],d){case"s":return s(String(y),g,u,h,w,x);case"c":return s(String.fromCharCode(+y),g,u,h,w);case"b":return a(y,2,C,g,u,h,w);case"o":return a(y,8,C,g,u,h,w);case"x":return a(y,16,C,g,u,h,w);case"X":return a(y,16,C,g,u,h,w).toUpperCase();case"u":return a(y,10,C,g,u,h,w);case"i":case"d":return m=+y||0,m=Math.round(m-m%1),p=0>m?"-":_,y=p+n(String(Math.abs(m)),h,"0",!1),o(y,p,g,u,w);case"e":case"E":case"f":case"F":case"g":case"G":return m=+y,p=0>m?"-":_,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=p+Math.abs(m)[f](h),o(y,p,g,u,w)[v]();default:return e}};return i.replace(e,l)}return e}),r("Core/JulianDate",["./DeveloperError","./binarySearch","./defined","./TimeConstants","./LeapSecond","./TimeStandard","./isLeapYear","../ThirdParty/sprintf"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){v.julianDate=e;var r=n.getLeapSeconds(),i=t(r,v,n.compareLeapSecondDate);0>i&&(i=~i),i>=r.length&&(i=r.length-1);var o=r[i].offset;if(i>0){var a=e.getSecondsDifference(r[i].julianDate);a>o&&(i--,o=r[i].offset)}e.addSeconds(o,e)}function u(e,r){v.julianDate=e;var i=n.getLeapSeconds(),o=t(i,v,n.compareLeapSecondDate);if(0>o&&(o=~o),0===o)return e.addSeconds(-i[0].offset,r);if(o>=i.length)return e.addSeconds(-i[o-1].offset,r);var a=e.getSecondsDifference(i[o].julianDate);return 0===a?e.addSeconds(-i[o].offset,r):1>=a?void 0:e.addSeconds(-i[--o].offset,r)}function c(e,t,n){var a=0|t/i.SECONDS_PER_DAY;return e+=a,t-=i.SECONDS_PER_DAY*a,0>t&&(e--,t+=i.SECONDS_PER_DAY),r(n)?(n._julianDayNumber=e,n._secondsOfDay=t,n):new A(e,t,o.TAI)}function h(e,t,r,n,o,a,s){var l=0|(t-14)/12,u=e+4800+l,c=(0|1461*u/4)+(0|367*(t-2-12*l)/12)-(0|3*((u+100)/100)/4)+r-32075;n-=12,0>n&&(n+=24);var h=a+(n*i.SECONDS_PER_HOUR+o*i.SECONDS_PER_MINUTE+s*i.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function d(e){return h(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())}var m=function(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s},p=[31,28,31,30,31,30,31,31,30,31,30,31],f=29,v={julianDate:void 0},y=/^(\d{4})$/,g=/^(\d{4})-(\d{2})$/,_=/^(\d{4})-?(\d{3})$/,w=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,C=/^(\d{4})-?(\d{2})-?(\d{2})$/,x=/([Z+\-])?(\d{2})?:?(\d{2})?$/,S=/^(\d{2})(\.\d+)?/.source+x.source,E=/^(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,b=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,T="Valid ISO 8601 date string required.",A=function(t,n,a){this._julianDayNumber=void 0,this._secondsOfDay=void 0;var s,u;if(r(t)||r(n)||r(a)){if(r(a)){if(a!==o.UTC&&a!==o.TAI)throw new e("timeStandard is not a known TimeStandard.")}else a=o.UTC;if(null===t||isNaN(t))throw new e("julianDayNumber is required.");if(null===n||isNaN(n))throw new e("julianSecondsOfDay is required.");s=0|t,u=n+(t-s)*i.SECONDS_PER_DAY}else{var h=new Date,m=d(h);s=m[0],u=m[1],a=o.UTC}c(s,u,this),a===o.UTC&&l(this)};A.clone=function(e,t){return r(e)?r(t)?(t._julianDayNumber=e._julianDayNumber,t._secondsOfDay=e._secondsOfDay,t):new A(e._julianDayNumber,e._secondsOfDay,o.TAI):void 0},A.fromDate=function(t,r){if(!(t instanceof Date)||isNaN(t.getTime()))throw new e("date must be a valid JavaScript Date.");var i=d(t);return new A(i[0],i[1],r)},A.fromIso8601=function(t){if("string"!=typeof t)throw new e(T);t=t.replace(",",".");var i,n,s,l=t.split("T"),u=1,c=1,d=0,m=0,v=0,x=0,D=l[0],P=l[1];if(!r(D))throw new e(T);var M;if(l=D.match(C),null!==l){if(M=D.split("-").length-1,M>0&&2!==M)throw new e(T);i=+l[1],u=+l[2],c=+l[3]}else if(l=D.match(g),null!==l)i=+l[1],u=+l[2];else if(l=D.match(y),null!==l)i=+l[1];else{var I;if(l=D.match(_),null!==l){if(i=+l[1],I=+l[2],s=a(i),1>I||s&&I>366||!s&&I>365)throw new e(T)}else{if(l=D.match(w),null===l)throw new e(T);i=+l[1];var O=+l[2],R=+l[3]||0;if(M=D.split("-").length-1,M>0&&(!r(l[3])&&1!==M||r(l[3])&&2!==M))throw new e(T);var L=new Date(Date.UTC(i,0,4));I=7*O+R-L.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),u=n.getUTCMonth()+1,c=n.getUTCDate()}if(s=a(i),1>u||u>12||1>c||(2!==u||!s)&&c>p[u-1]||s&&2===u&&c>f)throw new e(T);var z;if(r(P)){if(l=P.match(b),null!==l){if(M=P.split(":").length-1,M>0&&2!==M&&3!==M)throw new e(T);d=+l[1],m=+l[2],v=+l[3],x=1e3*+(l[4]||0),z=5}else if(l=P.match(E),null!==l){if(M=P.split(":").length-1,M>0&&1!==M)throw new e(T);d=+l[1],m=+l[2],v=60*+(l[3]||0),z=4}else{if(l=P.match(S),null===l)throw new e(T);d=+l[1],m=60*+(l[2]||0),z=3}if(m>=60||v>=61||d>24||24===d&&(m>0||v>0||x>0))throw new e(T);var N=l[z],B=+l[z+1],F=+(l[z+2]||0);switch(N){case"+":d-=B,m-=F;break;case"-":d+=B,m+=F;break;case"Z":break;default:m+=new Date(Date.UTC(i,u-1,c,d,m)).getTimezoneOffset()}}else m+=new Date(Date.UTC(i,u-1,c)).getTimezoneOffset();var V=60===v;for(V&&v--;m>=60;)m-=60,d++;for(;d>=24;)d-=24,c++;for(n=s&&2===u?f:p[u-1];c>n;)c-=n,u++,u>12&&(u-=12,i++),n=s&&2===u?f:p[u-1];for(;0>m;)m+=60,d--;for(;0>d;)d+=24,c--;for(;1>c;)u--,1>u&&(u+=12,i--),n=s&&2===u?f:p[u-1],c+=n;var k=h(i,u,c,d,m,v,x),U=new A(k[0],k[1],o.UTC);return V&&U.addSeconds(1,U),U},A.fromTotalDays=function(t,r){if(null===t||isNaN(t))throw new e("totalDays is required.");return new A(t,0,r)},A.compare=function(e,t){var r=e._julianDayNumber-t._julianDayNumber;return 0!==r?r:e._secondsOfDay-t._secondsOfDay},A.equals=function(e,t){return e===t||r(e)&&r(t)&&e._julianDayNumber===t._julianDayNumber&&e._secondsOfDay===t._secondsOfDay},A.equalsEpsilon=function(t,r,i){if(null===i||isNaN(i))throw new e("epsilon is required and must be a number.");return Math.abs(t.getSecondsDifference(r))<=i},A.prototype.clone=function(e){return A.clone(this,e)},A.prototype.getTotalDays=function(){return this._julianDayNumber+this._secondsOfDay/i.SECONDS_PER_DAY},A.prototype.getJulianDayNumber=function(){return this._julianDayNumber},A.prototype.getJulianTimeFraction=function(){return this._secondsOfDay/i.SECONDS_PER_DAY},A.prototype.getSecondsOfDay=function(){return this._secondsOfDay};var D=new A(0,0,o.TAI);return A.prototype.toGregorianDate=function(){var e=!1,t=u(this,D);r(t)||(this.addSeconds(-1,D),t=u(D,D),e=!0);var n=t._julianDayNumber,o=t._secondsOfDay;o>=43200&&(n+=1);var a=0|n+68569,s=0|4*a/146097;a=0|a-(0|(146097*s+3)/4);var l=0|4e3*(a+1)/1461001;a=0|a-(0|1461*l/4)+31;var c=0|80*a/2447,h=0|a-(0|2447*c/80);a=0|c/11;var d=0|c+2-12*a,p=0|100*(s-49)+l+a,f=0|o/i.SECONDS_PER_HOUR,v=o-f*i.SECONDS_PER_HOUR,y=0|v/i.SECONDS_PER_MINUTE;v-=y*i.SECONDS_PER_MINUTE;var g=0|v,_=(v-g)/i.SECONDS_PER_MILLISECOND;return f+=12,f>23&&(f-=24),e&&(g+=1),new m(p,d,h,f,y,g,_,e)},A.prototype.toDate=function(){var e=this.toGregorianDate(),t=e.second;return e.isLeapSecond&&(t-=1),new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,t,e.millisecond))},A.prototype.toIso8601=function(e){var t,i=this.toGregorianDate();return r(e)||0===i.millisecond?r(e)&&0!==e?(t=(.01*i.millisecond).toFixed(e).replace(".","").slice(0,e),s("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,t)):s("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(t=(.01*i.millisecond).toString().replace(".",""),s("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,t))},A.prototype.getSecondsDifference=function(e){var t=this,r=e,n=(r._julianDayNumber-t._julianDayNumber)*i.SECONDS_PER_DAY;return n+(r._secondsOfDay-t._secondsOfDay)},A.prototype.getMinutesDifference=function(e){return this.getSecondsDifference(e)/i.SECONDS_PER_MINUTE},A.prototype.getDaysDifference=function(e){var t=this,r=e,n=r._julianDayNumber-t._julianDayNumber,o=(r._secondsOfDay-t._secondsOfDay)/i.SECONDS_PER_DAY;return n+o},A.prototype.getTaiMinusUtc=function(){v.julianDate=this;var e=n.getLeapSeconds(),r=t(e,v,n.compareLeapSecondDate);return 0>r&&(r=~r,--r,0>r&&(r=0)),e[r].offset},A.prototype.addSeconds=function(t,r){if(null===t||isNaN(t))throw new e("seconds is required and must be a number.");return c(this._julianDayNumber,this._secondsOfDay+t,r)},A.prototype.addMinutes=function(t){if(null===t||isNaN(t))throw new e("duration is required and must be a number.");var r=this._secondsOfDay+t*i.SECONDS_PER_MINUTE;return new A(this._julianDayNumber,r,o.TAI)},A.prototype.addHours=function(t){if(null===t||isNaN(t))throw new e("duration is required and must be a number.");var r=this._secondsOfDay+t*i.SECONDS_PER_HOUR;return new A(this._julianDayNumber,r,o.TAI)},A.prototype.addDays=function(t){if(null===t||isNaN(t))throw new e("duration is required and must be a number.");var r=this._julianDayNumber+t;return new A(r,this._secondsOfDay,o.TAI)},A.prototype.lessThan=function(e){return A.compare(this,e)<0},A.prototype.lessThanOrEquals=function(e){return A.compare(this,e)<=0},A.prototype.greaterThan=function(e){return A.compare(this,e)>0},A.prototype.greaterThanOrEquals=function(e){return A.compare(this,e)>=0},A.prototype.compareTo=function(e){return A.compare(this,e)},A.prototype.equals=function(e){return A.equals(this,e)},A.prototype.equalsEpsilon=function(e,t){return A.equalsEpsilon(this,e,t)},0===n._leapSeconds.length&&(n._leapSeconds=[new n(new A(2441317,43210,o.TAI),10),new n(new A(2441499,43211,o.TAI),11),new n(new A(2441683,43212,o.TAI),12),new n(new A(2442048,43213,o.TAI),13),new n(new A(2442413,43214,o.TAI),14),new n(new A(2442778,43215,o.TAI),15),new n(new A(2443144,43216,o.TAI),16),new n(new A(2443509,43217,o.TAI),17),new n(new A(2443874,43218,o.TAI),18),new n(new A(2444239,43219,o.TAI),19),new n(new A(2444786,43220,o.TAI),20),new n(new A(2445151,43221,o.TAI),21),new n(new A(2445516,43222,o.TAI),22),new n(new A(2446247,43223,o.TAI),23),new n(new A(2447161,43224,o.TAI),24),new n(new A(2447892,43225,o.TAI),25),new n(new A(2448257,43226,o.TAI),26),new n(new A(2448804,43227,o.TAI),27),new n(new A(2449169,43228,o.TAI),28),new n(new A(2449534,43229,o.TAI),29),new n(new A(2450083,43230,o.TAI),30),new n(new A(2450630,43231,o.TAI),31),new n(new A(2451179,43232,o.TAI),32),new n(new A(2453736,43233,o.TAI),33),new n(new A(2454832,43234,o.TAI),34),new n(new A(2456109,43235,o.TAI),35)]),A}),r("Core/ClockStep",["./Enumeration"],function(e){"use strict";var t={TICK_DEPENDENT:new e(0,"TICK_DEPENDENT"),SYSTEM_CLOCK_MULTIPLIER:new e(1,"SYSTEM_CLOCK_MULTIPLIER"),SYSTEM_CLOCK:new e(2,"SYSTEM_CLOCK")};return t}),r("Core/ClockRange",["./Enumeration"],function(e){"use strict";var t={UNBOUNDED:new e(0,"UNBOUNDED"),CLAMPED:new e(1,"CLAMPED"),LOOP_STOP:new e(2,"LOOP_STOP")};return t}),r("Core/Event",["./DeveloperError"],function(e){"use strict";var t=function(){this._listeners=[],this._scopes=[]};return t.prototype.getNumberOfListeners=function(){return this._listeners.length},t.prototype.addEventListener=function(t,r){if("function"!=typeof t)throw new e("listener is required and must be a function.");this._listeners.push(t),this._scopes.push(r);var i=this;return function(){i.removeEventListener(t,r)}},t.prototype.removeEventListener=function(t,r){if("function"!=typeof t)throw new e("listener is required and must be a function.");for(var i=this._listeners,n=this._scopes,o=-1,a=0;ai;i++)e[i].apply(t[i],arguments)},t}),r("Core/Clock",["./defined","./DeveloperError","./JulianDate","./ClockStep","./ClockRange","./Event","./defaultValue"],function(e,t,r,i,n,o,a){"use strict";var s=function(s){s=a(s,a.EMPTY_OBJECT);var l=s.startTime,u=!e(l),c=s.stopTime,h=!e(c),d=s.currentTime,m=!e(d);if(u&&h&&m?(d=new r,l=r.clone(d),c=d.addDays(1)):u&&h?(l=r.clone(d),c=d.addDays(1)):u&&m?(l=c.addDays(-1),d=r.clone(l)):m&&h?(d=r.clone(l),c=l.addDays(1)):m?d=r.clone(l):h?c=d.addDays(1):u&&(l=r.clone(d)),l.greaterThan(c))throw new t("startTime must come before stopTime.");this.startTime=l,this.stopTime=c,this.currentTime=d,this.multiplier=a(s.multiplier,1),this.clockStep=a(s.clockStep,i.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=a(s.clockRange,n.UNBOUNDED),this.shouldAnimate=a(s.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=Date.now()};return s.prototype.tick=function(){var e=Date.now(),t=this.currentTime,o=this.startTime,a=this.stopTime,s=this.multiplier;if(this.shouldAnimate)if(this.clockStep===i.SYSTEM_CLOCK)t=new r;else{if(this.clockStep===i.TICK_DEPENDENT)t=t.addSeconds(s);else{var l=e-this._lastSystemTime;t=t.addSeconds(s*(l/1e3))}if(this.clockRange===n.CLAMPED)t.lessThan(o)?t=o:t.greaterThan(a)&&(t=a);else if(this.clockRange===n.LOOP_STOP)for(t.lessThan(o)&&(t=r.clone(o));t.greaterThan(a);)t=o.addSeconds(a.getSecondsDifference(t))}return this.currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t},s}),r("Core/Color",["./defaultValue","./defined","./freezeObject","./DeveloperError","./FeatureDetection","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var s=function(t,r,i,n){this.red=e(t,1),this.green=e(r,1),this.blue=e(i,1),this.alpha=e(n,1)};s.fromBytes=function(t,r,i,n){return t=s.byteToFloat(e(t,255)),r=s.byteToFloat(e(r,255)),i=s.byteToFloat(e(i,255)),n=s.byteToFloat(e(n,255)),new s(t,r,i,n)};var l,u,c;n.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(t,r,i,n){t=e(t,0)%1,r=e(r,0),i=e(i,0),n=e(n,1);var o=i,l=i,u=i;if(0!==r){var c;c=.5>i?i*(1+r):i+r-i*r;var h=2*i-c;o=a(h,c,t+1/3),l=a(h,c,t),u=a(h,c,t-1/3)}return new s(o,l,u,n)},s.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var a=r.red;if(!t(a)){var l=e(r.minimumRed,0),u=e(r.maximumRed,1);if(l>u)throw new i("minimumRed must be less than or equal to maximumRed");a=l+o.nextRandomNumber()*(u-l)}var c=r.green;if(!t(c)){var h=e(r.minimumGreen,0),d=e(r.maximumGreen,1);if(h>d)throw new i("minimumGreen must be less than or equal to maximumGreen");c=h+o.nextRandomNumber()*(d-h)}var m=r.blue;if(!t(m)){var p=e(r.minimumBlue,0),f=e(r.maximumBlue,1);if(p>f)throw new i("minimumBlue must be less than or equal to maximumBlue");m=p+o.nextRandomNumber()*(f-p)}var v=r.alpha;if(!t(v)){var y=e(r.minimumAlpha,0),g=e(r.maximumAlpha,1);if(y>g)throw new i("minimumAlpha must be less than or equal to maximumAlpha");v=y+o.nextRandomNumber()*(g-y)}return t(n)?(n.red=a,n.green=c,n.blue=m,n.alpha=v,n):new s(a,c,m,v)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,m=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,p=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){if(!t(r))throw new i("color is required");var n=s[r.toUpperCase()];if(t(n))return s.clone(n);var o=h.exec(r);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=d.exec(r),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=m.exec(r),null!==o?new s(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(e(o[4],"1.0"))):(o=p.exec(r),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(r,n,o){if(!t(r))throw new i("value is required");if(!t(n))throw new i("array is required");o=e(o,0),n[o++]=r.red,n[o++]=r.green,n[o++]=r.blue,n[o]=r.alpha},s.unpack=function(r,n,o){if(!t(r))throw new i("array is required");return n=e(n,0),t(o)||(o=new s),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:0|256*e},s.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new s(e.red,e.green,e.blue,e.alpha):void 0},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var r=s.floatToByte(this.red),i=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=i,e[2]=n,e[3]=o,e):[r,i,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.ALICEBLUE=r(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=r(s.fromCssColorString("#FAEBD7")),s.AQUA=r(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=r(s.fromCssColorString("#7FFFD4")),s.AZURE=r(s.fromCssColorString("#F0FFFF")),s.BEIGE=r(s.fromCssColorString("#F5F5DC")),s.BISQUE=r(s.fromCssColorString("#FFE4C4")),s.BLACK=r(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=r(s.fromCssColorString("#FFEBCD")),s.BLUE=r(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=r(s.fromCssColorString("#8A2BE2")),s.BROWN=r(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=r(s.fromCssColorString("#DEB887")),s.CADETBLUE=r(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=r(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=r(s.fromCssColorString("#D2691E")),s.CORAL=r(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=r(s.fromCssColorString("#6495ED")),s.CORNSILK=r(s.fromCssColorString("#FFF8DC")),s.CRIMSON=r(s.fromCssColorString("#DC143C")),s.CYAN=r(s.fromCssColorString("#00FFFF")),s.DARKBLUE=r(s.fromCssColorString("#00008B")),s.DARKCYAN=r(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=r(s.fromCssColorString("#B8860B")),s.DARKGRAY=r(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=r(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=r(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=r(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=r(s.fromCssColorString("#556B2F")),s.DARKORANGE=r(s.fromCssColorString("#FF8C00")),s.DARKORCHID=r(s.fromCssColorString("#9932CC")),s.DARKRED=r(s.fromCssColorString("#8B0000")),s.DARKSALMON=r(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=r(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=r(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=r(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=r(s.fromCssColorString("#00CED1")),s.DARKVIOLET=r(s.fromCssColorString("#9400D3")),s.DEEPPINK=r(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=r(s.fromCssColorString("#00BFFF")),s.DIMGRAY=r(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=r(s.fromCssColorString("#1E90FF")),s.FIREBRICK=r(s.fromCssColorString("#B22222")),s.FLORALWHITE=r(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=r(s.fromCssColorString("#228B22")),s.FUSCHIA=r(s.fromCssColorString("#FF00FF")),s.GAINSBORO=r(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=r(s.fromCssColorString("#F8F8FF")),s.GOLD=r(s.fromCssColorString("#FFD700")),s.GOLDENROD=r(s.fromCssColorString("#DAA520")),s.GRAY=r(s.fromCssColorString("#808080")),s.GREEN=r(s.fromCssColorString("#008000")),s.GREENYELLOW=r(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=r(s.fromCssColorString("#F0FFF0")),s.HOTPINK=r(s.fromCssColorString("#FF69B4")),s.INDIANRED=r(s.fromCssColorString("#CD5C5C")),s.INDIGO=r(s.fromCssColorString("#4B0082")),s.IVORY=r(s.fromCssColorString("#FFFFF0")),s.KHAKI=r(s.fromCssColorString("#F0E68C")),s.LAVENDER=r(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=r(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=r(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=r(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=r(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=r(s.fromCssColorString("#F08080")),s.LIGHTCYAN=r(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=r(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=r(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=r(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=r(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=r(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=r(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=r(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=r(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=r(s.fromCssColorString("#FFFFE0")),s.LIME=r(s.fromCssColorString("#00FF00")),s.LIMEGREEN=r(s.fromCssColorString("#32CD32")),s.LINEN=r(s.fromCssColorString("#FAF0E6")),s.MAGENTA=r(s.fromCssColorString("#FF00FF")),s.MAROON=r(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=r(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=r(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=r(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=r(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=r(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=r(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=r(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=r(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=r(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=r(s.fromCssColorString("#191970")),s.MINTCREAM=r(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=r(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=r(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=r(s.fromCssColorString("#FFDEAD")),s.NAVY=r(s.fromCssColorString("#000080")),s.OLDLACE=r(s.fromCssColorString("#FDF5E6")),s.OLIVE=r(s.fromCssColorString("#808000")),s.OLIVEDRAB=r(s.fromCssColorString("#6B8E23")),s.ORANGE=r(s.fromCssColorString("#FFA500")),s.ORANGERED=r(s.fromCssColorString("#FF4500")),s.ORCHID=r(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=r(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=r(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=r(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=r(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=r(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=r(s.fromCssColorString("#FFDAB9")),s.PERU=r(s.fromCssColorString("#CD853F")),s.PINK=r(s.fromCssColorString("#FFC0CB")),s.PLUM=r(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=r(s.fromCssColorString("#B0E0E6")),s.PURPLE=r(s.fromCssColorString("#800080")),s.RED=r(s.fromCssColorString("#FF0000")),s.ROSYBROWN=r(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=r(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=r(s.fromCssColorString("#8B4513")),s.SALMON=r(s.fromCssColorString("#FA8072")),s.SANDYBROWN=r(s.fromCssColorString("#F4A460")),s.SEAGREEN=r(s.fromCssColorString("#2E8B57")),s.SEASHELL=r(s.fromCssColorString("#FFF5EE")),s.SIENNA=r(s.fromCssColorString("#A0522D")),s.SILVER=r(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=r(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=r(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=r(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=r(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=r(s.fromCssColorString("#00FF7F")),s.STEELBLUE=r(s.fromCssColorString("#4682B4")),s.TAN=r(s.fromCssColorString("#D2B48C")),s.TEAL=r(s.fromCssColorString("#008080")),s.THISTLE=r(s.fromCssColorString("#D8BFD8")),s.TOMATO=r(s.fromCssColorString("#FF6347")),s.TURQUOISE=r(s.fromCssColorString("#40E0D0")),s.VIOLET=r(s.fromCssColorString("#EE82EE")),s.WHEAT=r(s.fromCssColorString("#F5DEB3")),s.WHITE=r(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=r(s.fromCssColorString("#F5F5F5")),s.YELLOW=r(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=r(s.fromCssColorString("#9ACD32")),s}),r("Core/ColorGeometryInstanceAttribute",["./defaultValue","./defined","./Color","./ComponentDatatype","./DeveloperError"],function(e,t,r,i,n){"use strict";var o=function(t,n,o,a){t=e(t,1),n=e(n,1),o=e(o,1),a=e(a,1),this.componentDatatype=i.UNSIGNED_BYTE,this.componentsPerAttribute=4,this.normalize=!0,this.value=new Uint8Array([r.floatToByte(t),r.floatToByte(n),r.floatToByte(o),r.floatToByte(a)])};return o.fromColor=function(e){if(!t(e))throw new n("color is required.");return new o(e.red,e.green,e.blue,e.alpha)},o.toValue=function(e,r){if(!t(e))throw new n("color is required.");return t(r)?e.toBytes(r):new Uint8Array(e.toBytes())},o}),r("Core/CornerType",["../Core/Enumeration"],function(e){"use strict";var t={ROUNDED:new e(0,"ROUNDED"),MITERED:new e(1,"MITERED"),BEVELED:new e(2,"BEVELED")};return t}),r("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=i.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function r(e,t,r,i){return(t||"")+r.toLowerCase()+(i||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var i=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment -},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,r).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(r.path=t.authority&&""==t.path?"/"+this.path:t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],i=""==t[0];for(i&&t.shift(),""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);("."==e||".."==e)&&r.push(""),i&&r.unshift(""),this.path=r.join("/")},e.resolve=function(t,r){var i=s[t]||(s[t]=new e(t)),n=s[r]||(s[r]=new e(r));return i.resolve(n).toString()};var s={};return e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),r("Core/buildModuleUrl",["require","./defined","./DeveloperError","../ThirdParty/Uri"],function(e,t,r,i){"use strict";function n(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var i=e[t].getAttribute("src"),n=h.exec(i);if(null!==n)return n[1]}return void 0}function o(){if(t(l))return l;var e;if(e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:n(),!t(e))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new i(e).resolve(new i(document.location.href))}function a(t){return e.toUrl("../"+t)}function s(e){return new i(e).resolve(o()).toString()}var l,u,c,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(r){t(u)||(u=t(e.toUrl)?a:s),t(c)||(c=document.createElement("a"));var i=u(r);return c.href=i,c.href=c.href,c.href};return d._cesiumScriptRegex=h,d}),r("Core/Iau2006XysSample",[],function(){"use strict";var e=function(e,t,r){this.x=e,this.y=t,this.s=r};return e}),r("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(r,i){if(null===r||"object"!=typeof r)return r;i=e(i,!1);var n=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i&&(a=t(a,i)),n[o]=a}return n};return t}),r("Core/RequestErrorEvent",["./defined"],function(e){"use strict";var t=function(e,t){this.statusCode=e,this.response=t};return t.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},t}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,i,n){return t(e).then(r,i,n)}function t(e){var t,r;return e instanceof i?t=e:s(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=n(e),t}function r(t){return e(t,o)}function i(e){this.then=e}function n(e){var r=new i(function(r){try{return t(r?r(e):e)}catch(i){return o(i)}});return r}function o(e){var r=new i(function(r,i){try{return i?t(i(e)):o(e)}catch(n){return o(n)}});return r}function a(){function e(e,t,r){return d(e,t,r)}function r(e){return p(e)}function n(e){return p(o(e))}function s(e){return m(e)}var l,u,c,h,d,m,p;return u=new i(e),l={then:e,resolve:r,reject:n,progress:s,promise:u,resolver:{resolve:r,reject:n,progress:s}},c=[],h=[],d=function(e,t,r){var i,n;return i=a(),n="function"==typeof r?function(e){try{i.progress(r(e))}catch(t){i.progress(t)}}:function(e){i.progress(e)},c.push(function(r){r.then(e,t).then(i.resolve,i.reject,n)}),h.push(n),i.promise},m=function(e){return f(h,e),e},p=function(e){return e=t(e),d=e.then,p=t,m=y,f(c,e),h=c=C,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,r,i,n,o){return v(2,arguments),e(t,function(t){function s(e){f(e)}function l(e){p(e)}var u,c,h,d,m,p,f,v,g,_;if(g=t.length>>>0,u=Math.max(0,Math.min(r,g)),h=[],c=g-u+1,d=[],m=a(),u)for(v=m.progress,f=function(e){d.push(e),--c||(p=f=y,m.reject(d))},p=function(e){h.push(e),--u||(p=f=y,m.resolve(h))},_=0;g>_;++_)_ in t&&e(t[_],l,s,v);else m.resolve(h);return m.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return v(1,arguments),d(e,g).then(t,r,i)}function h(){return d(arguments,g)}function d(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;n>l;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function m(t,r){var i=w.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},_.apply(t,i)})}function p(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function f(e,t){for(var r,i=0;r=e[i++];)r(t)}function v(e,t){for(var r,i=t.length;i>e;)if(r=t[--i],null!=r&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function y(){}function g(e){return e}var _,w,C;return e.defer=a,e.resolve=t,e.reject=r,e.join=h,e.all=c,e.map=d,e.reduce=m,e.any=u,e.some=l,e.chain=p,e.isPromise=s,i.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(C,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(C,t)})})}},w=[].slice,_=[].reduce||function(e){var t,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;n>o;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof r&&r.amd?r:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),r("Core/loadWithXhr",["./defined","./defaultValue","./DeveloperError","./RequestErrorEvent","../ThirdParty/when"],function(e,t,r,i,n){"use strict";var o=function(i){if(i=t(i,t.EMPTY_OBJECT),!e(i.url))throw new r("options.url is required.");var a=i.responseType,s=t(i.method,"GET"),l=i.data,u=i.headers;return n(i.url,function(e){var t=n.defer();return o.load(e,a,s,l,u,t),t.promise})};return o.load=function(t,r,n,o,a,s){var l=new XMLHttpRequest;if(l.open(n,t,!0),e(a))for(var u in a)a.hasOwnProperty(u)&&l.setRequestHeader(u,a[u]);e(r)&&(l.responseType=r),l.onload=function(){200===l.status?s.resolve(l.response):s.reject(new i(l.status,l.response))},l.onerror=function(){s.reject(new i)},l.send(o)},o.defaultLoad=o.load,o}),r("Core/loadText",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,headers:r})};return t}),r("Core/loadJson",["./clone","./defined","./loadText","./DeveloperError"],function(e,t,r,i){"use strict";var n={Accept:"application/json,*/*;q=0.01"},o=function(o,a){if(!t(o))throw new i("url is required.");return t(a)?t(a.Accept)||(a=e(a),a.Accept=n.Accept):a=n,r(o,a).then(function(e){return JSON.parse(e)})};return o}),r("Core/Iau2006XysData",["./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard","../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=h;return i._julianDayNumber=t,i._secondsOfDay=r,e._sampleZeroDateTT.getDaysDifference(i)}function u(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];var n=s.defer();t._chunkDownloadsInProgress[i]=n;var a,l=t._xysFileUrlTemplate;return a=r(l)?l.replace("{0}",i):e("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),s(o(a),function(e){t._chunkDownloadsInProgress[i]=!1;for(var r=t._samples,o=e.samples,a=3*i*t._samplesPerXysFile,s=0,l=o.length;l>s;++s)r[a+s]=o[s];n.resolve()}),n.promise}var c=function(e){e=t(e,t.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=t(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=t(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new n(this._sampleZeroJulianEphemerisDate,0,a.TAI),this._stepSizeDays=t(e.stepSizeDays,1),this._samplesPerXysFile=t(e.samplesPerXysFile,1e3),this._totalSamples=t(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var r=this._interpolationOrder,i=this._denominators=new Array(r+1),o=this._xTable=new Array(r+1),s=Math.pow(this._stepSizeDays,r),l=0;r>=l;++l){i[l]=s,o[l]=l*this._stepSizeDays;for(var u=0;r>=u;++u)u!==l&&(i[l]*=l-u);i[l]=1/i[l]}this._work=new Array(r+1),this._coef=new Array(r+1)},h=new n(0,0,a.TAI);return c.prototype.preload=function(e,t,r,i){var n=l(this,e,t),o=l(this,r,i),a=0|n/this._stepSizeDays-this._interpolationOrder/2;0>a&&(a=0);var c=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);for(var h=0|a/this._samplesPerXysFile,d=0|c/this._samplesPerXysFile,m=[],p=h;d>=p;++p)m.push(u(this,p));return s.all(m)},c.prototype.computeXysRadians=function(e,t,n){var o=l(this,e,t);if(0>o)return void 0;var a=0|o/this._stepSizeDays;if(a>=this._totalSamples)return void 0;var s=this._interpolationOrder,c=a-(0|s/2);0>c&&(c=0);var h=c+s;h>=this._totalSamples&&(h=this._totalSamples-1,c=h-s,0>c&&(c=0));var d=!1,m=this._samples;if(r(m[3*c])||(u(this,0|c/this._samplesPerXysFile),d=!0),r(m[3*h])||(u(this,0|h/this._samplesPerXysFile),d=!0),d)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var p,f,v=o-c*this._stepSizeDays,y=this._work,g=this._denominators,_=this._coef,w=this._xTable;for(p=0;s>=p;++p)y[p]=v-w[p];for(p=0;s>=p;++p){for(_[p]=1,f=0;s>=f;++f)f!==p&&(_[p]*=y[f]);_[p]*=g[p];var C=3*(c+p);n.x+=_[p]*m[C++],n.y+=_[p]*m[C++],n.s+=_[p]*m[C]}return n},c}),r("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(e,t,r,i,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=i,this.ut1MinusUtc=n};return e}),r("Core/EarthOrientationParameters",["./binarySearch","./defaultValue","./defined","./freezeObject","./loadJson","./EarthOrientationParametersSample","./JulianDate","./LeapSecond","./RuntimeError","./TimeConstants","./TimeStandard","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){return a.compare(e.julianDate,t)}function m(t,i){if(!r(i.columnNames))return t._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(i.samples))return t._dataError="Error in loaded EOP data: The samples property is required.",void 0;var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),h=i.columnNames.indexOf("ut1MinusUtcSeconds"),m=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>h||0>m||0>p||0>f)return t._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var v=t._samples=i.samples,y=t._dates=[];t._dateColumn=n,t._xPoleWanderRadiansColumn=o,t._yPoleWanderRadiansColumn=l,t._ut1MinusUtcSecondsColumn=h,t._xCelestialPoleOffsetRadiansColumn=m,t._yCelestialPoleOffsetRadiansColumn=p,t._taiMinusUtcSecondsColumn=f,t._columnCount=i.columnNames.length,t._lastIndex=void 0;for(var g,_=t._addNewLeapSeconds,w=0,C=v.length;C>w;w+=t._columnCount){var x=v[w+n],S=v[w+f],E=x+u.MODIFIED_JULIAN_DATE_DIFFERENCE,b=new a(E,S,c.TAI);if(y.push(b),_){if(S!==g&&r(g)){var T=s.getLeapSeconds(),A=e(T,b,d);if(0>A){var D=new s(b,S);T.splice(~A,0,D)}}g=S}}}function p(e,t,r,i,n){var o=r*i;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function f(e,t,r){return t+e*(r-t)}function v(e,t,r,i,n,o,a){var s=e._columnCount;if(o>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;var l=t[n],u=t[o];if(l.equals(u)||i.equals(l))return p(e,r,n,s,a),a;if(i.equals(u))return p(e,r,o,s,a),a;var c=l.getSecondsDifference(i)/l.getSecondsDifference(u),h=n*s,d=o*s,m=r[h+e._ut1MinusUtcSecondsColumn],v=r[d+e._ut1MinusUtcSecondsColumn],y=v-m;if(y>.5||-.5>y){var g=r[h+e._taiMinusUtcSecondsColumn],_=r[d+e._taiMinusUtcSecondsColumn];g!==_&&(u.equals(i)?m=v:v-=_-g)}return a.xPoleWander=f(c,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),a.yPoleWander=f(c,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),a.xPoleOffset=f(c,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=f(c,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=f(c,m,v),a}var y=function(e){if(e=t(e,t.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=t(e.addNewLeapSeconds,!0),r(e.data))m(this,e.data);else if(r(e.url)){var i=this;this._downloadPromise=h(n(e.url),function(e){m(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+e.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return y.NONE=i({getPromiseToLoad:function(){return h()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new o(0,0,0,0,0),t}}),y.prototype.getPromiseToLoad=function(){return h(this._downloadPromise)},y.prototype.compute=function(t,i){if(!r(this._samples)){if(r(this._dataError))throw new l(this._dataError);return void 0}if(r(i)||(i=new o(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var n=this._dates,s=this._lastIndex,u=0,c=0;if(r(s)){var h=n[s],d=n[s+1],m=h.lessThanOrEquals(t),p=!r(d),f=p||d.greaterThanOrEquals(t);if(m&&f)return u=s,!p&&d.equals(t)&&++u,c=u+1,v(this,n,this._samples,t,u,c,i),i}var y=e(n,t,a.compare,this._dateColumn);return y>=0?(yu&&(u=0)),this._lastIndex=u,v(this,n,this._samples,t,u,c,i),i},y}),r("Core/Transforms",["./defaultValue","./defined","./DeveloperError","./Iau2006XysData","./Iau2006XysSample","./Math","./Matrix3","./Matrix4","./Cartesian2","./Cartesian3","./Cartesian4","./TimeConstants","./Ellipsoid","./EarthOrientationParameters","./EarthOrientationParametersSample","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";var v={},y=new u,g=new u,_=new u;v.eastNorthUpToFixedFrame=function(r,i,n){if(o.equalsEpsilon(r.x,0,o.EPSILON14)&&o.equalsEpsilon(r.y,0,o.EPSILON14)){var a=o.sign(r.z);return t(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-a,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(0,-a,0,r.x,1,0,0,r.y,0,0,a,r.z,0,0,0,1)}var l=y,c=g,h=_;return i=e(i,d.WGS84),i.geodeticSurfaceNormal(r,l),c.x=-r.y,c.y=r.x,c.z=0,u.normalize(c,c),u.cross(l,c,h),t(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=h.x,n[5]=h.y,n[6]=h.z,n[7]=0,n[8]=l.x,n[9]=l.y,n[10]=l.z,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(c.x,h.x,l.x,r.x,c.y,h.y,l.y,r.y,c.z,h.z,l.z,r.z,0,0,0,1)};var w=new u,C=new u,x=new u;v.northEastDownToFixedFrame=function(r,i,n){if(o.equalsEpsilon(r.x,0,o.EPSILON14)&&o.equalsEpsilon(r.y,0,o.EPSILON14)){var a=o.sign(r.z);return t(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-a,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(-a,0,0,r.x,0,1,0,r.y,0,0,-a,r.z,0,0,0,1)}var l=w,c=C,h=x;return i=e(i,d.WGS84),i.geodeticSurfaceNormal(r,l),c.x=-r.y,c.y=r.x,c.z=0,u.normalize(c,c),u.cross(l,c,h),t(n)?(n[0]=h.x,n[1]=h.y,n[2]=h.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=-l.x,n[9]=-l.y,n[10]=-l.z,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(h.x,c.x,-l.x,r.x,h.y,c.y,-l.y,r.y,h.z,c.z,-l.z,r.z,0,0,0,1)};var S=24110.54841,E=8640184.812866,b=.093104,T=-62e-7,A=1.1772758384668e-19,D=72921158553e-15,P=o.TWO_PI/86400;v.computeTemeToPseudoFixedMatrix=function(e,r){var i,n=e.addSeconds(-e.getTaiMinusUtc()),s=n.getJulianDayNumber(),l=n.getSecondsOfDay(),u=s-2451545;i=l>=43200?(u+.5)/h.DAYS_PER_JULIAN_CENTURY:(u-.5)/h.DAYS_PER_JULIAN_CENTURY;var c=S+i*(E+i*(b+i*T)),d=c*P%o.TWO_PI,m=D+A*(s-2451545.5),p=(l+.5*h.SECONDS_PER_DAY)%h.SECONDS_PER_DAY,f=d+m*p,v=Math.cos(f),y=Math.sin(f);return t(r)?(r[0]=v,r[1]=-y,r[2]=0,r[3]=y,r[4]=v,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new a(v,y,0,-y,v,0,0,0,1)},v.iau2006XysData=new i,v.earthOrientationParameters=m.NONE;var M=32.184,I=2451545;v.preloadIcrfFixed=function(e){var t=e.start.getJulianDayNumber(),r=e.start.getSecondsOfDay()+M,i=e.stop.getJulianDayNumber(),n=e.stop.getSecondsOfDay()+M,o=v.iau2006XysData.preload(t,r,i,n),a=v.earthOrientationParameters.getPromiseToLoad();return f.all([o,a])},v.computeIcrfToFixedMatrix=function(e,r){var i=v.computeFixedToIcrfMatrix(e,r);return t(i)?a.transpose(i,r):void 0};var O=new n(0,0,0),R=new p(0,0,0,0,0,0),L=new a,z=new a;v.computeFixedToIcrfMatrix=function(e,r){var i=v.earthOrientationParameters.compute(e,R);if(!t(i))return void 0;var n=e.getJulianDayNumber(),s=e.getSecondsOfDay()+M,l=v.iau2006XysData.computeXysRadians(n,s,O);if(!t(l))return void 0;var u=l.x+i.xPoleOffset,c=l.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-u*u-c*c)),m=L;m[0]=1-d*u*u,m[3]=-d*u*c,m[6]=u,m[1]=-d*u*c,m[4]=1-d*c*c,m[7]=c,m[2]=-u,m[5]=-c,m[8]=1-d*(u*u+c*c);var p=a.fromRotationZ(-l.s,z),f=a.multiply(m,p,L),y=e.getJulianDayNumber(),g=e.getSecondsOfDay()-e.getTaiMinusUtc()+i.ut1MinusUtc,_=y-2451545,w=g/h.SECONDS_PER_DAY,C=.779057273264+w+.00273781191135448*(_+w);C=C%1*o.TWO_PI;var x=a.fromRotationZ(C,z),S=a.multiply(f,x,L),E=Math.cos(i.xPoleWander),b=Math.cos(i.yPoleWander),T=Math.sin(i.xPoleWander),A=Math.sin(i.yPoleWander),D=n-I+s/h.SECONDS_PER_DAY;D/=36525;var P=-47e-6*D*o.RADIANS_PER_DEGREE/3600,N=Math.cos(P),B=Math.sin(P),F=z;return F[0]=E*N,F[1]=E*B,F[2]=T,F[3]=-b*B+A*T*N,F[4]=b*N+A*T*B,F[5]=-A*E,F[6]=-A*B-b*T*N,F[7]=A*N-b*T*B,F[8]=b*E,a.multiply(S,F,r)};var N=new c;return v.pointToWindowCoordinates=function(e,t,r,i){var n=N;return s.multiplyByVector(e,c.fromElements(r.x,r.y,r.z,1,n),n),c.multiplyByScalar(n,1/n.w,n),s.multiplyByVector(t,n,n),l.fromCartesian4(n,i)},v}),r("Core/Ray",["./DeveloperError","./defaultValue","./Cartesian3"],function(e,t,r){"use strict";var i=function(e,i){i=r.clone(t(i,r.ZERO)),r.equals(i,r.ZERO)||r.normalize(i,i),this.origin=r.clone(t(e,r.ZERO)),this.direction=i};return i.prototype.getPoint=function(t,i){if("number"!=typeof t)throw new e("t is a required number");return i=r.multiplyByScalar(this.direction,t,i),r.add(this.origin,i,i)},i}),r("Core/EllipsoidTangentPlane",["./defaultValue","./defined","./DeveloperError","./Transforms","./AxisAlignedBoundingBox","./IntersectionTests","./Cartesian2","./Cartesian3","./Ellipsoid","./Matrix4","./Ray","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(n,o){if(!t(n))throw new r("origin is required.");if(o=e(o,l.WGS84),n=o.scaleToGeodeticSurface(n),!t(n))throw new r("origin must not be at the center of the ellipsoid.");var a=i.eastNorthUpToFixedFrame(n,o);this._ellipsoid=o,this._origin=s.clone(n),this._xAxis=s.fromCartesian4(u.getColumn(a,0)),this._yAxis=s.fromCartesian4(u.getColumn(a,1));var c=s.fromCartesian4(u.getColumn(a,2));this._plane=h.fromPointNormal(n,c)},m=new n;d.fromPoints=function(e,i){if(!t(e))throw new r("cartesians is required.");var o=n.fromPoints(e,m);return new d(o.center,i)},d.prototype.getEllipsoid=function(){return this._ellipsoid},d.prototype.getOrigin=function(){return this._origin};var p=new c,f=new s;d.prototype.projectPointOntoPlane=function(e,i){if(!t(e))throw new r("cartesian is required.");var n=p;n.origin=e,s.normalize(e,n.direction);var l=o.rayPlane(n,this._plane,f);if(t(l)||(s.negate(n.direction,n.direction),l=o.rayPlane(n,this._plane,f)),t(l)){var u=s.subtract(l,this._origin,l),c=s.dot(this._xAxis,u),h=s.dot(this._yAxis,u);return t(i)?(i.x=c,i.y=h,i):new a(c,h)}return void 0},d.prototype.projectPointsOntoPlane=function(e,i){if(!t(e))throw new r("cartesians is required.");t(i)||(i=[]);for(var n=0,o=e.length,a=0;o>a;a++){var s=this.projectPointOntoPlane(e[a],i[n]);t(s)&&(i[n]=s,n++)}return i.length=n,i};var v=new s;return d.prototype.projectPointsOntoEllipsoid=function(e,i){if(!t(e))throw new r("cartesians is required.");var n=e.length;t(i)?i.length=n:i=new Array(n);for(var o=this._ellipsoid,a=this._origin,l=this._xAxis,u=this._yAxis,c=v,h=0;n>h;++h){var d=e[h];s.multiplyByScalar(l,d.x,c);var m=i[h]=s.add(a,c,i[h]);s.multiplyByScalar(u,d.y,c),s.add(m,c,m),o.scaleToGeocentricSurface(m,m)}return i},d}),r("Core/EllipsoidGeodesic",["./freezeObject","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Math","./Cartesian3","./Cartographic"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=e._uSquared,r=e._ellipsoid.getMaximumRadius(),i=e._ellipsoid.getMinimumRadius(),n=(r-i)/r,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,m=1-d,p=Math.sqrt(m),f=t/4,v=f*f,y=v*f,g=v*v,_=1+f-3*v/4+5*y/4-175*g/64,w=1-f+15*v/8-35*y/8,C=1-3*f+35*v/4,x=1-5*f,S=_*c-w*Math.sin(2*c)*f/2-C*Math.sin(4*c)*v/16-x*Math.sin(6*c)*y/48-5*Math.sin(8*c)*g/512,E=e._constants;E.a=r,E.b=i,E.f=n,E.cosineHeading=o,E.sineHeading=a,E.tanU=s,E.cosineU=l,E.sineU=u,E.sigma=c,E.sineAlpha=h,E.sineSquaredAlpha=d,E.cosineSquaredAlpha=m,E.cosineAlpha=p,E.u2Over4=f,E.u4Over16=v,E.u6Over64=y,E.u8Over256=g,E.a0=_,E.a1=w,E.a2=C,E.a3=x,E.distanceRatio=S}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,r,i,n,o,a){var s=u(e,r);return(1-s)*e*t*(i+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,r,i,n,a,s){var l,u,h,d,m,p=(t-r)/t,f=a-i,v=Math.atan((1-p)*Math.tan(n)),y=Math.atan((1-p)*Math.tan(s)),g=Math.cos(v),_=Math.sin(v),w=Math.cos(y),C=Math.sin(y),x=g*w,S=g*C,E=_*C,b=_*w,T=f,A=o.TWO_PI,D=Math.cos(T),P=Math.sin(T);do{D=Math.cos(T),P=Math.sin(T);var M=S-b*D;h=Math.sqrt(w*w*P*P+M*M),u=E+x*D,l=Math.atan2(h,u);var I;0===h?(I=0,d=1):(I=x*P/h,d=1-I*I),A=T,m=u-2*E/d,isNaN(m)&&(m=0),T=f+c(p,I,d,l,h,u,m)}while(Math.abs(T-A)>o.EPSILON12);var O=d*(t*t-r*r)/(r*r),R=1+O*(4096+O*(O*(320-175*O)-768))/16384,L=O*(256+O*(O*(74-47*O)-128))/1024,z=m*m,N=L*h*(m+L*(u*(2*z-1)-L*m*(4*h*h-3)*(4*z-3)/6)/4),B=r*R*(l-N),F=Math.atan2(w*P,S-b*D),V=Math.atan2(g*P,S*D-b);e._distance=B,e._startHeading=F,e._endHeading=V,e._uSquared=O}function d(e,t,r,n){var o=a.normalize(n.cartographicToCartesian(t,p),m),u=a.normalize(n.cartographicToCartesian(r,p),p);if(Math.abs(Math.abs(a.angleBetween(o,u))-Math.PI)<.0125)throw new i("geodesic position is not unique");h(e,n.getMaximumRadius(),n.getMinimumRadius(),t.longitude,t.latitude,r.longitude,r.latitude),t.height=0,r.height=0,e._start=s.clone(t,e._start),e._end=s.clone(r,e._end),l(e)}var m=new a,p=new a,f=function(e,i,o){var a=t(o,n.WGS84);this._ellipsoid=a,this._start=new s,this._end=new s,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(i)&&d(this,e,i,a)};return f.prototype.getSurfaceDistance=function(){if(!r(this._distance))throw new i("start and end must be set before calling funciton getSurfaceDistance");return this._distance},f.prototype.setEndPoints=function(e,t){if(!r(e))throw new i("start cartographic position is required");if(!r(t))throw new i("end cartgraphic position is required");d(this,e,t,this._ellipsoid)},f.prototype.getStart=function(){return this._start},f.prototype.getEnd=function(){return this._end},f.prototype.getStartHeading=function(){if(!r(this._distance))throw new i("start and end must be set before calling funciton getStartHeading");return this._startHeading},f.prototype.getEndHeading=function(){if(!r(this._distance))throw new i("start and end must be set before calling funciton getEndHeading");return this._endHeading},f.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},f.prototype.interpolateUsingSurfaceDistance=function(e,t){if(!r(this._distance))throw new i("start and end must be set before calling funciton interpolateUsingSurfaceDistance");var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),l=Math.cos(4*o),u=Math.cos(6*o),h=Math.sin(2*o),d=Math.sin(4*o),m=Math.sin(6*o),p=Math.sin(8*o),f=o*o,v=o*f,y=n.u8Over256,g=n.u2Over4,_=n.u6Over64,w=n.u4Over16,C=2*v*y*a/3+o*(1-g+7*w/4-15*_/4+579*y/64-(w-15*_/4+187*y/16)*a-(5*_/4-115*y/16)*l-29*y*u/16)+(g/2-w+71*_/32-85*y/16)*h+(5*w/16-5*_/4+383*y/96)*d-f*((_-11*y/2)*h+5*y*d/2)+(29*_/96-29*y/16)*m+539*y*p/1536,x=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(x));C-=n.sigma;var E=Math.cos(2*n.sigma+C),b=Math.sin(C),T=Math.cos(C),A=n.cosineU*T,D=n.sineU*b,P=Math.atan2(b*n.sineHeading,A-D*n.cosineHeading),M=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return r(t)?(t.longitude=this._start.longitude+M,t.latitude=S,t.height=0,t):new s(this._start.longitude+M,S,0)},f}),r("Core/PolylinePipeline",["./defaultValue","./defined","./DeveloperError","./Cartographic","./Cartesian3","./Cartesian4","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./Math","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t,r,i){var o=i.scaleToGeodeticSurface(e,T),a=i.scaleToGeodeticSurface(t,A),s=n.angleBetween(o,a),l=Math.ceil(s/r),u=new Array(3*l),c=i.cartesianToCartographic(o,S),h=i.cartesianToCartographic(a,E);D.setEndPoints(c,h);var d=D.getSurfaceDistance()/l,m=0;c.height=0;var p=i.cartographicToCartesian(c,b);u[m++]=p.x,u[m++]=p.y,u[m++]=p.z;for(var f=1;l>f;f++){var v=D.interpolateUsingSurfaceDistance(f*d,E);p=i.cartographicToCartesian(v,b),u[m++]=p.x,u[m++]=p.y,u[m++]=p.z}return u}function m(e,t,r){var i=P;return r.geodeticSurfaceNormal(e,i),n.multiplyByScalar(i,t,i),n.add(e,i,e),e}var p={},f=new c,v=new n,y=new n,g=new h(n.ZERO,0),_=new n,w=new h(n.ZERO,0),C=new n,x=new n,S=new i,E=new i,b=new n,T=new n,A=new n,D=new s,P=new n,M=new n;return p.wrapLongitude=function(r,i){var o=[],a=[];if(t(r)&&r.length>0){i=e(i,c.IDENTITY);var s=c.inverseTransformation(i,f),u=c.multiplyByPoint(s,n.ZERO,v),d=c.multiplyByPointAsVector(s,n.UNIT_Y,y),m=h.fromPointNormal(u,d,g),p=c.multiplyByPointAsVector(s,n.UNIT_X,_),S=h.fromPointNormal(u,p,w),E=1;o.push(n.clone(r[0]));for(var b=o[0],T=r.length,A=1;T>A;++A){var D=r[A];if(h.getPointDistance(S,b)<0||h.getPointDistance(S,D)<0){var P=l.lineSegmentPlane(b,D,m,C);if(t(P)){var M=n.multiplyByScalar(d,5e-9,x);h.getPointDistance(m,b)<0&&n.negate(M,M),o.push(n.add(P,M)),a.push(E+1),n.negate(M,M),o.push(n.add(P,M)),E=1}}o.push(n.clone(r[A])),E++,b=D}a.push(E)}return{positions:o,lengths:a}},p.removeDuplicates=function(e){if(!t(e))throw new r("positions is required.");var i=e.length;if(2>i)return e.slice(0);var o=[];o.push(e[0]);for(var a=1;i>a;++a){var s=e[a-1],l=e[a];n.equals(s,l)||o.push(l)}return o},p.scaleToSurface=function(i,n,o){if(!t(i))throw new r("positions is required");n=e(n,u.RADIANS_PER_DEGREE),o=e(o,a.WGS84);for(var s=i.length,l=[],c=0;s-1>c;c++){var h=i[c],m=i[c+1];l=l.concat(d(h,m,n,o))}var p=i[s-1],f=o.cartesianToCartographic(p,S);f.height=0;var v=o.cartographicToCartesian(f,b);return l.push(v.x,v.y,v.z),l},p.scaleToGeodeticHeight=function(i,o,s,l){if(!t(i))throw new r("positions must be defined.");if(!t(o))throw new r("height must be defined");s=e(s,a.WGS84);var u,c,h=i.length,d=M;if(t(l)){if(l.length!==i.length)throw new r("result.length must be equal to positions.length");c=l}else c=new Array(i.length);if(0===o){for(u=0;h>u;u+=3)d=s.scaleToGeodeticSurface(n.fromArray(i,u,d),d),c[u]=d.x,c[u+1]=d.y,c[u+2]=d.z;return c}var p;if(Array.isArray(o)){if(o.length!==h/3)throw new r("height.length must be equal to positions.length");for(u=0;h>u;u+=3)p=o[u/3],d=n.fromArray(i,u,d),d=m(d,p,s),c[u]=d.x,c[u+1]=d.y,c[u+2]=d.z}else for(p=o,u=0;h>u;u+=3)d=n.fromArray(i,u,d),d=m(d,p,s),c[u]=d.x,c[u+1]=d.y,c[u+2]=d.z;return c},p}),r("Core/PolylineVolumeGeometryLibrary",["./defined","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./DeveloperError","./EllipsoidTangentPlane","./PolylinePipeline","./Matrix3","./Matrix4","./Quaternion","./Transforms","./Math"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e,t){for(var r=new Array(e.length),i=0;io;o++)c[o]=t;return c.push(i),c}var h=i-t,d=h/u;for(o=1;u>o;o++){var m=t+o*d;c[o]=m}return c[0]=t,c.push(i),c}function v(e,i,n,o){var a=new s(n,o),l=a.projectPointOntoPlane(r.add(n,e,Z),Z),u=a.projectPointOntoPlane(r.add(n,i,J),J),c=t.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function y(e,t,i,n,o,a,s,l){var h=W,m=q;F=d.eastNorthUpToFixedFrame(e,o,F),h=c.multiplyByPointAsVector(F,B,h),h=r.normalize(h,h);var p=v(h,t,e,o);k=u.fromRotationZ(p,k),G.z=a,F=c.multiplyTransformation(F,c.fromRotationTranslation(k,G,V),F);var f=U;f[0]=s;for(var y=0;l>y;y++)for(var g=0;gl;l++){s=e[l];var u=s.x-o,c=s.y-a;i[n++]=u,i[n++]=0,i[n++]=c,i[n++]=u,i[n++]=0,i[n++]=c}return s=e[0],i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a,i}function w(e,t){for(var r=e.length,i=new Array(3*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;r>s;s++)i[n++]=e[s].x-o,i[n++]=0,i[n++]=e[s].y-a;return i}function C(e,t,i,n,a,s,l,c,d,p){var f,v=r.angleBetween(r.subtract(t,e,R),r.subtract(i,e,L)),g=n.value===o.BEVELED.value?0:Math.ceil(v/m.toRadians(5));f=a?u.fromQuaternion(h.fromAxisAngle(r.negate(e,R),v/(g+1),j),X):u.fromQuaternion(h.fromAxisAngle(e,v/(g+1),j),X);var _,w;if(t=r.clone(t,Y),g>0)for(var C=p?2:1,x=0;g>x;x++)t=u.multiplyByVector(f,t,t),_=r.subtract(t,e,R),_=r.normalize(_,_),a||(_=r.negate(_,_)),w=s.scaleToGeodeticSurface(t,L),l=y(w,_,c,l,s,d,1,C);else _=r.subtract(t,e,R),_=r.normalize(_,_),a||(_=r.negate(_,_)),w=s.scaleToGeodeticSurface(t,L),l=y(w,_,c,l,s,d,1,1),i=r.clone(i,Y),_=r.subtract(i,e,R),_=r.normalize(_,_),a||(_=r.negate(_,_)),w=s.scaleToGeodeticSurface(i,L),l=y(w,_,c,l,s,d,1,1);return l}function x(e,t){return m.equalsEpsilon(e.latitude,t.latitude,m.EPSILON6)&&m.equalsEpsilon(e.longitude,t.longitude,m.EPSILON6)}var S=[new r,new r],E=new r,b=new r,T=new r,A=new r,D=new r,P=new r,M=new r,I=new r,O=new r,R=new r,L=new r,z={},N=new n,B=new r(-1,0,0),F=new c,V=new c,k=new u,U=u.IDENTITY.clone(),W=new r,q=new i,G=new r,H=new r,j=new h,Y=new r,X=new u;z.removeDuplicatesFromShape=function(e){for(var r=e.length,i=[],n=r-1,o=0;r>o;n=o++){var a=e[n],s=e[o]; -t.equals(a,s)||i.push(s)}return i};var Z=new r,J=new r;z.angleIsGreaterThanPi=function(e,t,i,n){var o=new s(i,n),a=o.projectPointOntoPlane(r.add(i,e,Z),Z),l=o.projectPointOntoPlane(r.add(i,t,J),J);return l.x*a.y-l.y*a.x>=0};var K=new n,Q=new n;return z.removeDuplicatesFromPositions=function(e,t){var r=e.length;if(2>r)return e.slice(0);var i=[];i.push(e[0]);for(var n=1;r>n;++n){var o=e[n-1],a=e[n],s=t.cartesianToCartographic(o,K),l=t.cartesianToCartographic(a,Q);x(s,l)||i.push(a)}return i},z.computePositions=function(e,t,i,n,a){var s=n._ellipsoid,u=p(e,s),c=n._granularity,h=n._cornerType,d=a?_(t,i):w(t,i),v=a?w(t,i):void 0,x=i.height/2,L=i.width/2,N=e.length,B=[],F=a?[]:void 0,V=E,k=b,U=T,W=A,q=D,G=P,H=M,j=I,Y=O,X=e[0],Z=e[1];W=s.geodeticSurfaceNormal(X,W),V=r.subtract(Z,X,V),V=r.normalize(V,V),j=r.cross(W,V,j),j=r.normalize(j,j);var J=u[0],K=u[1];a&&(F=y(X,j,v,F,s,J+x,1,1)),Y=r.clone(X,Y),X=Z,k=r.negate(V,k);for(var Q,$,et=1;N-1>et;et++){var tt=a?2:1;Z=e[et+1],V=r.subtract(Z,X,V),V=r.normalize(V,V),U=r.add(V,k,U),U=r.normalize(U,U),W=s.geodeticSurfaceNormal(X,W);var rt=!r.equalsEpsilon(r.negate(U,R),W,m.EPSILON2);if(rt){U=r.cross(U,W,U),U=r.cross(W,U,U),U=r.normalize(U,U);var it=1/Math.max(.25,r.magnitude(r.cross(U,k,R))),nt=z.angleIsGreaterThanPi(V,k,X,s);nt?(q=r.add(X,r.multiplyByScalar(U,it*L,U),q),G=r.add(q,r.multiplyByScalar(j,L,G),G),S[0]=r.clone(Y,S[0]),S[1]=r.clone(G,S[1]),Q=f(S,J+x,K+x,c),$=l.scaleToSurface(S),B=g($,j,d,B,s,Q,1),j=r.cross(W,V,j),j=r.normalize(j,j),H=r.add(q,r.multiplyByScalar(j,L,H),H),h.value===o.ROUNDED.value||h.value===o.BEVELED.value?C(q,G,H,h,nt,s,B,d,K+x,a):(U=r.negate(U,U),B=y(X,U,d,B,s,K+x,it,tt)),Y=r.clone(H,Y)):(q=r.add(X,r.multiplyByScalar(U,it*L,U),q),G=r.add(q,r.multiplyByScalar(j,-L,G),G),S[0]=r.clone(Y,S[0]),S[1]=r.clone(G,S[1]),Q=f(S,J+x,K+x,c),$=l.scaleToSurface(S,c,s),B=g($,j,d,B,s,Q,1),j=r.cross(W,V,j),j=r.normalize(j,j),H=r.add(q,r.multiplyByScalar(j,-L,H),H),h.value===o.ROUNDED.value||h.value===o.BEVELED.value?C(q,G,H,h,nt,s,B,d,K+x,a):B=y(X,U,d,B,s,K+x,it,tt),Y=r.clone(H,Y)),k=r.negate(V,k)}else B=y(Y,j,d,B,s,J+x,1,1),Y=X;J=K,K=u[et+1],X=Z}S[0]=r.clone(Y,S[0]),S[1]=r.clone(X,S[1]),Q=f(S,J+x,K+x,c),$=l.scaleToSurface(S,c,s),B=g($,j,d,B,s,Q,1),a&&(F=y(X,j,v,F,s,K+x,1,1)),N=B.length;var ot=a?N+F.length:N,at=new Float64Array(ot);return at.set(B),a&&at.set(F,N),at},z}),r("Core/CorridorGeometryLibrary",["./defined","./Cartesian2","./Cartesian3","./CornerType","./EllipsoidTangentPlane","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Matrix3","./Quaternion","./Math"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,n,o,a){var c=r.angleBetween(r.subtract(t,e,v),r.subtract(n,e,y)),h=o.value===i.BEVELED.value?1:Math.ceil(c/u.toRadians(5))+1,d=3*h,m=new Array(d);m[d-3]=n.x,m[d-2]=n.y,m[d-1]=n.z;var p;p=a?s.fromQuaternion(l.fromAxisAngle(r.negate(e,v),c/h,I),O):s.fromQuaternion(l.fromAxisAngle(e,c/h,I),O);var f=0;t=r.clone(t,v);for(var g=0;h>g;g++)t=s.multiplyByVector(p,t,t),m[f++]=t.x,m[f++]=t.y,m[f++]=t.z;return m}function h(e){var t=C,n=x,o=S,a=e[1];n=r.fromArray(e[1],a.length-3,n),o=r.fromArray(e[0],0,o),t=r.multiplyByScalar(r.add(n,o,t),.5,t);var s=c(t,n,o,i.ROUNDED,!1),l=e.length-1,u=e[l-1];a=e[l],n=r.fromArray(u,u.length-3,n),o=r.fromArray(a,0,o),t=r.multiplyByScalar(r.add(n,o,t),.5,t);var h=c(t,n,o,i.ROUNDED,!1);return[s,h]}function d(e,t,i,n){var o=v;return n?o=r.add(e,t,o):(t=r.negate(t,t),o=r.add(e,t,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function m(e,t,i,n){for(var o=new Array(e.length),a=new Array(e.length),s=r.multiplyByScalar(t,i,v),l=r.negate(s,y),u=0,c=e.length-1,h=0;hH;H++){g=s.geodeticSurfaceNormal(W,g),q=n[H+1],_=r.normalize(r.subtract(q,W,_),_),R=r.normalize(r.add(_,I,R),R);var X=!r.equalsEpsilon(r.negate(R,v),g,u.EPSILON2);if(X){R=r.cross(R,g,R),R=r.cross(g,R,R);var Z=l/Math.max(.25,r.magnitude(r.cross(R,I,v))),J=a.angleIsGreaterThanPi(_,I,W,s);R=r.multiplyByScalar(R,Z,R),J?(N=r.add(W,R,N),F=r.add(N,r.multiplyByScalar(O,l,F),F),B=r.add(N,r.multiplyByScalar(O,2*l,B),B),w[0]=r.clone(z,w[0]),w[1]=r.clone(F,w[1]),G=o.scaleToSurface(w,t,s),V=m(G,O,l,V),y&&(k.push(O.x,O.y,O.z),U.push(g.x,g.y,g.z)),L=r.clone(B,L),O=r.normalize(r.cross(g,_,O),O),B=r.add(N,r.multiplyByScalar(O,2*l,B),B),z=r.add(N,r.multiplyByScalar(O,l,z),z),f.value===i.ROUNDED.value||f.value===i.BEVELED.value?j.push({leftPositions:c(N,L,B,f,J)}):j.push({leftPositions:d(W,r.negate(R,R),B,J)})):(B=r.add(W,R,B),F=r.add(B,r.negate(r.multiplyByScalar(O,l,F),F),F),N=r.add(B,r.negate(r.multiplyByScalar(O,2*l,N),N),N),w[0]=r.clone(z,w[0]),w[1]=r.clone(F,w[1]),G=o.scaleToSurface(w,t,s),V=m(G,O,l,V),y&&(k.push(O.x,O.y,O.z),U.push(g.x,g.y,g.z)),L=r.clone(N,L),O=r.normalize(r.cross(g,_,O),O),N=r.add(B,r.negate(r.multiplyByScalar(O,2*l,N),N),N),z=r.add(B,r.negate(r.multiplyByScalar(O,l,z),z),z),f.value===i.ROUNDED.value||f.value===i.BEVELED.value?j.push({rightPositions:c(B,L,N,f,J)}):j.push({rightPositions:d(W,R,N,J)})),I=r.negate(_,I)}W=q}g=s.geodeticSurfaceNormal(W,g),w[0]=r.clone(z,w[0]),w[1]=r.clone(W,w[1]),G=o.scaleToSurface(w,t,s),V=m(G,O,l,V),y&&(k.push(O.x,O.y,O.z),U.push(g.x,g.y,g.z));var K;return f.value===i.ROUNDED.value&&(K=h(V,l,s)),{positions:V,corners:j,lefts:k,normals:U,endPositions:K}},f}),r("Core/CorridorGeometry",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./CornerType","./CorridorGeometryLibrary","./ComponentDatatype","./Ellipsoid","./Geometry","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./BoundingSphere","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function y(e,t,r,n,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=i.normalize(i.cross(r,t,D),D);s.normal&&o.addAttribute(l,t,n,a),s.binormal&&o.addAttribute(c,r,n,a),s.tangent&&o.addAttribute(u,h,n,a)}function g(e,r,n){var s,l,h,d=e.positions,m=e.corners,v=e.endPositions,g=e.lefts,_=e.normals,w=new f,C=0,T=0,M=0;for(l=0;ll;l++)V=i.fromArray($,3*(J-1-l),V),F=i.fromArray($,3*(J+l),F),o.addAttribute(U,F,j),o.addAttribute(U,V,void 0,Y),y(H,X,Z,j,Y,r),z=j/3,B=z+1,L=(Y-2)/3,N=L-1,K[Q++]=L,K[Q++]=z,K[Q++]=N,K[Q++]=N,K[Q++]=z,K[Q++]=B,j+=3,Y-=3}var et=0,tt=0,rt=d[et++],it=d[et++];U.set(rt,j),U.set(it,Y-it.length+1),Z=i.fromArray(g,tt,Z);var nt,ot;for(h=it.length-3,l=0;h>l;l+=3)nt=n.geodeticSurfaceNormal(i.fromArray(rt,l,D),D),ot=n.geodeticSurfaceNormal(i.fromArray(it,h-l,P),P),X=i.normalize(i.add(nt,ot,X),X),y(H,X,Z,j,Y,r),z=j/3,B=z+1,L=(Y-2)/3,N=L-1,K[Q++]=L,K[Q++]=z,K[Q++]=N,K[Q++]=N,K[Q++]=z,K[Q++]=B,j+=3,Y-=3;for(nt=n.geodeticSurfaceNormal(i.fromArray(rt,h,D),D),ot=n.geodeticSurfaceNormal(i.fromArray(it,h,P),P),X=i.normalize(i.add(nt,ot,X),X),tt+=3,l=0;ll;l++)V=i.fromArray(pt,3*(O-l-1),V),F=i.fromArray(pt,3*l,F),o.addAttribute(U,V,void 0,Y),o.addAttribute(U,F,j),y(H,X,Z,j,Y,r),B=j/3,z=B-1,N=(Y-2)/3,L=N+1,K[Q++]=L,K[Q++]=z,K[Q++]=N,K[Q++]=N,K[Q++]=z,K[Q++]=B,j+=3,Y-=3}if(w.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:U}),r.st){var ft,vt,yt=new Float32Array(2*(k/3)),gt=0;if(R){C/=3,T/=3;var _t=Math.PI/(O+1);vt=1/(C-O+1),ft=1/(T-O+1);var wt,Ct=O/2;for(l=Ct+1;O+1>l;l++)wt=c.PI_OVER_TWO+_t*l,yt[gt++]=ft*(1+Math.cos(wt)),yt[gt++]=.5*(1+Math.sin(wt));for(l=1;T-O+1>l;l++)yt[gt++]=l*ft,yt[gt++]=0;for(l=O;l>Ct;l--)wt=c.PI_OVER_TWO-l*_t,yt[gt++]=1-ft*(1+Math.cos(wt)),yt[gt++]=.5*(1+Math.sin(wt));for(l=Ct;l>0;l--)wt=c.PI_OVER_TWO-_t*l,yt[gt++]=1-vt*(1+Math.cos(wt)),yt[gt++]=.5*(1+Math.sin(wt));for(l=C-O;l>0;l--)yt[gt++]=l*vt,yt[gt++]=1;for(l=1;Ct+1>l;l++)wt=c.PI_OVER_TWO+_t*l,yt[gt++]=vt*(1+Math.cos(wt)),yt[gt++]=.5*(1+Math.sin(wt))}else{for(C/=3,T/=3,vt=1/(C-1),ft=1/(T-1),l=0;T>l;l++)yt[gt++]=l*ft,yt[gt++]=0;for(l=C;l>0;l--)yt[gt++]=(l-1)*vt,yt[gt++]=1}w.st=new p({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:yt})}return r.normal&&(w.normal=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.normals})),r.tangent&&(w.tangent=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.tangents})),r.binormal&&(w.binormal=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.binormals})),{attributes:w,indices:K}}function _(e,t){if(!(t.normal||t.binormal||t.tangent||t.st))return e;var r,n,a=e.position.values;(t.normal||t.binormal)&&(r=e.normal.values,n=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(t.normal||t.binormal||t.tangent){var d=t.normal?new Float32Array(6*u):void 0,m=t.binormal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=x,v=S,y=E,g=b,_=T,w=A,C=h;for(s=0;u>s;s+=3){var D=C+h;f=i.fromArray(a,s,f),v=i.fromArray(a,s+u,v),y=i.fromArray(a,(s+3)%u,y),v=i.subtract(v,f,v),y=i.subtract(y,f,y),g=i.normalize(i.cross(v,y,g),g),t.normal&&(o.addAttribute(d,g,D),o.addAttribute(d,g,D+3),o.addAttribute(d,g,C),o.addAttribute(d,g,C+3)),(t.tangent||t.binormal)&&(w=i.fromArray(r,s,w),t.binormal&&(o.addAttribute(m,w,D),o.addAttribute(m,w,D+3),o.addAttribute(m,w,C),o.addAttribute(m,w,C+3)),t.tangent&&(_=i.normalize(i.cross(w,g,_),_),o.addAttribute(p,_,D),o.addAttribute(p,_,D+3),o.addAttribute(p,_,C),o.addAttribute(p,_,C+3))),C+=6}if(t.normal){for(d.set(r),s=0;u>s;s+=3)d[s+u]=-r[s],d[s+u+1]=-r[s+1],d[s+u+2]=-r[s+2];e.normal.values=d}else e.normal=void 0;if(t.binormal?(m.set(n),m.set(n,u),e.binormal.values=m):e.binormal=void 0,t.tangent){var P=e.tangent.values;p.set(P),p.set(P,u),e.tangent.values=p}}if(t.st){var M=e.st.values,I=new Float32Array(6*c);I.set(M),I.set(M,c);for(var O=2*c,R=0;2>R;R++){for(I[O++]=M[0],I[O++]=M[1],s=2;c>s;s+=2){var L=M[s],z=M[s+1];I[O++]=L,I[O++]=z,I[O++]=L,I[O++]=z}I[O++]=M[0],I[O++]=M[1]}e.st.values=I}return e}function w(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;ix;x+=3){var A=d[x],D=d[x+1],P=d[x+2];b[T++]=P+p,b[T++]=D+p,b[T++]=A+p}c=_(c,t);var M,I,O,R;for(x=0;E>x;x+=2)M=x+E,I=M+E,O=M+1,R=I+1,b[T++]=M,b[T++]=I,b[T++]=O,b[T++]=O,b[T++]=I,b[T++]=R;return{attributes:c,indices:b}}var x=new i,S=new i,E=new i,b=new i,T=new i,A=new i,D=new i,P=new i,M=function(i){i=e(i,e.EMPTY_OBJECT);var o=i.positions;if(!t(o))throw new r("options.positions is required.");var a=i.width;if(!t(a))throw new r("options.width is required.");this._positions=o,this._width=a,this._ellipsoid=e(i.ellipsoid,s.WGS84),this._height=e(i.height,0),this._extrudedHeight=e(i.extrudedHeight,this._height),this._cornerType=e(i.cornerType,n.ROUNDED),this._vertexFormat=e(i.vertexFormat,v.DEFAULT),this._granularity=e(i.granularity,c.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry"};return M.createGeometry=function(e){var t=e._positions,i=e._height,n=e._extrudedHeight,a=i!==n,s=h.removeDuplicates(t);if(s.length<2)throw new r("Count of unique positions must be greater than 1.");var u,c=e._ellipsoid,p=e._vertexFormat,f={ellipsoid:c,positions:s,width:e._width,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};if(a){var v=Math.max(i,n);n=Math.min(i,n),i=v,f.height=i,f.extrudedHeight=n,u=C(f,p)}else{var y=o.computePositions(f);u=g(y,p,c),u.attributes.position.values=h.scaleToGeodeticHeight(u.attributes.position.values,i,c,u.attributes.position.values)}var _=u.attributes,w=m.fromVertices(_.position.values,void 0,3);return p.position||(u.attributes.position.values=void 0),new l({attributes:_,indices:u.indices,primitiveType:d.TRIANGLES,boundingSphere:w})},M}),r("Core/CorridorOutlineGeometry",["./defined","./DeveloperError","./Cartesian3","./CornerType","./CorridorGeometryLibrary","./ComponentDatatype","./Ellipsoid","./Geometry","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./defaultValue","./BoundingSphere","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(t,a,s){var u,c,h,d=[],m=t.positions,v=t.corners,y=t.endPositions,C=new f,x=0,S=0,E=0;for(c=0;cc;c++)R=r.fromArray(U,3*(F-1-c),R),O=r.fromArray(U,3*(F+c),O),n.addAttribute(z,O,N),n.addAttribute(z,R,void 0,B),P=N/3,I=P+1,D=(B-2)/3,M=D-1,V[k++]=D,V[k++]=M,V[k++]=P,V[k++]=I,N+=3,B-=3}var W=0,q=m[W++],G=m[W++];for(z.set(q,N),z.set(G,B-G.length+1),h=G.length-3,d.push(N/3,(B-2)/3),c=0;h>c;c+=3)P=N/3,I=P+1,D=(B-2)/3,M=D-1,V[k++]=D,V[k++]=M,V[k++]=P,V[k++]=I,N+=3,B-=3;for(c=0;cc;c++)R=r.fromArray(J,3*(T-c-1),R),O=r.fromArray(J,3*c,O),n.addAttribute(z,R,void 0,B),n.addAttribute(z,O,N),I=N/3,P=I-1,M=(B-2)/3,D=M+1,V[k++]=D,V[k++]=M,V[k++]=P,V[k++]=I,N+=3,B-=3;d.push(N/3)}else d.push(N/3,(B-2)/3);return V[k++]=N/3,V[k++]=(B-2)/3,C.position=new p({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:z}),{attributes:C,indices:V,wallIndices:d}}function y(e){var t=e.ellipsoid,r=n.computePositions(e),i=v(r,t,e.cornerType),o=i.wallIndices,a=e.height,s=e.extrudedHeight,u=i.attributes,h=i.indices,d=u.position.values,m=d.length,p=new Float64Array(m);p.set(d);var f=new Float64Array(2*m);d=c.scaleToGeodeticHeight(d,a,t,d),p=c.scaleToGeodeticHeight(p,s,t,p),f.set(d),f.set(p,m),u.position.values=f,m/=3;var y,g=h.length,_=l.createTypedArray(f.length/3,2*(g+o.length));_.set(h);var w=g;for(y=0;g>y;y+=2){var C=h[y],x=h[y+1];_[w++]=C+m,_[w++]=x+m}var S,E;for(y=0;ya;a++){var v=a/n*e.TWO_PI,y=Math.cos(v),g=Math.sin(v),_=y*i,w=g*i,C=y*r,x=g*r;h[m+p]=_,h[m+p+1]=w,h[m+p+2]=l,h[m+f]=C,h[m+f+1]=x,h[m+f+2]=s,m+=3,o&&(h[d++]=_,h[d++]=w,h[d++]=l,h[d++]=C,h[d++]=x,h[d++]=s)}return h},t}),r("Core/CylinderGeometry",["./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartesian3","./CylinderGeometryLibrary","./Math","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new i,v=new n,y=new n,g=new n,_=new n,w=function(i){i=e(i,e.EMPTY_OBJECT);var n=i.length,o=i.topRadius,a=i.bottomRadius,s=e(i.vertexFormat,p.DEFAULT),l=e(i.slices,128);if(!t(n)||0>=n)throw new r("options.length must be greater than 0.");if(!t(o)||0>o)throw new r("options.topRadius must be greater than 0.");if(!t(a)||0>a)throw new r("options.bottomRadius must be greater than 0.");if(0===a&&0===o)throw new r("bottomRadius and topRadius cannot both equal 0.");if(3>l)throw new r("options.slices must be greater that 3.");this._length=n,this._topRadius=o,this._bottomRadius=a,this._vertexFormat=s,this._slices=l,this._workerName="createCylinderGeometry"};return w.createGeometry=function(e){var t,r=e._length,p=e._topRadius,w=e._bottomRadius,C=e._vertexFormat,x=e._slices,S=x+x,E=x+S,b=S+S,T=o.computePositions(r,p,w,x,!0),A=C.st?new Float32Array(2*b):void 0,D=C.normal?new Float32Array(3*b):void 0,P=C.tangent?new Float32Array(3*b):void 0,M=C.binormal?new Float32Array(3*b):void 0,I=C.normal||C.tangent||C.binormal;if(I){var O=C.tangent||C.binormal,R=0,L=0,z=0,N=v;N.z=0;var B=g,F=y;for(t=0;x>t;t++){var V=t/x*a.TWO_PI,k=Math.cos(V),U=Math.sin(V);I&&(N.x=k,N.y=U,O&&(B=n.normalize(n.cross(n.UNIT_Z,N,B),B)),C.normal&&(D[R++]=k,D[R++]=U,D[R++]=0,D[R++]=k,D[R++]=U,D[R++]=0),C.tangent&&(P[L++]=B.x,P[L++]=B.y,P[L++]=B.z,P[L++]=B.x,P[L++]=B.y,P[L++]=B.z),C.binormal&&(F=n.normalize(n.cross(N,B,F),F),M[z++]=F.x,M[z++]=F.y,M[z++]=F.z,M[z++]=F.x,M[z++]=F.y,M[z++]=F.z))}for(t=0;x>t;t++)C.normal&&(D[R++]=0,D[R++]=0,D[R++]=-1),C.tangent&&(P[L++]=1,P[L++]=0,P[L++]=0),C.binormal&&(M[z++]=0,M[z++]=-1,M[z++]=0);for(t=0;x>t;t++)C.normal&&(D[R++]=0,D[R++]=0,D[R++]=1),C.tangent&&(P[L++]=1,P[L++]=0,P[L++]=0),C.binormal&&(M[z++]=0,M[z++]=1,M[z++]=0)}var W=12*x-12,q=l.createTypedArray(b,W),G=0,H=0;for(t=0;x-1>t;t++)q[G++]=H,q[G++]=H+2,q[G++]=H+3,q[G++]=H,q[G++]=H+3,q[G++]=H+1,H+=2;for(q[G++]=S-2,q[G++]=0,q[G++]=1,q[G++]=S-2,q[G++]=1,q[G++]=S-1,t=1;x-1>t;t++)q[G++]=S+t+1,q[G++]=S+t,q[G++]=S;for(t=1;x-1>t;t++)q[G++]=E,q[G++]=E+t,q[G++]=E+t+1;var j=0;if(C.st){var Y=Math.max(p,w);for(t=0;b>t;t++){var X=n.fromArray(T,3*t,_);A[j++]=(X.x+Y)/(2*Y),A[j++]=(X.y+Y)/(2*Y)}}var Z=new m;C.position&&(Z.position=new d({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:T})),C.normal&&(Z.normal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:D})),C.tangent&&(Z.tangent=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:P})),C.binormal&&(Z.binormal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:M})),C.st&&(Z.st=new d({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:A})),f.x=.5*r,f.y=Math.max(w,p);var J=new c(n.ZERO,i.magnitude(f));return new h({attributes:Z,indices:q,primitiveType:u.TRIANGLES,boundingSphere:J})},w}),r("Core/CylinderOutlineGeometry",["./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartesian3","./CylinderGeometryLibrary","./Math","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new i,f=function(i){i=e(i,e.EMPTY_OBJECT);var n=i.length,o=i.topRadius,a=i.bottomRadius,s=e(i.slices,128),l=Math.max(e(i.numberOfVerticalLines,16),0);if(!t(n)||0>=n)throw new r("options.length must be greater than 0.");if(!t(o)||0>o)throw new r("options.topRadius must be greater than 0.");if(!t(a)||0>a)throw new r("options.bottomRadius must be greater than 0.");if(0===a&&0===o)throw new r("bottomRadius and topRadius cannot both equal 0.");if(3>s)throw new r("options.slices must be greater that 3.");this._length=n,this._topRadius=o,this._bottomRadius=a,this._slices=s,this._numberOfVerticalLines=l,this._workerName="createCylinderOutlineGeometry"};return f.createGeometry=function(e){var t,r=e._length,a=e._topRadius,f=e._bottomRadius,v=e._slices,y=e._numberOfVerticalLines,g=2*v,_=o.computePositions(r,a,f,v,!1),w=2*v;if(y>0){var C=Math.min(y,v);t=Math.round(v/C),w+=C}for(var x=l.createTypedArray(g,2*w),S=0,E=0;v-1>E;E++)x[S++]=E,x[S++]=E+1,x[S++]=E+v,x[S++]=E+1+v;if(x[S++]=v-1,x[S++]=0,x[S++]=v+v-1,x[S++]=v,y>0)for(E=0;v>E;E+=t)x[S++]=E,x[S++]=E+v;var b=new m;b.position=new d({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:_}),p.x=.5*r,p.y=Math.max(f,a);var T=new c(n.ZERO,i.magnitude(p));return new h({attributes:b,indices:x,primitiveType:u.LINES,boundingSphere:T})},f}),r("Core/DefaultProxy",[],function(){"use strict";var e=function(e){this.proxy=e};return e.prototype.getURL=function(e){return this.proxy+"?"+encodeURIComponent(e)},e}),r("Core/EllipsoidGeometry",["./defaultValue","./DeveloperError","./Cartesian3","./Math","./Ellipsoid","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=new r,p=new r,f=new r,v=new r,y=new r(1,1,1),g=Math.cos,_=Math.sin,w=function(i){i=e(i,e.EMPTY_OBJECT);var n=e(i.radii,y),o=e(i.stackPartitions,64),a=e(i.slicePartitions,64),s=e(i.vertexFormat,d.DEFAULT);if(3>a)throw new t("options.slicePartitions cannot be less than three.");if(3>o)throw new t("options.stackPartitions cannot be less than three.");this._radii=r.clone(n),this._stackPartitions=o,this._slicePartitions=a,this._vertexFormat=s,this._workerName="createEllipsoidGeometry"};return w.createGeometry=function(e){var t,d,y=e._radii,w=n.fromCartesian3(y),C=e._stackPartitions,x=e._slicePartitions,S=e._vertexFormat,E=2+(C-1)*x,b=new Float64Array(3*E),T=6*x*(C-1),A=a.createTypedArray(E,T),D=S.normal?new Float32Array(3*E):void 0,P=S.tangent?new Float32Array(3*E):void 0,M=S.binormal?new Float32Array(3*E):void 0,I=S.st?new Float32Array(2*E):void 0,O=new Array(x),R=new Array(x);for(t=0;x>t;t++){var L=i.TWO_PI*t/x;O[t]=g(L),R[t]=_(L)}var z=0;for(b[z++]=0,b[z++]=0,b[z++]=y.z,t=1;C>t;t++){var N=Math.PI*t/C,B=_(N),F=y.x*B,V=y.y*B,k=y.z*g(N);for(d=0;x>d;d++)b[z++]=O[d]*F,b[z++]=R[d]*V,b[z++]=k}b[z++]=0,b[z++]=0,b[z++]=-y.z;var U=new h;S.position&&(U.position=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:b}));var W=0,q=0,G=0,H=0;if(S.st||S.normal||S.tangent||S.binormal){for(t=0;E>t;t++){var j=r.fromArray(b,3*t,m),Y=w.geodeticSurfaceNormal(j,p);if(S.st&&(I[W++]=Math.atan2(Y.y,Y.x)/i.TWO_PI+.5,I[W++]=Math.asin(Y.z)/Math.PI+.5),S.normal&&(D[q++]=Y.x,D[q++]=Y.y,D[q++]=Y.z),S.tangent||S.binormal){var X=f;if(0===t||t===E-1?(r.cross(r.UNIT_X,Y,X),r.normalize(X,X)):(r.cross(r.UNIT_Z,Y,X),r.normalize(X,X)),S.tangent&&(P[G++]=X.x,P[G++]=X.y,P[G++]=X.z),S.binormal){var Z=r.cross(Y,X,v);r.normalize(Z,Z),M[H++]=Z.x,M[H++]=Z.y,M[H++]=Z.z}}}S.st&&(U.st=new c({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:I})),S.normal&&(U.normal=new c({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:D})),S.tangent&&(U.tangent=new c({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:P})),S.binormal&&(U.binormal=new c({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:M}))}for(z=0,t=1;x>t;t++)A[z++]=0,A[z++]=t,A[z++]=t+1;for(A[z++]=0,A[z++]=x,A[z++]=1,t=0;C-2>t;t++){var J=t*x+1,K=(t+1)*x+1;for(d=0;x-1>d;d++)A[z++]=K+d,A[z++]=K+d+1,A[z++]=J+d+1,A[z++]=K+d,A[z++]=J+d+1,A[z++]=J+d;A[z++]=K+x-1,A[z++]=K,A[z++]=J,A[z++]=K+x-1,A[z++]=J,A[z++]=J+x-1}var Q=E-1;for(t=Q-1;t>Q-x;t--)A[z++]=Q,A[z++]=t,A[z++]=t-1;return A[z++]=Q,A[z++]=Q-x,A[z++]=Q-1,new u({attributes:U,indices:A,primitiveType:s.TRIANGLES,boundingSphere:l.fromEllipsoid(w)})},w}),r("Core/EllipsoidOutlineGeometry",["./defaultValue","./DeveloperError","./Cartesian3","./Math","./Ellipsoid","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=new r(1,1,1),m=Math.cos,p=Math.sin,f=function(i){i=e(i,e.EMPTY_OBJECT);var n=e(i.radii,d),o=e(i.stackPartitions,10),a=e(i.slicePartitions,8),s=e(i.subdivisions,128);if(1>o)throw new t("options.stackPartitions cannot be less than 1");if(0>a)throw new t("options.slicePartitions cannot be less than 0");if(0>s)throw new t("options.subdivisions must be greater than or equal to zero.");this._radii=r.clone(n),this._stackPartitions=o,this._slicePartitions=a,this._subdivisions=s,this._workerName="createEllipsoidOutlineGeometry"};return f.createGeometry=function(e){var t,r,d,f,v,y,g=e._radii,_=n.fromCartesian3(g),w=e._stackPartitions,C=e._slicePartitions,x=e._subdivisions,S=x*(w+C-1),E=S-C+2,b=new Float64Array(3*E),T=a.createTypedArray(E,2*S),A=0,D=new Array(x),P=new Array(x);for(t=0;x>t;t++)d=i.TWO_PI*t/x,D[t]=m(d),P[t]=p(d);for(t=1;w>t;t++)for(f=Math.PI*t/w,v=m(f),y=p(f),r=0;x>r;r++)b[A++]=g.x*D[r]*y,b[A++]=g.y*P[r]*y,b[A++]=g.z*v;for(D.length=C,P.length=C,t=0;C>t;t++)d=i.TWO_PI*t/C,D[t]=m(d),P[t]=p(d);for(b[A++]=0,b[A++]=0,b[A++]=g.z,t=1;x>t;t++)for(f=Math.PI*t/x,v=m(f),y=p(f),r=0;C>r;r++)b[A++]=g.x*D[r]*y,b[A++]=g.y*P[r]*y,b[A++]=g.z*v;for(b[A++]=0,b[A++]=0,b[A++]=-g.z,A=0,t=0;w-1>t;++t){var M=t*x;for(r=0;x-1>r;++r)T[A++]=M+r,T[A++]=M+r+1;T[A++]=M+x-1,T[A++]=M}var I=x*(w-1);for(r=1;C+1>r;++r)T[A++]=I,T[A++]=I+r;for(t=0;x-2>t;++t){var O=t*C+1+I,R=(t+1)*C+1+I;for(r=0;C-1>r;++r)T[A++]=R+r,T[A++]=O+r;T[A++]=R+C-1,T[A++]=O+C-1}var L=b.length/3-1;for(r=L-1;r>L-C-1;--r)T[A++]=L,T[A++]=r;var z=new h({position:new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:b})});return new u({attributes:z,indices:T,primitiveType:s.LINES,boundingSphere:l.fromEllipsoid(_)})},f}),r("Core/EllipsoidalOccluder",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./BoundingSphere"],function(e,t,r,i,n){"use strict";function o(e,t,r){var n=e.transformPositionToScaledSpace(t,d),o=i.magnitudeSquared(n),a=Math.sqrt(o),s=i.divideByScalar(n,a,m);o=Math.max(1,o),a=Math.max(1,a);var l=i.dot(s,r),u=i.magnitude(i.cross(s,r)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function a(e,t,r){return 0>=t||t===1/0||t!==t?void 0:i.multiplyByScalar(e,t,r)}function s(e,t){return e.transformPositionToScaledSpace(t,p),i.normalize(p,p)}var l=function(e,n){if(!t(e))throw new r("ellipsoid is required.");this._ellipsoid=e,this._cameraPosition=new i,this._cameraPositionInScaledSpace=new i,this._distanceToLimbInScaledSpaceSquared=0,t(n)&&this.setCameraPosition(n)};l.prototype.getEllipsoid=function(){return this._ellipsoid},l.prototype.setCameraPosition=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=i.magnitudeSquared(r)-1;i.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=n},l.prototype.getCameraPosition=function(){return this._cameraPosition};var u=new i;l.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,u);return this.isScaledSpacePointVisible(r)},l.prototype.isScaledSpacePointVisible=function(e){var t=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,n=i.subtract(e,t,u),o=-i.dot(n,t),a=o>r&&o*o/i.magnitudeSquared(n)>r;return!a},l.prototype.computeHorizonCullingPoint=function(e,i,n){if(!t(e))throw new r("directionToPoint is required");if(!t(i))throw new r("positions is required");for(var l=this._ellipsoid,u=s(l,e),c=0,h=0,d=i.length;d>h;++h){var m=i[h],p=o(l,m,u);c=Math.max(c,p)}return a(u,c,n)};var c=new i;l.prototype.computeHorizonCullingPointFromVertices=function(n,l,u,h,d){if(!t(n))throw new r("directionToPoint is required");if(!t(l))throw new r("vertices is required");if(!t(u))throw new r("stride is required");h=e(h,i.ZERO);for(var m=this._ellipsoid,p=s(m,n),f=0,v=0,y=l.length;y>v;v+=u){c.x=l[v]+h.x,c.y=l[v+1]+h.y,c.z=l[v+2]+h.z;var g=o(m,c,p);f=Math.max(f,g)}return a(p,f,d)};var h=[];l.prototype.computeHorizonCullingPointFromExtent=function(e,o,a){if(!t(e))throw new r("extent is required."); -var s=e.subsample(o,0,h),l=n.fromPoints(s);return i.magnitude(l.center)<.1*o.getMinimumRadius()?void 0:this.computeHorizonCullingPoint(l.center,s,a)};var d=new i,m=new i,p=new i;return l}),r("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this._removalFunctions=[]};return r.prototype.add=function(r,i,n){if(!e(r))throw new t("event is required");this._removalFunctions.push(r.addEventListener(i,n))},r.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,r=e.length;r>t;++t)e[t]();e.length=0},r}),r("Core/Extent",["./freezeObject","./defaultValue","./defined","./Ellipsoid","./Cartographic","./DeveloperError","./Math"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,i,n){this.west=t(e,0),this.south=t(r,0),this.east=t(i,0),this.north=t(n,0)};s.fromDegrees=function(e,i,n,o,l){return e=a.toRadians(t(e,0)),i=a.toRadians(t(i,0)),n=a.toRadians(t(n,0)),o=a.toRadians(t(o,0)),r(l)?(l.west=e,l.south=i,l.east=n,l.north=o,l):new s(e,i,n,o)},s.fromCartographicArray=function(e,t){if(!r(e))throw new o("cartographics is required.");for(var i=Number.MAX_VALUE,n=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=0,c=e.length;c>u;u++){var h=e[u];i=Math.min(i,h.longitude),n=Math.max(n,h.longitude),a=Math.min(a,h.latitude),l=Math.max(l,h.latitude)}return r(t)?(t.west=i,t.south=a,t.east=n,t.north=l,t):new s(i,a,n,l)},s.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){if("number"!=typeof t)throw new o("epsilon is required and must be a number.");return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.prototype.validate=function(){var e=this.north;if("number"!=typeof e)throw new o("north is required to be a number.");if(e<-a.PI_OVER_TWO||e>a.PI_OVER_TWO)throw new o("north must be in the interval [-Pi/2, Pi/2].");var t=this.south;if("number"!=typeof t)throw new o("south is required to be a number.");if(t<-a.PI_OVER_TWO||t>a.PI_OVER_TWO)throw new o("south must be in the interval [-Pi/2, Pi/2].");var r=this.west;if("number"!=typeof r)throw new o("west is required to be a number.");if(r<-Math.PI||r>Math.PI)throw new o("west must be in the interval [-Pi, Pi].");var i=this.east;if("number"!=typeof i)throw new o("east is required to be a number.");if(i<-Math.PI||i>Math.PI)throw new o("east must be in the interval [-Pi, Pi].")},s.prototype.getSouthwest=function(e){return r(e)?(e.longitude=this.west,e.latitude=this.south,e.height=0,e):new n(this.west,this.south)},s.prototype.getNorthwest=function(e){return r(e)?(e.longitude=this.west,e.latitude=this.north,e.height=0,e):new n(this.west,this.north)},s.prototype.getNortheast=function(e){return r(e)?(e.longitude=this.east,e.latitude=this.north,e.height=0,e):new n(this.east,this.north)},s.prototype.getSoutheast=function(e){return r(e)?(e.longitude=this.east,e.latitude=this.south,e.height=0,e):new n(this.east,this.south)},s.prototype.getCenter=function(e){return r(e)?(e.longitude=.5*(this.west+this.east),e.latitude=.5*(this.south+this.north),e.height=0,e):new n(.5*(this.west+this.east),.5*(this.south+this.north))},s.prototype.intersectWith=function(e,t){if(!r(e))throw new o("otherExtent is required.");var i=Math.max(this.west,e.west),n=Math.max(this.south,e.south),a=Math.min(this.east,e.east),l=Math.min(this.north,e.north);return r(t)?(t.west=i,t.south=n,t.east=a,t.north=l,t):new s(i,n,a,l)},s.prototype.contains=function(e){if(!r(e))throw new o("cartographic is required.");return e.longitude>=this.west&&e.longitude<=this.east&&e.latitude>=this.south&&e.latitude<=this.north},s.prototype.isEmpty=function(){return this.west>=this.east||this.south>=this.north};var l=new n;return s.prototype.subsample=function(e,n,o){e=t(e,i.WGS84),n=t(n,0),r(o)||(o=[]);var s=0,u=this.north,c=this.south,h=this.east,d=this.west,m=l;m.height=n,m.longitude=d,m.latitude=u,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=h,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.latitude=c,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=d,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.latitude=0>u?u:c>0?c:0;for(var p=1;8>p;++p){var f=-Math.PI+p*a.PI_OVER_TWO;f>d&&h>f&&(m.longitude=f,o[s]=e.cartographicToCartesian(m,o[s]),s++)}return 0===m.latitude&&(m.longitude=d,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=h,o[s]=e.cartographicToCartesian(m,o[s]),s++),o.length=s,o},s.MAX_VALUE=e(new s(-Math.PI,-a.PI_OVER_TWO,Math.PI,a.PI_OVER_TWO)),s}),r("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i,n){"use strict";var o=function(e,r,i,n){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(r,0),this[3]=t(n,0)};return o.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3]):void 0},o.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new o),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t):new o(i,-n,n,i)},o.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(t,i,n){var o=2*i,a=t[o],s=t[o+1];return r(n)?(n.x=a,n.y=s,n):new e(a,s)},o.setColumn=function(e,t,r,i){i=o.clone(e,i);var n=2*t;return i[n]=r.x,i[n+1]=r.y,i},o.getRow=function(t,i,n){var o=t[i],a=t[i+2];return r(n)?(n.x=o,n.y=a,n):new e(o,a)},o.setRow=function(e,t,r,i){return i=o.clone(e,i),i[t]=r.x,i[t+2]=r.y,i},o.multiply=function(e,t,i){var n=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],s=e[1]*t[0]+e[3]*t[1],l=e[1]*t[2]+e[3]*t[3];return r(i)?(i[0]=n,i[1]=s,i[2]=a,i[3]=l,i):new o(n,a,s,l)},o.multiplyByVector=function(t,i,n){var o=t[0]*i.x+t[2]*i.y,a=t[1]*i.x+t[3]*i.y;return r(n)?(n.x=o,n.y=a,n):new e(o,a)},o.multiplyByScalar=function(e,t,i){return r(i)?(i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i):new o(e[0]*t,e[2]*t,e[1]*t,e[3]*t)},o.negate=function(e,t){return r(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t):new o(-e[0],-e[2],-e[1],-e[3])},o.transpose=function(e,t){var i=e[0],n=e[2],a=e[1],s=e[3];return r(t)?(t[0]=i,t[1]=n,t[2]=a,t[3]=s,t):new o(i,a,n,s)},o.abs=function(e,t){return r(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t):new o(Math.abs(e[0]),Math.abs(e[2]),Math.abs(e[1]),Math.abs(e[3]))},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},o.IDENTITY=n(new o(1,0,0,1)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n"+"("+this[1]+", "+this[3]+")"},o}),r("Core/ExtentGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./Extent","./Geometry","./GeometryInstance","./GeometryPipeline","./GeographicProjection","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix2","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x){"use strict";function S(e,t){return e<-y.PI_OVER_TWO||e>y.PI_OVER_TWO?!1:t>y.PI||t<-y.PI?!1:!0}function E(e,r,i,n,o){var a=e.radiiSquared;O=z.latitude-e.granYCos*r+i*e.granXSin;var s=et(O),l=tt(O),u=a.z*l;R=z.longitude+r*e.granYSin+i*e.granXCos;var c=s*et(R),h=s*tt(R),d=a.x*c,m=a.y*h,p=rt(d*c+m*h+u*l),f=d/p,v=m/p,y=u/p;t(n)&&(q.x=f+c*n,q.y=v+h*n,q.z=y+l*n),t(o)&&(Y.x=f+c*o,Y.y=v+h*o,Y.z=y+l*o)}function b(e,t){var r=new h({attributes:new v,primitiveType:w.TRIANGLES});return e.position&&(r.attributes.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:t.positions})),e.normal&&(r.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(r.attributes.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.binormals})),r}function T(e,t,r,i,o){var a=e.length,s=t.normal?new Float32Array(a):void 0,l=t.tangent?new Float32Array(a):void 0,u=t.binormal?new Float32Array(a):void 0,c=0,h=i?a/2:0;a=i&&o?a/2:a;for(var d=0;a>d;d+=3){var m=n.fromArray(e,d,q),p=c+1,f=c+2;(t.normal||t.tangent||t.binormal)&&(G=r.geodeticSurfaceNormal(m,G),(t.tangent||t.binormal)&&(n.cross(n.UNIT_Z,G,H),_.multiplyByVector(U,H,H),n.normalize(H,H),t.binormal&&n.normalize(n.cross(G,H,j),j)),i&&(t.normal&&(s[c]=G.x,s[p]=G.y,s[f]=G.z),t.tangent&&(l[c]=H.x,l[p]=H.y,l[f]=H.z),t.binormal&&(u[c]=j.x,u[p]=j.y,u[f]=j.z)),o&&(t.normal&&(s[c+h]=-G.x,s[p+h]=-G.y,s[f+h]=-G.z),t.tangent&&(l[c+h]=-H.x,l[p+h]=-H.y,l[f+h]=-H.z),t.binormal&&(u[c+h]=j.x,u[p+h]=j.y,u[f+h]=j.z))),c+=3}return b(t,{positions:e,normals:s,tangents:l,binormals:u})}function A(e,t,r){for(var i=e.length,o=t.normal?new Float32Array(i):void 0,a=t.tangent?new Float32Array(i):void 0,s=t.binormal?new Float32Array(i):void 0,l=0,u=!0,c=i/2,h=0;c>h;h+=3){var d=n.fromArray(e,h,q),m=l+1,p=l+2;if(t.normal||t.tangent||t.binormal){var f=n.fromArray(e,h+3,J);if(u){var v=n.fromArray(e,h+c,K);n.subtract(f,d,f),n.subtract(v,d,v),G=n.normalize(n.cross(v,f,G),G),u=!1}n.equalsEpsilon(f,d,y.EPSILON10)&&(u=!0),(t.tangent||t.binormal)&&(j=r.geodeticSurfaceNormal(d,j),t.tangent&&(H=n.normalize(n.cross(j,G,H),H))),t.normal&&(o[l]=G.x,o[m]=G.y,o[p]=G.z,o[l+c]=G.x,o[m+c]=G.y,o[p+c]=G.z),t.tangent&&(a[l]=H.x,a[m]=H.y,a[p]=H.z,a[l+c]=H.x,a[m+c]=H.y,a[p+c]=H.z),t.binormal&&(s[l]=j.x,s[m]=j.y,s[p]=j.z,s[l+c]=j.x,s[m+c]=j.y,s[p+c]=j.z)}l+=3}return b(t,{positions:e,normals:o,tangents:a,binormals:s})}function D(e,r,i,n,o){return Q.x=(R-F.west)*n.lonScalar-.5,Q.y=(O-F.south)*n.latScalar-.5,g.multiplyByVector(V,Q,Q),Q.x+=.5,Q.y+=.5,t(o)&&(i[r+o]=Q.x,i[r+1+o]=Q.y),i[r++]=Q.x,i[r++]=Q.y,r}function P(e,t,r){return e[t+r]=Y.x,e[t++]=q.x,e[t+r]=Y.y,e[t++]=q.y,e[t+r]=Y.z,e[t++]=q.z,e}function M(e,t){for(var i=t.ellipsoid,n=t.size,o=t.height,l=t.width,u=t.surfaceHeight,c=0,h=e.position?new Float64Array(3*n):void 0,d=e.st?new Float32Array(2*n):void 0,m=0,p=0;o>p;++p)for(var v=0;l>v;++v)E(t,p,v,u),h[m++]=q.x,h[m++]=q.y,h[m++]=q.z,e.st&&(Q.x=(R-F.west)*t.lonScalar-.5,Q.y=(O-F.south)*t.latScalar-.5,g.multiplyByVector(V,Q,Q),Q.x+=.5,Q.y+=.5,d[c++]=Q.x,d[c++]=Q.y);for(var y=T(h,e,i,!0,!1),_=6*(l-1)*(o-1),w=s.createTypedArray(n,_),C=0,x=0,S=0;o-1>S;++S){for(var b=0;l-1>b;++b){var A=C,D=A+l,P=D+1,M=A+1;w[x++]=A,w[x++]=D,w[x++]=M,w[x++]=M,w[x++]=D,w[x++]=P,++C}++C}return y.indices=w,e.st&&(y.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:d})),{boundingSphere:r.fromExtent3D(t.extent,i,u),geometry:y}}function I(t,i){var o=i.surfaceHeight,l=i.extrudedHeight,u=Math.min(l,o),c=Math.max(l,o);if(y.equalsEpsilon(u,c,.1))return M(t,i);var h,p=i.height,v=i.width,g=i.size,_=i.ellipsoid,w=e(i.closeTop,!0),C=e(i.closeBottom,!0),x=2*v+2*p-4,S=2*(x+4),b=new Float64Array(3*S),I=t.st?new Float32Array(2*S):void 0,O=0,R=0,L=0,z=3*(S/2);for(h=0;p>h;h++)E(i,h,O,c,u),b=P(b,R,z),R+=3,t.st&&(L=D(t,L,I,i,S));for(h=p-1,O=0;v>O;O++)E(i,h,O,c,u),b=P(b,R,z),R+=3,t.st&&(L=D(t,L,I,i,S));for(O=v-1,h=p-1;h>=0;h--)E(i,h,O,c,u),b=P(b,R,z),R+=3,t.st&&(L=D(t,L,I,i,S));for(h=0,O=v-1;O>=0;O--)E(i,h,O,c,u),b=P(b,R,z),R+=3,t.st&&(L=D(t,L,I,i,S));var N=A(b,t,_);t.st&&(N.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:I}));var B,F,V,k,U,W=s.createTypedArray(S,6*x),G=b.length/6,H=0;for(U=0;G-1>U;U++){B=U,k=B+1;var j=n.fromArray(b,3*B,J),Q=n.fromArray(b,3*k,K);n.equalsEpsilon(j,Q,y.EPSILON10)||(F=B+G,V=F+1,W[H++]=B,W[H++]=F,W[H++]=k,W[H++]=k,W[H++]=F,W[H++]=V)}if(N.indices=W,C||w){var $,et,tt=0,rt=0;w&&(tt+=g,rt+=6*(v-1)*(p-1),$=c),C&&(tt+=g,rt+=6*(v-1)*(p-1),et=u);var it=new Float64Array(3*tt),nt=t.st?new Float32Array(2*tt):void 0,ot=s.createTypedArray(tt,rt);for(R=0,L=0,z=C&&w?3*g:0,h=0;p>h;++h)for(O=0;v>O;++O)E(i,h,O,$,et),C&&(it[R+z]=Y.x,it[R+1+z]=Y.y,it[R+2+z]=Y.z),w&&(it[R]=q.x,it[R+1]=q.y,it[R+2]=q.z),t.st&&(L=D(t,L,nt,i,2*g)),R+=3;var at=T(it,t,_,w,C);t.st&&(at.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:nt}));var st=0;for(H=0,z/=3,U=0;p-1>U;++U){for(var lt=0;v-1>lt;++lt)B=H,F=B+v,V=F+1,k=B+1,C&&(ot[st++]=k+z,ot[st++]=F+z,ot[st++]=B+z,ot[st++]=V+z,ot[st++]=F+z,ot[st++]=k+z),w&&(ot[st++]=B,ot[st++]=F,ot[st++]=k,ot[st++]=k,ot[st++]=F,ot[st++]=V),++H;++H}at.indices=ot,N=m.combine([new d({geometry:at}),new d({geometry:N})])}var ut=r.fromExtent3D(i.extent,_,c,Z),ct=r.fromExtent3D(i.extent,_,u,X),ht=r.union(ut,ct);return{boundingSphere:ht,geometry:N}}var O,R,L=new n,z=new o,N=new o,B=new n,F=new c,V=new g,k=new g,U=new _,W=new p,q=new n,G=new n,H=new n,j=new n,Y=new n,X=new r,Z=new r,J=new n,K=new n,Q=new i,$=new C,et=Math.cos,tt=Math.sin,rt=Math.sqrt,it=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.extent,n=e(r.granularity,y.RADIANS_PER_DEGREE),o=e(r.ellipsoid,u.WGS84),a=e(r.height,0),s=r.rotation,c=r.stRotation,h=e(r.vertexFormat,x.DEFAULT);if(!t(i))throw new l("extent is required.");if(i.validate(),i.eastm.PI_OVER_TWO?!1:t>m.PI||t<-m.PI?!1:!0}function y(e,r,i,n,o){var a=e.radiiSquared;w=S.latitude-e.granYCos*r+i*e.granXSin;var s=O(w),l=R(w),u=a.z*l;C=S.longitude+r*e.granYSin+i*e.granXCos;var c=s*O(C),h=s*R(C),d=a.x*c,m=a.y*h,p=L(d*c+m*h+u*l),f=d/p,v=m/p,y=u/p;t(n)&&(D.x=f+c*n,D.y=v+h*n,D.z=y+l*n),t(o)&&(P.x=f+c*o,P.y=v+h*o,P.z=y+l*o)}function g(e){var t,i=e.extent,n=e.ellipsoid,o=e.size,s=e.height,l=e.width,u=e.surfaceHeight,c=new Float64Array(3*o),h=0,d=0;for(t=0;l>t;t++)y(e,d,t,u),c[h++]=D.x,c[h++]=D.y,c[h++]=D.z;for(t=l-1,d=1;s>d;d++)y(e,d,t,u),c[h++]=D.x,c[h++]=D.y,c[h++]=D.z;for(d=s-1,t=l-2;t>=0;t--)y(e,d,t,u),c[h++]=D.x,c[h++]=D.y,c[h++]=D.z;for(t=0,d=s-2;d>0;d--)y(e,d,t,u),c[h++]=D.x,c[h++]=D.y,c[h++]=D.z;for(var m=2*(c.length/3),p=a.createTypedArray(c.length/3,m),f=0,v=0;vs;s++)y(e,f,s,o,n),v[p+h]=P.x,v[p+h+1]=P.y,v[p+h+2]=P.z,v[p++]=D.x,v[p++]=D.y,v[p++]=D.z;for(s=c-1,f=1;u>f;f++)y(e,f,s,o,n),v[p+h]=P.x,v[p+h+1]=P.y,v[p+h+2]=P.z,v[p++]=D.x,v[p++]=D.y,v[p++]=D.z;for(f=u-1,s=c-2;s>=0;s--)y(e,f,s,o,n),v[p+h]=P.x,v[p+h+1]=P.y,v[p+h+2]=P.z,v[p++]=D.x,v[p++]=D.y,v[p++]=D.z;for(s=0,f=u-2;f>0;f--)y(e,f,s,o,n),v[p+h]=P.x,v[p+h+1]=P.y,v[p+h+2]=P.z,v[p++]=D.x,v[p++]=D.y,v[p++]=D.z;for(var _=2*(v.length/3)+8,w=a.createTypedArray(v.length/3,_),C=v.length/6,x=0,S=0;C-1>S;S++)w[x++]=S,w[x++]=S+1,w[x++]=S+C,w[x++]=S+C+1;w[x++]=C-1,w[x++]=0,w[x++]=C+C-1,w[x++]=C,w[x++]=0,w[x++]=C,w[x++]=c-1,w[x++]=C+c-1,w[x++]=c+u-2,w[x++]=c+u-2+C,w[x++]=2*c+u-3,w[x++]=2*c+u-3+C;var E=r.fromExtent3D(l,d,o,I),b=r.fromExtent3D(l,d,n,M),T=r.union(E,b);return{boundingSphere:T,positions:v,indices:w}}var w,C,x=new i,S=new n,E=new n,b=new i,T=new p,A=new u,D=new i,P=new i,M=new r,I=new r,O=Math.cos,R=Math.sin,L=Math.sqrt,z=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.extent,n=e(r.granularity,m.RADIANS_PER_DEGREE),o=e(r.ellipsoid,l.WGS84),a=e(r.height,0),u=r.rotation;if(!t(i))throw new s("extent is required.");i.validate(),this._extent=i,this._granularity=n,this._ellipsoid=o,this._surfaceHeight=a,this._rotation=u,this._extrudedHeight=r.extrudedHeight,this._workerName="createExtentOutlineGeometry"};return z.createGeometry=function(e){var r=e._extent,n=e._granularity,a=e._ellipsoid,l=e._surfaceHeight,u=e._rotation,m=e._extrudedHeight,y=Math.ceil((r.east-r.west)/n)+1,w=Math.ceil((r.north-r.south)/n)+1,C=(r.east-r.west)/(y-1),D=(r.north-r.south)/(w-1),P=a.getRadiiSquared();r.getNorthwest(S),r.getCenter(E);var M=D,I=C,L=0,z=0;if(t(u)){var N=O(u);M*=N,I*=N;var B=R(u);L=D*B,z=C*B,A.project(S,x),A.project(E,b),i.subtract(x,b,x),p.fromRotation(u,T),p.multiplyByVector(T,x,x),i.add(x,b,x),A.unproject(x,S);var F=S.latitude,V=F+(y-1)*z,k=F-M*(w-1),U=F-M*(w-1)+(y-1)*z,W=Math.max(F,V,k,U),q=Math.min(F,V,k,U),G=S.longitude,H=G+(y-1)*I,j=G+(w-1)*L,Y=G+(w-1)*L+(y-1)*I,X=Math.max(G,H,j,Y),Z=Math.min(G,H,j,Y);if(!(v(W,Z)&&v(W,X)&&v(q,Z)&&v(q,X)))throw new s("Rotated extent is invalid.")}var J,K=2*y+2*w-4,Q={granYCos:M,granYSin:L,granXCos:I,granXSin:z,radiiSquared:P,ellipsoid:a,extent:r,width:y,height:w,surfaceHeight:l,size:K};J=t(m)?_(Q,m):g(Q);var $=new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:J.positions})});return new c({attributes:$,indices:J.indices,primitiveType:f.LINES,boundingSphere:J.boundingSphere})},z}),r("Core/FAR",[],function(){"use strict";var e=5906376272e3;return e}),r("Core/HeightmapTessellator",["./defaultValue","./defined","./freezeObject","./DeveloperError","./Cartesian3","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a){"use strict";var s={};return s.DEFAULT_STRUCTURE=r({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1}),s.computeVertices=function(r){if(!t(r)||!t(r.heightmap))throw new i("description.heightmap is required.");if(!t(r.width)||!t(r.height))throw new i("description.width and description.height are required.");if(!t(r.vertices))throw new i("description.vertices is required.");if(!t(r.nativeExtent))throw new i("description.nativeExtent is required.");if(!t(r.skirtHeight))throw new i("description.skirtHeight is required.");var l,u,c,h,d=Math.cos,m=Math.sin,p=Math.sqrt,f=Math.atan,v=Math.exp,y=a.PI_OVER_TWO,g=a.toRadians,_=r.vertices,w=r.heightmap,C=r.width,x=r.height,S=r.skirtHeight,E=e(r.isGeographic,!0),b=e(r.ellipsoid,o.WGS84),T=1/b.getMaximumRadius(),A=r.nativeExtent,D=r.extent;t(D)?(l=D.west,u=D.south,c=D.east,h=D.north):E?(l=g(A.west),u=g(A.south),c=g(A.east),h=g(A.north)):(l=A.west*T,u=y-2*f(v(-A.south*T)),c=A.east*T,h=y-2*f(v(-A.north*T)));var P=e(r.relativeToCenter,n.ZERO),M=e(r.structure,s.DEFAULT_STRUCTURE),I=e(M.heightScale,s.DEFAULT_STRUCTURE.heightScale),O=e(M.heightOffset,s.DEFAULT_STRUCTURE.heightOffset),R=e(M.elementsPerHeight,s.DEFAULT_STRUCTURE.elementsPerHeight),L=e(M.stride,s.DEFAULT_STRUCTURE.stride),z=e(M.elementMultiplier,s.DEFAULT_STRUCTURE.elementMultiplier),N=e(M.isBigEndian,s.DEFAULT_STRUCTURE.isBigEndian),B=(A.east-A.west)/(C-1),F=(A.north-A.south)/(x-1),V=b.getRadiiSquared(),k=V.x,U=V.y,W=V.z,q=0,G=65536,H=-65536,j=0,Y=x,X=0,Z=C;S>0&&(--j,++Y,--X,++Z);for(var J=j;Y>J;++J){var K=J;0>K&&(K=0),K>=x&&(K=x-1);var Q=A.north-F*K;Q=E?g(Q):y-2*f(v(-Q*T));for(var $=d(Q),et=m(Q),tt=W*et,rt=(Q-u)/(h-u),it=X;Z>it;++it){var nt=it;0>nt&&(nt=0),nt>=C&&(nt=C-1);var ot=A.west+B*nt;E?ot=g(ot):ot*=T;var at,st=K*C*L+nt*L;if(1===R)at=w[st];else{at=0;var lt;if(N)for(lt=0;R>lt;++lt)at=at*z+w[st+lt];else for(lt=R-1;lt>=0;--lt)at=at*z+w[st+lt]}at=at*I+O,H=Math.max(H,at),G=Math.min(G,at),(it!==nt||J!==K)&&(at-=S);var ut=$*d(ot),ct=$*m(ot),ht=k*ut,dt=U*ct,mt=p(ht*ut+dt*ct+tt*et),pt=1/mt,ft=ht*pt,vt=dt*pt,yt=tt*pt;_[q++]=ft+ut*at-P.x,_[q++]=vt+ct*at-P.y,_[q++]=yt+et*at-P.z,_[q++]=at;var gt=(ot-l)/(c-l);_[q++]=gt,_[q++]=rt}}return{maximumHeight:H,minimumHeight:G}},s}),r("Core/HermitePolynomialApproximation",["./defined","./Math"],function(e,t){"use strict";function r(e,t,i,n,o,a){var s,l,u,c=0;if(n>0){for(l=0;o>l;l++){for(s=!1,u=0;ul;l++){for(s=!1,u=0;ul;l++){s[l]=0;var v=new Array(p);for(f[l]=v,u=0;p>u;u++)v[u]=[]}var y=p,g=new Array(y);for(l=0;y>l;l++)g[l]=l;var _=p-1;for(h=0;a>h;h++){for(u=0;y>u;u++)m=g[u]*a+h,f[h][0].push(o[m]);for(l=1;y>l;l++){var w=!1;for(u=0;y-l>u;u++){var C,x=n[g[u]],S=n[g[u+l]];0>=S-x?(m=g[u]*a+a*l+h,C=o[m],f[h][l].push(C/i(l))):(C=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(C/(S-x))),w=w||0!==C}w||(_=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;_>=l;l++){var E=r(t,g,n,c,l,[]);for(h=0;a>h;h++){var b=f[h][l][0];s[h+c*a]+=b*E}}return s},n}),r("Core/IauOrientationParameters",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t,r,i){this.rightAscension=e,this.declination=t,this.rotation=r,this.rotationRate=i};return e}),r("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,r,i,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,m=26.4057084,p=13.064993,f=.3287146,v=1.7484877,y=-.1589763,g=.0036096,_=.1643573,w=12.9590088;return o.ComputeMoon=function(o,C){e(o)||(o=new r);var x=o.addSeconds(a),S=x.getTotalDays()-s,E=S/n.DAYS_PER_JULIAN_CENTURY,b=(125.045+l*S)*i.RADIANS_PER_DEGREE,T=(250.089+u*S)*i.RADIANS_PER_DEGREE,A=(260.008+c*S)*i.RADIANS_PER_DEGREE,D=(176.625+h*S)*i.RADIANS_PER_DEGREE,P=(357.529+d*S)*i.RADIANS_PER_DEGREE,M=(311.589+m*S)*i.RADIANS_PER_DEGREE,I=(134.963+p*S)*i.RADIANS_PER_DEGREE,O=(276.617+f*S)*i.RADIANS_PER_DEGREE,R=(34.226+v*S)*i.RADIANS_PER_DEGREE,L=(15.134+y*S)*i.RADIANS_PER_DEGREE,z=(119.743+g*S)*i.RADIANS_PER_DEGREE,N=(239.961+_*S)*i.RADIANS_PER_DEGREE,B=(25.053+w*S)*i.RADIANS_PER_DEGREE,F=Math.sin(b),V=Math.sin(T),k=Math.sin(A),U=Math.sin(D),W=Math.sin(P),q=Math.sin(M),G=Math.sin(I),H=Math.sin(O),j=Math.sin(R),Y=Math.sin(L),X=Math.sin(z),Z=Math.sin(N),J=Math.sin(B),K=Math.cos(b),Q=Math.cos(T),$=Math.cos(A),et=Math.cos(D),tt=Math.cos(P),rt=Math.cos(M),it=Math.cos(I),nt=Math.cos(O),ot=Math.cos(R),at=Math.cos(L),st=Math.cos(z),lt=Math.cos(N),ut=Math.cos(B),ct=(269.9949+.0031*E-3.8787*F-.1204*V+.07*k-.0172*U+.0072*q-.0052*Y+.0043*J)*i.RADIANS_PER_DEGREE,ht=(66.5392+.013*E+1.5419*K+.0239*Q-.0278*$+.0068*et-.0029*rt+9e-4*it+8e-4*at-9e-4*ut)*i.RADIANS_PER_DEGREE,dt=(38.3213+13.17635815*S-1.4e-12*S*S+3.561*F+.1208*V-.0642*k+.0158*U+.0252*W-.0066*q-.0047*G-.0046*H+.0028*j+.0052*Y+.004*X+.0019*Z-.0044*J)*i.RADIANS_PER_DEGREE,mt=(13.17635815-1.4e-12*2*S+3.561*K*l+.1208*Q*u-.0642*$*c+.0158*et*h+.0252*tt*d-.0066*rt*m-.0047*it*p-.0046*nt*f+.0028*ot*v+.0052*at*y+.004*st*g+.0019*lt*_-.0044*ut*w)/86400*i.RADIANS_PER_DEGREE;return e(C)||(C=new t),C.rightAscension=ct,C.declination=ht,C.rotation=dt,C.rotationRate=mt,C},o}),r("Core/IauOrientationAxes",["./Cartesian3","./defined","./DeveloperError","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,i,n){var s=c;s.x=Math.cos(r+o.PI_OVER_TWO),s.y=Math.sin(r+o.PI_OVER_TWO),s.z=0;var l=Math.cos(i),u=d;u.x=l*Math.cos(r),u.y=l*Math.sin(r),u.z=Math.sin(i);var m=e.cross(u,s,h);return t(n)||(n=new a),n[0]=s.x,n[1]=m.x,n[2]=u.x,n[3]=s.y,n[4]=m.y,n[5]=u.y,n[6]=s.z,n[7]=m.z,n[8]=u.z,n}var u=function(e){t(e)&&"function"==typeof e||(e=i.ComputeMoon),this._computeFunction=e},c=new e,h=new e,d=new e,m=new a,p=new s;return u.prototype.evaluate=function(r,i){t(r)||(r=new n);var u=this._computeFunction(r),c=l(u.rightAscension,u.declination,i),h=o.zeroToTwoPi(u.rotation),d=s.fromAxisAngle(e.UNIT_Z,h,p),f=a.fromQuaternion(s.conjugate(d,d),m),v=a.multiply(f,c,c);return v},u}),r("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=function(){throw new e("This function defines an interface and should not be called directly.")},t.interpolateOrderZero=function(){throw new e("This function defines an interface and should not be called directly.")},t}),r("Core/TimeInterval",["./defined","./DeveloperError","./freezeObject","./JulianDate","./TimeStandard"],function(e,t,r,i,n){"use strict";var o=function(r,n,o,a,s){if(!e(r))throw new t("start must be specified.");if(!e(n))throw new t("stop must be specified.");e(o)||(o=!0),e(a)||(a=!0);var l=i.compare(n,r);this.start=r,this.stop=n,this.data=s,this.isStartIncluded=o,this.isStopIncluded=a,this.isEmpty=0>l||0===l&&(!o||!a)};return o.fromIso8601=function(e,t,r,n){var a=e.split("/"),s=i.fromIso8601(a[0]),l=i.fromIso8601(a[1]);return new o(s,l,t,r,n)},o.equals=function(t,r,n){return t===r||e(t)&&e(r)&&(t.isEmpty&&r.isEmpty||t.isStartIncluded===r.isStartIncluded&&t.isStopIncluded===r.isStopIncluded&&i.equals(t.start,r.start)&&i.equals(t.stop,r.stop)&&(t.data===r.data||e(n)&&n(t.data,r.data)))},o.equalsEpsilon=function(r,n,o,a){if("number"!=typeof o)throw new t("epsilon is required and must be a number.");return r===n||e(r)&&e(n)&&(r.isEmpty&&n.isEmpty||r.isStartIncluded===n.isStartIncluded&&r.isStopIncluded===n.isStopIncluded&&i.equalsEpsilon(r.start,n.start,o)&&i.equalsEpsilon(r.stop,n.stop,o)&&(r.data===n.data||e(a)&&a(r.data,n.data)))},o.prototype.clone=function(){return new o(this.start,this.stop,this.isStartIncluded,this.isStopIncluded,this.data)},o.EMPTY=r(new o(new i(0,0,n.TAI),new i(0,0,n.TAI),!1,!1)),o.prototype.intersect=function(t,r){if(!e(t))return o.EMPTY;var n,a,s,l=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded,d=this.start,m=this.stop,p=this.isStartIncluded,f=this.isStopIncluded;return l.greaterThanOrEquals(d)&&m.greaterThanOrEquals(l)?(a=!i.equals(l,d)&&c||p&&c,s=f&&h,n=e(r)?r(this.data,t.data):this.data,m.greaterThanOrEquals(u)?(s=s||!i.equals(u,m)&&h,new o(l,u,a,s,n)):(s=s||f,new o(l,m,a,s,n))):l.lessThanOrEquals(d)&&d.lessThanOrEquals(u)?(a=i.equals(l,d)===!1&&p||p&&c,s=f&&h,n=e(r)?r(this.data,t.data):this.data,m.greaterThanOrEquals(u)?(s=s||i.equals(u,m)===!1&&h,new o(d,u,a,s,n)):(s=s||f,new o(d,m,a,s,n))):o.EMPTY},o.prototype.contains=function(e){if(this.isEmpty)return!1;var t=i.compare(this.start,e);if(0===t)return this.isStartIncluded;var r=i.compare(e,this.stop);return 0===r?this.isStopIncluded:0>t&&0>r},o.prototype.equals=function(e,t){return o.equals(this,e,t)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o}),r("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,r){"use strict";var i=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new r(i,n,!0,!0)),a={MINIMUM_VALUE:i,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),r("Core/KeyboardEventModifier",["./Enumeration"],function(e){"use strict";var t={SHIFT:new e(0,"SHIFT"),CTRL:new e(1,"CTRL"),ALT:new e(2,"ALT")};return t}),r("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l=r.length;for(a=0;n>a;a++)o[a]=0;for(a=0;l>a;a++){var u=1;for(s=0;l>s;s++)if(s!==a){var c=r[a]-r[s];u*=(t-r[s])/c}for(s=0;n>s;s++)o[s]+=u*i[a*n+s]}return o},t}),r("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var r={type:"Linear"};return r.getRequiredDataPoints=function(e){if(1!==e)throw new t("Linear interpolation can only generate a first degree polynomial.");return 2},r.interpolateOrderZero=function(r,i,n,o,a){if(2!==i.length)throw new t("The xTable provided to the linear interpolator must have exactly two elements.");if(0>=o)throw new t("There must be at least 1 dependent variable for each independent variable.");e(a)||(a=new Array(o));var s,l,u,c=i[0],h=i[1];if(c===h)throw new t("Divide by zero error: xTable[0] and xTable[1] are equal");for(s=0;o>s;s++)l=n[s],u=n[s+o],a[s]=((u-l)*r+h*l-c*u)/(h-c);return a},r}),r("Core/LinearSpline",["./defaultValue","./defined","./DeveloperError","./Spline","./Cartesian3"],function(e,t,r,i,n){"use strict";var o=function(i){i=e(i,e.EMPTY_OBJECT);var n=i.points,o=i.times;if(!t(n))throw new r("points is required.");if(n.length<2)throw new r("points.length must be greater than or equal to 2.");if(!t(o))throw new r("times is required.");if(o.length!==n.length)throw new r("times.length must be equal to points.length.");this.times=o,this.points=n,this._lastTimeIndex=0};return o.prototype.findTimeInterval=i.prototype.findTimeInterval,o.prototype.evaluate=function(e,r){var i=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),s=(e-o[a])/(o[a+1]-o[a]);return t(r)||(r=new n),n.lerp(i[a],i[a+1],s,r)},o}),r("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)};return i.clone=function(e,r){return t(e)?t(r)?(r.near=e.near,r.nearValue=e.nearValue,r.far=e.far,r.farValue=e.farValue,r):new i(e.near,e.nearValue,e.far,e.farValue):void 0 -},i.packedLength=4,i.pack=function(i,n,o){if(!t(i))throw new r("value is required");if(!t(n))throw new r("array is required");o=e(o,0),n[o++]=i.near,n[o++]=i.nearValue,n[o++]=i.far,n[o]=i.farValue},i.unpack=function(n,o,a){if(!t(n))throw new r("array is required");return o=e(o,0),t(a)||(a=new i),a.near=n[o++],a.nearValue=n[o++],a.far=n[o++],a.farValue=n[o],a},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),r("Core/ObjectOrientedBoundingBox",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./Intersect","./Matrix3","./BoundingRectangle"],function(e,t,r,i,n,o){"use strict";function a(e,t,r,i,n){var a=t[e]+r[0]*i[o.getElementIndex(0,e)]+r[1]*i[o.getElementIndex(1,e)]+r[2]*i[o.getElementIndex(2,e)];return Math.abs(n[e])>a?!0:!1}function s(e,t,r,i,n){var a=n[0]*i[o.getElementIndex(0,e)]+n[1]*i[o.getElementIndex(1,e)]+n[2]*i[o.getElementIndex(2,e)],s=r[e]+t[0]*i[o.getElementIndex(0,e)]+t[1]*i[o.getElementIndex(1,e)]+t[2]*i[o.getElementIndex(2,e)];return Math.abs(a)>s?!0:!1}function l(e,t,r,i,n,a){var s=a[(e+2)%3]*n[o.getElementIndex((e+1)%3,t)]-a[(e+1)%3]*n[o.getElementIndex((e+2)%3,t)],l=r[(e+1)%3]*n[o.getElementIndex((e+2)%3,t)]+r[(e+2)%3]*n[o.getElementIndex((e+1)%3,t)];return l+=i[(t+1)%3]*n[o.getElementIndex(e,(t+2)%3)]+i[(t+2)%3]*n[o.getElementIndex(e,(t+1)%3)],Math.abs(s)>l?!0:!1}var u=function(t,r,n){this.rotation=o.clone(e(t,o.IDENTITY)),this.translation=i.clone(e(r,i.ZERO)),this.scale=i.clone(e(n,i.ZERO))},c=new i,h=new i,d=new i,m=new i,p=new i;new i;var f=new o,v={unitary:new o,diagonal:new o};u.fromPoints=function(e,r){if(t(r)||(r=new u),!t(e)||0===e.length)return r.tranformMatrix=o.IDENTITY,r.translation=i.ZERO,r.scale=i.ZERO,r;var n,a=e.length,s=i.clone(e[0],c);for(n=1;a>n;n++)i.add(s,e[n],s);var l=1/a;i.multiplyByScalar(s,l,s);var y,g=0,_=0,w=0,C=0,x=0,S=0;for(n=0;a>n;n++)y=i.subtract(e[n],s,h),g+=y.x*y.x,_+=y.x*y.y,w+=y.x*y.z,C+=y.y*y.y,x+=y.y*y.z,S+=y.z*y.z;g*=l,_*=l,w*=l,C*=l,x*=l,S*=l;var E=f;E[0]=g,E[1]=_,E[2]=w,E[3]=_,E[4]=C,E[5]=x,E[6]=w,E[7]=x,E[8]=S;var b=o.getEigenDecomposition(E,v),T=o.transpose(b.unitary,r.rotation);y=i.subtract(e[0],s,h);var A=o.multiplyByVector(T,y,d),D=i.clone(A,m),P=i.clone(A,p);for(n=1;a>n;n++)y=i.subtract(e[n],s,y),o.multiplyByVector(T,y,A),i.getMinimumByComponent(P,A,P),i.getMaximumByComponent(D,A,D);var M=i.add(P,D,d);i.multiplyByScalar(M,.5,M),o.multiplyByVector(T,M,M),i.add(s,M,r.translation);var I=i.subtract(D,P,d);return i.multiplyByScalar(I,.5,r.scale),r},u.fromBoundingRectangle=function(e,i,n){if(!t(e))throw new r("boundingRectangle is required");t(n)||(n=new u),t(i)?o.fromRotationZ(i,n.rotation):o.clone(o.IDENTITY,n.rotation);var a=n.scale;a.x=.5*e.width,a.y=.5*e.height,a.z=0;var s=o.multiplyByVector(n.rotation,a,n.translation);return s.x+=e.x,s.y+=e.y,n},u.clone=function(e,r){return t(e)?t(r)?(o.clone(e.rotation,r.rotation),i.clone(e.translation,r.translation),i.clone(e.scale,r.scale),r):new u(e.rotation,e.translation,e.scale):void 0};var y=new o,g=new o,_=new i,w=new Array(3),C=new Array(3),x=new Array(3);return u.intersect=function(e,n){if(!t(e))throw new r("left is required");if(!t(n))throw new r("right is required");var u=o.transpose(e.rotation,y),c=o.multiply(u,n.rotation,g);o.abs(c,c);var h=w,d=C,m=x;return i.subtract(e.translation,n.translation,_),o.multiplyByVector(u,_,_),i.pack(_,h),i.pack(e.scale,d),i.pack(n.scale,m),a(0,d,m,c,h)?!1:a(1,d,m,c,h)?!1:a(2,d,m,c,h)?!1:s(0,d,m,c,h)?!1:s(1,d,m,c,h)?!1:s(2,d,m,c,h)?!1:l(0,0,d,m,c,h)?!1:l(1,0,d,m,c,h)?!1:l(2,0,d,m,c,h)?!1:l(0,1,d,m,c,h)?!1:l(1,1,d,m,c,h)?!1:l(2,1,d,m,c,h)?!1:l(0,2,d,m,c,h)?!1:l(1,2,d,m,c,h)?!1:l(2,2,d,m,c,h)?!1:!0},u.equals=function(e,r){return e===r||t(e)&&t(r)&&i.equals(e.transformedPosition,r.transformedPosition)&&o.equals(e.transformMatrix,r.transformMatrix)&&i.equals(e.extent,r.extent)},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u}),r("Core/Visibility",["./Enumeration"],function(e){"use strict";var t={NONE:new e(-1,"NONE"),PARTIAL:new e(0,"PARTIAL"),FULL:new e(1,"FULL")};return t}),r("Core/Occluder",["./defaultValue","./defined","./DeveloperError","./Math","./Cartesian3","./Visibility","./Ellipsoid","./BoundingSphere"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,i){if(!t(e))throw new r("occluderBoundingSphere is required.");if(!t(i))throw new r("camera position is required.");this._occluderPosition=n.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.setCameraPosition(i)};l.fromBoundingSphere=function(e,i,o){if(!t(e))throw new r("occluderBoundingSphere is required.");if(!t(i))throw new r("camera position is required.");return t(o)?(n.clone(e.center,o._occluderPosition),o._occluderRadius=e.radius,o.setCameraPosition(i),o):new l(e,i)},l.prototype.getPosition=function(){return this._occluderPosition},l.prototype.getRadius=function(){return this._occluderRadius};var u=new n;l.prototype.setCameraPosition=function(e){if(!t(e))throw new r("cameraPosition is required.");e=n.clone(e,this._cameraPosition);var i,o,a,s=n.subtract(this._occluderPosition,e,u),l=n.magnitudeSquared(s),c=this._occluderRadius*this._occluderRadius;if(l>c){i=Math.sqrt(l-c),l=1/Math.sqrt(l),o=n.multiplyByScalar(s,l,u);var h=i*i*l;a=n.add(e,n.multiplyByScalar(o,h,u),u)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=o,this._horizonPlanePosition=a,this._cameraPosition=e};var c=new n;l.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var t=n.subtract(e,this._occluderPosition,c),r=this._occluderRadius;if(r=n.magnitudeSquared(t)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,t=n.subtract(e,this._cameraPosition,t),r*r>n.magnitudeSquared(t)}return!1};var h=new n;l.prototype.isBoundingSphereVisible=function(e){var t=n.clone(e.center,h),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var i=n.subtract(t,this._occluderPosition,c),o=this._occluderRadius-r;if(o=n.magnitudeSquared(i)-o*o,r0?(o=Math.sqrt(o)+this._horizonDistance,i=n.subtract(t,this._cameraPosition,i),o*o+r*r>n.magnitudeSquared(i)):!1;if(o>0){i=n.subtract(t,this._cameraPosition,i);var a=n.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1},l.prototype.getVisibility=function(e){if(!t(e))throw new r("occludeeBS is required.");var i=n.clone(e.center),a=e.radius;if(a>this._occluderRadius)return o.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var s=n.subtract(i,this._occluderPosition),l=this._occluderRadius-a,u=n.magnitudeSquared(s);if(l=u-l*l,l>0){l=Math.sqrt(l)+this._horizonDistance,s=n.subtract(i,this._cameraPosition);var c=n.magnitudeSquared(s);return c>l*l+a*a?o.NONE:(l=this._occluderRadius+a,l=u-l*l,l>0?(l=Math.sqrt(l)+this._horizonDistance,l*l+a*a>c?o.FULL:o.PARTIAL):(s=n.subtract(i,this._horizonPlanePosition),n.dot(s,this._horizonPlaneNormal)>-a?o.PARTIAL:o.FULL))}}return o.NONE},l.getOccludeePoint=function(e,i,o){if(!t(e))throw new r("occluderBoundingSphere is required.");if(!t(o))throw new r("positions is required.");if(0===o.length)throw new r("positions must contain at least one element");var a=n.clone(i),s=n.clone(e.center),u=e.radius,c=o.length;if(n.equals(s,i))throw new r("occludeePosition must be different than occluderBoundingSphere.center");var h=n.normalize(n.subtract(a,s)),d=-n.dot(h,s),m=l._anyRotationVector(s,h,d),p=l._horizonToPlaneNormalDotProduct(e,h,d,m,o[0]);if(!p)return void 0;for(var f,v=1;c>v;++v){if(f=l._horizonToPlaneNormalDotProduct(e,h,d,m,o[v]),!f)return void 0;p>f&&(p=f)}if(.0017453283658983088>p)return void 0;var y=u/p;return n.add(s,n.multiplyByScalar(h,y))};var d=[];return l.computeOccludeePointFromExtent=function(i,o){if(!t(i))throw new r("extent is required.");o=e(o,a.WGS84);var u=i.subsample(o,0,d),c=s.fromPoints(u),h=n.ZERO;return n.equals(h,c.center)?void 0:l.getOccludeePoint(new s(h,o.getMinimumRadius()),c.center,u)},l._anyRotationVector=function(e,t,r){var i=n.abs(t),o=i.x>i.y?0:1;(0===o&&i.z>i.x||1===o&&i.z>i.y)&&(o=2);var a=new n;0===o?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,a=n.UNIT_X):1===o?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,a=n.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,a=n.UNIT_Z);var s=(n.dot(t,i)+r)/-n.dot(t,a);return n.normalize(n.subtract(n.add(i,n.multiplyByScalar(a,s)),e))},l._rotationVector=function(e,t,r,o,a){var s=n.subtract(o,e);if(s=n.normalize(s),n.dot(t,s)<.9999999847691291){var l=n.cross(t,s),u=n.magnitude(l);if(u>i.EPSILON13)return n.normalize(l)}return a},l._horizonToPlaneNormalDotProduct=function(e,t,r,i,o){var a=n.clone(o),s=n.clone(e.center),l=e.radius,u=n.subtract(s,a),c=n.magnitudeSquared(u),h=l*l;if(h>c)return!1;var d=c-h,m=Math.sqrt(d),p=Math.sqrt(c),f=1/p,v=m*f,y=v*m;u=n.normalize(u);var g=n.add(a,n.multiplyByScalar(u,y)),_=Math.sqrt(d-y*y),w=this._rotationVector(s,t,r,a,i),C=new n(w.x*w.x*u.x+(w.x*w.y-w.z)*u.y+(w.x*w.z+w.y)*u.z,(w.x*w.y+w.z)*u.x+w.y*w.y*u.y+(w.y*w.z-w.x)*u.z,(w.x*w.z-w.y)*u.x+(w.y*w.z+w.x)*u.y+w.z*w.z*u.z);C=n.normalize(C);var x=n.multiplyByScalar(C,_);w=n.normalize(n.subtract(n.add(g,x),s));var S=n.dot(t,w);w=n.normalize(n.subtract(n.subtract(g,x),s));var E=n.dot(t,w);return E>S?S:E},l}),r("Core/Packable",["../Core/DeveloperError"],function(e){"use strict";function t(){throw new e("This type should not be instantiated directly.")}var r={packedLength:void 0,pack:t,unpack:t};return r}),r("Core/PackableForInterpolation",["../Core/DeveloperError"],function(e){"use strict";function t(){throw new e("This type should not be instantiated directly.")}var r={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:t,unpackInterpolationResult:t};return r}),r("Core/PolygonGeometryLibrary",["./defaultValue","./defined","./Cartesian3","./Ellipsoid"],function(e,t,r,i){"use strict";function n(e,t,i,n){return r.subtract(t,e,a),r.multiplyByScalar(a,i/n,a),r.add(e,a,a),[a.x,a.y,a.z]}var o={},a=new r;o.subdivideLine=function(e,t,i){var o=r.distance(e,t),a=r.angleBetween(e,t),s=a/i,l=Math.ceil(Math.log(s)/Math.log(2));1>l&&(l=0);var u=Math.pow(2,l),c=o/u,h=new Array(3*u),d=0;h[d++]=e.x,h[d++]=e.y,h[d++]=e.z;for(var m=1;u>m;m++){var p=n(e,t,m*c,o);h[d++]=p[0],h[d++]=p[1],h[d++]=p[2]}return h};var s=new r,l=new r,u=new r,c=new r;return o.scaleToGeodeticHeightExtruded=function(n,o,a,h,d){h=e(h,i.WGS84);var m=s,p=l,f=u,v=c;if(t(n)&&t(n.attributes)&&t(n.attributes.position))for(var y=n.attributes.position.values,g=y.length/2,_=0;g>_;_+=3)r.fromArray(y,_,f),h.geodeticSurfaceNormal(f,m),v=h.scaleToGeodeticSurface(f,v),p=r.multiplyByScalar(m,a,p),p=r.add(v,p,p),y[_+g]=p.x,y[_+1+g]=p.y,y[_+2+g]=p.z,d&&(v=r.clone(f,v)),p=r.multiplyByScalar(m,o,p),p=r.add(v,p,p),y[_]=p.x,y[_+1]=p.y,y[_+2]=p.z;return n},o}),r("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3","./DeveloperError"],function(e,t){"use strict";var r=new t,i=function(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0};return i}),r("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this.length--,r},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),r("Core/WindingOrder",["./Enumeration"],function(e){"use strict";var t={CLOCKWISE:new e(2304,"CLOCKWISE"),COUNTER_CLOCKWISE:new e(2305,"COUNTER_CLOCKWISE"),validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return t}),r("Core/PolygonPipeline",["./DeveloperError","./Math","./Cartesian2","./Cartesian3","./defined","./Geometry","./GeometryAttribute","./Ellipsoid","./EllipsoidTangentPlane","./defaultValue","./pointInsideTriangle","./ComponentDatatype","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t,i){var n=r.subtract(t,e),o=r.subtract(i,t);return n.x*o.y-n.y*o.x>=0}function v(e){for(var t=e[0].x,r=0,i=0;it&&(t=e[i].x,r=i);return r}function y(e){for(var t=e[0][0].x,r=0,i=0;it&&(t=n,r=i)}return r}function g(e){for(var t=[],r=0;rc&&(c=t[h].x);c+=c-l;var d=new i(c,e.y,0);for(h=0;h=e.x||p.x>=e.x)&&(m.y>=e.y&&p.y<=e.y||m.y<=e.y&&p.y>=e.y)){var f=(p.y-m.y)*(d.x-e.x)-(p.x-m.x)*(d.y-e.y);if(0!==f){f=1/f;var y=((p.x-m.x)*(e.y-m.y)-(p.y-m.y)*(e.x-m.x))*f,g=((d.x-e.x)*(e.y-m.y)-(d.y-e.y)*(e.x-m.x))*f;if(y>=0&&1>=y&&g>=0&&1>=g){var _=new r(e.x+y*(d.x-e.x),e.y+y*(d.y-e.y)),w=r.subtract(_,e);f=r.magnitudeSquared(w),o>f&&(s=_,o=f,n[0]=h,n[1]=(h+1)%t.length)}}}}return s}function C(e,t){var i=y(t),n=t[i],o=v(n),a=n[o],s=[],l=w(a,e,s),u=_(e,l);if(-1!==u)return u;var h=r.magnitudeSquared(r.subtract(e[s[0]],a)),d=r.magnitudeSquared(r.subtract(e[s[1]],a)),m=d>h?e[s[0]]:e[s[1]],p=g(e),f=p.indexOf(m);-1!==f&&p.splice(f,1);for(var C=[],x=0;x0){var b=new r(1,0);for(x=0;xD&&(E=D,m=C[x])}}}return e.indexOf(m)}function x(e,t,r){for(var n=q.computeWindingOrder2D(e),o=0;oi&&(i=t.length-1),i===t.length&&(i=0),D(i,t),i}function D(t,n){var o=t-1,a=t+1;0>o&&(o=n.length-1),a===n.length&&(a=0);var s=r.subtract(n[o].position,n[t].position),l=r.subtract(n[a].position,n[t].position);if(s=new i(s.x,s.y,0),l=new i(l.x,l.y,0),P(s,l)){var u=new e("Superfluous vertex found.");throw u.vertexIndex=t,u}}function P(e,t){return 0===i.cross(e,t).z}function M(e,t){return i.cross(e,t).z<0}function I(e,t){return i.cross(e,t).z>0}function O(e,t,r){return i.cross(e,r).z>0&&i.cross(r,t).z>0}function R(e,t,r){return i.cross(e,r).z<0&&i.cross(r,t).z<0}function L(e,t,i){for(var n=0;nt||e>r)&&(t>e||r>e)||t===r&&t===e}function B(t){var r=t.length;if(3===r)return z(t)?[]:[t[0].index,t[1].index,t[2].index];if(t.length<3)throw new e("Invalid polygon: must have at least three vertices.");for(var i=!1,n=0;!i;){var o=10*t.length;if(n>o)return[];n++;for(var a=S(t.length),s=a+1;Math.abs(a-s)<2||Math.abs(a-s)>t.length-2;)s=S(t.length);if(a>s){var l=a;a=s,s=l}try{if(E(a,s,t)){var u=t.splice(a,s-a+1,t[a],t[s]);return B(t).concat(B(u))}}catch(c){if(c.hasOwnProperty("vertexIndex"))return t.splice(c.vertexIndex,1),B(t);throw c}}}var F=0,V=-1,k=1,U=new i,W=new i,q={removeDuplicates:function(t){if(!n(t))throw new e("positions is required.");var r=t.length;if(3>r)throw new e("At least three positions are required.");for(var o=[],a=r-1,s=0;r>s;a=s++){var l=t[a],u=t[s];i.equals(l,u)||o.push(u)}return o},computeArea2D:function(t){if(!n(t))throw new e("positions is required.");var r=t.length;if(3>r)throw new e("At least three positions are required.");for(var i=0,o=r-1,a=0;r>a;o=a++){var s=t[o],l=t[a];i+=s.x*l.y-l.x*s.y}return.5*i},computeWindingOrder2D:function(e){var t=q.computeArea2D(e);return t>=0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},triangulate:function(t){if(!n(t))throw new e("positions is required.");var r=t.length;if(3>r)throw new e("At least three positions are required.");for(var i=[],o=0;r>o;++o)i[o]={position:t[o],index:o};return B(i)},resetSeed:function(e){F=u(e,0)},computeSubdivision:function(r,s,l){if(!n(r))throw new e("positions is required.");if(!n(s))throw new e("indices is required.");if(s.length<3)throw new e("At least three indices are required.");if(0!==s.length%3)throw new e("The number of indices must be divisable by three.");if(l=u(l,t.RADIANS_PER_DEGREE),0>=l)throw new e("granularity must be greater than zero.");for(var c=new m,p=s.length,f=0;p>f;f+=3)c.enqueue({i0:s[f],i1:s[f+1],i2:s[f+2]});for(var v,y=r.slice(0),g=[],_={};c.length>0;){var w,C,x=c.dequeue(),S=y[x.i0],E=y[x.i1],b=y[x.i2],T=i.angleBetween(S,E),A=i.angleBetween(E,b),D=i.angleBetween(b,S),P=Math.max(T,Math.max(A,D));P>l?T===P?(w=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),v=_[w],v||(C=i.add(S,E),i.multiplyByScalar(C,.5,C),y.push(C),v=y.length-1,_[w]=v),c.enqueue({i0:x.i0,i1:v,i2:x.i2}),c.enqueue({i0:v,i1:x.i1,i2:x.i2})):A===P?(w=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),v=_[w],v||(C=i.add(E,b),i.multiplyByScalar(C,.5,C),y.push(C),v=y.length-1,_[w]=v),c.enqueue({i0:x.i1,i1:v,i2:x.i0}),c.enqueue({i0:v,i1:x.i2,i2:x.i0})):D===P&&(w=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),v=_[w],v||(C=i.add(b,S),i.multiplyByScalar(C,.5,C),y.push(C),v=y.length-1,_[w]=v),c.enqueue({i0:x.i2,i1:v,i2:x.i1}),c.enqueue({i0:v,i1:x.i0,i2:x.i1})):(g.push(x.i0),g.push(x.i1),g.push(x.i2))}var M=y.length,I=new Array(3*M),O=0;for(v=0;M>v;v++){var R=y[v];I[O++]=R.x,I[O++]=R.y,I[O++]=R.z}return new o({attributes:{position:new a({componentDatatype:h.DOUBLE,componentsPerAttribute:3,values:I})},indices:g,primitiveType:d.TRIANGLES})},scaleToGeodeticHeight:function(e,t,r,o){r=u(r,s.WGS84);var a=U,l=W;if(t=u(t,0),o=u(o,!0),n(e)&&n(e.attributes)&&n(e.attributes.position))for(var c=e.attributes.position.values,h=c.length,d=0;h>d;d+=3)i.fromArray(c,d,l),o&&(l=r.scaleToGeodeticSurface(l,l)),a=r.geodeticSurfaceNormal(l,a),i.multiplyByScalar(a,t,a),i.add(l,a,l),c[d]=l.x,c[d+1]=l.y,c[d+2]=l.z;return e},eliminateHoles:function(t,r,o){if(!n(t))throw new e("outerRing is required.");if(0===t.length)throw new e("outerRing must not be empty.");if(!n(r))throw new e("innerRings is required.");o=u(o,s.WGS84);for(var a=[],l=0;l0;)d=x(d,a,o);return d}};return q}),r("Core/PolygonGeometry",["./defaultValue","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Quaternion","./Queue","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E){"use strict";function b(e,t,r,i){for(var o=C.fromAxisAngle(e._plane.normal,r,O),s=y.fromQuaternion(o,R),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,m=0;d>m;++m){var p=n.clone(t[m],I);y.multiplyByVector(s,p,p);var f=e.projectPointOntoPlane(p,M);a(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return i.x=l,i.y=c,i.width=u-l,i.height=h-c,i}function T(e,t,r,i){var n=u.fromPoints(t,e),a=n.projectPointsOntoPlane(t,L),s=_.computeWindingOrder2D(a);s===E.CLOCKWISE&&(a.reverse(),t.reverse());var l=_.triangulate(a);l.length<3&&(l=[0,1,2]);var d;if(i){for(var p=t.length,f=new Array(3*p),v=0,y=0;p>y;y++){var g=t[y];f[v++]=g.x,f[v++]=g.y,f[v++]=g.z}d=new c({attributes:{position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:w.TRIANGLES})}else d=_.computeSubdivision(t,l,r);return new m({geometry:d})}function A(e,t,r,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(r,a),m=b(d,r,s,z),p=q;p.x=m.x,p.y=m.y;var f=t.attributes.position.values,g=f.length,_=e.st?new Float32Array(2*(g/3)):void 0,w=e.normal?new Float32Array(g):void 0,x=e.tangent?new Float32Array(g):void 0,S=e.binormal?new Float32Array(g):void 0,E=0,T=0,A=B,D=F,P=V,M=!0,I=C.fromAxisAngle(d._plane.normal,s,j),O=y.fromQuaternion(I,Y),R=g/2,L=g/3;l&&(g/=2);for(var k=0;g>k;k+=3){var X=n.fromArray(f,k,H);if(e.st){var Z=y.multiplyByVector(O,X,N),J=d.projectPointOntoPlane(Z,G);i.subtract(J,p,J),l&&(_[E+L]=J.x/m.width,_[E+1+L]=J.y/m.height),_[E]=J.x/m.width,_[E+1]=J.y/m.height,E+=2}if(e.normal||e.tangent||e.binormal){var K=T+1,Q=T+2;if(c){if(g>k+3){var $=n.fromArray(f,k+3,U);if(M){var et=n.fromArray(f,k+g,W);n.subtract($,X,$),n.subtract(et,X,et),A=n.normalize(n.cross(et,$,A),A),M=!1}n.equalsEpsilon($,X,v.EPSILON10)&&(M=!0)}(e.tangent||e.binormal)&&(P=a.geodeticSurfaceNormal(X,P),e.tangent&&(D=n.normalize(n.cross(P,A,D),D)))}else A=a.geodeticSurfaceNormal(X,A),(e.tangent||e.binormal)&&(D=n.cross(n.UNIT_Z,A,D),D=n.normalize(y.multiplyByVector(O,D,D),D),e.binormal&&(P=n.normalize(n.cross(A,D,P),P)));e.normal&&(l&&!c?(w[T+R]=-A.x,w[K+R]=-A.y,w[Q+R]=-A.z):(w[T+R]=A.x,w[K+R]=A.y,w[Q+R]=A.z),w[T]=A.x,w[K]=A.y,w[Q]=A.z),e.tangent&&(l&&!c?(x[T+R]=-D.x,x[K+R]=-D.y,x[Q+R]=-D.z):(x[T+R]=D.x,x[K+R]=D.y,x[Q+R]=D.z),x[T]=D.x,x[K]=D.y,x[Q]=D.z),e.binormal&&(l&&(S[T+R]=P.x,S[K+R]=P.y,S[Q+R]=P.z),S[T]=P.x,S[K]=P.y,S[Q]=P.z),T+=3}}e.st&&(t.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:_})),e.normal&&(t.attributes.normal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:w})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:x})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:S}))}return t}function D(e,t,r){var i,a,s,l,u,m,p,y,_,C=[],x=e.length;if(r)for(p=0;x>p;p++)y=e[p],_=e[(p+1)%x],C.push(y.x,y.y,y.z,_.x,_.y,_.z);else for(p=0;x>p;p++)y=e[p],_=e[(p+1)%x],i=g.subdivideLine(y,_,t),i.push(_.x,_.y,_.z),C=C.concat(i);C=C.concat(C),x=C.length;var S=f.createTypedArray(x/3,x-6*e.length);for(a=0,x/=6,p=0;x>p;p++)s=p,l=s+1,y=n.fromArray(C,3*s,U),_=n.fromArray(C,3*l,W),n.equalsEpsilon(y,_,v.EPSILON6)||(u=s+x,m=u+1,S[a++]=s,S[a++]=u,S[a++]=l,S[a++]=l,S[a++]=u,S[a++]=m);return new c({attributes:new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:C})}),indices:S,primitiveType:w.TRIANGLES})}function P(e,t,r,i,n){var a=T(e,t,r,n).geometry,s=a.attributes.position.values,l=a.indices,u=s.concat(s),p=u.length/3,v=f.createTypedArray(p,2*l.length);v.set(l);var y,g=l.length,w=p/2;for(y=0;g>y;y+=3){var C=v[y]+w,x=v[y+1]+w,S=v[y+2]+w;v[y+g]=S,v[y+1+g]=x,v[y+2+g]=C}var b=new c({attributes:new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:u})}),indices:v,primitiveType:a.primitiveType}),A={topAndBottom:new m({geometry:b})};A.walls=[];var P=i.outerRing,M=_.computeWindingOrder2D(P);M===E.CLOCKWISE&&(P=P.reverse());var I=D(P,r,n);A.walls.push(new m({geometry:I}));var O=i.holes;for(y=0;yD;D++){var z=O[D];if(z.positions=_.removeDuplicates(z.positions),z.positions.length<3)throw new s("At least three positions are required.");L.push(z.positions);var F=0;a(z.holes)&&(F=z.holes.length);for(var V=0;F>V;V++)b.enqueue(z.holes[V])}C.push({outerRing:I,holes:L});var U=_.eliminateHoles(I,L);E.push(U)}}l=E[0],t=r.fromPoints(l);var W,q=[];if(w){for(D=0;Dw;w++){var E=a[w],b=a[(w+1)%S];C.push(E.x,E.y,E.z,b.x,b.y,b.z)}else for(w=0;S>w;w++)C=C.concat(f.subdivideLine(a[w],a[(w+1)%S],r));S=C.length/3;var T=2*S,A=m.createTypedArray(C.length/3,T),D=0;for(w=0;S-1>w;w++)A[D++]=w,A[D++]=w+1;return A[D++]=S-1,A[D++]=0,new h({geometry:new l({attributes:new c({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:new Float64Array(C)})}),indices:A,primitiveType:y.LINES})})}function C(e,t,r,i){var a=v.removeDuplicates(t);if(a.length<3)throw new o("Duplicate positions result in not enough positions to form a polygon.");var d=s.fromPoints(a,e),p=d.projectPointsOntoPlane(a,x),g=v.computeWindingOrder2D(p);g===_.CLOCKWISE&&(p.reverse(),a.reverse());var w,C=[],S=a.length,E=new Array(S);if(E[0]=0,i){var b,T;for(w=0;S-1>w;w++)b=a[w],T=a[(w+1)%S],C.push(b.x,b.y,b.z,T.x,T.y,T.z),E[w+1]=C.length/3;b=a[S-1],T=a[0],C.push(b.x,b.y,b.z,T.x,T.y,T.z)}else{for(w=0;S-1>w;w++)C=C.concat(f.subdivideLine(a[w],a[w+1],r)),E[w+1]=C.length/3;C=C.concat(f.subdivideLine(a[S-1],a[0],r))}S=C.length/3;var A=2*(2*S+E.length),D=m.createTypedArray(C.length/3,A),P=0;for(w=0;S-1>w;w++)D[P++]=w,D[P++]=w+1,D[P++]=w+S,D[P++]=w+1+S;for(D[P++]=S-1,D[P++]=0,D[P++]=S+S-1,D[P++]=S,w=0;wT;T++){var M=A.holes[T];_.push(M.positions);var I=0;t(M.holes)&&(I=M.holes.length);for(var O=0;I>O;O++)x.enqueue(M.holes[O])}_.push(D)}a=_[0],n=r.fromPoints(a);var R,L=[];if(m)for(T=0;T<_.length;T++)R=C(s,_[T],u,y),t(R)&&(R.geometry=f.scaleToGeodeticHeightExtruded(R.geometry,c,h,s,y),L.push(R)); -else for(T=0;T<_.length;T++)R=w(s,_[T],u,y),t(R)&&(R.geometry=v.scaleToGeodeticHeight(R.geometry,c,s,!y),L.push(R));R=d.combine(L);var z=n.center;return E=s.geodeticSurfaceNormal(z,E),S=i.multiplyByScalar(E,c,S),z=i.add(z,S,z),m&&(b=r.clone(n,b),z=b.center,S=i.multiplyByScalar(E,h,S),z=i.add(z,S,z),n=r.union(n,b,n)),new l({attributes:R.attributes,indices:R.indices,primitiveType:R.primitiveType,boundingSphere:n})},T}),r("Core/PolylineGeometry",["./defined","./DeveloperError","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./Cartesian3","./PolylinePipeline","./VertexFormat","./Geometry","./GeometryAttribute","./GeometryAttributes","./Color"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=function(r){r=o(r,o.EMPTY_OBJECT);var i=r.positions,n=r.colors,a=o(r.width,1),s=o(r.colorsPerVertex,!1);if(!e(i)||i.length<2)throw new t("At least two positions are required.");if(1>a)throw new t("width must be greater than or equal to one.");if(e(n)&&(s&&n.lengtho;++o)T+=4*b[o]-4;var D,P,M=new Float64Array(3*T),I=new Float64Array(3*T),O=new Float64Array(3*T),R=new Float32Array(2*T),L=w.st?new Float32Array(2*T):void 0,z=e(C)?new Uint8Array(4*T):void 0,N=0,B=0,F=0,V=0,k=0,U=0,W=E.length;for(u=0;W>u;++u){0===u?(P=f,s.subtract(E[0],E[1],P),s.add(E[0],P,P)):P=E[u-1],s.clone(P,y),s.clone(E[u],v),u===W-1?(P=f,s.subtract(E[W-1],E[W-2],P),s.add(E[W-1],P,P)):P=E[u+1],s.clone(P,g),D=b[k],u===U+D&&(U+=D,++k);var q,G,H=0===u-U,j=u===U+b[k]-1,Y=H?2:0,X=j?2:4;if(e(z)){var Z=u-k;q=H||x?C[Z]:C[Z-1],j||(G=C[Z])}for(p=Y;X>p;++p){s.pack(v,M,N),s.pack(y,I,N),s.pack(g,O,N),N+=3;var J=0>p-2?-1:1;if(R[B++]=2*(p%2)-1,R[B++]=J*_,w.st&&(L[F++]=u/(W-1),L[F++]=Math.max(R[B-2],0)),e(z)){var K=2>p?q:G;z[V++]=m.floatToByte(K.red),z[V++]=m.floatToByte(K.green),z[V++]=m.floatToByte(K.blue),z[V++]=m.floatToByte(K.alpha)}}}var Q=new d;Q.position=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:M}),Q.prevPosition=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:I}),Q.nextPosition=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:O}),Q.expandAndWidth=new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:R}),w.st&&(Q.st=new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:L})),e(z)&&(Q.color=new h({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:z,normalize:!0})),A=b.length;var $=i.createTypedArray(T,6*E.length-6*A),et=0,tt=0;for(o=0;A>o;++o)for(D=b[o]-1,u=0;D>u;++u)$[tt++]=et,$[tt++]=et+2,$[tt++]=et+1,$[tt++]=et+1,$[tt++]=et+2,$[tt++]=et+3,et+=4;return new c({attributes:Q,indices:$,primitiveType:n.TRIANGLES,boundingSphere:a.fromPoints(E)})},p}),r("Core/PolylineVolumeGeometry",["./defined","./DeveloperError","./Cartesian3","./CornerType","./ComponentDatatype","./Ellipsoid","./Geometry","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./defaultValue","./BoundingSphere","./BoundingRectangle","./GeometryAttribute","./GeometryAttributes","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_){"use strict";function w(e,t,r,i){var o=new y;i.position&&(o.position=new v({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e}));var u,h,m,f,g,_,w=t.length,C=e.length/3,x=(C-2*w)/(2*w),S=c.triangulate(t),E=6*(x-1)*w+2*S.length,b=l.createTypedArray(C,E),T=2*w,A=0;for(u=0;x-1>u;u++){for(h=0;w-1>h;h++)m=2*h+2*u*w,_=m+T,f=m+1,g=f+T,b[A++]=f,b[A++]=m,b[A++]=g,b[A++]=g,b[A++]=m,b[A++]=_;m=2*w-2+2*u*w,f=m+1,g=f+T,_=m+T,b[A++]=f,b[A++]=m,b[A++]=g,b[A++]=g,b[A++]=m,b[A++]=_}if(i.st||i.tangent||i.binormal){var D,P,M=new Float32Array(2*C),I=1/(x-1),O=1/r.height,R=r.height/2,L=0;for(u=0;x>u;u++){for(D=u*I,P=O*(t[0].y+R),M[L++]=D,M[L++]=P,h=1;w>h;h++)P=O*(t[h].y+R),M[L++]=D,M[L++]=P,M[L++]=D,M[L++]=P;P=O*(t[0].y+R),M[L++]=D,M[L++]=P}for(h=0;w>h;h++)D=0,P=O*(t[h].y+R),M[L++]=D,M[L++]=P;for(h=0;w>h;h++)D=(x-1)*I,P=O*(t[h].y+R),M[L++]=D,M[L++]=P;o.st=new v({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var z=C-2*w;for(u=0;uo;o++)m[f++]=o+g,m[f++]=o+g+1;for(m[f++]=s-1+g,m[f++]=g,i=h-1,g=i*s,o=0;s-1>o;o++)m[f++]=o+g,m[f++]=o+g+1;for(m[f++]=s-1+g,m[f++]=g,i=0;h-1>i;i++){var _=s*i,w=_+s;for(o=0;s>o;o++)m[f++]=o+_,m[f++]=o+w}var C=new a({attributes:r,indices:l.createTypedArray(u,m),boundingSphere:p.fromVertices(e),primitiveType:d.LINES});return C}var w=function(r){r=m(r,m.EMPTY_OBJECT);var n=r.polylinePositions;if(!e(n))throw new t("options.polylinePositions is required.");var a=r.shapePositions;if(!e(a))throw new t("options.shapePositions is required.");this._positions=n,this._shape=a,this._ellipsoid=m(r.ellipsoid,o.WGS84),this._cornerType=m(r.cornerType,i.ROUNDED),this._granularity=m(r.granularity,u.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry"},C=new f;return w.createGeometry=function(e){var r=e._positions,i=h.removeDuplicatesFromPositions(r,e._ellipsoid);if(i.length<2)throw new t("Count of unique polyline positions must be greater than 1.");var n=e._shape;if(n=h.removeDuplicatesFromShape(n),n.length<3)throw new t("Count of unique shape positions must be at least 3.");c.computeWindingOrder2D(n).value===g.CLOCKWISE.value&&n.reverse();var o=f.fromPoints(n,C),a=h.computePositions(i,n,o,e,!1);return _(a,n,o,e._ellipsoid)},w}),r("Core/QuaternionSpline",["./defaultValue","./defined","./DeveloperError","./Spline","./Quaternion"],function(e,t,r,i,n){"use strict";function o(e,r,i){var o=e.length,a=new Array(o);a[0]=t(r)?r:e[0],a[o-1]=t(i)?i:e[o-1];for(var s=1;o-1>s;++s)a[s]=n.innerQuadrangle(e[s-1],e[s],e[s+1]);return a}function a(e){var t=e.points,r=e.innerQuadrangles,i=e.times;if(t.length<3){var o=i[0],a=1/(i[1]-o),s=t[0],l=t[1];return function(e,t){var r=(e-o)*a;return n.slerp(s,l,r,t)}}return function(o,a){var s=e._lastTimeIndex=e.findTimeInterval(o,e._lastTimeIndex),l=(o-i[s])/(i[s+1]-i[s]),u=t[s],c=t[s+1],h=r[s],d=r[s+1];return n.squad(u,c,h,d,l,a)}}var s=function(i){i=e(i,e.EMPTY_OBJECT);var n=i.points,s=i.times,l=i.firstInnerQuadrangle,u=i.lastInnerQuadrangle;if(!t(n))throw new r("points is required.");if(n.length<2)throw new r("points.length must be greater than or equal to 2.");if(!t(s))throw new r("times is required.");if(s.length!==n.length)throw new r("times.length must be equal to points.length.");var c=o(n,l,u);this.times=s,this.points=n,this.innerQuadrangles=c,this._evaluateFunction=a(this),this._lastTimeIndex=0};return s.prototype.findTimeInterval=i.prototype.findTimeInterval,s.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},s}),r("Core/ReferenceFrame",["./Enumeration"],function(e){"use strict";var t={FIXED:new e(0,"FIXED"),INERTIAL:new e(1,"INERTIAL")};return t}),r("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function r(){return!0}var i=function(i,n){function o(){throw new t(n)}n=e(n,"This object was destroyed, i.e., destroy() was called.");for(var a in i)"function"==typeof i[a]&&(i[a]=o);return i.isDestroyed=r,void 0};return i}),r("Core/ScreenSpaceEventType",["./Enumeration"],function(e){"use strict";var t={LEFT_DOWN:new e(0,"LEFT_DOWN"),LEFT_UP:new e(1,"LEFT_UP"),LEFT_CLICK:new e(2,"LEFT_CLICK"),LEFT_DOUBLE_CLICK:new e(3,"LEFT_DOUBLE_CLICK"),RIGHT_DOWN:new e(5,"RIGHT_DOWN"),RIGHT_UP:new e(6,"RIGHT_UP"),RIGHT_CLICK:new e(7,"RIGHT_CLICK"),RIGHT_DOUBLE_CLICK:new e(8,"RIGHT_DOUBLE_CLICK"),MIDDLE_DOWN:new e(10,"MIDDLE_DOWN"),MIDDLE_UP:new e(11,"MIDDLE_UP"),MIDDLE_CLICK:new e(12,"MIDDLE_CLICK"),MIDDLE_DOUBLE_CLICK:new e(13,"MIDDLE_DOUBLE_CLICK"),MOUSE_MOVE:new e(15,"MOUSE_MOVE"),WHEEL:new e(16,"WHEEL"),PINCH_START:new e(17,"PINCH_START"),PINCH_END:new e(18,"PINCH_END"),PINCH_MOVE:new e(19,"PINCH_MOVE")};return t}),r("Core/ScreenSpaceEventHandler",["./DeveloperError","./defined","./destroyObject","./Cartesian2","./ScreenSpaceEventType","./KeyboardEventModifier","./defaultValue"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){if(e._element===document)return r.x=t.clientX,r.y=t.clientY,r;var i=e._element.getBoundingClientRect();return r.x=t.clientX-i.left,r.y=t.clientY-i.top,r}function l(e,r){var i=e.name;return t(r)&&(i+="+"+r.name),i}function u(e){return e.shiftKey?o.SHIFT:e.ctrlKey?o.CTRL:e.altKey?o.ALT:void 0}function c(e,r){var i=s(e,r,w.position);if(e._lastMousePosition.x=i.x,e._lastMousePosition.y=i.y,e._totalPixels=0,!e._seenAnyTouchEvents){var o,a=u(r);0===r.button?(e._leftMouseButtonDown=!0,o=e.getInputAction(n.LEFT_DOWN,a)):1===r.button?(e._middleMouseButtonDown=!0,o=e.getInputAction(n.MIDDLE_DOWN,a)):2===r.button&&(e._rightMouseButtonDown=!0,o=e.getInputAction(n.RIGHT_DOWN,a)),t(o)&&o(w),r.preventDefault()}}function h(e,r){var i,o,a=u(r);if(!e._seenAnyTouchEvents){0===r.button?(e._leftMouseButtonDown=!1,i=e.getInputAction(n.LEFT_UP,a),o=e.getInputAction(n.LEFT_CLICK,a)):1===r.button?(e._middleMouseButtonDown=!1,i=e.getInputAction(n.MIDDLE_UP,a),o=e.getInputAction(n.MIDDLE_CLICK,a)):2===r.button&&(e._rightMouseButtonDown=!1,i=e.getInputAction(n.RIGHT_UP,a),o=e.getInputAction(n.RIGHT_CLICK,a));var l=s(e,r,C.position),c=e._lastMousePosition.x-l.x,h=e._lastMousePosition.y-l.y;e._totalPixels+=Math.sqrt(c*c+h*h),t(i)&&i(C),t(o)&&e._totalPixels0)){var h=s(e,r.changedTouches[0],b.position),d=e._lastMousePosition.x-h.x,p=e._lastMousePosition.y-h.y;e._totalPixels+=Math.sqrt(d*d+p*p),t(i)&&i(b),t(o)&&e._totalPixelsD;D++,p+=v,++g){C=v>0?m[p]+f:f-m[p],S=C+d,E=-Math.cos(S),T=o.multiplyByScalar(c,E),E=Math.sin(S),A=o.multiplyByScalar(h,E),T=o.add(T,A,T),E=Math.cos(C),E*=E,b=Math.sin(C),b*=b,x=n/Math.sqrt(i*E+r*b),w=x/t,E=Math.sin(w/2);var P=a.normalize(new a(T.x*E,T.y*E,T.z*E,Math.cos(w/2))),M=s.fromQuaternion(P),I=s.multiplyByVector(M,u),O=o.normalize(I);I=o.multiplyByScalar(O,t),y[g]=I}}var u={computeCircleBoundary:function(n,o,a,s){if(!t(n)||!t(o)||!t(a))throw new r("ellipsoid, center, and radius are required.");if(0>=a)throw new r("radius must be greater than zero.");if(s=e(s,i.RADIANS_PER_DEGREE),0>=s)throw new r("granularity must be greater than zero.");return this.computeEllipseBoundary(n,o,a,a,0,s)},computeEllipseBoundary:function(n,a,s,u,c,h){if(!(t(n)&&t(a)&&t(s)&&t(u)))throw new r("ellipsoid, center, semiMajorAxis, and semiMinorAxis are required.");if(0>=s||0>=u)throw new r("Semi-major and semi-minor axes must be greater than zero.");if(c=e(c,0),h=e(h,i.RADIANS_PER_DEGREE),0>=h)throw new r("granularity must be greater than zero.");if(u>s){var d=s;s=u,u=d}for(var m=2.31,p=s*s,f=u*u,v=s*u,y=1-f/p,g=Math.sqrt(y),_=o.clone(a),w=o.magnitude(_),C=new o(0,0,1),x=1/w,S=o.multiplyByScalar(_,x),E=o.normalize(o.cross(C,_)),b=o.cross(S,E),T=1+Math.ceil(i.PI_OVER_TWO/h),A=m/(T-1),D=[],P=0,M=0,I=0;T>I;I++,M+=A,++P)if(D[P]=M-g*Math.sin(M),D[P]>=i.PI_OVER_TWO){D[P]=i.PI_OVER_TWO,T=I+1;break}var O=[];return l(n,w,p,f,v,g,S,E,b,c,D,0,0,1,O,0,T-1),l(n,w,p,f,v,g,S,E,b,c,D,T-1,Math.PI,-1,O,T-1,T-1),l(n,w,p,f,v,g,S,E,b,c,D,0,Math.PI,1,O,2*T-2,T-1),l(n,w,p,f,v,g,S,E,b,c,D,T-1,i.TWO_PI,-1,O,3*T-3,T),O.push(o.clone(O[0])),O},compute2DCircle:function(t,r){t=e(t,1),r=e(r,2*i.RADIANS_PER_DEGREE);for(var o=[],a=i.toRadians(1),s=2*Math.PI/a,l=0;s>l;l++)o.push(new n(t*Math.cos(a*l),t*Math.sin(a*l)));return o}};return u}),r("Core/ShowGeometryInstanceAttribute",["./defaultValue","./defined","./ComponentDatatype","./DeveloperError"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,!0),this.componentDatatype=r.UNSIGNED_BYTE,this.componentsPerAttribute=1,this.normalize=!0,this.value=n.toValue(t)};return n.toValue=function(e,r){if(!t(e))throw new i("show is required.");return t(r)?(r[0]=e,r):new Uint8Array([e])},n}),r("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=e.addSeconds(w,t);var r=t.getTotalDays()-C;return t=t.addSeconds(l(r),t)}function c(i,a,s,l,u,c,m,p){if(0>s&&(s=-s,u+=n.PI),0>s||s>n.PI)throw new r("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var v=i*(1-a),y=l-u,g=u,_=d(c-l,a),w=h(a,0);if("Hyperbolic"===w&&Math.abs(n.NegativePiToPi(_))>=Math.acos(-1/a))throw new r("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");f(y,s,g,P);var C=v*(1+a),x=Math.cos(_),S=Math.sin(_),E=1+a*x;if(E<=n.Epsilon10)throw new r("elements cannot be converted to cartesian");var b=C/E;return t(p)?(p.x=b*x,p.y=b*S,p.z=0):p=new e(b*x,b*S,0),o.multiplyByVector(P,p,p)}function h(e,t){if(0>e)throw new r("eccentricity cannot be negative.");return t>=e?"Circular":1-t>e?"Elliptical":1+t>=e?"Parabolic":"Hyperbolic"}function d(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=m(e,t);return p(i,t)}function m(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;M>o&&Math.abs(s-a)>I;++o){s=a;var l=s-t*Math.sin(s)-e,u=1-t*Math.cos(s);a=s-l/u}if(o>=M)throw new r("Kepler equation did not converge");return s=a+i*n.TWO_PI}function p(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o=Math.cos(e)-t,a=Math.sin(e)*Math.sqrt(1-t*t),s=Math.atan2(a,o);return s=n.zeroToTwoPi(s),0>e&&(s-=n.TWO_PI),s+=i*n.TWO_PI}function f(e,i,a,s){if(0>i||i>n.PI)throw new r("inclination out of range");var l=Math.cos(e),u=Math.sin(e),c=Math.cos(i),h=Math.sin(i),d=Math.cos(a),m=Math.sin(a);return t(s)?(s[0]=d*l-m*u*c,s[1]=m*l+d*u*c,s[2]=u*h,s[3]=-d*u-m*l*c,s[4]=-m*u+d*l*c,s[5]=l*h,s[6]=m*h,s[7]=-d*h,s[8]=c):s=new o(d*l-m*u*c,-d*u-m*l*c,m*h,m*l+d*u*c,-m*u+d*l*c,-d*h,u*h,l*h,c),s}function v(e,t){u(e,Pt);var r=Pt.getJulianDayNumber()-x.getJulianDayNumber()+(Pt.getSecondsOfDay()-x.getSecondsOfDay())/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=O+q*Math.cos(z*n)+K*Math.sin(z*n)+G*Math.cos(N*n)+Q*Math.sin(N*n)+H*Math.cos(B*n)+$*Math.sin(B*n)+j*Math.cos(F*n)+et*Math.sin(F*n)+Y*Math.cos(V*n)+tt*Math.sin(V*n)+X*Math.cos(k*n)+rt*Math.sin(k*n)+Z*Math.cos(U*n)+it*Math.sin(U*n)+J*Math.cos(W*n)+nt*Math.sin(W*n),s=R+L*i+mt*Math.cos(ot*n)+Ct*Math.sin(ot*n)+pt*Math.cos(at*n)+xt*Math.sin(at*n)+ft*Math.cos(st*n)+St*Math.sin(st*n)+vt*Math.cos(lt*n)+Et*Math.sin(lt*n)+yt*Math.cos(ut*n)+bt*Math.sin(ut*n)+gt*Math.cos(ct*n)+Tt*Math.sin(ct*n)+_t*Math.cos(ht*n)+At*Math.sin(ht*n)+wt*Math.cos(dt*n)+Dt*Math.sin(dt*n),l=.0167086342-.0004203654*i,h=102.93734808*T+11612.3529*A*i,d=469.97289*A*i,m=174.87317577*T-8679.27034*A*i;return c(o,l,d,h,m,s,E,t)}function y(e,t){u(e,Pt);var r=Pt.getJulianDayNumber()-x.getJulianDayNumber()+(Pt.getSecondsOfDay()-x.getSecondsOfDay())/a.SECONDS_PER_DAY,i=r/a.DAYS_PER_JULIAN_CENTURY,n=i*i,o=n*i,s=o*i,l=383397.7725+.004*i,h=.055545526-1.6e-8*i,d=5.15668983*T,m=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,p=83.35324312*T,f=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,v=125.04455501*T,y=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,g=218.31664563*T,_=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,w=297.85019547*T+A*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),C=93.27209062*T+A*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),E=134.96340251*T+A*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),D=357.52910918*T+A*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*T-A*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),M=2*w,I=4*w,O=6*w,R=2*E,L=3*E,z=4*E,N=2*C;l+=3400.4*Math.cos(M)-635.6*Math.cos(M-E)-235.6*Math.cos(E)+218.1*Math.cos(M-D)+181*Math.cos(M+E),h+=.014216*Math.cos(M-E)+.008551*Math.cos(M-R)-.001383*Math.cos(E)+.001356*Math.cos(M+E)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-R)+869e-6*Math.cos(M-D-E)-627e-6*Math.cos(M)-394e-6*Math.cos(I-z)+282e-6*Math.cos(M-D-R)-279e-6*Math.cos(w-E)-236e-6*Math.cos(R)+231e-6*Math.cos(I)+229e-6*Math.cos(O-z)-201e-6*Math.cos(R-N),m+=486.26*Math.cos(M-N)-40.13*Math.cos(M)+37.51*Math.cos(N)+25.73*Math.cos(R-N)+19.97*Math.cos(M-D-N),f+=-55609*Math.sin(M-E)-34711*Math.sin(M-R)-9792*Math.sin(E)+9385*Math.sin(I-L)+7505*Math.sin(I-R)+5318*Math.sin(M+E)+3484*Math.sin(I-z)-3417*Math.sin(M-D-E)-2530*Math.sin(O-z)-2376*Math.sin(M)-2075*Math.sin(M-L)-1883*Math.sin(R)-1736*Math.sin(O-5*E)+1626*Math.sin(D)-1370*Math.sin(O-L),y+=-5392*Math.sin(M-N)-540*Math.sin(D)-441*Math.sin(M)+423*Math.sin(N)-288*Math.sin(R-N),_+=-3332.9*Math.sin(M)+1197.4*Math.sin(M-E)-662.5*Math.sin(D)+396.3*Math.sin(E)-218*Math.sin(M-D);var B=2*P,F=3*P;m+=46.997*Math.cos(P)*i-.614*Math.cos(M-N+P)*i+.614*Math.cos(M-N-P)*i-.0297*Math.cos(B)*n-.0335*Math.cos(P)*n+.0012*Math.cos(M-N+B)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(B)*o;var V=2.116*Math.sin(P)*i-.111*Math.sin(M-N-P)*i-.0015*Math.sin(P)*n;f+=V,_+=V,y+=-520.77*Math.sin(P)*i+13.66*Math.sin(M-N+P)*i+1.12*Math.sin(M-P)*i-1.06*Math.sin(N-P)*i+.66*Math.sin(B)*n+.371*Math.sin(P)*n-.035*Math.sin(M-N+B)*n-.015*Math.sin(M-N+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(B)*o,l*=b;var k=d+m*A,U=p+f*A,W=g+_*A,q=v+y*A;return c(l,h,k,U,q,W,S,t)}function g(t,r){return r=y(t,r),e.multiplyByScalar(r,It,r)}var _={},w=32.184,C=2451545,x=i.fromTotalDays(2451545,s.TAI),S=398600435e6,E=328900.56*1.012300034*S,b=1e3,T=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,D=14959787e4,P=new o,M=50,I=n.EPSILON8,O=1.0000010178*D,R=100.46645683*T,L=1295977422.83429*A,z=16002,N=21863,B=32004,F=10931,V=14529,k=16368,U=15318,W=32794,q=64e-7*D,G=-152*1e-7*D,H=62e-7*D,j=-8e-7*D,Y=32e-7*D,X=-41*1e-7*D,Z=19e-7*D,J=-11*1e-7*D,K=-150*1e-7*D,Q=-46*1e-7*D,$=68*1e-7*D,et=54e-7*D,tt=14e-7*D,rt=24e-7*D,it=-28*1e-7*D,nt=22e-7*D,ot=10,at=16002,st=21863,lt=10931,ut=1473,ct=32004,ht=4387,dt=73,mt=-325*1e-7,pt=-322*1e-7,ft=-79*1e-7,vt=232*1e-7,yt=-52*1e-7,gt=97e-7,_t=55e-7,wt=-41*1e-7,Ct=-105*1e-7,xt=-137*1e-7,St=258e-7,Et=35e-7,bt=-116*1e-7,Tt=-88*1e-7,At=-112*1e-7,Dt=-80*1e-7,Pt=new i,Mt=.012300034,It=-1*(Mt/(Mt+1)),Ot=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Rt=new e;return _.ComputeSunPositionInEarthInertialFrame=function(r,n){return t(r)||(r=new i),Rt=v(r,Rt),n=e.negate(Rt,n),g(r,Rt),e.subtract(n,Rt,n),o.multiplyByVector(Ot,n,n),n},_.ComputeMoonPositionInEarthInertialFrame=function(e,r){return t(e)||(e=new i),r=y(e,r),o.multiplyByVector(Ot,r,r),r},_}),r("Core/SimplePolylineGeometry",["./defined","./DeveloperError","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./Color","./Cartesian3"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(r){r=o(r,o.EMPTY_OBJECT);var i=r.positions,n=r.colors,a=o(r.colorsPerVertex,!1);if(!e(i)||i.length<2)throw new t("At least two positions are required.");if(e(n)&&(a&&n.lengtho;++o){var x,S=d[o];if(f&&o>0&&(h.pack(S,w,v),v+=3,x=m[o-1],C[y++]=c.floatToByte(x.red),C[y++]=c.floatToByte(x.green),C[y++]=c.floatToByte(x.blue),C[y++]=c.floatToByte(x.alpha)),f&&o===g-1)break;h.pack(S,w,v),v+=3,e(m)&&(x=m[o],C[y++]=c.floatToByte(x.red),C[y++]=c.floatToByte(x.green),C[y++]=c.floatToByte(x.blue),C[y++]=c.floatToByte(x.alpha))}var E=new u;E.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:w}),e(m)&&(E.color=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0}));var b=f?_:2*(_-1),T=i.createTypedArray(_,b),A=f?2:1;for(v=0,o=0;_-1>o;o+=A)T[v++]=o,T[v++]=o+1;return new s({attributes:E,indices:T,primitiveType:n.LINES,boundingSphere:a.fromPoints(d)})},d}),r("Core/SphereGeometry",["./defaultValue","./Cartesian3","./EllipsoidGeometry"],function(e,t,r){"use strict";var i=function(i){var n=e(i.radius,1),o=new t(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new r(a),this._workerName="createSphereGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/SphereOutlineGeometry",["./defaultValue","./Cartesian3","./EllipsoidOutlineGeometry"],function(e,t,r){"use strict";var i=function(i){var n=e(i.radius,1),o=new t(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new r(a),this._workerName="createSphereOutlineGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/Spherical",["./DeveloperError","./defaultValue","./defined"],function(e,t,r){"use strict";var i=function(e,r,i){this.clock=t(e,0),this.cone=t(r,0),this.magnitude=t(i,1)};return i.fromCartesian3=function(t,n){if(!r(t))throw new e("cartesian3 is required");var o=t.x,a=t.y,s=t.z,l=o*o+a*a;return r(n)||(n=new i),n.clock=Math.atan2(a,o),n.cone=Math.atan2(Math.sqrt(l),s),n.magnitude=Math.sqrt(l+s*s),n},i.clone=function(e,t){return r(e)?r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new i(e.clock,e.cone,e.magnitude):void 0},i.normalize=function(t,n){if(!r(t))throw new e("spherical is required");return r(n)?(n.clock=t.clock,n.cone=t.cone,n.magnitude=1,n):new i(t.clock,t.cone,1)},i.equals=function(e,t){return e===t||r(e)&&r(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},i.equalsEpsilon=function(e,i,n){return n=t(n,0),e===i||r(e)&&r(i)&&Math.abs(e.clock-i.clock)<=n&&Math.abs(e.cone-i.cone)<=n&&Math.abs(e.magnitude-i.magnitude)<=n},i.toString=function(e){return"("+e.clock+", "+e.cone+", "+e.magnitude+")"},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.normalize=function(e){return i.normalize(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return i.toString(this)},i}),r("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";var t,r=function(r){e(t)||(t=document.createElement("a")),t.href=window.location.href;var i=t.host,n=t.protocol;return t.href=r,t.href=t.href,n!==t.protocol||i!==t.host};return r}),r("Core/TaskProcessor",["require","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./isCrossOriginUrl","../ThirdParty/when","../ThirdParty/Uri"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){--e._activeTasks;var r=t.data,n=r.id,o=e._deferreds,a=o[n];i(r.error)?a.reject(r.error):a.resolve(r.result),delete o[n]}function u(){if(i(h))return h;if(h=t("Workers/cesiumWorkerBootstrapper.js"),o(h)){var e,r='importScripts("'+h+'");';try{e=new Blob([r],{type:"application/javascript"})}catch(n){var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new a;s.append(r),e=s.getBlob("application/javascript")}var l=window.URL||window.webkitURL;h=l.createObjectURL(e)}return h}function c(n){var o=u(),a=new Worker(o);a.postMessage=r(a.webkitPostMessage,a.postMessage);var c={loaderConfig:{},workerModule:d._workerModulePrefix+n._workerName};if(i(d._loaderConfig))c.loaderConfig=d._loaderConfig;else if(i(e.toUrl)){var h=new s("..").resolve(new s(t("Workers/cesiumWorkerBootstrapper.js"))).toString();c.loaderConfig.baseUrl=h}else c.loaderConfig.paths={Workers:t("Workers")};a.postMessage(c),a.onmessage=function(e){l(n,e)},n._worker=a}var h,d=function(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0 -};return d.prototype.scheduleTask=function(e,t){if(i(this._worker)||c(this),this._activeTasks>=this._maximumActiveTasks)return void 0;++this._activeTasks;var r=this._nextID++,n=a.defer();return this._deferreds[r]=n,this._worker.postMessage({id:r,parameters:e},t),n.promise},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return i(this._worker)&&this._worker.terminate(),n(this)},d._defaultWorkerModulePrefix="Workers/",d._workerModulePrefix=d._defaultWorkerModulePrefix,d._loaderConfig=void 0,d}),r("Core/TimeIntervalCollection",["./defined","./DeveloperError","./binarySearch","./TimeInterval","./JulianDate"],function(e,t,r,i,n){"use strict";function o(e,t){return n.compare(e.start,t.start)}function a(t,r,i,n){for(var o=0,a=0,l=new s,u=t._intervals,c=r._intervals;oa;a++)if(!i.equals(r[a],n[a],t))return!1;return!0},s.prototype.get=function(e){if(isNaN(e))throw new t("index must be a number.");return this._intervals[e]},s.prototype.getStart=function(){var e=this._intervals;return 0===e.length?void 0:e[0].start},s.prototype.getStop=function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop},s.prototype.getLength=function(){return this._intervals.length},s.prototype.clear=function(){this._intervals=[]},s.prototype.isEmpty=function(){return 0===this._intervals.length},s.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},s.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},s.prototype.contains=function(e){return this.indexOf(e)>=0},s.prototype.indexOf=function(n){if(!e(n))throw new t("date required");var a=this._intervals,s=r(a,new i(n,n,!0,!0),o);return s>=0?a[s].isStartIncluded?s:s>0&&a[s-1].stop.equals(n)&&a[s-1].isStopIncluded?s-1:~s:(s=~s,s>0&&s-1s;s++)if(o=a[s],!(e(t)&&!o.start.equals(t)||e(r)&&!o.stop.equals(r)||e(i)&&o.isStartIncluded!==i||e(n)&&o.isStopIncluded!==n))return a[s];return void 0},s.prototype.addInterval=function(a,s){if(!e(a))throw new t("interval is required");if(!a.isEmpty){var l,u,c=this._intervals;if(0===c.length||a.start.greaterThan(c[c.length-1].stop))return c.push(a),void 0;for(u=r(c,a,o),0>u?u=~u:u>0&&a.isStartIncluded&&c[u-1].isStartIncluded&&c[u-1].start.equals(a.start)?--u:u0&&(l=n.compare(c[u-1].stop,a.start),(l>0||0===l&&(c[u-1].isStopIncluded||a.isStartIncluded))&&((e(s)?s(c[u-1].data,a.data):c[u-1].data===a.data)?(a=a.stop.greaterThan(c[u-1].stop)?new i(c[u-1].start,a.stop,c[u-1].isStartIncluded,a.isStopIncluded,a.data):new i(c[u-1].start,c[u-1].stop,c[u-1].isStartIncluded,c[u-1].isStopIncluded||a.stop.equals(c[u-1].stop)&&a.isStopIncluded,a.data),c.splice(u-1,1),--u):(l=n.compare(c[u-1].stop,a.stop),l>0||0===l&&c[u-1].isStopIncluded&&!a.isStopIncluded?c.splice(u-1,1,new i(c[u-1].start,a.start,c[u-1].isStartIncluded,!a.isStartIncluded,c[u-1].data),new i(a.stop,c[u-1].stop,!a.isStopIncluded,c[u-1].isStopIncluded,c[u-1].data)):c[u-1]=new i(c[u-1].start,a.start,c[u-1].isStartIncluded,!a.isStartIncluded,c[u-1].data))));u0||0===l&&(a.isStopIncluded||c[u].isStartIncluded));)if(e(s)?s(c[u].data,a.data):c[u].data===a.data)a=new i(a.start,c[u].stop.greaterThan(a.stop)?c[u].stop:a.stop,a.isStartIncluded,c[u].stop.greaterThan(a.stop)?c[u].isStopIncluded:a.isStopIncluded,a.data),c.splice(u,1);else{if(c[u]=new i(a.stop,c[u].stop,!a.isStopIncluded,c[u].isStopIncluded,c[u].data),!c[u].isEmpty)break;c.splice(u,1)}c.splice(u,0,a)}},s.prototype.removeInterval=function(n){if(!e(n))throw new t("interval is required");if(n.isEmpty)return!1;var a=!1,s=this._intervals,l=r(s,n,o);0>l&&(l=~l);var u=n.start,c=n.stop,h=n.isStartIncluded,d=n.isStopIncluded;if(l>0){var m=s[l-1],p=m.stop;(p.greaterThan(u)||p.equals(u)&&m.isStopIncluded&&h)&&(a=!0,(p.greaterThan(c)||m.isStopIncluded&&!d&&p.equals(c))&&s.splice(l,0,new i(c,p,!d,m.isStopIncluded,m.data)),s[l-1]=new i(m.start,u,m.isStartIncluded,!h,m.data))}var f=s[l];for(la;a++)u[a]=i;return u}var c=n-i,h=c/l;for(a=1;l>a;a++){var d=i+a*h;u[a]=d}return u[0]=i,u}function c(e,t){return s.equalsEpsilon(e.latitude,t.latitude,s.EPSILON6)&&s.equalsEpsilon(e.longitude,t.longitude,s.EPSILON6)}function h(r,i,n,o){var a=e(o),s=e(n),l=[],u=[],h=a?[]:void 0,d=i.length;if(2>d)return i.slice(0);var f=i[0];l.push(f);var v=r.cartesianToCartographic(f,m);s&&(v.height=n[0]),u.push(v.height),a&&h.push(o[0]);for(var y=1;d>y;++y){var g=i[y],_=r.cartesianToCartographic(g,p);s&&(_.height=n[y]),c(v,_)?v.height<_.height&&(u[u.length-1]=_.height):(l.push(g),u.push(_.height),a&&h.push(o[y])),t.clone(_,v)}return{positions:l,topHeights:u,bottomHeights:h}}var d={},m=new t,p=new t;return d.computePositions=function(t,r,s,c,d,m){var p=h(t,r,s,c);if(r=p.positions,s=p.topHeights,c=p.bottomHeights,r.length<2)throw new i("unique positions must be greater than or equal to 2");var f=e(c);if(r.length>=3){var v=n.fromPoints(r,t),y=v.projectPointsOntoPlane(r);o.computeWindingOrder2D(y)===l.CLOCKWISE&&(r.reverse(),s.reverse(),f&&c.reverse())}var g,_=r.length,w=[],C=f?[]:void 0,x=[];for(g=0;_-1>g;g++){var S=r[g],E=r[g+1],b=s[g],T=s[g+1];w=w.concat(u(S,E,b,T,d)),m&&w.push(T),f&&(S=r[g],E=r[g+1],b=c[g],T=c[g+1],C=C.concat(u(S,E,b,T,d)),m&&C.push(T)),m&&(x=x.concat(a.scaleToSurface([S,E],d,t)))}m||(x=a.scaleToSurface(r,d,t),w.push(s[_-1]),f&&C.push(c[_-1]));var A=f?a.scaleToGeodeticHeight(x,C,t):x.slice(0),D=a.scaleToGeodeticHeight(x,w,t);return{newWallPositions:x,bottomPositions:A,topPositions:D}},d}),r("Core/WallGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new i,v=new i,y=new i,g=new i,_=new i,w=new i,C=new i,x=new i,S=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.positions,n=r.maximumHeights,o=r.minimumHeights;if(!t(i))throw new a("positions is required.");if(t(n)&&n.length!==i.length)throw new a("positions and maximumHeights must have the same length.");if(t(o)&&o.length!==i.length)throw new a("positions and minimumHeights must have the same length.");var l=e(r.vertexFormat,m.DEFAULT),u=e(r.granularity,h.RADIANS_PER_DEGREE),c=e(r.ellipsoid,s.WGS84);this._positions=i,this._minimumHeights=o,this._maximumHeights=n,this._vertexFormat=l,this._granularity=u,this._ellipsoid=c,this._workerName="createWallGeometry"};return S.fromConstantHeights=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.positions;if(!t(i))throw new a("options.positions is required.");var n,o,s=r.minimumHeight,l=r.maximumHeight,u=t(s),c=t(l);if(u||c){var h=i.length;n=u?new Array(h):void 0,o=c?new Array(h):void 0;for(var d=0;h>d;++d)u&&(n[d]=s),c&&(o[d]=l)}var m={positions:i,maximumHeights:o,minimumHeights:n,ellipsoid:r.ellipsoid,vertexFormat:r.vertexFormat};return new S(m)},S.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,s=e._maximumHeights,m=e._vertexFormat,S=e._granularity,E=e._ellipsoid,b=p.computePositions(E,t,s,a,S,!0),T=b.newWallPositions,A=b.bottomPositions,D=b.topPositions,P=T.length,M=2*P,I=m.position?new Float64Array(M):void 0,O=m.normal?new Float32Array(M):void 0,R=m.tangent?new Float32Array(M):void 0,L=m.binormal?new Float32Array(M):void 0,z=m.st?new Float32Array(2*(M/3)):void 0,N=0,B=0,F=0,V=0,k=0,U=x,W=C,q=w,G=!0;P/=3;var H;for(H=0;P>H;++H){var j=3*H,Y=i.fromArray(D,j,f),X=i.fromArray(A,j,v);if(m.position&&(I[N++]=X.x,I[N++]=X.y,I[N++]=X.z,I[N++]=Y.x,I[N++]=Y.y,I[N++]=Y.z),m.normal||m.tangent||m.binormal){var Z,J=new i,K=i.fromArray(T,j,v);if(P>H+1&&(Z=i.fromArray(T,j+3,y),J=i.fromArray(D,j+3,_)),G){var Q=i.subtract(J,Y,g),$=i.subtract(K,Y,f);U=i.normalize(i.cross($,Q,U),U),G=!1}i.equalsEpsilon(Z,K,h.EPSILON6)?G=!0:(m.tangent&&(W=i.normalize(i.subtract(Z,K,W),W)),m.binormal&&(q=i.normalize(i.cross(U,W,q),q))),m.normal&&(O[B++]=U.x,O[B++]=U.y,O[B++]=U.z,O[B++]=U.x,O[B++]=U.y,O[B++]=U.z),m.tangent&&(R[V++]=W.x,R[V++]=W.y,R[V++]=W.z,R[V++]=W.x,R[V++]=W.y,R[V++]=W.z),m.binormal&&(L[F++]=q.x,L[F++]=q.y,L[F++]=q.z,L[F++]=q.x,L[F++]=q.y,L[F++]=q.z)}if(m.st){var et=H/(P-1);z[k++]=et,z[k++]=0,z[k++]=et,z[k++]=1}}var tt=new c;m.position&&(tt.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:I})),m.normal&&(tt.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:O})),m.tangent&&(tt.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:R})),m.binormal&&(tt.binormal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(tt.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:z}));var rt=M/3;M-=6;var it=o.createTypedArray(rt,M),nt=0;for(H=0;rt-2>H;H+=2){var ot=H,at=H+2,st=i.fromArray(I,3*ot,f),lt=i.fromArray(I,3*at,v);if(!i.equalsEpsilon(st,lt,h.EPSILON6)){var ut=H+1,ct=H+3;it[nt++]=ut,it[nt++]=ot,it[nt++]=ct,it[nt++]=ct,it[nt++]=ot,it[nt++]=at}}return new l({attributes:tt,indices:it,primitiveType:d.TRIANGLES,boundingSphere:new r.fromVertices(I)})},S}),r("Core/WallOutlineGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new i,v=new i,y=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.positions,n=r.maximumHeights,o=r.minimumHeights;if(!t(i))throw new s("positions is required.");if(t(n)&&n.length!==i.length)throw new s("positions and maximumHeights must have the same length.");if(t(o)&&o.length!==i.length)throw new s("positions and minimumHeights must have the same length.");var a=e(r.granularity,d.RADIANS_PER_DEGREE),u=e(r.ellipsoid,l.WGS84);this._positions=i,this._minimumHeights=o,this._maximumHeights=n,this._granularity=a,this._ellipsoid=u,this._workerName="createWallOutlineGeometry"};return y.fromConstantHeights=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.positions;if(!t(i))throw new s("options.positions is required.");var n,o,a=r.minimumHeight,l=r.maximumHeight,u=t(a),c=t(l);if(u||c){var h=i.length;n=u?new Array(h):void 0,o=c?new Array(h):void 0;for(var d=0;h>d;++d)u&&(n[d]=a),c&&(o[d]=l)}var m={positions:i,maximumHeights:o,minimumHeights:n,ellipsoid:r.ellipsoid};return new y(m)},y.createGeometry=function(e){var t=e._positions,n=e._minimumHeights,s=e._maximumHeights,l=e._granularity,y=e._ellipsoid,g=p.computePositions(y,t,s,n,l,!1),_=g.newWallPositions,w=g.bottomPositions,C=g.topPositions,x=_.length,S=2*x,E=new Float64Array(S),b=0;x/=3;var T;for(T=0;x>T;++T){var A=3*T,D=i.fromArray(C,A,f),P=i.fromArray(w,A,v);E[b++]=P.x,E[b++]=P.y,E[b++]=P.z,E[b++]=D.x,E[b++]=D.y,E[b++]=D.z}var M=new h({position:new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:E})}),I=S/3;S=2*I-4+I;var O=a.createTypedArray(I,S),R=0;for(T=0;I-2>T;T+=2){var L=T,z=T+2,N=i.fromArray(E,3*L,f),B=i.fromArray(E,3*z,v);if(!i.equalsEpsilon(N,B,d.EPSILON6)){var F=T+1,V=T+3;O[R++]=F,O[R++]=L,O[R++]=F,O[R++]=V,O[R++]=L,O[R++]=z}}return O[R++]=I-2,O[R++]=I-1,new u({attributes:M,indices:O,primitiveType:m.LINES,boundingSphere:new r.fromVertices(E)})},y}),r("Core/WebMercatorProjection",["./defaultValue","./defined","./Cartesian3","./Cartographic","./Math","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";var a=function(t){this._ellipsoid=e(t,o.WGS84),this._semimajorAxis=this._ellipsoid.getMaximumRadius(),this._oneOverSemimajorAxis=1/this._semimajorAxis};return a.mercatorAngleToGeodeticLatitude=function(e){return n.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},a.geodeticLatitudeToMercatorAngle=function(e){e>a.MaximumLatitude?e=a.MaximumLatitude:e<-a.MaximumLatitude&&(e=-a.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},a.MaximumLatitude=a.mercatorAngleToGeodeticLatitude(Math.PI),a.prototype.getEllipsoid=function(){return this._ellipsoid},a.prototype.project=function(e,i){var n=this._semimajorAxis,o=e.longitude*n,s=a.geodeticLatitudeToMercatorAngle(e.latitude)*n,l=e.height;return t(i)?(i.x=o,i.y=s,i.z=l,i):new r(o,s,l)},a.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,s=a.mercatorAngleToGeodeticLatitude(e.y*n),l=e.z;return t(r)?(r.longitude=o,r.latitude=s,r.height=l,r):new i(o,s,l)},a}),r("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";var t=window.cancelAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"CancelAnimationFrame"],e(t)||(t=window[r[i]+"CancelRequestAnimationFrame"]),++i;e(t)||(t=clearTimeout)}();var r=function(e){t(e)};return r}),r("Core/combine",["./DeveloperError","./defaultValue","./defined"],function(e,t,r){"use strict";var i=function(e,r,i){r=t(r,!0),i=t(i,!0);for(var o={},a=0;a0&&(a+=-1===a.indexOf("?")?"?":"&",a+=h.join("&"));var p=s.proxy;return t(p)&&(a=p.getURL(a)),o.loadAndExecuteScript(a,l,u),u.promise};return o.loadAndExecuteScript=function(e,t,r){var i=document.createElement("script");i.async=!0,i.src=e;var n=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,n.removeChild(i)},i.onerror=function(e){r.reject(e)},n.appendChild(i)},o.defaultLoadAndExecuteScript=o.loadAndExecuteScript,o}),r("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"arraybuffer",headers:r})};return t}),r("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"blob",headers:r})};return t}),r("Core/loadImage",["./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","../ThirdParty/when"],function(e,t,r,i,n){"use strict";var o=/^data:/,a=function(s,l){if(!t(s))throw new r("url is required.");return l=e(l,!0),n(s,function(e){var t;t=o.test(e)||!l?!1:i(e);var r=n.defer();return a.createImage(e,t,r),r.promise})};return a.createImage=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(i)},i.onerror=function(e){r.reject(e)},t&&(i.crossOrigin=""),i.src=e},a.defaultCreateImage=a.createImage,a}),r("Core/loadImageViaBlob",["./loadBlob","./loadImage"],function(e,t){"use strict";var r=/^data:/,i=function(i){return r.test(i)?t(i):e(i).then(function(e){var r=window.URL.createObjectURL(e);return t(r,!1).then(function(t){return t.blob=e,window.URL.revokeObjectURL(r),t},function(e){return window.URL.revokeObjectURL(r),e})})},n=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(t){return!1}}();return n?i:t}),r("Core/loadXML",["./defined","./DeveloperError","./RequestErrorEvent","../ThirdParty/when"],function(e,t,r,i){"use strict";var n=function(r,o){if(!e(r))throw new t("url is required.");return i(r,function(e){var t=i.defer();return n.loadXML(e,o,t),t.promise})};return n.loadXML=function(t,i,n){var o=new XMLHttpRequest;if(o.overrideMimeType("text/xml"),o.open("GET",t,!0),e(i))for(var a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a,i[a]);o.onload=function(){200===o.status?n.resolve(o.responseXML):n.reject(new r(o.status,o.response))},o.onerror=function(){n.reject(new r)},o.send()},n.defaultLoadXML=n.loadXML,n}),r("Core/requestAnimationFrame",["./defined"],function(e){"use strict";var t=window.requestAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"RequestAnimationFrame"],++i;if(!e(t)){var o=0;t=function(e){var t=Date.now(),r=Math.max(16-(t-o),0);return o=t+r,setTimeout(function(){e(o)},r)}}}();var r=function(e){return t(e)};return r}),r("Core/throttleRequestByServer",["./defaultValue","./defined","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){return t(o)||(o=document.createElement("a")),o.href=e,o.hostname+"%"+o.port}function n(t,n){var o=i(t),l=e(s[o],0);return l>a?void 0:(s[o]=l+1,r(n(t),function(e){return s[o]--,e},function(e){return s[o]--,r.reject(e)}))}var o,a=6,s={};return n}),r("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";var t=function(t,r,i){if("function"!=typeof r)throw new e("oldFunction is required to be a function.");if("function"!=typeof i)throw new e("oldFunction is required to be a function.");return function(){i.apply(t,arguments),r.apply(t,arguments)}};return t}),r("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,r,i,n){var o=t.measureText(r),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=!/\S/.test(r);o.fontsize=s;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+"px "+a,u.innerHTML=r+"
"+r,document.body.appendChild(u),o.leading=1.2*s;var c=e(u,"height");if(c=c.replace("px",""),c>=2*s&&(o.leading=0|c/2),document.body.removeChild(u),l)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var h=document.createElement("canvas"),d=100;h.width=o.width+d,h.height=3*s,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=s;var m=h.getContext("2d");m.font=s+"px "+a;var p=h.width,f=h.height,v=f/2;m.fillStyle="white",m.fillRect(-1,-1,p+2,f+2),i&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(r,d/2,v)),n&&(m.fillStyle="black",m.fillText(r,d/2,v));for(var y=m.getImageData(0,0,p,f).data,g=0,_=4*p,w=y.length;++g0&&255===y[g];);var x=0|g/_;for(g=0;w>g&&255===y[g];)g+=_,g>=w&&(g=g-w+4);var S=0|g%_/4,E=1;for(g=w-3;g>=0&&255===y[g];)g-=_,0>g&&(g=w-3-4*E++);var b=0|g%_/4+1;o.ascent=v-C,o.descent=x-v,o.bounds={minx:S-d/2,maxx:b-d/2,miny:0,maxy:x-C},o.height=1+(x-C)}return o};return t}),r("Core/writeTextToCanvas",["./defaultValue","./defined","./DeveloperError","./Color","../ThirdParty/measureText"],function(e,t,r,i,n){"use strict";var o=function(o,a){if(!t(o))throw new r("text is required.");if(""===o)return void 0;a=e(a,e.EMPTY_OBJECT);var s=e(a.font,"10px sans-serif"),l=document.createElement("canvas");l.width=l.height=1,l.style.font=s;var u=l.getContext("2d");u.font=s,u.textBaseline=e(a.textBaseline,"bottom"),l.style.visibility="hidden",document.body.appendChild(l);var c=e(a.stroke,!1),h=e(a.fill,!0),d=2*e(a.strokeWidth,1);u.lineWidth=d;var m=n(u,o,c,h);l.dimensions=m,document.body.removeChild(l),l.style.visibility="";var p=m.height-m.ascent;l.width=m.width,l.height=m.height;var f=l.height-p;if(u.font=s,c){var v=e(a.strokeColor,i.BLACK);u.strokeStyle=v.toCssColorString(),u.lineWidth=d,u.strokeText(o,0,f)}if(h){var y=e(a.fillColor,i.WHITE);u.fillStyle=y.toCssColorString(),u.fillText(o,0,f)}return l};return o}),r("DynamicScene/ConstantProperty",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Enumeration"],function(e,t,r,i){"use strict";var n=function(e){if(!t(e))throw new r("value is required.");var n="object"!=typeof e||Array.isArray(e)||e instanceof i;if(!n){if("function"!=typeof e.clone)throw new r("clone is a required function.");if("function"!=typeof e.equals)throw new r("equals is a required function.")}this._value=e,this._simple=n};return n.prototype.getValue=function(e,t){return this._simple?this._value:this._value.clone(t)},n.prototype.equals=function(e){return this===e||e instanceof n&&(this._simple&&this._value===e._value||!this._simple&&this._value.equals(e._value))},n}),r("DynamicScene/Property",["../Core/defined","../Core/DeveloperError"],function(e,t){"use strict";function r(){throw new t("This type should not be instantiated directly.")}var i=r;return i.prototype.getValue=r,i.prototype.equals=r,i.equals=function(t,r){return t===r||e(t)&&t.equals(r)},i}),r("DynamicScene/ColorMaterialProperty",["../Core/Color","../Core/defined","./ConstantProperty","./Property"],function(e,t,r,i){"use strict";var n=function(){this.color=new r(e.WHITE)};return n.prototype.getType=function(){return"Color"},n.prototype.getValue=function(e,r){return t(r)||(r={}),r.color=t(this.color)?this.color.getValue(e,r.color):void 0,r},n.prototype.equals=function(e){return this===e||e instanceof n&&i.equals(this.color,e.color)},n}),r("DynamicScene/createDynamicPropertyDescriptor",["../Core/defaultValue"],function(e){"use strict";function t(t,r,i){return{configurable:e(i,!1),get:function(){return this[r]},set:function(e){var i=this[r];i!==e&&(this[r]=e,this._propertyChanged.raiseEvent(this,t,e,i))}}}return t}),r("DynamicScene/DynamicObject",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/TimeInterval","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=["cachedAvailabilityDate","cachedAvailabilityValue","id","propertyChanged","propertyNames","isAvailable","clean","merge","addProperty","removeProperty"],c=function(t){this._cachedAvailabilityDate=void 0,this._cachedAvailabilityValue=void 0,r(t)||(t=e()),this._id=t,this._availability=void 0,this._position=void 0,this._orientation=void 0,this._billboard=void 0,this._cone=void 0,this._ellipsoid=void 0,this._ellipse=void 0,this._label=void 0,this._name=void 0,this._parent=void 0,this._path=void 0,this._point=void 0,this._polygon=void 0,this._polyline=void 0,this._pyramid=void 0,this._vertexPositions=void 0,this._vector=void 0,this._viewFrom=void 0,this._propertyChanged=new o,this._propertyNames=["parent","position","orientation","billboard","cone","ellipsoid","ellipse","label","path","point","polygon","polyline","pyramid","vertexPositions","vector","viewFrom"]};return i(c.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},propertyNames:{get:function(){return this._propertyNames}},id:{get:function(){return this._id}},name:{configurable:!1,get:function(){return this._name},set:function(e){var t=this._name;t!==e&&(this._name=e,this._propertyChanged.raiseEvent(this,"name",e,t))}},availability:l("availability","_availability"),position:l("position","_position"),orientation:l("orientation","_orientation"),viewFrom:l("viewFrom","_viewFrom"),billboard:l("billboard","_billboard"),cone:l("cone","_cone"),ellipsoid:l("ellipsoid","_ellipsoid"),ellipse:l("ellipse","_ellipse"),label:l("label","_label"),parent:l("parent","_parent"),path:l("path","_path"),point:l("point","_point"),polygon:l("polygon","_polygon"),polyline:l("polyline","_polyline"),pyramid:l("pyramid","_pyramid"),vertexPositions:l("vertexPositions","_vertexPositions"),vector:l("vector","_vector")}),c.prototype.isAvailable=function(e){if(!r(e))throw new n("time is required.");var t=this._availability;return!r(t)||t.contains(e)},c.prototype.addProperty=function(e){if(!r(e))throw new n("propertyName is required.");var t=this._propertyNames;if(-1!==t.indexOf(e))throw new n(e+" is already a registered property.");if(-1!==u.indexOf(e))throw new n(e+" is a reserved property name.");t.push(e),Object.defineProperty(this,e,l(e,"_"+e,!0))},c.prototype.removeProperty=function(e){if(!r(e))throw new n("propertyName is required.");var t=this._propertyNames;if(-1!==u.indexOf(e))throw new n(e+" is a reserved property name.");if(-1===t.indexOf(e))throw new n(e+" is not a registered property.");this._propertyNames.push(e),delete this[e]},c.prototype.merge=function(e){if(!r(e))throw new n("source is required.");this.name=t(this.name,e.name),this.availability=t(e.availability,this.availability);for(var i=this._propertyNames,o=i.length,a=0;o>a;a++){var s=i[a],l=this[s],u=e[s];r(u)&&(r(l)?r(l.merge)&&l.merge(u):this[s]=r(u.merge)&&r(u.clone)?u.clone():u)}},c}),r("DynamicScene/DynamicObjectCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TimeInterval","../Core/Iso8601","../Core/DeveloperError","../Core/RuntimeError","./DynamicObject"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){if(0===e._suspendCount){var t=e._added,r=e._removed;(0!==t.length||0!==r.length)&&(e._collectionChanged.raiseEvent(e,t,r),t.length=0,r.length=0,e._addedHash={},e._removedHash={})}}var c=function(){this._array=[],this._hash={},this._added=[],this._addedHash={},this._removed=[],this._removedHash={},this._suspendCount=0,this._collectionChanged=new i,this._id=e()};return c.prototype.suspendEvents=function(){this._suspendCount++},c.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new a("resumeEvents can not be called before suspendEvents.");this._suspendCount--,u(this)},c.collectionChangedEventCallback=void 0,r(c.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}}}),c.prototype.computeAvailability=function(){for(var e=o.MAXIMUM_VALUE,r=o.MINIMUM_VALUE,i=this._array,a=0,s=i.length;s>a;a++){var l=i[a],u=l.availability;if(t(u)){var c=u.getStart(),h=u.getStop();c.lessThan(e)&&!c.equals(o.MINIMUM_VALUE)&&(e=c),h.greaterThan(r)&&!h.equals(o.MAXIMUM_VALUE)&&(r=h)}}return o.MAXIMUM_VALUE.equals(e)&&(e=o.MINIMUM_VALUE),o.MINIMUM_VALUE.equals(r)&&(r=o.MAXIMUM_VALUE),new n(e,r,!0,!0)},c.prototype.add=function(e){if(!t(e))throw new a("dynamicObject is required.");var r=e.id,i=this._hash;if(t(i[r]))throw new s("An object with id "+r+" already exists in this collection.");i[r]=e,this._array.push(e);var n=this._removed,o=-1,l=this._removedHash[r];t(l)&&(o=n.indexOf(l)),-1!==o?(n.splice(o,1),this._removedHash[r]=void 0):(this._added.push(e),this._addedHash[r]=e),u(this)},c.prototype.remove=function(e){if(!t(e))throw new a("dynamicObject is required");return this.removeById(e.id)},c.prototype.removeById=function(e){if(!t(e))throw new a("id is required.");var r=this._hash,i=this._array,n=r[e],o=t(n);if(o){r[e]=void 0,i.splice(i.indexOf(n),1);var s=this._added,l=-1,c=this._addedHash[e];t(c)&&(l=s.indexOf(c)),-1!==l?(s.splice(l,1),this._addedHash[e]=void 0):(this._removed.push(n),this._removedHash[e]=n),u(this)}return o},c.prototype.removeAll=function(){for(var e=this._array,r=e.length,i=this._removed,n=this._removedHash,o=this._addedHash,a=0;r>a;a++){var s=e[a],l=s.id,c=o[l];t(c)||(i.push(s),n[l]=s)}this._addedHash={},this._added.length=0,e.length=0,this._hash={},u(this)},c.prototype.getById=function(e){if(!t(e))throw new a("id is required.");return this._hash[e]},c.prototype.getObjects=function(){return this._array},c.prototype.getOrCreateObject=function(e){if(!t(e))throw new a("id is required.");var r=this._hash[e];return t(r)||(r=new l(e),this.add(r)),r},c}),r("DynamicScene/CompositeDynamicObjectCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./DynamicObject","./DynamicObjectCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,r=t.length,i=0;r>i;i++)e[t[i]]=void 0}function l(e,r,i){return function(n,o){for(var a=r.id,s=e._composite,l=s.getById(a),u=l[i],c=e._collectionsCopy,h=c.length,d=h-1;d>=0;d--){var m=c[d].getById(r.id);if(t(m)){var p=m[i];if(t(p)){var f=p[o];if(t(f))return u[o]=f,void 0}}}u[o]=void 0}}function u(e,r){var i=e._composite,n=e._eventHash;return function(o,a){var s=o.id,l=i.getById(s),u=l[a];h(n,r,o,a),c(e,n,r,o,a,o[a]);for(var d=e._collectionsCopy,m=d.length,p=!0,f=m-1;f>=0;f--){var v=d[f].getById(o.id);if(t(v)){var y=v[a];if(t(y)){if(p){if(p=!1,!t(y.merge)||!t(y.clone)){u=y;break}u=y.clone(u)}u.merge(y)}}}l[a]=u}}function c(e,r,i,n,o,a){if(t(a)&&t(a.propertyChanged)){var s=l(e,n,o);y[0]=i,y[1]=n.id,y[2]=o,r[JSON.stringify(y)]=a.propertyChanged.addEventListener(s)}}function h(e,r,i,n){y[0]=r,y[1]=i.id,y[2]=n;var o=JSON.stringify(y),a=e[o];t(a)&&(a(),e[o]=void 0)}function d(e,t,r,i){g[0]=r,g[1]=i.id,t[JSON.stringify(g)]=i.propertyChanged.addEventListener(u(e,r));for(var n=i.propertyNames,o=n.length,a=0;o>a;a++){var s=n[a];c(e,t,r,i,s,i[s])}}function m(e,t,r,i){g[0]=r,g[1]=i.id;var n=JSON.stringify(g);t[n](),t[n]=void 0;for(var o=i.propertyNames,a=o.length,s=0;a>s;s++){var l=o[s];h(t,r,i,l)}}function p(e){var r,i,n,l,u,c,h=e._collections,p=h.length,f=e._collectionsCopy,v=f.length,y=e._composite,g=new a,w=e._eventHash;for(r=0;v>r;r++)for(u=f[r],u.collectionChanged.removeEventListener(_.prototype._onCollectionChanged,e),n=u.getObjects(),c=u.id,l=n.length-1;l>-1;l--)i=n[l],m(e,w,c,i); -for(r=p-1;r>=0;r--)for(u=h[r],u.collectionChanged.addEventListener(_.prototype._onCollectionChanged,e),n=u.getObjects(),c=u.id,l=n.length-1;l>-1;l--){i=n[l],d(e,w,c,i);var C=g.getById(i.id);t(C)||(C=y.getById(i.id),t(C)?s(C):C=new o(i.id),g.add(C)),C.merge(i)}e._collectionsCopy=h.slice(0),y.suspendEvents(),y.removeAll();var x=g.getObjects();for(r=0;rr)throw new i("index must be greater than or equal to zero.");if(r>this._collections.length)throw new i("index must be less than or equal to the number of collections.");this._collections.splice(r,0,e)}else r=this._collections.length,this._collections.push(e);p(this)},_.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t?(this._collections.splice(t,1),p(this),!0):!1},_.prototype.removeAllCollections=function(){this._collections.length=[],p(this)},_.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},_.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},_.prototype.getCollection=function(e){if(!t(e))throw new i("index is required.","index");return this._collections[e]},_.prototype.getCollectionsLength=function(){return this._collections.length},_.prototype.raiseCollection=function(e){var t=f(this._collections,e);v(this,t,t+1)},_.prototype.lowerCollection=function(e){var t=f(this._collections,e);v(this,t,t-1)},_.prototype.raiseCollectionToTop=function(e){var t=f(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),p(this))},_.prototype.lowerCollectionToBottom=function(e){var t=f(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),p(this))},_.prototype.suspendEvents=function(){this._composite.suspendEvents()},_.prototype.resumeEvents=function(){this._composite.resumeEvents()},_.prototype.computeAvailability=function(){return this._composite.computeAvailability()},_.prototype.getById=function(e){return this._composite.getById(e)},_.prototype.getObjects=function(){return this._composite.getObjects()},_.prototype._onCollectionChanged=function(e,r,i){var n=this._collectionsCopy,a=n.length,l=this._composite;l.suspendEvents();var u,c,h,p,f=i.length,v=this._eventHash,y=e.id;for(u=0;f>u;u++){var g=i[u];m(this,v,y,g);var _=g.id;for(c=a-1;c>=0;c--)h=n[c].getById(_),t(h)&&(t(p)||(p=l.getById(_),s(p)),p.merge(h));t(p)||l.removeById(_)}var w=r.length;for(u=0;w>u;u++){var C=r[u];d(this,v,y,C);var x=C.id;for(c=a-1;c>=0;c--)h=n[c].getById(x),t(h)&&(t(p)||(p=l.getById(x),t(p)?s(p):(p=new o(x),l.add(p))),p.merge(h))}l.resumeEvents()},_}),r("DynamicScene/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n){"use strict";var o=function(){this._intervals=new i};return t(o.prototype,{intervals:{get:function(){return this._intervals}}}),o.prototype.getType=function(t){if(!e(t))throw new r("time is required");var i=this._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getType(t):void 0},o.prototype.getValue=function(t,i){if(!e(t))throw new r("time is required");var n=this._intervals.findDataForIntervalContainingDate(t);return e(n)?n.getValue(t,i):void 0},o.prototype.equals=function(e){return this===e||e instanceof o&&this._intervals.equals(e._intervals,n.equals)},o}),r("DynamicScene/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/TimeIntervalCollection","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){this._intervals=new n,this._referenceFrame=e(t,o.FIXED)};return r(s.prototype,{intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.getValueInReferenceFrame=function(e,r,n){if(!t(e))throw new i("time is required.");if(!t(r))throw new i("referenceFrame is required.");var o=this._intervals.findDataForIntervalContainingDate(e);return t(o)?o.getValueInReferenceFrame(e,r,n):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._referenceFrame===e._referenceFrame&&this._intervals.equals(e._intervals,a.equals)},s}),r("DynamicScene/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n){"use strict";var o=function(){this._intervals=new i};return t(o.prototype,{intervals:{get:function(){return this._intervals}}}),o.prototype.getValue=function(t,i){if(!e(t))throw new r("time is required");var n=this._intervals.findDataForIntervalContainingDate(t);return e(n)?n.getValue(t,i):void 0},o.prototype.equals=function(e){return this===e||e instanceof o&&this._intervals.equals(e._intervals,n.equals)},o}),r("DynamicScene/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,r,i,n,o,a){"use strict";function s(){throw new i("This type should not be instantiated directly.")}var l=s;r(l.prototype,{referenceFrame:{get:s}}),l.prototype.getValue=s,l.prototype.getValueInReferenceFrame=s,l.prototype.equals=s;var u=new n;return l.convertToReferenceFrame=function(r,i,s,l,c){if(s===l)return e.clone(i,c);var h=a.computeIcrfToFixedMatrix(r,u);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(r,u)),s===o.INERTIAL?n.multiplyByVector(h,i,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,u),i,c):void 0},l}),r("DynamicScene/ConstantPositionProperty",["./ConstantProperty","./PositionProperty","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(t,r){this._property=new e(t),this._referenceFrame=i(r,s.FIXED)};return o(u.prototype,{referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,s.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,r,i){if(!n(e))throw new a("time is required.");if(!n(r))throw new a("referenceFrame is required.");var o=this._property.getValue(e,i);return t.convertToReferenceFrame(e,o,this._referenceFrame,r,o)},u.prototype.equals=function(e){return this===e||e instanceof u&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},u}),r("Scene/HorizontalOrigin",["../Core/Enumeration"],function(e){"use strict";var t={CENTER:new e(0,"CENTER"),LEFT:new e(1,"LEFT"),RIGHT:new e(-1,"RIGHT")};return t}),r("Scene/LabelStyle",["../Core/Enumeration"],function(e){"use strict";var t={FILL:new e(0,"FILL"),OUTLINE:new e(1,"OUTLINE"),FILL_AND_OUTLINE:new e(2,"FILL_AND_OUTLINE")};return t}),r("Scene/VerticalOrigin",["../Core/Enumeration"],function(e){"use strict";var t={CENTER:new e(0,"CENTER"),BOTTOM:new e(1,"BOTTOM"),TOP:new e(-1,"TOP")};return t}),r("DynamicScene/DynamicBillboard",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._image=void 0,this._width=void 0,this._height=void 0,this._scale=void 0,this._rotation=void 0,this._alignedAxis=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._color=void 0,this._eyeOffset=void 0,this._pixelOffset=void 0,this._show=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._pixelOffsetScaleByDistance=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},image:o("image","_image"),scale:o("scale","_scale"),rotation:o("rotation","_rotation"),alignedAxis:o("alignedAxis","_alignedAxis"),horizontalOrigin:o("horizontalOrigin","_horizontalOrigin"),verticalOrigin:o("verticalOrigin","_verticalOrigin"),color:o("color","_color"),eyeOffset:o("eyeOffset","_eyeOffset"),pixelOffset:o("pixelOffset","_pixelOffset"),show:o("show","_show"),width:o("width","_width"),height:o("height","_height"),scaleByDistance:o("scaleByDistance","_scaleByDistance"),translucencyByDistance:o("translucencyByDistance","_translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance","_pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this._color,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.color=e(this._color,r._color),this.eyeOffset=e(this._eyeOffset,r._eyeOffset),this.horizontalOrigin=e(this._horizontalOrigin,r._horizontalOrigin),this.image=e(this._image,r._image),this.pixelOffset=e(this._pixelOffset,r._pixelOffset),this.scale=e(this._scale,r._scale),this.rotation=e(this._rotation,r._rotation),this.alignedAxis=e(this._alignedAxis,r._alignedAxis),this.show=e(this._show,r._show),this.verticalOrigin=e(this._verticalOrigin,r._verticalOrigin),this.width=e(this._width,r._width),this.height=e(this._height,r._height),this.scaleByDistance=e(this._scaleByDistance,r._scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,r._translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)},a}),r("DynamicScene/DynamicClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._propertyChanged=new o};return i(s.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},startTime:a("startTime","_startTime"),stopTime:a("stopTime","_stopTime"),currentTime:a("currentTime","_currentTime"),clockRange:a("clockRange","_clockRange"),clockStep:a("clockStep","_clockStep"),multiplier:a("multiplier","_multiplier")}),s.prototype.clone=function(e){return r(e)||(e=new s),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},s.prototype.merge=function(e){if(!r(e))throw new n("source is required.");this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},s.prototype.getValue=function(t){return r(t)||(t=new e),t.startTime=this.startTime,t.stopTime=this.stopTime,t.clockRange=this.clockRange,t.clockStep=this.clockStep,t.multiplier=this.multiplier,t.currentTime=this.currentTime,t},s}),r("DynamicScene/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defined","./ConstantProperty","./Property"],function(e,t,r,i){"use strict";var n=function(){this.color=new r(e.WHITE),this.outlineColor=new r(e.BLACK),this.outlineWidth=new r(0)};return n.prototype.getType=function(){return"PolylineOutline"},n.prototype.getValue=function(e,r){return t(r)||(r={}),r.color=t(this.color)?this.color.getValue(e,r.color):void 0,r.outlineColor=t(this.outlineColor)?this.outlineColor.getValue(e,r.outlineColor):void 0,r.outlineWidth=t(this.outlineWidth)?this.outlineWidth.getValue(e):void 0,r},n.prototype.equals=function(e){return this===e||e instanceof n&&i.equals(this.color,e.color)&&i.equals(this.outlineColor,e.outlineColor)&&i.equals(this.outlineWidth,e.outlineWidth)},n}),r("DynamicScene/DynamicCone",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._minimumClockAngle=void 0,this._maximumClockAngle=void 0,this._innerHalfAngle=void 0,this._outerHalfAngle=void 0,this._capMaterial=void 0,this._innerMaterial=void 0,this._outerMaterial=void 0,this._silhouetteMaterial=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._showIntersection=void 0,this._radius=void 0,this._show=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},minimumClockAngle:o("minimumClockAngle","_minimumClockAngle"),maximumClockAngle:o("maximumClockAngle","_maximumClockAngle"),innerHalfAngle:o("innerHalfAngle","_innerHalfAngle"),outerHalfAngle:o("outerHalfAngle","_outerHalfAngle"),capMaterial:o("capMaterial","_capMaterial"),innerMaterial:o("innerMaterial","_innerMaterial"),outerMaterial:o("outerMaterial","_outerMaterial"),silhouetteMaterial:o("silhouetteMaterial","_silhouetteMaterial"),intersectionColor:o("intersectionColor","_intersectionColor"),intersectionWidth:o("intersectionWidth","_intersectionWidth"),showIntersection:o("showIntersection","_showIntersection"),radius:o("radius","_radius"),show:o("show","_show")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.innerHalfAngle=this.innerHalfAngle,e.outerHalfAngle=this.outerHalfAngle,e.minimumClockAngle=this.minimumClockAngle,e.maximumClockAngle=this.maximumClockAngle,e.radius=this.radius,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.capMaterial=this.capMaterial,e.innerMaterial=this.innerMaterial,e.outerMaterial=this.outerMaterial,e.silhouetteMaterial=this.silhouetteMaterial,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.show=e(this.show,r.show),this.innerHalfAngle=e(this.innerHalfAngle,r.innerHalfAngle),this.outerHalfAngle=e(this.outerHalfAngle,r.outerHalfAngle),this.minimumClockAngle=e(this.minimumClockAngle,r.minimumClockAngle),this.maximumClockAngle=e(this.maximumClockAngle,r.maximumClockAngle),this.radius=e(this.radius,r.radius),this.showIntersection=e(this.showIntersection,r.showIntersection),this.intersectionColor=e(this.intersectionColor,r.intersectionColor),this.intersectionWidth=e(this.intersectionWidth,r.intersectionWidth),this.capMaterial=e(this.capMaterial,r.capMaterial),this.innerMaterial=e(this.innerMaterial,r.innerMaterial),this.outerMaterial=e(this.outerMaterial,r.outerMaterial),this.silhouetteMaterial=e(this.silhouetteMaterial,r.silhouetteMaterial)},a}),r("DynamicScene/DynamicLabel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._text=void 0,this._font=void 0,this._style=void 0,this._fillColor=void 0,this._outlineColor=void 0,this._outlineWidth=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._eyeOffset=void 0,this._pixelOffset=void 0,this._scale=void 0,this._show=void 0,this._translucencyByDistance=void 0,this._pixelOffsetScaleByDistance=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},text:o("text","_text"),font:o("font","_font"),style:o("style","_style"),fillColor:o("fillColor","_fillColor"),outlineColor:o("outlineColor","_outlineColor"),outlineWidth:o("outlineWidth","_outlineWidth"),horizontalOrigin:o("horizontalOrigin","_horizontalOrigin"),verticalOrigin:o("verticalOrigin","_verticalOrigin"),eyeOffset:o("eyeOffset","_eyeOffset"),pixelOffset:o("pixelOffset","_pixelOffset"),scale:o("scale","_scale"),show:o("show","_show"),translucencyByDistance:o("translucencyByDistance","_translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance","_pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.text=e(this.text,r.text),this.font=e(this.font,r.font),this.show=e(this.show,r.show),this.style=e(this.style,r.style),this.fillColor=e(this.fillColor,r.fillColor),this.outlineColor=e(this.outlineColor,r.outlineColor),this.outlineWidth=e(this.outlineWidth,r.outlineWidth),this.scale=e(this.scale,r.scale),this.horizontalOrigin=e(this.horizontalOrigin,r.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,r.verticalOrigin),this.eyeOffset=e(this.eyeOffset,r.eyeOffset),this.pixelOffset=e(this.pixelOffset,r.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,r._translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)},a}),r("DynamicScene/DynamicDirectionsProperty",["../Core/defined","../Core/TimeInterval","../Core/TimeIntervalCollection","../Core/Cartesian3","../Core/Spherical","../Core/Iso8601"],function(e,t,r,i,n,o){"use strict";function a(t){var r,o,a=[],s=t.unitSpherical;if(e(s)){for(r=0,o=s.length;o>r;r+=2)a.push(new n(s[r],s[r+1]));this.spherical=a}if(s=t.unitCartesian,e(s)){for(r=0,o=s.length;o>r;r+=3)a.push(new i(s[r],s[r+1],s[r+2],!0));this.cartesian=a}}function s(r,i,n){var s=i.interval;s=e(s)?t.fromIso8601(s):o.MAXIMUM_INTERVAL.clone(),e(n)&&(s=s.intersect(n));var l=r._propertyIntervals,u=l.findInterval(s.start,s.stop);e(u)||(u=s,l.addInterval(u)),u.data=new a(i)}a.prototype.getValue=function(){var t=this.spherical;if(!e(t)){t=[],this.spherical=t;for(var r=this.cartesian,i=0,o=r.length;o>i;i++)t.push(n.fromCartesian3(r[i]))}return t};var l=function(){this._propertyIntervals=new r};return l.prototype.processCzmlIntervals=function(e,t,r){if(Array.isArray(e))for(var i=0,n=e.length;n>i;i++)s(this,e[i],t,r);else s(this,e,t,r)},l.prototype.getValue=function(t){var r=this._propertyIntervals.findIntervalContainingDate(t);return e(r)?r.data.getValue():void 0},l}),r("DynamicScene/DynamicEllipse",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/Shapes","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(){this._semiMajorAxis=void 0,this._semiMinorAxis=void 0,this._rotation=void 0,this._lastPosition=void 0,this._lastSemiMajorAxis=void 0,this._lastSemiMinorAxis=void 0,this._lastRotation=void 0,this._cachedVertexPositions=void 0,this._propertyChanged=new a};return i(u.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},semiMajorAxis:l("semiMajorAxis","_semiMajorAxis"),semiMinorAxis:l("semiMinorAxis","_semiMinorAxis"),rotation:l("rotation","_rotation")}),u.prototype.clone=function(e){return r(e)||(e=new u),e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e},u.prototype.merge=function(e){if(!r(e))throw new n("source is required.");this.rotation=t(this.rotation,e.rotation),this.semiMajorAxis=t(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=t(this.semiMinorAxis,e.semiMinorAxis)},u.prototype.getValue=function(t,i){var n=this._semiMajorAxis,a=this._semiMinorAxis;if(!r(i)||!r(n)||!r(a))return void 0;var l=n.getValue(t),u=a.getValue(t),c=0,h=this._rotation;if(r(h)&&(c=h.getValue(t)),!r(l)||!r(u)||0===l||0===u)return void 0;var d=this._lastPosition,m=this._lastSemiMajorAxis,p=this._lastSemiMinorAxis,f=this._lastRotation;return c===f&&m===l&&p===u&&e.equals(d,i)||(this._cachedVertexPositions=s.computeEllipseBoundary(o.WGS84,i,l,u,c),this._lastPosition=e.clone(i,this._lastPosition),this._lastRotation=c,this._lastSemiMajorAxis=l,this._lastSemiMinorAxis=u),this._cachedVertexPositions},u}),r("DynamicScene/DynamicEllipsoid",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._radii=void 0,this._material=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},show:o("show","_show"),radii:o("radii","_radii"),material:o("material","_material")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.radii=this.radii,e.material=this.material,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.show=e(this.show,r.show),this.radii=e(this.radii,r.radii),this.material=e(this.material,r.material)},a}),r("DynamicScene/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defined","./ConstantProperty","./Property"],function(e,t,r,i,n){"use strict";var o=function(){this.color=new i(t.WHITE),this.cellAlpha=new i(.1),this.lineCount=new i(new e(8,8)),this.lineThickness=new i(new e(1,1))};return o.prototype.getType=function(){return"Grid"},o.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=r(this.color)?this.color.getValue(e,t.color):void 0,t.cellAlpha=r(this.cellAlpha)?this.cellAlpha.getValue(e):void 0,t.lineCount=r(this.lineCount)?this.lineCount.getValue(e,t.lineCount):void 0,t.lineThickness=r(this.lineThickness)?this.lineThickness.getValue(e,t.lineThickness):void 0,t},o.prototype.equals=function(e){return this===e||e instanceof o&&n.equals(this.color,e.color)&&n.equals(this.cellAlpha,e.cellAlpha)&&n.equals(this.lineCount,e.lineCount)&&n.equals(this.lineThickness,e.lineThickness)},o}),r("DynamicScene/ImageMaterialProperty",["../Core/Cartesian2","../Core/defined","./ConstantProperty","./Property"],function(e,t,r,i){"use strict";var n=function(){this.image=void 0,this.repeat=new r(new e(1,1))};return n.prototype.getType=function(){return"Image"},n.prototype.getValue=function(e,r){return t(r)||(r={}),r.image=t(this.image)?this.image.getValue(e):void 0,r.repeat=t(this.repeat)?this.repeat.getValue(e,r.repeat):void 0,r},n.prototype.equals=function(e){return this===e||e instanceof n&&i.equals(this.image,e.image)&&i.equals(this.repeat,e.repeat)},n}),r("DynamicScene/DynamicPath",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._outlineColor=void 0,this._outlineWidth=void 0,this._show=void 0,this._width=void 0,this._resolution=void 0,this._leadTime=void 0,this._trailTime=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},color:o("color","_color"),outlineColor:o("outlineColor","_outlineColor"),outlineWidth:o("outlineWidth","_outlineWidth"),show:o("show","_show"),width:o("width","_width"),resolution:o("resolution","_resolution"),leadTime:o("leadTime","_leadTime"),trailTime:o("trailTime","_trailTime")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.width=this.width,e.resolution=this.resolution,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.color=e(this.color,r.color),this.width=e(this.width,r.width),this.resolution=e(this.resolution,r.resolution),this.outlineColor=e(this.outlineColor,r.outlineColor),this.outlineWidth=e(this.outlineWidth,r.outlineWidth),this.show=e(this.show,r.show),this.leadTime=e(this.leadTime,r.leadTime),this.trailTime=e(this.trailTime,r.trailTime)},a}),r("DynamicScene/DynamicPoint",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._pixelSize=void 0,this._outlineColor=void 0,this._outlineWidth=void 0,this._show=void 0,this._scaleByDistance=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},color:o("color","_color"),pixelSize:o("pixelSize","_pixelSize"),outlineColor:o("outlineColor","_outlineColor"),outlineWidth:o("outlineWidth","_outlineWidth"),show:o("show","_show"),scaleByDistance:o("scaleByDistance","_scaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.color=e(this.color,r.color),this.pixelSize=e(this.pixelSize,r.pixelSize),this.outlineColor=e(this.outlineColor,r.outlineColor),this.outlineWidth=e(this.outlineWidth,r.outlineWidth),this.show=e(this.show,r.show),this.scaleByDistance=e(this.scaleByDistance,r.scaleByDistance)},a}),r("DynamicScene/DynamicPolyline",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._material=void 0,this._width=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},show:o("show","_show"),material:o("material","_material"),width:o("width","_width")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.material=this.material,e.width=this.width,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.show=e(this.show,r.show),this.material=e(this.material,r.material),this.width=e(this.width,r.width)},a}),r("DynamicScene/DynamicPolygon",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._material=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},show:o("show","_show"),material:o("material","_material")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.material=this.material,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.show=e(this.show,r.show),this.material=e(this.material,r.material)},a}),r("DynamicScene/DynamicPyramid",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._directions=void 0,this._radius=void 0,this._showIntersection=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._material=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},show:o("show","_show"),directions:o("directions","_directions"),radius:o("radius","_radius"),showIntersection:o("showIntersection","_showIntersection"),intersectionColor:o("intersectionColor","_intersectionColor"),intersectionWidth:o("intersectionWidth","_intersectionWidth"),material:o("material","_material")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.directions=this.directions,e.radius=this.radius,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.material=this.material,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.show=e(this.show,r.show),this.directions=e(this.directions,r.directions),this.radius=e(this.radius,r.radius),this.showIntersection=e(this.showIntersection,r.showIntersection),this.intersectionColor=e(this.intersectionColor,r.intersectionColor),this.intersectionWidth=e(this.intersectionWidth,r.intersectionWidth),this.material=e(this.material,r.material)},a}),r("DynamicScene/DynamicVector",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._show=void 0,this._width=void 0,this._direction=void 0,this._length=void 0,this._propertyChanged=new n};return r(a.prototype,{propertyChanged:{get:function(){return this._propertyChanged}},color:o("color","_color"),show:o("show","_show"),width:o("width","_width"),direction:o("direction","_direction"),length:o("length","_length")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.width=this.width,e.direction=this.direction,e.length=this.length,e.show=this.show,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.color=e(this.color,r.color),this.width=e(this.width,r.width),this.direction=e(this.direction,r.direction),this.length=e(this.length,r.length),this.show=e(this.show,r.show)},a}),r("DynamicScene/ReferenceProperty",["../Core/defaultValue","../Core/defined","../Core/DeveloperError"],function(e,t,r){"use strict";function i(e){var r=e._targetProperty;if(!t(r)){var i=e._dynamicObjectCollection,n=i.getById(e._targetObjectId);t(n)&&(r=n[e._targetPropertyName],e._targetProperty=r,e._targetObject=n)}return r}var n=function(e,i,n){if(!t(e))throw new r("dynamicObjectCollection is required.");if(!t(i))throw new r("targetObjectId is required.");if(!t(n))throw new r("targetPropertyName is required.");this._targetProperty=void 0,this._dynamicObjectCollection=e,this._targetObjectId=i,this._targetObject=void 0,this._targetPropertyName=n};return n.fromString=function(e,i){if(!t(e))throw new r("dynamicObjectCollection is required.");if(!t(i))throw new r("referenceString is required.");var o=i.split(".");if(2!==o.length)throw new r("referenceString must contain a single . delineating the target object ID and property name.");return new n(e,o[0],o[1])},n.prototype.getValue=function(e,n){if(!t(e))throw new r("time is required.");var o=i(this);return t(o)&&this._targetObject.isAvailable(e)?o.getValue(e,n):void 0},n.prototype.equals=function(e){return this===e||this._dynamicObjectCollection===e._dynamicObjectCollection&&this._targetObjectId===e._targetObjectId&&this._targetPropertyName===e._targetPropertyName},n}),r("DynamicScene/DynamicVertexPositionsProperty",["../Core/defined","../Core/TimeInterval","../Core/TimeIntervalCollection","../Core/Cartesian3","../Core/Cartographic","../Core/Iso8601","../Core/Ellipsoid","./ReferenceProperty"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){var r,o,a,s=[];if(a=t.cartesian,e(a)){for(r=0,o=a.length;o>r;r+=3)s.push(new i(a[r],a[r+1],a[r+2])); -this.cartesian=s}else if(a=t.cartographicRadians,e(a)){for(r=0,o=a.length;o>r;r+=3)s.push(new n(a[r],a[r+1],a[r+2]));this.cartographic=s}else if(a=t.cartographicDegrees,e(a)){for(r=0,o=a.length;o>r;r+=3)s.push(n.fromDegrees(a[r],a[r+1],a[r+2]));this.cartographic=s}}var u=a.WGS84;l.prototype.getValue=function(){return e(this.cartesian)||(this.cartesian=u.cartographicArrayToCartesianArray(this.cartographic)),this.cartesian};var c=function(){this._propertyIntervals=new r};return c.prototype.processCzmlIntervals=function(e,t,r){if(Array.isArray(e))for(var i=0,n=e.length;n>i;i++)this._addCzmlInterval(e[i],t,r);else this._addCzmlInterval(e,t,r)},c.prototype.getValue=function(t){var r=this._propertyIntervals.findIntervalContainingDate(t);if(!e(r))return void 0;var i=r.data;if(Array.isArray(i)){for(var n=[],o=0,a=i.length;a>o;o++){var s=i[o].getValue(t);e(s)&&n.push(s)}return n}return i.getValue()},c.prototype._addCzmlInterval=function(r,i,n){var a=r.interval;a=e(a)?t.fromIso8601(a):o.MAXIMUM_INTERVAL.clone(),e(i)&&(a=a.intersect(i));var u=this._propertyIntervals,c=u.findInterval(a.start,a.stop);e(c)||(c=a,u.addInterval(c));var h=r.references;if(e(h)){for(var d=[],m=0,p=h.length;p>m;m++)d.push(s.fromString(n,h[m]));c.data=d}else c.data=new l(r)},c}),r("DynamicScene/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){var i,n=e.length,o=r.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;o>i;i++)e[t++]=r[i]}function l(e,t){return e instanceof o?e:"string"==typeof e?o.fromIso8601(e):t.addSeconds(e)}var u={packedLength:1,pack:function(e,r,i){i=t(i,0),r[i]=e},unpack:function(e,r){return r=t(r,0),e[r]}},c=[],h=[],d=function(t,i,n,a,u){for(var d,m,p,f,v,y,g=0;gp){for(p=~p,f=p*u,m=void 0,y=i[p];g=0||r(y)&&o.compare(v,y)>=0));){for(c[_++]=v,g+=1,d=0;u>d;d++)h[w++]=a[g],g+=1;m=v}_>0&&(h.length=w,s(n,f,h),c.length=_,s(i,p,c))}else{for(d=0;u>d;d++)g++,n[p*u+d]=a[g];g++}}},m=function(e){if(!r(e))throw new n("type is required.");var i=e;i===Number&&(i=u);var o=t(i.packedInterpolationLength,i.packedLength);this._type=e,this._innerType=i,this._interpolationDegree=1,this._interpolationAlgorithm=a,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o)};return i(m.prototype,{type:{get:function(){return this._type}},interpolationDegree:{get:function(){return this._interpolationDegree},set:function(e){this._interpolationDegree=e,this._updateTableLength=!0}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm},set:function(e){this._interpolationAlgorithm=e,this._updateTableLength=!0}}}),m.prototype.getValue=function(t,i){if(!r(t))throw new n("time is required.");var a=this._innerType,s=this._times,l=this._values,u=e(s,t,o.compare);if(0>u){var c=this._xTable,h=this._yTable,d=this._interpolationAlgorithm,m=this._packedInterpolationLength;if(this._updateTableLength){this._updateTableLength=!1;var p=Math.min(d.getRequiredDataPoints(this._interpolationDegree),s.length);p!==this._numberOfPoints&&(this._numberOfPoints=p,c.length=p,h.length=p*m)}var f=this._numberOfPoints-1;if(1>f)return void 0;u=~u,u>=s.length&&(u=s.length-1);var v=0,y=s.length-1,g=y-v+1;if(f+1>g);else{var _=u-(0|f/2)-1;v>_&&(_=v);var w=_+f;w>y&&(w=y,_=w-f,v>_&&(_=v)),v=_,y=w}for(var C=y-v+1,x=0;C>x;++x)c[x]=s[y].getSecondsDifference(s[v+x]);if(r(a.convertPackedArrayForInterpolation))a.convertPackedArrayForInterpolation(l,v,y,h);else for(var S=0,E=a.packedLength,b=v*E,T=(y+1)*E;T>b;)h[S]=l[b],b++,S++;var A=s[y].getSecondsDifference(t),D=d.interpolateOrderZero(A,c,h,m,this._interpolationResult);return r(a.unpackInterpolationResult)?a.unpackInterpolationResult(D,l,v,y,i):a.unpack(D,0,i)}return a.unpack(this._values,u*a.packedLength,i)},m.prototype.addSample=function(e,t){if(!r(e))throw new n("time is required.");if(!r(t))throw new n("value is required.");var i=this._innerType,o=[e];i.pack(t,o,1),d(void 0,this._times,this._values,o,i.packedLength),this._updateTableLength=!0},m.prototype.addSamples=function(e,t){if(!r(e))throw new n("times is required.");if(!r(t))throw new n("values is required.");if(e.length!==t.length)throw new n("times and values must be the same length.");for(var i=this._innerType,o=e.length,a=[],s=0;o>s;s++)a.push(e[s]),i.pack(t[s],a,a.length);d(void 0,this._times,this._values,a,i.packedLength),this._updateTableLength=!0},m.prototype.addSamplesPackedArray=function(e,t){if(!r(e))throw new n("packedSamples is required.");d(t,this._times,this._values,e,this._innerType.packedLength),this._updateTableLength=!0},m.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;var t=this._times,i=e._times,n=t.length;if(n!==i.length)return!1;var a;for(a=0;n>a;a++)if(!o.equals(t[a],i[a]))return!1;var s=this._values,l=e._values;for(a=0;n>a;a++)if(s[a]!==l[a])return!1;return this._type===e._type&&this._interpolationDegree===e._interpolationDegree&&this._interpolationAlgorithm===e._interpolationAlgorithm},m._mergeNewSamples=d,m}),r("DynamicScene/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r){this._property=new l(e),this._referenceFrame=t(r,o.FIXED)};return i(u.prototype,{referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree},set:function(e){this._property.interpolationDegree=e}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm},set:function(e){this._property.interpolationAlgorithm=e}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,t,i){if(!r(e))throw new n("time is required.");if(!r(t))throw new n("referenceFrame is required.");return i=this._property.getValue(e,i),r(i)?a.convertToReferenceFrame(e,i,this._referenceFrame,t,i):i},u.prototype.addSample=function(e,t){this._property.addSample(e,t)},u.prototype.addSamples=function(e,t){this._property.addSamples(e,t)},u.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},u.prototype.equals=function(e){return this===e||s.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},u}),r("DynamicScene/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){this._intervals=new o,this._referenceFrame=e(t,n.FIXED)};return r(l.prototype,{intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,n.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,n){if(!t(e))throw new i("time is required.");if(!t(r))throw new i("referenceFrame is required.");var o=this._intervals.findDataForIntervalContainingDate(e);return t(o)?a.convertToReferenceFrame(e,o,this._referenceFrame,r,n):void 0},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,s.equals)&&this._referenceFrame===e._referenceFrame},l}),r("DynamicScene/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Enumeration","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o){"use strict";var a=function(){this._intervals=new n};return t(a.prototype,{intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,n){if(!e(t))throw new r("time is required");var o=this._intervals.findDataForIntervalContainingDate(t);return!e(o)||"object"!=typeof o||Array.isArray(o)||o instanceof i?o:o.clone(n)},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a}),r("DynamicScene/CzmlDataSource",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Color","../Core/ClockRange","../Core/ClockStep","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/Quaternion","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./DynamicBillboard","./DynamicClock","./ColorMaterialProperty","./PolylineOutlineMaterialProperty","./DynamicCone","./DynamicLabel","./DynamicDirectionsProperty","./DynamicEllipse","./DynamicEllipsoid","./GridMaterialProperty","./ImageMaterialProperty","./DynamicObject","./DynamicObjectCollection","./DynamicPath","./DynamicPoint","./DynamicPolyline","./DynamicPolygon","./DynamicPyramid","./DynamicVector","./DynamicVertexPositionsProperty","./SampledPositionProperty","./SampledProperty","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","../ThirdParty/Uri","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M,I,O,R,L,z,N,B,F,V,k,U,W,q,G,H,j,Y,X,Z,J,K,Q,$,et,tt,rt,it,nt,ot){"use strict";function at(e){var t=e.rgbaf;if(l(t))return t;var r=e.rgba;if(!l(r))return void 0;if(r.length===i.length)return[i.byteToFloat(r[0]),i.byteToFloat(r[1]),i.byteToFloat(r[2]),i.byteToFloat(r[3])];var n=r.length;t=new Array(n);for(var o=0;n>o;o+=5)t[o]=r[o],t[o+1]=i.byteToFloat(r[o+1]),t[o+2]=i.byteToFloat(r[o+2]),t[o+3]=i.byteToFloat(r[o+3]),t[o+4]=i.byteToFloat(r[o+4]);return t}function st(e,t){var r=s(e.image,e);if(l(t)){var i=new nt(document.location.href);t=new nt(t),r=new nt(r).resolve(t.resolve(i)).toString()}return r}function lt(e){if(l(e.cartesian))return e.cartesian;if(l(e.unitCartesian))return e.unitCartesian;var r,i,n,o=e.unitSpherical;if(l(o)){if(i=o.length,2===i)Vt.clock=o[0],Vt.cone=o[1],t.fromSpherical(Vt,Ft),n=[Ft.x,Ft.y,Ft.z];else{var a=0;for(n=new Array(4*(i/3)),r=0;i>r;r+=4)n[r]=o[a++],Vt.clock=o[a++],Vt.cone=o[a++],t.fromSpherical(Vt,Ft),n[r+1]=Ft.x,n[r+2]=Ft.y,n[r+3]=Ft.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)kt.longitude=s[0],kt.latitude=s[1],kt.height=s[2],c.WGS84.cartographicToCartesian(kt,Ft),n=[Ft.x,Ft.y,Ft.z];else for(i=s.length,n=new Array(i),r=0;i>r;r+=4)kt.longitude=s[r+1],kt.latitude=s[r+2],kt.height=s[r+3],c.WGS84.cartographicToCartesian(kt,Ft),n[r]=s[r],n[r+1]=Ft.x,n[r+2]=Ft.y,n[r+3]=Ft.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new x(JSON.stringify(e)+" is not a valid CZML interval.");if(3===u.length)kt.longitude=_.toRadians(u[0]),kt.latitude=_.toRadians(u[1]),kt.height=u[2],c.WGS84.cartographicToCartesian(kt,Ft),n=[Ft.x,Ft.y,Ft.z];else for(i=u.length,n=new Array(i),r=0;i>r;r+=4)kt.longitude=_.toRadians(u[r+1]),kt.latitude=_.toRadians(u[r+2]),kt.height=u[r+3],c.WGS84.cartographicToCartesian(kt,Ft),n[r]=u[r],n[r+1]=Ft.x,n[r+2]=Ft.y,n[r+3]=Ft.z;return n}function ut(r,n,o){switch(r){case Boolean:return s(n["boolean"],n);case e:return n.cartesian2;case t:return lt(n);case i:return at(n);case T:return T[s(n.horizontalOrigin,n)];case Image:return st(n,o);case f:return f.fromIso8601(s(n.date,n));case A:return A[s(n.labelStyle,n)];case Number:return s(n.number,n);case String:return s(n.string,n);case Array:return n.array;case w:var a=n.unitQuaternion;if(l(a)){if(4===a.length)return[-a[0],-a[1],-a[2],a[3]];a=a.slice(0);for(var c=0;cd;if(!v&&!h)return t[r]=l(e.unpack)?new R(e.unpack(c,0)):new R(c),!0;var y=!1,g=t[r];if(v&&!h){g instanceof tt||(g=new tt(e),t[r]=g,y=!0);var _,w=i.epoch;return l(w)&&(_=f.fromIso8601(w)),g.addSamplesPackedArray(c,_),ct(i,g),y}var C;if(!v&&h)return a=a.clone(),a.data=l(e.unpack)?e.unpack(c,0):c,l(g)||(g=new it,t[r]=g,y=!0),g instanceof it?g.intervals.addInterval(a):g instanceof I?(a.data=new R(a.data),g.intervals.addInterval(a)):(C=p.MAXIMUM_INTERVAL.clone(),C.data=g,y=!0,g=new I,t[r]=g,g.intervals.addInterval(C),a.data=new R(a.data),g.intervals.addInterval(a)),y;l(g)||(y=!0,g=new I,t[r]=g),g instanceof I||(C=p.MAXIMUM_INTERVAL.clone(),C.data=g,y=!0,g=new I,t[r]=g,g.intervals.addInterval(C));var x=g.intervals;return C=x.findInterval(a.start,a.stop,a.isStartIncluded,a.isStopIncluded),l(C)&&C.data instanceof tt||(C=a.clone(),C.data=new tt(e),x.addInterval(C)),C.data.addSamplesPackedArray(c,f.fromIso8601(i.epoch)),ct(i,C.data),y}function dt(e,t,r,i,n,o){if(l(i))if(Array.isArray(i))for(var a=0,s=i.length;s>a;a++)ht(e,t,r,i[a],n,o);else ht(e,t,r,i,n,o)}function mt(e,r,i,n){var o,a=i.interval;l(a)?(o=E.fromIso8601(a),l(n)&&(o=o.intersect(n))):l(n)&&(o=n);var u=C[s(i.referenceFrame,"FIXED")],c=lt(i),h=l(o)&&!o.equals(p.MAXIMUM_INTERVAL),d=t.packedLength,m=s(c.length,1),v="string"!=typeof c&&m>d;if(!v&&!h)return e[r]=new O(t.unpack(c),u),!0;var y=!1,g=e[r];if(v&&!h){g instanceof et&&g.referenceFrame===u||(g=new et(u),e[r]=g,y=!0);var _,w=i.epoch;return l(w)&&(_=f.fromIso8601(w)),g.addSamplesPackedArray(c,_),ct(i,g),y}var x;if(!v&&h)return o=o.clone(),o.data=t.unpack(c),l(g)||(g=new rt(u),e[r]=g,y=!0),g instanceof rt&&g.referenceFrame===u?g.intervals.addInterval(o):g instanceof M?(o.data=new O(o.data,u),g.intervals.addInterval(o)):(x=p.MAXIMUM_INTERVAL.clone(),x.data=g,y=!0,g=new M(g.referenceFrame),e[r]=g,g.intervals.addInterval(x),o.data=new O(o.data,u),g.intervals.addInterval(o)),y;l(g)?g instanceof M||(x=p.MAXIMUM_INTERVAL.clone(),x.data=g,y=!0,g=new M(g.referenceFrame),e[r]=g,g.intervals.addInterval(x)):(y=!0,g=new M(u),e[r]=g);var S=g.intervals;return x=S.findInterval(o.start,o.stop,o.isStartIncluded,o.isStopIncluded),l(x)&&x.data instanceof et&&x.data.referenceFrame===u||(x=o.clone(),x.data=new et(u),S.addInterval(x)),x.data.addSamplesPackedArray(c,f.fromIso8601(i.epoch)),ct(i,x.data),y}function pt(e,t,r,i,n){if(l(r))if(Array.isArray(r))for(var o=0,a=r.length;a>o;o++)mt(e,t,r[o],i,n);else mt(e,t,r,i,n)}function ft(e,t,r){return l(t)||l(r)?(e instanceof Wt||(e=new Wt),dt(Number,e,"_x",t),dt(Number,e,"_y",r),e):e}function vt(e,t,r,n,o){var a,u=r.interval;l(u)?(a=E.fromIso8601(u),l(n)&&(a=a.intersect(n))):l(n)&&(a=n),a=s(a,p.MAXIMUM_INTERVAL);var c=!1,h=e[t];l(h)||(h=new P,e[t]=h,c=!0);var d,m=h.intervals,f=m.findInterval(a.start,a.stop);l(f)?d=f.data:(f=a.clone(),m.addInterval(f));var v;return l(r.solidColor)?(d instanceof N||(d=new N),v=r.solidColor,dt(i,d,"color",v.color)):l(r.grid)?(d instanceof q||(d=new q),v=r.grid,dt(i,d,"color",v.color,void 0,o),dt(Number,d,"cellAlpha",v.cellAlpha,void 0,o),d.lineThickness=ft(d.lineThickness,v.rowThickness,v.columnThickness),d.lineCount=ft(d.lineCount,v.rowCount,v.columnCount)):l(r.image)&&(d instanceof G||(d=new G),v=r.image,dt(Image,d,"image",v.image,void 0,o),d.repeat=ft(d.repeat,v.horizontalRepeat,v.verticalRepeat)),f.data=d,c}function yt(e,t,r,i,n){if(l(r))if(Array.isArray(r))for(var o=0,a=r.length;a>o;o++)vt(e,t,r[o],i,n);else vt(e,t,r,i,n)}function gt(e,t){e.name=s(t.name,e.name)}function _t(e,t,r,i){var n=t.position;l(n)&&pt(e,"position",n,void 0,i)}function wt(e,r,i,n){var o=r.viewFrom;l(o)&&dt(t,e,"viewFrom",o,void 0,n)}function Ct(e,t,r,i){var n=t.orientation;l(n)&&dt(w,e,"orientation",n,void 0,i)}function xt(e,t,r){var i=t.vertexPositions;if(l(i)){var n=e.vertexPositions;l(n)||(e.vertexPositions=n=new $),n.processCzmlIntervals(i,void 0,r)}}function St(e,t){var r,i=t.availability;if(l(i)){var n;if(Array.isArray(i))for(var o=i.length,a=0;o>a;a++)l(n)||(n=new b),r=E.fromIso8601(i[a]),n.addInterval(r);else r=E.fromIso8601(i),n=new b,n.addInterval(r);e.availability=n}}function Et(r,n,o,a){var s=n.billboard;if(l(s)){var u=s.interval;l(u)&&(u=E.fromIso8601(u));var c=r.billboard;l(c)||(r.billboard=c=new L),dt(i,c,"color",s.color,u,a),dt(t,c,"eyeOffset",s.eyeOffset,u,a),dt(T,c,"horizontalOrigin",s.horizontalOrigin,u,a),dt(Image,c,"image",s.image,u,a),dt(e,c,"pixelOffset",s.pixelOffset,u,a),dt(Number,c,"scale",s.scale,u,a),dt(Number,c,"rotation",s.rotation,u,a),dt(t,c,"alignedAxis",s.alignedAxis,u,a),dt(Boolean,c,"show",s.show,u,a),dt(D,c,"verticalOrigin",s.verticalOrigin,u,a)}}function bt(e,t){var r=t.clock;if(l(r)&&"document"===e.id){var i=e.clock;if(l(i)||(i=new z,i.startTime=p.MAXIMUM_INTERVAL.start,i.stopTime=p.MAXIMUM_INTERVAL.stop,i.clockRange=n.LOOP_STOP,i.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,i.multiplier=1,e.clock=i),l(r.interval)){var a=E.fromIso8601(r.interval);i.startTime=a.start,i.stopTime=a.stop}l(r.currentTime)&&(i.currentTime=f.fromIso8601(r.currentTime)),l(r.range)&&(i.clockRange=n[r.range]),l(r.step)&&(i.clockStep=o[r.step]),l(r.multiplier)&&(i.multiplier=r.multiplier)}}function Tt(e,t,r,n){var o=t.cone;if(l(o)){var a=o.interval;l(a)&&(a=E.fromIso8601(a));var s=e.cone;l(s)||(e.cone=s=new F),dt(Boolean,s,"show",o.show,a,n),dt(Number,s,"radius",o.radius,a,n),dt(Boolean,s,"showIntersection",o.showIntersection,a,n),dt(i,s,"intersectionColor",o.intersectionColor,a,n),dt(Number,s,"intersectionWidth",o.intersectionWidth,a,n),dt(Number,s,"innerHalfAngle",o.innerHalfAngle,a,n),dt(Number,s,"outerHalfAngle",o.outerHalfAngle,a,n),dt(Number,s,"minimumClockAngle",o.minimumClockAngle,a,n),dt(Number,s,"maximumClockAngle",o.maximumClockAngle,a,n),yt(s,"capMaterial",o.capMaterial,a,n),yt(s,"innerMaterial",o.innerMaterial,a,n),yt(s,"outerMaterial",o.outerMaterial,a,n),yt(s,"silhouetteMaterial",o.silhouetteMaterial,a,n)}}function At(e,t,r,i){var n=t.ellipse;if(l(n)){var o=n.interval;l(o)&&(o=E.fromIso8601(o));var a=e.ellipse;l(a)||(e.ellipse=a=new U),dt(Number,a,"rotation",n.rotation,o,i),dt(Number,a,"semiMajorAxis",n.semiMajorAxis,o,i),dt(Number,a,"semiMinorAxis",n.semiMinorAxis,o,i)}}function Dt(e,r,i,n){var o=r.ellipsoid;if(l(o)){var a=o.interval;l(a)&&(a=E.fromIso8601(a));var s=e.ellipsoid;l(s)||(e.ellipsoid=s=new W),dt(Boolean,s,"show",o.show,a,n),dt(t,s,"radii",o.radii,a,n),yt(s,"material",o.material,a,n)}}function Pt(r,n,o,a){var s=n.label;if(l(s)){var u=s.interval;l(u)&&(u=E.fromIso8601(u));var c=r.label;l(c)||(r.label=c=new V),dt(i,c,"fillColor",s.fillColor,u,a),dt(i,c,"outlineColor",s.outlineColor,u,a),dt(Number,c,"outlineWidth",s.outlineWidth,u,a),dt(t,c,"eyeOffset",s.eyeOffset,u,a),dt(T,c,"horizontalOrigin",s.horizontalOrigin,u,a),dt(String,c,"text",s.text,u,a),dt(e,c,"pixelOffset",s.pixelOffset,u,a),dt(Number,c,"scale",s.scale,u,a),dt(Boolean,c,"show",s.show,u,a),dt(D,c,"verticalOrigin",s.verticalOrigin,u,a),dt(String,c,"font",s.font,u,a),dt(A,c,"style",s.style,u,a)}}function Mt(e,t,r,n){var o=t.path;if(l(o)){var a=o.interval;l(a)&&(a=E.fromIso8601(a));var s=e.path;l(s)||(e.path=s=new Y),dt(i,s,"color",o.color,a,n),dt(Number,s,"width",o.width,a,n),dt(i,s,"outlineColor",o.outlineColor,a,n),dt(Number,s,"outlineWidth",o.outlineWidth,a,n),dt(Boolean,s,"show",o.show,a,n),dt(Number,s,"resolution",o.resolution,a,n),dt(Number,s,"leadTime",o.leadTime,a,n),dt(Number,s,"trailTime",o.trailTime,a,n)}}function It(e,t,r,n){var o=t.point;if(l(o)){var a=o.interval;l(a)&&(a=E.fromIso8601(a));var s=e.point;l(s)||(e.point=s=new X),dt(i,s,"color",o.color,a,n),dt(Number,s,"pixelSize",o.pixelSize,a,n),dt(i,s,"outlineColor",o.outlineColor,a,n),dt(Number,s,"outlineWidth",o.outlineWidth,a,n),dt(Boolean,s,"show",o.show,a,n)}}function Ot(e,t,r,i){var n=t.polygon;if(l(n)){var o=n.interval;l(o)&&(o=E.fromIso8601(o));var a=e.polygon;l(a)||(e.polygon=a=new J),dt(Boolean,a,"show",n.show,o,i),yt(a,"material",n.material,o,i)}}function Rt(e,t,r,n){var o=t.polyline;if(l(o)){var a=o.interval;l(a)&&(a=E.fromIso8601(a));var s=e.polyline;l(s)||(e.polyline=s=new Z);var u=s.material;if(l(a)){var c,h=u;h instanceof P||(h=new P,s.material=h,l(u)&&(c=p.MAXIMUM_INTERVAL.clone(),c.data=u,h.intervals.addInterval(c))),c=h.intervals.findInterval(a.start,a.stop,a.isStartIncluded,a.isStopIncluded),l(c)?u=c.data:(u=new B,c=a.clone(),c.data=u,h.intervals.addInterval(c))}else u instanceof B||(u=new B,s.material=u);dt(Boolean,s,"show",o.show,a,n),dt(Number,s,"width",o.width,a,n),dt(i,u,"color",o.color,a,n),dt(i,u,"outlineColor",o.outlineColor,a,n),dt(Number,u,"outlineWidth",o.outlineWidth,a,n)}}function Lt(e,t,r,n){var o=t.pyramid;if(l(o)){var a=o.interval;l(a)&&(a=E.fromIso8601(a));var s=e.pyramid;if(l(s)||(e.pyramid=s=new K),dt(Boolean,s,"show",o.show,a,n),dt(Number,s,"radius",o.radius,a,n),dt(Boolean,s,"showIntersection",o.showIntersection,a,n),dt(i,s,"intersectionColor",o.intersectionColor,a,n),dt(Number,s,"intersectionWidth",o.intersectionWidth,a,n),yt(s,"material",o.material,a,n),l(o.directions)){var u=s.directions;l(u)||(s.directions=u=new k),u.processCzmlIntervals(o.directions,a)}}}function zt(e,r,n,o){var a=r.vector;if(l(a)){var s=a.interval;l(s)&&(s=E.fromIso8601(s));var u=e.vector;l(u)||(e.vector=u=new Q),dt(i,u,"color",a.color,s,o),dt(Boolean,u,"show",a.show,s,o),dt(Number,u,"width",a.width,s,o),dt(t,u,"direction",a.direction,s,o),dt(Number,u,"length",a.length,s,o)}}function Nt(e,t,r,i,n){var o=e.id;if(l(o)||(o=a()),e["delete"]===!0)t.removeById(o);else{var s;s="document"===o?n._document:t.getOrCreateObject(o);var u=e.parent;l(u)&&(s.parent=t.getOrCreateObject(u));for(var c=r.length-1;c>-1;c--)r[c](s,e,t,i)}}function Bt(e,t,r){var i=e._dynamicObjectCollection;qt._processCzml(t,i,r,void 0,e);var a,s=i.computeAvailability(),u=e._document;if(l(u)&&l(u.clock))a=new z,a.startTime=u.clock.startTime,a.stopTime=u.clock.stopTime,a.clockRange=u.clock.clockRange,a.clockStep=u.clock.clockStep,a.multiplier=u.clock.multiplier,a.currentTime=u.clock.currentTime;else if(!s.start.equals(p.MINIMUM_VALUE)){a=new z,a.startTime=s.start,a.stopTime=s.stop,a.clockRange=n.LOOP_STOP;var c=a.startTime.getSecondsDifference(a.stopTime),h=Math.round(c/120);a.multiplier=h,a.currentTime=a.startTime,a.clockStep=o.SYSTEM_CLOCK_MULTIPLIER}var m;return l(u)&&l(u.name)&&(m=u.name),!l(m)&&l(r)&&(m=d(r)),e._name=m,a}var Ft=new t,Vt=new S,kt=new r,Ut={HERMITE:m,LAGRANGE:v,LINEAR:y},Wt=function(){this._x=new R(0),this._y=new R(0)};Wt.prototype.getValue=function(t,r){return l(r)||(r=new e),r.x=this._x.getValue(t),r.y=this._y.getValue(t),r};var qt=function(e){this._name=e,this._changed=new h,this._error=new h,this._clock=void 0,this._dynamicObjectCollection=new j,this._timeVarying=!0,this._document=new H};return qt.updaters=[bt,Et,At,Dt,Tt,Pt,gt,Mt,It,Ot,Rt,Lt,zt,_t,wt,Ct,xt,St],qt.prototype.getName=function(){return this._name},qt.prototype.getChangedEvent=function(){return this._changed},qt.prototype.getErrorEvent=function(){return this._error},qt.prototype.getClock=function(){return this._clock},qt.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},qt.prototype.getIsTimeVarying=function(){return this._timeVarying},qt.prototype.process=function(e,t){if(!l(e))throw new u("czml is required.");this._clock=Bt(this,e,t)},qt.prototype.load=function(e,t){if(!l(e))throw new u("czml is required.");this._document=new H("document"),this._dynamicObjectCollection.removeAll(),this._clock=Bt(this,e,t)},qt.prototype.processUrl=function(e){if(!l(e))throw new u("url is required.");var t=this;return ot(g(e),function(r){t.process(r,e)},function(e){return t._error.raiseEvent(t,e),ot.reject(e)})},qt.prototype.loadUrl=function(e){if(!l(e))throw new u("url is required.");var t=this;return ot(g(e),function(r){t.load(r,e)},function(e){return t._error.raiseEvent(t,e),ot.reject(e)})},qt.processPacketData=dt,qt.processPositionPacketData=pt,qt.processMaterialPacketData=yt,qt._processCzml=function(e,t,r,i,n){if(i=l(i)?i:qt.updaters,Array.isArray(e))for(var o=0,a=e.length;a>o;o++)Nt(e[o],t,i,r,n);else Nt(e,t,i,r,n)},qt}),r("DynamicScene/DataSource",["../Core/DeveloperError"],function(e){"use strict";function t(){throw new e("This type should not be instantiated directly.")}var r=t;return r.prototype.getName=t,r.prototype.getChangedEvent=t,r.prototype.getErrorEvent=t,r.prototype.getClock=t,r.prototype.getDynamicObjectCollection=t,r.prototype.getIsTimeVarying=t,r}),r("DynamicScene/DataSourceCollection",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Event"],function(e,t,r,i){"use strict";var n=function(){this._dataSources=[],this.dataSourceAdded=new i,this.dataSourceRemoved=new i};return n.prototype.add=function(r){if(!t(r))throw new e("dataSource is required.");this._dataSources.push(r),this.dataSourceAdded.raiseEvent(this,r)},n.prototype.remove=function(e,t){var r=this._dataSources.indexOf(e);return-1!==r?(this._dataSources.splice(r,1),this.dataSourceRemoved.raiseEvent(this,e),"function"==typeof e.destroy&&t&&e.destroy(),!0):!1},n.prototype.removeAll=function(e){for(var t=this._dataSources,r=t.length-1;r>=0;r--)this.remove(t[r],e)},n.prototype.contains=function(e){return-1!==this.indexOf(e)},n.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},n.prototype.get=function(r){if(!t(r))throw new e("index is required.");return this._dataSources[r]},n.prototype.getLength=function(){return this._dataSources.length},n.prototype.isDestroyed=function(){return!1},n.prototype.destroy=function(){return this.removeAll(!0),r(this)},n}),r("Renderer/BlendEquation",["../Core/Enumeration"],function(e){"use strict";var t={ADD:new e(32774,"ADD"),SUBTRACT:new e(32778,"SUBTRACT"),REVERSE_SUBTRACT:new e(32779,"REVERSE_SUBTRACT"),validate:function(e){return e===t.ADD||e===t.SUBTRACT||e===t.REVERSE_SUBTRACT}};return t}),r("Renderer/BlendFunction",["../Core/Enumeration"],function(e){"use strict";var t={ZERO:new e(0,"ZERO"),ONE:new e(1,"ONE"),SOURCE_COLOR:new e(768,"SOURCE_COLOR"),ONE_MINUS_SOURCE_COLOR:new e(769,"ONE_MINUS_SOURCE_COLOR"),DESTINATION_COLOR:new e(774,"DESTINATION_COLOR"),ONE_MINUS_DESTINATION_COLOR:new e(775,"ONE_MINUS_DESTINATION_COLOR"),SOURCE_ALPHA:new e(770,"SOURCE_ALPHA"),ONE_MINUS_SOURCE_ALPHA:new e(771,"ONE_MINUS_SOURCE_ALPHA"),DESTINATION_ALPHA:new e(772,"DESTINATION_ALPHA"),ONE_MINUS_DESTINATION_ALPHA:new e(773,"ONE_MINUS_DESTINATION_ALPHA"),CONSTANT_COLOR:new e(32769,"CONSTANT_COLOR"),ONE_MINUS_CONSTANT_COLOR:new e(32770,"ONE_MINUS_CONSTANT_COLOR"),CONSTANT_ALPHA:new e(32771,"CONSTANT_ALPHA"),ONE_MINUS_CONSTANT_ALPHA:new e(32772,"ONE_MINUS_CONSTANT_ALPHA"),SOURCE_ALPHA_SATURATE:new e(776,"SOURCE_ALPHA_SATURATE"),validate:function(e){return e===t.ZERO||e===t.ONE||e===t.SOURCE_COLOR||e===t.ONE_MINUS_SOURCE_COLOR||e===t.DESTINATION_COLOR||e===t.ONE_MINUS_DESTINATION_COLOR||e===t.SOURCE_ALPHA||e===t.ONE_MINUS_SOURCE_ALPHA||e===t.DESTINATION_ALPHA||e===t.ONE_MINUS_DESTINATION_ALPHA||e===t.CONSTANT_COLOR||e===t.ONE_MINUS_CONSTANT_COLOR||e===t.CONSTANT_ALPHA||e===t.ONE_MINUS_CONSTANT_ALPHA||e===t.SOURCE_ALPHA_SATURATE}};return t}),r("Renderer/BlendingState",["./BlendEquation","./BlendFunction"],function(e,t){"use strict";var r={DISABLED:{enabled:!1},ALPHA_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.SOURCE_ALPHA,functionSourceAlpha:t.SOURCE_ALPHA,functionDestinationRgb:t.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:t.ONE_MINUS_SOURCE_ALPHA},PRE_MULTIPLIED_ALPHA_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.ONE,functionSourceAlpha:t.ONE,functionDestinationRgb:t.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:t.ONE_MINUS_SOURCE_ALPHA},ADDITIVE_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.SOURCE_ALPHA,functionSourceAlpha:t.SOURCE_ALPHA,functionDestinationRgb:t.ONE,functionDestinationAlpha:t.ONE}};return r}),r("Renderer/BufferUsage",["../Core/Enumeration"],function(e){"use strict";var t={STREAM_DRAW:new e(35040,"STREAM_DRAW"),STATIC_DRAW:new e(35044,"STATIC_DRAW"),DYNAMIC_DRAW:new e(35048,"DYNAMIC_DRAW"),validate:function(e){return e===t.STREAM_DRAW||e===t.STATIC_DRAW||e===t.DYNAMIC_DRAW}};return t}),r("Renderer/DrawCommand",[],function(){"use strict";var e=function(){this.boundingVolume=void 0,this.cull=!0,this.modelMatrix=void 0,this.primitiveType=void 0,this.vertexArray=void 0,this.count=void 0,this.offset=0,this.shaderProgram=void 0,this.uniformMap=void 0,this.renderState=void 0,this.framebuffer=void 0,this.pass=void 0,this.executeInClosestFrustum=!1,this.owner=void 0,this.debugShowBoundingVolume=!1,this.debugOverlappingFrustums=0};return e.prototype.execute=function(e,t){e.draw(this,t)},e}),r("Renderer/Pass",[],function(){"use strict";var e={OPAQUE:0,TRANSLUCENT:1,OVERLAY:2};return e}),r("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./BufferUsage"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var i=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=r(i);if(!o||i.getSizeInBytes()0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function u(e){var t=e.vaByPurpose;if(r(t)){for(var i in t)if(t.hasOwnProperty(i))for(var n=t[i],o=n.length,a=0;o>a;++a)n[a].va.destroy();e.vaByPurpose=void 0}}var c=function(e,t,i){function o(e,t){return t.componentDatatype.sizeInBytes-e.componentDatatype.sizeInBytes}if(!e)throw new n("context is required.");if(!t||0===t.length)throw new n("At least one attribute is required.");var s=c._verifyAttributes(t);i=i||0;for(var l,u,h,d,m={},p=[],f=s.length,v=0;f>v;++v){var y=s[v];y.vertexBuffer?p.push(y):(h=y.purpose,l=m[h],r(l)||(l=m[h]={}),d=y.usage.toString(),u=l[d],r(u)||(u=l[d]=[]),u.push(y))}this._buffersByPurposeAndUsage={},this._allBuffers=[];for(h in m)if(m.hasOwnProperty(h)){l=m[h];var g=this._buffersByPurposeAndUsage[h];r(g)||(g=this._buffersByPurposeAndUsage[h]={});for(d in l)if(l.hasOwnProperty(d)){u=l[d],u.sort(o);var _,w=c._vertexSizeInBytes(u);switch(d){case a.STATIC_DRAW.toString():_=a.STATIC_DRAW;break;case a.STREAM_DRAW.toString():_=a.STREAM_DRAW;break;case a.DYNAMIC_DRAW.toString():_=a.DYNAMIC_DRAW}var C={purpose:h,vertexSizeInBytes:w,vertexBuffer:void 0,usage:_,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(u,w)};g[d]=C,this._allBuffers.push(C)}}this._size=0,this._precreated=p,this._context=e,this.writers=void 0,this.vaByPurpose=void 0,this.resize(i)};c._verifyAttributes=function(i){for(var o=[],s=0;si;++i){var n=e[i];t+=n.componentsPerAttribute*n.componentDatatype.sizeInBytes}var o=r>0?e[0].componentDatatype.sizeInBytes:0,a=o>0?t%o:0,s=0===a?0:o-a;return t+=s},c._createArrayViews=function(e,t){for(var r=[],i=0,n=e.length,o=0;n>o;++o){var a=e[o],s=a.componentDatatype;r.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/s.sizeInBytes,view:void 0}),i+=a.componentsPerAttribute*s.sizeInBytes}return r},c.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers={};for(var i=0,n=t.length;n>i;++i){var o=t[i];c._resize(o,this._size);var a=this.writers[o.purpose];r(a)||(a=this.writers[o.purpose]=[]),c._appendWriters(a,o)}u(this)},c._resize=function(t,r){if(t.vertexSizeInBytes>0){var i=new ArrayBuffer(r*t.vertexSizeInBytes);if(t.arrayBuffer)for(var n=new Uint8Array(i),o=new Uint8Array(t.arrayBuffer),a=o.length,s=0;a>s;++s)n[s]=o[s];for(var l=t.arrayViews,u=l.length,c=0;u>c;++c){var h=l[c];h.view=e.createArrayBufferView(h.componentDatatype,i,h.offsetInBytes)}t.arrayBuffer=i}};var h=[function(e,t,r){return function(i,n){t[i*r]=n,e.needsCommit=!0}},function(e,t,r){return function(i,n,o){var a=i*r;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a){var s=i*r;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a,s){var l=i*r;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return c._appendWriters=function(e,t){for(var r=t.arrayViews,i=r.length,n=0;i>n;++n){var o=r[n];e[o.index]=h[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},c.prototype.commit=function(e){for(var t,i=!1,n=this._allBuffers,a=0,l=n.length;l>a;++a)t=n[a],i=s(this,t)||i;if(i||!r(this.vaByPurpose)){var h=this._buffersByPurposeAndUsage;u(this),this.vaByPurpose={};for(var d in h)if(h.hasOwnProperty(d)){for(var m=h[d],p=[],f=Math.ceil(this._size/o.SIXTY_FOUR_KILOBYTES),v=0;f>v;++v){var y=[],g=h.all;if(g!==m)for(var _ in g)if(g.hasOwnProperty(_)){var w=g[_];c._appendAttributes(y,w,v*w.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES)}for(var C in m)m.hasOwnProperty(C)&&(t=m[C],c._appendAttributes(y,t,v*t.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES));y=y.concat(this._precreated),p.push({va:this._context.createVertexArray(y,e),indicesCount:1.5*(v!==f-1?o.SIXTY_FOUR_KILOBYTES:this._size%o.SIXTY_FOUR_KILOBYTES)})}this.vaByPurpose[d]=p}}},c._appendAttributes=function(e,t,r){for(var i=t.arrayViews,n=i.length,o=0;n>o;++o){var a=i[o];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:r+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes})}},c.prototype.subCommit=function(e,t){if(0>e||e>=this._size)throw new n("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new n("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");for(var r=this._allBuffers,i=0,o=r.length;o>i;++i)l(r[i],e,t)},c.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t)e[t].needsCommit=!1},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return u(this),i(this)},c}),r("Renderer/createShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError"],function(e,t,r){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT);var n=i.defines,o=i.sources,a=i.pickColorQualifier;if(t(a)&&"uniform"!==a&&"varying"!==a)throw new r("options.pickColorQualifier must be 'uniform' or 'varying'.");var s,l,u="";if(t(n)&&n.length>0)for(l=n.length,s=0;l>s;++s)0!==n[s].length&&(u+="#define "+n[s]+"\n");if(t(o)&&o.length>0)for(l=o.length,s=0;l>s;++s)u+="\n#line 0\n"+o[s];if(t(a)){var c=u.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),h=a+" vec4 czm_pickColor; \n"+"void main() \n"+"{ \n"+" czm_old_main(); \n"+" if (gl_FragColor.a == 0.0) { \n"+" discard; \n"+" } \n"+" gl_FragColor = czm_pickColor; \n"+"}";u=c+"\n"+h}return u}return i}),r("Scene/SceneMode",["../Core/Enumeration"],function(e){"use strict";var t={SCENE2D:new e(0,"SCENE2D",{morphTime:0}),COLUMBUS_VIEW:new e(1,"COLUMBUS_VIEW",{morphTime:0}),SCENE3D:new e(2,"SCENE3D",{morphTime:1}),MORPHING:new e(3,"MORPHING")};return t}),r("Scene/SceneTransforms",["../Core/defined","../Core/DeveloperError","../Core/Cartographic","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Matrix4","../Core/BoundingRectangle","../Core/Math","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c={},h=new o(0,0,0,1),d=new o;c.wgs84ToWindowCoordinates=function(r,i,n){if(!e(r))throw new t("scene is required.");if(!e(i))throw new t("position is required.");if(c.computeActualWgs84Position(r.getFrameState(),i,h),!e(h))return n=void 0,void 0;var o=r.getUniformState().getViewProjection();return a.multiplyByVector(o,h,d),c.clipToWindowCoordinates(r.getContext(),d,n)},c.wgs84ToDrawingBufferCoordinates=function(r,i,n){if(!e(r))throw new t("scene is required.");if(!e(i))throw new t("position is required.");if(c.computeActualWgs84Position(r.getFrameState(),i,h),!e(h))return void 0;var s=r.getUniformState().getViewProjection();return a.multiplyByVector(s,o.fromElements(h.x,h.y,h.z,1,d),d),c.clipToDrawingBufferCoordinates(r.getContext(),d,n)};var m=new n,p=new r;c.computeActualWgs84Position=function(t,r,i){var o=t.mode;if(o===u.SCENE3D)return n.clone(r,i);var a=t.scene2D.projection;if(a.getEllipsoid().cartesianToCartographic(r,p),!e(p))return i=void 0;if(a.project(p,m),o===u.COLUMBUS_VIEW)return n.fromElements(m.z,m.x,m.y,i);if(o===u.SCENE2D)return n.fromElements(0,m.x,m.y,i);var s=t.morphTime;return n.fromElements(l.lerp(m.z,r.x,s),l.lerp(m.x,r.y,s),l.lerp(m.y,r.z,s),i)};var f=new n,v=new n,y=new s,g=new a;return c.clipToWindowCoordinates=function(e,t,r){var o=e.getCanvas();return n.divideByScalar(t,t.w,f),y.width=o.clientWidth,y.height=o.clientHeight,a.computeViewportTransformation(y,0,1,g),a.multiplyByPoint(g,f,v),i.fromCartesian3(v,r)},c.clipToDrawingBufferCoordinates=function(e,t,r){return n.divideByScalar(t,t.w,f),y.width=e.getDrawingBufferWidth(),y.height=e.getDrawingBufferHeight(),a.computeViewportTransformation(y,0,1,g),a.multiplyByPoint(g,f,v),i.fromCartesian3(v,r)},c.transformWindowToDrawingBuffer=function(e,t,r){var n=e.getCanvas(),o=e.getDrawingBufferWidth()/n.clientWidth,a=e.getDrawingBufferHeight()/n.clientHeight;return i.fromElements(t.x*o,t.y*a,r)},c}),r("Scene/Billboard",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/NearFarScalar","../Core/Matrix4","./HorizontalOrigin","./VerticalOrigin","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,r){var i=e._billboardCollection;t(i)&&(i._updateBillboard(e,r),e._dirty=!0)}var p={},f=function(a,s){if(a=e(a,p),t(a.scaleByDistance)&&a.scaleByDistance.far<=a.scaleByDistance.near)throw new r("scaleByDistance.far must be greater than scaleByDistance.near.");if(t(a.translucencyByDistance)&&a.translucencyByDistance.far<=a.translucencyByDistance.near)throw new r("translucencyByDistance.far must be greater than translucencyByDistance.near.");if(t(a.pixelOffsetScaleByDistance)&&a.pixelOffsetScaleByDistance.far<=a.pixelOffsetScaleByDistance.near)throw new r("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");this._show=e(a.show,!0),this._position=o.clone(e(a.position,o.ZERO)),this._actualPosition=o.clone(this._position),this._pixelOffset=n.clone(e(a.pixelOffset,n.ZERO)),this._translate=new n(0,0),this._eyeOffset=o.clone(e(a.eyeOffset,o.ZERO)),this._verticalOrigin=e(a.verticalOrigin,c.CENTER),this._horizontalOrigin=e(a.horizontalOrigin,u.CENTER),this._scale=e(a.scale,1),this._imageIndex=e(a.imageIndex,-1),this._color=i.clone(e(a.color,i.WHITE)),this._rotation=e(a.rotation,0),this._alignedAxis=o.clone(e(a.alignedAxis,o.ZERO)),this._width=a.width,this._height=a.height,this._scaleByDistance=a.scaleByDistance,this._translucencyByDistance=a.translucencyByDistance,this._pixelOffsetScaleByDistance=a.pixelOffsetScaleByDistance,this._id=a.id,this._pickId=void 0,this._pickIdThis=a._pickIdThis,this._billboardCollection=s,this._dirty=!1,this._index=-1},v=f.SHOW_INDEX=0,y=f.POSITION_INDEX=1,g=f.PIXEL_OFFSET_INDEX=2,_=f.EYE_OFFSET_INDEX=3,w=f.HORIZONTAL_ORIGIN_INDEX=4,C=f.VERTICAL_ORIGIN_INDEX=5,x=f.SCALE_INDEX=6,S=f.IMAGE_INDEX_INDEX=7,E=f.COLOR_INDEX=8,b=f.ROTATION_INDEX=9,T=f.ALIGNED_AXIS_INDEX=10,A=f.SCALE_BY_DISTANCE_INDEX=11,D=f.TRANSLUCENCY_BY_DISTANCE_INDEX=12,P=f.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;f.NUMBER_OF_PROPERTIES=14,f.prototype.getPickId=function(r){return t(this._pickId)||(this._pickId=r.createPickId({primitive:e(this._pickIdThis,this),id:this._id})),this._pickId},f.prototype.getShow=function(){return this._show},f.prototype.setShow=function(e){if(!t(e))throw new r("value is required.");e!==this._show&&(this._show=e,m(this,v))},f.prototype.getPosition=function(){return this._position},f.prototype.setPosition=function(e){if(!t(e))throw new r("value is required.");var i=this._position;o.equals(i,e)||(o.clone(e,i),o.clone(e,this._actualPosition),m(this,y))},f.prototype._getActualPosition=function(){return this._actualPosition},f.prototype._setActualPosition=function(e){o.clone(e,this._actualPosition),m(this,y)},f.prototype.getPixelOffset=function(){return this._pixelOffset},f.prototype.setPixelOffset=function(e){if(!t(e))throw new r("value is required.");var i=this._pixelOffset;n.equals(i,e)||(n.clone(e,i),m(this,g))},f.prototype._setTranslate=function(e){if(!t(e))throw new r("value is required.");var i=this._translate;n.equals(i,e)||(n.clone(e,i),m(this,g))},f.prototype.getScaleByDistance=function(){return this._scaleByDistance},f.prototype.setScaleByDistance=function(e){if(!s.equals(this._scaleByDistance,e)){if(e.far<=e.near)throw new r("far distance must be greater than near distance.");m(this,A),this._scaleByDistance=s.clone(e,this._scaleByDistance)}},f.prototype.getTranslucencyByDistance=function(){return this._translucencyByDistance},f.prototype.setTranslucencyByDistance=function(e){if(!s.equals(this._translucencyByDistance,e)){if(e.far<=e.near)throw new r("far distance must be greater than near distance.");m(this,D),this._translucencyByDistance=s.clone(e,this._translucencyByDistance)}},f.prototype.getPixelOffsetScaleByDistance=function(){return this._pixelOffsetScaleByDistance},f.prototype.setPixelOffsetScaleByDistance=function(e){if(!s.equals(this._pixelOffsetScaleByDistance,e)){if(e.far<=e.near)throw new r("far distance must be greater than near distance.");m(this,P),this._pixelOffsetScaleByDistance=s.clone(e,this._pixelOffsetScaleByDistance)}},f.prototype.getEyeOffset=function(){return this._eyeOffset},f.prototype.setEyeOffset=function(e){if(!t(e))throw new r("value is required.");var i=this._eyeOffset;o.equals(i,e)||(o.clone(e,i),m(this,_))},f.prototype.getHorizontalOrigin=function(){return this._horizontalOrigin},f.prototype.setHorizontalOrigin=function(e){if(!t(e))throw new r("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,m(this,w))},f.prototype.getVerticalOrigin=function(){return this._verticalOrigin},f.prototype.setVerticalOrigin=function(e){if(!t(e))throw new r("value is required.");this._verticalOrigin!==e&&(this._verticalOrigin=e,m(this,C))},f.prototype.getScale=function(){return this._scale},f.prototype.setScale=function(e){if(!t(e))throw new r("value is required.");this._scale!==e&&(this._scale=e,m(this,x))},f.prototype.getImageIndex=function(){return this._imageIndex},f.prototype.setImageIndex=function(e){if("number"!=typeof e)throw new r("value is required and must be a number.");this._imageIndex!==e&&(this._imageIndex=e,m(this,S))},f.prototype.getColor=function(){return this._color},f.prototype.setColor=function(e){if(!t(e))throw new r("value is required.");var n=this._color;i.equals(n,e)||(i.clone(e,n),m(this,E))},f.prototype.getRotation=function(){return this._rotation},f.prototype.setRotation=function(e){if(!t(e))throw new r("value is required.");this._rotation!==e&&(this._rotation=e,m(this,b))},f.prototype.getAlignedAxis=function(){return this._alignedAxis},f.prototype.setAlignedAxis=function(e){if(!t(e))throw new r("value is required.");var i=this._alignedAxis;o.equals(i,e)||(o.clone(e,i),m(this,T))},f.prototype.getWidth=function(){return this._width},f.prototype.setWidth=function(e){this._width!==e&&(this._width=e,m(this,S))},f.prototype.getHeight=function(){return this._height},f.prototype.setHeight=function(e){this._height!==e&&(this._height=e,m(this,S))},f.prototype.getId=function(){return this._id};var M=new a;f._computeActualPosition=function(e,t,r){return t.mode===h.SCENE3D?e:(l.multiplyByPoint(r,e,M),d.computeActualWgs84Position(t,M))};var I=new l,O=new a,R=new o,L=new n;f._computeScreenSpacePosition=function(e,t,r,i,s,u){var c=u.camera,h=c.viewMatrix,m=c.frustum.projectionMatrix,p=l.multiplyTransformation(h,e,I),f=l.multiplyByVector(p,a.fromElements(t.x,t.y,t.z,1,O),O),v=o.multiplyComponents(r,o.normalize(f,R),R);f.x+=r.x+v.x,f.y+=r.y+v.y,f.z+=v.z;var y=l.multiplyByVector(m,f,O),g=d.clipToWindowCoordinates(s,y,new n),_=s.getUniformState(),w=n.multiplyByScalar(i,_.getHighResolutionSnapScale(),L);return g.x+=w.x,g.y+=w.y,g};var z=new n(0,0);return f.prototype.computeScreenSpacePosition=function(e,i){var o=this._billboardCollection;if(!t(o))throw new r("Billboard must be in a collection. Was it removed?");if(!t(e))throw new r("context is required.");if(!t(i))throw new r("frameState is required.");n.clone(this._pixelOffset,z),n.add(z,this._translate,z);var a=o.modelMatrix;return f._computeScreenSpacePosition(a,this._actualPosition,this._eyeOffset,z,e,i)},f.prototype.equals=function(e){return this===e||t(e)&&this._show===e._show&&this._imageIndex===e._imageIndex&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&o.equals(this._position,e._position)&&i.equals(this._color,e._color)&&n.equals(this._pixelOffset,e._pixelOffset)&&n.equals(this._translate,e._translate)&&o.equals(this._eyeOffset,e._eyeOffset)&&s.equals(this._scaleByDistance,e._scaleByDistance)&&s.equals(this._translucencyByDistance,e._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&this._id===e._id},f.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},f}),r("Shaders/BillboardCollectionVS",[],function(){"use strict";return"attribute vec3 positionHigh;\nattribute vec3 positionLow;\nattribute vec2 direction;\nattribute vec4 textureCoordinatesAndImageSize;\nattribute vec3 originAndShow;\nattribute vec4 pixelOffsetAndTranslate;\nattribute vec4 eyeOffsetAndScale;\nattribute vec4 rotationAndAlignedAxis;\nattribute vec4 scaleByDistance;\nattribute vec4 translucencyByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\n#ifdef RENDER_FOR_PICK\nattribute vec4 pickColor;\n#else\nattribute vec4 color;\n#endif\nconst vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nfloat getNearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\ncameraDistSq = clamp(cameraDistSq, nearDistanceSq, farDistanceSq);\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(t, 0.15);\nreturn mix(valueAtMin, valueAtMax, t);\n}\nvoid main()\n{\nvec3 eyeOffset = eyeOffsetAndScale.xyz;\nfloat scale = eyeOffsetAndScale.w;\nvec2 textureCoordinates = textureCoordinatesAndImageSize.xy;\nvec2 imageSize = textureCoordinatesAndImageSize.zw;\nvec2 origin = originAndShow.xy;\nfloat show = originAndShow.z;\nvec2 pixelOffset = pixelOffsetAndTranslate.xy;\nvec2 translate = pixelOffsetAndTranslate.zw;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= getNearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = getNearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = getNearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = imageSize * scale * czm_highResolutionSnapScale;\nhalfSize *= ((direction * 2.0) - 1.0);\npositionWC.xy += (origin * abs(halfSize));\n#ifdef ROTATION\nfloat rotation = rotationAndAlignedAxis.x;\nvec3 alignedAxis = rotationAndAlignedAxis.yzw;\nif (!all(equal(rotationAndAlignedAxis, vec4(0.0))))\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\npositionWC.xy += halfSize;\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_highResolutionSnapScale);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),r("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),r("Scene/BillboardCollection",["../Core/defined","../Core/DeveloperError","../Core/Color","../Core/defaultValue","../Core/destroyObject","../Core/Cartesian2","../Core/Cartesian3","../Core/EncodedCartesian3","../Core/Matrix4","../Core/ComponentDatatype","../Core/IndexDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/VertexArrayFacade","../Renderer/createShaderSource","./SceneMode","./Billboard","./HorizontalOrigin","../Shaders/BillboardCollectionVS","../Shaders/BillboardCollectionFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S){"use strict";function E(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],r=e._billboards,i=r.length,n=0,o=0;i>n;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function b(t){var r=16384,i=t.cache.billboardCollection_directionsVertexBuffer;if(e(i))return i;for(var n=new Uint8Array(2*4*r),o=0,a=0;r>o;++o)n[a++]=0,n[a++]=0,n[a++]=255,n[a++]=0,n[a++]=255,n[a++]=255,n[a++]=0,n[a++]=255;return i=t.createVertexBuffer(n,p.STATIC_DRAW),i.setVertexArrayDestroyable(!1),t.cache.billboardCollection_directionsVertexBuffer=i,i}function T(t){var r=16384,i=t.cache.billboardCollection_indexBuffer;if(e(i))return i;for(var n=6*r,o=new Uint16Array(n),a=0,s=0;n>a;a+=6,s+=4)o[a]=s,o[a+1]=s+1,o[a+2]=s+2,o[a+3]=s+0,o[a+4]=s+2,o[a+5]=s+3;return i=t.createIndexBuffer(o,p.STATIC_DRAW,c.UNSIGNED_SHORT),i.setVertexArrayDestroyable(!1),t.cache.billboardCollection_indexBuffer=i,i}function A(e,t,r){var i=b(e);return new y(e,[{index:nt.positionHigh,componentsPerAttribute:3,componentDatatype:u.FLOAT,usage:r[G]},{index:nt.positionLow,componentsPerAttribute:3,componentDatatype:u.FLOAT,usage:r[G]},{index:nt.pixelOffsetAndTranslate,componentsPerAttribute:4,componentDatatype:u.FLOAT,usage:r[H]},{index:nt.eyeOffsetAndScale,componentsPerAttribute:4,componentDatatype:u.FLOAT,usage:r[Z]},{index:nt.textureCoordinatesAndImageSize,componentsPerAttribute:4,componentDatatype:u.FLOAT,usage:r[J]},{index:nt.pickColor,componentsPerAttribute:4,normalize:!0,componentDatatype:u.UNSIGNED_BYTE,usage:p.STATIC_DRAW,purpose:st},{index:nt.color,componentsPerAttribute:4,normalize:!0,componentDatatype:u.UNSIGNED_BYTE,usage:r[K],purpose:at},{index:nt.originAndShow,componentsPerAttribute:3,componentDatatype:u.BYTE,usage:r[q]},{index:nt.direction,vertexBuffer:i,componentsPerAttribute:2,normalize:!0,componentDatatype:u.UNSIGNED_BYTE},{index:nt.rotationAndAlignedAxis,componentsPerAttribute:4,componentDatatype:u.FLOAT,usage:r[Q]},{index:nt.scaleByDistance,componentsPerAttribute:4,componentDatatype:u.FLOAT,usage:r[et]},{index:nt.translucencyByDistance,componentsPerAttribute:4,componentDatatype:u.FLOAT,usage:r[tt]},{index:nt.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:u.FLOAT,usage:r[rt]}],4*t)}function D(e,t,r,i,n){var o=4*n._index,a=n._getActualPosition();e._mode===_.SCENE3D&&(e._baseVolume.expand(a,e._baseVolume),e._boundingVolumeDirty=!0),s.fromCartesian(a,ut);var l=i[ot],u=l[nt.positionHigh],c=ut.high;u(o+0,c.x,c.y,c.z),u(o+1,c.x,c.y,c.z),u(o+2,c.x,c.y,c.z),u(o+3,c.x,c.y,c.z);var h=l[nt.positionLow],d=ut.low;h(o+0,d.x,d.y,d.z),h(o+1,d.x,d.y,d.z),h(o+2,d.x,d.y,d.z),h(o+3,d.x,d.y,d.z)}function P(e,t,r,i,n){var o=4*n._index,a=n.getPixelOffset(),s=n._translate;e._maxPixelOffset=Math.max(e._maxPixelOffset,a.x+s.x,a.y+s.y);var l=i[ot],u=l[nt.pixelOffsetAndTranslate];u(o+0,a.x,a.y,s.x,s.y),u(o+1,a.x,a.y,s.x,s.y),u(o+2,a.x,a.y,s.x,s.y),u(o+3,a.x,a.y,s.x,s.y)}function M(e,t,r,i,n){var o=4*n._index,a=n.getEyeOffset(),s=n.getScale();e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(a.z)),e._maxScale=Math.max(e._maxScale,s);var l=i[ot],u=l[nt.eyeOffsetAndScale];u(o+0,a.x,a.y,a.z,s),u(o+1,a.x,a.y,a.z,s),u(o+2,a.x,a.y,a.z,s),u(o+3,a.x,a.y,a.z,s)}function I(e,t,i,n,o){var a=4*o._index,s=n[st],l=s[nt.pickColor],u=o.getPickId(t).color,c=r.floatToByte(u.red),h=r.floatToByte(u.green),d=r.floatToByte(u.blue),m=r.floatToByte(u.alpha);l(a+0,c,h,d,m),l(a+1,c,h,d,m),l(a+2,c,h,d,m),l(a+3,c,h,d,m)}function O(e,t,i,n,o){var a=4*o._index,s=n[at],l=s[nt.color],u=o.getColor(),c=r.floatToByte(u.red),h=r.floatToByte(u.green),d=r.floatToByte(u.blue),m=r.floatToByte(u.alpha);l(a+0,c,h,d,m),l(a+1,c,h,d,m),l(a+2,c,h,d,m),l(a+3,c,h,d,m)}function R(e,t,r,i,n){var o=4*n._index,a=n.getHorizontalOrigin().value,s=n.getVerticalOrigin().value,l=n.getShow();0===n.getColor().alpha&&(l=!1),e._allHorizontalCenter=e._allHorizontalCenter&&a===C.CENTER.value;var u=i[ot],c=u[nt.originAndShow];c(o+0,a,s,l),c(o+1,a,s,l),c(o+2,a,s,l),c(o+3,a,s,l)}function L(r,n,o,a,s){var l=4*s._index,u=0,c=0,h=0,d=0,m=s.getImageIndex();if(-1!==m){var p=o[m];if(!e(p))throw new t("Invalid billboard image index: "+m);u=p.x,c=p.y,h=p.width,d=p.height}var f=u+h,v=c+d,y=r._textureAtlas.getTexture().getDimensions(),g=.5*i(s.getWidth(),y.x*h),_=.5*i(s.getHeight(),y.y*d);r._maxSize=Math.max(r._maxSize,g,_);var w=a[ot],C=w[nt.textureCoordinatesAndImageSize];C(l+0,u,c,g,_),C(l+1,f,c,g,_),C(l+2,f,v,g,_),C(l+3,u,v,g,_)}function z(e,t,r,i,n){var o=4*n._index,s=n.getRotation(),l=n.getAlignedAxis();0===s&&a.equals(l,a.ZERO)||(e._shaderRotation=!0);var u=l.x,c=l.y,h=l.z,d=i[ot],m=d[nt.rotationAndAlignedAxis];m(o+0,s,u,c,h),m(o+1,s,u,c,h),m(o+2,s,u,c,h),m(o+3,s,u,c,h)}function N(t,r,i,n,o){var a=4*o._index,s=n[ot],l=s[nt.scaleByDistance],u=0,c=1,h=1,d=1,m=o.getScaleByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderScaleByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function B(t,r,i,n,o){var a=4*o._index,s=n[ot],l=s[nt.translucencyByDistance],u=0,c=1,h=1,d=1,m=o.getTranslucencyByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderTranslucencyByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function F(t,r,i,n,o){var a=4*o._index,s=n[ot],l=s[nt.pixelOffsetScaleByDistance],u=0,c=1,h=1,d=1,m=o.getPixelOffsetScaleByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderPixelOffsetScaleByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function V(e,t,r,i,n){D(e,t,r,i,n),P(e,t,r,i,n),M(e,t,r,i,n),I(e,t,r,i,n),O(e,t,r,i,n),R(e,t,r,i,n),L(e,t,r,i,n),z(e,t,r,i,n),N(e,t,r,i,n),B(e,t,r,i,n),F(e,t,r,i,n)}function k(t,r,i,n,o,a){var s;n.mode===_.SCENE3D?(s=t._baseVolume,t._boundingVolumeDirty=!0):s=t._baseVolume2D;for(var l=[],u=0;i>u;++u){var c=r[u],h=c.getPosition(),m=w._computeActualPosition(h,n,o);e(m)&&(c._setActualPosition(m),a?l.push(m):s.expand(m,s))}a&&d.fromPoints(l,s)}function U(e,t){var r=t.mode,i=t.scene2D.projection,n=e._billboards,o=e._billboardsToUpdate,a=e._modelMatrix;e._mode!==r||e._projection!==i||r!==_.SCENE3D&&!l.equals(a,e.modelMatrix)?(e._mode=r,e._projection=i,l.clone(e.modelMatrix,a),e._createVertexArray=!0,(r===_.SCENE3D||r===_.SCENE2D||r===_.COLUMBUS_VIEW)&&k(e,n,n.length,t,a,!0)):r===_.MORPHING?k(e,n,n.length,t,a,!0):(r===_.SCENE2D||r===_.COLUMBUS_VIEW)&&k(e,o,e._billboardsToUpdateIndex,t,a,!1)}function W(e,t,r,i){var n,o,s,l=r.camera,u=l.frustum,c=a.subtract(l.positionWC,i.center,ht),h=a.multiplyByScalar(l.directionWC,a.dot(c,l.directionWC),dt),d=Math.max(0,a.magnitude(h)-i.radius);ct.x=t.getDrawingBufferWidth(),ct.y=t.getDrawingBufferHeight();var m=u.getPixelSize(ct,d);n=Math.max(m.x,m.y),o=2*n*e._maxScale*e._maxSize,e._allHorizontalCenter&&(o*=.5),s=n*e._maxPixelOffset+e._maxEyeOffset,i.radius+=o+s}var q=w.SHOW_INDEX,G=w.POSITION_INDEX,H=w.PIXEL_OFFSET_INDEX,j=w.EYE_OFFSET_INDEX,Y=w.HORIZONTAL_ORIGIN_INDEX,X=w.VERTICAL_ORIGIN_INDEX,Z=w.SCALE_INDEX,J=w.IMAGE_INDEX_INDEX,K=w.COLOR_INDEX,Q=w.ROTATION_INDEX,$=w.ALIGNED_AXIS_INDEX,et=w.SCALE_BY_DISTANCE_INDEX,tt=w.TRANSLUCENCY_BY_DISTANCE_INDEX,rt=w.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,it=w.NUMBER_OF_PROPERTIES,nt={positionHigh:0,positionLow:1,pixelOffsetAndTranslate:2,eyeOffsetAndScale:3,textureCoordinatesAndImageSize:4,originAndShow:5,direction:6,pickColor:7,color:7,rotationAndAlignedAxis:8,scaleByDistance:9,translucencyByDistance:10,pixelOffsetScaleByDistance:11},ot="all",at="color",st="pick",lt=function(e){e=i(e,i.EMPTY_OBJECT),this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._propertiesChanged=new Uint32Array(it),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._baseVolume=new d,this._baseVolumeWC=new d,this._baseVolume2D=new d,this._boundingVolume=new d,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=l.clone(i(e.modelMatrix,l.IDENTITY)),this._modelMatrix=l.clone(l.IDENTITY),this.debugShowBoundingVolume=i(e.debugShowBoundingVolume,!1),this._mode=_.SCENE3D,this._projection=void 0,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.getTexture()}}};lt.prototype.add=function(e){var t=new w(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},lt.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},lt.prototype.removeAll=function(){this._destroyBillboards(),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},lt.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},lt.prototype.contains=function(t){return e(t)&&t._billboardCollection===this},lt.prototype.get=function(r){if(!e(r))throw new t("index is required.");return E(this),this._billboards[r]},lt.prototype.getLength=function(){return E(this),this._billboards.length},lt.prototype.getTextureAtlas=function(){return this._textureAtlas},lt.prototype.setTextureAtlas=function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)},lt.prototype.getDestroyTextureAtlas=function(){return this._destroyTextureAtlas},lt.prototype.setDestroyTextureAtlas=function(e){this._destroyTextureAtlas=e},lt.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;it>i;++i){var n=0===r[i]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var ut=new s,ct=new o,ht=new a,dt=new a;return lt.prototype.update=function(t,r,i){var n=this._textureAtlas;if(e(n)){var o=n.getTextureCoordinates();if(0!==o.length){E(this),U(this,r);var a=this._billboards,s=a.length,u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,p=this._propertiesChanged,y=n.getGUID(),w=this._createVertexArray||this._textureAtlasGUID!==y;this._textureAtlasGUID=y;var C,b=r.passes,I=b.pick;if(w||!I&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var k=0;it>k;++k)p[k]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),s>0){this._vaf=A(t,s,this._buffersUsage),C=this._vaf.writers;for(var ot=0;s>ot;++ot){var lt=this._billboards[ot];lt._dirty=!1,V(this,t,o,C,lt)}this._vaf.commit(T(t))}this._billboardsToUpdateIndex=0}else if(c>0){var ut=[];if(p[G]&&ut.push(D),p[H]&&ut.push(P),(p[j]||p[Z])&&ut.push(M),p[J]&&ut.push(L),p[K]&&ut.push(O),(p[Y]||p[X]||p[q])&&ut.push(R),(p[Q]||p[$])&&ut.push(z),p[et]&&ut.push(N),p[tt]&&ut.push(B),p[rt]&&ut.push(F),C=this._vaf.writers,c/s>.1){for(var ct=0;c>ct;++ct){var ht=u[ct]; -ht._dirty=!1;for(var dt=0;dtmt;++mt){var pt=u[mt];pt._dirty=!1;for(var ft=0;ft1.5*s&&(u.length=s),e(this._vaf)&&e(this._vaf.vaByPurpose)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,d.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var vt,yt=l.IDENTITY;r.mode===_.SCENE3D?(yt=this.modelMatrix,vt=d.clone(this._baseVolumeWC,this._boundingVolume)):vt=d.clone(this._baseVolume2D,this._boundingVolume),W(this,t,r,vt);var gt,_t,wt,Ct;if(b.render){var xt=this._colorCommands;for(e(this._rs)||(this._rs=t.createRenderState({depthTest:{enabled:!0},blending:m.ALPHA_BLEND})),(!e(this._sp)||this._shaderRotation&&!this._compiledShaderRotation||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistance)&&(this._sp=t.getShaderCache().replaceShaderProgram(this._sp,g({defines:[this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[x]}),S,nt),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),gt=this._vaf.vaByPurpose[at],_t=gt.length,xt.length=_t,Ct=0;_t>Ct;++Ct)wt=xt[Ct],e(wt)||(wt=xt[Ct]=new f),wt.boundingVolume=vt,wt.modelMatrix=yt,wt.primitiveType=h.TRIANGLES,wt.count=gt[Ct].indicesCount,wt.shaderProgram=this._sp,wt.uniformMap=this._uniforms,wt.vertexArray=gt[Ct].va,wt.renderState=this._rs,wt.pass=v.OPAQUE,wt.owner=this,wt.debugShowBoundingVolume=this.debugShowBoundingVolume,i.push(wt)}if(I){var St=this._pickCommands;for((!e(this._spPick)||this._shaderRotation&&!this._compiledShaderRotationPick||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistancePick)&&(this._spPick=t.getShaderCache().replaceShaderProgram(this._spPick,g({defines:["RENDER_FOR_PICK",this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[x]}),g({defines:["RENDER_FOR_PICK"],sources:[S]}),nt),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),gt=this._vaf.vaByPurpose[st],_t=gt.length,St.length=_t,Ct=0;_t>Ct;++Ct)wt=St[Ct],e(wt)||(wt=St[Ct]=new f),wt.boundingVolume=vt,wt.modelMatrix=yt,wt.primitiveType=h.TRIANGLES,wt.count=gt[Ct].indicesCount,wt.shaderProgram=this._spPick,wt.uniformMap=this._uniforms,wt.vertexArray=gt[Ct].va,wt.renderState=this._rs,wt.pass=v.OPAQUE,wt.owner=this,i.push(wt)}}}}},lt.prototype.isDestroyed=function(){return!1},lt.prototype.destroy=function(){return this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.release(),this._spPick=this._spPick&&this._spPick.release(),this._vaf=this._vaf&&this._vaf.destroy(),this._destroyBillboards(),n(this)},lt.prototype._destroyBillboards=function(){for(var e=this._billboards,t=e.length,r=0;t>r;++r)e[r]&&e[r]._destroy()},lt}),r("Renderer/TextureAtlasBuilder",["../Core/Event","../Core/defined","../Core/DeveloperError","../Core/loadImage"],function(e,t,r,i){"use strict";function n(){this.imageLoaded=new e,this.index=-1,this.loaded=!1}var o=function(e){if(!t(e))throw new r("textureAtlas is required.");this.textureAtlas=e,this._idHash={}};return o.prototype.addTextureFromUrl=function(e,n){if(!t(e))throw new r("url is required.");if(!t(n))throw new r("textureAvailableCallback is required.");this.addTextureFromFunction(e,function(e,t){i(e).then(t)},n)},o.prototype.addTextureFromFunction=function(e,i,o){if(!t(e))throw new r("id is required.");if(!t(i))throw new r("getImageCallback is required.");if(!t(o))throw new r("textureAvailableCallback is required.");var a=this._idHash[e];if(t(a))return a.loaded?o(a.index):a.imageLoaded.addEventListener(o),void 0;this._idHash[e]=a=new n,a.imageLoaded.addEventListener(o);var s=this;i(e,function(t){if(!s.textureAtlas.isDestroyed()){var r=a.index=s.textureAtlas.addImage(t);a.loaded=!0,a.imageLoaded.raiseEvent(r,e),a.imageLoaded=void 0}})},o}),r("DynamicScene/DynamicBillboardVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","../Renderer/TextureAtlasBuilder"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r,i){return function(n){var o=e._billboardVisualizerIndex;if(t(o)){var a=r.get(o);a._visualizerUrl===i&&(a._visualizerTextureAvailable=!0,a.setImageIndex(n))}}}function h(e,r,a){var u=a._billboard;if(t(u)){var h=a._position;if(t(h)){var d=u._image;if(t(d)){var y,g=u._show,_=a._billboardVisualizerIndex,w=a.isAvailable(r)&&(!t(g)||g.getValue(r));if(!w)return t(_)&&(y=e._billboardCollection.get(_),y.setShow(!1),y.setImageIndex(-1),y._visualizerUrl=void 0,y._visualizerTextureAvailable=!1,a._billboardVisualizerIndex=void 0,e._unusedIndexes.push(_)),void 0;if(t(_))y=e._billboardCollection.get(_);else{var C=e._unusedIndexes,x=C.length;x>0?(_=C.pop(),y=e._billboardCollection.get(_)):(_=e._billboardCollection.getLength(),y=e._billboardCollection.add()),a._billboardVisualizerIndex=_,y.dynamicObject=a,y._visualizerUrl=void 0,y._visualizerTextureAvailable=!1,y.setColor(i.WHITE),y.setEyeOffset(o.ZERO),y.setPixelOffset(n.ZERO),y.setScale(1),y.setHorizontalOrigin(s.CENTER),y.setVerticalOrigin(l.CENTER)}var S=d.getValue(r);if(S!==y._visualizerUrl&&(y._visualizerUrl=S,y._visualizerTextureAvailable=!1,e._textureAtlasBuilder.addTextureFromUrl(S,c(a,e._billboardCollection,S))),y.setShow(y._visualizerTextureAvailable),y._visualizerTextureAvailable){m=h.getValue(r,m),t(m)&&y.setPosition(m);var E=u._color;if(t(E)&&(p=E.getValue(r,p),t(p)&&y.setColor(p)),E=u._eyeOffset,t(E)&&(f=E.getValue(r,f),t(f)&&y.setEyeOffset(f)),E=u._pixelOffset,t(E)&&(v=E.getValue(r,v),t(v)&&y.setPixelOffset(v)),E=u._scale,t(E)){var b=E.getValue(r);t(b)&&y.setScale(b)}if(E=u._rotation,t(E)){var T=E.getValue(r);t(T)&&y.setRotation(T)}if(E=u._alignedAxis,t(E)){var A=E.getValue(r);t(A)&&y.setAlignedAxis(A)}if(E=u._horizontalOrigin,t(E)){var D=E.getValue(r);t(D)&&y.setHorizontalOrigin(D)}if(E=u._verticalOrigin,t(E)){var P=E.getValue(r);t(P)&&y.setVerticalOrigin(P)}E=u._width,t(E)&&y.setWidth(E.getValue(r)),E=u._height,t(E)&&y.setHeight(E.getValue(r)),E=u._scaleByDistance,t(E)&&y.setScaleByDistance(E.getValue(r)),E=u._translucencyByDistance,t(E)&&y.setTranslucencyByDistance(E.getValue(r)),E=u._pixelOffsetScaleByDistance,t(E)&&y.setPixelOffsetScaleByDistance(E.getValue(r))}}}}}var d=function(r,i){if(!t(r))throw new e("scene is required.");this._scene=r,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;var n=this._billboardCollection=new a,o=this._textureAtlas=r.getContext().createTextureAtlas();this._textureAtlasBuilder=new u(o),n.setTextureAtlas(o),r.getPrimitives().add(n),this.setDynamicObjectCollection(i)};d.prototype.getScene=function(){return this._scene},d.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},d.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(d.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(d.prototype._onObjectsRemoved,this))},d.prototype.update=function(r){if(!t(r))throw new e("time is requied.");if(t(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=0,o=i.length;o>n;n++)h(this,r,i[n])},d.prototype.removeAllPrimitives=function(){if(t(this._dynamicObjectCollection)){this._unusedIndexes=[],this._billboardCollection.removeAll();for(var e=this._dynamicObjectCollection.getObjects(),r=e.length-1;r>-1;r--)e[r]._billboardVisualizerIndex=void 0}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this.removeAllPrimitives(),this._scene.getPrimitives().remove(this._billboardCollection),r(this)};var m,p,f,v;return d.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._billboardCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._billboardVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),u.setImageIndex(-1),u._visualizerUrl=void 0,u._visualizerTextureAvailable=!1,s._billboardVisualizerIndex=void 0,o.push(l)}}},d}),r("Renderer/CullFace",["../Core/Enumeration"],function(e){"use strict";var t={FRONT:new e(1028,"FRONT"),BACK:new e(1029,"BACK"),FRONT_AND_BACK:new e(1032,"FRONT_AND_BACK"),validate:function(e){return e===t.FRONT||e===t.BACK||e===t.FRONT_AND_BACK}};return t}),r("Renderer/MipmapHint",["../Core/Enumeration"],function(e){"use strict";var t={DONT_CARE:new e(4352,"DONT_CARE"),FASTEST:new e(4353,"FASTEST"),NICEST:new e(4354,"NICEST"),validate:function(e){return e===t.DONT_CARE||e===t.FASTEST||e===t.NICEST}};return t}),r("Renderer/PixelDatatype",["../Core/Enumeration"],function(e){"use strict";var t={UNSIGNED_BYTE:new e(5121,"UNSIGNED_BYTE"),UNSIGNED_SHORT:new e(5123,"UNSIGNED_SHORT"),UNSIGNED_INT:new e(5125,"UNSIGNED_INT"),FLOAT:new e(5126,"FLOAT"),UNSIGNED_INT_24_8_WEBGL:new e(34042,"UNSIGNED_INT_24_8_WEBGL"),UNSIGNED_SHORT_4_4_4_4:new e(32819,"UNSIGNED_SHORT_4_4_4_4"),UNSIGNED_SHORT_5_5_5_1:new e(32820,"UNSIGNED_SHORT_5_5_5_1"),UNSIGNED_SHORT_5_6_5:new e(33635,"UNSIGNED_SHORT_5_6_5"),validate:function(e){return e===t.UNSIGNED_BYTE||e===t.UNSIGNED_SHORT||e===t.UNSIGNED_INT||e===t.FLOAT||e===t.UNSIGNED_INT_24_8_WEBGL||e===t.UNSIGNED_SHORT_4_4_4_4||e===t.UNSIGNED_SHORT_5_5_5_1||e===t.UNSIGNED_SHORT_5_6_5}};return t}),r("Renderer/PixelFormat",[],function(){"use strict";var e={DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,validate:function(t){return t===e.DEPTH_COMPONENT||t===e.DEPTH_STENCIL||t===e.ALPHA||t===e.RGB||t===e.RGBA||t===e.LUMINANCE||t===e.LUMINANCE_ALPHA},isColorFormat:function(t){return t===e.ALPHA||t===e.RGB||t===e.RGBA||t===e.LUMINANCE||t===e.LUMINANCE_ALPHA},isDepthFormat:function(t){return t===e.DEPTH_COMPONENT||t===e.DEPTH_STENCIL}};return e}),r("Renderer/TextureMagnificationFilter",[],function(){"use strict";var e={NEAREST:9728,LINEAR:9729,validate:function(t){return t===e.NEAREST||t===e.LINEAR}};return e}),r("Renderer/TextureMinificationFilter",[],function(){"use strict";var e={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,validate:function(t){return t===e.NEAREST||t===e.LINEAR||t===e.NEAREST_MIPMAP_NEAREST||t===e.LINEAR_MIPMAP_NEAREST||t===e.NEAREST_MIPMAP_LINEAR||t===e.LINEAR_MIPMAP_LINEAR}};return e}),r("Renderer/TextureWrap",[],function(){"use strict";var e={CLAMP_TO_EDGE:33071,REPEAT:10497,MIRRORED_REPEAT:33648,validate:function(t){return t===e.CLAMP_TO_EDGE||t===e.REPEAT||t===e.MIRRORED_REPEAT}};return e}),r("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./MipmapHint","./PixelDatatype","./PixelFormat","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(t,r,i,n,o,a,s,l,u,c){this._gl=t,this._textureFilterAnisotropic=r,this._textureTarget=i,this._texture=n,this._pixelFormat=o,this._pixelDatatype=a,this._width=s,this._height=l,this._dimensions=new e(s,l),this._preMultiplyAlpha=u,this._flipY=c,this._sampler=void 0,this.setSampler()};return d.prototype.copyFrom=function(e,i,o){if(!r(e))throw new n("source is required.");if(l.isDepthFormat(this._pixelFormat))throw new n("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(i=t(i,0),o=t(o,0),0>i)throw new n("xOffset must be greater than or equal to zero.");if(0>o)throw new n("yOffset must be greater than or equal to zero.");var a=e.width,s=e.height;if(i+a>this._width)throw new n("xOffset + source.width must be less than or equal to getWidth().");if(o+s>this._height)throw new n("yOffset + source.height must be less than or equal to getHeight().");var u=this._gl,c=this._textureTarget;u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,this._flipY),u.activeTexture(u.TEXTURE0),u.bindTexture(c,this._texture),e.arrayBufferView?u.texSubImage2D(c,0,i,o,a,s,this._pixelFormat,+this._pixelDatatype,e.arrayBufferView):u.texSubImage2D(c,0,i,o,this._pixelFormat,this._pixelDatatype,e),u.bindTexture(c,null)},d.prototype.copyFromFramebuffer=function(e,r,i,o,a,u){if(l.isDepthFormat(this._pixelFormat))throw new n("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===s.FLOAT)throw new n("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(e=t(e,0),r=t(r,0),i=t(i,0),o=t(o,0),a=t(a,this._width),u=t(u,this._height),0>e)throw new n("xOffset must be greater than or equal to zero.");if(0>r)throw new n("yOffset must be greater than or equal to zero.");if(0>i)throw new n("framebufferXOffset must be greater than or equal to zero.");if(0>o)throw new n("framebufferYOffset must be greater than or equal to zero.");if(e+a>this._width)throw new n("xOffset + width must be less than or equal to getWidth().");if(r+u>this._height)throw new n("yOffset + height must be less than or equal to getHeight().");var c=this._gl,h=this._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(h,this._texture),c.copyTexSubImage2D(h,0,e,r,i,o,a,u),c.bindTexture(h,null)},d.prototype.generateMipmap=function(e){if(l.isDepthFormat(this._pixelFormat))throw new n("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._width>1&&!o.isPowerOfTwo(this._width))throw new n("width must be a power of two to call generateMipmap().");if(this._height>1&&!o.isPowerOfTwo(this._height))throw new n("height must be a power of two to call generateMipmap().");if(e=t(e,a.DONT_CARE),!a.validate(e))throw new n("hint is invalid.");var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},d.prototype.getSampler=function(){return this._sampler},d.prototype.setSampler=function(e){if(!r(e)){var t=c.LINEAR,i=u.LINEAR;this._pixelDatatype===s.FLOAT&&(t=c.NEAREST,i=u.NEAREST),e={wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i,maximumAnisotropy:1}}if(this._pixelDatatype===s.FLOAT){if(e.minificationFilter!==c.NEAREST&&e.minificationFilter!==c.NEAREST_MIPMAP_NEAREST)throw new n("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(e.magnificationFilter!==u.NEAREST)throw new n("Only the NEAREST magnification filter is supported for floating point textures.")}var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,e.minificationFilter),o.texParameteri(a,o.TEXTURE_MAG_FILTER,e.magnificationFilter),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),r(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler={wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy}},d.prototype.getPixelFormat=function(){return this._pixelFormat},d.prototype.getPixelDatatype=function(){return this._pixelDatatype},d.prototype.getDimensions=function(){return this._dimensions},d.prototype.getPreMultiplyAlpha=function(){return this._preMultiplyAlpha},d.prototype.getFlipY=function(){return this._flipY},d.prototype.getWidth=function(){return this._width},d.prototype.getHeight=function(){return this._height},d.prototype._getTexture=function(){return this._texture},d.prototype._getTarget=function(){return this._textureTarget},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),i(this)},d}),r("Renderer/CubeMapFace",["../Core/defaultValue","../Core/DeveloperError","./PixelDatatype"],function(e,t,r){"use strict";var i=function(e,t,r,i,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=r,this._targetFace=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l};return i.prototype.copyFrom=function(r,i,n){if(!r)throw new t("source is required.");i=e(i,0),n=e(n,0);var o=r.width,a=r.height;if(0>i)throw new t("xOffset must be greater than or equal to zero.");if(0>n)throw new t("yOffset must be greater than or equal to zero.");if(i+o>this._size)throw new t("xOffset + source.width must be less than or equal to getWidth().");if(n+a>this._size)throw new t("yOffset + source.height must be less than or equal to getHeight().");var s=this._gl,l=this._textureTarget;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,this._flipY),s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),r.arrayBufferView?s.texSubImage2D(this._targetFace,0,i,n,o,a,this._pixelFormat,+this._pixelDatatype,r.arrayBufferView):s.texSubImage2D(this._targetFace,0,i,n,this._pixelFormat,+this._pixelDatatype,r),s.bindTexture(l,null)},i.prototype.copyFromFramebuffer=function(i,n,o,a,s,l){if(i=e(i,0),n=e(n,0),o=e(o,0),a=e(a,0),s=e(s,this._size),l=e(l,this._size),0>i)throw new t("xOffset must be greater than or equal to zero.");if(0>n)throw new t("yOffset must be greater than or equal to zero.");if(0>o)throw new t("framebufferXOffset must be greater than or equal to zero.");if(0>a)throw new t("framebufferYOffset must be greater than or equal to zero.");if(i+s>this._size)throw new t("xOffset + source.width must be less than or equal to getWidth().");if(n+l>this._size)throw new t("yOffset + source.height must be less than or equal to getHeight().");if(this._pixelDatatype===r.FLOAT)throw new t("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");var u=this._gl,c=this._textureTarget;u.activeTexture(u.TEXTURE0),u.bindTexture(c,this._texture),u.copyTexSubImage2D(this._targetFace,0,i,n,o,a,s,l),u.bindTexture(c,null)},i.prototype.getPixelFormat=function(){return this._pixelFormat},i.prototype.getPixelDatatype=function(){return this._pixelDatatype},i.prototype._getTexture=function(){return this._texture},i.prototype._getTarget=function(){return this._targetFace},i}),r("Renderer/CubeMap",["../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Math","./MipmapHint","./PixelDatatype","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap","./CubeMapFace"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(e,t,r,i,n,o,a,s,l){this._gl=e,this._textureFilterAnisotropic=t,this._textureTarget=r,this._texture=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l,this._sampler=void 0,this._positiveX=new u(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_X,n,o,a,s,l),this._negativeX=new u(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_X,n,o,a,s,l),this._positiveY=new u(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Y,n,o,a,s,l),this._negativeY=new u(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,n,o,a,s,l),this._positiveZ=new u(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Z,n,o,a,s,l),this._negativeZ=new u(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Z,n,o,a,s,l),this.setSampler()};return c.prototype.getPositiveX=function(){return this._positiveX},c.prototype.getNegativeX=function(){return this._negativeX},c.prototype.getPositiveY=function(){return this._positiveY},c.prototype.getNegativeY=function(){return this._negativeY},c.prototype.getPositiveZ=function(){return this._positiveZ},c.prototype.getNegativeZ=function(){return this._negativeZ},c.prototype.generateMipmap=function(e){if(this._size>1&&!i.isPowerOfTwo(this._size))throw new t("width and height must be a power of two to call generateMipmap().");if(e=e||n.DONT_CARE,!n.validate(e))throw new t("hint is invalid.");var r=this._gl,o=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(o,this._texture),r.generateMipmap(o),r.bindTexture(o,null)},c.prototype.setSampler=function(r){if(!e(r)){var i=s.LINEAR,n=a.LINEAR;this._pixelDatatype===o.FLOAT&&(i=s.NEAREST,n=a.NEAREST),r={wrapS:l.CLAMP_TO_EDGE,wrapT:l.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:n,maximumAnisotropy:1}}if(this._pixelDatatype===o.FLOAT){if(r.minificationFilter!==s.NEAREST&&r.minificationFilter!==s.NEAREST_MIPMAP_NEAREST)throw new t("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(r.magnificationFilter!==a.NEAREST)throw new t("Only the NEAREST magnification filter is supported for floating point textures.")}var u=this._gl,c=this._textureTarget;u.activeTexture(u.TEXTURE0),u.bindTexture(c,this._texture),u.texParameteri(c,u.TEXTURE_MIN_FILTER,r.minificationFilter),u.texParameteri(c,u.TEXTURE_MAG_FILTER,r.magnificationFilter),u.texParameteri(c,u.TEXTURE_WRAP_S,r.wrapS),u.texParameteri(c,u.TEXTURE_WRAP_T,r.wrapT),e(this._textureFilterAnisotropic)&&u.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.maximumAnisotropy),u.bindTexture(c,null),this._sampler={wrapS:r.wrapS,wrapT:r.wrapT,minificationFilter:r.minificationFilter,magnificationFilter:r.magnificationFilter,maximumAnisotropy:r.maximumAnisotropy}},c.prototype.getSampler=function(){return this._sampler},c.prototype.getPixelFormat=function(){return this._pixelFormat},c.prototype.getPixelDatatype=function(){return this._pixelDatatype},c.prototype.getWidth=function(){return this._size},c.prototype.getHeight=function(){return this._size},c.prototype.getPreMultiplyAlpha=function(){return this._preMultiplyAlpha},c.prototype.getFlipY=function(){return this._flipY},c.prototype._getTexture=function(){return this._texture},c.prototype._getTarget=function(){return this._textureTarget},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},c}),r("Shaders/Materials/AsphaltMaterial",[],function(){"use strict";return"uniform vec4 asphaltColor;\nuniform float bumpSize;\nuniform float roughness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 color = asphaltColor;\nvec2 st = materialInput.st;\nvec2 F = czm_cellular(st / bumpSize);\ncolor.rgb -= (F.x / F.y) * 0.1;\nfloat noise = czm_snoise(st / bumpSize);\nnoise = pow(noise, 5.0) * roughness;\ncolor.rgb += noise;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/BlobMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float frequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 F = czm_cellular(materialInput.st * frequency);\nfloat t = 1.0 - F.x * F.x;\nvec4 color = mix(lightColor, darkColor, t);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/BrickMaterial",[],function(){"use strict";return"uniform vec4 brickColor;\nuniform vec4 mortarColor;\nuniform vec2 brickSize;\nuniform vec2 brickPct;\nuniform float brickRoughness;\nuniform float mortarRoughness;\n#define Integral(x, p) ((floor(x) * p) + max(fract(x) - (1.0 - p), 0.0))\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 position = st / brickSize;\nif(fract(position.y * 0.5) > 0.5) {\nposition.x += 0.5;\n}\nvec2 filterWidth = vec2(0.02);\nvec2 useBrick = (Integral(position + filterWidth, brickPct) -\nIntegral(position, brickPct)) / filterWidth;\nfloat useBrickFinal = useBrick.x * useBrick.y;\nvec4 color = mix(mortarColor, brickColor, useBrickFinal);\nvec2 brickScaled = vec2(st.x / 0.1, st.y / 0.006);\nfloat brickNoise = abs(czm_snoise(brickScaled) * brickRoughness / 5.0);\ncolor.rg += brickNoise * useBrickFinal;\nvec2 mortarScaled = st / 0.005;\nfloat mortarNoise = max(czm_snoise(mortarScaled) * mortarRoughness, 0.0);\ncolor.rgb += mortarNoise * (1.0 - useBrickFinal);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),r("Shaders/Materials/CementMaterial",[],function(){"use strict";return"uniform vec4 cementColor;\nuniform float grainScale;\nuniform float roughness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat noise = czm_snoise(materialInput.st / grainScale);\nnoise = pow(noise, 5.0) * roughness;\nvec4 color = cementColor;\ncolor.rgb += noise;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/FacetMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float frequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 F = czm_cellular(materialInput.st * frequency);\nfloat t = 0.1 + (F.y - F.x);\nvec4 color = mix(lightColor, darkColor, t);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/FresnelMaterial",[],function(){"use strict";return"czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nfloat cosAngIncidence = max(dot(normalWC, positionWC), 0.0);\nmaterial.diffuse = mix(reflection.diffuse, refraction.diffuse, cosAngIncidence);\nreturn material;\n}\n"}),r("Shaders/Materials/GrassMaterial",[],function(){"use strict";return"uniform vec4 grassColor;\nuniform vec4 dirtColor;\nuniform float patchiness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat noise1 = (czm_snoise(st * patchiness * 1.0)) * 1.0;\nfloat noise2 = (czm_snoise(st * patchiness * 2.0)) * 0.5;\nfloat noise3 = (czm_snoise(st * patchiness * 4.0)) * 0.25;\nfloat noise = sin(noise1 + noise2 + noise3) * 0.1;\nvec4 color = mix(grassColor, dirtColor, noise);\nfloat verticalNoise = czm_snoise(vec2(st.x * 100.0, st.y * 20.0)) * 0.02;\nfloat horizontalNoise = czm_snoise(vec2(st.x * 20.0, st.y * 100.0)) * 0.02;\nfloat stripeNoise = min(verticalNoise, horizontalNoise);\ncolor.rgb += stripeNoise;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = lineThickness - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n" -}),r("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),r("Shaders/Materials/ReflectionMaterial",[],function(){"use strict";return"uniform samplerCube cubeMap;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 reflectedWC = reflect(positionWC, normalWC);\nmaterial.diffuse = textureCube(cubeMap, reflectedWC).channels;\nreturn material;\n}\n"}),r("Shaders/Materials/RefractionMaterial",[],function(){"use strict";return"uniform samplerCube cubeMap;\nuniform float indexOfRefractionRatio;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 refractedWC = refract(positionWC, -normalWC, indexOfRefractionRatio);\nmaterial.diffuse = textureCube(cubeMap, refractedWC).channels;\nreturn material;\n}\n"}),r("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(lightColor, darkColor, step(0.5, value));\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/TieDyeMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float frequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 scaled = materialInput.str * frequency;\nfloat t = abs(czm_snoise(scaled));\nvec4 color = mix(lightColor, darkColor, t);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),r("Shaders/Materials/WoodMaterial",[],function(){"use strict";return"uniform vec4 lightWoodColor;\nuniform vec4 darkWoodColor;\nuniform float ringFrequency;\nuniform vec2 noiseScale;\nuniform float grainFrequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 noisevec;\nnoisevec.x = czm_snoise(st * noiseScale.x);\nnoisevec.y = czm_snoise(st * noiseScale.y);\nvec2 location = st + noisevec;\nfloat dist = sqrt(location.x * location.x + location.y * location.y);\ndist *= ringFrequency;\nfloat r = fract(dist + noisevec[0] + noisevec[1]) * 2.0;\nif(r > 1.0)\nr = 2.0 - r;\nvec4 color = mix(lightWoodColor, darkWoodColor, r);\nr = abs(czm_snoise(vec2(st.x * grainFrequency, st.y * grainFrequency * 0.02))) * 0.2;\ncolor.rgb += lightWoodColor.rgb * r;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),r("Shaders/Materials/ErosionMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float time;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat alpha = 1.0;\nif (time != 1.0)\n{\nfloat t = 0.5 + (0.5 * czm_snoise(materialInput.str / (1.0 / 10.0)));\nif (t > time)\n{\nalpha = 0.0;\n}\n}\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a * alpha;\nreturn material;\n}\n"}),r("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),r("Scene/Material",["../ThirdParty/when","../Core/loadImage","../Core/DeveloperError","../Core/createGuid","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Cartesian2","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/Texture","../Renderer/CubeMap","../Shaders/Materials/AsphaltMaterial","../Shaders/Materials/BlobMaterial","../Shaders/Materials/BrickMaterial","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CementMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FacetMaterial","../Shaders/Materials/FresnelMaterial","../Shaders/Materials/GrassMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/ReflectionMaterial","../Shaders/Materials/RefractionMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/TieDyeMaterial","../Shaders/Materials/Water","../Shaders/Materials/WoodMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/ErosionMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M,I,O,R,L,z,N,B,F,V,k){"use strict";function U(e,t){e=s(e,s.EMPTY_OBJECT),t._strict=s(e.strict,!1),t._count=s(e.count,0),t._template=n(s(e.fabric,s.EMPTY_OBJECT)),t._template.uniforms=n(s(t._template.uniforms,s.EMPTY_OBJECT)),t._template.materials=n(s(t._template.materials,s.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:i(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];var r,o=tt._materialCache.getMaterial(t.type);if(l(o)){var u=n(o.fabric,!0);t._template=a([t._template,u]),r=o.translucent}H(t),l(o)||tt._materialCache.addMaterial(t.type,t),j(t),Z(t),Q(t);var c=0===t._translucentFunctions.length?!0:void 0;if(r=s(r,c),r=s(e.translucent,r),l(r))if("function"==typeof r){var h=function(){return r(t)};t._translucentFunctions.push(h)}else t._translucentFunctions.push(r)}function W(e,t,r,i){if(l(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(i&&!o||!i&&o)&&r(n,t)}}function q(e,t){for(var i="fabric: property name '"+e+"' is not valid. It should be ",n=0;n0&&(n[s]={type:"ivec3",x:1,y:1},J(e,s))}var u="uniform "+a+" "+t+";\n";-1===e.shaderSource.indexOf(u)&&(e.shaderSource=u+e.shaderSource);var c=t+"_"+e._count++;if(1===$(e,t,c)&&i)throw new r("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=o,"sampler2D"===a)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Y(t));else if("samplerCube"===a)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(X(t));else if(-1!==a.indexOf("mat")){var h=new nt[a];e._uniforms[c]=function(){return nt[a].fromColumnMajorArray(e.uniforms[t],h)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function K(e){var t=e.type;if(!l(t)){var r=typeof e;if("number"===r)t="float";else if("boolean"===r)t="bool";else if("string"===r)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===tt.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===r)if(Array.isArray(e))(4===e.length||9===e.length||16===e.length)&&(t="mat"+Math.sqrt(e.length));else{var i=0;for(var n in e)e.hasOwnProperty(n)&&(i+=1);i>=2&&4>=i?t="vec"+i:6===i&&(t="samplerCube")}}return t}function Q(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new tt({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=a([e._uniforms,o._uniforms]),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var s="czm_getMaterial",l=s+"_"+e._count++;$(o,s,l),e.shaderSource=o.shaderSource+e.shaderSource;var u=l+"(materialInput)";if(0===$(e,n,u)&&t)throw new r("strict: shader source does not use material '"+n+"'.")}}function $(e,t,r,i){i=s(i,!0);var n=0,o="a-zA-Z0-9_",a="(["+o+"])?",l="(["+o+(i?".":"")+"])?",u=new RegExp(l+t+a,"g");return e.shaderSource=e.shaderSource.replace(u,function(e,t,i){return t||i?e:(n+=1,r)}),n}function et(e,t,r){return $(e,t,t,r)}var tt=function(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],U(e,this),u(this,{type:{value:this.type,writable:!1}}),l(tt._uniformList[this.type])||(tt._uniformList[this.type]=Object.keys(this._uniforms))};tt._uniformList={},tt.fromType=function(e){if(!l(tt._materialCache.getMaterial(e)))throw new r("material with type '"+e+"' does not exist.");return new tt({fabric:{type:e}})},tt.prototype.isTranslucent=function(){if(l(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,r=t.length,i=0;r>i;++i){var n=t[i];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},tt.prototype.update=function(e){var t,r,i=this._loadedImages,n=i.length;for(t=0;n>t;++t){var o=i[t];r=o.id;var a=o.image,s=tt._textureCache.getTexture(this._texturePaths[r]);l(s)||(s=e.createTexture2D({source:a}),tt._textureCache.addTexture(this._texturePaths[r],s)),this._textures[r]=s;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=s._width,c.y=s._height}}i.length=0;var h=this._loadedCubeMaps;for(n=h.length,t=0;n>t;++t){var d=h[t];r=d.id;var m=d.images,p=tt._textureCache.getTexture(this._texturePaths[r]);l(p)||(p=e.createCubeMap({source:{positiveX:m[0],negativeX:m[1],positiveY:m[2],negativeY:m[3],positiveZ:m[4],negativeZ:m[5]}}),tt._textureCache.addTexture(this._texturePaths[r],p)),this._textures[r]=p}h.length=0;var f=this._updateFunctions;for(n=f.length,t=0;n>t;++t)f[t](this,e);var v=this.materials;for(var y in v)v.hasOwnProperty(y)&&v[y].update(e)},tt.prototype.isDestroyed=function(){return!1},tt.prototype.destroy=function(){var e=this.materials,t=this.uniforms;for(var r in t)if(t.hasOwnProperty(r)){var i=this._texturePaths[r];tt._textureCache.releaseTexture(i)}for(var n in e)e.hasOwnProperty(n)&&e[n].destroy();return c(this)};var rt=["type","materials","uniforms","components","source"],it=["diffuse","specular","shininess","normal","emission","alpha"],nt={mat2:d,mat3:m,mat4:p};return tt._textureCache={_textures:{},addTexture:function(e,t){this._textures[e]={texture:t,count:1}},getTexture:function(e){var t=this._textures[e];return l(t)?(t.count++,t.texture):void 0},releaseTexture:function(e){var t=this._textures[e];l(t)&&0===--t.count&&(t.texture=t.texture&&t.texture.destroy(),this._textures[e]=void 0)}},tt._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},tt.DefaultImageId="czm_defaultImage",tt.DefaultCubeMapId="czm_defaultCubeMap",tt.ColorType="Color",tt._materialCache.addMaterial(tt.ColorType,{fabric:{type:tt.ColorType,uniforms:{color:new o(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),tt.ImageType="Image",tt._materialCache.addMaterial(tt.ImageType,{fabric:{type:tt.ImageType,uniforms:{image:tt.DefaultImageId,repeat:new h(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a"}},translucent:!0}),tt.DiffuseMapType="DiffuseMap",tt._materialCache.addMaterial(tt.DiffuseMapType,{fabric:{type:tt.DiffuseMapType,uniforms:{image:tt.DefaultImageId,channels:"rgb",repeat:new h(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),tt.AlphaMapType="AlphaMap",tt._materialCache.addMaterial(tt.AlphaMapType,{fabric:{type:tt.AlphaMapType,uniforms:{image:tt.DefaultImageId,channel:"a",repeat:new h(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),tt.SpecularMapType="SpecularMap",tt._materialCache.addMaterial(tt.SpecularMapType,{fabric:{type:tt.SpecularMapType,uniforms:{image:tt.DefaultImageId,channel:"r",repeat:new h(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),tt.EmissionMapType="EmissionMap",tt._materialCache.addMaterial(tt.EmissionMapType,{fabric:{type:tt.EmissionMapType,uniforms:{image:tt.DefaultImageId,channels:"rgb",repeat:new h(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),tt.BumpMapType="BumpMap",tt._materialCache.addMaterial(tt.BumpMapType,{fabric:{type:tt.BumpMapType,uniforms:{image:tt.DefaultImageId,channel:"r",strength:.8,repeat:new h(1,1)},source:w},translucent:!1}),tt.NormalMapType="NormalMap",tt._materialCache.addMaterial(tt.NormalMapType,{fabric:{type:tt.NormalMapType,uniforms:{image:tt.DefaultImageId,channels:"rgb",strength:.8,repeat:new h(1,1)},source:D},translucent:!1}),tt.ReflectionType="Reflection",tt._materialCache.addMaterial(tt.ReflectionType,{fabric:{type:tt.ReflectionType,uniforms:{cubeMap:tt.DefaultCubeMapId,channels:"rgb"},source:P},translucent:!1}),tt.RefractionType="Refraction",tt._materialCache.addMaterial(tt.RefractionType,{fabric:{type:tt.RefractionType,uniforms:{cubeMap:tt.DefaultCubeMapId,channels:"rgb",indexOfRefractionRatio:.9},source:M},translucent:!1}),tt.FresnelType="Fresnel",tt._materialCache.addMaterial(tt.FresnelType,{fabric:{type:tt.FresnelType,materials:{reflection:{type:tt.ReflectionType},refraction:{type:tt.RefractionType}},source:b},translucent:!1}),tt.BrickType="Brick",tt._materialCache.addMaterial(tt.BrickType,{fabric:{type:tt.BrickType,uniforms:{brickColor:new o(.6,.3,.1,1),mortarColor:new o(.8,.8,.7,1),brickSize:new h(.3,.15),brickPct:new h(.9,.85),brickRoughness:.2,mortarRoughness:.1},source:_},translucent:function(e){var t=e.uniforms;return t.brickColor.alpha<1||t.mortarColor.alpha<1}}),tt.WoodType="Wood",tt._materialCache.addMaterial(tt.WoodType,{fabric:{type:tt.WoodType,uniforms:{lightWoodColor:new o(.6,.3,.1,1),darkWoodColor:new o(.4,.2,.07,1),ringFrequency:3,noiseScale:new h(.7,.5),grainFrequency:27},source:L},translucent:function(e){var t=e.uniforms;return t.lightWoodColor.alpha<1||t.darkWoodColor.alpha<1}}),tt.AsphaltType="Asphalt",tt._materialCache.addMaterial(tt.AsphaltType,{fabric:{type:tt.AsphaltType,uniforms:{asphaltColor:new o(.15,.15,.15,1),bumpSize:.02,roughness:.2},source:y},translucent:function(e){return e.uniforms.asphaltColor.alpha<1}}),tt.CementType="Cement",tt._materialCache.addMaterial(tt.CementType,{fabric:{type:tt.CementType,uniforms:{cementColor:new o(.95,.95,.85,1),grainScale:.01,roughness:.3},source:C},translucent:function(e){return e.uniforms.cementColor.alpha<1}}),tt.GrassType="Grass",tt._materialCache.addMaterial(tt.GrassType,{fabric:{type:tt.GrassType,uniforms:{grassColor:new o(.25,.4,.1,1),dirtColor:new o(.1,.1,.1,1),patchiness:1.5},source:T},translucent:function(e){var t=e.uniforms;return t.grassColor.alpha<1||t.dirtColor.alpha<1}}),tt.GridType="Grid",tt._materialCache.addMaterial(tt.GridType,{fabric:{type:tt.GridType,uniforms:{color:new o(0,1,0,1),cellAlpha:.1,lineCount:new h(8,8),lineThickness:new h(1,1)},source:A},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),tt.StripeType="Stripe",tt._materialCache.addMaterial(tt.StripeType,{fabric:{type:tt.StripeType,uniforms:{horizontal:!0,lightColor:new o(1,1,1,.5),darkColor:new o(0,0,1,.5),offset:0,repeat:5},source:I},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),tt.CheckerboardType="Checkerboard",tt._materialCache.addMaterial(tt.CheckerboardType,{fabric:{type:tt.CheckerboardType,uniforms:{lightColor:new o(1,1,1,.5),darkColor:new o(0,0,0,.5),repeat:new h(5,5)},source:x},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),tt.DotType="Dot",tt._materialCache.addMaterial(tt.DotType,{fabric:{type:tt.DotType,uniforms:{lightColor:new o(1,1,0,.75),darkColor:new o(0,1,1,.75),repeat:new h(5,5)},source:S},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),tt.TyeDyeType="TieDye",tt._materialCache.addMaterial(tt.TyeDyeType,{fabric:{type:tt.TyeDyeType,uniforms:{lightColor:new o(1,1,0,.75),darkColor:new o(1,0,0,.75),frequency:5},source:O},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),tt.FacetType="Facet",tt._materialCache.addMaterial(tt.FacetType,{fabric:{type:tt.FacetType,uniforms:{lightColor:new o(.25,.25,.25,.75),darkColor:new o(.75,.75,.75,.75),frequency:10},source:E},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),tt.BlobType="Blob",tt._materialCache.addMaterial(tt.BlobType,{fabric:{type:tt.BlobType,uniforms:{lightColor:new o(1,1,1,.5),darkColor:new o(0,0,1,.5),frequency:10},source:g},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),tt.WaterType="Water",tt._materialCache.addMaterial(tt.WaterType,{fabric:{type:tt.WaterType,uniforms:{baseWaterColor:new o(.2,.3,.6,1),blendColor:new o(0,1,.699,1),specularMap:tt.DefaultImageId,normalMap:tt.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:R},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),tt.RimLightingType="RimLighting",tt._materialCache.addMaterial(tt.RimLightingType,{fabric:{type:tt.RimLightingType,uniforms:{color:new o(1,0,0,.7),rimColor:new o(1,1,1,.4),width:.3},source:z},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),tt.ErosionType="Erosion",tt._materialCache.addMaterial(tt.ErosionType,{fabric:{type:tt.ErosionType,uniforms:{color:new o(1,0,0,.5),time:1},source:N},translucent:function(e){return e.uniforms.color.alpha<1}}),tt.FadeType="Fade",tt._materialCache.addMaterial(tt.FadeType,{fabric:{type:tt.FadeType,uniforms:{fadeInColor:new o(1,0,0,1),fadeOutColor:new o(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new h(.5,.5)},source:B},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<0}}),tt.PolylineArrowType="PolylineArrow",tt._materialCache.addMaterial(tt.PolylineArrowType,{fabric:{type:tt.PolylineArrowType,uniforms:{color:new o(1,1,1,1)},source:F},translucent:!0}),tt.PolylineGlowType="PolylineGlow",tt._materialCache.addMaterial(tt.PolylineGlowType,{fabric:{type:tt.PolylineGlowType,uniforms:{color:new o(0,.5,1,1),glowPower:.1},source:V},translucent:!0}),tt.PolylineOutlineType="PolylineOutline",tt._materialCache.addMaterial(tt.PolylineOutlineType,{fabric:{type:tt.PolylineOutlineType,uniforms:{color:new o(1,1,1,1),outlineColor:new o(1,0,0,1),outlineWidth:1},source:k},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),tt}),r("Shaders/EllipsoidVS",[],function(){"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, gl_DepthRange.near, gl_DepthRange.far);\n}\n"}),r("Shaders/EllipsoidFS",[],function(){"use strict";return"#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = gl_DepthRange.near;\nfloat f = gl_DepthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),r("Scene/EllipsoidPrimitive",["../Core/defaultValue","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Matrix4","../Core/BoundingSphere","../Core/PrimitiveType","../Renderer/CullFace","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","./Material","./SceneMode","../Shaders/EllipsoidVS","../Shaders/EllipsoidFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_){"use strict";function w(e){var i=e.cache.ellipsoidPrimitive_vertexArray;if(n(i))return i; -var o=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2)}));return i=e.createVertexArrayFromGeometry({geometry:o,attributeIndices:C,bufferUsage:d.STATIC_DRAW}),e.cache.ellipsoidPrimitive_vertexArray=i,i}var C={position:0},x=function(t){t=e(t,e.EMPTY_OBJECT),this.center=r.clone(e(t.center,r.ZERO)),this._center=new r,this.radii=r.clone(t.radii),this._radii=new r,this._oneOverEllipsoidRadiiSquared=new r,this._boundingSphere=new l,this.modelMatrix=s.clone(e(t.modelMatrix,s.IDENTITY)),this._modelMatrix=new s,this._computedModelMatrix=new s,this.show=e(t.show,!0),this.material=e(t.material,v.fromType(v.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this.onlySunLighting=e(t.onlySunLighting,!1),this._onlySunLighting=!1,this._owner=t._owner,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new m,this._colorCommand.owner=this,this._pickCommand=new m,this._pickCommand.owner=this;var i=this;this._uniforms={u_radii:function(){return i.radii},u_oneOverEllipsoidRadiiSquared:function(){return i._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return i._pickId.color}}};return x.prototype.update=function(t,a,d){if(this.show&&a.mode===y.SCENE3D&&n(this.center)&&n(this.radii)){if(!n(this.material))throw new o("this.material must be defined.");var m=this.material.isTranslucent(),v=this._translucent!==m;(!n(this._rs)||v)&&(this._translucent=m,this._rs=t.createRenderState({cull:{enabled:!0,face:c.FRONT},depthTest:{enabled:!0},depthMask:!m&&t.getFragmentDepth(),blending:m?h.ALPHA_BLEND:void 0})),n(this._va)||(this._va=w(t));var x=!1,S=this.radii;if(!r.equals(this._radii,S)){r.clone(S,this._radii);var E=this._oneOverEllipsoidRadiiSquared;E.x=1/(S.x*S.x),E.y=1/(S.y*S.y),E.z=1/(S.z*S.z),x=!0}s.equals(this.modelMatrix,this._modelMatrix)&&r.equals(this.center,this._center)||(s.clone(this.modelMatrix,this._modelMatrix),r.clone(this.center,this._center),s.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),x=!0),x&&(r.clone(r.ZERO,this._boundingSphere.center),this._boundingSphere.radius=r.getMaximumComponent(S),l.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var b=this._material!==this.material;this._material=this.material,this._material.update(t);var T=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var A=this._colorCommand;if(b||T||v){var D=p({defines:[this.onlySunLighting?"ONLY_SUN_LIGHTING":"",!m&&t.getFragmentDepth()?"WRITE_DEPTH":""],sources:[this.material.shaderSource,_]});this._sp=t.getShaderCache().replaceShaderProgram(this._sp,g,D,C),A.primitiveType=u.TRIANGLES,A.vertexArray=this._va,A.renderState=this._rs,A.shaderProgram=this._sp,A.uniformMap=i([this._uniforms,this.material._uniforms],!1,!1),A.executeInClosestFrustum=m,A.owner=e(this._owner,this)}var P=a.passes;if(P.render&&(A.boundingVolume=this._boundingSphere,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.modelMatrix=this._computedModelMatrix,A.pass=m?f.TRANSLUCENT:f.OPAQUE,d.push(A)),P.pick){var M=this._pickCommand;if(n(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),b||T||!n(this._pickSP)){var I=p({defines:[this.onlySunLighting?"ONLY_SUN_LIGHTING":"",!m&&t.getFragmentDepth()?"WRITE_DEPTH":""],sources:[this.material.shaderSource,_],pickColorQualifier:"uniform"});this._pickSP=t.getShaderCache().replaceShaderProgram(this._pickSP,g,I,C),M.primitiveType=u.TRIANGLES,M.vertexArray=this._va,M.renderState=this._rs,M.shaderProgram=this._pickSP,M.uniformMap=i([this._uniforms,this._pickUniforms,this.material._uniforms],!1,!1),M.executeInClosestFrustum=m,M.owner=e(this._owner,this)}M.boundingVolume=this._boundingSphere,M.modelMatrix=this._computedModelMatrix,M.pass=m?f.TRANSLUCENT:f.OPAQUE,d.push(M)}}},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._sp=this._sp&&this._sp.release(),this._pickSP=this._pickSP&&this._pickSP.release(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},x}),r("DynamicScene/MaterialProperty",["../Core/defined","../Core/DeveloperError","../Scene/Material"],function(e,t,r){"use strict";function i(){throw new t("This type should not be instantiated directly.")}var n=i;return n.prototype.getType=i,n.prototype.getValue=i,n.prototype.equals=i,n.getValue=function(t,i,n){if(e(i)){var o=i.getType(t);e(o)&&(e(n)&&n.type===o||(n=r.fromType(o)),i.getValue(t,n.uniforms))}return n},n}),r("DynamicScene/DynamicEllipsoidVisualizer",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Cartesian3","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Scene/EllipsoidPrimitive","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(r,i,h){var m=h._ellipsoid;if(t(m)){var v=m._radii;if(t(v)){var y=h._position;if(t(y)){var g=h._orientation;if(t(g)){var _,w=m._show,C=h._ellipsoidVisualizerIndex,x=h.isAvailable(i)&&(!t(w)||w.getValue(i));if(!x)return t(C)&&(_=r._ellipsoidCollection[C],_.show=!1,h._ellipsoidVisualizerIndex=void 0,r._unusedIndexes.push(C)),void 0;if(t(C))_=r._ellipsoidCollection[C];else{var S=r._unusedIndexes,E=S.length;E>0?(C=S.pop(),_=r._ellipsoidCollection[C]):(C=r._ellipsoidCollection.length,_=new l,r._ellipsoidCollection.push(_),r._primitives.add(_)),h._ellipsoidVisualizerIndex=C,_.dynamicObject=h,_.material=u.fromType(u.ColorType)}_.show=!0,_.radii=v.getValue(i,_.radii),p=e(y.getValue(i,p),_._visualizerPosition),f=e(g.getValue(i,f),_._visualizerOrientation),!t(p)||!t(f)||n.equals(p,_._visualizerPosition)&&s.equals(f,_._visualizerOrientation)||(a.fromRotationTranslation(o.fromQuaternion(f,d),p,_.modelMatrix),_._visualizerPosition=n.clone(p,_._visualizerPosition),_._visualizerOrientation=s.clone(f,_._visualizerOrientation)),_.material=c.getValue(i,m._material,_.material)}}}}}var d=new o,m=function(e,i){if(!t(e))throw new r("scene is required.");this._scene=e,this._unusedIndexes=[],this._primitives=e.getPrimitives(),this._ellipsoidCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(i)};m.prototype.getScene=function(){return this._scene},m.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},m.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(m.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(m.prototype._onObjectsRemoved,this))},m.prototype.update=function(e){if(!t(e))throw new r("time is requied.");if(t(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=0,o=i.length;o>n;n++)h(this,e,i[n])},m.prototype.removeAllPrimitives=function(){var e,r;for(e=0,r=this._ellipsoidCollection.length;r>e;e++)this._primitives.remove(this._ellipsoidCollection[e]);if(t(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._ellipsoidVisualizerIndex=void 0}this._unusedIndexes=[],this._ellipsoidCollection=[]},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this.removeAllPrimitives(),i(this)};var p,f;return m.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._ellipsoidCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._ellipsoidVisualizerIndex;if(t(l)){var u=n[l];u.show=!1,o.push(l),s._ellipsoidVisualizerIndex=void 0}}},m}),r("Shaders/SensorVolume",[],function(){"use strict";return"uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nbool inSensorShadow(vec3 coneVertexWC, czm_ellipsoid ellipsoidEC, vec3 pointWC)\n{\nvec3 D = ellipsoidEC.inverseRadii;\nvec3 q = D * coneVertexWC;\nfloat qMagnitudeSquared = dot(q, q);\nfloat test = qMagnitudeSquared - 1.0;\nvec3 temp = D * pointWC - q;\nfloat d = dot(temp, q);\nreturn (d < -test) && (d / length(temp) < -sqrt(test));\n}\nvec4 getIntersectionColor()\n{\nreturn u_intersectionColor;\n}\nfloat getIntersectionWidth()\n{\nreturn u_intersectionWidth;\n}\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC)\n{\nfloat t = pointMC.z / sensorRadius;\nfloat s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\ns = s - floor(s);\nreturn vec2(s, t);\n}\n"}),r("Shaders/CustomSensorVolumeVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec3 normal;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\ngl_Position = czm_modelViewProjection * position;\nv_positionWC = (czm_model * position).xyz;\nv_positionEC = (czm_modelView * position).xyz;\nv_normalEC = czm_normal * normal;\n}\n"}),r("Shaders/CustomSensorVolumeFS",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_sensorRadius;\nuniform float u_normalDirection;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{\nczm_materialInput materialInput;\nvec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\nmaterialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\nmaterialInput.str = pointMC / sensorRadius;\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nvec3 normalEC = normalize(v_normalEC);\nmaterialInput.normalEC = u_normalDirection * normalEC;\nczm_material material = czm_getMaterial(materialInput);\nreturn mix(czm_phong(normalize(positionToEyeEC), material), vec4(material.diffuse, material.alpha), 0.4);\n}\nbool isOnBoundary(float value, float epsilon)\n{\nfloat width = getIntersectionWidth();\nfloat tolerance = width * epsilon;\n#ifdef GL_OES_standard_derivatives\nfloat delta = max(abs(dFdx(value)), abs(dFdy(value)));\nfloat pixels = width * delta;\nfloat temp = abs(value);\nreturn temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n#else\nreturn abs(value) < tolerance;\n#endif\n}\nvec4 shade(bool isOnBoundary)\n{\nif (u_showIntersection && isOnBoundary)\n{\nreturn getIntersectionColor();\n}\nreturn getColor(u_sensorRadius, v_positionEC);\n}\nfloat ellipsoidSurfaceFunction(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * point;\nreturn dot(scaled, scaled) - 1.0;\n}\nvoid main()\n{\nvec3 sensorVertexWC = czm_model[3].xyz;\nvec3 sensorVertexEC = czm_modelView[3].xyz;\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nfloat ellipsoidValue = ellipsoidSurfaceFunction(ellipsoid, v_positionWC);\nif (!u_showThroughEllipsoid)\n{\nif (ellipsoidValue < 0.0)\n{\ndiscard;\n}\nif (inSensorShadow(sensorVertexWC, ellipsoid, v_positionWC))\n{\ndiscard;\n}\n}\nif (distance(v_positionEC, sensorVertexEC) > u_sensorRadius)\n{\ndiscard;\n}\nbool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\ngl_FragColor = shade(isOnEllipsoid);\n}\n"}),r("Scene/CustomSensorVolume",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Color","../Core/combine","../Core/destroyObject","../Core/FAR","../Core/Cartesian3","../Core/Matrix4","../Core/ComponentDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Renderer/BufferUsage","../Renderer/BlendingState","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/CullFace","../Renderer/Pass","./Material","../Shaders/SensorVolume","../Shaders/CustomSensorVolumeVS","../Shaders/CustomSensorVolumeFS","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x){"use strict";function S(e){for(var t=e._directions,r=t.length,i=new Float32Array(3*r),n=isFinite(e.radius)?e.radius:a,o=[s.ZERO],l=r-2,u=r-1,c=0;r>c;l=u++,u=c++){var d=s.fromSpherical(t[l]),m=s.fromSpherical(t[u]),p=s.fromSpherical(t[c]),f=Math.max(s.angleBetween(d,m),s.angleBetween(m,p)),v=n/Math.cos(.5*f),y=s.multiplyByScalar(m,v);i[3*u]=y.x,i[3*u+1]=y.y,i[3*u+2]=y.z,o.push(y)}return h.fromPoints(o,e._boundingSphere),i}function E(e,t){for(var r=S(e),i=e._directions.length,n=new Float32Array(18*i),o=0,a=i-1,l=0;i>l;a=l++){var c=new s(r[3*a],r[3*a+1],r[3*a+2]),h=new s(r[3*l],r[3*l+1],r[3*l+2]),d=s.normalize(s.cross(h,c));n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z,n[o++]=h.x,n[o++]=h.y,n[o++]=h.z,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z,n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z}var m=t.createVertexBuffer(new Float32Array(n),e.bufferUsage),p=6*Float32Array.BYTES_PER_ELEMENT,f=[{index:b.position,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:u.FLOAT,offsetInBytes:0,strideInBytes:p},{index:b.normal,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:u.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p}];return t.createVertexArray(f)}var b={position:0,normal:1},T=function(r){r=e(r,e.EMPTY_OBJECT),this._pickId=void 0,this._pickIdThis=e(r._pickIdThis,this),this._frontFaceColorCommand=new p,this._backFaceColorCommand=new p,this._pickCommand=new p,this._boundingSphere=new h,this._boundingSphereWC=new h,this._frontFaceColorCommand.primitiveType=c.TRIANGLES,this._frontFaceColorCommand.boundingVolume=this._boundingSphereWC,this._frontFaceColorCommand.owner=this,this._backFaceColorCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._backFaceColorCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._backFaceColorCommand.owner=this,this._pickCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._pickCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._pickCommand.owner=this,this.show=e(r.show,!0),this.showIntersection=e(r.showIntersection,!0),this.showThroughEllipsoid=e(r.showThroughEllipsoid,!1),this._showThroughEllipsoid=this.showThroughEllipsoid,this.modelMatrix=l.clone(e(r.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this.bufferUsage=e(r.bufferUsage,d.STATIC_DRAW),this._bufferUsage=this.bufferUsage,this.radius=e(r.radius,Number.POSITIVE_INFINITY),this._directions=void 0,this._directionsDirty=!1,this.setDirections(r.directions),this.material=t(r.material)?r.material:g.fromType(g.ColorType),this._material=void 0,this._translucent=void 0,this.intersectionColor=i.clone(e(r.intersectionColor,i.WHITE)),this.intersectionWidth=e(r.intersectionWidth,5),this.id=r.id,this._id=void 0;var n=this;this._uniforms={u_showThroughEllipsoid:function(){return n.showThroughEllipsoid},u_showIntersection:function(){return n.showIntersection},u_sensorRadius:function(){return isFinite(n.radius)?n.radius:a},u_intersectionColor:function(){return n.intersectionColor},u_intersectionWidth:function(){return n.intersectionWidth},u_normalDirection:function(){return 1}},this._mode=x.SCENE3D};return T.prototype.setDirections=function(e){this._directions=e,this._directionsDirty=!0},T.prototype.getDirections=function(){return this._directions},T.prototype.update=function(e,i,o){if(this._mode=i.mode,this.show&&this._mode===x.SCENE3D){if(this.radius<0)throw new r("this.radius must be greater than or equal to zero.");if(!t(this.material))throw new r("this.material must be defined.");var a=this.material.isTranslucent();if(this._showThroughEllipsoid!==this.showThroughEllipsoid||!t(this._frontFaceColorCommand.renderState)||this._translucent!==a){this._showThroughEllipsoid=this.showThroughEllipsoid,this._translucent=a;var s;a?(s=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND,cull:{enabled:!0,face:v.BACK}}),this._frontFaceColorCommand.renderState=s,this._frontFaceColorCommand.pass=y.TRANSLUCENT,s=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND,cull:{enabled:!0,face:v.FRONT}}),this._backFaceColorCommand.renderState=s,this._backFaceColorCommand.pass=y.TRANSLUCENT,s=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND}),this._pickCommand.renderState=s):(s=e.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._frontFaceColorCommand.renderState=s,this._frontFaceColorCommand.pass=y.OPAQUE,s=e.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._pickCommand.renderState=s)}var u=this._directionsDirty||this._bufferUsage!==this.bufferUsage;if(u){this._directionsDirty=!1,this._bufferUsage=this.bufferUsage,this._va=this._va&&this._va.destroy();var c=this._directions;c&&c.length>=3&&(this._frontFaceColorCommand.vertexArray=E(this,e),this._backFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray,this._pickCommand.vertexArray=this._frontFaceColorCommand.vertexArray)}if(t(this._frontFaceColorCommand.vertexArray)){var d=i.passes,p=!l.equals(this.modelMatrix,this._modelMatrix);p&&l.clone(this.modelMatrix,this._modelMatrix),(u||p)&&h.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC),this._frontFaceColorCommand.modelMatrix=this.modelMatrix,this._backFaceColorCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix,this._pickCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix;var g=this._material!==this.material;if(this._material=this.material,this._material.update(e),d.render){var S=this._frontFaceColorCommand,T=this._backFaceColorCommand;if(g||!t(S.shaderProgram)){var A=f({sources:[_,this._material.shaderSource,C]});S.shaderProgram=e.getShaderCache().replaceShaderProgram(S.shaderProgram,w,A,b),S.uniformMap=n([this._uniforms,this._material._uniforms],!1,!1),T.shaderProgram=S.shaderProgram,T.uniformMap=n([this._uniforms,this._material._uniforms],!1,!1),T.uniformMap.u_normalDirection=function(){return-1}}a?o.push(this._backFaceColorCommand,this._frontFaceColorCommand):o.push(this._frontFaceColorCommand)}if(d.pick){var D=this._pickCommand;if(t(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=e.createPickId({primitive:this._pickIdThis,id:this.id})),g||!t(D.shaderProgram)){var P=f({sources:[_,this._material.shaderSource,C],pickColorQualifier:"uniform"});D.shaderProgram=e.getShaderCache().replaceShaderProgram(D.shaderProgram,w,P,b);var M=this;D.uniformMap=n([this._uniforms,this._material._uniforms,{czm_pickColor:function(){return M._pickId.color}}],!1,!1)}D.pass=a?y.TRANSLUCENT:y.OPAQUE,o.push(D)}}}},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._frontFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray&&this._frontFaceColorCommand.vertexArray.destroy(),this._frontFaceColorCommand.shaderProgram=this._frontFaceColorCommand.shaderProgram&&this._frontFaceColorCommand.shaderProgram.release(),this._pickCommand.shaderProgram=this._pickCommand.shaderProgram&&this._pickCommand.shaderProgram.release(),this._pickId=this._pickId&&this._pickId.destroy(),o(this)},T}),r("DynamicScene/DynamicConeVisualizerUsingCustomSensor",["../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Quaternion","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Spherical","../Scene/CustomSensorVolume","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,t,i,n){var o=t[e];r(o)||(t[e]=o=new u),o.clock=i,o.cone=n,o.magnitude=1}function p(e,t,r,i,n){var o,s=0,l=a.toRadians(2);if(0===e&&t===a.TWO_PI)for(o=0;oo;o+=l)m(s++,n,o,i);if(m(s++,n,t,i),r){for(o=t;o>e;o-=l)m(s++,n,o,r);m(s++,n,e,r)}else m(s++,n,t,0)}return n.length=s,n}function f(i,n,u){var m=u._cone;if(r(m)){var f=u._position;if(r(f)){var y=u._orientation;if(r(y)){var w,C=m._show,x=u._coneVisualizerIndex,S=u.isAvailable(n)&&(!r(C)||C.getValue(n));if(!S)return r(x)&&(w=i._coneCollection[x],w.show=!1,u._coneVisualizerIndex=void 0,i._unusedIndexes.push(x)),void 0;if(r(x))w=i._coneCollection[x];else{var E=i._unusedIndexes,b=E.length;b>0?(x=E.pop(),w=i._coneCollection[x]):(x=i._coneCollection.length,w=new c,w._directionsScratch=[],i._coneCollection.push(w),i._primitives.add(w)),u._coneVisualizerIndex=x,w.dynamicObject=u,w.material=h.fromType(h.ColorType),w.intersectionColor=t.clone(t.YELLOW),w.intersectionWidth=5,w.radius=Number.POSITIVE_INFINITY,w.showIntersection=!0}w.show=!0;var T,A=m._minimumClockAngle;r(A)&&(T=A.getValue(n)),r(T)||(T=0);var D;A=m._maximumClockAngle,r(A)&&(D=A.getValue(n)),r(D)||(D=a.TWO_PI);var P;A=m._innerHalfAngle,r(A)&&(P=A.getValue(n)),r(P)||(P=0);var M;if(A=m._outerHalfAngle,r(A)&&(M=A.getValue(n)),r(M)||(M=Math.PI),(T!==w.minimumClockAngle||D!==w.maximumClockAngle||P!==w.innerHalfAngle||M!==w.outerHalfAngle)&&(w.setDirections(p(T,D,P,M,w._directionsScratch)),w.innerHalfAngle=P,w.maximumClockAngle=D,w.outerHalfAngle=M,w.minimumClockAngle=T),A=m._radius,r(A)){var I=A.getValue(n);r(I)&&(w.radius=I)}var O=f.getValue(n,g),R=y.getValue(n,_);if(!r(O)||!r(R)||e.equals(O,w._visualizerPosition)&&o.equals(R,w._visualizerOrientation)||(l.fromRotationTranslation(s.fromQuaternion(R,v),O,w.modelMatrix),w._visualizerPosition=e.clone(O,w._visualizerPosition),w._visualizerOrientation=o.clone(R,w._visualizerOrientation)),w.material=d.getValue(n,m._outerMaterial,w.material),A=m._intersectionColor,r(A)&&A.getValue(n,w.intersectionColor),A=m._intersectionWidth,r(A)){var L=A.getValue(n);r(L)&&(w.intersectionWidth=L)}}}}}var v=new s,y=function(e,t){if(!r(e))throw new n("scene is required.");this._scene=e,this._unusedIndexes=[],this._primitives=e.getPrimitives(),this._coneCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};y.prototype.getScene=function(){return this._scene},y.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},y.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(y.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(y.prototype._onObjectsRemoved,this))},y.prototype.update=function(e){if(!r(e))throw new n("time is requied.");if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,o=t.length;o>i;i++)f(this,e,t[i])},y.prototype.removeAllPrimitives=function(){var e,t;for(e=0,t=this._coneCollection.length;t>e;e++)this._primitives.remove(this._coneCollection[e]);if(r(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._coneVisualizerIndex=void 0}this._unusedIndexes=[],this._coneCollection=[]},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return this.removeAllPrimitives(),i(this)};var g=new e,_=new o;return y.prototype._onObjectsRemoved=function(e,t,i){for(var n=this._coneCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._coneVisualizerIndex;if(r(l)){var u=n[l];u.show=!1,o.push(l),s._coneVisualizerIndex=void 0}}},y}),r("Scene/Label",["../Core/defaultValue","../Core/DeveloperError","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/NearFarScalar","./Billboard","./LabelStyle","./HorizontalOrigin","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function d(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}var m=function(a,s){if(a=e(a,e.EMPTY_OBJECT),o(a.translucencyByDistance)&&a.translucencyByDistance.far<=a.translucencyByDistance.near)throw new t("translucencyByDistance.far must be greater than translucencyByDistance.near.");if(o(a.pixelOffsetScaleByDistance)&&a.pixelOffsetScaleByDistance.far<=a.pixelOffsetScaleByDistance.near)throw new t("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");this._text=e(a.text,""),this._show=e(a.show,!0),this._font=e(a.font,"30px sans-serif"),this._fillColor=n.clone(e(a.fillColor,n.WHITE)),this._outlineColor=n.clone(e(a.outlineColor,n.BLACK)),this._outlineWidth=e(a.outlineWidth,1),this._style=e(a.style,l.FILL),this._verticalOrigin=e(a.verticalOrigin,c.BOTTOM),this._horizontalOrigin=e(a.horizontalOrigin,u.LEFT),this._pixelOffset=r.clone(e(a.pixelOffset,r.ZERO)),this._eyeOffset=i.clone(e(a.eyeOffset,i.ZERO)),this._position=i.clone(e(a.position,i.ZERO)),this._scale=e(a.scale,1),this._id=a.id,this._translucencyByDistance=a.translucencyByDistance,this._pixelOffsetScaleByDistance=a.pixelOffsetScaleByDistance,this._labelCollection=s,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0};return m.prototype.getShow=function(){return this._show},m.prototype.setShow=function(e){if(!o(e))throw new t("value is required.");if(e!==this._show){this._show=e;for(var r=this._glyphs,i=0,n=r.length;n>i;i++){var a=r[i];o(a.billboard)&&a.billboard.setShow(e)}}},m.prototype.getPosition=function(){return this._position},m.prototype.setPosition=function(e){if(!o(e))throw new t("value is required.");var r=this._position;if(!i.equals(r,e)){i.clone(e,r);for(var n=this._glyphs,a=0,s=n.length;s>a;a++){var l=n[a];o(l.billboard)&&l.billboard.setPosition(e)}}},m.prototype.getText=function(){return this._text},m.prototype.setText=function(e){if(!o(e))throw new t("value is required.");e!==this._text&&(this._text=e,h(this))},m.prototype.getFont=function(){return this._font},m.prototype.setFont=function(e){if(!o(e))throw new t("value is required.");this._font!==e&&(this._font=e,h(this))},m.prototype.getFillColor=function(){return this._fillColor},m.prototype.setFillColor=function(e){if(!o(e))throw new t("value is required.");var r=this._fillColor;n.equals(r,e)||(n.clone(e,r),h(this))},m.prototype.getOutlineColor=function(){return this._outlineColor},m.prototype.setOutlineColor=function(e){if(!o(e))throw new t("value is required.");var r=this._outlineColor;n.equals(r,e)||(n.clone(e,r),h(this))},m.prototype.getOutlineWidth=function(){return this._outlineWidth},m.prototype.setOutlineWidth=function(e){if(!o(e))throw new t("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,h(this))},m.prototype.getStyle=function(){return this._style},m.prototype.setStyle=function(e){if(!o(e))throw new t("value is required.");this._style!==e&&(this._style=e,h(this))},m.prototype.getPixelOffset=function(){return this._pixelOffset},m.prototype.setPixelOffset=function(e){if(!o(e))throw new t("value is required.");var i=this._pixelOffset;r.equals(i,e)||(r.clone(e,i),d(this))},m.prototype.getTranslucencyByDistance=function(){return this._translucencyByDistance},m.prototype.setTranslucencyByDistance=function(e){if(!a.equals(this._translucencyByDistance,e)){if(e.far<=e.near)throw new t("far distance must be greater than near distance.");this._translucencyByDistance=a.clone(e,this._translucencyByDistance),h(this)}},m.prototype.getPixelOffsetScaleByDistance=function(){return this._pixelOffsetScaleByDistance},m.prototype.setPixelOffsetScaleByDistance=function(e){if(!a.equals(this._pixelOffsetScaleByDistance,e)){if(e.far<=e.near)throw new t("far distance must be greater than near distance.");this._pixelOffsetScaleByDistance=a.clone(e,this._pixelOffsetScaleByDistance),h(this)}},m.prototype.getEyeOffset=function(){return this._eyeOffset},m.prototype.setEyeOffset=function(e){if(!o(e))throw new t("value is required.");var r=this._eyeOffset;if(!i.equals(r,e)){i.clone(e,r);for(var n=this._glyphs,a=0,s=n.length;s>a;a++){var l=n[a];o(l.billboard)&&l.billboard.setEyeOffset(e)}}},m.prototype.getHorizontalOrigin=function(){return this._horizontalOrigin},m.prototype.setHorizontalOrigin=function(e){if(!o(e))throw new t("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,d(this))},m.prototype.getVerticalOrigin=function(){return this._verticalOrigin},m.prototype.setVerticalOrigin=function(e){if(!o(e))throw new t("value is required.");this._verticalOrigin!==e&&(this._verticalOrigin=e,d(this))},m.prototype.getScale=function(){return this._scale},m.prototype.getId=function(){return this._id},m.prototype.setScale=function(e){if(!o(e))throw new t("value is required.");if(this._scale!==e){this._scale=e;for(var r=this._glyphs,i=0,n=r.length;n>i;i++){var a=r[i];o(a.billboard)&&a.billboard.setScale(e)}d(this)}},m.prototype.computeScreenSpacePosition=function(e,r){if(!o(e))throw new t("context is required.");if(!o(r))throw new t("frameState is required.");var i=this._labelCollection,n=i.modelMatrix,a=s._computeActualPosition(this._position,r,n);return s._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,r)},m.prototype.equals=function(e){return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._text===e._text&&this._font===e._font&&i.equals(this._position,e._position)&&n.equals(this._fillColor,e._fillColor)&&n.equals(this._outlineColor,e._outlineColor)&&r.equals(this._pixelOffset,e._pixelOffset)&&i.equals(this._eyeOffset,e._eyeOffset)&&a.equals(this._translucencyByDistance,e._translucencyByDistance)&&a.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&this._id===e._id},m.prototype.isDestroyed=function(){return!1},m}),r("Scene/LabelCollection",["../Core/defaultValue","../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Cartesian2","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./Label","./LabelStyle","./HorizontalOrigin","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function m(e,t,r){this.labelCollection=e,this.index=t,this.dimensions=r}function p(e,t,r,i,n,o,s){return _.font=t,_.fillColor=r,_.strokeColor=i,_.strokeWidth=n,_.textBaseline=s===h.BOTTOM?"bottom":s===h.TOP?"top":"middle",_.fill=o===u.FILL||o===u.FILL_AND_OUTLINE,_.stroke=o===u.OUTLINE||o===u.FILL_AND_OUTLINE,a(e,_)}function f(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;r(i)&&(i.setShow(!1),i.setImageIndex(-1),i._pickId=i._pickId&&i._pickId.destroy(),e._spareBillboards.push(i),t.billboard=void 0)}function v(e,t){var i,n,o,a=t._text,s=a.length,l=t._glyphs,u=l.length;if(u>s)for(n=s;u>n;++n)f(e,l[n]);l.length=s;var h=e._glyphTextureCache,v=e._textureAtlas;for(o=0;s>o;++o){var y=a.charAt(o),g=t._font,_=t._fillColor,w=t._outlineColor,C=t._outlineWidth,x=t._style,S=t._verticalOrigin,E=JSON.stringify([y,g,_.toRgba(),w.toRgba(),C,+x,+S]),b=h[E];if(!r(b)){var T=p(y,g,_,w,C,x,S),A=-1;T.width>0&&T.height>0&&(A=v.addImage(T)),b=new m(e,A,T.dimensions),h[E]=b}if(i=l[o],r(i)?-1===b.index?f(e,i):r(i.textureInfo)&&(i.textureInfo=void 0):(i=new d,l[o]=i),i.textureInfo=b,i.dimensions=b.dimensions,-1!==b.index){var D=i.billboard;r(D)||(i.billboard=D=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add(),D.setShow(t._show),D.setPosition(t._position),D.setEyeOffset(t._eyeOffset),D.setPixelOffset(t._pixelOffset),D.setHorizontalOrigin(c.LEFT),D.setVerticalOrigin(t._verticalOrigin),D.setScale(t._scale),D._pickIdThis=t,D._id=t._id),i.billboard.setImageIndex(b.index),i.billboard.setTranslucencyByDistance(t._translucencyByDistance),i.billboard.setPixelOffsetScaleByDistance(t._pixelOffsetScaleByDistance)}}t._repositionAllGlyphs=!0}function y(e){var t,i,n=e._glyphs,o=0,a=0,s=0,l=n.length;for(s=0;l>s;++s)t=n[s],i=t.dimensions,o+=i.width,a=Math.max(a,i.height);var u=e._scale,d=e._horizontalOrigin,m=0;d===c.CENTER?m-=o/2*u:d===c.RIGHT&&(m-=o*u),w.x=m,w.y=0;var p=e._verticalOrigin;for(s=0;l>s;++s)t=n[s],i=t.dimensions,p===h.BOTTOM||i.height===a?w.y=-i.descent*u:p===h.TOP?w.y=-(a-i.height)*u-i.descent*u:p===h.CENTER&&(w.y=-(a-i.height)/2*u-i.descent*u),r(t.billboard)&&t.billboard._setTranslate(w),w.x+=i.width*u -}function g(e,t){for(var r=t._glyphs,n=0,o=r.length;o>n;++n)f(e,r[n]);t._labelCollection=void 0,i(t)}var _={},w=new n,C=function(t){t=e(t,e.EMPTY_OBJECT),this._textureAtlas=void 0,this._billboardCollection=new s,this._billboardCollection.setDestroyTextureAtlas(!1),this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this.modelMatrix=o.clone(e(t.modelMatrix,o.IDENTITY)),this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1)};return C.prototype.add=function(e){var t=new l(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},C.prototype.remove=function(e){if(r(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),g(this,e),!0}return!1},C.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;r>t;++t)g(this,e[t]);e.length=0},C.prototype.contains=function(e){return r(e)&&e._labelCollection===this},C.prototype.get=function(e){if(!r(e))throw new t("index is required.");return this._labels[e]},C.prototype.getLength=function(){return this._labels.length},C.prototype.update=function(e,t,i){var n=this._billboardCollection;n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume,r(this._textureAtlas)||(this._textureAtlas=e.createTextureAtlas(),n.setTextureAtlas(this._textureAtlas));for(var o=this._labelsToUpdate,a=0,s=o.length;s>a;++a){var l=o[a];if(!l.isDestroyed()){var u=l._glyphs.length;l._rebindAllGlyphs&&(v(this,l),l._rebindAllGlyphs=!1),l._repositionAllGlyphs&&(y(l),l._repositionAllGlyphs=!1);var c=l._glyphs.length-u;this._totalGlyphCount+=c}}o.length=0,n.update(e,t,i)},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),i(this)},C}),r("DynamicScene/DynamicLabelVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/HorizontalOrigin","../Scene/VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r,a){var c=a._label;if(t(c)){var h=c._text;if(t(h)){var y=a._position;if(t(y)){var g,_=c._show,w=a._labelVisualizerIndex,C=a.isAvailable(r)&&(!t(_)||_.getValue(r));if(!C)return t(w)&&(g=e._labelCollection.get(w),g.setShow(!1),e._unusedIndexes.push(w),a._labelVisualizerIndex=void 0),void 0;if(t(w))g=e._labelCollection.get(w);else{var x=e._unusedIndexes,S=x.length;S>0?(w=x.pop(),g=e._labelCollection.get(w)):(w=e._labelCollection.getLength(),g=e._labelCollection.add()),a._labelVisualizerIndex=w,g.dynamicObject=a,g.setText(""),g.setScale(1),g.setFont("30px sans-serif"),g.setFillColor(i.WHITE),g.setOutlineColor(i.BLACK),g.setOutlineWidth(1),g.setStyle(s.FILL),g.setPixelOffset(n.ZERO),g.setEyeOffset(o.ZERO),g.setHorizontalOrigin(l.CENTER),g.setVerticalOrigin(u.CENTER)}g.setShow(C);var E=h.getValue(r);t(E)&&g.setText(E),d=y.getValue(r,d),t(d)&&g.setPosition(d);var b=c._scale;if(t(b)){var T=b.getValue(r);t(T)&&g.setScale(T)}if(b=c._font,t(b)){var A=b.getValue(r);t(A)&&g.setFont(A)}if(b=c._fillColor,t(b)&&(m=b.getValue(r,m),t(m)&&g.setFillColor(m)),b=c._outlineColor,t(b)&&(p=b.getValue(r,p),t(p)&&g.setOutlineColor(p)),b=c._outlineWidth,t(b)){var D=b.getValue(r);t(D)&&g.setOutlineWidth(D)}if(b=c._style,t(b)){var P=b.getValue(r);t(P)&&g.setStyle(P)}if(b=c._pixelOffset,t(b)&&(v=b.getValue(r,v),t(v)&&g.setPixelOffset(v)),b=c._eyeOffset,t(b)&&(f=b.getValue(r,f),t(f)&&g.setEyeOffset(f)),b=c._horizontalOrigin,t(b)){var M=b.getValue(r);t(M)&&g.setHorizontalOrigin(M)}if(b=c._verticalOrigin,t(b)){var I=b.getValue(r);t(I)&&g.setVerticalOrigin(I)}b=c._translucencyByDistance,t(b)&&g.setTranslucencyByDistance(b.getValue(r)),b=c._pixelOffsetScaleByDistance,t(b)&&g.setPixelOffsetScaleByDistance(b.getValue(r))}}}}var h=function(r,i){if(!t(r))throw new e("scene is required.");this._scene=r,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;var n=this._labelCollection=new a;r.getPrimitives().add(n),this.setDynamicObjectCollection(i)};h.prototype.getScene=function(){return this._scene},h.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},h.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(h.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(h.prototype._onObjectsRemoved,this))},h.prototype.update=function(r){if(!t(r))throw new e("time is requied.");if(t(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=0,o=i.length;o>n;n++)c(this,r,i[n])},h.prototype.removeAllPrimitives=function(){if(this._unusedIndexes=[],this._labelCollection.removeAll(),t(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),r=e.length-1;r>-1;r--)e[r]._labelVisualizerIndex=void 0},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this.removeAllPrimitives(),this._scene.getPrimitives().remove(this._labelCollection),r(this)};var d,m,p,f,v;return h.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._labelCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._labelVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),o.push(l),s._labelVisualizerIndex=void 0}}},h}),r("Scene/Polyline",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/BoundingSphere","../Core/Color","../Core/PolylinePipeline","../Core/Matrix4","./Material"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r){++e._propertiesChanged[r];var i=e._polylineCollection;t(i)&&(i._updatePolyline(e,r),e._dirty=!0)}var u={},c=function(r,l){r=e(r,u),this._show=e(r.show,!0),this._width=e(r.width,1),this._material=r.material,t(this._material)||(this._material=s.fromType(s.ColorType),this._material.uniforms.color=new n(1,1,1,1));var c=r.positions;t(c)||(c=[]),this._positions=c,this._length=c.length,this._id=r.id;var h;t(l)&&(h=a.clone(l.modelMatrix)),this._modelMatrix=h,this._segments=o.wrapLongitude(c,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(v),this._polylineCollection=l,this._dirty=!1,this._pickId=void 0,this._pickIdThis=r._pickIdThis,this._boundingVolume=i.fromPoints(this._positions),this._boundingVolumeWC=i.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new i},h=c.SHOW_INDEX=0,d=c.WIDTH_INDEX=1,m=c.POSITION_INDEX=2,p=c.MATERIAL_INDEX=3,f=c.POSITION_SIZE_INDEX=4,v=c.NUMBER_OF_PROPERTIES=5;return c.prototype.getShow=function(){return this._show},c.prototype.setShow=function(e){if(!t(e))throw new r("value is required.");e!==this._show&&(this._show=e,l(this,h))},c.prototype.getPositions=function(){return this._positions},c.prototype.setPositions=function(e){if(!t(e))throw new r("value is required.");(this._positions.length!==e.length||this._positions.length!==this._length)&&l(this,f),this._positions=e,this._length=e.length,this._boundingVolume=i.fromPoints(this._positions,this._boundingVolume),this._boundingVolumeWC=i.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),l(this,m),this.update()},c.prototype.update=function(){var e=a.IDENTITY;t(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,n=this._segments.lengths,s=this._propertiesChanged[m]>0||this._propertiesChanged[f]>0;if((!a.equals(e,this._modelMatrix)||s)&&(this._segments=o.wrapLongitude(this._positions,e),this._boundingVolumeWC=i.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==r)l(this,f);else for(var u=n.length,c=0;u>c;++c)if(n[c]!==this._segments.lengths[c]){l(this,f);break}},c.prototype.getMaterial=function(){return this._material},c.prototype.setMaterial=function(e){if(!t(e))throw new r("material is required.");this._material!==e&&(this._material=e,l(this,p))},c.prototype.getWidth=function(){return this._width},c.prototype.setWidth=function(e){if(!t(e))throw new r("value is required.");var i=this._width;e!==i&&(this._width=e,l(this,d))},c.prototype.getId=function(){return this._id},c.prototype.getPickId=function(r){return t(this._pickId)||(this._pickId=r.createPickId({primitive:e(this._pickIdThis,this),id:this._id})),this._pickId},c.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;v-1>t;++t)e[t]=0},c.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},c}),r("Shaders/PolylineCommon",[],function(){"use strict";return"const vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvoid clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(normalize(previous.xyz - position.xyz), vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(normalize(next.xyz - position.xyz), vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_highResolutionSnapScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),r("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),r("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),r("Scene/PolylineCollection",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Color","../Core/destroyObject","../Core/Cartesian3","../Core/Cartesian4","../Core/EncodedCartesian3","../Core/Matrix4","../Core/Math","../Core/ComponentDatatype","../Core/IndexDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Core/Intersect","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","./Material","./SceneMode","./Polyline","../Shaders/PolylineCommon","../Shaders/PolylineVS","../Shaders/PolylineFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b){"use strict";function T(e,r,i,n,o,a,s){for(var l=n.length,u=0,c=!0,h=e._vertexArrays,p=e.debugShowBoundingVolume,f=h.length,v=0;f>v;++v)for(var g=h[v],w=g.buckets,x=w.length,S=0;x>S;++S){for(var E,b,T,A=w[S],D=A.offset,M=s?A.bucket.shaderProgram:A.bucket.pickShaderProgram,I=A.bucket.polylines,O=I.length,R=0,L=0;O>L;++L){var z=I[L],N=P(z._material);if(N!==E){if(t(E)&&R>0){var B=b.isTranslucent();u>=l?(T=new y,T.owner=e,n.push(T)):T=n[u],++u,T.boundingVolume=m.clone(j,T.boundingVolume),T.modelMatrix=a,T.primitiveType=d.TRIANGLES,T.shaderProgram=M,T.vertexArray=g.va,T.renderState=B?e._translucentRS:e._opaqueRS,T.pass=B?_.TRANSLUCENT:_.OPAQUE,T.debugShowBoundingVolume=s?p:!1,T.uniformMap=b._uniforms,T.count=R,T.offset=D,D+=R,R=0,c=!0,o.push(T)}b=z._material,b.update(r),E=N}for(var F=z._locatorBuckets,V=F.length,k=0;V>k;++k){var U=F[k];U.locator===A&&(R+=U.count)}var W;i.mode===C.SCENE3D?W=z._boundingVolumeWC:i.mode===C.COLUMBUS_VIEW?W=z._boundingVolume2D:i.mode===C.SCENE2D?t(z._boundingVolume2D)&&(W=m.clone(z._boundingVolume2D,Y),W.center.x=0):t(z._boundingVolumeWC)&&t(z._boundingVolume2D)&&(W=m.union(z._boundingVolumeWC,z._boundingVolume2D,Y)),c?(c=!1,m.clone(W,j)):m.union(W,j,j)}t(E)&&R>0&&(u>=l?(T=new y,T.owner=e,n.push(T)):T=n[u],++u,T.boundingVolume=m.clone(j,T.boundingVolume),T.modelMatrix=a,T.primitiveType=d.TRIANGLES,T.shaderProgram=M,T.vertexArray=g.va,T.renderState=b.isTranslucent()?e._translucentRS:e._opaqueRS,T.pass=b.isTranslucent()?_.TRANSLUCENT:_.OPAQUE,T.debugShowBoundingVolume=s?p:!1,T.uniformMap=b._uniforms,T.count=R,T.offset=D,c=!0,o.push(T)),E=void 0}n.length=u}function A(e){for(var t=e._buffersUsage,r=!1,i=e._propertiesChanged,n=0;q-2>n;++n){var o=t[n];i[n]?o.bufferUsage!==v.STREAM_DRAW?(r=!0,o.bufferUsage=v.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==v.STATIC_DRAW&&(0===o.frameCount?(r=!0,o.bufferUsage=v.STATIC_DRAW):o.frameCount--)}return r}function D(e,r){e._createVertexArray=!1,R(e),L(e),M(e);var i,n,o=[[]],a=o[0],s=[0],l=0,d=[[]],m=0,p=e._polylineBuckets;for(i in p)p.hasOwnProperty(i)&&(n=p[i],n.updateShader(r),m+=n.lengthOfPositions);if(m>0){var f,y=e._mode,g=new Float32Array(3*6*m),_=new Uint8Array(4*m),w=new Float32Array(4*m),x=0,S=0,E=0;for(i in p)if(p.hasOwnProperty(i)){n=p[i],n.write(g,_,w,x,S,E,r),y===C.MORPHING&&(t(f)||(f=new Float32Array(3*6*m)),n.writeForMorph(f,x));var b=n.lengthOfPositions;x+=3*6*b,S+=4*b,E+=4*b,l=n.updateIndices(o,s,d,l)}var T=e._buffersUsage[k].bufferUsage,A=e._buffersUsage[F].bufferUsage,D=e._buffersUsage[V].bufferUsage,P=A===v.STREAM_DRAW||D===v.STREAM_DRAW?v.STREAM_DRAW:v.STATIC_DRAW;e._positionBuffer=r.createVertexBuffer(g,T);var I;t(f)&&(I=r.createVertexBuffer(f,T)),e._pickColorBuffer=r.createVertexBuffer(_,v.STATIC_DRAW),e._texCoordExpandWidthAndShowBuffer=r.createVertexBuffer(w,P);for(var O=4*Uint8Array.BYTES_PER_ELEMENT,z=3*Float32Array.BYTES_PER_ELEMENT,N=4*Float32Array.BYTES_PER_ELEMENT,B=0,U=o.length,W=0;U>W;++W)if(a=o[W],a.length>0){var q=new Uint16Array(a),H=r.createIndexBuffer(q,v.STATIC_DRAW,h.UNSIGNED_SHORT);B+=s[W];var j,Y,Z,J,K=6*(W*z*u.SIXTY_FOUR_KILOBYTES-B*z),Q=z+K,$=z+Q,et=z+$,tt=z+et,rt=z+tt,it=W*O*u.SIXTY_FOUR_KILOBYTES-B*O,nt=W*N*u.SIXTY_FOUR_KILOBYTES-B*N,ot=[{index:G.position3DHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:K,strideInBytes:6*z},{index:G.position3DLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:Q,strideInBytes:6*z},{index:G.position2DHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:K,strideInBytes:6*z},{index:G.position2DLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:Q,strideInBytes:6*z},{index:G.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:$,strideInBytes:6*z},{index:G.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:et,strideInBytes:6*z},{index:G.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:$,strideInBytes:6*z},{index:G.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:et,strideInBytes:6*z},{index:G.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:tt,strideInBytes:6*z},{index:G.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:rt,strideInBytes:6*z},{index:G.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:tt,strideInBytes:6*z},{index:G.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,offsetInBytes:rt,strideInBytes:6*z},{index:G.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:c.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:nt},{index:G.pickColor,componentsPerAttribute:4,componentDatatype:c.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:it,normalize:!0}];y===C.SCENE3D?(j=e._positionBuffer,Y="vertexBuffer",Z=X,J="value"):y===C.SCENE2D||y===C.COLUMBUS_VIEW?(j=X,Y="value",Z=e._positionBuffer,J="vertexBuffer"):(j=I,Y="vertexBuffer",Z=e._positionBuffer,J="vertexBuffer"),ot[0][Y]=j,ot[1][Y]=j,ot[2][J]=Z,ot[3][J]=Z,ot[4][Y]=j,ot[5][Y]=j,ot[6][J]=Z,ot[7][J]=Z,ot[8][Y]=j,ot[9][Y]=j,ot[10][J]=Z,ot[11][J]=Z;var at=r.createVertexArray(ot,H);e._vertexArrays.push({va:at,buckets:d[W]})}}}function P(e){var t=w._uniformList[e.type],r=t.length;Z.length=2*r;for(var i=0,n=0;r>n;++n){var o=t[n];Z[i]=o,Z[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(Z)}function M(e){for(var r=e._mode,i=e._projection,n=e._modelMatrix,o=e._polylineBuckets={},a=e._polylines,s=a.length,l=0;s>l;++l){var u=a[l];if(u.getPositions().length>1){u.update();var c=u.getMaterial(),h=o[c.type];t(h)||(h=o[c.type]=new J(c,r,i,n)),h.addPolyline(u)}}}function I(e,t){var r=t.mode,i=t.scene2D.projection;e._mode===r&&e._projection===i&&l.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._projection=i,e._modelMatrix=l.clone(e.modelMatrix),e._createVertexArray=!0)}function O(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var r=[],i=e._polylines.length,n=0,o=0;i>n;++n){var a=e._polylines[n];t(a)&&(a._index=o++,r.push(a))}e._polylines=r}}function R(e){for(var r=e._polylines,i=r.length,n=0;i>n;++n)if(t(r[n])){var o=r[n]._bucket;t(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.release())}}function L(e){for(var t=e._vertexArrays.length,r=0;t>r;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function z(e){for(var r=e._polylines,i=r.length,n=0;i>n;++n)t(r[n])&&r[n]._destroy()}function N(e,t,r){this.count=e,this.offset=t,this.bucket=r}function B(e){return o.dot(o.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersect(a.UNIT_Y)===p.INTERSECTING}var F=x.SHOW_INDEX,V=x.WIDTH_INDEX,k=x.POSITION_INDEX,U=x.MATERIAL_INDEX,W=x.POSITION_SIZE_INDEX,q=x.NUMBER_OF_PROPERTIES,G={texCoordExpandWidthAndShow:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12,pickColor:13},H=function(t){t=e(t,e.EMPTY_OBJECT),this.modelMatrix=l.clone(e(t.modelMatrix,l.IDENTITY)),this._modelMatrix=l.clone(l.IDENTITY),this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(q),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:v.STATIC_DRAW,frameCount:0},{bufferUsage:v.STATIC_DRAW,frameCount:0},{bufferUsage:v.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0};H.prototype.add=function(e){var t=new x(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},H.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,t(e._bucket)){var r=e._bucket;r.shaderProgram=r.shaderProgram&&r.shaderProgram.release(),r.pickShaderProgram=r.pickShaderProgram&&r.pickShaderProgram.release()}return e._destroy(),!0}return!1},H.prototype.removeAll=function(){R(this),z(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},H.prototype.contains=function(e){return t(e)&&e._polylineCollection===this},H.prototype.get=function(e){if(!t(e))throw new r("index is required.");return O(this),this._polylines[e]},H.prototype.getLength=function(){return O(this),this._polylines.length},H.prototype.update=function(e,r,i){if(O(this),0!==this._polylines.length){I(this,r);var n,o=this._propertiesChanged;if(this._createVertexArray||A(this))D(this,e);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==C.SCENE3D)for(var s=a.length,u=0;s>u;++u)n=a[u],n.update();if(o[W]||o[U])D(this,e);else for(var c=a.length,h=this._polylineBuckets,d=0;c>d;++d){n=a[d],o=n._propertiesChanged;var m=n._bucket,p=0;for(var v in h)if(h.hasOwnProperty(v)){if(h[v]===m){(o[k]||o[F]||o[V])&&m.writeUpdate(p,n,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer);break}p+=h[v].lengthOfPositions}n._clean()}a.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var y=0;q>y;++y)o[y]=0;var g=l.IDENTITY;r.mode===C.SCENE3D&&(g=this.modelMatrix);var _=r.passes,w=0!==r.morphTime;if(t(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===w||(this._opaqueRS=e.createRenderState({depthMask:w,depthTest:{enabled:w}})),t(this._translucentRS)&&this._translucentRS.depthTest.enabled===w||(this._translucentRS=e.createRenderState({blending:f.ALPHA_BLEND,depthMask:!w,depthTest:{enabled:w}})),_.render){var x=this._colorCommands;T(this,e,r,x,i,g,!0)}if(_.pick){var S=this._pickCommands;T(this,e,r,S,i,g,!1)}}};var j=new m,Y=new m;H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return L(this),R(this),z(this),n(this)};var X=[0,0,0],Z=[];H.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};var J=function(e,t,r,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.projection=r,this.ellipsoid=r.getEllipsoid(),this.modelMatrix=i};J.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},J.prototype.updateShader=function(e){if(!t(this.shaderProgram)){var r=g({sources:[S,E]}),i=g({sources:[this.material.shaderSource,b]}),n=g({sources:[i],pickColorQualifier:"varying"});this.shaderProgram=e.getShaderCache().getShaderProgram(r,i,G),this.pickShaderProgram=e.getShaderCache().getShaderProgram(r,n,G)}},J.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===C.SCENE3D||!B(e))return t=e.getPositions().length,4*t-4;var r=0,i=e._segments.lengths;t=i.length;for(var n=0;t>n;++n)r+=4*i[n]-4;return r};var K=new o,Q=new o,$=new o,et=new o;J.prototype.write=function(e,t,r,n,a,l,u){for(var c=this.mode,h=this.polylines,d=h.length,m=0;d>m;++m)for(var p,f=h[m],v=f.getWidth(),y=f.getShow()&&v>0,g=this.getSegments(f),_=g.positions,w=g.lengths,x=_.length,S=f.getPickId(u).color,E=0,b=0,T=0;x>T;++T){0===T?(p=et,o.subtract(_[0],_[1],p),o.add(_[0],p,p)):p=_[T-1],Q.x=p.x,Q.y=p.y,Q.z=c!==C.SCENE2D?p.z:0,p=_[T],K.x=p.x,K.y=p.y,K.z=c!==C.SCENE2D?p.z:0,T===x-1?(p=et,o.subtract(_[x-1],_[x-2],p),o.add(_[x-1],p,p)):p=_[T+1],$.x=p.x,$.y=p.y,$.z=c!==C.SCENE2D?p.z:0;var A=w[E];T===b+A&&(b+=A,++E);for(var D=0===T-b,P=T===b+w[E]-1,M=D?2:0,I=P?2:4,O=M;I>O;++O){s.writeElements(K,e,n),s.writeElements(Q,e,n+6),s.writeElements($,e,n+12),t[a]=i.floatToByte(S.red),t[a+1]=i.floatToByte(S.green),t[a+2]=i.floatToByte(S.blue),t[a+3]=i.floatToByte(S.alpha);var R=0>O-2?-1:1;r[l]=T/(x-1),r[l+1]=2*(O%2)-1,r[l+2]=R*v,r[l+3]=y,n+=18,a+=4,l+=4}}};var tt=new o,rt=new o,it=new o,nt=new o;J.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,i=this.polylines,n=i.length,a=0;n>a;++a)for(var u=i[a],c=u._segments.positions,h=u._segments.lengths,d=c.length,m=0,p=0,f=0;d>f;++f){var v;0===f?(v=nt,o.subtract(c[0],c[1],v),o.add(c[0],v,v)):v=c[f-1],v=l.multiplyByPoint(r,v,rt);var y,g=l.multiplyByPoint(r,c[f],tt);f===d-1?(y=nt,o.subtract(c[d-1],c[d-2],y),o.add(c[d-1],y,y)):y=c[f+1],y=l.multiplyByPoint(r,y,it);var _=h[m];f===p+_&&(p+=_,++m);for(var w=0===f-p,C=f===p+h[m]-1,x=w?2:0,S=C?2:4,E=x;S>E;++E)s.writeElements(g,e,t),s.writeElements(v,e,t+6),s.writeElements(y,e,t+12),t+=18}};var ot=new Array(1);J.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new N(0,i,this);r[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var c=this.polylines,h=c.length,d=0;h>d;++d){var m=c[d];m._locatorBuckets=[];var p;if(this.mode===C.SCENE3D){p=ot;var f=m.getPositions().length;if(!(f>0))continue;p[0]=f}else p=m._segments.lengths;var v=p.length;if(v>0){for(var y=0,g=0;v>g;++g)for(var _=p[g]-1,w=0;_>w;++w)l+4>=u.SIXTY_FOUR_KILOBYTES-1&&(m._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,i=0,o=new N(0,0,this),r[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),y+=6,a+=6,i+=6,l+=4;m._locatorBuckets.push({locator:o,count:y}),l+4>=u.SIXTY_FOUR_KILOBYTES-1&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new N(0,0,this),r[++n]=[o])}m._clean()}return o.count=a,i},J.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,r=0,i=t.length,n=0;i>n;++n){var o=t[n];if(o===e)break;r+=o._actualLength}return r};var at={positions:void 0,lengths:void 0},st=new Array(1);return J.prototype.getSegments=function(e){var t=e.getPositions();if(this.mode===C.SCENE3D)return st[0]=t.length,at.positions=t,at.lengths=st,at;B(e)&&(t=e._segments.positions);for(var r,i,n=this.ellipsoid,a=this.projection,s=[],u=this.modelMatrix,c=t.length,h=0;c>h;++h)r=t[h],i=l.multiplyByPoint(u,r),s.push(a.project(n.cartesianToCartographic(i)));if(s.length>0){e._boundingVolume2D=m.fromPoints(s,e._boundingVolume2D);var d=e._boundingVolume2D.center;e._boundingVolume2D.center=new o(d.z,d.x,d.y)}return at.positions=s,at.lengths=e._segments.lengths,at},J.prototype.writeUpdate=function(e,t,r,i){var n=this.mode,a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);var l,u=new Float32Array(3*6*a),c=new Float32Array(4*a),h=0,d=0,m=this.getSegments(t),p=m.positions,f=m.lengths,v=0,y=0,g=t.getWidth(),_=t.getShow()&&g>0;a=p.length;for(var w=0;a>w;++w){0===w?(l=et,o.subtract(p[0],p[1],l),o.add(p[0],l,l)):l=p[w-1],Q.x=l.x,Q.y=l.y,Q.z=n!==C.SCENE2D?l.z:0,l=p[w],K.x=l.x,K.y=l.y,K.z=n!==C.SCENE2D?l.z:0,w===a-1?(l=et,o.subtract(p[a-1],p[a-2],l),o.add(p[a-1],l,l)):l=p[w+1],$.x=l.x,$.y=l.y,$.z=n!==C.SCENE2D?l.z:0;var x=f[v];w===y+x&&(y+=x,++v);for(var S=0===w-y,E=w===y+f[v]-1,b=S?2:0,T=E?2:4,A=b;T>A;++A){s.writeElements(K,u,h),s.writeElements(Q,u,h+6),s.writeElements($,u,h+12);var D=0>A-2?-1:1;c[d]=w/(a-1),c[d+1]=2*(A%2)-1,c[d+2]=D*g,c[d+3]=_,h+=18,d+=4}}r.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),i.copyFromArrayView(c,4*Float32Array.BYTES_PER_ELEMENT*e)}},H}),r("DynamicScene/DynamicPathVisualizer",["../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Cartesian3","../Core/Matrix3","../Core/Matrix4","../Core/Color","../Core/Transforms","../Core/ReferenceFrame","./SampledPositionProperty","./CompositePositionProperty","./TimeIntervalCollectionPositionProperty","../Scene/Material","../Scene/SceneMode","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(t,r,i,n,o,a,s,l){var u,c=t._property._times,h=s;u=t.getValueInReferenceFrame(r,o,l[h]),e(u)&&(l[h++]=u);for(var d,m,p,f=!e(n)||n.lessThanOrEquals(r)||n.greaterThanOrEquals(i),v=0,y=c.length,g=c[v],_=i,w=!1;y>v;){if(!f&&g.greaterThanOrEquals(n)&&(u=t.getValueInReferenceFrame(n,o,l[h]),e(u)&&(l[h++]=u),f=!0),g.greaterThan(r)&&g.lessThan(_)&&!g.equals(n)&&(u=t.getValueInReferenceFrame(g,o,l[h]),e(u)&&(l[h++]=u)),y-1>v){if(!w){var C=c[v+1],x=g.getSecondsDifference(C);w=x>a,w&&(d=Math.floor(x/a),m=0,p=x/Math.max(d,2),d=Math.max(d-2,1))}if(w&&d>m){g=g.addSeconds(p),m++;continue}}w=!1,v++,g=c[v]}return u=t.getValueInReferenceFrame(i,o,l[h]),e(u)&&(l[h++]=u),h}function v(t,r,i,n,o,a,s,l){for(var u,c=0,h=s,d=r,m=!e(n)||n.lessThanOrEquals(r)||n.greaterThanOrEquals(i);d.lessThan(i);)!m&&d.greaterThanOrEquals(n)&&(m=!0,u=t.getValueInReferenceFrame(n,o,l[h]),e(u)&&(l[h]=u,h++)),u=t.getValueInReferenceFrame(d,o,l[h]),e(u)&&(l[h]=u,h++),c++,d=r.addSeconds(a*c);return u=t.getValueInReferenceFrame(i,o,l[h]),e(u)&&(l[h]=u,h++),h}function y(t,r,i,n,o,a,s,l){for(var u=s,c=t.getIntervals(),h=0;h0?(h=E.pop(),o=this._polylineCollection.get(h)):(h=this._polylineCollection.getLength(),o=this._polylineCollection.add()),r._pathVisualizerIndex=h,o.dynamicObject=r,o.setWidth(1);var T=o.getMaterial();e(T)&&T.type===d.PolylineOutlineType||(T=d.fromType(d.PolylineOutlineType),o.setMaterial(T)),S=T.uniforms,a.clone(a.WHITE,S.color),a.clone(a.BLACK,S.outlineColor),S.outlineWidth=0}o.setShow(!0);var A=60;if(s=i._resolution,e(s)&&(A=s.getValue(t)),o.setPositions(_(n,l,u,t,this._referenceFrame,A,o.getPositions())),s=i._color,e(s)&&(S.color=s.getValue(t,S.color)),s=i._outlineColor,e(s)&&(S.outlineColor=s.getValue(t,S.outlineColor)),s=i._outlineWidth,e(s)&&(S.outlineWidth=s.getValue(t)),s=i._width,e(s)){var D=s.getValue(t);e(D)&&o.setWidth(D)}}}},C.prototype.removeObject=function(t){var r=t._pathVisualizerIndex;if(e(r)){var i=this._polylineCollection.get(r);i.setShow(!1),this._unusedIndexes.push(r),t._pathVisualizerIndex=void 0}},C.prototype.destroy=function(){return this._scene.getPrimitives().remove(this._polylineCollection),r(this)};var x=function(r,i){if(!e(r))throw new t("scene is required.");this._scene=r,this._updaters={},this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(i)};return x.prototype.getScene=function(){return this._scene},x.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},x.prototype.setDynamicObjectCollection=function(t){var r=this._dynamicObjectCollection;r!==t&&(e(r)&&(r.collectionChanged.removeEventListener(x.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=t,e(t)&&t.collectionChanged.addEventListener(x.prototype._onObjectsRemoved,this))},x.prototype.update=function(r){if(!e(r))throw new t("time is requied.");if(e(this._dynamicObjectCollection)){var i=this._updaters;for(var n in i)i.hasOwnProperty(n)&&i[n].update(r);for(var o=this._dynamicObjectCollection.getObjects(),a=0,s=o.length;s>a;a++){var u=o[a];if(e(u._path)){var c=u._position;if(e(c)){var h=u._pathUpdater,d=l.FIXED;this._scene.mode===m.SCENE3D&&(d=c._referenceFrame);var p=this._updaters[d];h===p&&e(p)?p.updateObject(r,u):(e(h)&&h.removeObject(u),e(p)||(p=new C(this._scene,d),p.update(r),this._updaters[d]=p),u._pathUpdater=p,e(p)&&p.updateObject(r,u))}}}}},x.prototype.removeAllPrimitives=function(){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].destroy();if(this._updaters={},e(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=i.length-1;n>-1;n--)i[n]._pathUpdater=void 0,i[n]._pathVisualizerIndex=void 0},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this.removeAllPrimitives(),r(this)},x.prototype._onObjectsRemoved=function(t,r,i){for(var n=i.length-1;n>-1;n--){var o=i[n],a=o._pathUpdater;e(a)&&a.removeObject(o)}},x}),r("DynamicScene/DynamicPointVisualizer",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/BillboardCollection","../Renderer/TextureAtlasBuilder"],function(e,t,r,i,n,o,a){"use strict";function s(i,n,o){var a=o._point;if(r(a)){var s=o._position;if(r(s)){var l,m=a._show,p=o._pointVisualizerIndex,f=o.isAvailable(n)&&(!r(m)||m.getValue(n));if(!f)return r(p)&&(l=i._billboardCollection.get(p),l.setShow(!1),l.setImageIndex(-1),o._pointVisualizerIndex=void 0,i._unusedIndexes.push(p)),void 0;var v=!1;if(r(p))l=i._billboardCollection.get(p);else{var y=i._unusedIndexes,g=y.length;g>0?(p=y.pop(),l=i._billboardCollection.get(p)):(p=i._billboardCollection.getLength(),l=i._billboardCollection.add()),o._pointVisualizerIndex=p,l.dynamicObject=o,l._visualizerColor=e.clone(e.WHITE,l._visualizerColor),l._visualizerOutlineColor=e.clone(e.BLACK,l._visualizerOutlineColor),l._visualizerOutlineWidth=0,l._visualizerPixelSize=1,v=!0}l.setShow(!0),c=s.getValue(n,c),r(c)&&l.setPosition(c);var _=a._color;if(r(_)&&(u=_.getValue(n,u),e.equals(l._visualizerColor,u)||(e.clone(u,l._visualizerColor),v=!0)),_=a._outlineColor,r(_)&&(h=_.getValue(n,h),e.equals(l._visualizerOutlineColor,h)||(e.clone(h,l._visualizerOutlineColor),v=!0)),_=a._outlineWidth,r(_)){var w=_.getValue(n);l._visualizerOutlineWidth!==w&&(l._visualizerOutlineWidth=w,v=!0)}if(_=a._pixelSize,r(_)){var C=_.getValue(n);l._visualizerPixelSize!==C&&(l._visualizerPixelSize=C,v=!0)}if(_=a._scaleByDistance,r(_)&&(d=_.getValue(n,d),r(d)&&l.setScaleByDistance(d)),v){var x=t(l._visualizerColor,e.WHITE).toCssColorString(),S=t(l._visualizerOutlineColor,e.BLACK).toCssColorString(),E=t(l._visualizerPixelSize,3),b=t(l._visualizerOutlineWidth,2),T=JSON.stringify([x,E,S,b]);i._textureAtlasBuilder.addTextureFromFunction(T,function(e,t){var r=document.createElement("canvas"),i=E+2*b;r.height=r.width=i;var n=r.getContext("2d");n.clearRect(0,0,i,i),0!==b&&(n.beginPath(),n.arc(i/2,i/2,i/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=S,n.fill()),n.beginPath(),n.arc(i/2,i/2,E/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=x,n.fill(),t(r)},function(e){l.setImageIndex(e)})}}}}var l=function(e,t){if(!r(e))throw new n("scene is required.");this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;var i=this._billboardCollection=new o,s=this._textureAtlas=e.getContext().createTextureAtlas();this._textureAtlasBuilder=new a(s),i.setTextureAtlas(s),e.getPrimitives().add(i),this.setDynamicObjectCollection(t)};l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(e){if(!r(e))throw new n("time is requied.");if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,o=t.length;o>i;i++)s(this,e,t[i])},l.prototype.removeAllPrimitives=function(){if(this._unusedIndexes=[],this._billboardCollection.removeAll(),r(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),t=e.length-1;t>-1;t--)e[t]._pointVisualizerIndex=void 0},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.removeAllPrimitives(),this._scene.getPrimitives().remove(this._billboardCollection),i(this)};var u,c,h,d;return l.prototype._onObjectsRemoved=function(e,t,i){for(var n=this._billboardCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._pointVisualizerIndex;if(r(l)){var u=n.get(l);u.setShow(!1),u.setImageIndex(-1),s._pointVisualizerIndex=void 0,o.push(l)}}},l}),r("Scene/Appearance",["../Core/clone","../Core/defaultValue","../Core/defined","../Renderer/BlendingState","../Renderer/CullFace","../Renderer/createShaderSource"],function(e,t,r,i,n,o){"use strict";var a=function(e){e=t(e,t.EMPTY_OBJECT),this.material=e.material,this.vertexShaderSource=e.vertexShaderSource,this.fragmentShaderSource=e.fragmentShaderSource,this.renderState=e.renderState,this.translucent=t(e.translucent,!0),this.closed=t(e.closed,!1)};return a.prototype.getFragmentShaderSource=function(){return o({defines:[this.flat?"FLAT":"",this.faceForward?"FACE_FORWARD":""],sources:[r(this.material)?this.material.shaderSource:"",this.fragmentShaderSource]})},a.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},a.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=i.ALPHA_BLEND):r.depthMask=!0,r},a.getDefaultRenderState=function(e,t){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=i.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:n.BACK}),r},a}),r("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC));\n#else\nnormalEC = normalize(normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/VertexFormat","./Material","./Appearance","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS"],function(e,t,r,i,n,o,a){"use strict";var s=function(r){r=e(r,e.EMPTY_OBJECT);var l=e(r.translucent,!0),u=e(r.aboveGround,!1);this.material=t(r.material)?r.material:i.fromType(i.ColorType),this.vertexShaderSource=e(r.vertexShaderSource,o),this.fragmentShaderSource=e(r.fragmentShaderSource,a),this.renderState=e(r.renderState,n.getDefaultRenderState(l,!u)),this.vertexFormat=s.VERTEX_FORMAT,this.flat=e(r.flat,!1),this.faceForward=e(r.faceForward,!1),this.translucent=l,this.closed=!1,this.aboveGround=u};return s.VERTEX_FORMAT=r.POSITION_AND_ST,s.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,s.prototype.isTranslucent=n.prototype.isTranslucent,s.prototype.getRenderState=n.prototype.getRenderState,s}),r("Renderer/VertexLayout",["../Core/Enumeration"],function(e){"use strict";var t={SEPARATE:new e(0,"SEPARATE"),INTERLEAVED:new e(1,"INTERLEAVED"),validate:function(e){return e===t.SEPARATE||e===t.INTERLEAVED}};return t}),r("Scene/PrimitivePipeline",["../Core/defined","../Core/defaultValue","../Core/Color","../Core/ComponentDatatype","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/Matrix4"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r){var i,n=!r,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(i=1;o>i;++i)if(!u.equals(a,e[i].modelMatrix)){n=!0;break}}if(n)for(i=0;o>i;++i)l.transformToWorldCoordinates(e[i]);else u.clone(e[0].modelMatrix,t)}function h(e,t){for(var n=e.length,o=0;n>o;++o){var a=e[o],l=a.geometry,u=l.attributes,c=u.position,h=4*(c.values.length/c.componentsPerAttribute);u.pickColor=new s({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(h)});for(var d=t[o],m=r.floatToByte(d.red),p=r.floatToByte(d.green),f=r.floatToByte(d.blue),v=r.floatToByte(d.alpha),y=u.pickColor.values,g=0;h>g;g+=4)y[g]=m,y[g+1]=p,y[g+2]=f,y[g+3]=v}}function d(t){var r,i=t.length,n=[],o=t[0].attributes;for(r in o)if(o.hasOwnProperty(r)){for(var a=o[r],s=!0,l=1;i>l;++l){var u=t[l].attributes[r];if(!e(u)||a.componentDatatype.value!==u.componentDatatype.value||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&n.push(r)}return n}function m(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],l=o.attributes,u=o.geometry,c=a.computeNumberOfVertices(u),h=t.length,d=0;h>d;++d){for(var m=t[d],p=l[m],f=p.componentDatatype,v=p.value,y=v.length,g=i.createTypedArray(f,c*y),_=0;c>_;++_)g.set(v,_*y);u.attributes[m]=new s({componentDatatype:f,componentsPerAttribute:y,normalize:p.normalize,values:g})}}function p(e){var t,r=e.instances,o=e.pickIds,a=e.projection,s=e.elementIndexUintSupported,u=e.allow3DOnly,p=e.allowPicking,f=e.vertexCacheOptimize,v=e.modelMatrix,y=r.length,g=r[0].geometry.primitiveType;for(t=1;y>t;++t)if(r[t].geometry.primitiveType!==g)throw new n("All instance geometries must have the same primitiveType.");if(c(r,v,u),!u)for(t=0;y>t;++t)l.wrapLongitude(r[t].geometry);p&&h(r,o);var _=d(r);if(m(r,_),f)for(t=0;y>t;++t)l.reorderForPostVertexCache(r[t].geometry),l.reorderForPreVertexCache(r[t].geometry);var w,C=l.combine(r),x=C.attributes;if(u)for(w in x)x.hasOwnProperty(w)&&x[w].componentDatatype.value===i.DOUBLE.value&&l.encodeAttribute(C,w,w+"3DHigh",w+"3DLow");else for(w in x)if(x.hasOwnProperty(w)&&x[w].componentDatatype.value===i.DOUBLE.value){var S=w+"3D",E=w+"2D";l.projectTo2D(C,w,S,E,a),l.encodeAttribute(C,S,S+"High",S+"Low"),l.encodeAttribute(C,E,E+"High",E+"Low")}return s?[C]:l.fitToUnsignedShortIndices(C)}function f(e,t,r){for(var n=[],o=e.attributes,a=r.length,s=0;a>s;++s){var l=r[s],u=o[l],c=u.componentDatatype;c.value===i.DOUBLE.value&&(c=i.FLOAT);var h=i.createTypedArray(c,u.values);n.push({index:t[l],componentDatatype:c,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:h}),delete o[l]}return n}function v(r,i,n){for(var o=[],s=d(r),l=r.length,u={},c={},h=0;l>h;++h)for(var m=r[h],p=a.computeNumberOfVertices(m.geometry),f=s.length,v=0;f>v;++v)for(var y=s[v],g=n[y],_=p;_>0;){for(var w,C=t(c[y],0),x=i[C],S=x.length,E=0;S>E&&(w=x[E],w.index!==g);++E);e(o[h])||(o[h]={}),e(o[h][y])||(o[h][y]={dirty:!1,value:m.attributes[y].value,indices:[]});var b,T=w.values.length/w.componentsPerAttribute,A=t(u[y],0);T>A+_?(b=_,o[h][y].indices.push({attribute:w,offset:A,count:b}),u[y]=A+_):(b=T-A,o[h][y].indices.push({attribute:w,offset:A,count:b}),u[y]=0,c[y]=C+1),_-=b}return o}function y(e){return{type:e.constructor.name,buffer:e.buffer}}function g(e){return new w[e.type](e.buffer)}if(!o.supportsTypedArrays())return{};var _={};_.combineGeometry=function(e){for(var t={instances:e.instances,pickIds:e.pickIds,ellipsoid:e.ellipsoid,projection:e.projection,elementIndexUintSupported:e.elementIndexUintSupported,allow3DOnly:e.allow3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:u.clone(e.modelMatrix)},r=p(t),i=l.createAttributeIndices(r[0]),n=t.instances,o=d(n),a=[],s=r.length,c=0;s>c;++c){var h=r[c];a.push(f(h,i,o))}var m=v(n,a,i);return{geometries:r,modelMatrix:t.modelMatrix,attributeIndices:i,vaAttributes:a,vaAttributeIndices:m}};var w={Int8Array:Int8Array,Uint8Array:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};return _.transferGeometry=function(t,r){var i,n=t.attributes;for(var o in n)n.hasOwnProperty(o)&&e(n[o])&&e(n[o].values)&&(i=n[o].values,r.indexOf(n[o].values.buffer)<0&&r.push(i.buffer),e(i.type)||(n[o].values=y(i)));e(t.indices)&&(i=t.indices,r.push(i.buffer),e(i.type)||(t.indices=y(t.indices)))},_.transferGeometries=function(e,t){for(var r=e.length,i=0;r>i;++i)_.transferGeometry(e[i],t)},_.transferPerInstanceAttributes=function(e,t){for(var r=e.length,i=0;r>i;++i)for(var n=e[i],o=n.length,a=0;o>a;++a){var s=n[a].values;t.push(s.buffer),n[a].values=y(s)}},_.transferInstances=function(e,t){for(var r=e.length,i=0;r>i;++i){var n=e[i];_.transferGeometry(n.geometry,t)}},_.receiveGeometry=function(t){var r=t.attributes;for(var i in r)r.hasOwnProperty(i)&&e(r[i])&&e(r[i].values)&&(r[i].values=g(r[i].values));e(t.indices)&&(t.indices=g(t.indices))},_.receiveGeometries=function(e){for(var t=e.length,r=0;t>r;++r)_.receiveGeometry(e[r])},_.receivePerInstanceAttributes=function(e){for(var t=e.length,r=0;t>r;++r)for(var i=e[r],n=i.length,o=0;n>o;++o)i[o].values=g(i[o].values)},_.receiveInstances=function(e){for(var t=e.length,r=0;t>r;++r){var i=e[r];_.receiveGeometry(i.geometry)}},_}),r("Scene/PrimitiveState",["../Core/Enumeration"],function(e){"use strict";var t={READY:new e(0,"READY"),CREATING:new e(1,"CREATING"),CREATED:new e(2,"CREATED"),COMBINING:new e(3,"COMBINING"),COMBINED:new e(4,"COMBINED"),COMPLETE:new e(5,"COMPLETE"),FAILED:new e(6,"FAILED")};return t}),r("Scene/Primitive",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/destroyObject","../Core/Matrix4","../Core/BoundingSphere","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/ComponentDatatype","../Core/TaskProcessor","../Core/GeographicProjection","../Core/clone","../Renderer/BufferUsage","../Renderer/VertexLayout","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/CullFace","../Renderer/Pass","./PrimitivePipeline","./PrimitiveState","./SceneMode","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b){"use strict";function T(e){return new l({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function A(e){var r=e.attributes,i=new u;for(var n in r)r.hasOwnProperty(n)&&t(r[n])&&(i[n]=T(r[n]));var o;if(t(e.indices)){var l=e.indices;o=new l.constructor(l)}return new s({attributes:i,indices:o,primitiveType:e.primitiveType,boundingSphere:a.clone(e.boundingSphere)})}function D(e){return new h({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function P(e,t){var r=e.attributes,i={};for(var n in r)r.hasOwnProperty(n)&&(i[n]=D(r[n]));return new c({geometry:t,modelMatrix:o.clone(e.modelMatrix),attributes:i})}function M(e,t){for(var r,i="",n="",o="";null!==(r=F.exec(t));){var a=r[1],s="vec4 czm_compute"+a[0].toUpperCase()+a.substr(1)+"()";i+=s+";\n",e.allow3DOnly?o+=s+"\n"+"{\n"+" return czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow);\n"+"}\n\n":(n+="attribute vec3 "+a+"2DHigh;\n"+"attribute vec3 "+a+"2DLow;\n",o+=s+"\n"+"{\n"+" vec4 p;\n"+" if (czm_morphTime == 1.0)\n"+" {\n"+" p = czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow);\n"+" }\n"+" else if (czm_morphTime == 0.0)\n"+" {\n"+" p = czm_translateRelativeToEye("+a+"2DHigh.zxy, "+a+"2DLow.zxy);\n"+" }\n"+" else\n"+" {\n"+" p = czm_columbusViewMorph(\n"+" czm_translateRelativeToEye("+a+"2DHigh.zxy, "+a+"2DLow.zxy),\n"+" czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow),\n"+" czm_morphTime);\n"+" }\n"+" return p;\n"+"}\n\n")}return _({sources:[i,n,t,o]})}function I(e){var t=e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),r="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+r}function O(e,r){if(!t(e._attributeIndices.show))return r;var i=r.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_non_show_main()"),n="attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}";return i+"\n"+n}function R(e,r){var n=e.getVertexAttributes();for(var o in n)if(n.hasOwnProperty(o)&&!t(r[o]))throw new i("Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '"+o+"', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.")}function L(r,i,n){for(var o=[],a=n.length,s=0;a>s;++s){var l={primitive:e(n[s].pickPrimitive,i)};t(n[s].id)&&(l.id=n[s].id);var u=r.createPickId(l);i._pickIds.push(u),o.push(u.color)}return o}function z(e,t){return function(){return t[e].value}}function N(e,r,n){return function(o){if(!t(o)||!t(o.length)||o.length<1||o.length>4)throw new i("value must be and array with length between 1 and 4.");var a=r[e];a.value=o,a.dirty||(n.push(a),a.dirty=!0)}}var B=function(t){t=e(t,e.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this.appearance=t.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=o.clone(o.IDENTITY),this._modelMatrix=new o,this.show=e(t.show,!0),this.vertexCacheOptimize=e(t.vertexCacheOptimize,!1),this.releaseGeometryInstances=e(t.releaseGeometryInstances,!0),this.allow3DOnly=e(t.allow3DOnly,!1),this.allowPicking=e(t.allowPicking,!0),this.asynchronous=e(t.asynchronous,!0),this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._translucent=void 0,this._state=S.READY,this._createdGeometries=[],this._geometries=[],this._vaAttributes=void 0,this._error=void 0,this._boundingSphere=void 0,this._boundingSphereWC=void 0,this._boundingSphereCV=void 0,this._boundingSphere2D=void 0,this._perInstanceAttributeIndices=void 0,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._dirtyAttributes=[],this._va=[],this._attributeIndices=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[]},F=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g,V=new m("taskDispatcher",Number.POSITIVE_INFINITY);return B.prototype.update=function(e,r,i){if(!(!this.show||!t(this.geometryInstances)&&0===this._va.length||t(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&0===this.geometryInstances.length||!t(this.appearance)||r.mode!==E.SCENE3D&&this.allow3DOnly||!r.passes.render&&!r.passes.pick)){var n,s,l,u,c,h,m,T,D,z,N,B,F,k=r.scene2D.projection,U=this.allowPicking,W=this;if(this._state!==S.COMPLETE&&this._state!==S.COMBINED)if(this.asynchronous){if(this._state===S.FAILED)throw this._error;if(this._state===S.READY){N=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],h=N.length;var q=[];for(m=0;h>m;++m)l=N[m].geometry,this._instanceIds.push(N[m].id),t(l.attributes)&&t(l.primitiveType)?this._createdGeometries.push({geometry:A(l),index:m}):q.push(V.scheduleTask({task:l._workerName,geometry:l,index:m}));this._state=S.CREATING,b.all(q,function(e){W._geometries=e,W._state=S.CREATED},function(e){W._error=e,W._state=S.FAILED})}else if(this._state===S.CREATED){for(N=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],B=new Array(N.length),F=this._geometries.concat(this._createdGeometries),h=F.length,m=0;h>m;++m)l=F[m],D=l.index,B[D]=P(N[D],l.geometry);h=B.length;var G=[];x.transferInstances(B,G),z=V.scheduleTask({task:"combineGeometry",instances:B,pickIds:U?L(e,this,N):void 0,ellipsoid:k.getEllipsoid(),isGeographic:k instanceof p,elementIndexUintSupported:e.getElementIndexUint(),allow3DOnly:this.allow3DOnly,allowPicking:U,vertexCacheOptimize:this.vertexCacheOptimize,modelMatrix:this.modelMatrix},G),this._state=S.COMBINING,b(z,function(e){x.receiveGeometries(e.geometries),x.receivePerInstanceAttributes(e.vaAttributes),W._geometries=e.geometries,W._attributeIndices=e.attributeIndices,W._vaAttributes=e.vaAttributes,W._perInstanceAttributeIndices=e.vaAttributeIndices,o.clone(e.modelMatrix,W.modelMatrix),W._state=S.COMBINED},function(e){W._error=e,W._state=S.FAILED})}}else{for(N=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],h=N.length,F=this._createdGeometries,m=0;h>m;++m)l=N[m].geometry,this._instanceIds.push(N[m].id),t(l.attributes)&&t(l.primitiveType)?F.push({geometry:A(l),index:m}):F.push({geometry:l.constructor.createGeometry(l),index:m});for(B=new Array(N.length),h=F.length,m=0;h>m;++m)l=F[m],D=l.index,B[D]=P(N[D],l.geometry);var H=x.combineGeometry({instances:B,pickIds:U?L(e,this,N):void 0,ellipsoid:k.getEllipsoid(),projection:k,elementIndexUintSupported:e.getElementIndexUint(),allow3DOnly:this.allow3DOnly,allowPicking:U,vertexCacheOptimize:this.vertexCacheOptimize,modelMatrix:this.modelMatrix});this._geometries=H.geometries,this._attributeIndices=H.attributeIndices,this._vaAttributes=H.vaAttributes,this._perInstanceAttributeIndices=H.vaAttributeIndices,o.clone(H.modelMatrix,this.modelMatrix),this._state=S.COMBINED}var j=this._attributeIndices;if(this._state===S.COMBINED){F=this._geometries;var Y=this._vaAttributes;this._boundingSphere=a.clone(F[0].boundingSphere);var X=[];for(h=F.length,m=0;h>m;++m){l=F[m],u=Y[m];var Z=u.length;for(T=0;Z>T;++T)c=u[T],c.vertexBuffer=e.createVertexBuffer(c.values,v.DYNAMIC_DRAW),delete c.values;X.push(e.createVertexArrayFromGeometry({geometry:l,attributeIndices:j,bufferUsage:v.STATIC_DRAW,vertexLayout:y.INTERLEAVED,vertexArrayAttributes:u}))}this._va=X,this._primitiveType=F[0].primitiveType,this.releaseGeometryInstances&&(this.geometryInstances=void 0),this._geomtries=void 0,this._createdGeometries=void 0,this._state=S.COMPLETE}if(this._state===S.COMPLETE){var J=this.appearance,K=J.material,Q=!1,$=!1;this._appearance!==J?(this._appearance=J,this._material=K,Q=!0,$=!0):this._material!==K&&(this._material=K,$=!0);var et=this._appearance.isTranslucent();this._translucent!==et&&(this._translucent=et,Q=!0),t(this._material)&&this._material.update(e);var tt=J.closed&&et;if(Q){var rt=J.getRenderState();if(tt){var it=f(rt,!1);it.cull={enabled:!0,face:w.BACK},this._frontFaceRS=e.createRenderState(it),it.cull.face=w.FRONT,this._backFaceRS=e.createRenderState(it)}else this._frontFaceRS=e.createRenderState(rt),this._backFaceRS=this._frontFaceRS;if(U)this._pickRS=this._backFaceRS;else{var nt=f(rt,!1);nt.colorMask={red:!1,green:!1,blue:!1,alpha:!1},this._pickRS=e.createRenderState(nt)}}if($){var ot=e.getShaderCache(),at=M(this,J.vertexShaderSource);at=O(this,at);var st=J.getFragmentShaderSource();if(this._sp=ot.replaceShaderProgram(this._sp,at,st,j),R(this._sp,j),U){var lt=_({sources:[st],pickColorQualifier:"varying"});this._pickSP=ot.replaceShaderProgram(this._pickSP,I(at),lt,j)}else this._pickSP=ot.getShaderProgram(at,st,j);R(this._pickSP,j)}var ut=this._colorCommands,ct=this._pickCommands;if(Q||$){var ht=t(K)?K._uniforms:void 0,dt=et?C.TRANSLUCENT:C.OPAQUE;ut.length=this._va.length*(tt?2:1),ct.length=this._va.length,h=ut.length;var mt=0,pt=0;for(m=0;h>m;++m)tt&&(n=ut[m],t(n)||(n=ut[m]=new g),n.owner=this,n.primitiveType=this._primitiveType,n.vertexArray=this._va[mt],n.renderState=this._backFaceRS,n.shaderProgram=this._sp,n.uniformMap=ht,n.pass=dt,++m),n=ut[m],t(n)||(n=ut[m]=new g),n.owner=this,n.primitiveType=this._primitiveType,n.vertexArray=this._va[mt],n.renderState=this._frontFaceRS,n.shaderProgram=this._sp,n.uniformMap=ht,n.pass=dt,s=ct[pt],t(s)||(s=ct[pt]=new g),s.owner=this,s.primitiveType=this._primitiveType,s.vertexArray=this._va[mt],s.renderState=this._pickRS,s.shaderProgram=this._pickSP,s.uniformMap=ht,s.pass=dt,++pt,++mt}if(this._dirtyAttributes.length>0){for(u=this._dirtyAttributes,h=u.length,m=0;h>m;++m){c=u[m];var ft=c.value,vt=c.indices,yt=vt.length;for(T=0;yt>T;++T){D=vt[T];for(var gt=D.offset,_t=D.count,wt=D.attribute,Ct=wt.componentDatatype,xt=wt.componentsPerAttribute,St=d.createTypedArray(Ct,_t*xt),Et=0;_t>Et;++Et)St.set(ft,Et*xt);var bt=gt*xt*Ct.sizeInBytes;wt.vertexBuffer.copyFromArrayView(St,bt)}c.dirty=!1}u.length=0}o.equals(this.modelMatrix,this._modelMatrix)||(o.clone(this.modelMatrix,this._modelMatrix),this._boundingSphereWC=a.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC),!this.allow3DOnly&&t(this._boundingSphere)&&(this._boundingSphereCV=a.projectTo2D(this._boundingSphereWC,k,this._boundingSphereCV),this._boundingSphere2D=a.clone(this._boundingSphereCV,this._boundingSphere2D),this._boundingSphere2D.center.x=0));var Tt;r.mode===E.SCENE3D?Tt=this._boundingSphereWC:r.mode===E.COLUMBUS_VIEW?Tt=this._boundingSphereCV:r.mode===E.SCENE2D&&t(this._boundingSphere2D)?Tt=this._boundingSphere2D:t(this._boundingSphereWC)&&t(this._boundingSphereCV)&&(Tt=a.union(this._boundingSphereWC,this._boundingSphereCV));var At=r.passes;if(At.render)for(h=ut.length,m=0;h>m;++m)ut[m].modelMatrix=this.modelMatrix,ut[m].boundingVolume=Tt,ut[m].debugShowBoundingVolume=this.debugShowBoundingVolume,i.push(ut[m]);if(At.pick)for(h=ct.length,m=0;h>m;++m)ct[m].modelMatrix=this.modelMatrix,ct[m].boundingVolume=Tt,i.push(ct[m])}}},B.prototype.getGeometryInstanceAttributes=function(e){if(!t(e))throw new i("id is required");if(!t(this._perInstanceAttributeIndices))throw new i("must call update before calling getGeometryInstanceAttributes");for(var n=-1,o=this._lastPerInstanceAttributeIndex,a=this._instanceIds,s=a.length,l=0;s>l;++l){var u=(o+l)%s;if(e===a[u]){n=u;break}}if(-1===n)return void 0;var c=this._perInstanceAttributeIndices[n],h={},d={},m=!1;for(var p in c)c.hasOwnProperty(p)&&(m=!0,d[p]={get:z(p,c),set:N(p,c,this._dirtyAttributes)});return m&&r(h,d),this._lastPerInstanceAttributeIndex=n,h},B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.release(),this._pickSP=this._pickSP&&this._pickSP.release();var r=this._va;for(e=r.length,t=0;e>t;++t)r[t].destroy();this._va=void 0;var i=this._pickIds;for(e=i.length,t=0;e>t;++t)i[t].destroy();return this._pickIds=void 0,n(this)},B}),r("Scene/Polygon",["../Core/DeveloperError","../Core/defaultValue","../Core/defined","../Core/Color","../Core/destroyObject","../Core/Math","../Core/Ellipsoid","../Core/GeometryInstance","../Core/PolygonGeometry","./EllipsoidSurfaceAppearance","./Primitive","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(n){n=t(n,t.EMPTY_OBJECT),this.ellipsoid=t(n.ellipsoid,a.WGS84),this._ellipsoid=void 0,this.granularity=t(n.granularity,o.RADIANS_PER_DEGREE),this._granularity=void 0,this.height=t(n.height,0),this._height=void 0,this.textureRotationAngle=t(n.textureRotationAngle,0),this._textureRotationAngle=void 0,this.show=t(n.show,!0);var s=h.fromType(h.ColorType);if(s.uniforms.color=new i(1,1,0,.5),this.material=t(n.material,s),this.id=n.id,this._id=void 0,this.asynchronous=t(n.asynchronous,!0),this.debugShowBoundingVolume=t(n.debugShowBoundingVolume,!1),this._positions=void 0,this._polygonHierarchy=void 0,this._createPrimitive=!1,this._primitive=void 0,r(n.positions)&&r(n.polygonHierarchy))throw new e("Either options.positions or options.polygonHierarchy can be provided, but not both.");r(n.positions)?this.setPositions(n.positions):r(n.polygonHierarchy)&&this.configureFromPolygonHierarchy(n.polygonHierarchy)};return d.prototype.getPositions=function(){return this._positions},d.prototype.setPositions=function(t){if(r(t)&&t.length<3)throw new e("At least three positions are required.");this._positions=t,this._polygonHierarchy=void 0,this._createPrimitive=!0},d.prototype.configureFromPolygonHierarchy=function(e){this._positions=void 0,this._polygonHierarchy=e,this._createPrimitive=!0},d.prototype.update=function(t,i,n){if(!r(this.ellipsoid))throw new e("this.ellipsoid must be defined."); -if(!r(this.material))throw new e("this.material must be defined.");if(this.granularity<0)throw new e("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&(this._createPrimitive||r(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){if(this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),!r(this._positions)&&!r(this._polygonHierarchy))return;var o;o=r(this._positions)?new s({geometry:l.fromPositions({positions:this._positions,height:this.height,vertexFormat:u.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}):new s({geometry:new l({polygonHierarchy:this._polygonHierarchy,height:this.height,vertexFormat:u.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}),this._primitive=new c({geometryInstances:o,appearance:new u({aboveGround:this.height>0}),asynchronous:this.asynchronous})}var a=this._primitive;a.debugShowBoundingVolume=this.debugShowBoundingVolume,a.appearance.material=this.material,a.update(t,i,n)}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},d}),r("DynamicScene/DynamicPolygonVisualizer",["../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Scene/Polygon","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,i){var s=i._polygon;if(t(s)){var l,c=s._show,h=i._ellipse,d=i._position,m=i._vertexPositions,p=i._polygonVisualizerIndex,f=i.isAvailable(r)&&(!t(c)||c.getValue(r)),v=t(m);if(!(f&&(v||t(h)&&t(d))))return t(p)&&(l=e._polygonCollection[p],l.show=!1,i._polygonVisualizerIndex=void 0,e._unusedIndexes.push(p)),void 0;if(t(p))l=e._polygonCollection[p];else{var y=e._unusedIndexes,g=y.length;g>0?(p=y.pop(),l=e._polygonCollection[p]):(p=e._polygonCollection.length,l=new n,l.asynchronous=!1,e._polygonCollection.push(l),e._primitives.add(l)),i._polygonVisualizerIndex=p,l.dynamicObject=i,l.material=o.fromType(o.ColorType)}l.show=!0;var _;_=v?m.getValue(r):h.getValue(r,d.getValue(r,u)),l._visualizerPositions!==_&&t(_)&&_.length>3&&(l.setPositions(_),l._visualizerPositions=_),l.material=a.getValue(r,s._material,l.material)}}var l=function(e,i){if(!t(e))throw new r("scene is required.");this._scene=e,this._unusedIndexes=[],this._primitives=e.getPrimitives(),this._polygonCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(i)};l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(e){if(!t(e))throw new r("time is requied.");if(t(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=0,o=i.length;o>n;n++)s(this,e,i[n])},l.prototype.removeAllPrimitives=function(){var e,r;for(e=0,r=this._polygonCollection.length;r>e;e++)this._primitives.remove(this._polygonCollection[e]);if(t(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._polygonVisualizerIndex=void 0}this._unusedIndexes=[],this._polygonCollection=[]},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.removeAllPrimitives(),i(this)};var u=new e;return l.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._polygonCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._polygonVisualizerIndex;if(t(l)){var u=n[l];u.show=!1,o.push(l),s._polygonVisualizerIndex=void 0}}},l}),r("DynamicScene/DynamicPolylineVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Cartesian3","./MaterialProperty","../Scene/Material","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,i){var a=i._polyline;if(t(a)){var s,l=a._show,c=i._ellipse,h=i._position,d=i._vertexPositions,m=i._polylineVisualizerIndex,p=i.isAvailable(r)&&(!t(l)||l.getValue(r));if(e._scene.getContext(),!(p&&(t(d)||t(c)&&t(h))))return t(m)&&(s=e._polylineCollection.get(m),s.setShow(!1),i._polylineVisualizerIndex=void 0,e._unusedIndexes.push(m)),void 0;if(t(m))s=e._polylineCollection.get(m);else{var f=e._unusedIndexes,v=f.length;v>0?(m=f.pop(),s=e._polylineCollection.get(m)):(m=e._polylineCollection.getLength(),s=e._polylineCollection.add()),i._polylineVisualizerIndex=m,s.dynamicObject=i,s.setWidth(1);var y=s.getMaterial();t(y)&&y.type===o.PolylineOutlineType||(y=o.fromType(o.PolylineOutlineType),s.setMaterial(y))}s.setShow(!0);var g;g=t(c)?c.getValue(r,h.getValue(r,u)):d.getValue(r),t(g)&&s._visualizerPositions!==g&&(s.setPositions(g),s._visualizerPositions=g);var _=a._material;if(t(_)&&s.setMaterial(n.getValue(r,_,s.getMaterial())),_=a._width,t(_)){var w=_.getValue(r);t(w)&&s.setWidth(w)}}}var l=function(r,i){if(!t(r))throw new e("scene is required.");this._scene=r,this._unusedIndexes=[],this._primitives=r.getPrimitives();var n=this._polylineCollection=new a;r.getPrimitives().add(n),this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(i)};l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(r){if(!t(r))throw new e("time is requied.");if(t(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=0,o=i.length;o>n;n++)s(this,r,i[n])},l.prototype.removeAllPrimitives=function(){var e;if(this._polylineCollection.removeAll(),t(this._dynamicObjectCollection)){var r=this._dynamicObjectCollection.getObjects();for(e=r.length-1;e>-1;e--)r[e]._polylineVisualizerIndex=void 0}this._unusedIndexes=[]},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.removeAllPrimitives(),this._scene.getPrimitives().remove(this._polylineCollection),r(this)};var u=new i;return l.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._polylineCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._polylineVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),o.push(l),s._polylineVisualizerIndex=void 0}}},l}),r("DynamicScene/DynamicPyramidVisualizer",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Cartesian3","../Core/Color","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Scene/CustomSensorVolume","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(r,i,d){var p=d._pyramid;if(t(p)){var y=p._directions;if(t(y)){var g=d._position;if(t(g)){var _=d._orientation;if(t(_)){var w,C=p._show,x=d._pyramidVisualizerIndex,S=d.isAvailable(i)&&(!t(C)||C.getValue(i));if(!S)return t(x)&&(w=r._pyramidCollection[x],w.show=!1,d._pyramidVisualizerIndex=void 0,r._unusedIndexes.push(x)),void 0;if(t(x))w=r._pyramidCollection[x];else{var E=r._unusedIndexes,b=E.length;b>0?(x=E.pop(),w=r._pyramidCollection[x]):(x=r._pyramidCollection.length,w=new u,r._pyramidCollection.push(w),r._primitives.add(w)),d._pyramidVisualizerIndex=x,w.dynamicObject=d,w.radius=Number.POSITIVE_INFINITY,w.showIntersection=!0,w.intersectionColor=o.YELLOW,w.intersectionWidth=5,w.material=c.fromType(c.ColorType)}w.show=!0;var T=y.getValue(i);t(T)&&w._visualizerDirections!==T&&(w.setDirections(T),w._visualizerDirections=T),f=e(g.getValue(i,f),w._visualizerPosition),v=e(_.getValue(i,v),w._visualizerOrientation),!t(f)||!t(v)||n.equals(f,w._visualizerPosition)&&l.equals(v,w._visualizerOrientation)||(s.fromRotationTranslation(a.fromQuaternion(v,m),f,w.modelMatrix),n.clone(f,w._visualizerPosition),l.clone(v,w._visualizerOrientation)),w.material=h.getValue(i,p._material,w.material);var A=p._intersectionColor;if(t(A)){var D=A.getValue(i,D);t(D)&&(w.intersectionColor=D)}if(A=p._intersectionWidth,t(A)){var P=A.getValue(i,P);t(P)&&(w.intersectionWidth=P)}if(A=p._radius,t(A)){var M=A.getValue(i,M);t(M)&&(w.radius=M)}}}}}}var m=new a,p=function(e,i){if(!t(e))throw new r("scene is required.");this._scene=e,this._unusedIndexes=[],this._primitives=e.getPrimitives(),this._pyramidCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(i)};p.prototype.getScene=function(){return this._scene},p.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},p.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(p.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(p.prototype._onObjectsRemoved,this))},p.prototype.update=function(e){if(!t(e))throw new r("time is requied.");if(t(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=0,o=i.length;o>n;n++)d(this,e,i[n])},p.prototype.removeAllPrimitives=function(){var e,r;for(e=0,r=this._pyramidCollection.length;r>e;e++)this._primitives.remove(this._pyramidCollection[e]);if(t(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._pyramidVisualizerIndex=void 0}this._unusedIndexes=[],this._pyramidCollection=[]},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this.removeAllPrimitives(),i(this)};var f,v;return p.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._pyramidCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._pyramidVisualizerIndex;if(t(l)){var u=n[l];u.show=!1,o.push(l),s._pyramidVisualizerIndex=void 0}}},p}),r("DynamicScene/DynamicVectorVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Cartesian3","../Core/Color","../Scene/Material","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,a){var s=a._vector;if(t(s)){var l,u=s._show,c=a._position,h=s._direction,d=s._length,m=a._vectorVisualizerIndex,p=a.isAvailable(r)&&(!t(u)||u.getValue(r));if(!(p&&t(h)&&t(c)&&t(d)))return t(m)&&(l=e._polylineCollection.get(m),l.setShow(!1),a._vectorVisualizerIndex=void 0,e._unusedIndexes.push(m)),void 0;var f;if(t(m))l=e._polylineCollection.get(m),f=l.getMaterial().uniforms;else{var v=e._unusedIndexes;v.length>0?(m=v.pop(),l=e._polylineCollection.get(m)):(m=e._polylineCollection.getLength(),l=e._polylineCollection.add(),l._visualizerPositions=[new i,new i]),a._vectorVisualizerIndex=m,l.dynamicObject=a,l.setWidth(1);var y=l.getMaterial();t(y)&&y.type===o.PolylineArrowType||(y=o.fromType(o.PolylineArrowType),l.setMaterial(y)),f=y.uniforms,n.clone(n.WHITE,f.color)}l.setShow(!0);var g=l._visualizerPositions,_=c.getValue(r,g[0]),w=h.getValue(r,g[1]),C=d.getValue(r);t(_)&&t(w)&&t(C)&&(i.add(_,i.multiplyByScalar(i.normalize(w,w),C,w),w),l.setPositions(g));var x=s._color;if(t(x)&&(f.color=x.getValue(r,f.color)),x=s._width,t(x)){var S=x.getValue(r);t(S)&&l.setWidth(S)}}}var l=function(r,i){if(!t(r))throw new e("scene is required.");this._scene=r,this._unusedIndexes=[],this._primitives=r.getPrimitives();var n=this._polylineCollection=new a;r.getPrimitives().add(n),this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(i)};return l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(r){if(!t(r))throw new e("time is requied.");if(t(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=0,o=i.length;o>n;n++)s(this,r,i[n])},l.prototype.removeAllPrimitives=function(){var e;if(this._polylineCollection.removeAll(),t(this._dynamicObjectCollection)){var r=this._dynamicObjectCollection.getObjects();for(e=r.length-1;e>-1;e--)r[e]._vectorVisualizerIndex=void 0}this._unusedIndexes=[]},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.removeAllPrimitives(),this._scene.getPrimitives().remove(this._polylineCollection),r(this)},l.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._polylineCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._vectorVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),o.push(l),s._vectorVisualizerIndex=void 0}}},l}),r("DynamicScene/VisualizerCollection",["../Core/defaultValue","../Core/defined","../Core/destroyObject"],function(e,t,r){"use strict";var i=function(e,r){this._visualizers=t(e)?e:[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(r)};return i.prototype.getVisualizers=function(){return this._visualizers.slice(0)},i.prototype.setVisualizers=function(r,i){i=e(i,!0);var n,o=this._visualizers;if(i)for(n=o.length-1;n>-1;n--){var a=o[n];-1===r.indexOf(a)&&a.destroy()}t(r)||(r=[]),this._visualizers=r;var s=this._dynamicObjectCollection;for(n=r.length-1;n>-1;n--)r[n].setDynamicObjectCollection(s)},i.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},i.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;if(t!==e){this._dynamicObjectCollection=e;for(var r=this._visualizers,i=r.length-1;i>-1;i--)r[i].setDynamicObjectCollection(e)}},i.prototype.update=function(e){for(var t=this._visualizers,r=t.length-1;r>-1;r--)t[r].update(e)},i.prototype.removeAllPrimitives=function(){for(var e=this._visualizers,t=e.length-1;t>-1;t--)e[t].removeAllPrimitives()},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(t){if(t=e(t,!0),this.removeAllPrimitives(),t)for(var i=this._visualizers,n=i.length-1;n>-1;n--)i[n].destroy();return r(this)},i}),r("DynamicScene/DataSourceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","./DynamicBillboardVisualizer","./DynamicEllipsoidVisualizer","./DynamicConeVisualizerUsingCustomSensor","./DynamicLabelVisualizer","./DynamicPathVisualizer","./DynamicPointVisualizer","./DynamicPolygonVisualizer","./DynamicPolylineVisualizer","./DynamicPyramidVisualizer","./DynamicVectorVisualizer","./VisualizerCollection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";var v=[o,a,s,l,c,h,d,m,u,p],y=function(r,o,a){if(!t(r))throw new i("scene is required.");if(!t(o))throw new i("dataSourceCollection is required.");this._eventHelper=new n,this._eventHelper.add(o.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(o.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=o,this._scene=r,this._timeVaryingSources=[],this._staticSourcesToUpdate=[],this._visualizersTypes=e(a,v).slice(0);for(var s=0,l=o.getLength();l>s;s++)this._onDataSourceAdded(o,o.get(s))};return y.prototype.getScene=function(){return this._scene},y.prototype.getVisualizerTypes=function(){return this._visualizersTypes.slice(0)},y.prototype.getDataSources=function(){return this._dataSourceCollection},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.getLength();i>t;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return r(this)},y.prototype.update=function(e){if(!t(e))throw new i("time is required.");var r,n=this._timeVaryingSources,o=n.length;for(r=0;o>r;r++)n[r]._visualizerCollection.update(e);var a=this._staticSourcesToUpdate;if(o=a.length,o>0){for(r=0;o>r;r++)a[r]._visualizerCollection.update(e);a.length=0}},y.prototype._onDataSourceAdded=function(e,t){for(var r=this._visualizersTypes,i=r.length,n=new Array(i),o=this._scene,a=0;i>a;a++)n[a]=new r[a](o);var s=new f(n,t.getDynamicObjectCollection());t._visualizerCollection=s,t.getChangedEvent().addEventListener(this._onDataSourceChanged,this),this._onDataSourceChanged(t)},y.prototype._onDataSourceRemoved=function(e,t){t.getChangedEvent().removeEventListener(this._onDataSourceChanged,this);var r=this._timeVaryingSources.indexOf(t);-1!==r&&this._timeVaryingSources.splice(r,1);var i=this._staticSourcesToUpdate.indexOf(t);-1!==i&&this._staticSourcesToUpdate.splice(i,1),t._visualizerCollection.destroy(),t._visualizerCollection=void 0},y.prototype._onDataSourceChanged=function(e){var t=this._timeVaryingSources.indexOf(e),r=this._staticSourcesToUpdate.indexOf(e);e.getIsTimeVarying()?(-1===t&&this._timeVaryingSources.push(e),-1!==r&&this._staticSourcesToUpdate.splice(r,1)):(-1===r&&this._staticSourcesToUpdate.push(e),-1!==t&&this._timeVaryingSources.splice(r,1))},y}),r("Scene/CameraColumbusViewMode",["../Core/Enumeration"],function(e){"use strict";var t={FREE:new e(0,"FREE"),LOCKED:new e(1,"LOCKED")};return t}),r("DynamicScene/DynamicObjectView",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Quaternion","../Core/Matrix3","../Core/Matrix4","../Core/Ellipsoid","../Core/Transforms","../Scene/CameraColumbusViewMode","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,r,i,a,s,l,u,c){var h,d=e.scene,m=d.mode!==e._mode;m?(e._mode=d.mode,e._screenSpaceCameraController.enableTranslate=!1,h=o.magnitude(a)):h=i?o.magnitude(a):r.position.z;var p=s.getValue(l,e._lastCartesian);if(t(p)){var f=u.cartesianToCartographic(p,e._lastCartographic);f.height=h,i||m?(r.controller.setPositionCartographic(f),r.up.z=0,o.normalize(r.up,r.up),r.right.z=0,o.normalize(r.right,r.right),n.clone(r.right,e._first2dUp)):r.position=c.project(f),e._lastDistance=r.frustum.right-r.frustum.left,n.clone(r.right,e._last2dUp)}}function v(e,r,n,a,s,l,c){g(e,r,n,a);var m=s.getValue(l,e._lastCartesian);if(t(m)){var p=!1,f=l.addSeconds(.01),v=s.getValue(f,S);if(t(v)&&!o.equalsEpsilon(m,v,i.EPSILON6)){var y,T=d.computeFixedToIcrfMatrix(l,w),A=d.computeFixedToIcrfMatrix(f,C);t(T)&&t(A)?y=u.transpose(T,x):(y=d.computeTemeToPseudoFixedMatrix(l,x),T=u.transpose(y,w),A=d.computeTemeToPseudoFixedMatrix(f,C),u.transpose(A,A));var D=E;o.normalize(m,D),o.normalize(v,v),u.multiplyByVector(T,D,D),u.multiplyByVector(A,v,v);var P=o.cross(D,v,b);if(!o.equalsEpsilon(P,o.ZERO,i.EPSILON6)){var M=o.cross(P,D,S);u.multiplyByVector(y,M,M),u.multiplyByVector(y,P,P),u.multiplyByVector(y,D,D),o.normalize(M,M),o.normalize(P,P),o.normalize(D,D);var I=_;I[0]=M.x,I[1]=M.y,I[2]=M.z,I[3]=0,I[4]=P.x,I[5]=P.y,I[6]=P.z,I[7]=0,I[8]=D.x,I[9]=D.y,I[10]=D.z,I[11]=0,I[12]=m.x,I[13]=m.y,I[14]=m.z,I[15]=0,r.transform=I,p=!0}}p||(r.transform=d.eastNorthUpToFixedFrame(m,c,_)),e._screenSpaceCameraController.setEllipsoid(h.UNIT_SPHERE);var O=r.position;o.clone(O,e._lastOffset),e._lastDistance=o.magnitude(O)}}function y(e,r,i,n,a,s,l,u){g(e,r,i,n);var d=a.getValue(s,e._lastCartesian);if(t(d)){var p=l.cartesianToCartographic(d,e._lastCartographic),f=u.project(p);T.x=f.z,T.y=f.x,T.z=f.y;var v=r.transform;c.setColumn(v,3,T,v);var y=e._screenSpaceCameraController;y.enableTranslate=!1,y.setEllipsoid(h.UNIT_SPHERE),y.columbusViewMode=m.LOCKED,r.controller.constrainedAxis=o.UNIT_Z;var _=r.position;o.clone(_,e._lastOffset),e._lastDistance=o.magnitude(_)}}function g(e,t,r,a){var s=e.scene;if(t.controller.constrainedAxis=o.UNIT_Z,r)t.controller.lookAt(a,o.ZERO,o.UNIT_Z);else if(s.mode!==e._mode){e._mode=s.mode;var c=e._first2dUp,h=e._last2dUp;if(!n.equals(c,h)){var d=Math.acos(c.x);c.y<0&&(d=i.TWO_PI-d);var m=Math.acos(h.x);h.y<0&&(m=i.TWO_PI-m),h.x=0,h.y=0,c.x=0,c.y=0;var p=m-d,f=l.fromAxisAngle(o.UNIT_Z,p,A);u.multiplyByVector(u.fromQuaternion(f,D),a,a)}o.multiplyByScalar(o.normalize(a,a),e._lastDistance,a),t.controller.lookAt(a,o.ZERO,o.UNIT_Z)}}var _=new c,w=new u,C=new u,x=new u,S=new o,E=new o,b=new o,T=new a(0,0,0,1),A=new l,D=new u,P=new o(1e4,-1e4,1e4),M=new o,I=function(t,r,i){this.dynamicObject=t,this.scene=r,this._lastScene=void 0,this.ellipsoid=e(i,h.WGS84),this._lastDynamicObject=void 0,this._mode=void 0,this._lastCartesian=new o,this._lastCartographic=new s,this._lastDistance=void 0,this._lastOffset=new o,this._offsetScratch=new o,this._first2dUp=new n,this._last2dUp=new n};return I.prototype.update=function(e){if(!t(e))throw new r("time is required.");var i=this.scene;if(!t(i))throw new r("DynamicObjectView.scene is required.");i!==this._lastScene&&(this._lastScene=i,this._screenSpaceCameraController=i.getScreenSpaceCameraController());var n=this.dynamicObject;if(!t(n))throw new r("DynamicObjectView.dynamicObject is required.");var a=this.ellipsoid;if(!t(a))throw new r("DynamicObjectView.ellipsoid is required.");var s=this.dynamicObject.position;if(!t(s))throw new r("dynamicObject.position is required.");var l=n!==this._lastDynamicObject,u=this._offsetScratch;if(l){this._lastDynamicObject=n;var c=this.dynamicObject.viewFrom;t(c)&&t(c.getValue(e,u))||o.clone(P,u);var h=this._first2dUp,d=this._last2dUp;h.x=h.y=0,d.x=d.y=0,o.clone(u,this._lastOffset),this._lastDistance=o.magnitude(u),o.equals(o.normalize(u,M),o.UNIT_Z)&&(u.y-=.01)}else t(this._lastOffset)?u=this._lastOffset:o.clone(P,u);var m=i.mode;m===p.SCENE2D?f(this,i.getCamera(),l,u,s,e,a,i.scene2D.projection):m===p.SCENE3D?v(this,i.getCamera(),l,u,s,e,a):m===p.COLUMBUS_VIEW&&y(this,i.getCamera(),l,u,s,e,a,i.scene2D.projection)},I}),r("ThirdParty/topojson",[],function(){var e=function(){function e(e,t){function r(t){var r=e.arcs[t],i=r[0],n=[0,0];return r.forEach(function(e){n[0]+=e[0],n[1]+=e[1]}),[i,n]}var i={},n={},o={};t.forEach(function(e){var t=r(e);(i[t[0]]||(i[t[0]]=[])).push(e),(i[t[1]]||(i[t[1]]=[])).push(~e)}),t.forEach(function(e){var t,i,a=r(e),s=a[0],l=a[1];if(t=o[s])if(delete o[t.end],t.push(e),t.end=l,i=n[l]){delete n[i.start];var u=i===t?t:t.concat(i);n[u.start=t.start]=o[u.end=i.end]=u}else if(i=o[l]){delete n[i.start],delete o[i.end];var u=t.concat(i.map(function(e){return~e}).reverse());n[u.start=t.start]=o[u.end=i.start]=u}else n[t.start]=o[t.end]=t;else if(t=n[l])if(delete n[t.start],t.unshift(e),t.start=s,i=o[s]){delete o[i.end];var c=i===t?t:i.concat(t);n[c.start=i.start]=o[c.end=t.end]=c}else if(i=n[s]){delete n[i.start],delete o[i.end];var c=i.map(function(e){return~e}).reverse().concat(t);n[c.start=i.end]=o[c.end=t.end]=c}else n[t.start]=o[t.end]=t;else if(t=n[s])if(delete n[t.start],t.unshift(~e),t.start=l,i=o[l]){delete o[i.end];var c=i===t?t:i.concat(t);n[c.start=i.start]=o[c.end=t.end]=c}else if(i=n[l]){delete n[i.start],delete o[i.end];var c=i.map(function(e){return~e}).reverse().concat(t);n[c.start=i.end]=o[c.end=t.end]=c}else n[t.start]=o[t.end]=t;else if(t=o[l])if(delete o[t.end],t.push(~e),t.end=s,i=o[s]){delete n[i.start];var u=i===t?t:t.concat(i);n[u.start=t.start]=o[u.end=i.end]=u}else if(i=n[s]){delete n[i.start],delete o[i.end];var u=t.concat(i.map(function(e){return~e}).reverse());n[u.start=t.start]=o[u.end=i.start]=u}else n[t.start]=o[t.end]=t;else t=[e],n[t.start=s]=o[t.end=l]=t});var a=[];for(var s in o)a.push(o[s]);return a}function t(t,r,i){function o(e){0>e&&(e=~e),(h[e]||(h[e]=[])).push(c)}function a(e){e.forEach(o)}function s(e){e.forEach(a)}function l(e){"GeometryCollection"===e.type?e.geometries.forEach(l):e.type in d&&(c=e,d[e.type](e.arcs))}var u=[];if(arguments.length>1){var c,h=[],d={LineString:a,MultiLineString:s,Polygon:s,MultiPolygon:function(e){e.forEach(s)}};l(r),h.forEach(arguments.length<3?function(e,t){u.push(t)}:function(e,t){i(e[0],e[e.length-1])&&u.push(t)})}else for(var m=0,p=t.arcs.length;p>m;++m)u.push(m);return n(t,{type:"MultiLineString",arcs:e(t,u)})}function r(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return i(e,t)})}:i(e,t)}function i(e,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:n(e,t)};return null==t.id&&delete r.id,r}function n(e,t){function r(e,t){t.length&&t.pop();for(var r,i=p[0>e?~e:e],n=0,a=i.length,s=0,l=0;a>n;++n)t.push([(s+=(r=i[n])[0])*c+d,(l+=r[1])*h+m]);0>e&&o(t,a)}function i(e){return[e[0]*c+d,e[1]*h+m]}function n(e){for(var t=[],i=0,n=e.length;n>i;++i)r(e[i],t);return t.length<2&&t.push(t[0]),t}function a(e){for(var t=n(e);t.length<4;)t.push(t[0]);return t}function s(e){return e.map(a)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in f?{type:t,coordinates:f[t](e)}:null}var u=e.transform,c=u.scale[0],h=u.scale[1],d=u.translate[0],m=u.translate[1],p=e.arcs,f={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return s(e.arcs)},MultiPolygon:function(e){return e.arcs.map(s)}};return l(t)}function o(e,t){for(var r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function a(e,t){for(var r=0,i=e.length;i>r;){var n=r+i>>>1;e[n]e&&(e=~e);var r=n[e];r?r.push(t):n[e]=[t]})}function r(e,r){e.forEach(function(e){t(e,r)})}function i(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){i(e,t)}):e.type in s&&s[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),s={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var l in n)for(var u=n[l],c=u.length,h=0;c>h;++h)for(var d=h+1;c>d;++d){var m,p=u[h],f=u[d];(m=o[p])[l=a(m,f)]!==f&&m.splice(l,0,f),(m=o[f])[l=a(m,p)]!==p&&m.splice(l,0,p)}return o}return{version:"1.1.4",mesh:t,feature:r,neighbors:s}}();return e}),r("DynamicScene/GeoJsonDataSource",["../Core/createGuid","../Core/Cartographic","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/getFilenameFromUri","../Core/RuntimeError","../Core/Ellipsoid","../Core/Event","../Core/loadJson","./ConstantProperty","./DynamicObject","./DynamicPoint","./DynamicPolyline","./DynamicPolygon","./ColorMaterialProperty","./DynamicObjectCollection","../ThirdParty/when","../ThirdParty/topojson"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g){"use strict";function _(t,r){var n=t.id;if(i(n)&&"Feature"===t.type){for(var o=2,a=n;i(r.getById(a));)a=n+"_"+o,o++;n=a}else n=e();var s=r.getOrCreateObject(n);return s.geoJson=t,s}function w(e,t){for(var r=new Array(e.length),i=0;ia;a++)C(e,o[a],void 0,i,n)}function S(e,t,r,n,o){for(var s=r.geometries,l=0,u=s.length;u>l;l++){var c=s[l],h=c.type,d=R[h];if(!i(d))throw new a("Unknown geometry type: "+h);d(e,t,c,n,o)}}function E(e,t,r,i){var n=_(t,e._dynamicObjectCollection);n.merge(e.defaultPoint),n.position=new c(i(r.coordinates))}function b(e,t,r,i){for(var n=r.coordinates,o=0;othis._sizeInBytes)throw new e("This buffer is not large enough.");var i=this._gl,n=this._bufferTarget;i.bindBuffer(n,this._buffer),i.bufferSubData(n,r,t),i.bindBuffer(n,null)},r.prototype._getBuffer=function(){return this._buffer},r.prototype.getSizeInBytes=function(){return this._sizeInBytes},r.prototype.getUsage=function(){return this._usage},r.prototype.getVertexArrayDestroyable=function(){return this._vertexArrayDestroyable},r.prototype.setVertexArrayDestroyable=function(e){this._vertexArrayDestroyable=e},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),t(this)},r}),r("Renderer/ClearCommand",["../Core/Color","../Core/freezeObject"],function(e,t){"use strict";var r=function(){this.color=void 0,this.depth=void 0,this.stencil=void 0,this.renderState=void 0,this.framebuffer=void 0,this.owner=void 0},i=new r;return i.color=new e(0,0,0,0),i.depth=1,i.stencil=0,r.ALL=t(i),r.prototype.execute=function(e,t){e.clear(this,t)},r}),r("Renderer/Framebuffer",["../Core/DeveloperError","../Core/destroyObject","./PixelFormat"],function(e,t,r){"use strict";function i(e,t,r){e._bind();var i=e._gl;r?i.framebufferTexture2D(i.FRAMEBUFFER,t,r._getTarget(),r._getTexture(),0):i.framebufferTexture2D(i.FRAMEBUFFER,t,i.TEXTURE_2D,null,0),e._unBind()}function n(e,t,r){e._bind();var i=e._gl;r?i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,r._getRenderbuffer()):i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,null),e._unBind()}function o(e,t){e.destroyAttachments&&t&&t.destroy&&t.destroy()}var a=function(t,r){if(this._gl=t,this._framebuffer=t.createFramebuffer(),this._colorTexture=void 0,this._colorRenderbuffer=void 0,this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=!0,r){if(r.colorTexture&&r.colorRenderbuffer)throw new e("Cannot have both a color texture and color renderbuffer attachment.");if(r.depthTexture&&r.depthRenderbuffer)throw new e("Cannot have both a depth texture and depth renderbuffer attachment.");if(r.depthStencilTexture&&r.depthStencilRenderbuffer)throw new e("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");var i=r.depthTexture||r.depthRenderbuffer,n=r.depthStencilTexture||r.depthStencilRenderbuffer;if(i&&n)throw new e("Cannot have both a depth and depth-stencil attachment.");if(r.stencilRenderbuffer&&n)throw new e("Cannot have both a stencil and depth-stencil attachment.");if(i&&r.stencilRenderbuffer)throw new e("Cannot have both a depth and stencil attachment.");r.colorTexture&&this.setColorTexture(r.colorTexture),r.colorRenderbuffer&&this.setColorRenderbuffer(r.colorRenderbuffer),r.depthTexture&&this.setDepthTexture(r.depthTexture),r.depthRenderbuffer&&this.setDepthRenderbuffer(r.depthRenderbuffer),r.stencilRenderbuffer&&this.setStencilRenderbuffer(r.stencilRenderbuffer),r.depthStencilTexture&&this.setDepthStencilTexture(r.depthStencilTexture),r.depthStencilRenderbuffer&&this.setDepthStencilRenderbuffer(r.depthStencilRenderbuffer)}};return a.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},a.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},a.prototype.setColorTexture=function(t){if(t&&!r.isColorFormat(t.getPixelFormat()))throw new e("The color-texture pixel-format must be a color format.");i(this,this._gl.COLOR_ATTACHMENT0,t),o(this,this._colorTexture),this._colorTexture=t},a.prototype.getColorTexture=function(){return this._colorTexture},a.prototype.setColorRenderbuffer=function(e){n(this,this._gl.COLOR_ATTACHMENT0,e),o(this,this._colorRenderbuffer),this._colorRenderbuffer=e},a.prototype.getColorRenderbuffer=function(){return this._colorRenderbuffer},a.prototype.setDepthTexture=function(t){if(t&&t.getPixelFormat()!==r.DEPTH_COMPONENT)throw new e("The depth-texture pixel-format must be DEPTH_COMPONENT.");i(this,this._gl.DEPTH_ATTACHMENT,t),o(this,this._depthTexture),this._depthTexture=t},a.prototype.getDepthTexture=function(){return this._depthTexture},a.prototype.setDepthRenderbuffer=function(e){n(this,this._gl.DEPTH_ATTACHMENT,e),o(this,this._depthRenderbuffer),this._depthRenderbuffer=e},a.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer},a.prototype.setStencilRenderbuffer=function(e){n(this,this._gl.STENCIL_ATTACHMENT,e),o(this,this._stencilRenderbuffer),this._stencilRenderbuffer=e},a.prototype.getStencilRenderbuffer=function(){return this._stencilRenderbuffer},a.prototype.setDepthStencilTexture=function(t){if(t&&t.getPixelFormat()!==r.DEPTH_STENCIL)throw new e("The depth-stencil pixel-format must be DEPTH_STENCIL.");i(this,this._gl.DEPTH_STENCIL_ATTACHMENT,t),o(this,this._depthStencilTexture),this._depthStencilTexture=t},a.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture},a.prototype.setDepthStencilRenderbuffer=function(e){n(this,this._gl.DEPTH_STENCIL_ATTACHMENT,e),o(this,this._depthStencilRenderbuffer),this._depthStencilRenderbuffer=e},a.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer},a.prototype.hasDepthAttachment=function(){return!!(this.getDepthTexture()||this.getDepthRenderbuffer()||this.getDepthStencilTexture()||this.getDepthStencilRenderbuffer())},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.destroyAttachments&&(this._colorTexture=this._colorTexture&&this._colorTexture.destroy&&this._colorTexture.destroy(),this._colorRenderbuffer=this._colorRenderbuffer&&this._colorRenderbuffer.destroy(),this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),this._gl.deleteFramebuffer(this._framebuffer),t(this)},a}),r("Renderer/PassState",[],function(){"use strict";var e=function(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0};return e}),r("Renderer/RenderbufferFormat",["../Core/Enumeration"],function(e){"use strict";var t={RGBA4:new e(32854,"RGBA4"),RGB5_A1:new e(32855,"RGB5_A1"),RGB565:new e(36194,"RGB565"),DEPTH_COMPONENT16:new e(33189,"DEPTH_COMPONENT16"),STENCIL_INDEX8:new e(36168,"STENCIL_INDEX8"),DEPTH_STENCIL:new e(34041,"DEPTH_STENCIL"),validate:function(e){return e===t.RGBA4||e===t.RGB5_A1||e===t.RGB565||e===t.DEPTH_COMPONENT16||e===t.STENCIL_INDEX8||e===t.DEPTH_STENCIL}};return t}),r("Renderer/PickFramebuffer",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Color","../Core/BoundingRectangle","./PassState","./RenderbufferFormat"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){var t=new o(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new n},this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0};s.prototype.begin=function(e){var r=this._context,i=r.getDrawingBufferWidth(),o=r.getDrawingBufferHeight();return n.clone(e,this._passState.scissorTest.rectangle),t(this._fb)&&this._width===i&&this._height===o||(this._width=i,this._height=o,this._fb=this._fb&&this._fb.destroy(),this._fb=r.createFramebuffer({colorTexture:r.createTexture2D({width:i,height:o}),depthRenderbuffer:r.createRenderbuffer({format:a.DEPTH_COMPONENT16})}),this._passState.framebuffer=this._fb),this._passState};var l=new i;return s.prototype.end=function(r){for(var n=e(r.width,1),o=e(r.height,1),a=this._context,s=a.readPixels({x:r.x,y:r.y,width:n,height:o,framebuffer:this._fb}),u=Math.max(n,o),c=u*u,h=Math.floor(.5*n),d=Math.floor(.5*o),m=0,p=0,f=0,v=-1,y=0;c>y;++y){if(m>=-h&&h>=m&&p>=-d&&d>=p){var g=4*((d-p)*n+m+h);l.red=i.byteToFloat(s[g]),l.green=i.byteToFloat(s[g+1]),l.blue=i.byteToFloat(s[g+2]),l.alpha=i.byteToFloat(s[g+3]);var _=a.getObjectByPickColor(l);if(t(_))return _}if(m===p||0>m&&-m===p||m>0&&m===1-p){var w=f;f=-v,v=w}m+=f,p+=v}return void 0},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),r(this)},s}),r("Renderer/Renderbuffer",["../Core/destroyObject"],function(e){"use strict";function t(t,r,i,n){var o=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,o),t.renderbufferStorage(t.RENDERBUFFER,r,i,n),t.bindRenderbuffer(t.RENDERBUFFER,null),this.getFormat=function(){return r},this.getWidth=function(){return i},this.getHeight=function(){return n},this._getRenderbuffer=function(){return o},this.isDestroyed=function(){return!1},this.destroy=function(){return t.deleteRenderbuffer(o),e(this)}}return t}),r("Renderer/DepthFunction",["../Core/Enumeration"],function(e){"use strict";var t={NEVER:new e(512,"NEVER"),LESS:new e(513,"LESS"),EQUAL:new e(514,"EQUAL"),LESS_OR_EQUAL:new e(515,"LEQUAL"),GREATER:new e(516,"GREATER"),NOT_EQUAL:new e(517,"NOTEQUAL"),GREATER_OR_EQUAL:new e(518,"GEQUAL"),ALWAYS:new e(519,"ALWAYS"),validate:function(e){return e===t.NEVER||e===t.LESS||e===t.EQUAL||e===t.LESS_OR_EQUAL||e===t.GREATER||e===t.NOT_EQUAL||e===t.GREATER_OR_EQUAL||e===t.ALWAYS}};return t}),r("Renderer/StencilFunction",["../Core/Enumeration"],function(e){"use strict";var t={NEVER:new e(512,"NEVER"),LESS:new e(513,"LESS"),EQUAL:new e(514,"EQUAL"),LESS_OR_EQUAL:new e(515,"LESS_OR_EQUAL"),GREATER:new e(516,"GREATER"),NOT_EQUAL:new e(517,"NOT_EQUAL"),GREATER_OR_EQUAL:new e(518,"GREATER_OR_EQUAL"),ALWAYS:new e(519,"ALWAYS"),validate:function(e){return e===t.NEVER||e===t.LESS||e===t.EQUAL||e===t.LESS_OR_EQUAL||e===t.GREATER||e===t.NOT_EQUAL||e===t.GREATER_OR_EQUAL||e===t.ALWAYS}};return t}),r("Renderer/StencilOperation",["../Core/Enumeration"],function(e){"use strict";var t={ZERO:new e(0,"ZERO"),KEEP:new e(7680,"KEEP"),REPLACE:new e(7681,"REPLACE"),INCREMENT:new e(7682,"INCREMENT"),DECREMENT:new e(7683,"DECREMENT"),INVERT:new e(5386,"INVERT"),INCREMENT_WRAP:new e(34055,"INCREMENT_WRAP"),DECREMENT_WRAP:new e(34056,"DECREMENT_WRAP"),validate:function(e){return e===t.ZERO||e===t.KEEP||e===t.REPLACE||e===t.INCREMENT||e===t.DECREMENT||e===t.INVERT||e===t.INCREMENT_WRAP||e===t.DECREMENT_WRAP}};return t}),r("Renderer/RenderState",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/BoundingRectangle","../Core/RuntimeError","../Core/WindingOrder","./CullFace","./DepthFunction","./BlendEquation","./BlendFunction","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,t,r){r?e.enable(t):e.disable(t)}function p(e,t){e.frontFace(t.frontFace)}function f(e,t){var r=t.cull,i=r.enabled;m(e,e.CULL_FACE,i),i&&e.cullFace(r.face)}function v(e,t){e.lineWidth(t.lineWidth)}function y(e,t){var r=t.polygonOffset,i=r.enabled;m(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(r.factor,r.units)}function g(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(m(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function _(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function w(e,t){var r=t.depthTest,i=r.enabled;m(e,e.DEPTH_TEST,i),i&&e.depthFunc(r.func)}function C(e,t){var r=t.colorMask;e.colorMask(r.red,r.green,r.blue,r.alpha)}function x(e,t){e.depthMask(t.depthMask)}function S(e,t){e.stencilMask(t.stencilMask)}function E(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;if(m(e,e.BLEND,o),o){var a=n.color,s=n.equationRgb,l=n.equationAlpha,u=n.functionSourceRgb,c=n.functionDestinationRgb,h=n.functionSourceAlpha,d=n.functionDestinationAlpha;e.blendColor(a.red,a.green,a.blue,a.alpha),e.blendEquationSeparate(s,l),e.blendFuncSeparate(u,c,h,d)}}function b(e,t){var r=t.stencilTest,i=r.enabled;if(m(e,e.STENCIL_TEST,i),i){var n=r.frontFunction,o=r.backFunction,a=r.reference,s=r.mask;e.stencilFunc(r.frontFunction,r.reference,r.mask),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=r.frontOperation,u=l.fail,c=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,c,h);var d=r.backOperation,p=d.fail,f=d.zFail,v=d.zPass;e.stencilOpSeparate(e.BACK,p,f,v)}}function T(e,t){var r=t.sampleCoverage,i=r.enabled;m(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(r.value,r.invert)}function A(e,t){m(e,e.DITHER,t.dither)}function D(e,t,i){var n=t.viewport;r(n)||(n=I,n.width=i.context.getDrawingBufferWidth(),n.height=i.context.getDrawingBufferHeight()),i.context.getUniformState().setViewport(n),e.viewport(n.x,n.y,n.width,n.height)}function P(e,t){var r=[];return e.frontFace!==t.frontFace&&r.push(p),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&r.push(f),e.lineWidth!==t.lineWidth&&r.push(v),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&r.push(y),r.push(g),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&r.push(_),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&r.push(w),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&r.push(C),e.depthMask!==t.depthMask&&r.push(x),r.push(E),e.stencilMask!==t.stencilMask&&r.push(S),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&r.push(b),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&r.push(T),e.dither!==t.dither&&r.push(A),r.push(D),r}var M=function(m,p){var f=t(p,{}),v=t(f.cull,{}),y=t(f.polygonOffset,{}),g=t(f.scissorTest,{}),_=t(g.rectangle,{}),w=t(f.depthRange,{}),C=t(f.depthTest,{}),x=t(f.colorMask,{}),S=t(f.blending,{}),E=t(S.color,{}),b=t(f.stencilTest,{}),T=t(b.frontOperation,{}),A=t(b.backOperation,{}),D=t(f.sampleCoverage,{}),P=f.viewport;if(this.frontFace=t(f.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:t(v.enabled,!1),face:t(v.face,s.BACK)},this.lineWidth=t(f.lineWidth,1),this.polygonOffset={enabled:t(y.enabled,!1),factor:t(y.factor,0),units:t(y.units,0)},this.scissorTest={enabled:t(g.enabled,!1),rectangle:n.clone(_)},this.depthRange={near:t(w.near,0),far:t(w.far,1)},this.depthTest={enabled:t(C.enabled,!1),func:t(C.func,l.LESS)},this.colorMask={red:t(x.red,!0),green:t(x.green,!0),blue:t(x.blue,!0),alpha:t(x.alpha,!0)},this.depthMask=t(f.depthMask,!0),this.stencilMask=t(f.stencilMask,-1),this.blending={enabled:t(S.enabled,!1),color:new e(t(E.red,0),t(E.green,0),t(E.blue,0),t(E.alpha,0)),equationRgb:t(S.equationRgb,u.ADD),equationAlpha:t(S.equationAlpha,u.ADD),functionSourceRgb:t(S.functionSourceRgb,c.ONE),functionSourceAlpha:t(S.functionSourceAlpha,c.ONE),functionDestinationRgb:t(S.functionDestinationRgb,c.ZERO),functionDestinationAlpha:t(S.functionDestinationAlpha,c.ZERO)},this.stencilTest={enabled:t(b.enabled,!1),frontFunction:t(b.frontFunction,h.ALWAYS),backFunction:t(b.backFunction,h.ALWAYS),reference:t(b.reference,0),mask:t(b.mask,-1),frontOperation:{fail:t(T.fail,d.KEEP),zFail:t(T.zFail,d.KEEP),zPass:t(T.zPass,d.KEEP)},backOperation:{fail:t(A.fail,d.KEEP),zFail:t(A.zFail,d.KEEP),zPass:t(A.zPass,d.KEEP)}},this.sampleCoverage={enabled:t(D.enabled,!1),value:t(D.value,1),invert:t(D.invert,!1)},this.dither=t(f.dither,!0),this.viewport=r(P)?new n(P.x,P.y,r(P.width)?P.width:m.getDrawingBufferWidth(),r(P.height)?P.height:m.getDrawingBufferHeight()):void 0,!a.validate(this.frontFace))throw new i("Invalid renderState.frontFace.");if(!s.validate(this.cull.face))throw new i("Invalid renderState.cull.face.");if(this.lineWidthm.getMaximumAliasedLineWidth())throw new o("renderState.lineWidth is out of range. Check getMinimumAliasedLineWidth() and getMaximumAliasedLineWidth().");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new i("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new i("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new i("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new i("renderState.depthRange.far must be less than or equal to one.");if(!l.validate(this.depthTest.func))throw new i("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new i("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!u.validate(this.blending.equationRgb))throw new i("Invalid renderState.blending.equationRgb.");if(!u.validate(this.blending.equationAlpha))throw new i("Invalid renderState.blending.equationAlpha.");if(!c.validate(this.blending.functionSourceRgb))throw new i("Invalid renderState.blending.functionSourceRgb.");if(!c.validate(this.blending.functionSourceAlpha))throw new i("Invalid renderState.blending.functionSourceAlpha.");if(!c.validate(this.blending.functionDestinationRgb))throw new i("Invalid renderState.blending.functionDestinationRgb.");if(!c.validate(this.blending.functionDestinationAlpha))throw new i("Invalid renderState.blending.functionDestinationAlpha.");if(!h.validate(this.stencilTest.frontFunction))throw new i("Invalid renderState.stencilTest.frontFunction.");if(!h.validate(this.stencilTest.backFunction))throw new i("Invalid renderState.stencilTest.backFunction.");if(!d.validate(this.stencilTest.frontOperation.fail))throw new i("Invalid renderState.stencilTest.frontOperation.fail.");if(!d.validate(this.stencilTest.frontOperation.zFail))throw new i("Invalid renderState.stencilTest.frontOperation.zFail.");if(!d.validate(this.stencilTest.frontOperation.zPass))throw new i("Invalid renderState.stencilTest.frontOperation.zPass.");if(!d.validate(this.stencilTest.backOperation.fail))throw new i("Invalid renderState.stencilTest.backOperation.fail.");if(!d.validate(this.stencilTest.backOperation.zFail))throw new i("Invalid renderState.stencilTest.backOperation.zFail.");if(!d.validate(this.stencilTest.backOperation.zPass))throw new i("Invalid renderState.stencilTest.backOperation.zPass.");if(r(this.viewport)){if(this.viewport.width<0)throw new i("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.width>m.getMaximumViewportWidth())throw new o("renderState.viewport.width must be less than or equal to the maximum viewport width ("+this.getMaximumViewportWidth().toString()+"). Check getMaximumViewportWidth().");if(this.viewport.height<0)throw new i("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.height>m.getMaximumViewportHeight())throw new o("renderState.viewport.height must be less than or equal to the maximum viewport height ("+this.getMaximumViewportHeight().toString()+"). Check getMaximumViewportHeight().")}this.id=0,this._applyFunctions=[]},I=new n;return M.apply=function(e,t,r){p(e,t),f(e,t),v(e,t),y(e,t),g(e,t,r),_(e,t),w(e,t),C(e,t),x(e,t),S(e,t),E(e,t,r),b(e,t),T(e,t),A(e,t),D(e,t,r)},M.partialApply=function(e,t,i,n){var o=i._applyFunctions[t.id];r(o)||(o=P(t,i),i._applyFunctions[t.id]=o);for(var a=o.length,s=0;a>s;++s)o[s](e,i,n)},M}),r("Renderer/ShaderCache",["../Core/defined","../Core/destroyObject"],function(e,t){"use strict";var r=function(e){this._context=e,this._shaders={},this._shadersToRelease={}};return r.prototype.replaceShaderProgram=function(t,r,i,n){return e(t)&&t.release(),this.getShaderProgram(r,i,n)},r.prototype.getShaderProgram=function(e,t,r){var i,n=e+t+JSON.stringify(r);if(this._shaders[n])i=this._shaders[n],delete this._shadersToRelease[n];else{var o=this._context.createShaderProgram(e,t,r);i={cache:this,shaderProgram:o,keyword:n,count:0},o._cachedShader=i,this._shaders[n]=i}return++i.count,i.shaderProgram},r.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];delete this._shaders[r.keyword],r.shaderProgram.destroy()}this._shadersToRelease={}},r.prototype.releaseShaderProgram=function(e){if(e){var t=e._cachedShader;t&&0===--t.count&&(this._shadersToRelease[t.keyword]=t)}return void 0},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){var e=this._shaders;for(var r in e)e.hasOwnProperty(r)&&e[r].shaderProgram.destroy();return t(this)},r}),r("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),r("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),r("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),r("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),r("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),r("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),r("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),r("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),r("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),r("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),r("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),r("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),r("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),r("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),r("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),r("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),r("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n" -}),r("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 0.0;\n"}),r("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 2.0;\n"}),r("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),r("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 3.0;\n"}),r("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),r("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),r("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),r("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),r("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),r("Shaders/Builtin/Structs/material",[],function(){"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),r("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),r("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),r("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),r("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),r("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),r("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),r("Shaders/Builtin/Functions/cellular",[],function(){"use strict";return"vec3 _czm_permute289(vec3 x)\n{\nreturn mod((34.0 * x + 1.0) * x, 289.0);\n}\nvec2 czm_cellular(vec2 P)\n{\n#define K 0.142857142857\n#define Ko 0.428571428571\n#define jitter 1.0\nvec2 Pi = mod(floor(P), 289.0);\nvec2 Pf = fract(P);\nvec3 oi = vec3(-1.0, 0.0, 1.0);\nvec3 of = vec3(-0.5, 0.5, 1.5);\nvec3 px = _czm_permute289(Pi.x + oi);\nvec3 p = _czm_permute289(px.x + Pi.y + oi);\nvec3 ox = fract(p*K) - Ko;\nvec3 oy = mod(floor(p*K),7.0)*K - Ko;\nvec3 dx = Pf.x + 0.5 + jitter*ox;\nvec3 dy = Pf.y - of + jitter*oy;\nvec3 d1 = dx * dx + dy * dy;\np = _czm_permute289(px.y + Pi.y + oi);\nox = fract(p*K) - Ko;\noy = mod(floor(p*K),7.0)*K - Ko;\ndx = Pf.x - 0.5 + jitter*ox;\ndy = Pf.y - of + jitter*oy;\nvec3 d2 = dx * dx + dy * dy;\np = _czm_permute289(px.z + Pi.y + oi);\nox = fract(p*K) - Ko;\noy = mod(floor(p*K),7.0)*K - Ko;\ndx = Pf.x - 1.5 + jitter*ox;\ndy = Pf.y - of + jitter*oy;\nvec3 d3 = dx * dx + dy * dy;\nvec3 d1a = min(d1, d2);\nd2 = max(d1, d2);\nd2 = min(d2, d3);\nd1 = min(d1a, d2);\nd2 = max(d1a, d2);\nd1.xy = (d1.x < d1.y) ? d1.xy : d1.yx;\nd1.xz = (d1.x < d1.z) ? d1.xz : d1.zx;\nd1.yz = min(d1.yz, d2.yz);\nd1.y = min(d1.y, d1.z);\nd1.y = min(d1.y, d2.x);\nreturn sqrt(d1.xy);\n}\n"}),r("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),r("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),r("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),r("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),r("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),r("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),r("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),r("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),r("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),r("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),r("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),r("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),r("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, shininess);\n}\n"}),r("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),r("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),r("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),r("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),r("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),r("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorYLow, float southMercatorYHigh, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nfloat t1 = 0.0 - southMercatorYLow;\nfloat e = t1 - 0.0;\nfloat t2 = ((-southMercatorYLow - e) + (0.0 - (t1 - e))) + mercatorY - southMercatorYHigh;\nfloat highDifference = t1 + t2;\nfloat lowDifference = t2 - (highDifference - t1);\nreturn highDifference * oneOverMercatorHeight + lowDifference * oneOverMercatorHeight;\n}\n"}),r("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),r("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),r("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),r("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material) + czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),r("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),r("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),r("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),r("Shaders/Builtin/Functions/snoise",[],function(){"use strict";return"vec4 _czm_mod289(vec4 x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 _czm_mod289(vec3 x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec2 _czm_mod289(vec2 x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nfloat _czm_mod289(float x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 _czm_permute(vec4 x)\n{\nreturn _czm_mod289(((x*34.0)+1.0)*x);\n}\nvec3 _czm_permute(vec3 x)\n{\nreturn _czm_mod289(((x*34.0)+1.0)*x);\n}\nfloat _czm_permute(float x)\n{\nreturn _czm_mod289(((x*34.0)+1.0)*x);\n}\nvec4 _czm_taylorInvSqrt(vec4 r)\n{\nreturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat _czm_taylorInvSqrt(float r)\n{\nreturn 1.79284291400159 - 0.85373472095314 * r;\n}\nvec4 _czm_grad4(float j, vec4 ip)\n{\nconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\nvec4 p,s;\np.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\np.w = 1.5 - dot(abs(p.xyz), ones.xyz);\ns = vec4(lessThan(p, vec4(0.0)));\np.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\nreturn p;\n}\nfloat czm_snoise(vec2 v)\n{\nconst vec4 C = vec4(0.211324865405187,\n0.366025403784439,\n-0.577350269189626,\n0.024390243902439);\nvec2 i = floor(v + dot(v, C.yy) );\nvec2 x0 = v - i + dot(i, C.xx);\nvec2 i1;\ni1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\nvec4 x12 = x0.xyxy + C.xxzz;\nx12.xy -= i1;\ni = _czm_mod289(i);\nvec3 p = _czm_permute( _czm_permute( i.y + vec3(0.0, i1.y, 1.0 )) + i.x + vec3(0.0, i1.x, 1.0 ));\nvec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\nm = m*m ;\nm = m*m ;\nvec3 x = 2.0 * fract(p * C.www) - 1.0;\nvec3 h = abs(x) - 0.5;\nvec3 ox = floor(x + 0.5);\nvec3 a0 = x - ox;\nm *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\nvec3 g;\ng.x = a0.x * x0.x + h.x * x0.y;\ng.yz = a0.yz * x12.xz + h.yz * x12.yw;\nreturn 130.0 * dot(m, g);\n}\nfloat czm_snoise(vec3 v)\n{\nconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\nconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\nvec3 i = floor(v + dot(v, C.yyy) );\nvec3 x0 = v - i + dot(i, C.xxx) ;\nvec3 g = step(x0.yzx, x0.xyz);\nvec3 l = 1.0 - g;\nvec3 i1 = min( g.xyz, l.zxy );\nvec3 i2 = max( g.xyz, l.zxy );\nvec3 x1 = x0 - i1 + C.xxx;\nvec3 x2 = x0 - i2 + C.yyy;\nvec3 x3 = x0 - D.yyy;\ni = _czm_mod289(i);\nvec4 p = _czm_permute( _czm_permute( _czm_permute(\ni.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\nfloat n_ = 0.142857142857;\nvec3 ns = n_ * D.wyz - D.xzx;\nvec4 j = p - 49.0 * floor(p * ns.z * ns.z);\nvec4 x_ = floor(j * ns.z);\nvec4 y_ = floor(j - 7.0 * x_ );\nvec4 x = x_ *ns.x + ns.yyyy;\nvec4 y = y_ *ns.x + ns.yyyy;\nvec4 h = 1.0 - abs(x) - abs(y);\nvec4 b0 = vec4( x.xy, y.xy );\nvec4 b1 = vec4( x.zw, y.zw );\nvec4 s0 = floor(b0)*2.0 + 1.0;\nvec4 s1 = floor(b1)*2.0 + 1.0;\nvec4 sh = -step(h, vec4(0.0));\nvec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\nvec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\nvec3 p0 = vec3(a0.xy,h.x);\nvec3 p1 = vec3(a0.zw,h.y);\nvec3 p2 = vec3(a1.xy,h.z);\nvec3 p3 = vec3(a1.zw,h.w);\nvec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\np0 *= norm.x;\np1 *= norm.y;\np2 *= norm.z;\np3 *= norm.w;\nvec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\nm = m * m;\nreturn 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\ndot(p2,x2), dot(p3,x3) ) );\n}\nfloat czm_snoise(vec4 v)\n{\nconst vec4 C = vec4( 0.138196601125011,\n0.276393202250021,\n0.414589803375032,\n-0.447213595499958);\n#define F4 0.309016994374947451\nvec4 i = floor(v + dot(v, vec4(F4)) );\nvec4 x0 = v - i + dot(i, C.xxxx);\nvec4 i0;\nvec3 isX = step( x0.yzw, x0.xxx );\nvec3 isYZ = step( x0.zww, x0.yyz );\ni0.x = isX.x + isX.y + isX.z;\ni0.yzw = 1.0 - isX;\ni0.y += isYZ.x + isYZ.y;\ni0.zw += 1.0 - isYZ.xy;\ni0.z += isYZ.z;\ni0.w += 1.0 - isYZ.z;\nvec4 i3 = clamp( i0, 0.0, 1.0 );\nvec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\nvec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\nvec4 x1 = x0 - i1 + C.xxxx;\nvec4 x2 = x0 - i2 + C.yyyy;\nvec4 x3 = x0 - i3 + C.zzzz;\nvec4 x4 = x0 + C.wwww;\ni = _czm_mod289(i);\nfloat j0 = _czm_permute( _czm_permute( _czm_permute( _czm_permute(i.w) + i.z) + i.y) + i.x);\nvec4 j1 = _czm_permute( _czm_permute( _czm_permute( _czm_permute (\ni.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n+ i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n+ i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n+ i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\nvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\nvec4 p0 = _czm_grad4(j0, ip);\nvec4 p1 = _czm_grad4(j1.x, ip);\nvec4 p2 = _czm_grad4(j1.y, ip);\nvec4 p3 = _czm_grad4(j1.z, ip);\nvec4 p4 = _czm_grad4(j1.w, ip);\nvec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\np0 *= norm.x;\np1 *= norm.y;\np2 *= norm.z;\np3 *= norm.w;\np4 *= _czm_taylorInvSqrt(dot(p4,p4));\nvec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\nvec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\nm0 = m0 * m0;\nm1 = m1 * m1;\nreturn 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n+ dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n"}),r("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x, tangent.y, tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x, normal.y, normal.z);\n}\n"}),r("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),r("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),r("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),r("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Functions/RGBToXYZ","./Functions/XYZToRGB","./Functions/antialias","./Functions/cellular","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/saturation","./Functions/snoise","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/transpose","./Functions/windowToEyeCoordinates"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M,I,O,R,L,z,N,B,F,V,k,U,W,q,G,H,j,Y,X,Z,J,K,Q,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct){"use strict";return{czm_degreesPerRadian:e,czm_epsilon1:t,czm_epsilon2:r,czm_epsilon3:i,czm_epsilon4:n,czm_epsilon5:o,czm_epsilon6:a,czm_epsilon7:s,czm_infinity:l,czm_oneOverPi:u,czm_oneOverTwoPi:c,czm_pi:h,czm_piOverFour:d,czm_piOverSix:m,czm_piOverThree:p,czm_piOverTwo:f,czm_radiansPerDegree:v,czm_sceneMode2D:y,czm_sceneMode3D:g,czm_sceneModeColumbusView:_,czm_sceneModeMorphing:w,czm_solarRadius:C,czm_threePiOver2:x,czm_twoPi:S,czm_webMercatorMaxLatitude:E,czm_ellipsoid:b,czm_material:T,czm_materialInput:A,czm_ray:D,czm_raySegment:P,czm_RGBToXYZ:M,czm_XYZToRGB:I,czm_antialias:O,czm_cellular:R,czm_columbusViewMorph:L,czm_computePosition:z,czm_eastNorthUpToEyeCoordinates:N,czm_ellipsoidContainsPoint:B,czm_ellipsoidNew:F,czm_ellipsoidWgs84TextureCoordinates:V,czm_equalsEpsilon:k,czm_eyeOffset:U,czm_eyeToWindowCoordinates:W,czm_geodeticSurfaceNormal:q,czm_getDefaultMaterial:G,czm_getLambertDiffuse:H,czm_getSpecular:j,czm_getWaterNoise:Y,czm_getWgs84EllipsoidEC:X,czm_hue:Z,czm_isEmpty:J,czm_isFull:K,czm_latitudeToWebMercatorFraction:Q,czm_luminance:$,czm_modelToWindowCoordinates:et,czm_multiplyWithColorBalance:tt,czm_phong:rt,czm_pointAlongRay:it,czm_rayEllipsoidIntersectionInterval:nt,czm_saturation:ot,czm_snoise:at,czm_tangentToEyeSpaceMatrix:st,czm_translateRelativeToEye:lt,czm_transpose:ut,czm_windowToEyeCoordinates:ct}}),r("Renderer/ShaderProgram",["../Core/defined","../Core/DeveloperError","../Core/FeatureDetection","../Core/RuntimeError","../Core/destroyObject","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","./AutomaticUniforms","./UniformDatatype","../Shaders/Builtin/CzmBuiltins"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t){switch(t){case e.FLOAT:return function(){return u.FLOAT};case e.FLOAT_VEC2:return function(){return u.FLOAT_VEC2};case e.FLOAT_VEC3:return function(){return u.FLOAT_VEC3};case e.FLOAT_VEC4:return function(){return u.FLOAT_VEC4};case e.INT:return function(){return u.INT};case e.INT_VEC2:return function(){return u.INT_VEC2};case e.INT_VEC3:return function(){return u.INT_VEC3};case e.INT_VEC4:return function(){return u.INT_VEC4};case e.BOOL:return function(){return u.BOOL};case e.BOOL_VEC2:return function(){return u.BOOL_VEC2};case e.BOOL_VEC3:return function(){return u.BOOL_VEC3};case e.BOOL_VEC4:return function(){return u.BOOL_VEC4};case e.FLOAT_MAT2:return function(){return u.FLOAT_MAT2};case e.FLOAT_MAT3:return function(){return u.FLOAT_MAT3};case e.FLOAT_MAT4:return function(){return u.FLOAT_MAT4};case e.SAMPLER_2D:return function(){return u.SAMPLER_2D};case e.SAMPLER_CUBE:return function(){return u.SAMPLER_CUBE};default:throw new i("Unrecognized uniform type: "+t)}}function d(e,t,r){e.useProgram(t);for(var i=0,n=r.length,o=0;n>o;++o)i=r[o]._setSampler(i);return e.useProgram(null),i}function m(e){var t=e.indexOf("#version");if(-1!==t){var r=e.indexOf("\n",t);if(-1!==t){var i=e.substring(t,r+1),n=e.substring(0,t)+"//"+e.substring(t);return{version:i,source:n}}}return{version:"",source:e}}function p(t,r,i){for(var n,o=0;oc;++c)u+=0===c?"// Comment replaced to prevent problems when determining dependencies on built-in functions\n":"//\n";r=r.replace(s,u)}n={name:t,glslSource:r,dependsOn:[],requiredBy:[],evaluated:!1},i.push(n)}return n}function f(t,r){if(!t.evaluated){t.evaluated=!0;var i=t.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);e(i)&&null!==i&&(i=i.filter(function(e,t){return i.indexOf(e)===t}),i.forEach(function(e){if(e!==t.name&&D._czmBuiltinsAndUniforms.hasOwnProperty(e)){var i=p(e,D._czmBuiltinsAndUniforms[e],r);t.dependsOn.push(i),i.requiredBy.push(t),f(i,r)}}))}}function v(e){for(var r=[],i=[];e.length>0;){var n=e.pop();i.push(n),0===n.requiredBy.length&&r.push(n)}for(;r.length>0;){var o=r.shift();e.push(o);for(var a=0;a=0;--n)i=i+t[n].glslSource+"\n";return i.replace(r.glslSource,"")}function g(){return"#ifdef GL_FRAGMENT_PRECISION_HIGH \n precision highp float; \n#else \n precision mediump float; \n#endif \n\n"}function _(t,r,n,o,a){var s,l=m(n),u=m(o),c=l.version+y(l.source)+"\n#line 0\n"+l.source,h=u.version+g()+y(u.source)+"\n#line 0\n"+u.source,d=t.createShader(t.VERTEX_SHADER);t.shaderSource(d,c),t.compileShader(d);var p=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(p,h),t.compileShader(p);var f=t.createProgram();if(t.attachShader(f,d),t.attachShader(f,p),t.deleteShader(d),t.deleteShader(p),e(a))for(var v in a)a.hasOwnProperty(v)&&t.bindAttribLocation(f,a[v],v);if(t.linkProgram(f),!t.getProgramParameter(f,t.LINK_STATUS)){if(!t.getShaderParameter(p,t.COMPILE_STATUS))throw s=t.getShaderInfoLog(p),t.deleteProgram(f),console.error("[GL] Fragment shader compile log: "+s),new i("Fragment shader failed to compile. Compile log: "+s);if(!t.getShaderParameter(d,t.COMPILE_STATUS))throw s=t.getShaderInfoLog(d),t.deleteProgram(f),console.error("[GL] Vertex shader compile log: "+s),new i("Vertex shader failed to compile. Compile log: "+s);throw s=t.getProgramInfoLog(f),t.deleteProgram(f),console.error("[GL] Shader program link log: "+s),new i("Program failed to link. Link log: "+s)}return r&&(s=t.getShaderInfoLog(d),e(s)&&s.length>0&&console.log("[GL] Vertex shader compile log: "+s)),r&&(s=t.getShaderInfoLog(p),e(s)&&s.length>0&&console.log("[GL] Fragment shader compile log: "+s)),r&&(s=t.getProgramInfoLog(f),e(s)&&s.length>0&&console.log("[GL] Shader program link log: "+s)),f}function w(e,t,r){for(var i={},n=0;r>n;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:a}}return i}function C(e,t){for(var r={},i=[],n=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),a=0;o>a;++a){var s=e.getActiveUniform(t,a),l="[0]",u=-1!==s.name.indexOf(l,s.name.length-l.length)?s.name.slice(0,s.name.length-3):s.name;if(0!==u.indexOf("gl_"))if(s.name.indexOf("[")<0){var c=e.getUniformLocation(t,u),h=e.getUniform(t,c),d=new T(e,s,u,c,h);r[u]=d,i.push(d),d._setSampler&&n.push(d)}else{var m,p,f,v,y=u.indexOf("[");if(y>=0){if(m=r[u.slice(0,y)],"undefined"==typeof m)continue; -p=m._getLocations(),p.length<=1&&(f=m.value,v=e.getUniformLocation(t,u),p.push(v),f.push(e.getUniform(t,v)))}else{p=[],f=[];for(var g=0;go;++o)l[o].uniform.value=l[o].automaticUniform.getValue(r);for(n=a.length,o=0;n>o;++o)a[o]._set();if(i){var c=this._gl,h=this._program;if(c.validateProgram(h),!c.getProgramParameter(h,c.VALIDATE_STATUS))throw new t("Program validation failed. Link log: "+c.getProgramInfoLog(h))}},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._gl.deleteProgram(this._program),n(this)},D.prototype.release=function(){return this._cachedShader?this._cachedShader.cache.releaseShaderProgram(this):this.destroy()},D}),r("Renderer/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./PixelFormat"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r,n,o,a){this.bottomLeft=i(e,t.ZERO),this.topRight=i(r,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function u(e,r){var i=e.getNumberOfImages(),o=2;if(i>0){var a=e._texture.getWidth(),s=e._texture.getHeight(),u=o*(a+r.width+e._borderWidthInPixels),c=o*(s+r.height+e._borderWidthInPixels),h=a/u,d=s/c,m=new l(new t(a+e._borderWidthInPixels,0),new t(u,s)),p=new l(new t,new t(u,s),e._root,m),f=new l(new t(0,s+e._borderWidthInPixels),new t(u,c)),v=new l(new t,new t(u,c),p,f);e._root=v;for(var y=0;ys||0>u)return void 0;if(0===s&&0===u)return r;if(s>u){r.childNode1=new l(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var h=r.bottomLeft.x+i.width+e._borderWidthInPixels;hu)throw new a("borderWidthInPixels must be greater than or equal to zero.");var c=i(e.initialSize,d);if(c.x<1||c.y<1)throw new a("initialSize must be greater than zero.");this._context=o,this._pixelFormat=i(e.pixelFormat,s.RGBA),this._borderWidthInPixels=u,this._textureCoordinates=[],this._guid=r(),this._texture=this._context.createTexture2D({width:c.x,height:c.y,pixelFormat:this._pixelFormat}),this._root=new l(new t,new t(c.x,c.y));var h=e.images;n(h)&&h.length>0&&this.addImages(h);var m=e.image;n(m)&&this.addImage(m)};return m.prototype.addImage=function(e){var t=this.getNumberOfImages();return h(this,e,t),this._guid=r(),t},m.prototype.addImages=function(e){if(!n(e)||e.length<1)throw new a("images is required and must have length greater than zero.");var t,i=[],o=e.length,s=this.getNumberOfImages();for(t=0;o>t;++t)i.push({image:e[t],index:t+s});for(i.sort(function(e,t){return Math.max(t.image.height,t.image.width)-Math.max(e.image.height,e.image.width)}),t=0;o>t;++t){var l=i[t];h(this,l.image,l.index)}return this._guid=r(),s},m.prototype.addSubRegions=function(t,i){for(var n=this.addImage(t),o=this._texture.getWidth(),a=this._texture.getHeight(),s=this.getNumberOfImages(),l=i.length,u=this._textureCoordinates[n],c=0;l>c;++c){var h=i[c];this._textureCoordinates.push(new e(u.x+h.x/o,u.y+h.y/a,h.width/o,h.height/a))}return this._guid=r(),s},m.prototype.getBorderWidthInPixels=function(){return this._borderWidthInPixels},m.prototype.getTextureCoordinates=function(){return this._textureCoordinates},m.prototype.getTexture=function(){return this._texture},m.prototype.getNumberOfImages=function(){return this._textureCoordinates.length},m.prototype.getGUID=function(){return this._guid},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),o(this)},m}),r("Renderer/UniformState",["../Core/Matrix3","../Core/Matrix4","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/Math","../Core/EncodedCartesian3","../Core/BoundingRectangle","../Core/Transforms","../Core/Simon1994PlanetaryPositions","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,r){t.clone(r,e._view),t.getRotation(r,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function p(e,r){t.clone(r,e._inverseView),t.getRotation(r,e._inverseViewRotation)}function f(e,r){t.clone(r,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function v(e,r){t.clone(r,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function y(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function g(t,r){a(c.computeIcrfToFixedMatrix(r.time,B))||(B=c.computeTemeToPseudoFixedMatrix(r.time,B));var n=h.ComputeSunPositionInEarthInertialFrame(r.time,t._sunPositionWC);e.multiplyByVector(B,n,n),i.normalize(n,t._sunDirectionWC),n=e.multiplyByVector(t.getViewRotation3D(),n,t._sunDirectionEC),i.normalize(n,n),n=h.ComputeMoonPositionInEarthInertialFrame(r.time,t._moonDirectionEC),e.multiplyByVector(B,n,n),e.multiplyByVector(t.getViewRotation3D(),n,n),i.normalize(n,n);var o=r.scene2D.projection,s=o.getEllipsoid(),l=s.cartesianToCartographic(t._sunPositionWC,F);o.project(l,t._sunPositionColumbusView)}function _(e){if(e._viewportDirty){var r=e._viewport;t.computeOrthographicOffCenter(r.x,r.x+r.width,r.y,r.y+r.height,0,1,e._viewportOrthographicMatrix),t.computeViewportTransformation(r,0,1,e._viewportTransformation),e._viewportDirty=!1}}function w(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,t.inverse(e._projection,e._inverseProjection))}function C(e){e._modelViewDirty&&(e._modelViewDirty=!1,t.multiplyTransformation(e._view,e._model,e._modelView))}function x(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,t.multiplyTransformation(e.getView3D(),e._model,e._modelView3D))}function S(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.getModelView(),r=e._modelViewRelativeToEye;r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=0,r[13]=0,r[14]=0,r[15]=t[15]}}function E(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,t.inverse(e.getModelView(),e._inverseModelView))}function b(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,t.inverse(e.getModelView3D(),e._inverseModelView3D))}function T(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,t.multiply(e._projection,e._view,e._viewProjection))}function A(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,t.multiply(e._projection,e.getModelView(),e._modelViewProjection))}function D(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,t.multiply(e._projection,e.getModelViewRelativeToEye(),e._modelViewProjectionRelativeToEye))}function P(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,t.multiply(e._infiniteProjection,e.getModelView(),e._modelViewInfiniteProjection))}function M(e){e._normalDirty&&(e._normalDirty=!1,t.transpose(e.getInverseModelView(),U),t.getRotation(U,e._normal))}function I(e){e._normal3DDirty&&(e._normal3DDirty=!1,t.transpose(e.getInverseModelView3D(),U),t.getRotation(U,e._normal3D))}function O(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,t.getRotation(e.getInverseModelView(),e._inverseNormal))}function R(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,t.getRotation(e.getInverseModelView3D(),e._inverseNormal3D))}function L(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,t.multiplyByPoint(e.getInverseModel(),e._cameraPosition,W),l.fromCartesian(W,e._encodedCameraPositionMC))}function z(e,r,n,o,l,u,h,m){var p=q;p.x=e.y,p.y=e.z,p.z=e.x;var f=G;f.x=n.y,f.y=n.z,f.z=n.x;var v=H;v.x=o.y,v.y=o.z,v.z=o.x;var y=j;y.x=r.y,y.y=r.z,y.z=r.x,u===d.SCENE2D&&(p.z=.5*l);var g=h.unproject(p,Y);g.longitude=s.clamp(g.longitude,-Math.PI,Math.PI),g.latitude=s.clamp(g.latitude,-s.PI_OVER_TWO,s.PI_OVER_TWO);var _=h.getEllipsoid(),w=_.cartographicToCartesian(g,X),C=c.eastNorthUpToFixedFrame(w,_,Z);return t.multiplyByPointAsVector(C,f,f),t.multiplyByPointAsVector(C,v,v),t.multiplyByPointAsVector(C,y,y),a(m)||(m=new t),m[0]=f.x,m[1]=v.x,m[2]=-y.x,m[3]=0,m[4]=f.y,m[5]=v.y,m[6]=-y.y,m[7]=0,m[8]=f.z,m[9]=v.z,m[10]=-y.z,m[11]=0,m[12]=-i.dot(f,w),m[13]=-i.dot(v,w),m[14]=i.dot(y,w),m[15]=1,m}var N=function(){this._viewport=new u,this._viewportDirty=!1,this._viewportOrthographicMatrix=t.clone(t.IDENTITY),this._viewportTransformation=t.clone(t.IDENTITY),this._model=t.clone(t.IDENTITY),this._view=t.clone(t.IDENTITY),this._inverseView=t.clone(t.IDENTITY),this._projection=t.clone(t.IDENTITY),this._infiniteProjection=t.clone(t.IDENTITY),this._entireFrustum=new r,this._currentFrustum=new r,this._pixelSize=0,this._frameState=void 0,this._temeToPseudoFixed=e.clone(t.IDENTITY),this._view3DDirty=!0,this._view3D=new t,this._inverseView3DDirty=!0,this._inverseView3D=new t,this._inverseModelDirty=!0,this._inverseModel=new t,this._viewRotation=new e,this._inverseViewRotation=new e,this._viewRotation3D=new e,this._inverseViewRotation3D=new e,this._inverseProjectionDirty=!0,this._inverseProjection=new t,this._modelViewDirty=!0,this._modelView=new t,this._modelView3DDirty=!0,this._modelView3D=new t,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new t,this._inverseModelViewDirty=!0,this._inverseModelView=new t,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new t,this._viewProjectionDirty=!0,this._viewProjection=new t,this._modelViewProjectionDirty=!0,this._modelViewProjection=new t,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new t,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new t,this._normalDirty=!0,this._normal=new e,this._normal3DDirty=!0,this._normal3D=new e,this._inverseNormalDirty=!0,this._inverseNormal=new e,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new e,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new l,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new r},B=new e,F=new o;N.prototype.updateFrustum=function(e){f(this,e.projectionMatrix),a(e.infiniteProjectionMatrix)&&v(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far};var V=new r,k=new r;N.prototype.update=function(e,t){this._mode=t.mode,this._mapProjection=t.scene2D.projection;var r=t.camera;m(this,r.viewMatrix),p(this,r.inverseViewMatrix),y(this,r),t.mode===d.SCENE2D?(this._frustum2DWidth=r.frustum.right-r.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),g(this,t),V.x=e.getDrawingBufferWidth(),V.y=e.getDrawingBufferHeight();var i=r.frustum.getPixelSize(V,void 0,k);this._pixelSize=Math.max(i.x,i.y),this._entireFrustum.x=r.frustum.near,this._entireFrustum.y=r.frustum.far,this.updateFrustum(r.frustum),this._frameState=t,this._temeToPseudoFixed=c.computeTemeToPseudoFixedMatrix(t.time,this._temeToPseudoFixed)},N.prototype.setViewport=function(e){u.equals(e,this._viewport)||(u.clone(e,this._viewport),this._viewportDirty=!0)},N.prototype.getViewport=function(){return this._viewport},N.prototype.getViewportOrthographic=function(){return _(this),this._viewportOrthographicMatrix},N.prototype.getViewportTransformation=function(){return _(this),this._viewportTransformation},N.prototype.setModel=function(e){t.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._modelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0},N.prototype.getModel=function(){return this._model},N.prototype.getInverseModel=function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,t.inverse(this._model,this._inverseModel)),this._inverseModel},N.prototype.getView=function(){return this._view},N.prototype.getView3D=function(){return this._view3DDirty&&(this._mode===d.SCENE3D?t.clone(this._view,this._view3D):z(this._cameraPosition,this._cameraDirection,this._cameraRight,this._cameraUp,this._frustum2DWidth,this._mode,this._mapProjection,this._view3D),t.getRotation(this._view3D,this._viewRotation3D),this._view3DDirty=!1),this._view3D},N.prototype.getViewRotation=function(){return this._viewRotation},N.prototype.getViewRotation3D=function(){return this.getView3D(),this._viewRotation3D},N.prototype.getInverseView=function(){return this._inverseView},N.prototype.getInverseView3D=function(){return this._inverseView3DDirty&&(t.inverseTransformation(this.getView3D(),this._inverseView3D),t.getRotation(this._inverseView3D,this._inverseViewRotation3D),this._inverseView3DDirty=!1),this._inverseView3D},N.prototype.getInverseViewRotation=function(){return this._inverseViewRotation},N.prototype.getInverseViewRotation3D=function(){return this.getInverseView3D(),this._inverseViewRotation3D},N.prototype.getProjection=function(){return this._projection},N.prototype.getInverseProjection=function(){return w(this),this._inverseProjection},N.prototype.getInfiniteProjection=function(){return this._infiniteProjection},N.prototype.getModelView=function(){return C(this),this._modelView},N.prototype.getModelView3D=function(){return x(this),this._modelView3D},N.prototype.getModelViewRelativeToEye=function(){return S(this),this._modelViewRelativeToEye},N.prototype.getInverseModelView=function(){return E(this),this._inverseModelView},N.prototype.getInverseModelView3D=function(){return b(this),this._inverseModelView3D},N.prototype.getViewProjection=function(){return T(this),this._viewProjection},N.prototype.getModelViewProjection=function(){return A(this),this._modelViewProjection},N.prototype.getModelViewProjectionRelativeToEye=function(){return D(this),this._modelViewProjectionRelativeToEye},N.prototype.getModelViewInfiniteProjection=function(){return P(this),this._modelViewInfiniteProjection};var U=new t;N.prototype.getNormal=function(){return M(this),this._normal},N.prototype.getNormal3D=function(){return I(this),this._normal3D},N.prototype.getInverseNormal=function(){return O(this),this._inverseNormal},N.prototype.getInverseNormal3D=function(){return R(this),this._inverseNormal3D},N.prototype.getEntireFrustum=function(){return this._entireFrustum},N.prototype.getCurrentFrustum=function(){return this._currentFrustum},N.prototype.getEyeHeight2D=function(){return this._eyeHeight2D},N.prototype.getPixelSize=function(){return this._pixelSize},N.prototype.getSunPositionWC=function(){return this._sunPositionWC},N.prototype.getSunPositionColumbusView=function(){return this._sunPositionColumbusView},N.prototype.getSunDirectionWC=function(){return this._sunDirectionWC},N.prototype.getSunDirectionEC=function(){return this._sunDirectionEC},N.prototype.getMoonDirectionEC=function(){return this._moonDirectionEC};var W=new i;N.prototype.getEncodedCameraPositionMCHigh=function(){return L(this),this._encodedCameraPositionMC.high},N.prototype.getEncodedCameraPositionMCLow=function(){return L(this),this._encodedCameraPositionMC.low},N.prototype.getFrameState=function(){return this._frameState},N.prototype.getTemeToPseudoFixedMatrix=function(){return this._temeToPseudoFixed},N.prototype.getHighResolutionSnapScale=function(){return 1};var q=new i,G=new i,H=new i,j=new i,Y=new o,X=new i,Z=new t;return N}),r("Renderer/VertexArray",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/ComponentDatatype"],function(e,t,r,i,n){"use strict";function o(r,o,a){var s=t(o.vertexBuffer),l=t(o.value);if(!s&&!l)throw new i("attribute must have a vertexBuffer or a value.");if(s&&l)throw new i("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");var u=o.value?o.value.length:o.componentsPerAttribute;if(1!==u&&2!==u&&3!==u&&4!==u){if(l)throw new i("attribute.value.length must be in the range [1, 4].");throw new i("attribute.componentsPerAttribute must be in the range [1, 4].")}if(t(o.componentDatatype)&&!n.validate(o.componentDatatype))throw new i("attribute must have a valid componentDatatype or not specify it.");if(t(o.strideInBytes)&&o.strideInBytes>255)throw new i("attribute must have a strideInBytes less than or equal to 255 or not specify it.");var c={index:e(o.index,a),enabled:e(o.enabled,!0),vertexBuffer:o.vertexBuffer,value:l?o.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:e(o.componentDatatype,n.FLOAT),normalize:e(o.normalize,!1),offsetInBytes:e(o.offsetInBytes,0),strideInBytes:e(o.strideInBytes,0)};if(s)c.vertexAttrib=function(e){e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(this.index,this.componentsPerAttribute,this.componentDatatype.value,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(this.index)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(){}}r.push(c)}function a(e,r,i){for(var n=0;ni;++i){var n=e.getExtension(t[i]);if(n)return n}return void 0}function W(e,t,r,i){var n;"number"==typeof r?n=r:"object"==typeof r&&"number"==typeof r.byteLength&&(n=r.byteLength);var o=e.createBuffer();return e.bindBuffer(t,o),e.bufferData(t,r,i),e.bindBuffer(t,null),new p(e,t,n,i,o)}function q(e){if(e._validateFB){var t=e._gl,r=t.checkFramebufferStatus(t.FRAMEBUFFER);if(r!==t.FRAMEBUFFER_COMPLETE){var n;switch(r){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:n="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:n="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:n="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:n="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new i(n)}}}function G(e,t,r){var i=e._currentRenderState;i!==t&&(e._currentRenderState=t,S.partialApply(e._gl,i,t,r))}function H(e,t,i,n){var o=r(i.renderState)?i.renderState:e._defaultRenderState;r(t)&&(t._bind(),q(e,t));var a=i.shaderProgram;a._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,a.maximumTextureUnitIndex),G(e,o,n)}function j(e,i){var n=i.primitiveType,o=i.vertexArray,a=i.offset,s=i.count;e._us.setModel(t(i.modelMatrix,d.IDENTITY)),i.shaderProgram._setUniforms(i.uniformMap,e._us,e._validateSP);var l=o.getIndexBuffer();r(l)?(a*=l.getBytesPerIndex(),s=t(s,l.getNumberOfIndices()),o._bind(),e._gl.drawElements(n,s,l.getIndexDatatype(),a),o._unBind()):(s=t(s,o.numberOfVertices),o._bind(),e._gl.drawArrays(n,a,s),o._unBind())}function Y(e){r(e)&&e._unBind()}function X(e){return e.values.length/e.componentsPerAttribute}function Z(e){return e.componentDatatype.sizeInBytes*e.componentsPerAttribute}function J(e){var t,i,n,o=[];for(i in e)e.hasOwnProperty(i)&&r(e[i])&&r(e[i].values)&&(o.push(i),e[i].componentDatatype.value===a.DOUBLE.value&&(e[i].componentDatatype=a.FLOAT,e[i].values=a.createTypedArray(a.FLOAT,e[i].values)));var s,u=o.length;if(u>0)for(s=X(e[o[0]]),t=1;u>t;++t){var c=X(e[o[t]]);if(c!==s)throw new l("Each attribute list must have the same number of vertices. Attribute "+o[t]+" has a different number of vertices "+"("+c.toString()+")"+" than attribute "+o[0]+" ("+s.toString()+").") -}o.sort(function(t,r){return e[r].componentDatatype.sizeInBytes-e[t].componentDatatype.sizeInBytes});var h=0,d={};for(t=0;u>t;++t)i=o[t],n=e[i],d[i]=h,h+=Z(n);if(h>0){var m=e[o[0]].componentDatatype.sizeInBytes,p=h%m;0!==p&&(h+=m-p);var f=s*h,v=new ArrayBuffer(f),y={};for(t=0;u>t;++t){i=o[t];var g=e[i].componentDatatype.sizeInBytes;y[i]={pointer:a.createTypedArray(e[i].componentDatatype,v),index:d[i]/g,strideInComponentType:h/g}}for(t=0;s>t;++t)for(var _=0;u>_;++_){i=o[_],n=e[i];for(var w=n.values,C=y[i],x=C.pointer,S=n.componentsPerAttribute,E=0;S>E;++E)x[C.index+E]=w[t*S+E];C.index+=C.strideInComponentType}return{buffer:v,offsetsInBytes:d,vertexSizeInBytes:h}}return void 0}function K(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var Q=function(i,n){if(!window.WebGLRenderingContext)throw new l("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=i,n=e(n,!0),n=t(n,{}),n.allowTextureFilterAnisotropic=t(n.allowTextureFilterAnisotropic,!0);var a=t(n.webgl,{});if(a.alpha=t(a.alpha,!1),a.failIfMajorPerformanceCaveat=t(a.failIfMajorPerformanceCaveat,!0),this._originalGLContext=i.getContext("webgl",a)||i.getContext("experimental-webgl",a)||void 0,!r(this._originalGLContext))throw new l("The browser supports WebGL, but initialization failed.");this._id=h(),this._validateFB=!1,this._validateSP=!1,this._logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new E(this);var s=this._gl=this._originalGLContext;this._version=s.getParameter(s.VERSION),this._shadingLanguageVersion=s.getParameter(s.SHADING_LANGUAGE_VERSION),this._vendor=s.getParameter(s.VENDOR),this._renderer=s.getParameter(s.RENDERER),this._redBits=s.getParameter(s.RED_BITS),this._greenBits=s.getParameter(s.GREEN_BITS),this._blueBits=s.getParameter(s.BLUE_BITS),this._alphaBits=s.getParameter(s.ALPHA_BITS),this._depthBits=s.getParameter(s.DEPTH_BITS),this._stencilBits=s.getParameter(s.STENCIL_BITS),this._maximumCombinedTextureImageUnits=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._maximumCubeMapSize=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),this._maximumFragmentUniformVectors=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),this._maximumTextureImageUnits=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),this._maximumRenderbufferSize=s.getParameter(s.MAX_RENDERBUFFER_SIZE),this._maximumTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),this._maximumVaryingVectors=s.getParameter(s.MAX_VARYING_VECTORS),this._maximumVertexAttributes=s.getParameter(s.MAX_VERTEX_ATTRIBS),this._maximumVertexTextureImageUnits=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._maximumVertexUniformVectors=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),this._aliasedLineWidthRange=s.getParameter(s.ALIASED_LINE_WIDTH_RANGE),this._aliasedPointSizeRange=s.getParameter(s.ALIASED_POINT_SIZE_RANGE),this._maximumViewportDimensions=s.getParameter(s.MAX_VIEWPORT_DIMS),this._antialias=s.getContextAttributes().antialias,this._standardDerivatives=U(s,["OES_standard_derivatives"]),this._elementIndexUint=U(s,["OES_element_index_uint"]),this._depthTexture=U(s,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=U(s,["OES_texture_float"]);var u=n.allowTextureFilterAnisotropic?U(s,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=u,this._maximumTextureFilterAnisotropy=r(u)?s.getParameter(u.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,this._vertexArrayObject=U(s,["OES_vertex_array_object"]),this._fragDepth=U(s,["EXT_frag_depth"]);var c=s.getParameter(s.COLOR_CLEAR_VALUE);this._clearColor=new o(c[0],c[1],c[2],c[3]),this._clearDepth=s.getParameter(s.DEPTH_CLEAR_VALUE),this._clearStencil=s.getParameter(s.STENCIL_CLEAR_VALUE);var d=new I,m=new z(this),p=this.createRenderState();this._defaultPassState=m,this._defaultRenderState=p,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=d,this._currentRenderState=p,this._maxFrameTextureUnitIndex=0,this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=n,this.cache={},S.apply(s,p,m)};Q.prototype.getId=function(){return this._id},Q.prototype.getCanvas=function(){return this._canvas},Q.prototype.getShaderCache=function(){return this._shaderCache},Q.prototype.getUniformState=function(){return this._us},Q.prototype.getVersion=function(){return this._version},Q.prototype.getShadingLanguageVersion=function(){return this._shadingLanguageVersion},Q.prototype.getVendor=function(){return this._vendor},Q.prototype.getRenderer=function(){return this._renderer},Q.prototype.getRedBits=function(){return this._redBits},Q.prototype.getGreenBits=function(){return this._greenBits},Q.prototype.getBlueBits=function(){return this._blueBits},Q.prototype.getAlphaBits=function(){return this._alphaBits},Q.prototype.getDepthBits=function(){return this._depthBits},Q.prototype.getStencilBits=function(){return this._stencilBits},Q.prototype.getMaximumCombinedTextureImageUnits=function(){return this._maximumCombinedTextureImageUnits},Q.prototype.getMaximumCubeMapSize=function(){return this._maximumCubeMapSize},Q.prototype.getMaximumFragmentUniformVectors=function(){return this._maximumFragmentUniformVectors},Q.prototype.getMaximumTextureImageUnits=function(){return this._maximumTextureImageUnits},Q.prototype.getMaximumRenderbufferSize=function(){return this._maximumRenderbufferSize},Q.prototype.getMaximumTextureSize=function(){return this._maximumTextureSize},Q.prototype.getMaximumVaryingVectors=function(){return this._maximumVaryingVectors},Q.prototype.getMaximumVertexAttributes=function(){return this._maximumVertexAttributes},Q.prototype.getMaximumVertexTextureImageUnits=function(){return this._maximumVertexTextureImageUnits},Q.prototype.getMaximumVertexUniformVectors=function(){return this._maximumVertexUniformVectors},Q.prototype.getMinimumAliasedLineWidth=function(){return this._aliasedLineWidthRange[0]},Q.prototype.getMaximumAliasedLineWidth=function(){return this._aliasedLineWidthRange[1]},Q.prototype.getMinimumAliasedPointSize=function(){return this._aliasedPointSizeRange[0]},Q.prototype.getMaximumAliasedPointSize=function(){return this._aliasedPointSizeRange[1]},Q.prototype.getMaximumViewportWidth=function(){return this._maximumViewportDimensions[0]},Q.prototype.getMaximumViewportHeight=function(){return this._maximumViewportDimensions[1]},Q.prototype.getAntialias=function(){return this._antialias},Q.prototype.getStandardDerivatives=function(){return!!this._standardDerivatives},Q.prototype.getElementIndexUint=function(){return!!this._elementIndexUint},Q.prototype.getDepthTexture=function(){return!!this._depthTexture},Q.prototype.getFloatingPointTexture=function(){return!!this._textureFloat},Q.prototype.getTextureFilterAnisotropic=function(){return!!this._textureFilterAnisotropic},Q.prototype.getMaximumTextureFilterAnisotropy=function(){return this._maximumTextureFilterAnisotropy},Q.prototype.getVertexArrayObject=function(){return!!this._vertexArrayObject},Q.prototype.getFragmentDepth=function(){return!!this._fragDepth},Q.prototype.getValidateFramebuffer=function(){return this._validateFB},Q.prototype.setValidateFramebuffer=function(e){this._validateFB=e},Q.prototype.getValidateShaderProgram=function(){return this._validateSP},Q.prototype.setValidateShaderProgram=function(e){this._validateSP=e},Q.prototype.getThrowOnWebGLError=function(){return this._throwOnWebGLError},Q.prototype.setThrowOnWebGLError=function(e){this._throwOnWebGLError=e,this._gl=k(this._originalGLContext,e?F:null)},Q.prototype.getLogShaderCompilation=function(){return this._logShaderCompilation},Q.prototype.setLogShaderCompilation=function(e){this._logShaderCompilation=e},Q.prototype.getDefaultTexture=function(){return void 0===this._defaultTexture&&(this._defaultTexture=this.createTexture2D({source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture},Q.prototype.getDefaultCubeMap=function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=this.createCubeMap({source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap},Q.prototype.getDrawingBufferHeight=function(){return this._gl.drawingBufferHeight},Q.prototype.getDrawingBufferWidth=function(){return this._gl.drawingBufferWidth},Q.prototype.createShaderProgram=function(e,t,r){return new b(this._gl,this._logShaderCompilation,e,t,r)},Q.prototype.createVertexBuffer=function(e,t){return W(this._gl,this._gl.ARRAY_BUFFER,e,t)},Q.prototype.createIndexBuffer=function(e,t,r){if(r===s.UNSIGNED_INT&&!this.getElementIndexUint())throw new l("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system.");var i=s.getSizeInBytes(r),n=this._gl,o=W(n,n.ELEMENT_ARRAY_BUFFER,e,t),a=o.getSizeInBytes()/i;return o.getIndexDatatype=function(){return r},o.getBytesPerIndex=function(){return i},o.getNumberOfIndices=function(){return a},o},Q.prototype.createVertexArray=function(e,t){return new O(this._gl,this._vertexArrayObject,e,t)},Q.prototype.createTexture2D=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.source,n=r(i)?i.width:e.width,o=r(i)?i.height:e.height,a=t(e.pixelFormat,_.RGBA),s=t(e.pixelDatatype,g.UNSIGNED_BYTE);if(s===g.FLOAT&&!this.getFloatingPointTexture())throw new l("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(_.isDepthFormat(a)&&!this.getDepthTexture())throw new l("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check getDepthTexture().");var u=e.preMultiplyAlpha||a===_.RGB||a===_.LUMINANCE,c=t(e.flipY,!0),h=this._gl,d=h.TEXTURE_2D,m=h.createTexture();return h.activeTexture(h.TEXTURE0),h.bindTexture(d,m),r(i)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),r(i.arrayBufferView)?h.texImage2D(d,0,a,n,o,0,a,s,i.arrayBufferView):h.texImage2D(d,0,a,a,s,i)):h.texImage2D(d,0,a,n,o,0,a,s,null),h.bindTexture(d,null),new T(h,this._textureFilterAnisotropic,d,m,a,s,n,o,u,c)},Q.prototype.createTexture2DFromFramebuffer=function(e,r,i,n,o){var a=this._gl;e=t(e,_.RGB),r=t(r,0),i=t(i,0),n=t(n,a.drawingBufferWidth),o=t(o,a.drawingBufferHeight);var s=a.TEXTURE_2D,l=a.createTexture();return a.activeTexture(a.TEXTURE0),a.bindTexture(s,l),a.copyTexImage2D(s,0,e,r,i,n,o,0),a.bindTexture(s,null),new T(a,this._textureFilterAnisotropic,s,l,e,void 0,n,o)},Q.prototype.createTextureAtlas=function(e){return e=t(e,{}),e.context=this,new A(e)},Q.prototype.createCubeMap=function(e){function i(e,t){t.arrayBufferView?p.texImage2D(e,0,c,u,u,0,c,h,t.arrayBufferView):p.texImage2D(e,0,c,c,h,t)}e=t(e,t.EMPTY_OBJECT);var n,o,a=e.source;if(r(a)){var s=[a.positiveX,a.negativeX,a.positiveY,a.negativeY,a.positiveZ,a.negativeZ];n=s[0].width,o=s[0].height}else n=e.width,o=e.height;var u=n,c=t(e.pixelFormat,_.RGBA),h=t(e.pixelDatatype,g.UNSIGNED_BYTE);if(h===g.FLOAT&&!this.getFloatingPointTexture())throw new l("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");var d=e.preMultiplyAlpha||c===_.RGB||c===_.LUMINANCE,m=t(e.flipY,!0),p=this._gl,f=p.TEXTURE_CUBE_MAP,y=p.createTexture();return p.activeTexture(p.TEXTURE0),p.bindTexture(f,y),r(a)?(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,m),i(p.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX),i(p.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX),i(p.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY),i(p.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY),i(p.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ),i(p.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ)):(p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,u,u,0,c,h,null)),p.bindTexture(f,null),new v(p,this._textureFilterAnisotropic,f,y,c,h,u,d,m)},Q.prototype.createFramebuffer=function(e){return new y(this._gl,e)},Q.prototype.createRenderbuffer=function(e){var i=this._gl;e=t(e,t.EMPTY_OBJECT);var n=t(e.format,x.RGBA4),o=r(e.width)?e.width:i.drawingBufferWidth,a=r(e.height)?e.height:i.drawingBufferHeight;return new C(i,n,o,a)};var $=0,et={};Q.prototype.createRenderState=function(e){var t=JSON.stringify(e),i=et[t];if(r(i))return i;var n=new S(this,e),o=JSON.stringify(n);return i=et[o],r(i)||(n.id=$++,i=n,et[o]=i),et[t]=i,i},Q.prototype.createSampler=function(e){var i={wrapS:t(e.wrapS,M.CLAMP_TO_EDGE),wrapT:t(e.wrapT,M.CLAMP_TO_EDGE),minificationFilter:t(e.minificationFilter,P.LINEAR),magnificationFilter:t(e.magnificationFilter,D.LINEAR),maximumAnisotropy:r(e.maximumAnisotropy)?e.maximumAnisotropy:1};return i};var tt=new L;return Q.prototype.clear=function(e,i){e=t(e,tt),i=t(i,this._defaultPassState);var n=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;r(s)&&(o.equals(this._clearColor,s)||(o.clone(s,this._clearColor),n.clearColor(s.red,s.green,s.blue,s.alpha)),a|=n.COLOR_BUFFER_BIT),r(l)&&(l!==this._clearDepth&&(this._clearDepth=l,n.clearDepth(l)),a|=n.DEPTH_BUFFER_BIT),r(u)&&(u!==this._clearStencil&&(this._clearStencil=u,n.clearStencil(u)),a|=n.STENCIL_BUFFER_BIT);var c=t(e.renderState,this._defaultRenderState);G(this,c,i);var h=t(e.framebuffer,i.framebuffer);r(h)&&(h._bind(),q(this,h)),n.clear(a),r(h)&&h._unBind()},Q.prototype.draw=function(e,r){r=t(r,this._defaultPassState);var i=t(e.framebuffer,r.framebuffer);H(this,i,e,r),j(this,e),Y(i)},Q.prototype.endFrame=function(){var e=this._gl;e.useProgram(null);var t=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;t>r;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},Q.prototype.readPixels=function(e){var t=this._gl;e=e||{};var r=Math.max(e.x||0,0),i=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer||null,s=new Uint8Array(4*n*o);return a&&(a._bind(),q(this,a)),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),a&&a._unBind(),s},Q.prototype.createVertexArrayFromGeometry=function(e){var i,n,o,l=t(e,t.EMPTY_OBJECT),u=t(l.geometry,t.EMPTY_OBJECT),h=t(l.bufferUsage,f.DYNAMIC_DRAW),d=t(l.attributeIndices,t.EMPTY_OBJECT),p=r(l.vertexLayout)&&l.vertexLayout===R.INTERLEAVED,v=l.vertexArrayAttributes,y=r(v)?v:[],g=u.attributes;if(p){var _=J(g);if(r(_)){o=this.createVertexBuffer(_.buffer,h);var w=_.offsetsInBytes,C=_.vertexSizeInBytes;for(i in g)g.hasOwnProperty(i)&&r(g[i])&&(n=g[i],r(n.values)?y.push({index:d[i],vertexBuffer:o,componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,offsetInBytes:w[i],strideInBytes:C}):y.push({index:d[i],value:n.value,componentDatatype:n.componentDatatype,normalize:n.normalize}))}}else for(i in g)if(g.hasOwnProperty(i)&&r(g[i])){n=g[i];var x=n.componentDatatype;x.value===a.DOUBLE.value&&(x=a.FLOAT),o=void 0,r(n.values)&&(o=this.createVertexBuffer(a.createTypedArray(x,n.values),h)),y.push({index:d[i],vertexBuffer:o,value:n.value,componentDatatype:x,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize})}var S,E=u.indices;return r(E)&&(S=c.computeNumberOfVertices(u)>m.SIXTY_FOUR_KILOBYTES&&this.getElementIndexUint()?this.createIndexBuffer(new Uint32Array(E),h,s.UNSIGNED_INT):this.createIndexBuffer(new Uint16Array(E),h,s.UNSIGNED_SHORT)),this.createVertexArray(y,S)},Q.prototype.createPickFramebuffer=function(){return new w(this)},Q.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},K.prototype.destroy=function(){return delete this._pickObjects[this.key],void 0},Q.prototype.createPickId=function(e){++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new l("Out of unique Pick IDs.");return this._pickObjects[t]=e,new K(this._pickObjects,t,o.fromRgba(t))},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];r(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),n(this)},Q}),r("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when"],function(e,t,r,i){"use strict";var n=function(n,o,a){if(!e(n))throw new t("context is required.");if(!(e(o)&&e(o.positiveX)&&e(o.negativeX)&&e(o.positiveY)&&e(o.negativeY)&&e(o.positiveZ)&&e(o.negativeZ)))throw new t("urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");var s=[r(o.positiveX,a),r(o.negativeX,a),r(o.positiveY,a),r(o.negativeY,a),r(o.positiveZ,a),r(o.negativeZ,a)];return i.all(s,function(e){return n.createCubeMap({source:{positiveX:e[0],negativeX:e[1],positiveY:e[2],negativeY:e[3],positiveZ:e[4],negativeZ:e[5]}})})};return n}),r("ThirdParty/Tween",[],function(){var e=e||function(){var e=[];return{REVISION:"7",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)},update:function(t){if(0===e.length)return!1;var r=0,i=e.length;for(t=void 0!==t?t:Date.now();i>r;)e[r].update(t)?r++:(e.splice(r,1),i--);return!0}}}();return e.Tween=function(t){var r=t,i={},n={},o=1e3,a=0,s=null,l=e.Easing.Linear.None,u=e.Interpolation.Linear,c=[],h=null,d=!1,m=null,p=null;this.to=function(e,t){return void 0!==t&&(o=t),n=e,this},this.start=function(t){e.add(this),d=!1,s=void 0!==t?t:Date.now(),s+=a;for(var o in n)if(null!==r[o]){if(n[o]instanceof Array){if(0===n[o].length)continue;n[o]=[r[o]].concat(n[o])}i[o]=r[o]}return this},this.stop=function(){return e.remove(this),this},this.delay=function(e){return a=e,this},this.easing=function(e){return l=e,this},this.interpolation=function(e){return u=e,this},this.chain=function(){return c=arguments,this},this.onStart=function(e){return h=e,this},this.onUpdate=function(e){return m=e,this},this.onComplete=function(e){return p=e,this},this.update=function(e){if(s>e)return!0;d===!1&&(null!==h&&h.call(r),d=!0);var t=(e-s)/o;t=t>1?1:t;var a=l(t);for(var f in i){var v=i[f],y=n[f];r[f]=y instanceof Array?u(y,a):v+(y-v)*a}if(null!==m&&m.call(r,a),1==t){null!==p&&p.call(r);for(var g=0,_=c.length;_>g;g++)c[g].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/i)))},Out:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/i)+1)},InOut:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/i):.5*r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/i)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return.5>t?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return 0>r?a(t[0],t[1],n):r>1?a(t[i],t[i-1],i-n):a(t[o],t[o+1>i?i:o+1],n-o)},Bezier:function(t,r){var i,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(i=0;o>=i;i++)n+=a(1-r,o-i)*a(r,i)*t[i]*s(o,i);return n},CatmullRom:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(0>r&&(o=Math.floor(n=i*(1+r))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],n-o)):0>r?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):r>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[o?o-1:0],t[o],t[o+1>i?i:o+1],t[o+2>i?i:o+2],n-o)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(t,r){var i=e.Interpolation.Utils.Factorial;return i(t)/i(r)/i(t-r)},Factorial:function(){var e=[1];return function(t){var r,i=1;if(e[t])return e[t];for(r=t;r>1;r--)i*=r;return e[t]=i}}(),CatmullRom:function(e,t,r,i,n){var o=.5*(r-e),a=.5*(i-t),s=n*n,l=n*s;return(2*t-2*r+o+a)*l+(-3*t+3*r-2*o-a)*s+o*n+t}}},e}),r("Scene/AnimationCollection",["../Core/defined","../Core/DeveloperError","../Core/clone","../ThirdParty/Tween","../Core/defaultValue"],function(e,t,r,i,n){"use strict";var o=function(){};return o.prototype.add=function(o){if(o=n(o,n.EMPTY_OBJECT),!e(o.duration))throw new t("duration is required.");if(o.duration>0){var a=n(o.delayDuration,0),s=n(o.easingFunction,i.Easing.Linear.None),l=r(o.startValue),u=new i.Tween(l);return u.onCancel=o.onCancel,u.to(o.stopValue,o.duration),u.delay(a),u.easing(s),"function"==typeof o.onUpdate&&u.onUpdate(function(){o.onUpdate(l)}),u.onComplete(n(o.onComplete,null)),u.start(),{_tween:u}}"function"==typeof o.onComplete&&o.onComplete()},o.prototype.addAlpha=function(r,o,a,s){if(!e(r))throw new t("material is required.");var l=[];for(var u in r.uniforms)r.uniforms.hasOwnProperty(u)&&e(r.uniforms[u])&&e(r.uniforms[u].alpha)&&l.push(u);if(0===l.length)throw new t("material has no properties with alpha components.");o=n(o,0),a=n(a,1),s=n(s,n.EMPTY_OBJECT);var c=n(s.duration,3e3),h=n(s.delayDuration,0),d=n(s.easingFunction,i.Easing.Linear.None),m={alpha:o},p=new i.Tween(m);return p.to({alpha:a},c),p.delay(h),p.easing(d),p.onUpdate(function(){for(var e=l.length,t=0;e>t;++t)r.uniforms[l[t]].alpha=m.alpha}),p.onComplete(n(s.onComplete,null)),p.start(),{_tween:p}},o.prototype.addProperty=function(r,o,a,s,l){if(!e(r))throw new t("object is required.");if(!e(o))throw new t("property is required.");if(!e(r[o]))throw new t("object must have the specified property.");l=n(l,n.EMPTY_OBJECT);var u=n(l.duration,3e3),c=n(l.delayDuration,0),h=n(l.easingFunction,i.Easing.Linear.None),d={value:a},m=new i.Tween(d);return m.to({value:s},u),m.delay(c),m.easing(h),m.onUpdate(function(){r[o]=d.value}),m.onComplete(n(l.onComplete,null)),m.start(),{_tween:m}},o.prototype.addOffsetIncrement=function(r,o){if(!e(r))throw new t("material is required.");if(!e(r.uniforms.offset))throw new t("material must have an offset property.");o=n(o,n.EMPTY_OBJECT);var a=n(o.duration,3e3),s=n(o.delayDuration,0),l=n(o.easingFunction,i.Easing.Linear.None),u={offset:r.uniforms.offset},c=new i.Tween(u);return c.to({offset:r.uniforms.offset+1},a),c.delay(s),c.easing(l),c.onUpdate(function(){r.uniforms.offset=u.offset}),c.onComplete(function(){c.to({offset:r.uniforms.offset+1},a),c.start()}),c.start(),{_tween:c}},o.prototype.remove=function(t){if(e(t)){var r=i.getAll().length;return i.remove(t._tween),i.getAll().length===r-1}return!1},o.prototype.removeAll=function(){for(var e=i.getAll(),t=e.length,r=-1;++rn;n+=3)i=o(r,i,e[n],e[n+1],e[n+2]);return r}var s=function(){throw new t("This type should not be instantiated directly.")};s.attributeIndices={position3DAndHeight:0,textureCoordinates:1};var l=[];return s.getRegularGridIndices=function(t,r){var i=l[t];e(i)||(l[t]=i=[]);var n=i[r];if(!e(n)){n=i[r]=new Uint16Array(6*(t-1)*(r-1));for(var o=0,a=0,s=0;r-1>s;++s){for(var u=0;t-1>u;++u){var c=o,h=c+t,d=h+1,m=c+1;n[a++]=c,n[a++]=h,n[a++]=m,n[a++]=m,n[a++]=h,n[a++]=d,++o}++o}}return n},s.createTileEllipsoidGeometryFromBuffers=function(t,o,a,l){var u=r.FLOAT,c=o.vertices,h=t.createVertexBuffer(c,i.STATIC_DRAW),d=5*u.sizeInBytes,m=3;l&&(d+=u.sizeInBytes,++m);var p=[{index:s.attributeIndices.position3DAndHeight,vertexBuffer:h,componentDatatype:u,componentsPerAttribute:m,offsetInBytes:0,strideInBytes:d},{index:s.attributeIndices.textureCoordinates,vertexBuffer:h,componentDatatype:u,componentsPerAttribute:2,offsetInBytes:m*u.sizeInBytes,strideInBytes:d}],f=o.indices.indexBuffers||{},v=f[t.getId()];if(!e(v)||v.isDestroyed()){var y=o.indices;v=t.createIndexBuffer(y,i.STATIC_DRAW,n.UNSIGNED_SHORT),v.setVertexArrayDestroyable(!1),v.referenceCount=1,f[t.getId()]=v,o.indices.indexBuffers=f}else++v.referenceCount;a.vertexArray=t.createVertexArray(p,v)},s.createWireframeVertexArray=function(e,t,r){var o=a(r.indices),s=e.createIndexBuffer(o,i.STATIC_DRAW,n.UNSIGNED_SHORT);return e.createVertexArray(t._attributes,s)},s.heightmapTerrainQuality=.25,s.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.getMaximumRadius()*Math.PI*s.heightmapTerrainQuality/(t*r)},s.prototype.requestTileGeometry=function(){throw new t("This type should not be instantiated directly.")},s.prototype.getErrorEvent=function(){throw new t("This type should not be instantiated directly.")},s.prototype.getLevelMaximumGeometricError=function(){throw new t("This type should not be instantiated directly.")},s.prototype.getCredit=function(){throw new t("This type should not be instantiated directly.")},s.prototype.getTilingScheme=function(){throw new t("This type should not be instantiated directly.")},s.prototype.hasWaterMask=function(){throw new t("This type should not be instantiated directly.")},s.prototype.isReady=function(){throw new t("This type should not be instantiated directly.")},s}),r("Scene/ImageryState",["../Core/Enumeration"],function(e){"use strict";var t={UNLOADED:new e(0,"UNLOADED"),TRANSITIONING:new e(1,"TRANSITIONING"),RECEIVED:new e(2,"RECEIVED"),TEXTURE_LOADED:new e(3,"TEXTURE_LOADED"),READY:new e(4,"READY"),FAILED:new e(5,"FAILED"),INVALID:new e(6,"INVALID"),PLACEHOLDER:new e(7,"PLACEHOLDER")};return t}),r("Scene/TerrainState",["../Core/Enumeration"],function(e){"use strict";var t={FAILED:new e(0,"FAILED"),UNLOADED:new e(1,"UNLOADED"),RECEIVING:new e(2,"RECEIVING"),RECEIVED:new e(3,"RECEIVED"),TRANSFORMING:new e(4,"TRANSFORMING"),TRANSFORMED:new e(5,"TRANSFORMED"),READY:new e(6,"READY")};return t}),r("Scene/TileState",["../Core/Enumeration"],function(e){"use strict";var t={START:new e(0,"START"),LOADING:new e(1,"LOADING"),READY:new e(2,"READY")};return t}),r("Scene/TileProviderError",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";var r=function(t,r,i,n,o,a){this.provider=t,this.message=r,this.x=i,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1};return r.handleError=function(e,i,n,o,a,s,l,u){var c=e;return t(e)?(c.provider=i,c.message=o,c.x=a,c.y=s,c.level=l,c.retry=!1,++c.timesRetried):c=new r(i,o,a,s,l,0),n.getNumberOfListeners()>0?n.raiseEvent(c):(console.log('An error occurred in "'+i.constructor.name+'":'),console.log(o)),c.retry&&t(u)&&u(),c},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),r("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","./TerrainProvider","./TerrainState","./TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n,l){function u(t){e.data=t,e.state=o.RECEIVED}function c(){e.state=o.FAILED;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+l+".";t._requestError=a.handleError(t._requestError,t,t.getErrorEvent(),r,i,n,l,h)}function h(){e.data=t.requestTileGeometry(i,n,l),r(e.data)?(e.state=o.RECEIVING,s(e.data,u,c)):e.state=o.UNLOADED}h()}function u(e,t,i,n,a,l){var u=i.getTilingScheme(),c=e.data,h=c.createMesh(u,n,a,l);r(h)&&(e.state=o.TRANSFORMING,s(h,function(t){e.mesh=t,e.state=o.TRANSFORMED},function(){e.state=o.FAILED}))}function c(e,t){n.createTileEllipsoidGeometryFromBuffers(t,e.mesh,e,!0),e.state=o.READY}var h=function(e){this.state=o.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e};return h.prototype.freeResources=function(){if(this.state=o.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.getIndexBuffer();this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},h.prototype.publishToTile=function(r){var i=this.mesh;t.clone(i.center,r.center),r.minimumHeight=i.minimumHeight,r.maximumHeight=i.maximumHeight,e.clone(i.boundingSphere3D,r.boundingSphere3D),t.clone(i.occludeePointInScaledSpace,r.occludeePointInScaledSpace),r.freeVertexArray(),r.vertexArray=this.vertexArray,this.vertexArray=void 0},h.prototype.processLoadStateMachine=function(e,t,r,i,n){this.state===o.UNLOADED&&l(this,t,r,i,n),this.state===o.RECEIVED&&u(this,e,t,r,i,n),this.state===o.TRANSFORMED&&c(this,e,t,r,i,n)},h.prototype.processUpsampleStateMachine=function(e,t,n,a,l){if(this.state===o.UNLOADED){var h=this.upsampleDetails;if(!r(h))throw new i("TileTerrain cannot upsample unless provided upsampleDetails.");var d=h.data,m=h.x,p=h.y,f=h.level;if(this.data=d.upsample(t.getTilingScheme(),m,p,f,n,a,l),!r(this.data))return;this.state=o.RECEIVING;var v=this;s(this.data,function(e){v.data=e,v.state=o.RECEIVED},function(){v.state=o.FAILED})}this.state===o.RECEIVED&&u(this,e,t,n,a,l),this.state===o.TRANSFORMED&&c(this,e,t,n,a,l)},h}),r("Scene/Tile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/DeveloperError","./ImageryState","./TerrainState","./TileState","./TileTerrain","../Renderer/PixelDatatype","../Renderer/PixelFormat","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict"; -function p(e,r,n){var o=v(e);i(o)&&(e.upsampledTerrain=new l(o)),_(e)&&(e.loadedTerrain=new l);for(var a=0,s=n.getLength();s>a;++a){var u=n.get(a);u.show&&u._createTileImagerySkeletons(e,r)}var c=e.tilingScheme.getEllipsoid(),h=e.extent;c.cartographicToCartesian(h.getSouthwest(),e.southwestCornerCartesian);var d=c.cartographicToCartesian(h.getSoutheast(),b);c.cartographicToCartesian(h.getNortheast(),e.northeastCornerCartesian);var m=c.cartographicToCartesian(h.getNorthwest(),T);t.negate(e.southwestCornerCartesian,S),t.cross(t.UNIT_Z,S,S),t.normalize(S,e.westNormal),t.negate(e.northeastCornerCartesian,S),t.cross(S,t.UNIT_Z,S),t.normalize(S,e.eastNormal),c.geodeticSurfaceNormal(d,E),t.subtract(e.southwestCornerCartesian,d,S),t.cross(E,S,S),t.normalize(S,e.southNormal),c.geodeticSurfaceNormal(m,E),t.subtract(e.northeastCornerCartesian,m,S),t.cross(E,S,S),t.normalize(S,e.northNormal)}function f(e,t,r){var n=e.loadedTerrain,o=e.upsampledTerrain,s=!1;if(i(n)){if(n.processLoadStateMachine(t,r,e.x,e.y,e.level),n.state.value>=a.RECEIVED.value){if(e.terrainData!==n.data){e.terrainData=n.data;var l=e.terrainData.getWaterMask();i(l)&&(i(e.waterMaskTexture)&&(--e.waterMaskTexture.referenceCount,0===e.waterMaskTexture.referenceCount&&e.waterMaskTexture.destroy()),e.waterMaskTexture=w(t,l),e.waterMaskTranslationAndScale.x=0,e.waterMaskTranslationAndScale.y=0,e.waterMaskTranslationAndScale.z=1,e.waterMaskTranslationAndScale.w=1),g(e)}s=!0}n.state===a.READY?(n.publishToTile(e),e.loadedTerrain=void 0,e.upsampledTerrain=void 0):n.state===a.FAILED&&(e.loadedTerrain=void 0)}!s&&i(o)&&(o.processUpsampleStateMachine(t,r,e.x,e.y,e.level),o.state.value>=a.RECEIVED.value&&e.terrainData!==o.data&&(e.terrainData=o.data,r.hasWaterMask()&&C(e,t),y(e)),o.state===a.READY?(o.publishToTile(e),e.upsampledTerrain=void 0):o.state===a.FAILED&&(e.upsampledTerrain=void 0))}function v(e){for(var t=e.parent;i(t)&&!i(t.terrainData);)t=t.parent;return i(t)?{data:t.terrainData,x:t.x,y:t.y,level:t.level}:void 0}function y(e){if(i(e.children))for(var t=0;4>t;++t){var r=e.children[t];if(r.state!==s.START){if(i(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())continue;i(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new l({data:e.terrainData,x:e.x,y:e.y,level:e.level}),r.state=s.LOADING}}}function g(e){if(i(e.children))for(var t=0;4>t;++t){var r=e.children[t];if(r.state!==s.START){if(i(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())continue;i(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new l({data:e.terrainData,x:e.x,y:e.y,level:e.level}),e.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(i(r.loadedTerrain)||(r.loadedTerrain=new l)),r.state=s.LOADING}}}function _(e){var t=e.parent;return i(t)?i(t.terrainData)?t.terrainData.isChildAvailable(t.x,t.y,e.x,e.y):!1:!0}function w(e,t){var r,n=e.cache.tile_waterMaskData;i(n)||(n=e.cache.tile_waterMaskData={allWaterTexture:void 0,allLandTexture:void 0,sampler:void 0,destroy:function(){i(this.allWaterTexture)&&this.allWaterTexture.destroy(),i(this.allLandTexture)&&this.allLandTexture.destroy()}});var o=Math.sqrt(t.length);return 1!==o||0!==t[0]&&255!==t[0]?(r=e.createTexture2D({pixelFormat:c.LUMINANCE,pixelDatatype:u.UNSIGNED_BYTE,source:{width:o,height:o,arrayBufferView:t}}),r.referenceCount=0,i(n.sampler)||(n.sampler=e.createSampler({wrapS:m.CLAMP_TO_EDGE,wrapT:m.CLAMP_TO_EDGE,minificationFilter:d.LINEAR,magnificationFilter:h.LINEAR})),r.setSampler(n.sampler)):(i(n.allWaterTexture)||(n.allWaterTexture=e.createTexture2D({pixelFormat:c.LUMINANCE,pixelDatatype:u.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}}),n.allWaterTexture.referenceCount=1,n.allLandTexture=e.createTexture2D({pixelFormat:c.LUMINANCE,pixelDatatype:u.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([0]),width:1,height:1}}),n.allLandTexture.referenceCount=1),r=0===t[0]?n.allLandTexture:n.allWaterTexture),++r.referenceCount,r}function C(e){for(var t=e.parent;i(t)&&!i(t.terrainData)||t.terrainData.wasCreatedByUpsampling();)t=t.parent;if(i(t)&&i(t.waterMaskTexture)){e.waterMaskTexture=t.waterMaskTexture,++e.waterMaskTexture.referenceCount;var r=t.extent,n=e.extent,o=n.east-n.west,a=n.north-n.south,s=o/(r.east-r.west),l=a/(r.north-r.south);e.waterMaskTranslationAndScale.x=s*(n.west-r.west)/o,e.waterMaskTranslationAndScale.y=l*(n.south-r.south)/a,e.waterMaskTranslationAndScale.z=s,e.waterMaskTranslationAndScale.w=l}}var x=function(o){if(!i(o))throw new n("description is required.");if(i(o.x)&&i(o.y)){if(o.x<0||o.y<0)throw new n("description.x and description.y must be greater than or equal to zero.")}else if(!i(o.extent))throw new n("Either description.extent is required or description.x and description.y are required.");if(!i(o.level)||o.zoom<0)throw new n("description.level is required and must be greater than or equal to zero.");if(!i(o.tilingScheme))throw new n("description.tilingScheme is required.");this.tilingScheme=o.tilingScheme,this.x=o.x,this.y=o.y,this.level=o.level,this.parent=o.parent,this.children=void 0,this.extent=this.tilingScheme.tileXYToExtent(this.x,this.y,this.level),this.state=s.START,this.replacementPrevious=void 0,this.replacementNext=void 0,this.imagery=[],this.distance=0,this.southwestCornerCartesian=new t,this.northeastCornerCartesian=new t,this.westNormal=new t,this.southNormal=new t,this.eastNormal=new t,this.northNormal=new t,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new r(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.occludeePointInScaledSpace=new t,this.isRenderable=!1,this.loadedTerrain=void 0,this.upsampledTerrain=void 0};x.prototype.getChildren=function(){if(!i(this.children)){var e=this.tilingScheme,t=this.level+1,r=2*this.x,n=2*this.y;this.children=[new x({tilingScheme:e,x:r,y:n,level:t,parent:this}),new x({tilingScheme:e,x:r+1,y:n,level:t,parent:this}),new x({tilingScheme:e,x:r,y:n+1,level:t,parent:this}),new x({tilingScheme:e,x:r+1,y:n+1,level:t,parent:this})]}return this.children},x.prototype.freeResources=function(){i(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.state=s.START,this.isRenderable=!1,this.terrainData=void 0,i(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),i(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0);var e,t,r=this.imagery;for(e=0,t=r.length;t>e;++e)r[e].freeResources();if(this.imagery.length=0,i(this.children)){for(e=0,t=this.children.length;t>e;++e)this.children[e].freeResources();this.children=void 0}this.freeVertexArray()},x.prototype.freeVertexArray=function(){var e;i(this.vertexArray)&&(e=this.vertexArray.getIndexBuffer(),this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),"undefined"!=typeof this.wireframeVertexArray&&(e=this.wireframeVertexArray.getIndexBuffer(),this.wireframeVertexArray.destroy(),this.wireframeVertexArray=void 0,e.isDestroyed()||"undefined"==typeof e.referenceCount||(--e.referenceCount,0===e.referenceCount&&e.destroy()))},x.prototype.processStateMachine=function(e,t,r){this.state===s.START&&(p(this,t,r),this.state=s.LOADING),this.state===s.LOADING&&f(this,e,t);for(var n=i(this.vertexArray),a=!i(this.loadedTerrain)&&!i(this.upsampledTerrain),l=this.imagery,u=0,c=l.length;c>u;++u){var h=l[u];if(i(h.loadingImagery)){if(h.loadingImagery.state===o.PLACEHOLDER){var d=h.loadingImagery.imageryLayer;if(d.getImageryProvider().isReady()){h.freeResources(),l.splice(u,1),d._createTileImagerySkeletons(this,t,u),--u,c=l.length;continue}}var m=h.processStateMachine(this,e);a=a&&m,n=n&&(m||i(h.readyImagery))}}u===c&&(n&&(this.isRenderable=!0),a&&(this.state=s.READY))};var S=new t,E=new t,b=new t,T=new t;return x}),r("Scene/TilingScheme",["../Core/defined","../Core/DeveloperError","./Tile"],function(e,t,r){"use strict";var i=function(){throw new t("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")};return i.prototype.getEllipsoid=function(){throw new t("This type should not be instantiated directly.")},i.prototype.getExtent=function(){throw new t("This type should not be instantiated directly.")},i.prototype.getProjection=function(){throw new t("This type should not be instantiated directly.")},i.prototype.getNumberOfXTilesAtLevel=function(){throw new t("This type should not be instantiated directly.")},i.prototype.getNumberOfYTilesAtLevel=function(){throw new t("This type should not be instantiated directly.")},i.prototype.createLevelZeroTiles=function(){throw new t("This type should not be instantiated directly.")},i.prototype.extentToNativeExtent=function(){throw new t("This type should not be instantiated directly.")},i.prototype.tileXYToNativeExtent=function(){throw new t("This type should not be instantiated directly.")},i.prototype.tileXYToExtent=function(){throw new t("This type should not be instantiated directly.")},i.prototype.positionToTileXY=function(){throw new t("This type should not be instantiated directly.")},i.createRectangleOfLevelZeroTiles=function(i,n,o){if(!e(i))throw new t("tilingScheme is required.");if(!e(n))throw new t("numberOfLevelZeroTilesX is required.");if(!e(o))throw new t("numberOfLevelZeroTilesY is required.");for(var a=new Array(n*o),s=0,l=0;o>l;++l)for(var u=0;n>u;++u)a[s++]=new r({tilingScheme:i,x:u,y:l,level:0});return a},i}),r("Scene/GeographicTilingScheme",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Cartesian2","../Core/Ellipsoid","../Core/Extent","../Core/GeographicProjection","./TilingScheme"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(t){t=e(t,{}),this._ellipsoid=e(t.ellipsoid,o.WGS84),this._extent=e(t.extent,a.MAX_VALUE),this._projection=new s(this._ellipsoid),this._numberOfLevelZeroTilesX=e(t.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=e(t.numberOfLevelZeroTilesY,1)};return u.prototype.getEllipsoid=function(){return this._ellipsoid},u.prototype.getExtent=function(){return this._extent},u.prototype.getProjection=function(){return this._projection},u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<o.north||e.latitudeo.east)return void 0;var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=(o.east-o.west)/a,u=(o.north-o.south)/s,c=0|(e.longitude-o.west)/l;c>=a&&(c=a-1);var h=0|(o.north-e.latitude)/u;return h>=s&&(h=s-1),t(i)?(i.x=c,i.y=h,i):new n(c,h)},u}),r("Scene/TerrainMesh",[],function(){"use strict";var e=function(e,t,r,i,n,o,a){this.center=e,this.vertices=t,this.indices=r,this.minimumHeight=i,this.maximumHeight=n,this.boundingSphere3D=o,this.occludeePointInScaledSpace=a};return e}),r("Scene/HeightmapTerrainData",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/HeightmapTessellator","../Core/Math","../Core/TaskProcessor","./GeographicTilingScheme","./TerrainMesh","./TerrainProvider","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i,n,o,a){var s=1,l=e._width,u=e._height,c=o*(l-1),h=c+l-1,d=a*(u-1),m=d+u-1,p=1<1)for(_=x;S>=_;++_)for(g=w;C>=g;++g)for(var R=(_*l+g)*O,L=0;O>L;++L)M[I++]=T[R+L];else for(_=x;S>=_;++_)for(g=w;C>=g;++g)M[I++]=T[_*l+g];return new y({buffer:M,width:E,height:b,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function h(e,t,r,i,o,a,s,l){var u,c,h,p,f=e._width,g=e._height,_=e._structure,w=_.stride,C=e._buffer,x=new C.constructor(f*g*w),S=t.tileXYToExtent(r,i,o),E=t.tileXYToExtent(a,s,l);if(w>1){var b=_.elementsPerHeight,T=_.elementMultiplier,A=_.isBigEndian,D=Math.pow(T,b-1);for(c=0;g>c;++c)for(h=n.lerp(E.north,E.south,c/(g-1)),u=0;f>u;++u){p=n.lerp(E.west,E.east,u/(f-1));var P=m(C,b,T,w,A,S,f,g,p,h);v(x,b,T,D,w,A,c*f+u,P)}}else for(c=0;g>c;++c)for(h=n.lerp(E.north,E.south,c/(g-1)),u=0;f>u;++u)p=n.lerp(E.west,E.east,u/(f-1)),x[c*f+u]=d(C,S,f,g,p,h);return new y({buffer:x,width:f,height:g,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function d(e,t,r,i,n,o){var a=(n-t.west)*(r-1)/(t.east-t.west),s=(o-t.south)*(i-1)/(t.north-t.south),l=0|a,u=l+1;u>=r&&(u=r-1,l=r-2);var c=0|s,h=c+1;h>=i&&(h=i-1,c=i-2);var d=a-l,m=s-c;c=i-1-c,h=i-1-h;var f=e[c*r+l],v=e[c*r+u],y=e[h*r+l],g=e[h*r+u];return p(d,m,f,v,y,g)}function m(e,t,r,i,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south),d=0|c,m=d+1;m>=a&&(m=a-1,d=a-2);var v=0|h,y=v+1;y>=s&&(y=s-1,v=s-2);var g=c-d,_=h-v;v=s-1-v,y=s-1-y;var w=f(e,t,r,i,n,v*a+d),C=f(e,t,r,i,n,v*a+m),x=f(e,t,r,i,n,y*a+d),S=f(e,t,r,i,n,y*a+m);return p(g,_,w,C,x,S)}function p(e,t,r,i,n,o){return e>t?r+e*(i-r)+t*(o-i):r+e*(o-n)+t*(n-r)}function f(e,t,r,i,n,o){o*=i;var a,s=0;if(n)for(a=0;t>a;++a)s=s*r+e[o+a];else for(a=t-1;a>=0;--a)s=s*r+e[o+a];return s}function v(e,t,r,i,n,o,a,s){a*=n;var l;if(o)for(l=0;t>l;++l)e[a+l]=0|s/i,s-=e[a+l]*i,i/=r;else for(l=t-1;l>=0;--l)e[a+l]=0|s/i,s-=e[a+l]*i,i/=r}var y=function(n){if(!t(n)||!t(n.buffer))throw new r("description.buffer is required.");if(!t(n.width))throw new r("description.width is required.");if(!t(n.height))throw new r("description.height is required.");this._buffer=n.buffer,this._width=n.width,this._height=n.height,this._childTileMask=e(n.childTileMask,15);var o=i.DEFAULT_STRUCTURE,a=n.structure;t(a)?a!==o&&(a.heightScale=e(a.heightScale,o.heightScale),a.heightOffset=e(a.heightOffset,o.heightOffset),a.elementsPerHeight=e(a.elementsPerHeight,o.elementsPerHeight),a.stride=e(a.stride,o.stride),a.elementMultiplier=e(a.elementMultiplier,o.elementMultiplier),a.isBigEndian=e(a.isBigEndian,o.isBigEndian)):a=o,this._structure=a,this._createdByUpsampling=e(n.createdByUpsampling,!1),this._waterMask=n.waterMask},g=new o("createVerticesFromHeightmap");return y.prototype.createMesh=function(e,i,n,o){if(!t(e))throw new r("tilingScheme is required.");if(!t(i))throw new r("x is required.");if(!t(n))throw new r("y is required.");if(!t(o))throw new r("level is required.");var c=e.getEllipsoid(),h=e.tileXYToNativeExtent(i,n,o),d=e.tileXYToExtent(i,n,o),m=c.cartographicToCartesian(d.getCenter()),p=this._structure,f=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,e.getNumberOfXTilesAtLevel(0)),v=f/(1<1){var l=a.elementsPerHeight,u=a.elementMultiplier,c=a.isBigEndian;i=m(this._buffer,l,u,s,c,e,n,o,t,r)}else i=d(this._buffer,e,n,o,t,r);return i*a.heightScale+a.heightOffset},y.prototype.upsample=function(e,i,n,o,a,s,l){if(!t(e))throw new r("tilingScheme is required.");if(!t(i))throw new r("thisX is required.");if(!t(n))throw new r("thisY is required.");if(!t(o))throw new r("thisLevel is required.");if(!t(a))throw new r("descendantX is required.");if(!t(s))throw new r("descendantY is required.");if(!t(l))throw new r("descendantLevel is required.");var u=l-o;if(u>1)throw new r("Upsampling through more than one level at a time is not currently supported.");var d;return d=1===this._width%2&&1===this._height%2?c(this,e,i,n,o,a,s,l):h(this,e,i,n,o,a,s,l)},y.prototype.isChildAvailable=function(e,i,n,o){if(!t(e))throw new r("thisX is required.");if(!t(i))throw new r("thisY is required.");if(!t(n))throw new r("childX is required.");if(!t(o))throw new r("childY is required.");var a=2;return n!==2*e&&++a,o!==2*i&&(a-=2),0!==(this._childTileMask&1<l;++l){var h=s[l],d=4*h.x+h.y*o,m=r[d+3];m>0&&(n=!1)}n&&(r=void 0)}u._missingImagePixels=r,u._isReady=!0}function l(){u._missingImagePixels=void 0,u._isReady=!0}if(a=e(a,{}),!t(a.missingImageUrl))throw new n("description.missingImageUrl is required.");if(!t(a.pixelsToCheck))throw new n("description.pixelsToCheck is required.");this._pixelsToCheck=a.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var u=this;o(r(a.missingImageUrl),s,l)};return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new n("shouldDiscardImage must not be called before the discard policy is ready.");var r=this._pixelsToCheck,o=this._missingImagePixels;if(!t(o))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var a=i(e),s=e.width,l=0,u=r.length;u>l;++l)for(var c=r[l],h=4*c.x+c.y*s,d=0;4>d;++d){var m=h+d;if(a[m]!==o[m])return!1}return!0},a}),r("Scene/ImageryProvider",["../Core/defined","../Core/loadImage","../Core/loadImageViaBlob","../Core/DeveloperError","../Core/throttleRequestByServer"],function(e,t,r,i,n){"use strict";var o=function(){throw this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,new i("This type should not be instantiated directly.")};return o.prototype.isReady=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getExtent=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getTileWidth=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getTileHeight=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getMaximumLevel=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getMinimumLevel=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getTilingScheme=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getTileDiscardPolicy=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getErrorEvent=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getCredit=function(){throw new i("This type should not be instantiated directly.")},o.prototype.getProxy=function(){throw new i("This type should not be instantiated directly.")},o.prototype.requestImage=function(){throw new i("This type should not be instantiated directly.")},o.loadImage=function(i,o){return e(i.getTileDiscardPolicy())?n(o,r):n(o,t)},o}),r("Scene/WebMercatorTilingScheme",["../Core/defaultValue","../Core/defined","../Core/Ellipsoid","../Core/Extent","../Core/Cartesian2","../Core/WebMercatorProjection","./TilingScheme"],function(e,t,r,i,n,o,a){"use strict";var s=function(a){if(a=e(a,{}),this._ellipsoid=e(a.ellipsoid,r.WGS84),this._numberOfLevelZeroTilesX=e(a.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=e(a.numberOfLevelZeroTilesY,1),this._projection=new o(this._ellipsoid),t(a.extentSouthwestInMeters)&&t(a.extentNortheastInMeters))this._extentSouthwestInMeters=a.extentSouthwestInMeters,this._extentNortheastInMeters=a.extentNortheastInMeters;else{var s=this._ellipsoid.getMaximumRadius()*Math.PI;this._extentSouthwestInMeters=new n(-s,-s),this._extentNortheastInMeters=new n(s,s)}var l=this._projection.unproject(this._extentSouthwestInMeters),u=this._projection.unproject(this._extentNortheastInMeters);this._extent=new i(l.longitude,l.latitude,u.longitude,u.latitude)};return s.prototype.getEllipsoid=function(){return this._ellipsoid},s.prototype.getExtent=function(){return this._extent},s.prototype.getProjection=function(){return this._projection},s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<o.north||e.latitudeo.east)return void 0;var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=this._extentNortheastInMeters.x-this._extentSouthwestInMeters.x,u=l/a,c=this._extentNortheastInMeters.y-this._extentSouthwestInMeters.y,h=c/s,d=this._projection,m=d.project(e),p=m.x-this._extentSouthwestInMeters.x,f=this._extentNortheastInMeters.y-m.y,v=0|p/u;v>=a&&(v=a-1);var y=0|f/h;return y>=s&&(y=s-1),t(i)?(i.x=v,i.y=y,i):new n(v,y)},s}),r("Scene/ArcGisMapServerImageryProvider",["../Core/defaultValue","../Core/defined","../Core/jsonp","../Core/Cartesian2","../Core/DeveloperError","../Core/Event","./DiscardMissingTileImagePolicy","./GeographicTilingScheme","./ImageryProvider","./TileProviderError","./WebMercatorTilingScheme","./Credit","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,r,i,n){var o;if(e._useTiles)o=e._url+"/tile/"+n+"/"+i+"/"+r;else{var a=e._tilingScheme.tileXYToNativeExtent(r,i,n),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;o=e._url+"/export?",o+="bbox="+s,o+="&bboxSR=4326&size=256%2C256&imageSR=4326&format=png&transparent=true&f=image"}var l=e._proxy;return t(l)&&(o=l.getURL(o)),o}var p=function(l){function p(e){var r=e.tileInfo;if(g._useTiles&&t(r)){if(g._tileWidth=r.rows,g._tileHeight=r.cols,102100===r.spatialReference.wkid)g._tilingScheme=new c;else{if(4326!==e.tileInfo.spatialReference.wkid){var n="Tile spatial reference WKID "+e.tileInfo.spatialReference.wkid+" is not supported.";return y=u.handleError(y,g,g._errorEvent,n,void 0,void 0,void 0,v),void 0}g._tilingScheme=new s}g._maximumLevel=e.tileInfo.lods.length-1,t(g._tileDiscardPolicy)||(g._tileDiscardPolicy=new a({missingImageUrl:m(g,0,0,g._maximumLevel),pixelsToCheck:[new i(0,0),new i(200,20),new i(20,200),new i(80,110),new i(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),g._useTiles=!0}else g._tileWidth=256,g._tileHeight=256,g._tilingScheme=new s,g._useTiles=!1;t(e.copyrightText)&&e.copyrightText.length>0&&(g._credit=new h(e.copyrightText)),g._ready=!0,u.handleSuccess(y)}function f(){var e="An error occurred while accessing "+g._url+".";y=u.handleError(y,g,g._errorEvent,e,void 0,void 0,void 0,v)}function v(){var e=r(g._url,{parameters:{f:"json"},proxy:g._proxy});d(e,p,f)}if(l=e(l,{}),!t(l.url))throw new n("description.url is required.");this._url=l.url,this._tileDiscardPolicy=l.tileDiscardPolicy,this._proxy=l.proxy,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._tilingScheme=void 0,this._credit=void 0,this._useTiles=e(l.usePreCachedTilesIfAvailable,!0),this._errorEvent=new o,this._ready=!1;var y,g=this;v()};return p.prototype.isUsingPrecachedTiles=function(){return this._useTiles},p.prototype.getUrl=function(){return this._url},p.prototype.getProxy=function(){return this._proxy},p.prototype.getTileWidth=function(){if(!this._ready)throw new n("getTileWidth must not be called before the imagery provider is ready.");return this._tileWidth},p.prototype.getTileHeight=function(){if(!this._ready)throw new n("getTileHeight must not be called before the imagery provider is ready.");return this._tileHeight},p.prototype.getMaximumLevel=function(){if(!this._ready)throw new n("getMaximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel},p.prototype.getMinimumLevel=function(){if(!this._ready)throw new n("getMinimumLevel must not be called before the imagery provider is ready.");return 0},p.prototype.getTilingScheme=function(){if(!this._ready)throw new n("getTilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme},p.prototype.getExtent=function(){if(!this._ready)throw new n("getExtent must not be called before the imagery provider is ready.");return this._tilingScheme.getExtent()},p.prototype.getTileDiscardPolicy=function(){if(!this._ready)throw new n("getTileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy},p.prototype.getErrorEvent=function(){return this._errorEvent},p.prototype.isReady=function(){return this._ready},p.prototype.requestImage=function(e,t,r){if(!this._ready)throw new n("requestImage must not be called before the imagery provider is ready.");var i=m(this,e,t,r);return l.loadImage(this,i)},p.prototype.getCredit=function(){return this._credit},p}),r("Scene/BingMapsStyle",["../Core/Enumeration"],function(e){"use strict";var t={AERIAL:new e(0,"AERIAL",{imagerySetName:"Aerial"}),AERIAL_WITH_LABELS:new e(1,"AERIAL_WITH_LABELS",{imagerySetName:"AerialWithLabels"}),ROAD:new e(2,"ROAD",{imagerySetName:"Road"}),ORDNANCE_SURVEY:new e(3,"ORDNANCE_SURVEY",{imagerySetName:"OrdnanceSurvey"}),COLLINS_BART:new e(4,"COLLINS_BART",{imagerySetName:"CollinsBart"})};return t}),r("Scene/BingMapsImageryProvider",["../Core/defaultValue","../Core/defined","../Core/jsonp","../Core/BingMapsApi","../Core/Cartesian2","../Core/DeveloperError","../Core/Event","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider","./TileProviderError","./WebMercatorTilingScheme","./Credit","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e,r,i,n){var o=e._imageUrlTemplate,a=f.tileXYToQuadKey(r,i,n);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(r+i+n)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return t(u)&&(o=u.getURL(o)),o}var f=function v(u){function f(e){var r=e.resourceSets[0].resources[0];C._tileWidth=r.imageWidth,C._tileHeight=r.imageHeight,C._maximumLevel=r.zoomMax-1,C._imageUrlSubdomains=r.imageUrlSubdomains,C._imageUrlTemplate=r.imageUrl.replace("{culture}",""),t(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new l({missingImageUrl:p(C,0,0,C._maximumLevel),pixelsToCheck:[new n(0,0),new n(120,140),new n(130,160),new n(200,50),new n(200,200)],disableCheckIfAllPixelsAreTransparent:!0})),C._ready=!0,c.handleSuccess(_)}function y(){var e="An error occurred while accessing "+w+".";_=c.handleError(_,C,C._errorEvent,e,void 0,void 0,void 0,g)}function g(){var e=r(w,{callbackParameterName:"jsonp",proxy:C._proxy});m(e,f,y)}if(u=e(u,{}),!t(u.url))throw new o("description.url is required.");this._key=i.getKey(u.key),this._url=u.url,this._mapStyle=e(u.mapStyle,s.AERIAL),this._tileDiscardPolicy=u.tileDiscardPolicy,this._proxy=u.proxy,this._credit=new d("Bing Imagery",v._logoData,"http://www.bing.com"),this.defaultGamma=1,(this._mapStyle===s.AERIAL||this._mapStyle===s.AERIAL_WITH_LABELS)&&(this.defaultGamma=1.3),this._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new a,this._ready=!1; -var _,w=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle.imagerySetName+"?key="+this._key,C=this;g()};return f.prototype.getUrl=function(){return this._url},f.prototype.getProxy=function(){return this._proxy},f.prototype.getKey=function(){return this._key},f.prototype.getMapStyle=function(){return this._mapStyle},f.prototype.getTileWidth=function(){if(!this._ready)throw new o("getTileWidth must not be called before the imagery provider is ready.");return this._tileWidth},f.prototype.getTileHeight=function(){if(!this._ready)throw new o("getTileHeight must not be called before the imagery provider is ready.");return this._tileHeight},f.prototype.getMaximumLevel=function(){if(!this._ready)throw new o("getMaximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel},f.prototype.getMinimumLevel=function(){if(!this._ready)throw new o("getMinimumLevel must not be called before the imagery provider is ready.");return 0},f.prototype.getTilingScheme=function(){if(!this._ready)throw new o("getTilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme},f.prototype.getExtent=function(){if(!this._ready)throw new o("getExtent must not be called before the imagery provider is ready.");return this._tilingScheme.getExtent()},f.prototype.getTileDiscardPolicy=function(){if(!this._ready)throw new o("getTileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy},f.prototype.getErrorEvent=function(){return this._errorEvent},f.prototype.isReady=function(){return this._ready},f.prototype.requestImage=function(e,t,r){if(!this._ready)throw new o("requestImage must not be called before the imagery provider is ready.");var i=p(this,e,t,r);return u.loadImage(this,i)},f.prototype.getCredit=function(){return this._credit},f._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAWCAYAAACcy/8iAAAABGdBTUEAAK/INwWK6QAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAL+UlEQVRYR9WYeVSXZRbHFZB9kX0H2UQBWUQFFJcKl9GOVIBLWDNKc7JSUxwVbFxGBBcUaVGSpCI7ogKOWohWipKC4oqaC4KyCIoCssiOznzuD36NecypM/8095zn/F7e57n3ud/7fO997ksvpLeamppq37591U1NTbXNzc31LCwsdE1MTDQMDQ2ZUlORRb8m6urqKkZGRn0Y2mZmZgaMvujqoaulo6PThyW9e8YfQ8RhAwMDDSsrK4MBAwbYeHh4OLi5udnZ29sb47g282osUzr9iyG6AFOXADk6OloNGjTIZfDgwQMRB1tbW9RNtAGt+izdp8bz5Fnr5RAUQ19fX/VZA0yqHIIqvsk60ekWTU1NVU5F19XV1TY2bk3Y7t2ZK1K/+jrSy8vLldM2RVFHV1dXw9jYWFMGADT09PTUed9HhHfa/fr1M5sW/OKI/RuC4wqSX965bWXIHG9vb1dLS0sjdNXZQw2dPqIrwRU7BEpD5sQObkhQlI79DEjmZC/REx3R1dbW1tDS0tJEV4s5Hd7rKQcM1ZXgc3h61tbWOvxqE3jRVWNObPbqhXIfABtxsh5nz57PevTocVdjY2PD0KFDx6IwEND2DGuebWTwbMUwx4AJTgt9TVxcXJyz4kas79ph3fl4h/mj+lSHW2sXTA5nMztSxZANjdjDFGeIgaXCFs/W8jemTDgJfcBoAUZdgghATd7pYdpI9kKs0LORwbM1e8uvPfadnJ2dOSvX/vjg6ODgYEPwrWGbYvC3OcOQd5rsr0rge8sJq4sz0NC3oODM4X8hjY1Nzb6+vtOdnJyCoOmoYcOGjfLz8xstg+dAHx8fP2jvaWNj44SubOS5dfGoFRUpHsV1X7vXXdzsczQibEwYUXbDSXFqIIwZQhADsaGwhZ2R7BFAnH1wyBkAloA0IoiGADLDtj0+DSJF/GRtj85odEbh02hPT8+gxYuXRKSnZ6zOzNyz6tOtye9GRkaOPnPmzPtnz559X35zc3NnJCYmeuCfHimqTvBVBLAGkTQnSsNOnjx1tBtwY3NwcPD8zz//YvPFi5e+v3PnToFyVFZW5l+9eu27AweyP8WBsYAZjnMjJk4Y++aWtQu2bouL+DIhdkkC9iba2dmNIDgvxcdvjCwoOJ1ZXl6ep7RTVVV16saN4qOHDx9Jff318FCA+3FiAwDugk0vgvPinj17E69du/4De55S6pWVleWfOlWQfeFCYc7du9UlDx8+bHz4sLnxVMGZb8PDw8devnw5/vjx44uqq6v31tfXHzl06NB4Trsvvkg6dQOGchZQwj8/vxtwa2tr+4MHD+o6OzvbeW5B8XZV1Z3rbHxVnltaWpuY67h3v6Z8x460LSNHjgxftGjxUhyo7OjoaL18+adTnED4zFmz5ty8eesK71oY7U1NTfeQ4h47FS0tLY1ip6Gh8f7Ro7np06dPf8PL23vSpsQPl1dU3L7a2dnV0dbW3sraqtu3K69WV98rbmxqqu1CHiM9vrY0Nzc3pKSkrOjfv79vRkbGlJiYmFFFRUWrCwsL56elpQ2Dqfpywr8KWKSr61EXm17bu3d/Skho6BQiHjRkyJCg114LCUtL27mpuLjkgmza2trW9sMPh//5wQd/j6mpqa0RXRhwYd68ectu3Sq9Jn/j8P38kyezoeB7sGKC1IdJkyaFpKZ+FX/lytV8QAuGrry8/O8XLly4jJMsEzwNDQ21Bw8e2hkePuMvUFn0Xl62fEU09gvQ6RTbly79dDEx8aNE/HoFhrjANsljK0DKsIAthoDVIr3UqN6KHFYAJjq/AFxWXlG0YEHkfN6PwYY7BcZJhjwTnMCIiL/OLi6+eUXWcgrtO9J27rp/v0YJuHD//m8y2ts7hCHNe/ft3xEYODIUhwaT0/2x44wdN5wZMXly8J+vF924LHowpy07++C3ytPD5hcEKAQ9P6g+EL1BUHPUjBlvzC0puVkoa+rq6u4uW7Y8CpBDyX0LhgFFUXJWj7W6vNdCrw/FubtKS9Eih80kh58EvGHDpniS/SXmXKGCCcOACOlzFZhSW5xl448//iS+DbSy/tr1ohLw1sozp3bpxIkT38mznO7q2LjlOO1PPbJGv6+YYhjjnCOOBW7btu0jWSty/nyhAogILHgXvSAOxIP19hQdJ/wZTAGciv0sCQx0biLW68hTd+bFTQ2CowZoNYKqxjtVDQ0N5XWnuJakwzKl6fCFUod69vpXWFjYHBRG4qQD14UBTYYWwdHi/sNG336cVMBKpL6+oV7W375dVf0k4Ly8vO/lGcD3YmPXRGFrkIDFjjrbihMaBM4MQD5JSUlrZa0IutceIfK8Oz3jK39//zAJFreBsMyLAI15++3ZkRUVFUWypra2rnz58pURvHcErLbYZigB/geoUgChRgQN4btbRmZmonKzrKzs3QRhItHyxDEbQJoBXobcgR5QfXxW1oF0Uk+xPv9kwWko/UzAa9asW4zTAwmWHlsqHCKI0rQYw5RBycnJcbJWZN/+b7JuV1aWCqspUA+OHcvdN2tWxFvk8ERy+JX18RtiqO7nZF/k8YHsg9vd3d0DCYg1BNTA9i87q6eFQKsCQroT26ioqBlE7gqbPaJy1lGBk4KDXwkjZ/2gjA8U9+b+DZg06eXXtmz5NEHyU2gFUECtTVAWracBr18f/zdOwJUT1mVLBWDAS/cjBcUdSq+WtSLJyZ+lRC9duhJQhdSAlvb29jZoW3Pnzt0S8rWCPRtlTzKp48SJvNwxY8ZIg+NN7MywL+zpztXniIosJDcMyWMPnJtzq7T0nFRBrpJONr6UmZn50a5du9bt2rV7LcUoiaJ0WhyRNVLJY2JW/yM6eukKAN8Xp3sAK3KYSludkJD4PsFy6qGc4gTopgSwAUWlf2pq6kpZK7J1a/Jm2BNMnk5OSfkylvv2m9LSslzu8BOlpaX55eUVl9txTECXlZWXUFgjsT0E/y2kBe2x/1zpLacMaKlmFtDYY8mS6HC6lFSagxIpSkIfACoEjF1cRe3cy2U5OTlfREdHvw0DgqKiot8jj29xt7aeO3f+JHP75fnevfslmzZ9OBOnbGGSFvspAFM7VDkVqaL227dvj2Qpy1takpK2xvBuODXCmzTzpasKkO6K8QJNzISQkNCZOUeP7ZPrUAJEcI+PGz9+AteOHZTW7LH/X0VFVVVVjRPQkTYTmjkEBgb6E70pcXFx75Bjy47k5Oz48ccTGVBueWxsLG3cwmkBAQH+5KBcF84vvPDi0BUrVk5Zs2bNW7NnvzN95syZU6H5W+iHkhae0M4Yh5SUE0rLZ6Um+qZ0SP4bNya8uXbtulmkSxD7+wDYjVrRHxY4MRwYjvgmrerwiRMnRtDc5AlgusKa5ORtUQTH+QkG/SbpTd8un1byHawnwCWvEWcp+Zy8F72tF89u8o45O5wwpZgZMgxwzphKbMmcHb/9+O0HGDtOy5K1hsxrsU5ZQUUUeQwAbQCass6WX5dx48YPj176wdSoqKXTaSYEvAd0dURXPkSc8WsIpz0tPz8/W2jd3NzSmJ6euZo73eX3AhYRZ1Sgm3Ql0nvqsIk+GxqBzZjNeDSRBt+A09GVnKHKy6Xeh7VyzWgzJzq6Mi/FENpqMacu4HrsK6U3e6hILrNWi3UGxMf6k082v07Tc76yquoneub0qVOnSdH0J4hezA+lzoxbtSpmFalSISdMu1kE26YSGPsnUuZ3S28orgIYFa5NVQGkHHKN9bwTwwp69qyXQqTCdSMB+3nIO2qEct3TotDFpnywa+Kzydy5814qKrpxkLohRbPt5s2bF/iI2fjqq6+Gz5+/YC4fG3sePKivliuJktLG3CquJW8YZPpEyvxPonDqGeN58lvWPCkKeuO0HmnjGBoWFpSTcyyltra2hDr2kMuiU+jbXTw7Ovh8raFyn05M/HARYH04fSspgNh5MmX+0CKNiPy7SIMCaERF78fXli83TjgfL+tpPj7j+/br/PyTXx45krOVU42G6n8iOPJNbglYLhnFHfx/AVYpiusR0PLvH32Am0NxR3LWnWbHh+tpCN/Mvjx7U6BcAWoLI6TH1xEqSwqKjW5Tvya9ev0bEj8/qn9c7kYAAAAASUVORK5CYII=",f.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<=0;--n){var o=1<r&&(t.x=r),t.x<-r&&(t.x=-r);var i=e._maxCoord.y*e.maximumTranslateFactor;t.y>i&&(t.y=i),t.y<-i&&(t.y=-i)}function w(e,r){var i,o=e._camera;if(t(r)){var a=n.clone(o.positionWC,K),s=n.clone(o.upWC,Q),l=n.clone(o.rightWC,$),u=n.clone(o.directionWC,et);i=o.transform,o.transform=m.multiplyTransformation(r,i,tt);var c=o.inverseTransform;m.multiplyByPoint(c,a,o.position),m.multiplyByPointAsVector(c,s,o.up),m.multiplyByPointAsVector(c,l,o.right),m.multiplyByPointAsVector(c,u,o.direction)}return i}function C(e,r){if(t(r)){var i=e._camera,o=n.clone(i.positionWC,rt),a=n.clone(i.upWC,it),s=n.clone(i.rightWC,nt),l=n.clone(i.directionWC,ot);i.transform=r,r=i.inverseTransform,m.multiplyByPoint(r,o,i.position),m.multiplyByPointAsVector(r,a,i.up),m.multiplyByPointAsVector(r,s,i.right),m.multiplyByPointAsVector(r,l,i.direction)}}function x(e,r,i){var o=e._camera,a=w(e,i),s=o.position,l=n.normalize(s,lt);if(t(e.constrainedAxis)){var u=n.equalsEpsilon(l,e.constrainedAxis,h.EPSILON2),c=n.equalsEpsilon(l,n.negate(e.constrainedAxis,ht),h.EPSILON2);if(u||c)(u&&0>r||c&&r>0)&&e.rotate(o.right,r);else{var d=n.normalize(e.constrainedAxis,ut),m=n.dot(l,d),p=Math.acos(m);r>0&&r>p&&(r=p),m=n.dot(l,n.negate(d,ht)),p=Math.acos(m),0>r&&-r>p&&(r=-p);var f=n.cross(d,l,ct);e.rotate(f,r)}}else e.rotate(o.right,r);C(e,a)}function S(e,r,i){t(e.constrainedAxis)?e.rotate(e.constrainedAxis,r,i):e.rotate(e._camera.up,r,i)}function E(e,r){var i=e._camera.frustum;if(!(t(i.left)&&t(i.right)&&t(i.top)&&t(i.bottom)))throw new s("The camera frustum is expected to be orthographic for 2D camera control.");r=.5*r;var n=i.right-r,o=i.left+r,a=e._maxCoord.x*e.maximumZoomFactor;n>a&&(n=a,o=-a);var l=i.top/i.right;i.right=n,i.left=o,i.top=i.right*l,i.bottom=-i.top}function b(e,t){var r=e._camera;e.move(r.direction,t)}function T(e,t){var r=e._camera,o=.5*-t.height,a=-o,s=r.frustum;if(a>o){var l=s.top/s.right;s.right=a,s.left=o,s.top=s.right*l,s.bottom=-s.top}i.clone(e._projection.project(t),r.position),n.negate(n.UNIT_Z,r.direction),n.clone(n.UNIT_Y,r.up),n.clone(n.UNIT_X,r.right)}function A(e,t){var r=e._camera,i=e._projection;r.position=i.project(t),n.negate(n.UNIT_Z,r.direction),n.clone(n.UNIT_Y,r.up),n.clone(n.UNIT_X,r.right)}function D(e,t){var r=e._camera,i=e._projection.getEllipsoid();i.cartographicToCartesian(t,r.position),n.negate(r.position,r.direction),n.normalize(r.direction,r.direction),n.cross(r.direction,n.UNIT_Z,r.right),n.cross(r.right,r.direction,r.up),n.cross(r.direction,r.up,r.right)}function P(e){var t=e._camera;return Math.atan2(t.right.y,t.right.x)}function M(e){var t=e._camera,r=e._projection.getEllipsoid(),i=v.eastNorthUpToFixedFrame(t.position,r,dt),n=m.getRotation(i,mt);d.transpose(n,n);var o=d.multiplyByVector(n,t.right,pt);return Math.atan2(o.y,o.x)}function I(e,t){var r=P(e);t=r-t,e.look(n.UNIT_Z,t)}function O(e,t){var r=e._camera,i=n.normalize(r.position,ft),o=M(e);t=o-t,e.look(i,t)}function R(e){var t=e._camera;return h.PI_OVER_TWO-Math.acos(-t.direction.z)}function L(e){var t=e._camera,r=n.normalize(t.position,vt);return n.negate(r,r),h.PI_OVER_TWO-Math.acos(n.dot(t.direction,r))}function z(e,t,r,i,o){var a=e;o&&(a=St);var s=t.north,l=t.south,u=t.east,c=t.west;c>u&&(u+=h.TWO_PI);var d=yt;d.longitude=u,d.latitude=s;var m=r.cartographicToCartesian(d,gt);d.latitude=l;var p=r.cartographicToCartesian(d,Ct);d.longitude=c;var f=r.cartographicToCartesian(d,_t);d.latitude=s;var v=r.cartographicToCartesian(d,wt),y=n.subtract(m,f,xt);n.multiplyByScalar(y,.5,y),n.add(f,y,y),n.subtract(v,y,v),n.subtract(p,y,p),n.subtract(m,y,m),n.subtract(f,y,f);var g=r.geodeticSurfaceNormal(y,a.direction);n.negate(g,g),n.normalize(g,g);var _=n.cross(g,n.UNIT_Z,a.right);n.normalize(_,_);var w=n.cross(_,g,a.up),C=Math.max(Math.abs(n.dot(w,v)),Math.abs(n.dot(w,p)),Math.abs(n.dot(w,m)),Math.abs(n.dot(w,f))),x=Math.max(Math.abs(n.dot(_,v)),Math.abs(n.dot(_,p)),Math.abs(n.dot(_,m)),Math.abs(n.dot(_,f))),S=Math.tan(.5*e.frustum.fovy),E=e.frustum.aspectRatio*S,b=Math.max(x/E,C/S),T=n.magnitude(y)+b;return n.normalize(y,y),n.multiplyByScalar(y,T,i)}function N(e,r,i,o,a){var s=r.north,l=r.south,u=r.east,c=r.west,h=e.inverseTransform,d=Et;d.longitude=u,d.latitude=s;var p=i.project(d,bt);m.multiplyByPoint(e.transform,p,p),m.multiplyByPoint(h,p,p),d.longitude=c,d.latitude=l;var f=i.project(d,Tt);m.multiplyByPoint(e.transform,f,f),m.multiplyByPoint(h,f,f);var v=Math.tan(.5*e.frustum.fovy),y=e.frustum.aspectRatio*v;if(t(o)||(o=new n),o.x=.5*(p.x-f.x)+f.x,o.y=.5*(p.y-f.y)+f.y,o.z=.5*Math.max((p.x-f.x)/y,(p.y-f.y)/v),!a){var g=n.clone(n.UNIT_Z,e.direction);n.negate(g,g),n.clone(n.UNIT_X,e.right),n.clone(n.UNIT_Y,e.up)}return o}function B(e,r,i,o,a){var s=r.north,l=r.south,u=r.east,c=r.west,h=At;h.longitude=u,h.latitude=s;var d=i.project(h,Dt);h.longitude=c,h.latitude=l;var m,p,f=i.project(h,Pt),v=.5*Math.abs(d.x-f.x),y=.5*Math.abs(d.y-f.y),g=e.frustum.right/e.frustum.top,_=y*g;if(v>_?(m=v,p=m/g):(p=y,m=_),y=Math.max(2*m,2*p),t(o)||(o=new n),o.x=.5*(d.x-f.x)+f.x,o.y=.5*(d.y-f.y)+f.y,a)h=i.unproject(o,h),h.height=y,o=i.project(h,o);else{var w=e.frustum;w.right=m,w.left=-m,w.top=p,w.bottom=-p;var C=n.clone(n.UNIT_Z,e.direction);n.negate(C,C),n.clone(n.UNIT_X,e.right),n.clone(n.UNIT_Y,e.up)}return o}function F(t,r,i,n){i=e(i,l.WGS84);var o=t.getPickRay(r,Mt),a=c.rayEllipsoid(o,i);return a?o.getPoint(a.start,n):void 0}function V(e,t,r,i){var n=e.getPickRay(t,It),o=n.origin;o.z=0;var a=r.unproject(o);return a.latitude<-h.PI_OVER_TWO||a.latitude>h.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI?void 0:r.getEllipsoid().cartographicToCartesian(a,i)}function k(e,t,r,i){var o=e.getPickRay(t,Ot),a=-o.origin.x/o.direction.x;o.getPoint(a,i);var s=r.unproject(new n(i.y,i.z,0));return s.latitude<-h.PI_OVER_TWO||s.latitude>h.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI?void 0:r.getEllipsoid().cartographicToCartesian(s,i)}function U(e,t,r){var i=e._context._canvas.clientWidth,o=e._context._canvas.clientHeight,a=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*a,l=e.frustum.near,u=2/i*t.x-1,c=2/o*(o-t.y)-1,h=e.positionWC;n.clone(h,r.origin);var d=n.multiplyByScalar(e.directionWC,l,Rt);n.add(h,d,d);var m=n.multiplyByScalar(e.rightWC,u*l*s,Lt),p=n.multiplyByScalar(e.upWC,c*l*a,zt),f=n.add(d,m,r.direction);return n.add(f,p,f),n.subtract(f,h,f),n.normalize(f,f),r}function W(e,t,r){var i=e._context._canvas.clientWidth,o=e._context._canvas.clientHeight,a=2/i*t.x-1;a*=.5*(e.frustum.right-e.frustum.left);var s=2/o*(o-t.y)-1;s*=.5*(e.frustum.top-e.frustum.bottom);var l=r.origin;return n.clone(e.position,l),l.x+=a,l.y+=s,n.clone(e.directionWC,r.direction),r}function q(e,t){var r=e._camera,i=r.position,o=i.x<-e._maxCoord.x||i.x>e._maxCoord.x,a=i.y<-e._maxCoord.y||i.y>e._maxCoord.y,s=o||a,l=r.frustum,u=l.top,c=l.bottom,d=l.right,m=l.left,p=e._frustum,f=d>e._frustum.right;if(s||f){var v=n.clone(i);v.x>e._maxCoord.x?v.x=e._maxCoord.x:v.x<-e._maxCoord.x&&(v.x=-e._maxCoord.x),v.y>e._maxCoord.y?v.y=e._maxCoord.y:v.y<-e._maxCoord.y&&(v.y=-e._maxCoord.y);var y=function(e){s&&(r.position=n.lerp(i,v,e.time)),f&&(r.frustum.top=h.lerp(u,p.top,e.time),r.frustum.bottom=h.lerp(c,p.bottom,e.time),r.frustum.right=h.lerp(d,p.right,e.time),r.frustum.left=h.lerp(m,p.left,e.time))};return{easingFunction:g.Easing.Exponential.Out,startValue:{time:0},stopValue:{time:1},duration:t,onUpdate:y}}return void 0}function G(e,t,r,i,o,a){var s=n.clone(t);r.y>i?s.y-=r.y-i:r.y<-i&&(s.y+=-i-r.y),r.z>o?s.z-=r.z-o:r.z<-o&&(s.z+=-o-r.z);var l=e._camera,u=function(e){var r=n.lerp(t,s,e.time);l.position=m.multiplyByPoint(l.inverseTransform,r,l.position)};return{easingFunction:g.Easing.Exponential.Out,startValue:{time:0},stopValue:{time:1},duration:a,onUpdate:u}}function H(e,t){var r=e._camera,i=r.position,o=r.direction,a=m.multiplyByPointAsVector(r.inverseTransform,n.UNIT_X,Nt),s=-n.dot(a,i)/n.dot(a,o),l=n.add(i,n.multiplyByScalar(o,s,Bt),Bt);l=m.multiplyByPoint(r.transform,l,l),i=m.multiplyByPoint(r.transform,r.position,Ft);var u=Math.tan(.5*e._camera.frustum.fovy),c=e._camera.frustum.aspectRatio*u,h=n.magnitude(n.subtract(i,l,Vt)),d=c*h,p=u*h,f=e._maxCoord.x,v=e._maxCoord.y,y=Math.max(d-f,f),g=Math.max(p-v,v);if(i.z<-y||i.z>y||i.y<-g||i.y>g){var _=l.y<-y||l.y>y,w=l.z<-g||l.z>g;if(_||w)return G(e,i,l,y,g,t)}return void 0}var j=function(e){if(!t(e))throw new s("camera is required.");this._camera=e,this._mode=y.SCENE3D,this._projection=new u,this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumTranslateFactor=1.5,this.maximumZoomFactor=2.5,this._maxCoord=new n,this._frustum=void 0},Y=new a(Math.PI,h.PI_OVER_TWO);j.prototype.update=function(e,r){var i=!1;e!==this._mode&&(this._mode=e,i=this._mode===y.SCENE2D);var n=r.projection;if(t(n)&&n!==this._projection&&(this._projection=n,this._maxCoord=n.project(Y,this._maxCoord)),i){var o=this._frustum=this._camera.frustum.clone();if(!(t(o.left)&&t(o.right)&&t(o.top)&&t(o.bottom)))throw new s("The camera frustum is expected to be orthographic for 2D camera control.");var a=2,l=o.top/o.right;o.right=this._maxCoord.x*a,o.left=-o.right,o.top=l*o.right,o.bottom=-o.top}};var X=new n;j.prototype.move=function(e,r){if(!t(e))throw new s("direction is required.");var i=this._camera.position;n.multiplyByScalar(e,r,X),n.add(i,X,i),this._mode===y.SCENE2D&&_(this,i)},j.prototype.moveForward=function(t){t=e(t,this.defaultMoveAmount),this.move(this._camera.direction,t)},j.prototype.moveBackward=function(t){t=e(t,this.defaultMoveAmount),this.move(this._camera.direction,-t)},j.prototype.moveUp=function(t){t=e(t,this.defaultMoveAmount),this.move(this._camera.up,t)},j.prototype.moveDown=function(t){t=e(t,this.defaultMoveAmount),this.move(this._camera.up,-t)},j.prototype.moveRight=function(t){t=e(t,this.defaultMoveAmount),this.move(this._camera.right,t)},j.prototype.moveLeft=function(t){t=e(t,this.defaultMoveAmount),this.move(this._camera.right,-t)},j.prototype.lookLeft=function(t){t=e(t,this.defaultLookAmount),this.look(this._camera.up,-t)},j.prototype.lookRight=function(t){t=e(t,this.defaultLookAmount),this.look(this._camera.up,t)},j.prototype.lookUp=function(t){t=e(t,this.defaultLookAmount),this.look(this._camera.right,-t)},j.prototype.lookDown=function(t){t=e(t,this.defaultLookAmount),this.look(this._camera.right,t)};var Z=new p,J=new d;j.prototype.look=function(r,i){if(!t(r))throw new s("axis is required.");var n=e(i,this.defaultLookAmount),o=p.fromAxisAngle(r,-n,Z),a=d.fromQuaternion(o,J),l=this._camera.direction,u=this._camera.up,c=this._camera.right;d.multiplyByVector(a,l,l),d.multiplyByVector(a,u,u),d.multiplyByVector(a,c,c)},j.prototype.twistLeft=function(t){t=e(t,this.defaultLookAmount),this.look(this._camera.direction,t)},j.prototype.twistRight=function(t){t=e(t,this.defaultLookAmount),this.look(this._camera.direction,-t)};var K=new n,Q=new n,$=new n,et=new n,tt=new m,rt=new n,it=new n,nt=new n,ot=new n,at=new p,st=new d;j.prototype.rotate=function(r,i,o){if(!t(r))throw new s("axis is required.");var a=this._camera,l=e(i,this.defaultRotateAmount),u=p.fromAxisAngle(r,-l,at),c=d.fromQuaternion(u,st),h=w(this,o);d.multiplyByVector(c,a.position,a.position),d.multiplyByVector(c,a.direction,a.direction),d.multiplyByVector(c,a.up,a.up),n.cross(a.direction,a.up,a.right),n.cross(a.right,a.direction,a.up),C(this,h)},j.prototype.rotateDown=function(t,r){t=e(t,this.defaultRotateAmount),x(this,t,r)},j.prototype.rotateUp=function(t,r){t=e(t,this.defaultRotateAmount),x(this,-t,r)};var lt=new n,ut=new n,ct=new n,ht=new n;j.prototype.rotateRight=function(t,r){t=e(t,this.defaultRotateAmount),S(this,-t,r)},j.prototype.rotateLeft=function(t,r){t=e(t,this.defaultRotateAmount),S(this,t,r)},j.prototype.zoomIn=function(t){t=e(t,this.defaultZoomAmount),this._mode===y.SCENE2D?E(this,t):b(this,t)},j.prototype.zoomOut=function(t){t=e(t,this.defaultZoomAmount),this._mode===y.SCENE2D?E(this,-t):b(this,-t)},j.prototype.getMagnitude=function(){var e=this._camera;return this._mode===y.SCENE3D?n.magnitude(e.position):this._mode===y.COLUMBUS_VIEW?Math.abs(e.position.z):this._mode===y.SCENE2D?Math.max(e.frustum.right-e.frustum.left,e.frustum.top-e.frustum.bottom):void 0},j.prototype.setPositionCartographic=function(e){if(!t(e))throw new s("cartographic is required.");this._mode===y.SCENE2D?T(this,e):this._mode===y.COLUMBUS_VIEW?A(this,e):this._mode===y.SCENE3D&&D(this,e)};var dt=new m,mt=new d,pt=new n,ft=new n,vt=new n;r(j.prototype,{heading:{get:function(){return this._mode===y.SCENE2D||this._mode===y.COLUMBUS_VIEW?P(this):this._mode===y.SCENE3D?M(this):void 0},set:function(e){if(!t(e))throw new s("angle is required.");this._mode===y.SCENE2D||this._mode===y.COLUMBUS_VIEW?I(this,e):this._mode===y.SCENE3D&&O(this,e)}},tilt:{get:function(){return this._mode===y.COLUMBUS_VIEW?R(this):this._mode===y.SCENE3D?L(this):void 0},set:function(e){if(!t(e))throw new s("angle is required.");if(this._mode===y.COLUMBUS_VIEW||this._mode===y.SCENE3D){var r=this._camera;e=h.clamp(e,0,h.PI_OVER_TWO),e-=this.tilt,this.look(r.right,e)}}}}),j.prototype.lookAt=function(e,r,i){if(!t(e))throw new s("eye is required");if(!t(r))throw new s("target is required");if(!t(i))throw new s("up is required");if(this._mode===y.SCENE2D)throw new s("lookAt is not supported in 2D mode because there is only one direction to look.");if(this._mode===y.MORPHING)throw new s("lookAt is not supported while morphing.");var o=this._camera;o.position=n.clone(e,o.position),o.direction=n.normalize(n.subtract(r,e,o.direction),o.direction),o.right=n.normalize(n.cross(o.direction,i,o.right),o.right),o.up=n.cross(o.right,o.direction,o.up)};var yt=new a,gt=new n,_t=new n,wt=new n,Ct=new n,xt=new n,St={direction:new n,right:new n,up:new n},Et=new a,bt=new n,Tt=new n,At=new a,Dt=new n,Pt=new n;j.prototype.getExtentCameraCoordinates=function(e,r){if(!t(e))throw new s("extent is required");return this._mode===y.SCENE3D?z(this._camera,e,this._projection.getEllipsoid(),r,!0):this._mode===y.COLUMBUS_VIEW?N(this._camera,e,this._projection,r,!0):this._mode===y.SCENE2D?B(this._camera,e,this._projection,r,!0):void 0},j.prototype.viewExtent=function(r,i){if(!t(r))throw new s("extent is required.");i=e(i,l.WGS84),this._mode===y.SCENE3D?z(this._camera,r,i,this._camera.position):this._mode===y.COLUMBUS_VIEW?N(this._camera,r,this._projection,this._camera.position):this._mode===y.SCENE2D&&B(this._camera,r,this._projection,this._camera.position)};var Mt=new f,It=new f,Ot=new f;j.prototype.pickEllipsoid=function(r,i,o){if(!t(r))throw new s("windowPosition is required.");return t(o)||(o=new n),i=e(i,l.WGS84),this._mode===y.SCENE3D?o=F(this,r,i,o):this._mode===y.SCENE2D?o=V(this,r,this._projection,o):this._mode===y.COLUMBUS_VIEW&&(o=k(this,r,this._projection,o)),o};var Rt=new n,Lt=new n,zt=new n;j.prototype.getPickRay=function(e,r){if(!t(e))throw new s("windowPosition is required.");t(r)||(r=new f);var i=this._camera,n=i.frustum;return t(n.aspectRatio)&&t(n.fovy)&&t(n.near)?U(i,e,r):W(i,e,r)};var Nt=new n,Bt=new n,Ft=new n,Vt=new n;return j.prototype.createCorrectPositionAnimation=function(e){if(!t(e))throw new s("duration is required.");return this._mode===y.SCENE2D?q(this,e):this._mode===y.COLUMBUS_VIEW?H(this,e):void 0},j}),r("Scene/CullingVolume",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect"],function(e,t,r,i){"use strict";var n=function(t){this.planes=e(t,[])};return n.prototype.getVisibility=function(e){if(!t(e))throw new r("boundingVolume is required.");for(var n=this.planes,o=!1,a=0,s=n.length;s>a;++a){var l=e.intersect(n[a]);if(l===i.OUTSIDE)return i.OUTSIDE;l===i.INTERSECTING&&(o=!0)}return o?i.INTERSECTING:i.INSIDE},n}),r("Scene/PerspectiveOffCenterFrustum",["../Core/DeveloperError","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Matrix4","../Scene/CullingVolume"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){var t=e.top,r=e.bottom,i=e.right,n=e.left,o=e.near,a=e.far;(t!==e._top||r!==e._bottom||n!==e._left||i!==e._right||o!==e._near||a!==e._far)&&(e._left=n,e._right=i,e._top=t,e._bottom=r,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,i,r,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,i,r,t,o,e._infinitePerspective))}var c=function(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=void 0,this._infinitePerspective=void 0};i(c.prototype,{projectionMatrix:{get:function(){return u(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return u(this),this._infinitePerspective}}});var h=new o,d=new o,m=new o,p=new o;return c.prototype.computeCullingVolume=function(e,t,i){var n=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,f=this.near,v=this.far,y=o.cross(t,i,h),g=d;o.multiplyByScalar(t,f,g),o.add(e,g,g);var _=m;o.multiplyByScalar(t,v,_),o.add(e,_,_);var w=p;o.multiplyByScalar(y,c,w),o.add(g,w,w),o.subtract(w,e,w),o.normalize(w,w),o.cross(w,i,w);var C=n[0];return r(C)||(C=n[0]=new a),C.x=w.x,C.y=w.y,C.z=w.z,C.w=-o.dot(w,e),o.multiplyByScalar(y,u,w),o.add(g,w,w),o.subtract(w,e,w),o.normalize(w,w),o.cross(i,w,w),C=n[1],r(C)||(C=n[1]=new a),C.x=w.x,C.y=w.y,C.z=w.z,C.w=-o.dot(w,e),o.multiplyByScalar(i,l,w),o.add(g,w,w),o.subtract(w,e,w),o.normalize(w,w),o.cross(y,w,w),C=n[2],r(C)||(C=n[2]=new a),C.x=w.x,C.y=w.y,C.z=w.z,C.w=-o.dot(w,e),o.multiplyByScalar(i,s,w),o.add(g,w,w),o.subtract(w,e,w),o.normalize(w,w),o.cross(w,y,w),C=n[3],r(C)||(C=n[3]=new a),C.x=w.x,C.y=w.y,C.z=w.z,C.w=-o.dot(w,e),C=n[4],r(C)||(C=n[4]=new a),C.x=t.x,C.y=t.y,C.z=t.z,C.w=-o.dot(t,g),o.negate(t,w),C=n[5],r(C)||(C=n[5]=new a),C.x=w.x,C.y=w.y,C.z=w.z,C.w=-o.dot(w,_),this._cullingVolume},c.prototype.getPixelSize=function(e,i,o){u(this);var a=e.x,s=e.y;i=t(i,this.near);var l=1/this.near,c=this.top*l,h=2*i*c/s;c=this.right*l;var d=2*i*c/a;return r(o)?(o.x=d,o.y=h,o):new n(d,h)},c.prototype.clone=function(e){return r(e)||(e=new c),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},c.prototype.equals=function(e){return r(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},c}),r("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/PerspectiveOffCenterFrustum"],function(e,t,r,i){"use strict";function n(e){var t=e._offCenterFrustum;(e.fovy!==e._fovy||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far)&&(e._fovy=e.fovy,e._aspectRatio=e.aspectRatio,e._near=e.near,e._far=e.far,t.top=e.near*Math.tan(.5*e.fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far)}var o=function(){this._offCenterFrustum=new i,this.fovy=void 0,this._fovy=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far};return t(o.prototype,{projectionMatrix:{get:function(){return n(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return n(this),this._offCenterFrustum.infiniteProjectionMatrix}}}),o.prototype.computeCullingVolume=function(e,t,r){return n(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},o.prototype.getPixelSize=function(e,t,r){return n(this),this._offCenterFrustum.getPixelSize(e,t,r)},o.prototype.clone=function(t){return e(t)||(t=new o),t.fovy=this.fovy,t.aspectRatio=this.aspectRatio,t.near=this.near,t.far=this.far,t._fovy=void 0,t._aspectRatio=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},o.prototype.equals=function(t){return e(t)?(n(this),n(t),this.fovy===t.fovy&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum)):!1},o}),r("Scene/Camera",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","../Core/Ellipsoid","../Core/Cartesian3","../Core/Cartesian4","../Core/Matrix4","./CameraController","./PerspectiveFrustum"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){var t=e._right,r=e._up,i=e._direction,n=e._position,a=e._viewMatrix;a[0]=t.x,a[1]=r.x,a[2]=-i.x,a[3]=0,a[4]=t.y,a[5]=r.y,a[6]=-i.y,a[7]=0,a[8]=t.z,a[9]=r.z,a[10]=-i.z,a[11]=0,a[12]=-o.dot(t,n),a[13]=-o.dot(r,n),a[14]=o.dot(i,n),a[15]=1,s.multiply(a,e._invTransform,e._viewMatrix),s.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function h(e){var t=e._position,r=!o.equals(t,e.position);r&&(t=o.clone(e.position,e._position));var n=e._direction,a=!o.equals(n,e.direction);a&&(n=o.clone(e.direction,e._direction));var l=e._up,u=!o.equals(l,e.up);u&&(l=o.clone(e.up,e._up));var h=e._right,d=!o.equals(h,e.right);d&&(h=o.clone(e.right,e._right));var p=e._transform,f=!s.equals(p,e.transform);if(f&&(p=s.clone(e.transform,e._transform),s.inverseTransformation(e._transform,e._invTransform)),(r||f)&&(e._positionWC=s.multiplyByPoint(p,t,e._positionWC)),a||u||d){var v=o.dot(n,o.cross(l,h,m));if(Math.abs(1-v)>i.EPSILON2){n=o.normalize(n,e._direction),o.clone(n,e.direction);var y=1/o.magnitudeSquared(l),g=o.dot(l,n)*y,_=o.multiplyByScalar(n,g,m);l=o.normalize(o.subtract(l,_,e._up),e._up),o.clone(l,e.up),h=o.cross(n,l,e._right),o.clone(h,e.right)}}(a||f)&&(e._directionWC=s.multiplyByPointAsVector(p,n,e._directionWC)),(u||f)&&(e._upWC=s.multiplyByPointAsVector(p,l,e._upWC)),(d||f)&&(e._rightWC=s.multiplyByPointAsVector(p,h,e._rightWC)),(r||a||u||d||f)&&c(e)}var d=function(t){if(!e(t))throw new r("context is required.");this.transform=s.clone(s.IDENTITY),this._transform=s.clone(s.IDENTITY),this._invTransform=s.clone(s.IDENTITY);var a=n.WGS84.getMaximumRadius(),h=o.multiplyByScalar(o.normalize(new o(0,-2,1)),2.5*a);this.position=h,this._position=o.clone(h),this._positionWC=o.clone(h);var d=o.normalize(o.negate(h));this.direction=d,this._direction=o.clone(d),this._directionWC=o.clone(d);var m=o.normalize(o.cross(d,o.UNIT_Z)),p=o.cross(m,d);this.up=p,this._up=o.clone(p),this._upWC=o.clone(p),m=o.cross(d,p),this.right=m,this._right=o.clone(m),this._rightWC=o.clone(m),this.frustum=new u,this.frustum.fovy=i.toRadians(60),this.frustum.aspectRatio=t.getDrawingBufferWidth()/t.getDrawingBufferHeight(),this.controller=new l(this),this._viewMatrix=new s,this._invViewMatrix=new s,c(this),this._context=t},m=new o;return t(d.prototype,{inverseTransform:{get:function(){return h(this),this._invTransform}},viewMatrix:{get:function(){return h(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return h(this),this._invViewMatrix}},positionWC:{get:function(){return h(this),this._positionWC}},directionWC:{get:function(){return h(this),this._directionWC}},upWC:{get:function(){return h(this),this._upWC}},rightWC:{get:function(){return h(this),this._rightWC}}}),d.prototype.clone=function(){var e=new d(this._context);return e.position=o.clone(this.position),e.direction=o.clone(this.direction),e.up=o.clone(this.up),e.right=o.clone(this.right),e.transform=s.clone(this.transform),e.frustum=this.frustum.clone(),e},d.prototype.worldToCameraCoordinates=function(t,i){if(!e(t))throw new r("cartesian is required.");return s.multiplyByVector(this.inverseTransform,t,i)},d.prototype.cameraToWorldCoordinates=function(t,i){if(!e(t))throw new r("cartesian is required.");return s.multiplyByVector(this.transform,t,i)},d}),r("Scene/CameraEventType",["../Core/Enumeration"],function(e){"use strict";var t={LEFT_DRAG:new e(0,"LEFT_DRAG"),RIGHT_DRAG:new e(1,"RIGHT_DRAG"),MIDDLE_DRAG:new e(2,"MIDDLE_DRAG"),WHEEL:new e(3,"WHEEL"),PINCH:new e(4,"PINCH")};return t}),r("Scene/CameraEventAggregator",["../Core/defined","../Core/defaultValue","../Core/DeveloperError","../Core/destroyObject","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Cartesian2","../Core/KeyboardEventModifier","./CameraEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r){var i=t.name;return e(r)&&(i+="+"+r.name),i}function h(e,t){s.clone(e.distance.startPosition,t.distance.startPosition),s.clone(e.distance.endPosition,t.distance.endPosition),s.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),s.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function d(t,r,i){var n=c(u.PINCH,r),o=t._update,l=t._isDown,d=t._pressTime,m=t._releaseTime;o[n]=!0,l[n]=!1;var p=t._movement[n];e(p)||(p=t._movement[n]={}),p.distance={startPosition:new s,endPosition:new s},p.angleAndHeight={startPosition:new s,endPosition:new s},p.prevAngle=0,t._eventHandler.setInputAction(function(){t._buttonsDown++,l[n]=!0,d[n]=new Date},a.PINCH_START,r),t._eventHandler.setInputAction(function(){t._buttonsDown=Math.max(t._buttonsDown-1,0),l[n]=!1,m[n]=new Date -},a.PINCH_END,r),t._eventHandler.setInputAction(function(e){if(l[n]){o[n]?(h(e,p),o[n]=!1,p.prevAngle=p.angleAndHeight.startPosition.x):(s.clone(e.distance.endPosition,p.distance.endPosition),s.clone(e.angleAndHeight.endPosition,p.angleAndHeight.endPosition));for(var t=p.angleAndHeight.endPosition.x,r=p.prevAngle,a=2*Math.PI;t>=r+Math.PI;)t-=a;for(;t0},y.prototype.getButtonPressTime=function(t,i){if(!e(t))throw new r("type is required.");var n=c(t,i);return this._pressTime[n]},y.prototype.getButtonReleaseTime=function(t,i){if(!e(t))throw new r("type is required.");var n=c(t,i);return this._releaseTime[n]},y.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),i(this)},y}),r("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/clone","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/HermiteSpline","../Core/Math","../Core/Matrix3","../Core/Quaternion","../Core/QuaternionSpline","../Scene/PerspectiveFrustum","../Scene/PerspectiveOffCenterFrustum","../Scene/SceneMode","../ThirdParty/Tween"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,r,i){return t.cross(e,r,M),t.cross(M,e,I),P[0]=M.x,P[1]=I.x,P[2]=-e.x,P[3]=M.y,P[4]=I.y,P[5]=-e.y,P[6]=M.z,P[7]=I.z,P[8]=-e.z,u.fromRotationMatrix(P,i)}function v(e,t,r){var i,n,o;if(e instanceof h){var a=Math.tan(.5*e.fovy);return i=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*i/o,r*i/n)}return e instanceof d?(i=e.near,n=e.top,o=e.right,Math.max(t*i/o,r*i/n)):Math.max(t,r)}function y(e,r,i,n,o){var c,h,d,m=r.getMaximumRadius(),p=e.frustum,f=v(p,m,m),y=t.dot(t.normalize(i),t.normalize(n));if(t.magnitude(i)>f)h=m+.6*(f-m),d=.35;else{var g=t.subtract(i,n);h=t.magnitude(t.add(t.multiplyByScalar(g,.5),n));var _=t.magnitude(t.multiplyByScalar(e.up,t.dot(g,e.up))),w=t.magnitude(t.multiplyByScalar(e.right,t.dot(g,e.right)));h+=v(p,_,w),d=s.clamp(y+1,.25,.5)}var C,x,S,E,b=t.multiplyByScalar(t.normalize(n),h),T=t.multiplyByScalar(t.normalize(i),h);if(t.magnitude(n)>f&&y>.75)E=t.add(t.multiplyByScalar(t.subtract(i,n),.5),n),c=[i,E,n];else if(t.magnitude(i)>f&&y>0)E=t.add(t.multiplyByScalar(t.subtract(i,b),.5),b),c=[i,E,n];else{c=[i],x=Math.acos(t.dot(t.normalize(T),t.normalize(b))),C=t.cross(b,T),t.equalsEpsilon(C,t.ZERO,s.EPSILON6)&&(C=t.UNIT_Z);for(var A=d*x,D=x-A,P=D;P>0;P-=A)S=l.fromQuaternion(u.fromAxisAngle(C,P)),c.push(l.multiplyByVector(S,b));c.push(n)}for(var M=new Array(c.length),I=o/(c.length-1),O=0;Oh;++h)l=a[h],t.normalize(t.negate(l,O),O),t.normalize(t.cross(O,t.UNIT_Z,R),R),t.cross(R,O,L),s[h]=f(O,L,z);return l=a[u],n(i)&&n(o)?s[u]=f(i,o):(t.normalize(t.negate(l,O),O),t.normalize(t.cross(O,t.UNIT_Z,R),R),t.cross(R,O,L),s[u]=f(O,L,z)),new c({points:s,times:r.times})}function _(e,r,i,n,o){var a=e.camera,s=e.scene2D.projection.getEllipsoid(),u=y(a,s,a.position,r,i),c=g(a,u,n,o),h=function(e){var r=e.time,i=c.evaluate(r);l.fromQuaternion(i,D),a.position=u.evaluate(r),a.right=l.getRow(D,0,a.right),a.up=l.getRow(D,1,a.up),a.direction=t.negate(l.getRow(D,2,a.direction),a.direction)};return h}function w(e,r,i,n,o){var l,u,c=r.getMaximumRadius(),h=e.frustum,d=v(h,Math.PI*c,s.PI_OVER_TWO*c),m=.5;if(i.z>d)u=.6*d;else{var p=t.subtract(i,n);u=v(h,Math.abs(p.y),Math.abs(p.x))}var f=t.clone(n);f.z=u;var y=t.clone(i);y.z=u;var g;if(n.z>d)g=t.add(t.multiplyByScalar(t.subtract(i,n),.5),n),l=[i,g,n];else if(i.z>d)g=t.add(t.multiplyByScalar(t.subtract(i,f),.5),f),l=[i,g,n];else{l=[i];var _=t.subtract(y,f),w=t.magnitude(_);t.normalize(_,_);for(var C=m*w,x=w-C,S=x;S>0;S-=C)l.push(t.add(t.multiplyByScalar(_,S),f));l.push(n)}for(var E=new Array(l.length),b=o/(l.length-1),T=0;Tl;++l)a[l]=V;return a[s]=n(r)&&n(i)?f(r,i):V,new c({points:a,times:t.times})}function x(e,r,i,n,o){var a=e.camera,s=e.scene2D.projection.getEllipsoid(),u=w(a,s,t.clone(a.position),r,i),c=C(a,u,n,o),h=function(e){var r=e.time,i=c.evaluate(r);l.fromQuaternion(i,D),a.position=u.evaluate(r,a.position),a.right=l.getRow(D,0,a.right),a.up=l.getRow(D,1,a.up),a.direction=t.negate(l.getRow(D,2,a.direction),a.direction)};return h}function S(e,r,i,n,o){var a=e.camera,s=e.scene2D.projection.getEllipsoid(),u=t.clone(a.position);u.z=a.frustum.right-a.frustum.left;var c=w(a,s,u,r,i),h=C(a,c,t.negate(t.UNIT_Z),o),d=a.position.z,m=function(e){var r=e.time,i=h.evaluate(r);l.fromQuaternion(i,D),a.position=c.evaluate(r);var n=a.position.z;a.position.z=d,a.right=l.getRow(D,0,a.right),a.up=l.getRow(D,1,a.up),a.direction=t.negate(l.getRow(D,2,a.direction),a.direction);var o=a.frustum,s=o.top/o.right,u=.5*(n-(o.right-o.left));o.right+=u,o.left-=u,o.top=s*o.right,o.bottom=-o.top};return m}function E(e){var t={enableTranslate:e.enableTranslate,enableZoom:e.enableZoom,enableRotate:e.enableRotate,enableTilt:e.enableTilt,enableLook:e.enableLook};return e.enableTranslate=!1,e.enableZoom=!1,e.enableRotate=!1,e.enableTilt=!1,e.enableLook=!1,t}function b(e,t){e.enableTranslate=t.enableTranslate,e.enableZoom=t.enableZoom,e.enableRotate=t.enableRotate,e.enableTilt=t.enableTilt,e.enableLook=t.enableLook}var T={},A=new t,D=new l,P=new l,M=new t,I=new t,O=new t,R=new t,L=new t,z=new u,N=t.negate(t.UNIT_Z),B=t.normalize(t.cross(N,t.UNIT_Y)),F=t.cross(B,N),V=f(N,F),k=new t,U=new t,W=new t;return T.createAnimation=function(r,a){a=i(a,i.EMPTY_OBJECT);var l=a.destination,u=a.direction,c=a.up;if(!n(r))throw new o("scene is required.");if(!n(l))throw new o("destination is required.");if(n(u)&&!n(c)||n(c)&&!n(u))throw new o("If either direction or up is given, then both are required.");var h=r.getFrameState();if(h.mode===m.MORPHING)throw new o("frameState.mode cannot be SceneMode.MORPHING");var d=i(a.duration,3e3),f=r.getScreenSpaceCameraController(),v=E(f),y=function(e){var t=function(){"function"==typeof e&&e(),b(f,v)};return t},g=y(a.onComplete),w=y(a.onCancel),C=h.camera.frustum;if(h.mode===m.SCENE2D){if(e.equalsEpsilon(h.camera.position,l,s.EPSILON6)&&s.equalsEpsilon(Math.max(C.right-C.left,C.top-C.bottom),l.z,s.EPSILON6))return{duration:0,onComplete:g,onCancel:w}}else if(t.equalsEpsilon(l,h.camera.position,s.EPSILON6))return{duration:0,onComplete:g,onCancel:w};if(0>=d){var T=function(){var e=l;if(h.mode===m.SCENE3D?(n(a.direction)||n(a.up)?(k=a.direction,U=t.normalize(t.cross(k,a.up,U),U)):(k=t.normalize(t.negate(e,k),k),U=t.normalize(t.cross(k,t.UNIT_Z,U),U)),W=i(a.up,t.cross(U,k,W))):(n(a.direction)||n(a.up)?(k=a.direction,U=t.normalize(t.cross(k,a.up,U),U)):(k=t.negate(t.UNIT_Z,k),U=t.normalize(t.cross(k,t.UNIT_Y,U),U)),W=i(a.up,t.cross(U,k,W))),t.clone(e,h.camera.position),t.clone(k,h.camera.direction),t.clone(W,h.camera.up),t.clone(U,h.camera.right),h.mode===m.SCENE2D){var r=h.camera.position.z,o=C.top/C.right,s=.5*(r-(C.right-C.left));C.right+=s,C.left-=s,C.top=o*C.right,C.bottom=-C.top}"function"==typeof g&&g()};return{duration:0,onComplete:T,onCancel:w}}var A;return A=h.mode===m.SCENE3D?_(h,l,d,u,c):h.mode===m.SCENE2D?S(h,l,d,u,c):x(h,l,d,u,c),{duration:d,easingFunction:p.Easing.Sinusoidal.InOut,startValue:{time:0},stopValue:{time:d},onUpdate:A,onComplete:g,onCancel:w}},T.createAnimationCartographic=function(e,t){t=i(t,i.EMPTY_OBJECT);var a=t.destination;if(!n(e))throw new o("scene is required.");if(!n(a))throw new o("description.destination is required.");var s=e.getFrameState(),l=s.scene2D.projection;if(s.mode===m.SCENE3D){var u=l.getEllipsoid();u.cartographicToCartesian(a,A)}else{if(s.mode!==m.COLUMBUS_VIEW&&s.mode!==m.SCENE2D)throw new o("frameState.mode cannot be SceneMode.MORPHING");l.project(a,A)}var c=r(t);return c.destination=A,this.createAnimation(e,c)},T.createAnimationExtent=function(e,t){t=i(t,i.EMPTY_OBJECT);var a=t.destination,s=e.getFrameState();if(!n(s))throw new o("frameState is required.");if(!n(a))throw new o("description.destination is required.");if(s.mode===m.MORPHING)throw new o("frameState.mode cannot be SceneMode.MORPHING");var l=r(t),u=s.camera;return u.controller.getExtentCameraCoordinates(a,A),l.destination=A,this.createAnimation(e,l)},T}),r("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,r){"use strict";var i=function(t,i,n,o,a){if(this.imageryLayer=t,this.x=i,this.y=n,this.level=o,0!==o){var s=0|i/2,l=0|n/2,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=r.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.referenceCount=0,!e(a)&&t.getImageryProvider().isReady()){var c=t.getImageryProvider().getTilingScheme();a=c.tileXYToExtent(i,n,o)}this.extent=a};return i.createPlaceholder=function(e){var t=new i(e,0,0,0);return t.addReference(),t.state=r.PLACEHOLDER,t},i.prototype.addReference=function(){++this.referenceCount},i.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&e(this.texture.destroy)&&this.texture.destroy(),t(this),0):this.referenceCount},i}),r("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";var r=function(e,t){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateExtent=t,this.textureTranslationAndScale=void 0};return r.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},r.prototype.processStateMachine=function(r,i){var n=this.loadingImagery,o=n.imageryLayer;if(n.state===t.UNLOADED&&(n.state=t.TRANSITIONING,o._requestImagery(n)),n.state===t.RECEIVED&&(n.state=t.TRANSITIONING,o._createTexture(i,n)),n.state===t.TEXTURE_LOADED&&(n.state=t.TRANSITIONING,o._reprojectTexture(i,n)),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this),!0;for(var a=n.parent,s=!1;e(a)&&a.state!==t.READY;)s=s||a.state!==t.FAILED&&a.state!==t.INVALID,a=a.parent;return this.readyImagery!==a&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=a,e(a)&&(a.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this))),s||n.state!==t.FAILED&&n.state!==t.INVALID?!1:!0},r}),r("Scene/TexturePool",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/PixelDatatype","../Renderer/PixelFormat","../Renderer/Texture"],function(e,t,r,i,n,o){"use strict";function a(t,r,i){return e(s)||(s=function(e,t,r){this._texture=e,this._textureTypeKey=t,this._pool=r},Object.keys(o.prototype).forEach(function(e){s.prototype[e]=function(){var t=this._texture;return t[e].apply(t,arguments)}}),s.prototype.destroy=function(){var t=this._pool._free[this._textureTypeKey];e(t)||(t=this._pool._free[this._textureTypeKey]=[]),t.length>=8?this._texture.destroy():t.push(this)}),new s(t,r,i)}var s,l=function(){this._free={}};return l.prototype.createTexture2D=function(t,o){if(!o)throw new r("description is required.");var s=o.source,l=e(s)?s.width:o.width,u=e(s)?s.height:o.height,c=o.pixelFormat||n.RGBA,h=+(o.pixelDatatype||i.UNSIGNED_BYTE),d=+(o.preMultiplyAlpha||c===n.RGB||c===n.LUMINANCE),m=JSON.stringify([l,u,c,h,d]),p=this._free[m];if(e(p)&&p.length>0){var f=p.pop();return e(s)&&f.copyFrom(s),f}return a(t.createTexture2D(o),m,this)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){var e=this._free;return Object.keys(e).forEach(function(t){e[t].forEach(function(e){e._texture.destroy()})}),t(this)},l}),r("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),r("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec2 u_textureDimensions;\nuniform float u_northLatitude;\nuniform float u_southLatitude;\nuniform float u_southMercatorYHigh;\nuniform float u_southMercatorYLow;\nuniform float u_oneOverMercatorHeight;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat currentLatitude = mix(u_southLatitude, u_northLatitude, position.y);\nfloat fraction = czm_latitudeToWebMercatorFraction(currentLatitude, u_southMercatorYLow, u_southMercatorYHigh, u_oneOverMercatorHeight);\nv_textureCoordinates = vec2(position.x, fraction);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),r("Scene/ImageryLayer",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/BoundingRectangle","../Core/ComponentDatatype","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/Extent","../Core/FeatureDetection","../Core/Math","../Core/PrimitiveType","../Core/Geometry","../Core/GeometryAttribute","../Renderer/BufferUsage","../Renderer/MipmapHint","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/ClearCommand","./GeographicTilingScheme","./Imagery","./TileProviderError","./ImageryState","./TileImagery","./TerrainProvider","./TexturePool","../ThirdParty/when","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P){"use strict";function M(e,t,r){return JSON.stringify([e,t,r])}function I(r,o,a,l){var u=o.cache.imageryLayer_reproject;if(!t(u)){u=o.cache.imageryLayer_reproject={framebuffer:void 0,vertexArray:void 0,shaderProgram:void 0,renderState:void 0,sampler:void 0,destroy:function(){t(this.framebuffer)&&this.framebuffer.destroy(),t(this.vertexArray)&&this.vertexArray.destroy(),t(this.shaderProgram)&&this.shaderProgram.release()}},u.framebuffer=o.createFramebuffer(),u.framebuffer.destroyAttachments=!1;for(var c=new Array(131072),w=0,C=0;256>C;++C)for(var x=C/255,S=0;256>S;++S){var E=S/255;c[w++]=E,c[w++]=x}var T=new d({attributes:{position:new m({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:c})},indices:b.getRegularGridIndices(256,256),primitiveType:h.TRIANGLES}),A={position:0};u.vertexArray=o.createVertexArrayFromGeometry({geometry:T,attributeIndices:A,bufferUsage:p.STATIC_DRAW}),u.shaderProgram=o.getShaderCache().getShaderProgram(P,D,A);var M=o.getMaximumTextureFilterAnisotropy();u.sampler=o.createSampler({wrapS:g.CLAMP_TO_EDGE,wrapT:g.CLAMP_TO_EDGE,minificationFilter:y.LINEAR,magnificationFilter:v.LINEAR,maximumAnisotropy:Math.min(M,e(r._maximumAnisotropy,M))})}a.setSampler(u.sampler);var I=a.getWidth(),O=a.getHeight();L.textureDimensions.x=I,L.textureDimensions.y=O,L.texture=a,L.northLatitude=l.north,L.southLatitude=l.south;var R=Math.sin(l.south),N=.5*Math.log((1+R)/(1-R));z[0]=N,L.southMercatorYHigh=z[0],L.southMercatorYLow=N-z[0],R=Math.sin(l.north);var B=.5*Math.log((1+R)/(1-R));L.oneOverMercatorHeight=1/(B-N);var F=r._texturePool.createTexture2D(o,{width:I,height:O,pixelFormat:a.getPixelFormat(),pixelDatatype:a.getPixelDatatype(),preMultiplyAlpha:a.getPreMultiplyAlpha()});F.generateMipmap(f.NICEST),u.framebuffer.setColorTexture(F);var V=new _;return V.color=s.BLACK,V.framebuffer=u.framebuffer,V.execute(o),t(u.renderState)&&u.renderState.viewport.width===I&&u.renderState.viewport.height===O||(u.renderState=o.createRenderState({viewport:new i(0,0,I,O)})),o.draw({framebuffer:u.framebuffer,shaderProgram:u.shaderProgram,renderState:u.renderState,primitiveType:h.TRIANGLES,vertexArray:u.vertexArray,uniformMap:L}),F}function O(e,t,r){var i=e._imageryProvider,n=i.getTilingScheme(),o=n.getEllipsoid(),a=Math.cos(r),s=n.getExtent(),l=o.getMaximumRadius()*(s.east-s.west)*a/(i.getTileWidth()*n.getNumberOfXTilesAtLevel(0)),u=l/t,c=Math.log(u)/Math.log(2),h=Math.round(c);return 0|h}var R=function N(t,r){this._imageryProvider=t,r=e(r,{}),this.alpha=e(r.alpha,e(t.defaultAlpha,1)),this.brightness=e(r.brightness,e(t.defaultBrightness,N.DEFAULT_BRIGHTNESS)),this.contrast=e(r.contrast,e(t.defaultContrast,N.DEFAULT_CONTRAST)),this.hue=e(r.hue,e(t.defaultHue,N.DEFAULT_HUE)),this.saturation=e(r.saturation,e(t.defaultSaturation,N.DEFAULT_SATURATION)),this.gamma=e(r.gamma,e(t.defaultGamma,N.DEFAULT_GAMMA)),this.show=e(r.show,!0),this._minimumTerrainLevel=r.minimumTerrainLevel,this._maximumTerrainLevel=r.maximumTerrainLevel,this._extent=e(r.extent,l.MAX_VALUE),this._maximumAnisotropy=r.maximumAnisotropy,this._imageryCache={},this._texturePool=new T,this._skeletonPlaceholder=new E(C.createPlaceholder(this)),this._show=!1,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0};R.DEFAULT_BRIGHTNESS=1,R.DEFAULT_CONTRAST=1,R.DEFAULT_HUE=0,R.DEFAULT_SATURATION=1,R.DEFAULT_GAMMA=1,R.prototype.getImageryProvider=function(){return this._imageryProvider},R.prototype.getExtent=function(){return this._extent},R.prototype.isBaseLayer=function(){return this._isBaseLayer},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return this._texturePool=this._texturePool&&this._texturePool.destroy(),r(this)},R.prototype._createTileImagerySkeletons=function(e,r,i){if(t(this._minimumTerrainLevel)&&e.levelthis._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(t(i)||(i=e.imagery.length),!n.isReady())return this._skeletonPlaceholder.loadingImagery.addReference(),e.imagery.splice(i,0,this._skeletonPlaceholder),!0;var o=e.extent.intersectWith(n.getExtent());if(o=o.intersectWith(this._extent),o.east<=o.west||o.north<=o.south){if(!this.isBaseLayer())return!1;var s=n.getExtent().intersectWith(this._extent),l=e.extent;l.south>=s.north?o.north=o.south=s.north:l.north<=s.south&&(o.north=o.south=s.south),l.west>=s.east?o.west=o.east=s.east:l.east<=s.west&&(o.west=o.east=s.west)}var u=0;o.south>0?u=o.south:o.north<0&&(u=o.north);var c=1,h=c*r.getLevelMaximumGeometricError(e.level),d=O(this,h,u);d=Math.max(0,d);var m=n.getMaximumLevel();if(d>m&&(d=m),t(n.getMinimumLevel)){var p=n.getMinimumLevel();p>d&&(d=p)}var f=n.getTilingScheme(),v=f.positionToTileXY(o.getNorthwest(),d),y=f.positionToTileXY(o.getSoutheast(),d),g=(e.extent.north-e.extent.south)/512,_=(e.extent.east-e.extent.west)/512,w=f.tileXYToExtent(v.x,v.y,d);Math.abs(w.south-e.extent.north)<_&&v.yv.y&&--y.y,Math.abs(C.west-e.extent.east)v.x&&--y.x;var x,S,b=e.extent,T=f.tileXYToExtent(v.x,v.y,d),A=0,D=1;!this.isBaseLayer()&&Math.abs(T.west-e.extent.west)>=g&&(A=Math.min(1,(T.west-b.west)/(b.east-b.west))),!this.isBaseLayer()&&Math.abs(T.north-e.extent.north)>=_&&(D=Math.max(0,(T.north-b.south)/(b.north-b.south)));for(var P=D,M=v.x;M<=y.x;M++){x=A,T=f.tileXYToExtent(M,v.y,d),A=Math.min(1,(T.east-b.west)/(b.east-b.west)),M===y.x&&(this.isBaseLayer()||Math.abs(T.east-e.extent.east)1e-5){var a=I(this,r,n,i.extent);n.destroy(),i.texture=n=a}if(c.isPowerOfTwo(n.getWidth())&&c.isPowerOfTwo(n.getHeight())){var s=r.cache.imageryLayer_mipmapSampler;if(!t(s)){var l=r.getMaximumTextureFilterAnisotropy();s=r.cache.imageryLayer_mipmapSampler=r.createSampler({wrapS:g.CLAMP_TO_EDGE,wrapT:g.CLAMP_TO_EDGE,minificationFilter:y.LINEAR_MIPMAP_LINEAR,magnificationFilter:v.LINEAR,maximumAnisotropy:Math.min(l,e(this._maximumAnisotropy,l))})}n.generateMipmap(f.NICEST),n.setSampler(s)}else{var u=r.cache.imageryLayer_nonMipmapSampler;t(u)||(u=r.cache.imageryLayer_nonMipmapSampler=r.createSampler({wrapS:g.CLAMP_TO_EDGE,wrapT:g.CLAMP_TO_EDGE,minificationFilter:y.LINEAR,magnificationFilter:v.LINEAR})),n.setSampler(u)}i.state=S.READY},R.prototype.getImageryFromCache=function(e,r,i,n){var o=M(e,r,i),a=this._imageryCache[o];return t(a)||(a=new C(this,e,r,i,n),this._imageryCache[o]=a),a.addReference(),a},R.prototype.removeImageryFromCache=function(e){var t=M(e.x,e.y,e.level);delete this._imageryCache[t]};var L={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},u_northLatitude:function(){return this.northLatitude},u_southLatitude:function(){return this.southLatitude},u_southMercatorYLow:function(){return this.southMercatorYLow},u_southMercatorYHigh:function(){return this.southMercatorYHigh},u_oneOverMercatorHeight:function(){return this.oneOverMercatorHeight},textureDimensions:new o,texture:void 0,northLatitude:0,southLatitude:0,southMercatorYHigh:0,southMercatorYLow:0,oneOverMercatorHeight:0},z=u.supportsTypedArrays()?new Float32Array(1):void 0;return R}),r("Scene/TileReplacementQueue",["../Core/defined","./ImageryState","./TerrainState"],function(e,t,r){"use strict";function i(e,t){var r=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:r.replacementNext=i,t===e.tail?e.tail=r:i.replacementPrevious=r,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}var n=function(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0};return n.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},n.prototype.trimTiles=function(n){for(var o=this.tail,a=!0;a&&e(this._lastBeforeStartOfFrame)&&this.count>n&&e(o);){a=o!==this._lastBeforeStartOfFrame;for(var s=o.replacementPrevious,l=o.loadedTerrain,u=e(l)&&(l.state===r.RECEIVING||l.state===r.TRANSFORMING),c=o.upsampledTerrain,h=e(c)&&(c.state===r.RECEIVING||c.state===r.TRANSFORMING),d=!u&&!h,m=o.imagery,p=0,f=m.length;d&&f>p;++p){var v=m[p];d=!e(v.loadingImagery)||v.loadingImagery.state!==t.TRANSITIONING}d&&(o.freeResources(),i(this,o)),o=s}},n.prototype.markTileRendered=function(t){var r=this.head;return r===t?(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext),void 0):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,this.head=t,void 0):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,this.tail=t,void 0))},n}),r("Scene/CentralBodySurface",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/FeatureDetection","../Core/DeveloperError","../Core/EllipsoidalOccluder","../Core/Intersect","../Core/Matrix4","../Core/PrimitiveType","../Core/Queue","../Core/WebMercatorProjection","../Renderer/DrawCommand","../Renderer/Pass","./ImageryLayer","./ImageryState","./SceneMode","./TerrainProvider","./TileReplacementQueue","./TileState","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E){"use strict";function b(e,r){var i=e.loadingImagery;t(i)||(i=e.readyImagery);var n=r.loadingImagery;return t(n)||(n=r.readyImagery),i.imageryLayer._layerIndex-n.imageryLayer._layerIndex}function T(e){if(e._imageryLayerCollection._update(),e._layerOrderChanged){e._layerOrderChanged=!1;for(var r=e._tileReplacementQueue.head;t(r);)r.imagery.sort(b),r=r.replacementNext}}function A(e,r,i){var n=e._debug;if(!n.suspendLodUpdate){var o,a,s=e._tilesToRenderByTextureCount;for(o=0,a=s.length;a>o;++o){var l=s[o];t(l)&&(l.length=0)}var u=e._tileTraversalQueue;if(u.clear(),n.maxDepth=0,n.tilesVisited=0,n.tilesCulled=0,n.tilesRendered=0,n.texturesRendered=0,n.tilesWaitingForChildren=0,e._tileLoadQueue.length=0,e._tileReplacementQueue.markStartOfRenderFrame(),!t(e._levelZeroTiles)){if(!e._terrainProvider.isReady())return;var c=e._terrainProvider.getTilingScheme();e._levelZeroTiles=c.createLevelZeroTiles()}var h=i.camera.positionWC,d=e._terrainProvider.getTilingScheme().getEllipsoid(),m=d.cartesianToCartographic(h,W);e._ellipsoidalOccluder.setCameraPosition(h);var p,f=e._levelZeroTiles;for(o=0,a=f.length;a>o;++o)p=f[o],e._tileReplacementQueue.markTileRendered(p),p.state!==S.READY&&L(e,p),p.isRenderable&&I(e,i,p)?u.enqueue(p):(++n.tilesCulled,p.isRenderable||++n.tilesWaitingForChildren);for(;t(p=u.dequeue());)if(++n.tilesVisited,e._tileReplacementQueue.markTileRendered(p),p.level>n.maxDepth&&(n.maxDepth=p.level),D(e,r,i,h,m,p)o;++o)I(e,i,v[o])?u.enqueue(v[o]):++n.tilesCulled}else++n.tilesWaitingForChildren,M(e,p);n.enableDebugOutput&&(n.tilesVisited!==n.lastTilesVisited||n.tilesRendered!==n.lastTilesRendered||n.texturesRendered!==n.lastTexturesRendered||n.tilesCulled!==n.lastTilesCulled||n.maxDepth!==n.lastMaxDepth||n.tilesWaitingForChildren!==n.lastTilesWaitingForChildren)&&(console.log("Visited "+n.tilesVisited+", Rendered: "+n.tilesRendered+", Textures: "+n.texturesRendered+", Culled: "+n.tilesCulled+", Max Depth: "+n.maxDepth+", Waiting for children: "+n.tilesWaitingForChildren),n.lastTilesVisited=n.tilesVisited,n.lastTilesRendered=n.tilesRendered,n.lastTexturesRendered=n.texturesRendered,n.lastTilesCulled=n.tilesCulled,n.lastMaxDepth=n.maxDepth,n.lastTilesWaitingForChildren=n.tilesWaitingForChildren)}}function D(e,t,r,i,n,o){if(r.mode===w.SCENE2D)return P(e,t,r,i,n,o);var a=o.extent,s=1;if(r.mode===w.SCENE3D){var l=0;a.south>0?l=a.south:a.north<0&&(l=a.north),s=Math.cos(l)}var u=s*e._terrainProvider.getLevelMaximumGeometricError(o.level),c=Math.sqrt(O(r,i,n,o));o.distance=c;var h=t.getDrawingBufferHeight(),d=r.camera,m=d.frustum,p=m.fovy;return u*h/(2*c*Math.tan(.5*p))}function P(e,t,r,i,n,o){var a=r.camera,s=a.frustum,l=t.getDrawingBufferWidth(),u=t.getDrawingBufferHeight(),c=e._terrainProvider.getLevelMaximumGeometricError(o.level),h=Math.max(s.top-s.bottom,s.right-s.left)/Math.max(l,u);return c/h}function M(e,r){for(var i=0,n=r.imagery,o=0,a=n.length;a>o;++o){var s=n[o];t(s.readyImagery)&&0!==s.readyImagery.imageryLayer.alpha&&++i}var l=e._tilesToRenderByTextureCount[i];t(l)||(l=[],e._tilesToRenderByTextureCount[i]=l),l.push(r);var u=e._debug;++u.tilesRendered,u.texturesRendered+=i}function I(e,r,n){var a=r.cullingVolume,s=n.boundingSphere3D;if(r.mode!==w.SCENE3D&&(s=q,i.fromExtentWithHeights2D(n.extent,r.scene2D.projection,n.minimumHeight,n.maximumHeight,s),o.fromElements(s.center.z,s.center.x,s.center.y,s.center),r.mode===w.MORPHING&&(s=i.union(n.boundingSphere3D,s,s))),a.getVisibility(s)===h.OUTSIDE)return!1;if(r.mode===w.SCENE3D){var l=n.occludeePointInScaledSpace;return t(l)?e._ellipsoidalOccluder.isScaledSpacePointVisible(l):!0}return!0}function O(e,t,r,i){var n=i.southwestCornerCartesian,a=i.northeastCornerCartesian,s=i.westNormal,l=i.southNormal,u=i.eastNormal,c=i.northNormal,h=i.maximumHeight;e.mode!==w.SCENE3D&&(n=e.scene2D.projection.project(i.extent.getSouthwest(),G),n.z=n.y,n.y=n.x,n.x=0,a=e.scene2D.projection.project(i.extent.getNortheast(),H),a.z=a.y,a.y=a.x,a.x=0,s=j,u=o.UNIT_Y,l=Y,c=o.UNIT_Z,h=0);var d,m=o.subtract(t,n,X),p=o.dot(m,s),f=o.dot(m,l),v=o.subtract(t,a,X),y=o.dot(v,u),g=o.dot(v,c);d=e.mode===w.SCENE3D?r.height:t.x;var _=d-h,C=0;return p>0?C+=p*p:y>0&&(C+=y*y),f>0?C+=f*f:g>0&&(C+=g*g),_>0&&(C+=_*_),C}function R(e,t,r){for(var i=!0,n=r.getChildren(),o=0,a=n.length;a>o;++o){var s=n[o];e._tileReplacementQueue.markTileRendered(s),s.state!==S.READY&&L(e,s),s.isRenderable||(i=!1)}return i}function L(e,t){e._tileLoadQueue.push(t) -}function z(e,t){var r=e._tileLoadQueue,i=e._terrainProvider,n=e._imageryLayerCollection;if(0!==r.length){e._tileReplacementQueue.trimTiles(e._tileCacheSize);for(var o=Date.now(),a=e._loadQueueTimeSlice,s=o+a,l=r.length-1,u=l;u>=0;--u){var c=r[u];if(e._tileReplacementQueue.markTileRendered(c),c.processStateMachine(t,i,n),Date.now()>=s)break}}}function N(e,t){return e.distance-t.distance}function B(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function F(e){var t={u_center3D:function(){return this.center3D},u_tileExtent:function(){return this.tileExtent},u_modifiedModelView:function(){return this.modifiedModelView},u_dayTextures:function(){return this.dayTextures},u_dayTextureTranslationAndScale:function(){return this.dayTextureTranslationAndScale},u_dayTextureTexCoordsExtent:function(){return this.dayTextureTexCoordsExtent},u_dayTextureAlpha:function(){return this.dayTextureAlpha},u_dayTextureBrightness:function(){return this.dayTextureBrightness},u_dayTextureContrast:function(){return this.dayTextureContrast},u_dayTextureHue:function(){return this.dayTextureHue},u_dayTextureSaturation:function(){return this.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.dayTextureOneOverGamma},u_dayIntensity:function(){return this.dayIntensity},u_southAndNorthLatitude:function(){return this.southAndNorthLatitude},u_southMercatorYLowAndHighAndOneOverHeight:function(){return this.southMercatorYLowAndHighAndOneOverHeight},u_waterMask:function(){return this.waterMask},u_waterMaskTranslationAndScale:function(){return this.waterMaskTranslationAndScale},center3D:void 0,modifiedModelView:new d,tileExtent:new a,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsExtent:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new n,southMercatorYLowAndHighAndOneOverHeight:new o,waterMask:void 0,waterMaskTranslationAndScale:new a};return B(t,e),t}function V(e,r,n,s,l,u,c,h){for(var p=n.camera.viewMatrix,C=r.getMaximumTextureImageUnits(),x=e._tileCommands,S=e._tileCommandUniformMaps,E=-1,b=e._tilesToRenderByTextureCount,T=0,A=b.length;A>T;++T){var D=b[T];if(t(D)&&0!==D.length){D.sort(N);for(var P=0,M=D.length;M>P;P++){var I=D[P],O=I.center,R=K,L=0,z=0,B=0,V=0,U=0;if(n.mode!==w.SCENE3D){var W=l.project(I.extent.getSouthwest(),et),q=l.project(I.extent.getNortheast(),tt);if(R.x=W.x,R.y=W.y,R.z=q.x,R.w=q.y,n.mode!==w.MORPHING&&(O=Q,O.x=0,O.y=.5*(R.z+R.x),O.z=.5*(R.w+R.y),R.x-=O.y,R.y-=O.z,R.z-=O.y,R.w-=O.z),l instanceof f){L=I.extent.south,z=I.extent.north;var G=f.geodeticLatitudeToMercatorAngle(L),H=f.geodeticLatitudeToMercatorAngle(z);Z[0]=G,B=Z[0],V=G-Z[0],U=1/(H-G)}}var j=$;j.x=O.x,j.y=O.y,j.z=O.z,j.w=1,d.multiplyByVector(p,j,j),d.setColumn(p,3,j,J);var Y=I.imagery,X=0,rt=Y.length;do{var it=0;++E;var nt=x[E];t(nt)||(nt=new v,nt.owner=I,nt.cull=!1,nt.boundingVolume=new i,x[E]=nt,S[E]=F(u)),nt.owner=I,nt.debugShowBoundingVolume=I===e._debug.boundingSphereTile;var ot=S[E];ot.center3D=I.center,a.clone(R,ot.tileExtent),ot.southAndNorthLatitude.x=L,ot.southAndNorthLatitude.y=z,ot.southMercatorYLowAndHighAndOneOverHeight.x=V,ot.southMercatorYLowAndHighAndOneOverHeight.y=B,ot.southMercatorYLowAndHighAndOneOverHeight.z=U,d.clone(J,ot.modifiedModelView);for(var at=!1,st=!1,lt=!1,ut=!1,ct=!1,ht=!1;C>it&&rt>X;){var dt=Y[X],mt=dt.readyImagery;if(++X,t(mt)&&mt.state===_.READY&&0!==mt.imageryLayer.alpha){var pt=mt.imageryLayer;t(dt.textureTranslationAndScale)||(dt.textureTranslationAndScale=pt._calculateTextureTranslationAndScale(I,dt)),ot.dayTextures[it]=mt.texture,ot.dayTextureTranslationAndScale[it]=dt.textureTranslationAndScale,ot.dayTextureTexCoordsExtent[it]=dt.textureCoordinateExtent,ot.dayTextureAlpha[it]="function"==typeof pt.alpha?pt.alpha(n,pt,mt.x,mt.y,mt.level):pt.alpha,ht=ht||1!==ot.dayTextureAlpha[it],ot.dayTextureBrightness[it]="function"==typeof pt.brightness?pt.brightness(n,pt,mt.x,mt.y,mt.level):pt.brightness,at=at||ot.dayTextureBrightness[it]!==g.DEFAULT_BRIGHTNESS,ot.dayTextureContrast[it]="function"==typeof pt.contrast?pt.contrast(n,pt,mt.x,mt.y,mt.level):pt.contrast,st=st||ot.dayTextureContrast[it]!==g.DEFAULT_CONTRAST,ot.dayTextureHue[it]="function"==typeof pt.hue?pt.hue(n,pt,mt.x,mt.y,mt.level):pt.hue,lt=lt||ot.dayTextureHue[it]!==g.DEFAULT_HUE,ot.dayTextureSaturation[it]="function"==typeof pt.saturation?pt.saturation(n,pt,mt.x,mt.y,mt.level):pt.saturation,ut=ut||ot.dayTextureSaturation[it]!==g.DEFAULT_SATURATION,ot.dayTextureOneOverGamma[it]="function"==typeof pt.gamma?1/pt.gamma(n,pt,mt.x,mt.y,mt.level):1/pt.gamma,ct=ct||ot.dayTextureOneOverGamma[it]!==1/g.DEFAULT_GAMMA,++it}}ot.dayTextures.length=it,ot.waterMask=I.waterMaskTexture,a.clone(I.waterMaskTranslationAndScale,ot.waterMaskTranslationAndScale),c.push(nt),nt.shaderProgram=s.getShaderProgram(r,T,at,st,lt,ut,ct,ht),nt.renderState=h,nt.primitiveType=m.TRIANGLES,nt.vertexArray=I.vertexArray,nt.uniformMap=ot,nt.pass=y.OPAQUE,e._debug.wireframe&&(k(r,e,I),t(I.wireframeVertexArray)&&(nt.vertexArray=I.wireframeVertexArray,nt.primitiveType=m.LINES));var ft=nt.boundingVolume;n.mode!==w.SCENE3D?(i.fromExtentWithHeights2D(I.extent,n.scene2D.projection,I.minimumHeight,I.maximumHeight,ft),o.fromElements(ft.center.z,ft.center.x,ft.center.y,ft.center),n.mode===w.MORPHING&&(ft=i.union(I.boundingSphere3D,ft,ft))):i.clone(I.boundingSphere3D,ft)}while(rt>X)}}}x.length=Math.max(0,E+1)}function k(e,r,i){if(!t(i.wireframeVertexArray)&&!t(i.meshForWireframePromise)&&(i.meshForWireframePromise=i.terrainData.createMesh(r._terrainProvider.getTilingScheme(),i.x,i.y,i.level),t(i.meshForWireframePromise))){var n=i.vertexArray;E(i.meshForWireframePromise,function(t){i.vertexArray===n&&(i.wireframeVertexArray=C.createWireframeVertexArray(e,i.vertexArray,t)),i.meshForWireframePromise=void 0})}}var U=function(e){if(!t(e.terrainProvider))throw new u("options.terrainProvider is required.");if(!t(e.imageryLayerCollection))throw new u("options.imageryLayerCollection is required.");this._terrainProvider=e.terrainProvider,this._imageryLayerCollection=e.imageryLayerCollection,this._imageryLayerCollection.layerAdded.addEventListener(U.prototype._onLayerAdded,this),this._imageryLayerCollection.layerRemoved.addEventListener(U.prototype._onLayerRemoved,this),this._imageryLayerCollection.layerMoved.addEventListener(U.prototype._onLayerMoved,this),this._imageryLayerCollection.layerShownOrHidden.addEventListener(U.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1;var r=this._terrainProvider.getTilingScheme();this._levelZeroTiles=void 0,this._tilesToRenderByTextureCount=[],this._tileCommands=[],this._tileCommandUniformMaps=[],this._tileTraversalQueue=new p,this._tileLoadQueue=[],this._tileReplacementQueue=new x,this._maximumScreenSpaceError=2,this._tileCacheSize=100,this._loadQueueTimeSlice=5;var i=r.getEllipsoid();this._ellipsoidalOccluder=new c(i,o.ZERO),this._debug={enableDebugOutput:!1,wireframe:!1,boundingSphereTile:void 0,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,texturesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTexturesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1}};U.prototype.update=function(e,t,r,i,n,o,a){T(this),A(this,e,t),z(this,e,t),V(this,e,t,n,a,i,r,o)},U.prototype.getTerrainProvider=function(){return this._terrainProvider},U.prototype.setTerrainProvider=function(e){if(this._terrainProvider!==e){if(!t(e))throw new u("terrainProvider is required.");this._terrainProvider=e;var r=this._tileReplacementQueue;r.head=void 0,r.tail=void 0,r.count=0;var i=this._levelZeroTiles;if(t(i))for(var n=0;na;++a){var l=i[a],u=l.loadingImagery;if(t(u)||(u=l.readyImagery),u.imageryLayer===e)-1===n&&(n=a),l.freeResources(),++o;else if(-1!==n)break}-1!==n&&i.splice(n,o),e.isBaseLayer()&&(r.isRenderable=!1),r=r.replacementNext}},U.prototype._onLayerMoved=function(){t(this._levelZeroTiles)&&(this._layerOrderChanged=!0)},U.prototype._onLayerShownOrHidden=function(e,r,i){t(this._levelZeroTiles)&&(i?this._onLayerAdded(e,r):this._onLayerRemoved(e,r))},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){var e=this._levelZeroTiles;if(t(e))for(var i=0;ip;++p)m+="color = sampleAndBlend(\n color,\n u_dayTextures["+p+"],\n"+" textureCoordinates,\n"+" u_dayTextureTexCoordsExtent["+p+"],\n"+" u_dayTextureTranslationAndScale["+p+"],\n"+(u?" u_dayTextureAlpha["+p+"],\n":"1.0,\n")+(n?" u_dayTextureBrightness["+p+"],\n":"0.0,\n")+(o?" u_dayTextureContrast["+p+"],\n":"0.0,\n")+(a?" u_dayTextureHue["+p+"],\n":"0.0,\n")+(s?" u_dayTextureSaturation["+p+"],\n":"0.0,\n")+(l?" u_dayTextureOneOverGamma["+p+"]);\n":"0.0);\n");m+=" return color;\n}",h=t.getShaderCache().getShaderProgram(d,m,this._attributeIndices),this._shaders[c]=h}return h},r.prototype.destroy=function(){return this.invalidateShaders(),t(this)},r}),r("Scene/EllipsoidTerrainProvider",["../Core/defaultValue","../Core/defined","../Core/Ellipsoid","../Core/Event","./HeightmapTerrainData","./TerrainProvider","./GeographicTilingScheme"],function(e,t,r,i,n,o,a){"use strict";var s=function(s){s=e(s,{}),this._tilingScheme=s.tilingScheme,t(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:e(s.ellipsoid,r.WGS84)})),this._levelZeroMaximumGeometricError=o.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.getEllipsoid(),64,this._tilingScheme.getNumberOfXTilesAtLevel(0));var l=16,u=16;this._terrainData=new n({buffer:new Uint8Array(l*u),width:16,height:16}),this._errorEvent=new i};return s.prototype.requestTileGeometry=function(){return this._terrainData},s.prototype.getErrorEvent=function(){return this._errorEvent},s.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<i)throw new e("index must be greater than or equal to zero.");if(i>this._layers.length)throw new e("index must be less than or equal to the number of layers.");this._layers.splice(i,0,t)}else i=this._layers.length,this._layers.push(t);this._update(),this.layerAdded.raiseEvent(t,i)},u.prototype.addImageryProvider=function(t,i){if(!r(t))throw new e("imageryProvider is required.");var n=new a(t);return this.add(n,i),n},u.prototype.remove=function(e,r){r=t(r,!0);var i=this._layers.indexOf(e);return-1!==i?(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(e,i),r&&e.destroy(),!0):!1},u.prototype.removeAll=function(e){e=t(e,!0);for(var r=this._layers,i=0,n=r.length;n>i;i++){var o=r[i];this.layerRemoved.raiseEvent(o,i),e&&o.destroy()}this._layers=[]},u.prototype.contains=function(e){return-1!==this.indexOf(e)},u.prototype.indexOf=function(e){return this._layers.indexOf(e)},u.prototype.get=function(t){if(!r(t))throw new e("index is required.","index");return this._layers[t]},u.prototype.getLength=function(){return this._layers.length},u.prototype.raise=function(e){var t=s(this._layers,e);l(this,t,t+1)},u.prototype.lower=function(e){var t=s(this._layers,e);l(this,t,t-1)},u.prototype.raiseToTop=function(e){var t=s(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},u.prototype.lowerToBottom=function(e){var t=s(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this.removeAll(!0),i(this)},u.prototype._update=function(){for(var e,t,i=!0,n=this._layers,o=0,a=n.length;a>o;++o)t=n[o],t._layerIndex=o,t.show?(t._isBaseLayer=i,i=!1):t._isBaseLayer=!1,t.show!==t._show&&(r(t._show)&&(r(e)||(e=[]),e.push(t)),t._show=t.show);if(r(e))for(o=0,a=e.length;a>o;++o)t=e[o],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},u}),r("Shaders/CentralBodyFS",[],function(){"use strict";return"#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsExtent[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_LIGHTING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvec3 sampleAndBlend(\nvec3 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateExtent,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateExtent.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateExtent.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 sample = texture2D(texture, textureCoordinates);\nvec3 color = sample.rgb;\nfloat alpha = sample.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nreturn mix(previousColor, color, alpha * textureAlpha);\n}\nvec3 computeDayColor(vec3 initialColor, vec2 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec3 imageryColor, float specularMapValue);\nvoid main()\n{\nvec3 initialColor = vec3(0.0, 0.0, 0.5);\nvec3 startDayColor = computeDayColor(initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\nstartDayColor = vec3(1.0, 0.0, 0.0);\n}\n#endif\nvec4 color = vec4(startDayColor, 1.0);\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_LIGHTING)\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal3D * normalMC);\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, startDayColor, mask);\n}\n#endif\n#ifdef ENABLE_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\ngl_FragColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\ngl_FragColor = color;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nconst float oceanFrequency = 125000.0;\nconst float oceanAnimationSpeed = 0.006;\nconst float oceanAmplitude = 2.0;\nconst float oceanSpecularIntensity = 0.5;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec3 imageryColor, float specularMapValue)\n{\nfloat time = czm_frameNumber * oceanAnimationSpeed;\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / oceanAmplitude));\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC);\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), specularMapValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor + diffuseHighlight + nonDiffuseHighlight + specular, 1.0);\n}\n#endif\n"}),r("Shaders/CentralBodyFSDepth",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),r("Shaders/CentralBodyFSPole",[],function(){"use strict";return"uniform vec3 u_color;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(czm_windowToEyeCoordinates(gl_FragCoord).xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection.start);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec3 startDayColor = u_color;\ngl_FragColor = vec4(startDayColor, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),r("Shaders/CentralBodyVS",[],function(){"use strict";return"attribute vec4 position3DAndHeight;\nattribute vec2 textureCoordinates;\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileExtent;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec3 u_southMercatorYLowAndHighAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvec4 getPosition(vec3 position3DWC);\nfloat get2DYPositionFraction();\nvec4 getPosition3DMode(vec3 position3DWC)\n{\nreturn czm_projection * (u_modifiedModelView * vec4(position3DAndHeight.xyz, 1.0));\n}\nfloat get2DMercatorYPositionFraction()\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorYLow = u_southMercatorYLowAndHighAndOneOverHeight.x;\nfloat southMercatorYHigh = u_southMercatorYLowAndHighAndOneOverHeight.y;\nfloat oneOverMercatorHeight = u_southMercatorYLowAndHighAndOneOverHeight.z;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorYLow, southMercatorYHigh, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction()\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position3DWC, float height2D)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 rtcPosition2D = vec4(height2D, mix(u_tileExtent.st, u_tileExtent.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn czm_projection * (u_modifiedModelView * rtcPosition2D);\n}\nvec4 getPosition2DMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, 0.0);\n}\nvec4 getPositionColumbusViewMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, position3DAndHeight.w);\n}\nvec4 getPositionMorphingMode(vec3 position3DWC)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 position2DWC = vec4(0.0, mix(u_tileExtent.st, u_tileExtent.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\nvoid main()\n{\nvec3 position3DWC = position3DAndHeight.xyz + u_center3D;\ngl_Position = getPosition(position3DWC);\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_LIGHTING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\nv_textureCoordinates = textureCoordinates;\n}\n"}),r("Shaders/CentralBodyVSDepth",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),r("Shaders/CentralBodyVSPole",[],function(){"use strict";return"attribute vec4 position;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat x = (position.x - czm_viewport.x) / czm_viewport.z;\nfloat y = (position.y - czm_viewport.y) / czm_viewport.w;\nv_textureCoordinates = vec2(x, y);\ngl_Position = czm_viewportOrthographic * position;\n}\n"}),r("Scene/CentralBody",["../Core/buildModuleUrl","../Core/combine","../Core/loadImage","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ComponentDatatype","../Core/Ellipsoid","../Core/Extent","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Occluder","../Core/PrimitiveType","../Core/Transforms","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DepthFunction","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","./CentralBodySurface","./CentralBodySurfaceShaderSet","./EllipsoidTerrainProvider","./ImageryLayerCollection","./SceneMode","./TerrainProvider","../Shaders/CentralBodyFS","../Shaders/CentralBodyFSDepth","../Shaders/CentralBodyFSPole","../Shaders/CentralBodyVS","../Shaders/CentralBodyVSDepth","../Shaders/CentralBodyVSPole","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M,I,O,R,L,z,N,B,F,V,k,U,W){"use strict";function q(e,t){var r=e._ellipsoid.getRadii(),i=t.camera.positionWC,n=u.multiplyComponents(e._ellipsoid.getOneOverRadii(),i,Z),o=u.magnitude(n),a=u.normalize(n,J),s=u.normalize(u.cross(u.UNIT_Z,n,K),K),l=u.normalize(u.cross(a,s,Q),Q),c=Math.sqrt(u.magnitudeSquared(n)-1),h=u.multiplyByScalar(a,1/o,Z),d=c/o,m=u.multiplyByScalar(s,d,J),p=u.multiplyByScalar(l,d,K),f=u.add(h,p,Q);u.subtract(f,m,f),u.multiplyComponents(r,f,f),u.pack(f,X,0);var v=u.subtract(h,p,Q);u.subtract(v,m,v),u.multiplyComponents(r,v,v),u.pack(v,X,3);var y=u.add(h,p,Q);u.add(y,m,y),u.multiplyComponents(r,y,y),u.pack(y,X,6);var g=u.subtract(h,p,Q);return u.add(g,m,g),u.multiplyComponents(r,g,g),u.pack(g,X,9),X}function G(e,t,r,i,n,o){var s,l=e._ellipsoid.cartographicToCartesian(new c(0,i)),h=e._ellipsoid.cartographicToCartesian(new c(Math.PI,i)),d=.5*u.magnitude(u.subtract(l,h)),m=e._ellipsoid.cartographicToCartesian(new c(0,r)),p=t.camera.direction;s=1-u.dot(u.negate(u.UNIT_Z),p)<_.EPSILON6?u.UNIT_X:u.normalize(u.cross(p,u.UNIT_Z));var f=u.add(m,u.multiplyByScalar(s,d)),v=u.add(m,u.multiplyByScalar(u.normalize(u.cross(u.UNIT_Z,s)),d));S.pointToWindowCoordinates(n,o,m,m),S.pointToWindowCoordinates(n,o,f,f),S.pointToWindowCoordinates(n,o,v,v);var y=Math.floor(Math.max(u.distance(v,m),u.distance(f,m))),g=y;return new a(Math.floor(m.x)-y,Math.floor(m.y)-g,2*y,2*g)}function H(e,r,i){var o=e._surface._terrainProvider;if(i.mode===L.SCENE3D&&o.isReady()){var a=o.getTilingScheme().getExtent(),l=r.getUniformState().getViewProjection(),u=$;u.width=r.getDrawingBufferWidth(),u.height=r.getDrawingBufferHeight();var c,d,p,f,x,S,b,T=w.computeViewportTransformation(u,0,1,et),A=.05,D=e._occluder;a.north<_.PI_OVER_TWO&&(c=new m(-Math.PI,a.north,Math.PI,_.PI_OVER_TWO),d=s.fromExtent3D(c,e._ellipsoid),p=i.cullingVolume.getVisibility(d)===g.OUTSIDE,f=C.computeOccludeePointFromExtent(c,e._ellipsoid),x=f&&!D.isPointVisible(f,0)||!D.isBoundingSphereVisible(d),e._drawNorthPole=!p&&!x,e._drawNorthPole&&(b=G(e,i,c.north,c.south-A,l,T),tt[0]=b.x,tt[1]=b.y,tt[2]=b.x+b.width,tt[3]=b.y,tt[4]=b.x+b.width,tt[5]=b.y+b.height,tt[6]=b.x,tt[7]=b.y+b.height,n(e._northPoleCommand.vertexArray)?e._northPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(tt):(e._northPoleCommand.boundingVolume=s.fromExtent3D(c,e._ellipsoid),S=new v({attributes:{position:new y({componentDatatype:h.FLOAT,componentsPerAttribute:2,values:tt})}}),e._northPoleCommand.vertexArray=r.createVertexArrayFromGeometry({geometry:S,attributeIndices:{position:0},bufferUsage:E.STREAM_DRAW})))),a.south>-_.PI_OVER_TWO&&(c=new m(-Math.PI,-_.PI_OVER_TWO,Math.PI,a.south),d=s.fromExtent3D(c,e._ellipsoid),p=i.cullingVolume.getVisibility(d)===g.OUTSIDE,f=C.computeOccludeePointFromExtent(c,e._ellipsoid),x=f&&!D.isPointVisible(f)||!D.isBoundingSphereVisible(d),e._drawSouthPole=!p&&!x,e._drawSouthPole&&(b=G(e,i,c.south,c.north+A,l,T),tt[0]=b.x,tt[1]=b.y,tt[2]=b.x+b.width,tt[3]=b.y,tt[4]=b.x+b.width,tt[5]=b.y+b.height,tt[6]=b.x,tt[7]=b.y+b.height,n(e._southPoleCommand.vertexArray)?e._southPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(tt):(e._southPoleCommand.boundingVolume=s.fromExtent3D(c,e._ellipsoid),S=new v({attributes:{position:new y({componentDatatype:h.FLOAT,componentsPerAttribute:2,values:tt})}}),e._southPoleCommand.vertexArray=r.createVertexArrayFromGeometry({geometry:S,attributeIndices:{position:0},bufferUsage:E.STREAM_DRAW}))));var P=0,M=e._imageryLayerCollection.getLength()>0?e._imageryLayerCollection.get(0):void 0;n(M)&&n(M.getImageryProvider())&&n(M.getImageryProvider().getPoleIntensity)&&(P=M.getImageryProvider().getPoleIntensity());var I={u_dayIntensity:function(){return P}},O=e;if(!n(e._northPoleCommand.uniformMap)){var R=t([I,{u_color:function(){return O.northPoleColor}}],!1,!1);e._northPoleCommand.uniformMap=t([R,e._drawUniforms],!1,!1)}if(!n(e._southPoleCommand.uniformMap)){var z=t([I,{u_color:function(){return O.southPoleColor}}],!1,!1);e._southPoleCommand.uniformMap=t([z,e._drawUniforms],!1,!1)}}}function j(e,t){var r=t.creditDisplay,i=e._surface._terrainProvider.getCredit();n(i)&&r.addCredit(i);for(var o=e._imageryLayerCollection,a=0,s=o.getLength();s>a;++a){var l=o.get(a); -l.show&&(i=l.getImageryProvider().getCredit(),n(i)&&r.addCredit(i))}}var Y=function(t){t=i(t,d.WGS84);var r=new O({ellipsoid:t}),n=new R;this.terrainProvider=r,this._ellipsoid=t,this._imageryLayerCollection=n,this._surface=new M({terrainProvider:r,imageryLayerCollection:n}),this._occluder=new C(new s(u.ZERO,t.getMinimumRadius()),u.ZERO),this._surfaceShaderSet=new I(z.attributeIndices),this._rsColor=void 0,this._rsColorWithoutDepthTest=void 0;var o=new b;o.depth=1,o.stencil=0,o.owner=this,this._clearDepthCommand=o,this._depthCommand=new A,this._depthCommand.primitiveType=x.TRIANGLES,this._depthCommand.boundingVolume=new s(u.ZERO,t.getMaximumRadius()),this._depthCommand.pass=P.OPAQUE,this._depthCommand.owner=this,this._northPoleCommand=new A,this._northPoleCommand.primitiveType=x.TRIANGLE_FAN,this._northPoleCommand.pass=P.OPAQUE,this._northPoleCommand.owner=this,this._southPoleCommand=new A,this._southPoleCommand.primitiveType=x.TRIANGLE_FAN,this._southPoleCommand.pass=P.OPAQUE,this._southPoleCommand.owner=this,this._drawNorthPole=!1,this._drawSouthPole=!1,this.northPoleColor=new u(2/255,6/255,18/255),this.southPoleColor=new u(1,1,1),this.show=!0,this._mode=L.SCENE3D,this._projection=void 0,this.oceanNormalMapUrl=e("Assets/Textures/waterNormalsSmall.jpg"),this.depthTestAgainstTerrain=!1,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this._enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this._lastOceanNormalMapUrl=void 0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5,this._showingPrettyOcean=!1,this._hasWaterMask=!1,this._lightingFadeDistance=new l(this.lightingFadeOutDistance,this.lightingFadeInDistance);var a=this;this._drawUniforms={u_zoomedOutOceanSpecularIntensity:function(){return a._zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return a._oceanNormalMap},u_lightingFadeDistance:function(){return a._lightingFadeDistance}}};Y.prototype.getEllipsoid=function(){return this._ellipsoid},Y.prototype.getImageryLayers=function(){return this._imageryLayerCollection};var X=p.supportsTypedArrays()?new Float32Array(12):[],Z=new u,J=new u,K=new u,Q=new u,$=new a,et=new w,tt=p.supportsTypedArrays()?new Float32Array(8):[];return Y.prototype.update=function(e,t,i){if(this.show){var o=e.getDrawingBufferWidth(),a=e.getDrawingBufferHeight();if(0!==o&&0!==a){var s=t.mode,l=t.scene2D.projection,u=!1;this._mode===s&&n(this._rsColor)||(u=!0,s===L.SCENE3D||s===L.COLUMBUS_VIEW?(this._rsColor=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0}}),this._rsColorWithoutDepthTest=e.createRenderState({cull:{enabled:!0}}),this._depthCommand.renderState=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0,func:T.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}})):(this._rsColor=e.createRenderState({cull:{enabled:!0}}),this._rsColorWithoutDepthTest=e.createRenderState({cull:{enabled:!0}}),this._depthCommand.renderState=e.createRenderState({cull:{enabled:!0}}))),this._northPoleCommand.renderState=this._rsColorWithoutDepthTest,this._southPoleCommand.renderState=this._rsColorWithoutDepthTest;var c=q(this,t);if(this._depthCommand.vertexArray)this._depthCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(c);else{var d=new v({attributes:{position:new y({componentDatatype:h.FLOAT,componentsPerAttribute:3,values:c})},indices:[0,1,2,2,1,3],primitiveType:x.TRIANGLES});this._depthCommand.vertexArray=e.createVertexArrayFromGeometry({geometry:d,attributeIndices:{position:0},bufferUsage:E.DYNAMIC_DRAW})}var m=e.getShaderCache();if(n(this._depthCommand.shaderProgram)||(this._depthCommand.shaderProgram=m.getShaderProgram(k,B,{position:0})),this._surface._terrainProvider.hasWaterMask()&&this.oceanNormalMapUrl!==this._lastOceanNormalMapUrl){this._lastOceanNormalMapUrl=this.oceanNormalMapUrl;var p=this;W(r(this.oceanNormalMapUrl),function(t){p._oceanNormalMap=p._oceanNormalMap&&p._oceanNormalMap.destroy(),p._oceanNormalMap=e.createTexture2D({source:t})})}var g=this._projection!==l,_=this._surface._terrainProvider.hasWaterMask(),w=this._hasWaterMask!==_,C=this._enableLighting!==this.enableLighting;if(!n(this._surfaceShaderSet)||!n(this._northPoleCommand.shaderProgram)||!n(this._southPoleCommand.shaderProgram)||u||g||w||C||n(this._oceanNormalMap)!==this._showingPrettyOcean){var S,b="vec4 getPosition(vec3 position3DWC) { return getPosition3DMode(position3DWC); }",A="vec4 getPosition(vec3 position3DWC) { return getPosition2DMode(position3DWC); }",P="vec4 getPosition(vec3 position3DWC) { return getPositionColumbusViewMode(position3DWC); }",M="vec4 getPosition(vec3 position3DWC) { return getPositionMorphingMode(position3DWC); }";switch(s){case L.SCENE3D:S=b;break;case L.SCENE2D:S=A;break;case L.COLUMBUS_VIEW:S=P;break;case L.MORPHING:S=M}var I,O="float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }",R="float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }";I=l instanceof f?O:R,this._surfaceShaderSet.baseVertexShaderString=D({defines:[_?"SHOW_REFLECTIVE_OCEAN":"",this.enableLighting?"ENABLE_LIGHTING":""],sources:[V,S,I]});var G=_&&n(this._oceanNormalMap);this._surfaceShaderSet.baseFragmentShaderString=D({defines:[_?"SHOW_REFLECTIVE_OCEAN":"",G?"SHOW_OCEAN_WAVES":"",this.enableLighting?"ENABLE_LIGHTING":""],sources:[N]}),this._surfaceShaderSet.invalidateShaders();var Y=m.replaceShaderProgram(this._northPoleCommand.shaderProgram,U,F,z.attributeIndices);this._northPoleCommand.shaderProgram=Y,this._southPoleCommand.shaderProgram=Y,this._showingPrettyOcean=n(this._oceanNormalMap),this._hasWaterMask=_,this._enableLighting=this.enableLighting}var X=t.camera.positionWC;this._occluder.setCameraPosition(X),H(this,e,t),this._mode=s,this._projection=l;var Z=t.passes;Z.render&&(s===L.SCENE3D&&(this._drawNorthPole&&i.push(this._northPoleCommand),this._drawSouthPole&&i.push(this._southPoleCommand)),this._zoomedOutOceanSpecularIntensity=s===L.SCENE3D?.5:0,this._lightingFadeDistance.x=this.lightingFadeOutDistance,this._lightingFadeDistance.y=this.lightingFadeInDistance,this._surface._maximumScreenSpaceError=this.maximumScreenSpaceError,this._surface._tileCacheSize=this.tileCacheSize,this._surface.setTerrainProvider(this.terrainProvider),this._surface.update(e,t,i,this._drawUniforms,this._surfaceShaderSet,this._rsColor,this._projection),j(this,t),(s===L.SCENE3D||s===L.COLUMBUS_VIEW)&&(this.depthTestAgainstTerrain||(i.push(this._clearDepthCommand),s===L.SCENE3D&&i.push(this._depthCommand)))),Z.pick&&i.push(this._depthCommand)}}},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){return this._northPoleCommand.vertexArray=this._northPoleCommand.vertexArray&&this._northPoleCommand.vertexArray.destroy(),this._southPoleCommand.vertexArray=this._southPoleCommand.vertexArray&&this._southPoleCommand.vertexArray.destroy(),this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._northPoleCommand.shaderProgram=this._northPoleCommand.shaderProgram&&this._northPoleCommand.shaderProgram.release(),this._southPoleCommand.shaderProgram=this._northPoleCommand.shaderProgram,this._depthCommand.shaderProgram=this._depthCommand.shaderProgram&&this._depthCommand.shaderProgram.release(),this._depthCommand.vertexArray=this._depthCommand.vertexArray&&this._depthCommand.vertexArray.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),o(this)},Y}),r("Scene/CesiumTerrainProvider",["../Core/defaultValue","../Core/defined","../Core/loadArrayBuffer","../Core/throttleRequestByServer","../Core/DeveloperError","../Core/Event","./Credit","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(e){if(!t(e)||!t(e.url))throw new n("description.url is required.");this._url=e.url,this._proxy=e.proxy,this._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=u.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.getEllipsoid(),this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._terrainDataStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1},this._errorEvent=new o;var r=e.credit;"string"==typeof r&&(r=new a(r)),this._credit=r};return h.prototype.requestTileGeometry=function(n,o,a,s){var u=this._tilingScheme.getNumberOfYTilesAtLevel(a),h=this._url+"/"+a+"/"+n+"/"+(u-o-1)+".terrain",d=this._proxy;t(d)&&(h=d.getURL(h));var m;if(s=e(s,!0)){if(m=i(h,r),!t(m))return void 0}else m=r(h);var p=this;return c(m,function(e){var t=new Uint16Array(e,0,p._heightmapWidth*p._heightmapWidth);return new l({buffer:t,childTileMask:new Uint8Array(e,t.byteLength,1)[0],waterMask:new Uint8Array(e,t.byteLength+1,e.byteLength-t.byteLength-1),width:p._heightmapWidth,height:p._heightmapWidth,structure:p._terrainDataStructure})})},h.prototype.getErrorEvent=function(){return this._errorEvent},h.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<r;++r)e[r].destroy();this._primitives=[]},o.prototype.contains=function(e){return!!(e&&e._external&&e._external._composites&&e._external._composites[this._guid])},o.prototype.raise=function(e){if(t(e)){var r=n(this,e),i=this._primitives;if(r!==i.length-1){var o=i[r];i[r]=i[r+1],i[r+1]=o}}},o.prototype.raiseToTop=function(e){if(t(e)){var r=n(this,e),i=this._primitives;r!==i.length-1&&(i.splice(r,1),i.push(e))}},o.prototype.lower=function(e){if(t(e)){var r=n(this,e),i=this._primitives;if(0!==r){var o=i[r];i[r]=i[r-1],i[r-1]=o}}},o.prototype.lowerToBottom=function(e){if(t(e)){var r=n(this,e),i=this._primitives;0!==r&&(i.splice(r,1),i.unshift(e))}},o.prototype.get=function(e){if(!t(e))throw new i("index is required.");return this._primitives[e]},o.prototype.getLength=function(){return this._primitives.length},o.prototype.update=function(e,t,r){if(this.show){this._centralBody&&this._centralBody.update(e,t,r);for(var i=this._primitives,n=i.length,o=0;n>o;++o)i[o].update(e,t,r)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return this.removeAll(),this._centralBody=this.destroyPrimitives&&this._centralBody&&this._centralBody.destroy(),r(this)},o}),r("Scene/CreditDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./Credit"],function(e,t,r,i,n){"use strict";function o(e,r,i){if(!t(e.element)){var n=e.getText(),o=e.getLink(),a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(r.hasChildNodes()){var l=document.createElement("span");l.textContent=i,l.className="cesium-credit-delimiter",r.appendChild(l)}r.appendChild(e.element)}function a(e,r){if(!t(e.element)){var i=e.getText(),n=e.getLink(),o=document.createElement("span"),a=document.createElement("img");if(a.src=e.getImageUrl(),a.style["vertical-align"]="bottom",t(i)&&(a.alt=i,a.title=i),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}r.appendChild(e.element)}function s(e,t){for(var r=e.length,i=0;r>i;i++){var o=e[i];if(n.equals(o,t))return!0}return!1}function l(e){var r=e.element;if(t(r)){var i=r.parentNode;if(!e.hasImage()){var n=r.previousSibling;null===n&&(n=r.nextSibling),null!==n&&i.removeChild(n)}i.removeChild(r)}}function u(e,t){var r,i,n,a=e._displayedCredits.textCredits;for(r=0;r0}),asynchronous:this.asynchronous})}var s=this._primitive;s.appearance.material=this.material,s.debugShowBoundingVolume=this.debugShowBoundingVolume,s.update(t,i,n)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},m}),r("Scene/FrameState",["./SceneMode"],function(e){"use strict";var t=function(t){this.mode=e.SCENE3D,this.morphTime=e.SCENE3D.morphTime,this.frameNumber=0,this.time=void 0,this.scene2D={projection:void 0},this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=t,this.events=[]};return t}),r("Scene/FrustumCommands",["../Core/defaultValue"],function(e){"use strict";var t=function(t,r){this.near=e(t,0),this.far=e(r,0),this.opaqueCommands=[],this.translucentCommands=[]};return t}),r("Scene/GoogleEarthImageryProvider",["../Core/defaultValue","../Core/defined","../Core/loadText","../Core/DeveloperError","../Core/RuntimeError","../Core/Event","../Core/Extent","./ImageryProvider","./TileProviderError","./WebMercatorTilingScheme","./GeographicTilingScheme","./Credit","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,r,i,n){var o=e._imageUrlTemplate;o=o.replace("{x}",r),o=o.replace("{y}",i),o=o.replace("{zoom}",n+1);var a=e._proxy;return t(a)&&(o=a.getURL(o)),o}var p=function f(s){function m(e){var r;try{r=JSON.parse(e)}catch(i){r=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var o,s=0;st.right)throw new r("right must be greater than left.");if(t.bottom>t.top)throw new r("top must be greater than bottom.");if(t.near<=0||t.near>t.far)throw new r("near must be greater than zero and less than far.");t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=a.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix)}}var u=function(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new s,this._orthographicMatrix=void 0};t(u.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var c=new n,h=new n,d=new n,m=new n;return u.prototype.computeCullingVolume=function(t,i,a){if(!e(t))throw new r("position is required.");if(!e(i))throw new r("direction is required.");if(!e(a))throw new r("up is required.");var s=this._cullingVolume.planes,l=this.top,u=this.bottom,p=this.right,f=this.left,v=this.near,y=this.far,g=n.cross(i,a,c),_=h;n.multiplyByScalar(i,v,_),n.add(t,_,_);var w=d;n.multiplyByScalar(g,f,w),n.add(_,w,w);var C=s[0];return e(C)||(C=s[0]=new o),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-n.dot(g,w),n.multiplyByScalar(g,p,w),n.add(_,w,w),C=s[1],e(C)||(C=s[1]=new o),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-n.dot(n.negate(g,m),w),n.multiplyByScalar(a,u,w),n.add(_,w,w),C=s[2],e(C)||(C=s[2]=new o),C.x=a.x,C.y=a.y,C.z=a.z,C.w=-n.dot(a,w),n.multiplyByScalar(a,l,w),n.add(_,w,w),C=s[3],e(C)||(C=s[3]=new o),C.x=-a.x,C.y=-a.y,C.z=-a.z,C.w=-n.dot(n.negate(a,m),w),C=s[4],e(C)||(C=s[4]=new o),C.x=i.x,C.y=i.y,C.z=i.z,C.w=-n.dot(i,_),n.multiplyByScalar(i,y,w),n.add(t,w,w),C=s[5],e(C)||(C=s[5]=new o),C.x=-i.x,C.y=-i.y,C.z=-i.z,C.w=-n.dot(n.negate(i,m),w),this._cullingVolume},u.prototype.getPixelSize=function(t,n,o){if(l(this),!e(t))throw new r("drawingBufferDimensions is required.");var a=t.x,s=t.y;if(0>=a)throw new r("drawingBufferDimensions.x must be greater than zero.");if(0>=s)throw new r("drawingBufferDimensions.y must be greater than zero.");var u=this.right-this.left,c=this.top-this.bottom,h=u/a,d=c/s;return e(o)?(o.x=h,o.y=d,o):new i(h,d)},u.prototype.clone=function(t){return e(t)||(t=new u),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},u.prototype.equals=function(t){return e(t)&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},u}),r("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),r("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/VertexFormat","./Appearance","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){t=e(t,e.EMPTY_OBJECT);var l=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?o:i,d=c?a:n,m=c?s.FLAT_VERTEX_FORMAT:s.VERTEX_FORMAT;this.material=void 0,this.vertexShaderSource=e(t.vertexShaderSource,h),this.fragmentShaderSource=e(t.fragmentShaderSource,d),this.renderState=e(t.renderState,r.getDefaultRenderState(l,u)),this.vertexFormat=m,this.flat=c,this.faceForward=e(t.faceForward,!1),this.translucent=l,this.closed=u};return s.VERTEX_FORMAT=t.POSITION_AND_NORMAL,s.FLAT_VERTEX_FORMAT=t.POSITION_ONLY,s.prototype.getFragmentShaderSource=r.prototype.getFragmentShaderSource,s.prototype.isTranslucent=r.prototype.isTranslucent,s.prototype.getRenderState=r.prototype.getRenderState,s}),r("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),r("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),r("Scene/ViewportQuad",["../Core/Color","../Core/destroyObject","../Core/defined","../Core/DeveloperError","../Core/BoundingRectangle","../Core/ComponentDatatype","../Core/PrimitiveType","../Core/Geometry","../Core/GeometryAttribute","./Material","../Renderer/BufferUsage","../Renderer/BlendingState","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","../Shaders/ViewportQuadVS","../Shaders/ViewportQuadFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function y(e){var t=e.cache.viewportQuad_vertexArray;if(r(t))return t;var i=new s({attributes:{position:new l({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new l({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},primitiveType:a.TRIANGLES});return t=e.createVertexArrayFromGeometry({geometry:i,attributeIndices:_,bufferUsage:c.STATIC_DRAW}),e.cache.viewportQuad_vertexArray=t,t}var g=function(t,i){this._va=void 0,this._overlayCommand=new d,this._overlayCommand.primitiveType=a.TRIANGLE_FAN,this._overlayCommand.pass=p.OVERLAY,this._overlayCommand.owner=this,this.show=!0,r(t)||(t=new n),this.rectangle=n.clone(t),r(i)||(i=u.fromType(u.ColorType),i.uniforms.color=new e(1,1,1,1)),this.material=i,this._material=void 0},_={position:0,textureCoordinates:1};return g.prototype.update=function(e,t,o){if(this.show){if(!r(this.material))throw new i("this.material must be defined.");if(!r(this.rectangle))throw new i("this.rectangle must be defined.");r(this._va)||(this._va=y(e),this._overlayCommand.vertexArray=this._va);var a=this._overlayCommand.renderState;r(a)&&n.equals(a.viewport,this.rectangle)||(this._overlayCommand.renderState=e.createRenderState({blending:h.ALPHA_BLEND,viewport:this.rectangle}));var s=t.passes;if(s.render){if(this._material!==this.material){this._material=this.material;var l=m({sources:[this._material.shaderSource,v]});this._overlayCommand.shaderProgram=e.getShaderCache().replaceShaderProgram(this._overlayCommand.shaderProgram,f,l,_)}this._material.update(e),this._overlayCommand.uniformMap=this._material._uniforms,o.push(this._overlayCommand)}}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.release(),t(this)},g}),r("Scene/PerformanceDisplay",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Renderer/PixelFormat","./Material","./ViewportQuad"],function(e,t,r,i,n,o,a,s){"use strict";var l=t.fromCssColorString("#e52"),u=t.fromCssColorString("#de3"),c=t.fromCssColorString("rgba(0, 0, 30, 0.9)"),h=new e(0,0,80,40),d=function(e){e=r(e,r.EMPTY_OBJECT),this._fpsColor=r(e.fpsColor,l).toCssColorString(),this._frameTimeColor=r(e.frameTimeColor,u).toCssColorString(),this._backgroundColor=r(e.backgroundColor,c).toCssColorString(),this._font=r(e.font,"bold 10px Helvetica,Arial,sans-serif"),this._rectangle=r(e.rectangle,h),this._canvas=document.createElement("canvas"),this._canvas.width=this._rectangle.width,this._canvas.height=this._rectangle.height,this._canvasContext=this._canvas.getContext("2d"),this._canvasContext.font=this._font,this._canvasContext.lineWidth=1,this._bufferLength=this._rectangle.width,this._frameTimeSamples=new Array(this._bufferLength),this._fpsSamples=new Array(this._bufferLength);for(var t=0;t=this._bufferLength&&(this._frameTimeIndex=0),this._frameCount++;var c=this._fps,h=l-this._lastFpsSampleTime;h>1e3&&(c=this._fps=0|1e3*this._frameCount/h,this._fpsSamples[this._fpsIndex++]=c,this._fpsIndex>=this._bufferLength&&(this._fpsIndex=0),this._lastFpsSampleTime=l,this._frameCount=0);var d=this._canvasContext,m=this._rectangle.width,p=this._rectangle.height;d.clearRect(0,0,m,p),d.fillStyle=this._backgroundColor,d.fillRect(0,0,m,p),i(c)&&(d.fillStyle=this._fpsColor,d.textAlign="left",d.fillText(c+" FPS",1,10)),d.fillStyle=this._frameTimeColor,d.textAlign="right",d.fillText(u+" MS",m-1,10);for(var f=0;f0&&this._drawLine(this._fpsColor,f,c/100),u=this._frameTimeSamples[(f+this._frameTimeIndex)%this._bufferLength],u>0&&this._drawLine(this._frameTimeColor,f,u/200);i(this._quad)||(this._quad=new s(void 0,a.fromType(a.ImageType))),i(this._texture)?this._texture.copyFrom(this._canvas):(this._texture=e.createTexture2D({source:this._canvas,pixelFormat:o.RGBA}),this._quad.material.uniforms.image=this._texture);var v=e.getDrawingBufferHeight();if(v!==this._viewportHeight){this._viewportHeight=v;var y=this._quad.rectangle;y.x=this._rectangle.x,y.y=v-p-this._rectangle.y,y.width=m,y.height=p}this._quad.update(e,t,r)},d.prototype._drawLine=function(e,t,r){var i=this._canvasContext,n=this._rectangle.height,o=n-10;t=.5+t,i.beginPath(),i.strokeStyle=e,i.moveTo(t,n);var a=r*o;a>o&&(a=o);var s=n-a;i.lineTo(t,s),i.stroke()},d.prototype.destroy=function(){return this._quad=this._quad.destroy(),n(this)},d}),r("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),r("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/VertexFormat","./Material","./Appearance","../Renderer/createShaderSource","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineFS","../Shaders/PolylineCommon"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r){r=e(r,e.EMPTY_OBJECT);var c=e(r.translucent,!0),h=!1,d=o({sources:[l,a]}),m=s,p=u.VERTEX_FORMAT;this.material=t(r.material)?r.material:i.fromType(i.ColorType),this.vertexShaderSource=e(r.vertexShaderSource,d),this.fragmentShaderSource=e(r.fragmentShaderSource,m),this.renderState=e(r.renderState,n.getDefaultRenderState(c,h)),this.vertexFormat=p,this.translucent=c,this.closed=h};return u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,u.prototype.isTranslucent=n.prototype.isTranslucent,u.prototype.getRenderState=n.prototype.getRenderState,u}),r("Scene/RectangularPyramidSensorVolume",["../Core/clone","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Renderer/BufferUsage","./Material","./CustomSensorVolume"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(n){n=r(n,r.EMPTY_OBJECT),this.show=r(n.show,!0),this.showIntersection=r(n.showIntersection,!0),this.showThroughEllipsoid=r(n.showThroughEllipsoid,!1),this.modelMatrix=s.clone(r(n.modelMatrix,s.IDENTITY)),this.bufferUsage=r(n.bufferUsage,l.STATIC_DRAW),this.radius=r(n.radius,Number.POSITIVE_INFINITY),this.xHalfAngle=r(n.xHalfAngle,a.PI_OVER_TWO),this._xHalfAngle=void 0,this.yHalfAngle=r(n.yHalfAngle,a.PI_OVER_TWO),this._yHalfAngle=void 0,this.material=i(n.material)?n.material:u.fromType(u.ColorType),this.intersectionColor=t.clone(r(n.intersectionColor,t.WHITE)),this.intersectionWidth=r(n.intersectionWidth,5),this.id=n.id;var o=e(n);o._pickIdThis=r(n._pickIdThis,this),this._customSensor=new c(o)};return h.prototype.update=function(e,t,r){if(this.xHalfAngle>a.PI_OVER_TWO||this.yHalfAngle>a.PI_OVER_TWO)throw new o("this.xHalfAngle and this.yHalfAngle must each be less than or equal to 90 degrees.");var i=this._customSensor;if(i.show=this.show,i.showIntersection=this.showIntersection,i.showThroughEllipsoid=this.showThroughEllipsoid,i.modelMatrix=this.modelMatrix,i.bufferUsage=this.bufferUsage,i.radius=this.radius,i.material=this.material,i.intersectionColor=this.intersectionColor,i.intersectionWidth=this.intersectionWidth,i.id=this.id,this._xHalfAngle!==this.xHalfAngle||this._yHalfAngle!==this.yHalfAngle){this._xHalfAngle=this.xHalfAngle,this._yHalfAngle=this.yHalfAngle;var n=Math.tan(Math.min(this.xHalfAngle,a.toRadians(89))),s=Math.tan(Math.min(this.yHalfAngle,a.toRadians(89))),l=Math.atan(n/s),u=Math.atan(Math.sqrt(n*n+s*s));i.setDirections([{clock:l,cone:u},{clock:a.toRadians(180)-l,cone:u},{clock:a.toRadians(180)+l,cone:u},{clock:-l,cone:u}])}i.update(e,t,r)},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this._customSensor=this._customSensor&&this._customSensor.destroy(),n(this)},h}),r("Scene/ScreenSpaceCameraController",["../Core/defined","../Core/destroyObject","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/DeveloperError","../Core/Ellipsoid","../Core/KeyboardEventModifier","../Core/FAR","../Core/IntersectionTests","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/Transforms","./AnimationCollection","./CameraEventAggregator","./CameraEventType","./CameraColumbusViewMode","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_){"use strict";function w(e,t){if(0>e)return 0;var r=25*(1-t);return Math.exp(-r*e)}function C(e){return r.equalsEpsilon(e.startPosition,e.endPosition,h.EPSILON14)}function x(t,n,o,a,s,l,u){var c=l[u];e(c)||(c=l[u]={startPosition:new r,endPosition:new r,motion:new r,active:!1});var h=t.getButtonPressTime(n,o),d=t.getButtonReleaseTime(n,o),m=h&&d&&(d.getTime()-h.getTime())/1e3,p=new Date,f=d&&(p.getTime()-d.getTime())/1e3;if(h&&d&&W>m){var v=w(f,a);if(c.active)r.clone(c.endPosition,c.startPosition),r.multiplyByScalar(c.motion,v,c.endPosition),r.add(c.startPosition,c.endPosition,c.endPosition),i.clone(r.ZERO,c.motion);else{var y=t.getLastMovement(n,o);if(!e(y)||C(y))return;c.motion.x=.5*(y.endPosition.x-y.startPosition.x),c.motion.y=.5*(y.endPosition.y-y.startPosition.y),r.clone(y.startPosition,c.startPosition),r.multiplyByScalar(c.motion,v,c.endPosition),r.add(c.startPosition,c.endPosition,c.endPosition),c.active=!0}if(isNaN(c.endPosition.x)||isNaN(c.endPosition.y)||C(c))return c.active=!1,void 0;t.isButtonDown(n,o)||s(l,c)}else c.active=!1}function S(t,r,i,n,o,a){if(e(i)){var s=t._aggregator;Array.isArray(i)||(q[0]=i,i=q);for(var l=i.length,u=0;l>u;++u){var c=i[u],h=e(c.eventType)?c.eventType:c,d=c.modifier,m=s.isMoving(h,d)&&s.getMovement(h,d);r&&(m?n(t,s.getMovement(h,d)):1>o&&x(s,h,d,o,n,t,a))}}}function E(t,r,i,n,o){var a=1;e(o)&&(a=h.clamp(Math.abs(o),.25,1));var s=t.minimumZoomDistance*a,l=t.maximumZoomDistance,u=n-s,c=i*u;c=h.clamp(c,t._minimumZoomRate,t._maximumZoomRate);var d=r.endPosition.y-r.startPosition.y,m=d/t._canvas.clientHeight;m=Math.min(m,t.maximumMovementRatio);var p=c*m;p>0&&Math.abs(n-s)<1||0>p&&Math.abs(n-l)<1||(s>n-p?p=n-s-1:n-p>l&&(p=n-l),t._cameraController.zoomIn(p))}function b(e,t){var r=e._cameraController,i=r.getPickRay(t.startPosition,G).origin,n=r.getPickRay(t.endPosition,H).origin;r.moveRight(i.x-n.x),r.moveUp(i.y-n.y)}function T(t,r){e(r.distance)&&(r=r.distance),E(t,r,t._zoomFactor,t._cameraController.getMagnitude())}function A(t,i){if(e(i.angleAndHeight))return D(t,i.angleAndHeight),void 0;var n=t._canvas.clientWidth,o=t._canvas.clientHeight,a=j;a.x=2/n*i.startPosition.x-1,a.y=2/o*(o-i.startPosition.y)-1,r.normalize(a,a);var s=Y;s.x=2/n*i.endPosition.x-1,s.y=2/o*(o-i.endPosition.y)-1,r.normalize(s,s);var l=Math.acos(a.x);a.y<0&&(l=h.TWO_PI-l);var u=Math.acos(s.x);s.y<0&&(u=h.TWO_PI-u);var c=u-l;t._cameraController.twistRight(c)}function D(e,t){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),rh.EPSILON6&&(i.normalize(m,m),r.move(m,f))}function I(t,r){e(r.angleAndHeight)&&(r=r.angleAndHeight);var n=$;n.x=t._canvas.clientWidth/2,n.y=t._canvas.clientHeight/2;var o=t._cameraController.getPickRay(n,et),a=i.UNIT_X,l=o.origin,u=o.direction,c=-i.dot(a,l)/i.dot(a,u),h=i.multiplyByScalar(u,c,tt);i.add(l,h,h);var m=d.fromTranslation(h,rt),p=t._ellipsoid;t.setEllipsoid(s.UNIT_SPHERE),z(t,r,m,i.UNIT_Z),t.setEllipsoid(p)}function O(t,r){e(r.distance)&&(r=r.distance);var n=it;n.x=t._canvas.clientWidth/2,n.y=t._canvas.clientHeight/2;var o=t._cameraController.getPickRay(n,nt),a=i.UNIT_X,s=o.origin,l=o.direction,u=-i.dot(a,s)/i.dot(a,l);E(t,r,t._zoomFactor,u)}function R(t){if(t.columbusViewMode===g.LOCKED)S(t,t.enableRotate,t.rotateEventTypes,z,t.inertiaSpin,"_lastInertiaSpinMovement"),S(t,t.enableZoom,t.zoomEventTypes,B,t.inertiaZoom,"_lastInertiaZoomMovement");else{if(t._aggregator.anyButtonDown()&&t._animationCollection.removeAll(),S(t,t.enableTilt,t.tiltEventTypes,I,t.inertiaSpin,"_lastInertiaTiltMovement"),S(t,t.enableTranslate,t.translateEventTypes,M,t.inertiaTranslate,"_lastInertiaTranslateMovement"),S(t,t.enableZoom,t.zoomEventTypes,O,t.inertiaZoom,"_lastInertiaZoomMovement"),S(t,t.enableLook,t.lookEventTypes,V),!(t._aggregator.anyButtonDown()||e(t._lastInertiaZoomMovement)&&t._lastInertiaZoomMovement.active||e(t._lastInertiaTranslateMovement)&&t._lastInertiaTranslateMovement.active||t._animationCollection.contains(t._animation))){var r=t._cameraController.createCorrectPositionAnimation(t.bounceAnimationTime);e(r)&&(t._animation=t._animationCollection.add(r))}t._animationCollection.update()}}function L(t,r){e(t._cameraController.pickEllipsoid(r.startPosition,t._ellipsoid,ot))?N(t,r):z(t,r)}function z(t,r,n,o,a){var s=t._cameraController,l=s.constrainedAxis;e(o)&&(s.constrainedAxis=o);var u=i.magnitude(s._camera.position),c=t._rotateFactor*(u-t._rotateRateRangeAdjustment);c>t._maximumRotateRate&&(c=t._maximumRotateRate),c0&&T>0||0>b&&0>T?-1:1;b=Math.abs(b);var D=v;v=E*(v*b-A*f*(1-S)),f=E*(f*S+A*D*(1-b))}}if(s.rotateRight(f,n),s.rotateUp(v,n),e(a)){var P=i.clone(s._camera.directionWC,at),M=d.inverseTransformation(n,ut);P=d.multiplyByPointAsVector(M,P,P);var I=-i.dot(P,o),O=Math.acos(I);O>a&&(O-=a,s.rotateUp(-O,n))}s.constrainedAxis=l}function N(t,r){var n=t._cameraController,o=n.pickEllipsoid(r.startPosition,t._ellipsoid,ct),a=n.pickEllipsoid(r.endPosition,t._ellipsoid,ht);if(e(o)&&e(a))if(o=n._camera.worldToCameraCoordinates(o,o),a=n._camera.worldToCameraCoordinates(a,a),e(n.constrainedAxis)){var s=n.constrainedAxis,l=i.mostOrthogonalAxis(s,dt);i.cross(l,s,l),i.normalize(l,l);var u=i.cross(s,l,mt),c=i.magnitude(o),d=i.dot(s,o),m=Math.acos(d/c),p=i.multiplyByScalar(s,d,pt);i.subtract(o,p,p),i.normalize(p,p);var f=i.magnitude(a),v=i.dot(s,a),y=Math.acos(v/f),g=i.multiplyByScalar(s,v,ft);i.subtract(a,g,g),i.normalize(g,g);var _=Math.acos(i.dot(p,l));i.dot(p,u)<0&&(_=h.TWO_PI-_);var w=Math.acos(i.dot(g,l));i.dot(g,u)<0&&(w=h.TWO_PI-w);var C,x=_-w;C=i.equalsEpsilon(s,n._camera.position,h.EPSILON2)?n._camera.right:i.cross(s,n._camera.position,dt);var S,E=i.cross(s,C,dt),b=i.dot(E,i.subtract(o,s,mt)),T=i.dot(E,i.subtract(a,s,mt));S=b>0&&T>0?y-m:b>0&&0>=T?i.dot(n._camera.position,s)>0?-m-y:m+y:m-y,n.rotateRight(x),n.rotateUp(S)}else{i.normalize(o,o),i.normalize(a,a);var A=i.dot(o,a),D=i.cross(o,a,dt);if(1>A&&!i.equalsEpsilon(D,i.ZERO,h.EPSILON14)){var P=Math.acos(A);n.rotate(D,P)}}}function B(t,r){e(r.distance)&&(r=r.distance);var n=t._cameraController._camera,o=t._ellipsoid,a=o.cartesianToCartographic(n.position).height,s=i.normalize(n.position,vt);E(t,r,t._zoomFactor,a,i.dot(s,n.direction))}function F(t,r){e(r.angleAndHeight)&&(r=r.angleAndHeight);var n=t._cameraController,o=t._ellipsoid,a=.25*t.minimumZoomDistance,l=o.cartesianToCartographic(t._cameraController._camera.position).height;if(!(l-a-1c&&(u=Math.acos(c)),u=r.startPosition.x>r.endPosition.x?-u:u;var h=t._horizontalRotationAxis;e(h)?n.look(h,u):n.lookLeft(u),o.x=0,o.y=r.startPosition.y,a.x=0,a.y=r.endPosition.y,s=n.getPickRay(o,Et).direction,l=n.getPickRay(a,bt).direction,u=0,c=i.dot(s,l),1>c&&(u=Math.acos(c)),u=r.startPosition.y>r.endPosition.y?-u:u,n.lookUp(u)}function k(e){S(e,e.enableRotate,e.rotateEventTypes,L,e.inertiaSpin,"_lastInertiaSpinMovement"),S(e,e.enableZoom,e.zoomEventTypes,B,e.inertiaZoom,"_lastInertiaZoomMovement"),S(e,e.enableTilt,e.tiltEventTypes,F,e.inertiaSpin,"_lastInertiaTiltMovement"),S(e,e.enableLook,e.lookEventTypes,V)}var U=function(t,r){if(!e(t))throw new a("canvas is required.");if(!e(r))throw new a("cameraController is required.");this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.columbusViewMode=g.FREE,this.bounceAnimationTime=3e3,this.minimumZoomDistance=20,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=y.LEFT_DRAG,this.zoomEventTypes=[y.RIGHT_DRAG,y.WHEEL,y.PINCH],this.rotateEventTypes=y.LEFT_DRAG,this.tiltEventTypes=[y.MIDDLE_DRAG,y.PINCH,{eventType:y.LEFT_DRAG,modifier:l.CTRL}],this.lookEventTypes={eventType:y.LEFT_DRAG,modifier:l.SHIFT},this._canvas=t,this._cameraController=r,this._ellipsoid=s.WGS84,this._aggregator=new v(t),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaWheelZoomMovement=void 0,this._lastInertiaTiltMovement=void 0,this._animationCollection=new f,this._animation=void 0,this._horizontalRotationAxis=void 0;var i=this._ellipsoid.getMaximumRadius();this._zoomFactor=5,this._rotateFactor=1/i,this._rotateRateRangeAdjustment=i,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._translateFactor=1,this._minimumZoomRate=20,this._maximumZoomRate=u};U.prototype.getEllipsoid=function(){return this._ellipsoid},U.prototype.setEllipsoid=function(e){e=e||s.WGS84;var t=e.getMaximumRadius();this._ellipsoid=e,this._rotateFactor=1/t,this._rotateRateRangeAdjustment=t};var W=.4,q=[],G=new m,H=new m,j=new r,Y=new r,X=new m,Z=new m,J=new i,K=new i,Q=new i,$=new r,et=new m,tt=new i,rt=new d,it=new r,nt=new m,ot=new i,at=i.clone(i.ZERO),st=new i,lt=new i,ut=new d,ct=n.clone(n.UNIT_W),ht=n.clone(n.UNIT_W),dt=new i,mt=new i,pt=new i,ft=new i,vt=new i,yt=new r,gt=new m,_t=new o,wt=n.clone(n.UNIT_W),Ct=new d,xt=new r,St=new r,Et=new m,bt=new m;return U.prototype.update=function(e){e===_.SCENE2D?P(this):e===_.COLUMBUS_VIEW?(this._horizontalRotationAxis=i.UNIT_Z,R(this)):e===_.SCENE3D&&(this._horizontalRotationAxis=void 0,k(this)),this._aggregator.reset()},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){return this._spinHandler=this._spinHandler&&this._spinHandler.destroy(),this._translateHandler=this._translateHandler&&this._translateHandler.destroy(),this._lookHandler=this._lookHandler&&this._lookHandler.destroy(),this._rotateHandler=this._rotateHandler&&this._rotateHandler.destroy(),this._zoomHandler=this._zoomHandler&&this._zoomHandler.destroy(),this._zoomWheelHandler=this._zoomWheelHandler&&this._zoomWheelHandler.destroy(),this._pinchHandler=this._pinchHandler&&this._pinchHandler.destroy(),t(this)},U}),r("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),r("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),r("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),r("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),r("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Geometry","../Core/GeometryAttribute","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/Transforms","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/PixelFormat","../Renderer/RenderbufferFormat","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough","../Shaders/ViewportQuadVS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b){"use strict";function T(e){var t=e.cache.viewportQuad_vertexArray;if(a(t))return t;var r=new l({attributes:{position:new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},primitiveType:d.TRIANGLES});return t=e.createVertexArrayFromGeometry({geometry:r,attributeIndices:D,bufferUsage:p.STATIC_DRAW}),e.cache.viewportQuad_vertexArray=t,t}var A=function(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new y,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new y,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t};A.prototype.clear=function(e,t){var r=this._clearFBO1Command;i.clone(o(t,i.BLACK),r.color),r.execute(e),r=this._clearFBO2Command,i.clone(o(t,i.BLACK),r.color),r.execute(e)},A.prototype.execute=function(e){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var D={position:0,textureCoordinates:1},P=new e,M=new e,I=new r,O=new t,R=new t,L=new h;return A.prototype.update=function(e){var r=e.getDrawingBufferWidth(),n=e.getDrawingBufferHeight(),o=this;if(!a(this._fbo)){this._fbo=e.createFramebuffer(),this._downSampleFBO1=e.createFramebuffer(),this._downSampleFBO2=e.createFramebuffer(),this._clearFBO1Command=new f,this._clearFBO1Command.color=new i,this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command=new f,this._clearFBO2Command.color=new i,this._clearFBO2Command.framebuffer=this._downSampleFBO2;var s=d.TRIANGLE_FAN,l=T(e),u=this._downSampleCommand=new v;u.owner=this,u.primitiveType=s,u.vertexArray=l,u.shaderProgram=e.getShaderCache().getShaderProgram(b,E,D),u.uniformMap={},u.framebuffer=this._downSampleFBO1;var p=this._brightPassCommand=new v;p.owner=this,p.primitiveType=s,p.vertexArray=l,p.shaderProgram=e.getShaderCache().getShaderProgram(b,x,D),p.uniformMap={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},p.framebuffer=this._downSampleFBO2;var y=1,A=2,z=this._blurXCommand=new v;z.owner=this,z.primitiveType=s,z.vertexArray=l,z.shaderProgram=e.getShaderCache().getShaderProgram(b,S,D),z.uniformMap={delta:function(){return y},sigma:function(){return A},direction:function(){return 0}},z.framebuffer=this._downSampleFBO1;var N=this._blurYCommand=new v;N.owner=this,N.primitiveType=s,N.vertexArray=l,N.shaderProgram=e.getShaderCache().getShaderProgram(b,S,D),N.uniformMap={delta:function(){return y},sigma:function(){return A},direction:function(){return 1}},N.framebuffer=this._downSampleFBO2;var B=this._blendCommand=new v;B.owner=this,B.primitiveType=s,B.vertexArray=l,B.shaderProgram=e.getShaderCache().getShaderProgram(b,C,D),B.uniformMap={u_center:function(){return o._uCenter},u_radius:function(){return o._uRadius}};var F=this._fullScreenCommand=new v;F.owner=this,F.primitiveType=s,F.vertexArray=l,F.shaderProgram=e.getShaderCache().getShaderProgram(b,E,D),F.uniformMap={}}var V=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))-2),k=Math.pow(2,Math.ceil(Math.log(n)/Math.log(2))-2),U=Math.max(V,k),W=P;W.width=r,W.height=n;var q=M;q.width=U,q.height=U;var G=this._fbo,H=G.getColorTexture();if(!a(H)||H.getWidth()!==r||H.getHeight()!==n){this._blurStep.x=this._blurStep.y=1/U,G.setColorTexture(e.createTexture2D({width:r,height:n})),e.getDepthTexture()?G.setDepthTexture(e.createTexture2D({width:r,height:n,pixelFormat:_.DEPTH_COMPONENT,pixelDatatype:g.UNSIGNED_SHORT})):G.setDepthRenderbuffer(e.createRenderbuffer({format:w.DEPTH_COMPONENT16})),this._downSampleFBO1.setColorTexture(e.createTexture2D({width:U,height:U})),this._downSampleFBO2.setColorTexture(e.createTexture2D({width:U,height:U}));var j=e.createRenderState({viewport:q}),Y=e.createRenderState();this._downSampleCommand.uniformMap.u_texture=function(){return G.getColorTexture()},this._downSampleCommand.renderState=j,this._brightPassCommand.uniformMap.u_texture=function(){return o._downSampleFBO1.getColorTexture()},this._brightPassCommand.renderState=j,this._blurXCommand.uniformMap.u_texture=function(){return o._downSampleFBO2.getColorTexture()},this._blurXCommand.uniformMap.u_step=function(){return o._blurStep},this._blurXCommand.renderState=j,this._blurYCommand.uniformMap.u_texture=function(){return o._downSampleFBO1.getColorTexture()},this._blurYCommand.uniformMap.u_step=function(){return o._blurStep},this._blurYCommand.renderState=j,this._blendCommand.uniformMap.u_texture0=function(){return G.getColorTexture()},this._blendCommand.uniformMap.u_texture1=function(){return o._downSampleFBO2.getColorTexture()},this._blendCommand.renderState=Y,this._fullScreenCommand.uniformMap.u_texture=function(){return G.getColorTexture()},this._fullScreenCommand.renderState=Y}var X=e.getUniformState(),Z=X.getSunPositionWC(),J=X.getView(),K=X.getViewProjection(),Q=X.getProjection(),$=h.computeViewportTransformation(W,0,1,L),et=h.multiplyByPoint(J,Z,I),tt=m.pointToWindowCoordinates(K,$,Z,O);et.x+=c.SOLAR_RADIUS;var rt=m.pointToWindowCoordinates(Q,$,et,et),it=2*30*t.magnitude(t.subtract(rt,tt,rt)),nt=R;nt.x=it,nt.y=it;var ot=this._upSamplePassState.scissorTest.rectangle;return ot.x=Math.max(tt.x-.5*nt.x,0),ot.y=Math.max(tt.y-.5*nt.y,0),ot.width=Math.min(nt.x,r),ot.height=Math.min(nt.y,n),t.clone(tt,this._uCenter),this._uRadius=.5*Math.max(nt.x,nt.y),$=h.computeViewportTransformation(q,0,1,L),tt=m.pointToWindowCoordinates(K,$,Z,O),nt.x*=V/r,nt.y*=k/n,ot=this._downSamplePassState.scissorTest.rectangle,ot.x=Math.max(tt.x-.5*nt.x,0),ot.y=Math.max(tt.y-.5*nt.y,0),ot.width=Math.min(nt.x,r),ot.height=Math.min(nt.y,n),this._downSamplePassState.context=e,this._upSamplePassState.context=e,this._fbo},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.release(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.release(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.release(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.release(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.release(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.release(),s(this)},A}),r("Scene/Scene",["../Core/Math","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicProjection","../Core/Ellipsoid","../Core/Occluder","../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Intersect","../Core/Interval","../Core/Matrix4","../Core/JulianDate","../Core/EllipsoidGeometry","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/ColorGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Renderer/Context","../Renderer/ClearCommand","../Renderer/PassState","../Renderer/Pass","./Camera","./ScreenSpaceCameraController","./CompositePrimitive","./CullingVolume","./AnimationCollection","./SceneMode","./SceneTransforms","./FrameState","./OrthographicFrustum","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./FrustumCommands","./Primitive","./PerInstanceColorAppearance","./SunPostProcess","./CreditDisplay"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M,I,O,R,L,z,N,B,F,V,k,U){"use strict";function W(e){var t=e._primitives.getCentralBody();if(e.mode===I.SCENE3D&&i(t)){var r=t.getEllipsoid();return lt.radius=r.getMinimumRadius(),st=l.fromBoundingSphere(lt,e._camera.positionWC,st)}return void 0}function q(e){e.render=!1,e.pick=!1}function G(e,t,r){var i=e._camera,n=e._frameState;n.mode=e.mode,n.morphTime=e.morphTime,n.scene2D=e.scene2D,n.frameNumber=t,n.time=r,n.camera=i,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),n.occluder=W(e),n.events.length=0,q(n.passes)}function H(e,t,r,n,o){o.length=n;for(var a=0;n>a;++a){var s=Math.max(e,Math.pow(r,a)*e),l=Math.min(t,r*s);0!==a&&(s*=.99);var u=o[a];i(u)?(u.near=s,u.far=l):u=o[a]=new B(s,l)}}function j(e,t,r){e.debugShowFrustums&&(t.debugOverlappingFrustums=0);for(var n=e._frustumCommandsList,o=n.length,a=0;o>a;++a){var s=n[a],l=s.near,u=s.far;if(!(r.start>u)){if(r.stopc;++c)l[c].opaqueIndex=0,l[c].translucentIndex=0;var h,d=Number.MAX_VALUE,p=Number.MIN_VALUE,f=!1;e._frameState.mode===I.SCENE3D&&(h=e._frameState.occluder);for(var v=ut.planes,y=0;5>y;++y)v[y]=n.planes[y];n=ut;for(var g=t.length,_=0;g>_;++_){var w=t[_],C=w.pass;if(C===b.OVERLAY)r.push(w);else{var x=w.boundingVolume;if(i(x)){if(w.cull&&(n.getVisibility(x)===m.OUTSIDE||i(h)&&!h.isBoundingSphereVisible(x)))continue;ct=x.getPlaneDistances(s,a,ct),d=Math.min(d,ct.start),p=Math.max(p,ct.stop)}else ct.start=o.frustum.near,ct.stop=o.frustum.far,f=!(w instanceof S);j(e,w,ct)}}f?(d=o.frustum.near,p=o.frustum.far):(d=Math.min(Math.max(d,o.frustum.near),o.frustum.far),p=Math.max(Math.min(p,o.frustum.far),d));var E=e.farToNearRatio,T=Math.ceil(Math.log(p/d)/Math.log(E));d!==Number.MAX_VALUE&&(T!==u||0!==l.length&&(dl[u-1].far))&&(H(d,p,E,T,l),Y(e))}function X(e){var t={},r=e.getVertexAttributes();for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i].index);return t}function Z(e,r){var n=e.shaderProgram.fragmentShaderSource,o=n.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_Debug_main()"),a="void main() \n{ \n czm_Debug_main(); \n";if(r.debugShowCommands){i(e._debugColor)||(e._debugColor=t.fromRandom());var s=e._debugColor;a+=" gl_FragColor.rgb *= vec3("+s.red+", "+s.green+", "+s.blue+"); \n"}if(r.debugShowFrustums){var l=1&e.debugOverlappingFrustums?"1.0":"0.0",u=2&e.debugOverlappingFrustums?"1.0":"0.0",c=4&e.debugOverlappingFrustums?"1.0":"0.0";a+=" gl_FragColor.rgb *= vec3("+l+", "+u+", "+c+"); \n"}return a+="}",o+"\n"+a}function J(e,t,r,n){if(i(e.shaderProgram)){var o=e.shaderProgram,a=X(o);e.shaderProgram=r.getShaderCache().getShaderProgram(o.vertexShaderSource,Z(e,t),a),e.execute(r,n),e.shaderProgram.release(),e.shaderProgram=o}}function K(e,t,r,n){if((!i(t.debugCommandFilter)||t.debugCommandFilter(e))&&(t.debugShowCommands||t.debugShowFrustums?J(e,t,r,n):e.execute(r,n),e.debugShowBoundingVolume&&i(e.boundingVolume))){if(!i(t._debugSphere)){var o=y.createGeometry(new y({ellipsoid:s.UNIT_SPHERE,vertexFormat:V.FLAT_VERTEX_FORMAT}));t._debugSphere=new F({geometryInstances:new g({geometry:_.toWireframe(o),attributes:{color:new w(1,0,0,1)}}),appearance:new V({flat:!0,translucent:!1}),asynchronous:!1})}var a=f.multiplyByTranslation(f.IDENTITY,e.boundingVolume.center);t._debugSphere.modelMatrix=f.multiplyByUniformScale(a,e.boundingVolume.radius);var l=[];t._debugSphere.update(r,t._frameState,l),l[0].execute(r,n)}}function Q(e,t){if(i(e)){for(var r=t.mode===I.SCENE3D?t.occluder:void 0,n=t.cullingVolume,o=ut.planes,a=0;5>a;++a)o[a]=n.planes[a];n=ut;var s=e.boundingVolume;return i(e)&&(!i(e.boundingVolume)||!e.cull||n.getVisibility(s)!==m.OUTSIDE&&(!i(r)||r.isBoundingSphereVisible(s)))}}function $(e,r,n){var o,a=e._frameState,s=e._camera,l=e._context,u=l.getUniformState();o=i(s.frustum.fovy)?s.frustum.clone(ht):i(s.frustum.infiniteProjectionMatrix)?s.frustum.clone(dt):s.frustum.clone(mt),i(e.sun)&&e.sunBloom!==e._sunBloom?(e._sunPostProcess=e.sunBloom?new k:e._sunPostProcess.destroy(),e._sunBloom=e.sunBloom):!i(e.sun)&&i(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var c=a.passes.render&&i(e.skyBox)?e.skyBox.update(l,a):void 0,h=a.passes.render&&i(e.skyAtmosphere)?e.skyAtmosphere.update(l,a):void 0,d=a.passes.render&&i(e.sun)?e.sun.update(l,a):void 0,m=Q(d,a);m&&e.sunBloom&&(r.framebuffer=e._sunPostProcess.update(l));var p=e._clearColorCommand;t.clone(n,p.color),p.execute(l,r),m&&e.sunBloom&&e._sunPostProcess.clear(l,e.backgroundColor),o.near=s.frustum.near,o.far=s.frustum.far,u.updateFrustum(o),i(c)&&K(c,e,l,r),i(h)&&K(h,e,l,r),i(d)&&m&&(d.execute(l,r),e.sunBloom&&(e._sunPostProcess.execute(l),r.framebuffer=void 0));for(var f=e._clearDepthStencilCommand,v=e._frustumCommandsList,y=v.length,g=0;y>g;++g){f.execute(l,r);var _=y-g-1,w=v[_];o.near=w.near,o.far=w.far,u.updateFrustum(o);var C,x=w.opaqueCommands,S=w.opaqueIndex;for(C=0;S>C;++C)K(x[C],e,l,r);for(x=w.translucentCommands,S=x.length=w.translucentIndex,C=0;S>C;++C)K(x[C],e,l,r)}}function et(e,t){for(var r=e._context,i=e._overlayCommandList,n=i.length,o=0;n>o;++o)i[o].execute(r,t)}function tt(e){var t=e._context,r=e._frameState,n=e._commandList;e._primitives.update(t,r,n),i(e.moon)&&e.moon.update(t,r,n)}function rt(e){for(var t=e.events,r=t.length,i=0;r>i;++i)t[i].raiseEvent()}function it(e,t){var r=e._context,i=e._camera,n=i.frustum,o=r.getDrawingBufferWidth(),a=r.getDrawingBufferHeight(),s=2/o*t.x-1;s*=.5*(n.right-n.left);var l=2/a*(a-t.y)-1;l*=.5*(n.top-n.bottom);var u=i.position;u=new d(u.z,u.x,u.y),u.y+=s,u.z+=l,ft.x=o,ft.y=a;var c=n.getPixelSize(ft,void 0,vt),h=pt;return h.right=.5*c.x,h.left=-h.right,h.top=.5*c.y,h.bottom=-h.top,h.near=n.near,h.far=n.far,h.computeCullingVolume(u,i.directionWC,i.upWC)}function nt(e,t,r,i){var n=e._context,o=e._camera,a=o.frustum,s=a.near,l=n.getDrawingBufferWidth(),u=n.getDrawingBufferHeight(),c=Math.tan(.5*a.fovy),h=a.aspectRatio*c,d=2/l*t.x-1,m=2/u*(u-t.y)-1,p=d*s*h,f=m*s*c;ft.x=l,ft.y=u;var v=a.getPixelSize(ft,void 0,vt),y=.5*v.x*r,g=.5*v.y*i,_=yt;return _.top=f+g,_.bottom=f-g,_.right=p+y,_.left=p-y,_.near=s,_.far=a.far,_.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function ot(e,t,r,i){return e.mode===I.SCENE2D?it(e,t,r,i):nt(e,t,r,i)}var at=function(e,r,n){var o=new x(e,r);i(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0px 0px 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10pt",n.style["padding-right"]="5px",e.parentNode.appendChild(n)),this._frameState=new R(new U(n)),this._passState=new E(o),this._canvas=e,this._context=o,this._primitives=new D,this._pickFramebuffer=void 0,this._camera=new T(o),this._screenSpaceCameraController=new A(e,this._camera.controller),this._animations=new M,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._commandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._clearColorCommand=new S,this._clearColorCommand.color=new t,this._clearColorCommand.owner=!0;var l=new S;l.depth=1,l.stencil=1,l.owner=this,this._clearDepthStencilCommand=l,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=t.clone(t.BLACK),this.mode=I.SCENE3D,this.scene2D={projection:new a(s.WGS84)},this.morphTime=1,this.farToNearRatio=1e3,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugFrustumStatistics=void 0,this._debugSphere=void 0;var u=this._camera.frustum.near,c=this._camera.frustum.far,h=Math.ceil(Math.log(c/u)/Math.log(this.farToNearRatio));H(u,c,this.farToNearRatio,h,this._frustumCommandsList),G(this,0,new v),this.initializeFrame()};at.prototype.getCanvas=function(){return this._canvas},at.prototype.getContext=function(){return this._context},at.prototype.getPrimitives=function(){return this._primitives},at.prototype.getCamera=function(){return this._camera},at.prototype.getScreenSpaceCameraController=function(){return this._screenSpaceCameraController},at.prototype.getUniformState=function(){return this._context.getUniformState()},at.prototype.getFrameState=function(){return this._frameState},at.prototype.getAnimations=function(){return this._animations};var st,lt=new c,ut=new P,ct=new p,ht=new z,dt=new N,mt=new L;at.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.getShaderCache().destroyReleasedShaderPrograms()),this._animations.update(),this._camera.controller.update(this.mode,this.scene2D),this._screenSpaceCameraController.update(this.mode)},at.prototype.render=function(n){i(n)||(n=new v);var o=this.getUniformState(),a=this._frameState,s=e.incrementWrap(a.frameNumber,15e6,1);G(this,s,n),a.passes.render=!0,a.creditDisplay.beginFrame();var l=this._context;o.update(l,a),this._commandList.length=0,this._overlayCommandList.length=0,tt(this),Y(this);var u=this._passState;$(this,u,r(this.backgroundColor,t.BLACK)),et(this,u),a.creditDisplay.endFrame(),l.endFrame(),rt(a)};var pt=new L,ft=new h,vt=new h,yt=new N,gt=3,_t=3,wt=new u(0,0,gt,_t),Ct=new t(0,0,0,0),xt=new h;return at.prototype.pick=function(e){if(!i(e))throw new o("windowPosition is undefined.");var t=this._context,r=this.getUniformState(),n=this._frameState,a=O.transformWindowToDrawingBuffer(t,e,xt);i(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),G(this,n.frameNumber,n.time),n.cullingVolume=ot(this,a,gt,_t),n.passes.pick=!0,r.update(t,n),this._commandList.length=0,tt(this),Y(this),wt.x=a.x-.5*(gt-1),wt.y=t.getDrawingBufferHeight()-a.y-.5*(_t-1),$(this,this._pickFramebuffer.begin(wt),Ct);var s=this._pickFramebuffer.end(wt);return t.endFrame(),rt(n),s},at.prototype.drillPick=function(e){if(!i(e))throw new o("windowPosition is undefined.");for(var t=[],r=this.pick(e);i(r)&&i(r.primitive);){var n=r.primitive;if(t.push(r),i(n.show))n.show=!1;else if("function"==typeof n.setShow)n.setShow(!1);else if("function"==typeof n.getGeometryInstanceAttributes){var a=n.getGeometryInstanceAttributes(r.id);i(a)&&i(a.show)&&(a.show=C.toValue(!1))}r=this.pick(e)}for(var s=0;sS&&(C=0);var E=(S-C)*t;if(Er;++r)e[r].destroy();this._sensors=[]},a.prototype.contains=function(e){return e?-1!==this._sensors.indexOf(e):!1},a.prototype.get=function(t){if(!e(t))throw new r("index is required.");return this._sensors[t]},a.prototype.getLength=function(){return this._sensors.length},a.prototype.update=function(e,t,r){var i=t.mode;if(i===o.SCENE3D)for(var n=this._sensors,a=n.length,s=0;a>s;++s)n[s].update(e,t,r)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),t(this)},a}),r("Scene/SingleTileImageryProvider",["../Core/defaultValue","../Core/defined","../Core/loadImage","../Core/DeveloperError","../Core/Event","../Core/Extent","./Credit","./GeographicTilingScheme","./TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(c){function h(e){C._image=e,C._tileWidth=e.width,C._tileHeight=e.height,C._ready=!0,l.handleSuccess(C._errorEvent)}function d(){var e="Failed to load image "+g+".";w=l.handleError(w,C,C._errorEvent,e,0,0,0,m)}function m(){u(r(g),h,d)}c=e(c,{});var p=c.url;if(!t(p))throw new i("url is required.");this._url=p;var f=c.proxy;this._proxy=f;var v=e(c.extent,o.MAX_VALUE),y=new s({extent:v,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1});this._tilingScheme=y,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new n,this._ready=!1;var g=p;t(f)&&(g=f.getURL(g));var _=c.credit;"string"==typeof _&&(_=new a(_)),this._credit=_;var w,C=this;m()};return c.prototype.getUrl=function(){return this._url},c.prototype.getProxy=function(){return this._proxy},c.prototype.getTileWidth=function(){if(!this._ready)throw new i("getTileWidth must not be called before the imagery provider is ready.");return this._tileWidth},c.prototype.getTileHeight=function(){if(!this._ready)throw new i("getTileHeight must not be called before the imagery provider is ready.");return this._tileHeight},c.prototype.getMaximumLevel=function(){if(!this._ready)throw new i("getMaximumLevel must not be called before the imagery provider is ready.");return 0},c.prototype.getMinimumLevel=function(){if(!this._ready)throw new i("getMinimumLevel must not be called before the imagery provider is ready.");return 0},c.prototype.getTilingScheme=function(){if(!this._ready)throw new i("getTilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme},c.prototype.getExtent=function(){return this._tilingScheme.getExtent()},c.prototype.getTileDiscardPolicy=function(){if(!this._ready)throw new i("getTileDiscardPolicy must not be called before the imagery provider is ready.");return void 0},c.prototype.getErrorEvent=function(){return this._errorEvent},c.prototype.isReady=function(){return this._ready},c.prototype.requestImage=function(){if(!this._ready)throw new i("requestImage must not be called before the imagery provider is ready.");return this._image},c.prototype.getCredit=function(){return this._credit},c}),r("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform float fCameraHeight;\nuniform float fCameraHeight2;\nuniform float fOuterRadius;\nuniform float fOuterRadius2;\nuniform float fInnerRadius;\nuniform float fScale;\nuniform float fScaleDepth;\nuniform float fScaleOverScaleDepth;\nconst float Kr = 0.0025;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float fKmESun = Km * ESun;\nconst float fKrESun = Kr * ESun;\nconst vec3 v3InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nvec3 v3Pos = position.xyz;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\nfloat fStartDepth = exp(-1.0 / fScaleDepth);\nfloat fStartOffset = fStartDepth*scale(fStartAngle);\n#else\nvec3 v3Start = czm_viewerPositionWC;\nfloat fHeight = length(v3Start);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\nfloat fStartAngle = dot(v3Ray, v3Start) / fHeight;\nfloat fStartOffset = fDepth*scale(fStartAngle);\n#endif\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\nfor(int i=0; ithis._outerRadius?this._spSkyFromSpace:this._spSkyFromAtmosphere,s},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.release(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.release(),n(this)},v}),r("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),r("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),r("Scene/SkyBox",["../Core/defaultValue","../Core/BoxGeometry","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/GeometryPipeline","../Core/VertexFormat","../Core/PrimitiveType","../Renderer/loadCubeMap","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/BlendingState","../Scene/SceneMode","../Shaders/SkyBoxVS","../Shaders/SkyBoxFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";var y=function(t){this.sources=t.sources,this._sources=void 0,this.show=e(t.show,!0),this._command=new d,this._command.owner=this,this._cubeMap=void 0};return y.prototype.update=function(e,n){if(!this.show)return void 0;if(n.mode!==p.SCENE3D&&n.mode!==p.MORPHING)return void 0;if(!n.passes.render)return void 0;if(this._sources!==this.sources){this._sources=this.sources;var d=this.sources;if(!(i(d.positiveX)&&i(d.negativeX)&&i(d.positiveY)&&i(d.negativeY)&&i(d.positiveZ)&&i(d.negativeZ)))throw new o("sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof d.positiveX!=typeof d.negativeX||typeof d.positiveX!=typeof d.positiveY||typeof d.positiveX!=typeof d.negativeY||typeof d.positiveX!=typeof d.positiveZ||typeof d.positiveX!=typeof d.negativeZ)throw new o("sources properties must all be the same type.");"string"==typeof d.positiveX?c(e,this._sources).then(function(e){g._cubeMap=g._cubeMap&&g._cubeMap.destroy(),g._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=e.createCubeMap({source:d}))}var y=this._command;if(!i(y.vertexArray)){var g=this;y.uniformMap={u_cubeMap:function(){return g._cubeMap}};var _=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:l.POSITION_ONLY})),w=s.createAttributeIndices(_);y.primitiveType=u.TRIANGLES,y.modelMatrix=a.clone(a.IDENTITY),y.vertexArray=e.createVertexArrayFromGeometry({geometry:_,attributeIndices:w,bufferUsage:h.STATIC_DRAW}),y.shaderProgram=e.getShaderCache().getShaderProgram(f,v,w),y.renderState=e.createRenderState({blending:m.ALPHA_BLEND})}return i(this._cubeMap)?y:void 0},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.release(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},y}),r("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),r("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),r("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),r("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Math","../Core/PrimitiveType","../Core/Geometry","../Core/GeometryAttribute","../Core/Color","../Core/BoundingRectangle","../Core/Matrix4","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/PixelFormat","../Renderer/ClearCommand","./SceneTransforms","./SceneMode","../Shaders/SunVS","../Shaders/SunFS","../Shaders/ViewportQuadVS","../Shaders/SunTextureFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b){"use strict";function T(e){var t=e.cache.viewportQuad_vertexArray;if(o(t))return t;var r=new c({attributes:{position:new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},primitiveType:u.TRIANGLES});return t=e.createVertexArrayFromGeometry({geometry:r,attributeIndices:D,bufferUsage:v.STATIC_DRAW}),e.cache.viewportQuad_vertexArray=t,t}var A=function(){this.show=!0,this._command=new y,this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}};a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var D={position:0,textureCoordinates:1},P=new t,M=new t,I=new i,O=new i;return A.prototype.update=function(i,a){if(!this.show)return void 0;var s=a.mode;if(s===C.SCENE2D||s===C.MORPHING)return void 0;if(!a.passes.render)return void 0;var c=i.getDrawingBufferWidth(),h=i.getDrawingBufferHeight();if(!o(this._texture)||c!==this._drawingBufferWidth||h!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=c,this._drawingBufferHeight=h,this._glowFactorDirty=!1;var A=Math.max(c,h);A=Math.pow(2,Math.ceil(Math.log(A)/Math.log(2))-2),this._texture=i.createTexture2D({width:A,height:A,pixelFormat:g.RGBA});var R=i.createFramebuffer({colorTexture:this._texture});R.destroyAttachments=!1;var L=new _;L.color=new d(0,0,0,0),L.framebuffer=R;var z=new y;z.owner=this,z.primitiveType=u.TRIANGLE_FAN,z.vertexArray=T(i),z.shaderProgram=i.getShaderCache().getShaderProgram(E,b,D),z.framebuffer=R,z.renderState=i.createRenderState({viewport:new m(0,0,A,A)}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=.5*(1/(1+2*this._glowLengthTS));var N=this;z.uniformMap={u_glowLengthTS:function(){return N._glowLengthTS},u_radiusTS:function(){return N._radiusTS}},L.execute(i),z.execute(i),z.shaderProgram.release(),R.destroy()}var B=this._command;if(!o(B.vertexArray)){var F={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=i.createVertexBuffer(V,v.STATIC_DRAW),U=[{index:F.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}];B.vertexArray=i.createVertexArray(U),B.primitiveType=u.TRIANGLE_FAN,B.shaderProgram=i.getShaderCache().getShaderProgram(x,S,F),B.renderState=i.createRenderState({blending:f.ALPHA_BLEND}),B.uniformMap=this._uniformMap,B.boundingVolume=new e}var W=i.getUniformState().getSunPositionWC(),q=i.getUniformState().getSunPositionColumbusView(),G=this._boundingVolume,H=this._boundingVolume2D;r.clone(W,G.center),H.center.x=q.z,H.center.y=q.x,H.center.z=q.y,G.radius=l.SOLAR_RADIUS+l.SOLAR_RADIUS*this._glowLengthTS,H.radius=G.radius,s===C.SCENE3D?e.clone(G,B.boundingVolume):s===C.COLUMBUS_VIEW&&e.clone(H,B.boundingVolume);var j=w.computeActualWgs84Position(a,W,O),Y=r.magnitude(r.subtract(j,a.camera.position,O)),X=i.getUniformState().getProjection(),Z=I;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var J=p.multiplyByVector(X,Z,O),K=w.clipToDrawingBufferCoordinates(i,J,P);Z.x=l.SOLAR_RADIUS;var Q=p.multiplyByVector(X,Z,O),$=w.clipToDrawingBufferCoordinates(i,Q,M);return this._size=Math.ceil(t.magnitude(t.subtract($,K,O))),this._size=2*this._size*(1+2*this._glowLengthTS),B},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.release(),this._texture=this._texture&&this._texture.destroy(),s(this)},A}),r("Scene/TerrainData",["../Core/DeveloperError"],function(e){"use strict";var t=function(){throw new e("This type should not be instantiated directly.")};return t.prototype.interpolateHeight=function(){throw new e("This type should not be instantiated directly.")},t.prototype.isChildAvailable=function(){throw new e("This type should not be instantiated directly.")},t.prototype.getWaterMask=function(){throw new e("This type should not be instantiated directly.")},t.prototype.createMesh=function(){throw new e("This type should not be instantiated directly.")},t.prototype.upsample=function(){throw new e("This type should not be instantiated directly.")},t.prototype.wasCreatedByUpsampling=function(){throw new e("This type should not be instantiated directly.")},t}),r("Scene/TileCoordinatesImageryProvider",["../Core/defaultValue","../Core/Color","../Core/Event","./GeographicTilingScheme"],function(e,t,r,i){"use strict";var n=function(n){n=e(n,{}),this._tilingScheme=e(n.tilingScheme,new i),this._color=e(n.color,t.YELLOW),this._errorEvent=new r,this._tileWidth=e(n.tileWidth,256),this._tileHeight=e(n.tileHeight,256)};return n.prototype.getProxy=function(){return void 0},n.prototype.getTileWidth=function(){return this._tileWidth},n.prototype.getTileHeight=function(){return this._tileHeight},n.prototype.getMaximumLevel=function(){return void 0},n.prototype.getMinimumLevel=function(){return void 0},n.prototype.getTilingScheme=function(){return this._tilingScheme -},n.prototype.getExtent=function(){return this._tilingScheme.getExtent()},n.prototype.getTileDiscardPolicy=function(){return void 0},n.prototype.getErrorEvent=function(){return this._errorEvent},n.prototype.isReady=function(){return!0},n.prototype.requestImage=function(e,t,r){var i=document.createElement("canvas");i.width=256,i.height=256;var n=i.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+r+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),i},n.prototype.getCredit=function(){return void 0},n}),r("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";var t=function(){throw new e("This type should not be instantiated directly.")};return t.prototype.isReady=function(){throw new e("This type should not be instantiated directly.")},t.prototype.shouldDiscardImage=function(){throw new e("This type should not be instantiated directly.")},t}),r("Scene/TileMapServiceImageryProvider",["../Core/defaultValue","../Core/defined","../Core/Cartographic","../Core/DeveloperError","../Core/Event","../Core/loadXML","../Core/Extent","./Credit","./ImageryProvider","./WebMercatorTilingScheme","./GeographicTilingScheme"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,r,i,n){var o=e._tilingScheme.getNumberOfYTilesAtLevel(n),a=e._url+n+"/"+r+"/"+(o-i-1)+"."+e._fileExtension,s=e._proxy;return t(s)&&(a=s.getURL(a)),a}var d=/\/$/,m=function(l){if(l=e(l,{}),!t(l.url))throw new i("description.url is required.");var h=l.url;d.test(h)||(h+="/"),this._url=h,this._ready=!1,this._proxy=l.proxy,this._tileDiscardPolicy=l.tileDiscardPolicy,this._errorEvent=new n;var m=l.credit;"string"==typeof m&&(m=new s(m)),this._credit=m;var p=this;o(h+"tilemapresource.xml").then(function(i){var n=i.getElementsByTagName("TileFormat")[0];p._fileExtension=e(l.fileExtension,n.getAttribute("extension")),p._tileWidth=e(l.tileWidth,parseInt(n.getAttribute("width"),10)),p._tileHeight=e(l.tileHeight,parseInt(n.getAttribute("height"),10));var o=i.getElementsByTagName("TileSet");if(p._minimumLevel=e(l.minimumLevel,parseInt(o[0].getAttribute("order"),10)),p._maximumLevel=e(l.maximumLevel,parseInt(o[o.length-1].getAttribute("order"),10)),p._extent=l.extent,t(p._extent))p._extent=a.clone(p._extent);else{var s=i.getElementsByTagName("BoundingBox")[0],h=r.fromDegrees(parseFloat(s.getAttribute("miny")),parseFloat(s.getAttribute("minx"))),d=r.fromDegrees(parseFloat(s.getAttribute("maxy")),parseFloat(s.getAttribute("maxx")));p._extent=new a(h.longitude,h.latitude,d.longitude,d.latitude)}var m=l.tilingScheme;if(!t(m)){var f=i.getElementsByTagName("TileSets")[0].getAttribute("profile");m="geodetic"===f?new c:new u}p._extent.westm.getExtent().east&&(p._extent.east=m.getExtent().east),p._extent.southm.getExtent().north&&(p._extent.north=m.getExtent().north);var v=m.positionToTileXY(p._extent.getSouthwest(),p._minimumLevel),y=m.positionToTileXY(p._extent.getNortheast(),p._minimumLevel),g=(Math.abs(y.x-v.x)+1)*(Math.abs(y.y-v.y)+1);g>4&&(p._minimumLevel=0),p._tilingScheme=m,p._ready=!0},function(){p._fileExtension=e(l.fileExtension,"png"),p._tileWidth=e(l.tileWidth,256),p._tileHeight=e(l.tileHeight,256),p._minimumLevel=e(l.minimumLevel,0),p._maximumLevel=e(l.maximumLevel,18),p._tilingScheme=e(l.tilingScheme,new u),p._extent=e(l.extent,p._tilingScheme.getExtent()),p._ready=!0})};return m.prototype.getUrl=function(){return this._url},m.prototype.getProxy=function(){return this._proxy},m.prototype.getTileWidth=function(){if(!this._ready)throw new i("getTileWidth must not be called before the imagery provider is ready.");return this._tileWidth},m.prototype.getTileHeight=function(){if(!this._ready)throw new i("getTileHeight must not be called before the imagery provider is ready.");return this._tileHeight},m.prototype.getMinimumLevel=function(){if(!this._ready)throw new i("getMinimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel},m.prototype.getMaximumLevel=function(){if(!this._ready)throw new i("getMaximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel},m.prototype.getTilingScheme=function(){if(!this._ready)throw new i("getTilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme},m.prototype.getExtent=function(){if(!this._ready)throw new i("getExtent must not be called before the imagery provider is ready.");return this._extent},m.prototype.getTileDiscardPolicy=function(){if(!this._ready)throw new i("getTileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy},m.prototype.getErrorEvent=function(){return this._errorEvent},m.prototype.isReady=function(){return this._ready},m.prototype.requestImage=function(e,t,r){if(!this._ready)throw new i("requestImage must not be called before the imagery provider is ready.");var n=h(this,e,t,r);return l.loadImage(this,n)},m.prototype.getCredit=function(){return this._credit},m}),r("Scene/VRTheWorldTerrainProvider",["../Core/defaultValue","../Core/defined","../Core/loadImage","../Core/loadXML","../Core/getImagePixels","../Core/throttleRequestByServer","../Core/DeveloperError","../Core/Extent","../Core/Math","../Core/Ellipsoid","../Core/Event","./Credit","./TerrainProvider","./TileProviderError","./GeographicTilingScheme","./HeightmapTerrainData","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function y(e,t){this.extent=e,this.maxLevel=t}function g(e,t,r,i){for(var n=e._tilingScheme,o=e._extents,a=n.tileXYToExtent(t,r,i),s=0,l=0;l0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new c,this._ready=!1,this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var g=r.credit;"string"==typeof g&&(g=new h(g)),this._credit=g,this._tilingScheme=void 0,this._extents=[];var _,w=this,C=e(r.ellipsoid,u.WGS84);f()};w.prototype.requestTileGeometry=function(i,s,l,u){if(!this.isReady())throw new a("requestTileGeometry must not be called before isReady returns true.");var c=this._tilingScheme.getNumberOfYTilesAtLevel(l),h=this._url+l+"/"+i+"/"+(c-s-1)+".tif?cesium=true",d=this._proxy;t(d)&&(h=d.getURL(h));var m;if(u=e(u,!0)){if(m=o(h,r),!t(m))return void 0}else m=r(h);var p=this;return v(m,function(e){return new f({buffer:n(e),width:p._heightmapWidth,height:p._heightmapHeight,childTileMask:g(p,i,s,l),structure:p._terrainDataStructure})})},w.prototype.getErrorEvent=function(){return this._errorEvent},w.prototype.getLevelMaximumGeometricError=function(e){if(!this.isReady())throw new a("requestTileGeometry must not be called before isReady returns true.");return this._levelZeroMaximumGeometricError/(1<=0&&aa&&(o+="?");var s=e._parameters;for(var l in s)s.hasOwnProperty(l)&&(o+=l+"="+s[l]+"&");if(r(s.layers)||(o+="layers="+e._layers+"&"),r(s.srs)||(o+="srs=EPSG:4326&"),!r(s.bbox)){var u=e._tilingScheme.tileXYToNativeExtent(t,i,n),c=u.west+","+u.south+","+u.east+","+u.north;o+="bbox="+c+"&"}r(s.width)||(o+="width=256&"),r(s.height)||(o+="height=256&");var h=e._proxy;return r(h)&&(o=h.getURL(o)),o}var h=function d(i){if(i=t(i,{}),!r(i.url))throw new n("description.url is required.");if(!r(i.layers))throw new n("description.layers is required.");this._url=i.url,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._layers=i.layers;var l=e(d.DefaultParameters);if(r(i.parameters))for(var c in i.parameters)if(i.parameters.hasOwnProperty(c)){var h=c.toLowerCase();l[h]=i.parameters[c]}this._parameters=l,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=i.maximumLevel;var m=t(i.extent,a.MAX_VALUE);this._tilingScheme=new u({extent:m});var p=i.credit;"string"==typeof p&&(p=new s(p)),this._credit=p,this._errorEvent=new o,this._ready=!0};return h.prototype.getUrl=function(){return this._url},h.prototype.getProxy=function(){return this._proxy},h.prototype.getLayers=function(){return this._layers},h.prototype.getTileWidth=function(){if(!this._ready)throw new n("getTileWidth must not be called before the imagery provider is ready.");return this._tileWidth},h.prototype.getTileHeight=function(){if(!this._ready)throw new n("getTileHeight must not be called before the imagery provider is ready.");return this._tileHeight},h.prototype.getMinimumLevel=function(){if(!this._ready)throw new n("getMinimumLevel must not be called before the imagery provider is ready.");return 0},h.prototype.getMaximumLevel=function(){if(!this._ready)throw new n("getMaximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel},h.prototype.getTilingScheme=function(){if(!this._ready)throw new n("getTilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme},h.prototype.getExtent=function(){if(!this._ready)throw new n("getExtent must not be called before the imagery provider is ready.");return this._tilingScheme.getExtent()},h.prototype.getTileDiscardPolicy=function(){if(!this._ready)throw new n("getTileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy},h.prototype.getErrorEvent=function(){return this._errorEvent},h.prototype.isReady=function(){return this._ready},h.prototype.requestImage=function(e,t,r){if(!this._ready)throw new n("requestImage must not be called before the imagery provider is ready.");var i=c(this,e,t,r);return l.loadImage(this,i)},h.prototype.getCredit=function(){return this._credit},h.DefaultParameters=i({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),h}),r("Scene/createTangentSpaceDebugPrimitive",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/ColorGeometryInstanceAttribute","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./Primitive","./PerInstanceColorAppearance"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(u){u=e(u,e.EMPTY_OBJECT);var c=[],h=u.geometry;if(!t(h))throw new r("options.geometry is required.");t(h.attributes)&&t(h.primitiveType)||(h=h.constructor.createGeometry(h));var d=h.attributes,m=a.clone(e(u.modelMatrix,a.IDENTITY)),p=e(u.length,1e4);return t(d.normal)&&c.push(new n({geometry:o.createLineSegmentsForVectors(h,"normal",p),attributes:{color:new i(1,0,0,1)},modelMatrix:m})),t(d.binormal)&&c.push(new n({geometry:o.createLineSegmentsForVectors(h,"binormal",p),attributes:{color:new i(0,1,0,1)},modelMatrix:m})),t(d.tangent)&&c.push(new n({geometry:o.createLineSegmentsForVectors(h,"tangent",p),attributes:{color:new i(0,0,1,1)},modelMatrix:m})),c.length>0?new s({geometryInstances:c,appearance:new l({flat:!0,translucent:!1})}):void 0}return u}),r("Scene/sampleTerrain",["../Core/DeveloperError","../Core/defined","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){var t=e.positions,r=e.tilingScheme.tileXYToExtent(e.x,e.y,e.level);return function(e){for(var i=0;ir;r++)c[t[r]]=e});var h={propertychange:!0},d=n&&function(){for(var t=3,r=n.createElement("div"),i=r.getElementsByTagName("i");r.innerHTML="",i[0];);return t>4?t:e}();return{$a:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],n:function(e,t){for(var r=0,i=e.length;i>r;r++)t(e[r])},l:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var r=0,i=e.length;i>r;r++)if(e[r]===t)return r;return-1},Ua:function(e,t,r){for(var i=0,n=e.length;n>i;i++)if(t.call(r,e[i]))return e[i];return null},ia:function(e,t){var r=u.a.l(e,t);r>=0&&e.splice(r,1)},Va:function(e){e=e||[];for(var t=[],r=0,i=e.length;i>r;r++)0>u.a.l(t,e[r])&&t.push(e[r]);return t},ha:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)r.push(t(e[i]));return r},ga:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)t(e[i])&&r.push(e[i]);return r},X:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var r=0,i=t.length;i>r;r++)e.push(t[r]);return e},V:function(e,t,r){var i=u.a.l(u.a.Ha(e),t);0>i?r&&e.push(t):r||e.splice(i,1)},extend:function(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},K:t,Da:function(e,t){if(!e)return e;var r,i={};for(r in e)e.hasOwnProperty(r)&&(i[r]=t(e[r],r,e));return i},wa:function(e){for(;e.firstChild;)u.removeNode(e.firstChild)},Vb:function(e){e=u.a.Q(e);for(var t=n.createElement("div"),r=0,i=e.length;i>r;r++)t.appendChild(u.L(e[r]));return t},Ya:function(e,t){for(var r=0,i=e.length,n=[];i>r;r++){var o=e[r].cloneNode(!0);n.push(t?u.L(o):o)}return n},S:function(e,t){if(u.a.wa(e),t)for(var r=0,i=t.length;i>r;r++)e.appendChild(t[r])},nb:function(e,t){var r=e.nodeType?[e]:e;if(0o;o++)n.insertBefore(t[o],i);for(o=0,a=r.length;a>o;o++)u.removeNode(r[o])}},$:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);if(1d?e.setAttribute("selected",t):e.selected=t},la:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ec:function(e,t){for(var r=[],i=(e||"").split(t),n=0,o=i.length;o>n;n++){var a=u.a.la(i[n]);""!==a&&r.push(a)}return r},ac:function(e,t){return e=e||"",t.length>e.length?!1:e.substring(0,t.length)===t},Gb:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},va:function(e){return u.a.Gb(e,e.ownerDocument.documentElement)},Ra:function(e){return!!u.a.Ua(e,u.a.va)},v:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},r:function(e,t,i){var n=d&&h[t];if(n||"undefined"==typeof a)if(n||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){i.call(e,t)},s="on"+t;e.attachEvent(s,o),u.a.C.ea(e,function(){e.detachEvent(s,o)})}else e.addEventListener(t,i,!1);else{if(r(e,t)){var l=i;i=function(e,t){var r=this.checked;t&&(this.checked=!0!==t.Ab),l.call(this,e),this.checked=r}}a(e).bind(t,i)}},da:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof a){var o=[];r(e,t)&&o.push({Ab:e.checked}),a(e).trigger(t,o)}else if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=n.createEvent(c[t]||"HTMLEvents"),o.initEvent(t,!0,!0,i,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");r(e,t)&&(e.checked=!0!==e.checked),e.fireEvent("on"+t)}},c:function(e){return u.M(e)?e():e},Ha:function(e){return u.M(e)?e.t():e},ma:function(e,t,r){if(t){var i=/\S+/g,n=e.className.match(i)||[];u.a.n(t.match(i),function(e){u.a.V(n,e,r)}),e.className=n.join(" ")}},Ma:function(t,r){var i=u.a.c(r);(null===i||i===e)&&(i="");var o=u.e.firstChild(t);!o||3!=o.nodeType||u.e.nextSibling(o)?u.e.S(t,[n.createTextNode(i)]):o.data=i,u.a.Jb(t)},pb:function(e,t){if(e.name=t,7>=d)try{e.mergeAttributes(n.createElement(""),!1)}catch(r){}},Jb:function(e){d>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Hb:function(e){if(d){var t=e.style.width;e.style.width=0,e.style.width=t}},Zb:function(e,t){e=u.a.c(e),t=u.a.c(t);for(var r=[],i=e;t>=i;i++)r.push(i);return r},Q:function(e){for(var t=[],r=0,i=e.length;i>r;r++)t.push(e[r]);return t},cc:6===d,dc:7===d,ja:d,ab:function(e,t){for(var r=u.a.Q(e.getElementsByTagName("input")).concat(u.a.Q(e.getElementsByTagName("textarea"))),i="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=r.length-1;o>=0;o--)i(r[o])&&n.push(r[o]);return n},Wb:function(e){return"string"==typeof e&&(e=u.a.la(e))?s&&s.parse?s.parse(e):new Function("return "+e)():null},Na:function(e,t,r){if(!s||!s.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return s.stringify(u.a.c(e),t,r)},Xb:function(e,r,i){i=i||{};var o=i.params||{},a=i.includeFields||this.$a,s=e;if("object"==typeof e&&"form"===u.a.v(e))for(var s=e.action,l=a.length-1;l>=0;l--)for(var c=u.a.ab(e,a[l]),h=c.length-1;h>=0;h--)o[c[h].name]=c[h].value;r=u.a.c(r);var d=n.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var m in r)e=n.createElement("input"),e.name=m,e.value=u.a.Na(u.a.c(r[m])),d.appendChild(e);t(o,function(e,t){var r=n.createElement("input");r.name=e,r.value=t,d.appendChild(r)}),n.body.appendChild(d),i.submitter?i.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),u.b("utils",u.a),u.b("utils.arrayForEach",u.a.n),u.b("utils.arrayFirst",u.a.Ua),u.b("utils.arrayFilter",u.a.ga),u.b("utils.arrayGetDistinctValues",u.a.Va),u.b("utils.arrayIndexOf",u.a.l),u.b("utils.arrayMap",u.a.ha),u.b("utils.arrayPushAll",u.a.X),u.b("utils.arrayRemoveItem",u.a.ia),u.b("utils.extend",u.a.extend),u.b("utils.fieldsIncludedWithJsonPost",u.a.$a),u.b("utils.getFormFields",u.a.ab),u.b("utils.peekObservable",u.a.Ha),u.b("utils.postJson",u.a.Xb),u.b("utils.parseJson",u.a.Wb),u.b("utils.registerEventHandler",u.a.r),u.b("utils.stringifyJson",u.a.Na),u.b("utils.range",u.a.Zb),u.b("utils.toggleDomNodeCssClass",u.a.ma),u.b("utils.triggerEvent",u.a.da),u.b("utils.unwrapObservable",u.a.c),u.b("utils.objectForEach",u.a.K),u.b("utils.addOrRemoveItem",u.a.V),u.b("unwrap",u.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,r=Array.prototype.slice.call(arguments);return e=r.shift(),function(){return t.apply(e,r.concat(Array.prototype.slice.call(arguments)))}}),u.a.f=new function(){function t(t,o){var a=t[i];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[i]="ko"+r++,n[a]={}}return n[a]}var r=0,i="__ko__"+(new Date).getTime(),n={};return{get:function(r,i){var n=t(r,!1);return n===e?e:n[i]},set:function(r,i,n){(n!==e||t(r,!1)!==e)&&(t(r,!0)[i]=n)},clear:function(e){var t=e[i];return t?(delete n[t],e[i]=null,!0):!1},D:function(){return r++ +i}}},u.b("utils.domData",u.a.f),u.b("utils.domData.clear",u.a.f.clear),u.a.C=new function(){function t(t,r){var n=u.a.f.get(t,i);return n===e&&r&&(n=[],u.a.f.set(t,i,n)),n}function r(e){var i=t(e,!1);if(i)for(var i=i.slice(0),n=0;ni;i++)r(t[i])}return e},removeNode:function(e){u.L(e),e.parentNode&&e.parentNode.removeChild(e)}}},u.L=u.a.C.L,u.removeNode=u.a.C.removeNode,u.b("cleanNode",u.L),u.b("removeNode",u.removeNode),u.b("utils.domNodeDisposal",u.a.C),u.b("utils.domNodeDisposal.addDisposeCallback",u.a.C.ea),u.b("utils.domNodeDisposal.removeDisposeCallback",u.a.C.mb),function(){u.a.Fa=function(e){var t;if("undefined"!=typeof a){if(a.parseHTML)t=a.parseHTML(e)||[];else if((t=a.clean([e]))&&t[0]){for(e=t[0];e.parentNode&&11!==e.parentNode.nodeType;)e=e.parentNode;e.parentNode&&e.parentNode.removeChild(e)}}else{var r=u.a.la(e).toLowerCase();for(t=n.createElement("div"),r=r.match(/^<(thead|tbody|tfoot)/)&&[1,"","
"]||!r.indexOf("",""]||(!r.indexOf("",""]||[0,"",""],e="ignored
"+r[1]+e+r[2]+"
","function"==typeof i.innerShiv?t.appendChild(i.innerShiv(e)):t.innerHTML=e;r[0]--;)t=t.lastChild;t=u.a.Q(t.lastChild.childNodes)}return t},u.a.Ka=function(t,r){if(u.a.wa(t),r=u.a.c(r),null!==r&&r!==e)if("string"!=typeof r&&(r=r.toString()),"undefined"!=typeof a)a(t).html(r);else for(var i=u.a.Fa(r),n=0;ni;i++)t(n[i],r)}var r={};return{Ca:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(0|4294967296*(1+Math.random())).toString(16).substring(1)+(0|4294967296*(1+Math.random())).toString(16).substring(1);return r[t]=e,""},ub:function(t,i){var n=r[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,i||[]),!0}finally{delete r[t]}},vb:function(e,r){var i=[];t(e,i);for(var n=0,o=i.length;o>n;n++){var a=i[n].Fb,s=[a];r&&u.a.X(s,r),u.u.ub(i[n].Tb,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},jb:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),u.b("memoization",u.u),u.b("memoization.memoize",u.u.Ca),u.b("memoization.unmemoize",u.u.ub),u.b("memoization.parseMemoText",u.u.jb),u.b("memoization.unmemoizeDomNodeAndDescendants",u.u.vb),u.xa={throttle:function(e,t){e.throttleEvaluation=t;var r=null;return u.h({read:e,write:function(i){clearTimeout(r),r=setTimeout(function(){e(i)},t)}})},notify:function(e,t){e.equalityComparer="always"==t?null:r}};var c={undefined:1,"boolean":1,number:1,string:1};u.b("extenders",u.xa),u.sb=function(e,t,r){this.target=e,this.qa=t,this.Eb=r,u.s(this,"dispose",this.B)},u.sb.prototype.B=function(){this.Qb=!0,this.Eb()},u.ca=function(){this.F={},u.a.extend(this,u.ca.fn),u.s(this,"subscribe",this.T),u.s(this,"extend",this.extend),u.s(this,"getSubscriptionsCount",this.Lb)};var h="change";u.ca.fn={T:function(e,t,r){r=r||h;var i=new u.sb(this,t?e.bind(t):e,function(){u.a.ia(this.F[r],i)}.bind(this));return this.F[r]||(this.F[r]=[]),this.F[r].push(i),i},notifySubscribers:function(e,t){if(t=t||h,this.cb(t))try{u.i.Wa();for(var r,i=this.F[t].slice(0),n=0;r=i[n];++n)r&&!0!==r.Qb&&r.qa(e)}finally{u.i.end()}},cb:function(e){return this.F[e]&&this.F[e].length},Lb:function(){var e=0;return u.a.K(this.F,function(t,r){e+=r.length}),e},extend:function(e){var t=this;return e&&u.a.K(e,function(e,r){var i=u.xa[e];"function"==typeof i&&(t=i(t,r)||t)}),t}},u.fb=function(e){return null!=e&&"function"==typeof e.T&&"function"==typeof e.notifySubscribers},u.b("subscribable",u.ca),u.b("isSubscribable",u.fb),u.i=function(){var e=[];return{Wa:function(t){e.push(t&&{qa:t,Za:[]})},end:function(){e.pop()},lb:function(t){if(!u.fb(t))throw Error("Only subscribable things can act as dependencies");if(0=0;i--)r(t[i])&&(t[i]._destroy=!0);this.N()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=u.a.l(t,e)}):[]},indexOf:function(e){var t=this();return u.a.l(t,e)},replace:function(e,t){var r=this.indexOf(e);r>=0&&(this.O(),this.t()[r]=t,this.N())}},u.a.n("pop push reverse shift sort splice unshift".split(" "),function(e){u.ba.fn[e]=function(){var t=this.t();return this.O(),this.Xa(t,e,arguments),t=t[e].apply(t,arguments),this.N(),t}}),u.a.n(["slice"],function(e){u.ba.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),u.b("observableArray",u.ba);var m="arrayChange";u.xa.trackArrayChanges=function(e){function t(){if(!r){r=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,r){return r&&r!==h||++n,t.apply(this,arguments)};var o=[].concat(e.t()||[]);i=null,e.T(function(t){if(t=[].concat(t||[]),e.cb(m)){var r;(!i||n>1)&&(i=u.a.ra(o,t,{sparse:!0})),r=i,r.length&&e.notifySubscribers(r,m)}o=t,i=null,n=0})}}if(!e.Xa){var r=!1,i=null,n=0,o=e.T;e.T=e.subscribe=function(e,r,i){return i===m&&t(),o.apply(this,arguments)},e.Xa=function(e,t,o){function a(e,t,r){s.push({status:e,value:t,index:r})}if(r&&!n){var s=[],l=e.length,u=o.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;u>t;t++)a("added",o[t],c+t);break;case"pop":c=l-1;case"shift":l&&a("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>o[0]?l+o[0]:o[0]),l);for(var l=1===u?l:Math.min(t+(o[1]||0),l),u=t+u-2,c=Math.max(l,u),h=2;c>t;++t,++h)l>t&&a("deleted",e[t],t),u>t&&a("added",o[h],t);break;default:return}i=s}}}},u.h=function(t,r,i){function n(){u.a.n(w,function(e){e.B()}),w=[]}function o(){var e=s.throttleEvaluation;e&&e>=0?(clearTimeout(C),C=setTimeout(a,e)):a()}function a(){if(!d){if(g&&g()){if(!m)return _(),h=!0,void 0}else m=!1;d=!0;try{var t=u.a.ha(w,function(e){return e.target});u.i.Wa(function(r){var i;0<=(i=u.a.l(t,r))?t[i]=e:w.push(r.T(o))});for(var i=r?p.call(r):p(),n=t.length-1;n>=0;n--)t[n]&&w.splice(n,1)[0].B();h=!0,s.equalityComparer&&s.equalityComparer(c,i)||(s.notifySubscribers(c,"beforeChange"),c=i,s.notifySubscribers(c))}finally{u.i.end(),d=!1}w.length||_()}}function s(){if(0t;t++)e=e();return e})},u.toJSON=function(e,t,r){return e=u.tb(e),u.a.Na(e,t,r)},i.prototype={save:function(e,t){var r=u.a.l(this.keys,e);r>=0?this.Qa[r]=t:(this.keys.push(e),this.Qa.push(t))},get:function(t){return t=u.a.l(this.keys,t),t>=0?this.Qa[t]:e}}}(),u.b("toJS",u.tb),u.b("toJSON",u.toJSON),function(){u.k={o:function(t){switch(u.a.v(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?u.a.f.get(t,u.d.options.Ea):7>=u.a.ja?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?u.k.o(t.options[t.selectedIndex]):e;default:return t.value}},na:function(t,r){switch(u.a.v(t)){case"option":switch(typeof r){case"string":u.a.f.set(t,u.d.options.Ea,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=r;break;default:u.a.f.set(t,u.d.options.Ea,r),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof r?r:""}break;case"select":""===r&&(r=e),(null===r||r===e)&&(t.selectedIndex=-1);for(var i=t.options.length-1;i>=0;i--)if(u.k.o(t.options[i])==r){t.selectedIndex=i;break}1=l){t&&a.push(r?{key:t,value:r.join("")}:{unknown:t}),t=r=l=0;continue}}else if(58===d){if(!r)continue}else if(47===d&&h&&1"===n.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};u.e={P:{},childNodes:function(t){return e(t)?r(t):t.childNodes},Z:function(t){if(e(t)){t=u.e.childNodes(t);for(var r=0,i=t.length;i>r;r++)u.removeNode(t[r])}else u.a.wa(t)},S:function(t,r){if(e(t)){u.e.Z(t);for(var i=t.nextSibling,n=0,o=r.length;o>n;n++)i.parentNode.insertBefore(r[n],i)}else u.a.S(t,r)},kb:function(t,r){e(t)?t.parentNode.insertBefore(r,t.nextSibling):t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},eb:function(t,r,i){i?e(t)?t.parentNode.insertBefore(r,i.nextSibling):i.nextSibling?t.insertBefore(r,i.nextSibling):t.appendChild(r):u.e.kb(t,r)},firstChild:function(r){return e(r)?!r.nextSibling||t(r.nextSibling)?null:r.nextSibling:r.firstChild},nextSibling:function(r){return e(r)&&(r=i(r)),r.nextSibling&&t(r.nextSibling)?null:r.nextSibling},Mb:e,bc:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},ib:function(r){if(l[u.a.v(r)]){var n=r.firstChild;if(n)do if(1===n.nodeType){var o;o=n.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=i(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=n.nextSibling,s=0;s=u.a.ja&&r in p?(r=p[r],n?t.removeAttribute(r):t[r]=i):n||t.setAttribute(r,i.toString()),"name"===r&&u.a.pb(t,n?"":i.toString())})}},function(){u.d.checked={after:["value","attr"],init:function(t,r,i){function n(){return i.has("checkedValue")?u.a.c(i.get("checkedValue")):t.value}function o(){var e=t.checked,o=d?n():e;if(m&&(!l||e)){var a=u.i.p(r);c?h!==o?(e&&(u.a.V(a,o,!0),u.a.V(a,h,!1)),h=o):u.a.V(a,o,e):u.g.oa(a,i,"checked",o,!0)}}function a(){var e=u.a.c(r());t.checked=c?0<=u.a.l(e,n()):s?e:n()===e}var s="checkbox"==t.type,l="radio"==t.type;if(s||l){var c=s&&u.a.c(r())instanceof Array,h=c?n():e,d=l||c,m=!1;l&&!t.name&&u.d.uniqueName.init(t,function(){return!0}),u.h(o,null,{I:t}),u.a.r(t,"click",o),u.h(a,null,{I:t}),m=!0}}},u.g.U.checked=!0,u.d.checkedValue={update:function(e,t){e.value=u.a.c(t())}}}(),u.d.css={update:function(e,t){var r=u.a.c(t());"object"==typeof r?u.a.K(r,function(t,r){r=u.a.c(r),u.a.ma(e,t,r)}):(r=String(r||""),u.a.ma(e,e.__ko__cssValue,!1),e.__ko__cssValue=r,u.a.ma(e,r,!0))}},u.d.enable={update:function(e,t){var r=u.a.c(t());r&&e.disabled?e.removeAttribute("disabled"):r||e.disabled||(e.disabled=!0)}},u.d.disable={update:function(e,t){u.d.enable.update(e,function(){return!u.a.c(t())})}},u.d.event={init:function(e,t,r,i,n){var o=t()||{};u.a.K(o,function(o){"string"==typeof o&&u.a.r(e,o,function(e){var a,s=t()[o];if(s){try{var l=u.a.Q(arguments);i=n.$data,l.unshift(i),a=s.apply(i,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===r.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},u.d.foreach={hb:function(e){return function(){var t=e(),r=u.a.Ha(t);return r&&"number"!=typeof r.length?(u.a.c(t),{foreach:r.data,as:r.as,includeDestroyed:r.includeDestroyed,afterAdd:r.afterAdd,beforeRemove:r.beforeRemove,afterRender:r.afterRender,beforeMove:r.beforeMove,afterMove:r.afterMove,templateEngine:u.J.Aa}):{foreach:t,templateEngine:u.J.Aa}}},init:function(e,t){return u.d.template.init(e,u.d.foreach.hb(t))},update:function(e,t,r,i,n){return u.d.template.update(e,u.d.foreach.hb(t),r,i,n)}},u.g.Y.foreach=!1,u.e.P.foreach=!0,u.d.hasfocus={init:function(e,t,r){function i(i){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(a){o=n.body}i=o===e}n=t(),u.g.oa(n,r,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var n=i.bind(null,!0),o=i.bind(null,!1);u.a.r(e,"focus",n),u.a.r(e,"focusin",n),u.a.r(e,"blur",o),u.a.r(e,"focusout",o)},update:function(e,t){var r=!!u.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===r||(r?e.focus():e.blur(),u.i.p(u.a.da,null,[e,r?"focusin":"focusout"]))}},u.g.U.hasfocus=!0,u.d.hasFocus=u.d.hasfocus,u.g.U.hasFocus=!0,u.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){u.a.Ka(e,t())}};var f=u.a.f.D();l("if"),l("ifnot",!1,!0),l("with",!0,!1,function(e,t){return e.createChildContext(t)}),u.d.options={init:function(e){if("select"!==u.a.v(e))throw Error("options binding applies only to SELECT elements");for(;0","#comment",n)})},yb:function(e,t){return u.u.Ca(function(r,i){var n=r.nextSibling;n&&n.nodeName.toLowerCase()===t&&u.pa(n,e,i)})}}}(),u.b("__tr_ambtns",u.Oa.yb),function(){u.m={},u.m.j=function(e){this.j=e},u.m.j.prototype.text=function(){var e=u.a.v(this.j),e="script"===e?"text":"textarea"===e?"value":"innerHTML";if(0==arguments.length)return this.j[e];var t=arguments[0];"innerHTML"===e?u.a.Ka(this.j,t):this.j[e]=t};var t=u.a.f.D()+"_";u.m.j.prototype.data=function(e){return 1===arguments.length?u.a.f.get(this.j,t+e):(u.a.f.set(this.j,t+e,arguments[1]),void 0)};var r=u.a.f.D();u.m.W=function(e){this.j=e},u.m.W.prototype=new u.m.j,u.m.W.prototype.text=function(){if(0==arguments.length){var t=u.a.f.get(this.j,r)||{};return t.Pa===e&&t.sa&&(t.Pa=t.sa.innerHTML),t.Pa}u.a.f.set(this.j,r,{Pa:arguments[0]})},u.m.j.prototype.nodes=function(){return 0==arguments.length?(u.a.f.get(this.j,r)||{}).sa:(u.a.f.set(this.j,r,{sa:arguments[0]}),void 0)},u.b("templateSources",u.m),u.b("templateSources.domElement",u.m.j),u.b("templateSources.anonymousTemplate",u.m.W)}(),function(){function t(e,t,r){var i;for(t=u.e.nextSibling(t);e&&(i=e)!==t;)e=u.e.nextSibling(i),r(i,e)}function r(e,r){if(e.length){var i=e[0],n=e[e.length-1],o=i.parentNode,a=u.H.instance,s=a.preprocessNode;if(s){if(t(i,n,function(e,t){var r=e.previousSibling,o=s.call(a,e);o&&(e===i&&(i=o[0]||t),e===n&&(n=o[o.length-1]||r))}),e.length=0,!i)return;i===n?e.push(i):(e.push(i,n),u.a.$(e,o))}t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||u.Sa(r,e)}),t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||u.u.vb(e,[r])}),u.a.$(e,o)}}function i(e){return e.nodeType?e:0=o;o++)for(l=s,d.push(s=[]),u=c(p,o+f),a=h(0,o-1);u>=a;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||v,s[a-1]||v)+1:a+1:o+1;for(c=[],h=[],f=[],o=m,a=p;o||a;)p=d[o][a]-1,a&&p===d[o][a-1]?h.push(c[c.length]={status:r,value:t[--a],index:a}):o&&p===d[o-1][a]?f.push(c[c.length]={status:i,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));if(h.length&&f.length){e=10*m;var y;for(t=r=0;(n.dontLimitMoves||e>t)&&(y=h[r]);r++){for(i=0;d=f[i];i++)if(y.value===d.value){y.moved=d.index,d.moved=y.index,f.splice(i,1),t=i=0;break}t+=i}}return c.reverse()}return function(t,r,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},t=t||[],r=r||[],t.length<=r.length?e(t,r,"added","deleted",i):e(r,t,"deleted","added",i)}}(),u.b("utils.compareArrays",u.a.ra),function(){function t(t,r,i,n,o){var a=[],s=u.h(function(){var e=r(i,o,u.a.$(a,t))||[];0r;r++)t[r]&&u.a.n(t[r].R,function(i){e(i,r,t[r].fa)})}n=n||[],a=a||{};var h=u.a.f.get(i,r)===e,d=u.a.f.get(i,r)||[],m=u.a.ha(d,function(e){return e.fa}),p=u.a.ra(m,n,a.dontLimitMoves),f=[],v=0,y=0,g=[],_=[];n=[];for(var w,C,x,S=[],m=[],E=0;C=p[E];E++)switch(x=C.moved,C.status){case"deleted":x===e&&(w=d[v],w.h&&w.h.B(),g.push.apply(g,u.a.$(w.R,i)),a.beforeRemove&&(n[E]=w,_.push(w))),v++;break;case"retained":l(E,v++);break;case"added":x!==e?l(E,x):(w={fa:C.value,za:u.q(y++)},f.push(w),_.push(w),h||(m[E]=w))}c(a.beforeMove,S),u.a.n(g,a.beforeRemove?u.L:u.removeNode);for(var b,E=0,h=u.e.firstChild(i);w=_[E];E++){for(w.R||u.a.extend(w,t(i,o,w.fa,s,w.za)),v=0;p=w.R[v];h=p.nextSibling,b=p,v++)p!==h&&u.e.eb(i,p,b);!w.Ob&&s&&(s(w.fa,w.R,w.za),w.Ob=!0)}c(a.beforeRemove,n),c(a.afterMove,S),c(a.afterAdd,m),u.a.f.set(i,r,f)}}(),u.b("utils.setDomNodeChildrenFromArrayMapping",u.a.Ja),u.J=function(){this.allowTemplateRewriting=!1},u.J.prototype=new u.w,u.J.prototype.renderTemplateSource=function(e){var t=(9>u.a.ja?0:e.nodes)?e.nodes():null;return t?u.a.Q(t.cloneNode(!0).childNodes):(e=e.text(),u.a.Fa(e))},u.J.Aa=new u.J,u.La(u.J.Aa),u.b("nativeTemplateEngine",u.J),function(){u.Ba=function(){var e=this.Rb=function(){if("undefined"==typeof a||!a.tmpl)return 0;try{if(0<=a.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,r,i){if(i=i||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var o=t.data("precompiled");return o||(o=t.text()||"",o=a.template(null,"{{ko_with $item.koBindingContext}}"+o+"{{/ko_with}}"),t.data("precompiled",o)),t=[r.$data],r=a.extend({koBindingContext:r},i.templateOptions),r=a.tmpl(o,t,r),r.appendTo(n.createElement("div")),a.fragments={},r},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){n.write("")},e>0&&(a.tmpl.tag.ko_code={open:"__.push($1 || '');"},a.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},u.Ba.prototype=new u.w;var e=new u.Ba;0r;++r)e.call(t,this[r],r,this)},u=Object.getOwnPropertyNames,c=s?Object.defineProperty:function(e){return e},h=Function.prototype.toString,d=Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t},m=Object.prototype.hasOwnProperty,p=/^\n?function\s?(\w*)?_?\(/,f=function(){function e(){var e=s(),i={};this.unlock=function(n){var o=h(n);if(m.call(o,e))return o[e](i);var a=d(null,t);return c(o,e,{value:new Function("s","l",r)(i,a)}),a}}var t={value:{writable:!0,value:i}},r="return function(k){if(k===s)return l}",o=d(null),s=function(){var e=Math.random().toString(36).slice(2);return e in o?s():o[e]=e},l=s(),h=function(e){if(m.call(e,l))return e[l];if(!Object.isExtensible(e))throw new TypeError("Object must be extensible");var t=d(null);return c(e,l,{value:t}),t};return n(Object,a("getOwnPropertyNames",function(e){var t=u(e);return m.call(e,l)&&t.splice(t.indexOf(l),1),t})),n(e.prototype,a("get",function(e){return this.unlock(e).value})),n(e.prototype,a("set",function(e,t){this.unlock(e).value=t})),e}(),v=function(e){function s(e){return this===t||null==this||this===s.prototype?new s(e):(v(this,new f),g(this,e),void 0)}function u(e){p(e);var t=y(this).get(e);return t===r?i:t}function c(e,t){p(e),y(this).set(e,t===i?r:t)}function h(e){return p(e),y(this).get(e)!==i}function d(e){p(e);var t=y(this),r=t.get(e)!==i;return t.set(e,i),r}function m(){return y(this),"[object WeakMap]"}var p=function(e){if(null==e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Invalid WeakMap key")},v=function(t,r){var i=e.unlock(t);if(i.value)throw new TypeError("Object is already a WeakMap");i.value=r},y=function(t){var r=e.unlock(t).value;if(!r)throw new TypeError("WeakMap is not generic");return r},g=function(e,t){null!==t&&"object"==typeof t&&"function"==typeof t.forEach&&t.forEach(function(r,i){r instanceof Array&&2===r.length&&c.call(e,t[i][0],t[i][1])})};u._name="get",c._name="set",h._name="has",m._name="toString";try{var _=("return "+d).replace("e_","\\u0065"),w=new Function("unwrap","validate",_)(y,p)}catch(C){var w=d}var _=(""+Object).split("Object"),x=a("toString",function(){return _[0]+o(this)+_[1]});n(x,x);var S={__proto__:[]}instanceof Array?function(e){e.__proto__=x}:function(e){n(e,x)};return S(s),l.call([m,u,c,h,w],function(e){n(s.prototype,e),S(e)}),s}(new f);e.WeakMap=v}((0,eval)("this"))}),r("ThirdParty/knockout-es5",["./weakmap","exports"],function(e,r){!function(i,n){"use strict";function o(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var r=this,i=a(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(t){if(!(t in i)){var o=e[t],a=o instanceof Array,s=r.isObservable(o)?o:a?r.observableArray(o):r.observable(o);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:r.isWriteableObservable(s)?s:n}),i[t]=s,a&&l(r,s)}}),e}function a(e,t){y||(y=_());var r=y.get(e);return!r&&t&&(r={},y.set(e,r)),r}function s(e,t,r){var i=this,n={owner:e,deferEvaluation:!0};if("function"==typeof r)n.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');n.read=r.get,n.write=r.set}return e[t]=i.computed(n),o.call(i,e,[t]),e}function l(e,t){var r=null;e.computed(function(){r&&(r.dispose(),r=null);var i=t();i instanceof Array&&(r=u(e,t,i)) -})}function u(e,t,r){var i=c(e,r);return i.subscribe(t)}function c(e,t){g||(g=_());var r=g.get(t);if(!r){r=new e.subscribable,g.set(t,r);var i={};h(t,r,i),d(e,t,r,i)}return r}function h(e,t,r){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var n=e[i];e[i]=function(){var e=n.apply(this,arguments);return r.pause!==!0&&t.notifySubscribers(this),e}})}function d(e,t,r,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return r.notifySubscribers(t),o}})})}function m(e,t){if(!e)return null;var r=a(e,!1);return r&&r[t]||null}function p(e,t){var r=m(e,t);r&&r.valueHasMutated()}function f(e){e.track=o,e.getObservable=m,e.valueHasMutated=p,e.defineProperty=s}function v(){if("undefined"!=typeof module){var n=t("knockout"),o=t("weakmap");f(n),_=function(){return new o},module.exports=n}else"ko"in i?(f(i.ko),_=function(){return new i.WeakMap}):"undefined"!=typeof e&&(_=function(){return new e.WeakMap},r.attachToKo=f)}var y,g,_;v()}(this)}),r("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",r={register:function(r){r.bindingHandlers.cesiumSvgPath={init:function(i,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),r.virtualElements.setDomNodeChildren(i,[o]),r.computed({read:function(){var e=r.unwrap(n());a.setAttribute("d",r.unwrap(e.path));var i=r.unwrap(e.width),s=r.unwrap(e.height);o.setAttribute("width",i),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+i+" "+s),e.css&&o.setAttribute("class",t+" "+r.unwrap(e.css))},disposeWhenNodeIsRemoved:i}),{controlsDescendantBindings:!0}}},r.virtualElements.allowedBindings.cesiumSvgPath=!0}};return r}),r("ThirdParty/knockout",["./knockout-3.0.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,r){"use strict";return t.attachToKo(e),r.register(e),e}),r("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";var t=function(t){if("string"==typeof t){var r=document.getElementById(t);if(null===r)throw new e('Element with id "'+t+'" does not exist in the document.');t=r}return t};return t}),r("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";var t=function(t,r,i,n,o){return i.call(n,t[r]),e.getObservable(t,r).subscribe(i,n,o)};return t}),r("Widgets/Animation/Animation",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Color","../getElement","../subscribeAndEvaluate"],function(e,t,r,i,n,o,a){"use strict";function s(e){return n.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,e.tagName);for(var r in e)if(e.hasOwnProperty(r)&&"tagName"!==r)if("children"===r){var i,n=e.children.length;for(i=0;n>i;++i)t.appendChild(l(e.children[i]))}else 0===r.indexOf("xlink:")?t.setAttributeNS(y,r.substring(6),e[r]):"textContent"===r?t.textContent=e[r]:t.setAttribute(r,e[r]);return t}function u(e,t,r){var i=document.createElementNS(v,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=r,i.appendChild(n),i}function c(e,t,r){e.setAttribute("transform","translate(100,100) rotate("+r+")"),t.setAttribute("transform","rotate("+r+")")}function h(e,t){var r=t.alpha,i=1-r;return T.red=e.red*i+t.red*r,T.green=e.green*i+t.green*r,T.blue=e.blue*i+t.blue*r,T.toCssColorString()}function d(e,t,r){var i={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect","class":"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect","class":"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":r},{tagName:"title",textContent:""}]};return l(i)}function m(e,t,r){var i={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use","class":"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":r},{tagName:"title",textContent:""}]};return l(i)}function p(e,t){var r=e._viewModel,i=r.shuttleRingDragging;if(!i||f===e)if("mousedown"===t.type||i&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||i&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!i&&(n>u.right||nu.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,m=180*Math.atan2(d,h)/Math.PI+90;m>180&&(m-=360);var p=r.shuttleRingAngle;i||nc.left&&o>c.top&&om?r.slower():m>p&&r.faster(),t.preventDefault()}else f=void 0,r.shuttleRingDragging=!1}var f,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",g=n.fromCssColorString("rgba(247,250,255,0.384)"),_=n.fromCssColorString("rgba(143,191,255,0.216)"),w=n.fromCssColorString("rgba(153,197,255,0.098)"),C=n.fromCssColorString("rgba(255,255,255,0.086)"),x=n.fromCssColorString("rgba(255,255,255,0.267)"),S=n.fromCssColorString("rgba(255,255,255,0)"),E=n.fromCssColorString("rgba(66,67,68,0.3)"),b=n.fromCssColorString("rgba(0,0,0,0.5)"),T=new n,A=function(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var r=this;this._clickFunction=function(){var e=r._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]};A.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;i>t;t++)e[t].dispose();r(this)},A.prototype.isDestroyed=function(){return!1},A.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return this.svgElement.setAttribute("class","cesium-animation-buttonDisabled"),void 0;if(this._toggled)return this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"),void 0;this.svgElement.setAttribute("class","cesium-animation-rectButton")}},A.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},A.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};var D=function(t,r){if(!e(t))throw new i("container is required.");if(!e(r))throw new i("viewModel is required.");t=o(t),this._viewModel=r,this._container=t,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var n=document.createElement("style");n.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(n,document.head.childNodes[0]);var s=document.createElement("div");s.className="cesium-animation-theme",s.innerHTML='
',this._theme=s,this._themeNormal=s.childNodes[0],this._themeHover=s.childNodes[1],this._themeSelect=s.childNodes[2],this._themeDisabled=s.childNodes[3],this._themeKnob=s.childNodes[4],this._themePointer=s.childNodes[5],this._themeSwoosh=s.childNodes[6],this._themeSwooshHover=s.childNodes[7];var h=document.createElementNS(v,"svg:svg");this._svgNode=h,h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var f=document.createElementNS(v,"g");this._topG=f,this._realtimeSVG=new A(m(3,4,"#animation_pathClock"),r.playRealtimeViewModel),this._playReverseSVG=new A(d(44,99,"#animation_pathPlayReverse"),r.playReverseViewModel),this._playForwardSVG=new A(d(124,99,"#animation_pathPlay"),r.playForwardViewModel),this._pauseSVG=new A(d(84,99,"#animation_pathPause"),r.pauseViewModel);var g=document.createElementNS(v,"g");g.appendChild(this._realtimeSVG.svgElement),g.appendChild(this._playReverseSVG.svgElement),g.appendChild(this._playForwardSVG.svgElement),g.appendChild(this._pauseSVG.svgElement);var _=l({tagName:"circle","class":"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=_;var w=l({tagName:"g","class":"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=w,this._shuttleRingPointer=l({tagName:"use","class":"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var C=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle","class":"cesium-animation-knobOuter",cx:0,cy:0,r:71});var x=61,S=l({tagName:"circle","class":"cesium-animation-knobInner",cx:0,cy:0,r:x});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var E=l({tagName:"circle","class":"cesium-animation-blank",cx:0,cy:0,r:x}),b=document.createElementNS(v,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),t.appendChild(s),f.appendChild(b),f.appendChild(C),f.appendChild(g),b.appendChild(_),b.appendChild(w),b.appendChild(this._shuttleRingPointer),C.appendChild(this._knobOuter),C.appendChild(S),C.appendChild(this._knobDate),C.appendChild(this._knobTime),C.appendChild(this._knobStatus),C.appendChild(E),h.appendChild(f),t.appendChild(h);var T=this,D=function(e){p(T,e)};this._mouseCallback=D,_.addEventListener("mousedown",D,!0),_.addEventListener("touchstart",D,!0),w.addEventListener("mousedown",D,!0),w.addEventListener("touchstart",D,!0),document.addEventListener("mousemove",D,!0),document.addEventListener("touchmove",D,!0),document.addEventListener("mouseup",D,!0),document.addEventListener("touchend",D,!0),this._shuttleRingPointer.addEventListener("mousedown",D,!0),this._shuttleRingPointer.addEventListener("touchstart",D,!0),this._knobOuter.addEventListener("mousedown",D,!0),this._knobOuter.addEventListener("touchstart",D,!0);var P,M=this._knobTime.childNodes[0],I=this._knobDate.childNodes[0],O=this._knobStatus.childNodes[0];this._subscriptions=[a(r.pauseViewModel,"toggled",function(e){P!==e&&(P=e,P?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(r,"shuttleRingAngle",function(e){c(T._shuttleRingPointer,T._knobOuter,e)}),a(r,"dateLabel",function(e){I.textContent!==e&&(I.textContent=e)}),a(r,"timeLabel",function(e){M.textContent!==e&&(M.textContent=e)}),a(r,"multiplierLabel",function(e){O.textContent!==e&&(O.textContent=e)})],this.applyThemeChanges(),this.resize()};return t(D.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;n>i;i++)t[i].dispose();return r(this)},D.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var r=this._svgNode,i=200,n=132,o=e,a=t;0===e&&0===t?(o=i,a=n):0===e?(a=t,o=i*(t/n)):0===t&&(o=e,a=n*(e/i));var s=o/i,l=a/n;r.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",r.setAttribute("width",o),r.setAttribute("height",a),r.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},D.prototype.applyThemeChanges=function(){var t=s(this._themeNormal),r=s(this._themeHover),i=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(t,g)},{tagName:"stop",offset:"12%","stop-color":h(t,_)},{tagName:"stop",offset:"46%","stop-color":h(t,w)},{tagName:"stop",offset:"81%","stop-color":h(t,C)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,g)},{tagName:"stop",offset:"12%","stop-color":h(r,_)},{tagName:"stop",offset:"46%","stop-color":h(r,w)},{tagName:"stop",offset:"81%","stop-color":h(r,C)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,g)},{tagName:"stop",offset:"12%","stop-color":h(i,_)},{tagName:"stop",offset:"46%","stop-color":h(i,w)},{tagName:"stop",offset:"81%","stop-color":h(i,C)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,x)},{tagName:"stop",offset:"75%","stop-color":h(n,S)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,"in":"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,b)},{tagName:"stop",offset:"100%","stop-color":h(a,b)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,g)},{tagName:"stop",offset:"60%","stop-color":h(o,E)},{tagName:"stop",offset:"85%","stop-color":h(o,_)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,E)},{tagName:"stop",offset:"60%","stop-color":h(o,g)},{tagName:"stop",offset:"85%","stop-color":h(o,C)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});e(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},D}),r("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,r,i,n,o){"use strict";var a=function(a,s){function l(){if(!l.canExecute)throw new i("Cannot execute command, canExecute is false.");var e,t={args:arguments,cancel:!1};return u.raiseEvent(t),t.cancel||(e=a.apply(null,arguments),c.raiseEvent(e)),e}if(!t(a))throw new i("func is required.");s=e(s,!0);var u=new n,c=new n;return l.canExecute=s,o.track(l,["canExecute"]),r(l,{beforeExecute:{value:u},afterExecute:{value:c}}),l};return a}),r("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";var o=function(r,o){if(!t(r))throw new i("command is required.");this._command=r,o=e(o,e.EMPTY_OBJECT),this.toggled=e(o.toggled,!1),this.tooltip=e(o.tooltip,""),n.track(this,["toggled","tooltip"])};return r(o.prototype,{command:{get:function(){return this._command}}}),o}),r("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockStep","../../Core/ClockRange","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../createCommand","../ToggleButtonViewModel","../../ThirdParty/sprintf","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e.clockStep===t.SYSTEM_CLOCK&&(e.clockStep=t.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=1)}function h(e){c(e),e.shouldAnimate=!0}function d(e,t){return e-t}function m(t,r){var i=e(r,t,d);return 0>i?~i:i}function p(e,t){if(Math.abs(e)<=y)return e/y;var r,i,n=y,o=g,a=0;return e>0?(r=Math.log(t[t.length-1]),i=(r-a)/(o-n),Math.exp(a+i*(e-n))):(r=Math.log(-t[0]),i=(r-a)/(o-n),-Math.exp(a+i*(Math.abs(e)-n)))}function f(e,r,i){if(i.clockStep===t.SYSTEM_CLOCK)return y;if(Math.abs(e)<=1)return e*y;var n,o,a=y,s=g,l=0;return e>0?(n=Math.log(r[r.length-1]),o=(n-l)/(s-a),(Math.log(e)-l)/o+a):(n=Math.log(-r[0]),o=(n-l)/(s-a),-((Math.log(Math.abs(e))-l)/o+a))}var v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y=15,g=105,_=function(e){if(!i(e))throw new o("clockViewModel is required.");var n=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=_.defaultDateFormatter,this._timeFormatter=_.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,u.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(_.defaultTicks),this.timeLabel=void 0,u.defineProperty(this,"timeLabel",function(){return n._timeFormatter(n._clockViewModel.currentTime,n)}),this.dateLabel=void 0,u.defineProperty(this,"dateLabel",function(){return n._dateFormatter(n._clockViewModel.currentTime,n)}),this.multiplierLabel=void 0,u.defineProperty(this,"multiplierLabel",function(){var e=n._clockViewModel;if(e.clockStep===t.SYSTEM_CLOCK)return"Today";var r=e.multiplier;return 0===r%1?r.toFixed(0)+"x":r.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,u.defineProperty(this,"shuttleRingAngle",{get:function(){return f(e.multiplier,n._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,g),-g);var r=n._allShuttleRingTicks,i=n._clockViewModel;if(i.clockStep=t.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===g)return i.multiplier=e>0?r[r.length-1]:r[0],void 0;var o=p(e,r);if(n.snapToTicks)o=r[m(o,r)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=0|Math.round(o/l)*l}else a>y?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}i.multiplier=o}}),this._canAnimate=void 0,u.defineProperty(this,"_canAnimate",function(){var e=n._clockViewModel,t=e.clockRange;if(n.shuttleRingDragging||t===r.UNBOUNDED)return!0;var i=e.multiplier,o=e.currentTime,a=e.startTime,s=!1;if(t===r.LOOP_STOP)s=o.greaterThan(a)||o.equals(a)&&i>0;else{var l=e.stopTime;s=o.greaterThan(a)&&o.lessThan(l)||o.equals(a)&&i>0||o.equals(l)&&0>i}return s||(e.shouldAnimate=!1),s}),this._isSystemTimeAvailable=void 0,u.defineProperty(this,"_isSystemTimeAvailable",function(){var e=n._clockViewModel,t=e.clockRange;if(t===r.UNBOUNDED)return!0;var i=e.systemTime;return i.greaterThanOrEquals(e.startTime)&&i.lessThanOrEquals(e.stopTime)}),this._isAnimating=void 0,u.defineProperty(this,"_isAnimating",function(){return n._clockViewModel.shouldAnimate&&(n._canAnimate||n.shuttleRingDragging)});var l=a(function(){var e=n._clockViewModel;e.shouldAnimate?(c(e),e.shouldAnimate=!1):n._canAnimate&&h(e)});this._pauseViewModel=new s(l,{toggled:u.computed(function(){return!n._isAnimating}),tooltip:"Pause"});var d=a(function(){var e=n._clockViewModel;c(e);var t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new s(d,{toggled:u.computed(function(){return n._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var v=a(function(){var e=n._clockViewModel;c(e);var t=e.multiplier;0>t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new s(v,{toggled:u.computed(function(){return n._isAnimating&&e.multiplier>0&&e.clockStep!==t.SYSTEM_CLOCK}),tooltip:"Play Forward"});var w=a(function(){var e=n._clockViewModel;e.clockStep=t.SYSTEM_CLOCK,e.multiplier=1,e.shouldAnimate=!0},u.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new s(w,{toggled:u.computed(function(){return e.shouldAnimate&&e.clockStep===t.SYSTEM_CLOCK}),tooltip:u.computed(function(){return n._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=a(function(){var e=n._clockViewModel;c(e);var t=n._allShuttleRingTicks,r=e.multiplier,i=m(r,t)-1;i>=0&&(e.multiplier=t[i])}),this._faster=a(function(){var e=n._clockViewModel;c(e);var t=n._allShuttleRingTicks,r=e.multiplier,i=m(r,t)+1;it;++t)n=e[t],a.hasOwnProperty(n)||(a[n]=!0,s.push(n));s.sort(d);var l=[];for(r=s.length,t=r-1;t>=0;--t)n=s[t],0!==n&&l.push(-n);Array.prototype.push.apply(l,s),this._allShuttleRingTicks=l},n(_.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){if("function"!=typeof e)throw new o("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if("function"!=typeof e)throw new o("timeFormatter must be a function");this._timeFormatter=e}}}),_._maxShuttleRingAngle=g,_._realtimeShuttleRingAngle=y,_}),r("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";var o=function(t,o){if(!e(t))throw new r("imageryLayers is required");if(e(o)){if(!Array.isArray(o))throw new r("imageryProviderViewModels must be an array")}else o=[];var a=this;this._imageryLayers=t,this.imageryProviderViewModels=o.slice(0),this.dropDownVisible=!1,n.track(this,["imageryProviderViewModels","dropDownVisible"]),this.selectedName=void 0,n.defineProperty(this,"selectedName",function(){var t=a.selectedItem;return e(t)?t.name:void 0}),this.selectedIconUrl=void 0,n.defineProperty(this,"selectedIconUrl",function(){var t=a.selectedItem;return e(t)?t.iconUrl:void 0}),this.selectedItem=void 0;var s=n.observable();this._currentProviders=[],n.defineProperty(this,"selectedItem",{get:function(){return s()},set:function(r){var i,n=a._currentProviders,o=n.length;for(i=0;o>i;i++)for(var l=t.getLength(),u=0;l>u;u++){var c=t.get(u);if(c.getImageryProvider()===n[i]){t.remove(c);break}}if(e(r)){var h=r.creationCommand();if(Array.isArray(h)){var d=h.length;for(i=d-1;i>=0;i--)t.addImageryProvider(h[i],0);a._currentProviders=h.slice(0)}else a._currentProviders=[h],t.addImageryProvider(h,0);s(r)}a.dropDownVisible=!1}}),this._toggleDropDown=i(function(){a.dropDownVisible=!a.dropDownVisible})};return t(o.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},imageryLayers:{get:function(){return this._imageryLayers}}}),o}),r("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./BaseLayerPickerViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r,s){if(!e(t))throw new i("container is required.");if(!e(r))throw new i("imageryLayers is required.");t=n(t);var l=new o(r,s),u=document.createElement("button");u.type="button",u.className="cesium-button cesium-toolbar-button",u.setAttribute("data-bind","attr: { title: selectedName },click: toggleDropDown"),t.appendChild(u); -var c=document.createElement("img");c.setAttribute("draggable","false"),c.className="cesium-baseLayerPicker-selected",c.setAttribute("data-bind","attr: { src: selectedIconUrl }"),u.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-dropDown",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-visible" : dropDownVisible, "cesium-baseLayerPicker-hidden" : !dropDownVisible },foreach: imageryProviderViewModels'),t.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedItem },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedItem = $data; }'),h.appendChild(d);var m=document.createElement("img");m.className="cesium-baseLayerPicker-itemIcon",m.setAttribute("data-bind","attr: { src: iconUrl }"),m.setAttribute("draggable","false"),d.appendChild(m);var p=document.createElement("div");p.className="cesium-baseLayerPicker-itemLabel",p.setAttribute("data-bind","text: name"),d.appendChild(p),a.applyBindings(l,u),a.applyBindings(l,h),this._viewModel=l,this._container=t,this._element=u,this._choices=h,this._closeDropDown=function(e){u.contains(e.target)||h.contains(e.target)||(l.dropDownVisible=!1)},document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0)};return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0),a.cleanNode(this._element),a.cleanNode(this._choices),this._container.removeChild(this._element),this._container.removeChild(this._choices),r(this)},s}),r("Widgets/BaseLayerPicker/ImageryProviderViewModel",["../../Core/defineProperties","../../Core/defined","../../Core/DeveloperError","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";var o=function(e){if(!t(e.name))throw new r("description.name is required.");if(!t(e.tooltip))throw new r("description.tooltip is required.");if(!t(e.iconUrl))throw new r("description.iconUrl is required.");if("function"!=typeof e.creationFunction)throw new r("description.creationFunction is required.");var o=e.creationFunction;t(o.canExecute)||(o=i(o)),this._creationCommand=o,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,n.track(this,["name","tooltip","iconUrl"])};return e(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),r("Widgets/BaseLayerPicker/createDefaultBaseLayers",["../BaseLayerPicker/ImageryProviderViewModel","../../Core/buildModuleUrl","../../Core/FeatureDetection","../../Core/DefaultProxy","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/ArcGisMapServerImageryProvider","../../Scene/OpenStreetMapImageryProvider","../../Scene/TileMapServiceImageryProvider"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(){var u=new i("http://cesiumjs.org/proxy/"),c=r.supportsCrossOriginImagery()?void 0:u,h=[];return h.push(new e({name:"Bing Maps Aerial",iconUrl:t("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new n({url:"http://dev.virtualearth.net",mapStyle:o.AERIAL,proxy:c})}})),h.push(new e({name:"Bing Maps Aerial with Labels",iconUrl:t("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new n({url:"http://dev.virtualearth.net",mapStyle:o.AERIAL_WITH_LABELS,proxy:c})}})),h.push(new e({name:"Bing Maps Roads",iconUrl:t("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new n({url:"http://dev.virtualearth.net",mapStyle:o.ROAD,proxy:c})}})),h.push(new e({name:"ESRI World Imagery",iconUrl:t("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new a({url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",proxy:u})}})),h.push(new e({name:"ESRI World Street Map",iconUrl:t("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new a({url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",proxy:u})}})),h.push(new e({name:"ESRI National Geographic",iconUrl:t("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new a({url:"http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",proxy:u})}})),h.push(new e({name:"Open­Street­Map",iconUrl:t("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return new s({url:"http://tile.openstreetmap.org/",proxy:c})}})),h.push(new e({name:"Stamen Watercolor",iconUrl:t("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return new s({url:"http://tile.stamen.com/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",proxy:c})}})),h.push(new e({name:"Stamen Toner",iconUrl:t("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return new s({url:"http://tile.stamen.com/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",proxy:c})}})),h.push(new e({name:"MapQuest Open­Street­Map",iconUrl:t("Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return new s({url:"http://otile1.mqcdn.com/tiles/1.0.0/osm/",proxy:c})}})),h.push(new e({name:"The Black Marble",iconUrl:t("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return new l({url:"http://cesiumjs.org/blackmarble",maximumLevel:8,credit:"Black Marble imagery courtesy NASA Earth Observatory",proxy:c})}})),h.push(new e({name:"Natural Earth II",iconUrl:t("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return new l({url:t("Assets/Textures/NaturalEarthII")})}})),h}return u}),r("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/DefaultProxy","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/Event","../../Core/FeatureDetection","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/CentralBody","../../Scene/Credit","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/SceneTransitioner","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E){"use strict";function b(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(){if(!e.isDestroyed())try{e._useDefaultRenderLoop?(e.resize(),e.render(),d(t)):e._renderLoopRunning=!1}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._renderLoopError.raiseEvent(e,r),e._showRenderLoopErrors&&(e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",r),console.error(r))}}e._renderLoopRunning=!0,d(t)}var A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAaCAYAAABikagwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9wGGRQyF371QVsAABOHSURBVGje7Vp5cFTHmf91v2Nm3owGnYMuEEJCOBiEjDlsDMYQjGMOOwmXcWxiLywpJ9iuTXZd612corJssFOxi8LerXizxEGUvWsivNxxHHCQ8WYBYSFzmUMCCXQjaUajOd/V+4f6Kc14kI/KZv/xq+p6M/PmO15/9/c1wa0vwpcMQAHgBuAFoPG7mz8jAGwASQBxADFhJQGYACwAjK+vrr/AJQ8jVMqfuwH4AGQByAaQnTNqXGHWqHGFbq8/g1BJsgw9GQ12Bds/qWsxEvEeAEEAfQDCAKKCgPGVcP//BOsIVQHgAZAJIACgsHTqvDvK7150T2bR2DFaZm6W4slwUypR20yaiUg4OtDbcaP36rlPPt6/7f2B3q5mAB0AeriAE18J9y93kVu4X4W73BwAhQBK5v/gZ98ZVXXvDG92IJMx569MQDEoK0tPmOHu1s4L7799sH7vtvcAXAPQCaCfu2qLu+7h+Eh3sS8Bcyt48iVgPos2+4J7jS+BIx2etDBSynfH/Xq46y0CUL70n3/zXMmUuXepWoZHFCQhFIQARCBFJYV6/Nn+QHnVBH9Ovq/51JFWADpfJhcqEzyDcx9ukTTr/xr2VnDpng0nuHR0h1u3wvWF6EspgBIAFYAfQAGAsuU/rfm7kePvvJ0QiTj6QSgBISS9ujEGSikkxaXklIwfK8uK2Xru2HVurWKspZyezGmmWwp/LqVsupPQub4grPQ5YIejKQvPJAGflLLJSBGmxPEqKXhU4XdJEBq7BR5Z+L+DKx3MTTHWEaybx9WCud/btCJQMeX2Qevk+NPoks0YPArF/RUj0NyXxOmO2CAy1a1OmL9yUVfTmatXTx52EildYFQVNlgRmBR1xQJgCBbPBAVUhcw8lTObLz0FVk4RIEmJJyJNZzFBiCTFBRL+f50rriFUATRFiZSU/XYEAw6X5LlIUghZqXvl5p8pfycRZsgjymlKGw1Adm7JbRUVs785nwGghP5pp9mfFMOxWstmuC3gwdcrRqA/buJUWwyKRMAYgydrZNZt9337623njn+ixyN9nAmdM5nBvYOPfxc3mnEmTQ4T5VZv8hfz8aUKnocJd5tvVhxAhOMADzNefleFjRUFa/D/xzi8LQhIEpTG4VXnNBzlZYISufk7juCfqaAoLkHYcZ6HBAEM8O+ObJz3HcFDpJfDJwWYfiHMMTklviocKHv6I3+zRFLdKhEEatmALBFIBIibNhQ6KFyJEjT2JHDoUj/a+nVIVIBhBGOnzptWXzhmTFfT2TZBOH4AgSeeeGJqRUVFqdfr9btcLnVQXwapmqZpJZPJRCgUCh47duzie++9dwWAXl5enrlp06bF0WhUM01TYYwRrmg2vzNKqS3Lsunz+Yy6urpTP//5z09blkVLSkryVq9ePT03NzegqqqbUnqTGyOEMNM0k319fX2///3vz9bW1l4DYD700EPFy5Ytm65pmvbBBx9c2rp166Wnnnqq7MEHH5zAGIu8/vrr+w8ePPgJVwrRO2gAcg8cOLA2mUx62tvbB9avX39s+fLlo++///5JXNiwbXugpqam9tChQ2cEj6NzuQwlsi+//PKSzMzMQtu2qcfjMZqbm09v2LDht4J3sQEQOU2Jo8mKKzt7VEU5lSgFBi3PZkBZrgv3lGbCo1Jc7I7iSGN40JcQgoGkhXdO94ESQJEoGI+1k/M9mDKqQHEv++akl186e45rNAAE3njjjccWLFhwfyAQyJEkiabGbcc7JJNJva2trX3Lli3vvPbaa+eKi4uLV6xY8d10cf5TcZ8x5OXl5b366qs9lFLtrbfeWldVVXW7pmkuxhjS0SSEIJlMGitXrrz2/PPPv1lTU3NtypQp0x955JG/kmVZdrlcR7du3WrOnTt33pIlS+YDwNGjR68ePHiwjVtukm+wI9ichQsXPgUAHR0d3evXr78xc+bMu9asWbOQUjpENz8/v/jQoUP/IiiH40UzAeQvW7Zs1rp16/7a5/NpDr/19fWlGzZsOM4tNsphkc5iPaXTvl6uuDUvY4MZLwNQ4Ffw+LR8+KQQTCuJSQUFcMsEe88FoSkSKCFwyWSISQbg9pEefHdGAJHIdUydVjFecL3K448/Pm3hwoUPBAKBHFGIlmU5pRCRpMGEze12q2PHjh2zatWqeTt37gwODAxkOQIJhUJ6Y2Njn6IojFJqE0KYsGyPx0POnTvXnUgkfGvXrr1j5syZU7iFsKampv5YLBZ34GzbJgAwatSo7MzMTE95eXnZT37yk0dramr+PRQKZSQSCdPn88nBYNADID8UCmkAYBiGGQ6Hna6cksbdZliWZUuSRKPRKAAUBINBfywWM30+n+yEtenTp9+5YsWKGTt37oxwz+a44RwARc8+++xSr9eriQrY398v8311CUncTTHN0Q7Vl1OQJymq4iBwyxQPT8qDVwri1d1/i8ttp/AP39mOBeMn41pQx9mOGFSZ3qT52ZqMR6aMRGvXKfzbgX9Ea3PnSLEdOWXKlK/5/X4/AFy8ePHG6tWr90QikS5VVaOEEIsxRhljngcffLBi8+bNjxBCUFJSMrKkpMRvGIbboXP27Nn+2bNn/3cgEIgSQmKEEAOARQixKKVxRVEioVAoYtu2dMcdd4x24Hbv3t3+ox/96ONoNBqklMa4ppNkMinNnz8///nnn6/y+Xw0mUxaANy6rrsdl28YhguAX9d1F98jwn9TUjJkJ5N1DWV0ti0ByDAMw+PsbzQatX0+Hy0oKMhcvnz5nP3791+IxWJRIUaPfO655+ZVVlaOA4BoNGprmkZ5uJJThZouKyYAqOrWVEKoE7cwszQDlQUK3jr8S5y++iEIIXh55/fwylOH8e3KHHSEdfQnLFBuRbJEsLQyF27Sh3eO/iuudV+EaSuqkJF6MjMzs9xutwIAv/rVr06eOHHiEwCtPBHQOaPaxYsXLxcXF8cKCwtzOzo6+ltbW4OFhYU+h2nDMAgAqbu7W8xkLSEBcsos1bbtocZIIBBQs7Ky5Pb2dkvXdV1wfaipqemsqak5yF1bFABljNEU4Sj87nia1LKHCJWGLLh6AkDhiksAoLq6um/VqlWZWVlZ8gMPPHDHwoULK2tqasJcYJ7y8vKyb33rW/f4/X43YwybNm26vnnz5pIUb0tvVe44maSVjEfizDJtmwFlOS4srczGiQvv4ncnd4ASAkIo+mN92LLrB/j7Vb/GQxOz8Z/1PTDsQXc6p3QEqopU7Dr6S5y8fAiKpCKhs6SQSUqyLKsO4d7e3j4AvbxD1csFQQF4EolEaP369TVCFjuiqKiogG8w5s6dm8sY++ZwcfbZZ5/dvHXr1isnT55scVz+rFmz8urr6xc4Ls22bZZIJExd181oNGr09PREDx06dPmFF144Ho/HTVGIjiE4guECoyl1LYTPcppGEAghDAAikUjixRdfbHnppZfKfD6fa82aNfMOHz7cHgwGbwBwr1ix4u677rqrgsfU4I4dO66lCPZTXSkqpOaMa60e7mjuosw0RmYoWHf3SLT3NOKt91+CbsZBeOlDCcX5luP4rw9fw4wSH+4p9cMlU3xtpAfLJmej/vIR7PnjLyDRwXeKhoxubokWAOYkDXxTLE5brB11oTZMCrWoNQgymJwZhsHC4bAZjUaNaDRqxGIx3VnxeDzJky8TQGLHjh3n9u3bd6ytrS3U2dkZ6e3tjfX398cHBgYS8XjcIIQQr9frKioq8ldWVhb88Ic/vHfbtm3zAXhs25aHUx7uEt1COeXEXM3JfAWLvWnSxRhLbNu2rampqSlMCME3vvGNyXPmzKkCUFZeXn776tWr72WMwbZtvPDCCx+5XK6wo6BcOdhwQ4Chuu/KR39onDGS9T80u9ivkgiqD/0UbT2NcKvelMaEhXfrqlGaPwEPT5qH0lwvqopcaOtpxPb3/gmGmYBEFRBC0HUlfp67tQQALxMKYsaYU+tlcSadNN8NIOO+++4bnZ2d7Q+Hw+zIkSNJxtiQ9TQ1NUW3bNnSmJWVlZBlWaeUWs5SVTUxYsSIRF1dXScAwzTN2MMPP7w3Pz//ZFVVVUFubq7L6/VKmqZRl8ulKIriVlVVmz59ev6cOXMCLpeLLliwYDyAOpGm08SglA659mQy6eHTrwiPtRYXbi6vP2/yjI61AoDL5Ur09vZ2bt++/ezGjRvvppSSjRs3Lti9e/fvnnzyyfHjx48fyRjDwYMHL9TW1jYWFhZ6xfIs3UhUTlPQRwGE9Gv/c/ba9YGi2rPv0FONf/iUUB3Lj8SDqD60GYtmdGBcYSVOnL+K39b9Gp19zVDkwZzBSpLY9Qv9Z3lKHgOgmaYZd9zg1KlTS994441L3G3lcD6oo/1btmxZFwgEctrb27vWrFlzwLIs2cmKW1pa4q+//vp1AbchdIKiPGZHAJDFixcHpk+ffnsoFNLefvvt3ra2Nl0YSDhdt4zy8vLwsWPHsl0ul6ooigSACuEZXKBJwzAMxhhUVZW8Xm8uH5hQ3mCwOf95VVVVYx03yQVhUEpNQbBxADfefPPN6NKlS8dUVlYWVlZW5r344osz1q1bV8IYQzAYjFVXV5+IxWIdkiTlpfDCUgcC6Sw2CqBvw4ZN+7/9d+Wzo1avT5HU9N1tMpj4dfU14z/efxletx9xPYpIPAhVccO2bVBKcf189I/h3mSLkBi5b9y40RWLxZJer9f12GOPTa6oqMjq6enpJYQYlFLGyx21tLQ0MGnSpDGEECQSCZMQIjuNCF6aqI8++mheVlZWJrdYkzcoLEVREj6fL1FfX39x165dzfPnzy/7/ve/v1LXdWvlypVde/bsuRKLxQyn1LEsS2aMeebNm1fs8/lkxhgsy7IAJBRF0Yc2TZZ1AANNTU0djoJt2rRpzqxZs/K6urq6JUnSCSHMMAxZ07SsxYsXV1JKCWMMAwMDMQBhVVWTjtU6gr1y5Yq1d+/ej8aNG5eraZr6zDPPjPV4PBJjDLW1ted27dr1MYCYqqpDcpMkyRIaEyydxToxNgagr7e3t+XEe0rNxPkjnvhTznNr4Sb0KBL6YO9BovJQnRXptTqaPgr9wTLsDgAhTkOurq4+unz58vs1TRvl9/vVuXPnljHGxgqxw2GcEjLYJLlw4cKV06dPd06bNo04+MePH+/ftm3bNNG1iW5KVVVl//79ew4cONC8d+/ey88884ysKIp85513jpo8eXJh2pHX4EUIITh58uRFAN1utzvHcb0ejycGoKuurk5vbW29u7i4ODB69OisJ5988i4xxDhsKIoiEUJgmqZ94MCBOgBdmqaVODxrmhbhiaP+4x//+N2lS5dOmjBhwhiPxyMBQFdXV191dfX7tm23AdBdLtdQzFYUxWmb3iRcmqbh7vQfOz9+v/PdjvP6kcHuE288MJZWuM4Smw1mgkQvHw/v6Wga+BjADY53AEDfmTNnLq9du/Znp06datB13RA3ROwGmaZphcPhgX379v326aefftO27Tafz9fJGGOmadqMMSbLMpEkiaZbjDFommYQQsK1tbWNr7zyymvhcLifEIJbwRBCmGVZ1vHjxz9atGjRLwA0Z2dndzpdHb/fHwTQcuLEiYann3761fPnz3+i67pBCCGUUkoIofwjpZQS27ZZd3f3ja1bt1Zv3LhxL4CrmZmZPYQQkxCCjIyMEIB2AG0Amrdv3/6beDweNwzD1nXdPHXq1Indu3cf48+7MjIyupw98ng8EW4wCWH4kHbQLgsnJ4oAlN332Ji1hbeps6lEaLohQLrhQCJi9zcei77TcLh9H4CrALp4rLN5LBvBE4scAP6JEyfmBQIBL6VUopSCMcYGBgYSly5dCvX19YW5QkQAmD6fz3PvvfeWxmIxr2EYHqFXPBRrKKWWJEmG1+uNtbW1dTU0NNzgz7wA/OXl5bkFBQV+XsYQwVpZMpk0jh8/3snpRQCYo0aN8k6YMCHX5XLRa9euBRsaGnr4Jnp458c7ceLEbK/X6xL5MQzDbGhoCNq2HeO4YgBYWVmZv6KiIkdVVbS0tHQ3NDR0CsORrDlz5oyllHoYY3p9ff31cDjczeGhaVrGkiVLSg3DkLu7u/s+/PDDFn4UKeJYLhnmAJvGs9QCAKOnLMhfNHqSNl/LlHOpTORbWa4et2ORXqv1wgf9NVfO9B7nTYcuPvlICq02t9CJ8ggjOJomodOF0ZQtHNvxCC08pBnbmcIhO53jdA7mpXaKUkOSWGoxYaaKlIa7IozT0uET+XDGehDGhhBGb6bTmBHezeb8OyNPCPQk/ptzeHConCSfcZDNI1hWQXaBVl5254hZmSPVce4MKUdxEQ+VJMnUbcNIWJFoyOzoa02eOX2k+yg/79TFNWkgZchOUobe4vA63WzUEmpYsa+dCoM0Izgz5aQkTUOPpGvUpKFJBaUR8Q03cLdT8NkppyEgPGOCYcnCiNASsn2SwrstDA2Gxnbkc5xSdHGrcmaBWYoqZ+YUe4pcXuqXJCobupWIhaze3vZohzAfdOaKN2mSwPxwR0ZSZ6uptZoIN9yxFCYIiqV5v3THStgwNNPhvtXxFgzDP9K8q52Cj6ZRNnaLffoUDfI5zhVLgrvxCN0Ux5URYXYYF84Wf2qqf4uDV591ZuiLHir7c8F+mZOU5M+Iazg8n3mYjnxORkV3I6dxg6KrMQW3Yaexlq+uv8D1v2IL+t4z3B/NAAAAAElFTkSuQmCC",D=function(e,a){if(!o(e))throw new l("container is required.");e=E(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s),this._element=s;try{var d="http://www.w3.org/2000/svg",T=document.createElementNS(d,"svg");T.style.display="none",s.appendChild(T);var D=document.createElement("canvas");D.oncontextmenu=function(){return!1},D.onselectstart=function(){return!1},s.appendChild(D);var P=document.createElement("div");P.className="cesium-widget-credits",s.appendChild(P);var M=new g(D,a.contextOptions,P);M.getCamera().controller.constrainedAxis=t.UNIT_Z;var I=u.WGS84,O=M.getFrameState().creditDisplay,R=new v("Cesium",A,"http://cesiumjs.org/");O.addDefaultCredit(R);var L=new f(I);M.getPrimitives().setCentralBody(L);var z=a.skyBox;o(z)||(z=new x({sources:{positiveX:b("px"),negativeX:b("mx"),positiveY:b("py"),negativeY:b("my"),positiveZ:b("pz"),negativeZ:b("mz")}})),M.skyBox=z,M.skyAtmosphere=new C(I),M.sun=new S,M.moon=new y;var N=a.imageryProvider;o(N)||(N=new p({url:"http://dev.virtualearth.net",proxy:h.supportsCrossOriginImagery()?void 0:new i("http://cesiumjs.org/proxy/")})),N!==!1&&L.getImageryLayers().addImageryProvider(N),o(a.terrainProvider)&&(L.terrainProvider=a.terrainProvider),this._container=e,this._canvas=D,this._zoomDetector=T,this._canvasWidth=D.width,this._canvasHeight=D.height,this._scene=M,this._centralBody=L,this._clock=n(a.clock,new r),this._transitioner=new w(M,I),this._screenSpaceEventHandler=new m(D),this._useDefaultRenderLoop=void 0,this._renderLoopRunning=!1,this._creditContainer=P,this._canRender=!1,this._showRenderLoopErrors=n(a.showRenderLoopErrors,!0),this._renderLoopError=new c,a.sceneMode&&(a.sceneMode===_.SCENE2D&&this._transitioner.to2D(),a.sceneMode===_.COLUMBUS_VIEW&&this._transitioner.toColumbusView()),this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0)}catch(B){var F="Error constructing CesiumWidget. Check if WebGL is enabled.";throw this.showErrorPanel(F,B),B}};return a(D.prototype,{container:{get:function(){return this._container}},sceneTransitioner:{get:function(){return this._transitioner}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},centralBody:{get:function(){return this._centralBody}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},onRenderLoopError:{get:function(){return this._renderLoopError}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}}}),D.prototype.showErrorPanel=function(e,t){var r=this._element,i=document.createElement("div");i.className="cesium-widget-errorPanel";var n=document.createElement("div");n.className="cesium-widget-errorPanel-content",i.appendChild(n);var a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.textContent=e,n.appendChild(a);var s;if(o(t)){var l=document.createElement("div");l.className="cesium-widget-errorPanel-scroll",n.appendChild(l),s=function(){l.style.maxHeight=Math.max(Math.round(.9*r.clientHeight-100),30)+"px"},s(),window.addEventListener("resize",s,!1);var u=document.createElement("div");u.className="cesium-widget-errorPanel-message",u.textContent=t,l.appendChild(u)}var c=document.createElement("div");c.className="cesium-widget-errorPanel-buttonPanel",n.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button",h.textContent="OK",h.onclick=function(){o(s)&&window.removeEventListener("resize",s,!1),r.removeChild(i)},c.appendChild(h),r.appendChild(i)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},D.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,r=e.clientHeight;if(this._canvasWidth!==t||this._canvasHeight!==r){var i;i=o(window.devicePixelRatio)&&1!==window.devicePixelRatio?window.devicePixelRatio:1!==this._zoomDetector.currentScale?this._zoomDetector.currentScale:1,this._canvasWidth=t,this._canvasHeight=r,t*=i,r*=i,e.width=t,e.height=r;var n=0!==t&&0!==r;if(this._canRender=n,n){var a=this._scene.getCamera().frustum;o(a.aspectRatio)?a.aspectRatio=t/r:(a.top=a.right*(r/t),a.bottom=-a.top)}}},D.prototype.render=function(){this._scene.initializeFrame();var e=this._clock.tick();this._canRender&&this._scene.render(e)},D}),r("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(r){t(r)||(r=new e),this._clock=r,this._eventHelper=new n,this._eventHelper.add(r.onTick,this.synchronize,this);var i=a.observable(r.startTime);i.equalityComparer=o.equals,this.systemTime=a.observable(new o),this.systemTime.equalityComparer=o.equals,a.track(this,["systemTime"]),this.startTime=void 0,a.defineProperty(this,"startTime",{get:i,set:function(e){i(e),r.startTime=e}});var s=a.observable(r.stopTime);s.equalityComparer=o.equals,this.stopTime=void 0,a.defineProperty(this,"stopTime",{get:s,set:function(e){r.stopTime=e,s(e)}});var l=a.observable(r.currentTime);l.equalityComparer=o.equals,this.currentTime=void 0,a.defineProperty(this,"currentTime",{get:l,set:function(e){r.currentTime=e,l(e)}});var u=a.observable(r.multiplier);this.multiplier=void 0,a.defineProperty(this,"multiplier",{get:u,set:function(e){r.multiplier=e,u(e)}});var c=a.observable(r.clockStep);c.equalityComparer=function(e,t){return e===t},this.clockStep=void 0,a.defineProperty(this,"clockStep",{get:c,set:function(e){c(e),r.clockStep=e}});var h=a.observable(r.clockRange);h.equalityComparer=function(e,t){return e===t},this.clockRange=void 0,a.defineProperty(this,"clockRange",{get:h,set:function(e){h(e),r.clockRange=e}});var d=a.observable(r.shouldAnimate);this.shouldAnimate=void 0,a.defineProperty(this,"shouldAnimate",{get:d,set:function(e){d(e),r.shouldAnimate=e}})};return r(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock,t=e.startTime,r=e.stopTime,i=e.currentTime,n=e.multiplier,a=e.clockStep,s=e.clockRange,l=e.shouldAnimate;this.systemTime=new o,this.startTime=t,this.stopTime=r,this.currentTime=i,this.multiplier=n,this.clockStep=a,this.clockRange=s,this.shouldAnimate=l},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},s}),r("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";var t=function(){throw this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,new e("This type should not be instantiated directly.")};return t}),r("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){var r=this,i=a.observable(n.isFullscreen()),s=a.observable(n.isFullscreenEnabled());this.isFullscreen=void 0,a.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,a.defineProperty(this,"isFullscreenEnabled",{get:function(){return s()},set:function(e){s(e&&n.isFullscreenEnabled())}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=o(function(){n.isFullscreen()?n.exitFullscreen():n.requestFullscreen(r._fullscreenElement)},a.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(t,document.body),this._callback=function(){i(n.isFullscreen())},document.addEventListener(n.getFullscreenChangeEventName(),this._callback)};return t(s.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new i("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){document.removeEventListener(n.getFullscreenChangeEventName(),this._callback),r(this)},s}),r("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/destroyObject","../getElement","./FullscreenButtonViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",l="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z",u=function(t,i){if(!e(t))throw new r("container is required.");t=n(t);var u=new o(i);u._exitFullScreenPath=l,u._enterFullScreenPath=s;var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-fullscreenButton",c.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),t.appendChild(c),a.applyBindings(u,c),this._container=t,this._viewModel=u,this._element=c};return t(u.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._viewModel.destroy(),a.cleanNode(this._element),this._container.removeChild(this._element),i(this)},u}),r("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/Extent","../../Core/jsonp","../../Core/Matrix3","../../Core/Matrix4","../../Scene/CameraFlightPath","../../Scene/SceneMode","../createCommand","../../ThirdParty/knockout","../../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e){var r=e.searchText;if(!/^\s*$/.test(r)){e._isSearchInProgress=!0;var n=l(e._url+"REST/v1/Locations",{parameters:{query:r,key:e._key},callbackParameterName:"jsonp"}),o=e._geocodeInProgress=f(n,function(r){if(!o.cancel){if(e._isSearchInProgress=!1,0===r.resourceSets.length)return e.searchText=e._searchText+" (not found)",void 0;var n=r.resourceSets[0];if(0===n.resources.length)return e.searchText=e._searchText+" (not found)",void 0;var a=n.resources[0];e._searchText=a.name;var l=a.bbox,m=l[0],p=l[1],f=l[2],v=l[3],y=s.fromDegrees(p,m,v,f),g=e._scene.getCamera().controller.getExtentCameraCoordinates(y);if(i(g)){var _,w;e._scene.mode===d.SCENE3D?(_=t.UNIT_Z,w=t.negate(e._ellipsoid.geodeticSurfaceNormal(g))):(_=t.UNIT_Y,w=t.negate(t.UNIT_Z));var C={destination:g,duration:e._flightDuration,up:_,direction:w},x=e._scene.getCamera();if(!c.equals(x.transform,c.IDENTITY)){c.inverseTransformation(x.transform),c.multiplyByPoint(x.transform,x.position,x.position);var S=c.getRotation(x.transform);u.multiplyByVector(S,x.direction,x.direction),u.multiplyByVector(S,x.up,x.up),t.cross(x.direction,x.up,x.right),x.transform=c.IDENTITY,e._scene.getScreenSpaceCameraController().setEllipsoid(e._ellipsoid)}var E=h.createAnimation(e._scene,C);e._scene.getAnimations().add(E)}}},function(){o.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function y(e){e._isSearchInProgress=!1,i(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}var g=function(t){if(!i(t)||!i(t.scene))throw new o("description.scene is required.");this._url=r(t.url,"http://dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(t.key),this._scene=t.scene,this._ellipsoid=r(t.ellipsoid,a.WGS84),this._flightDuration=r(t.flightDuration,1500),this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0;var n=this;this._searchCommand=m(function(){n.isSearchInProgress?y(n):v(n)}),p.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,p.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,p.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){if("string"!=typeof e)throw new o("value must be a valid string.");this._searchText=e}}),this.flightDuration=void 0,p.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){if(0>e)throw new o("value must be positive.");this._flightDuration=e}})};return n(g.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},search:{get:function(){return this._searchCommand}}}),g}),r("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./GeocoderViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",l="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z",u=function(t){if(!e(t)||!e(t.container))throw new i("description.container is required."); -if(!e(t.scene))throw new i("description.scene is required.");var r=n(t.container),u=new o(t);u._startSearchPath=s,u._stopSearchPath=l;var c=document.createElement("form");c.setAttribute("data-bind","submit: search");var h=document.createElement("input");h.type="search",h.className="cesium-geocoder-input",h.setAttribute("placeholder","Enter an address or landmark..."),h.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",css: { "cesium-geocoder-input-wide" : searchText.length > 0 }'),c.appendChild(h);var d=document.createElement("span");d.className="cesium-geocoder-searchButton",d.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),c.appendChild(d),r.appendChild(c),a.applyBindings(u,c),this._container=r,this._viewModel=u,this._form=c,this._onInputBegin=function(e){r.contains(e.target)||h.blur()},this._onInputEnd=function(e){r.contains(e.target)&&h.focus()},document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0)};return t(u.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0),a.cleanNode(this._form),this._container.removeChild(this._form),r(this)},u}),r("Widgets/HomeButton/HomeButtonViewModel",["../../Core/Cartesian3","../../Core/Matrix3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/Extent","../../Core/Matrix4","../../Scene/Camera","../../Scene/CameraColumbusViewMode","../../Scene/CameraFlightPath","../../Scene/SceneMode","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(r,n,o,a){var m=r.mode,p=r.getCamera();p.controller.constrainedAxis=e.UNIT_Z;var f=r.getScreenSpaceCameraController();f.setEllipsoid(n),f.columbusViewMode=c.FREE;var v=r.getContext();i(o)&&m===d.MORPHING&&o.completeMorph();var y,g;if(m===d.SCENE2D)p.transform=new l(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),g={destination:s.MAX_VALUE,duration:a},y=h.createAnimationExtent(r,g),r.getAnimations().add(y);else if(m===d.SCENE3D){e.add(p.position,l.getTranslation(p.transform),p.position);var _=l.getRotation(p.transform);t.multiplyByVector(_,p.direction,p.direction),t.multiplyByVector(_,p.up,p.up),t.multiplyByVector(_,p.right,p.right),p.transform=l.clone(l.IDENTITY);var w=new u(v);g={destination:w.position,duration:a,up:w.up,direction:w.direction},y=h.createAnimation(r,g),r.getAnimations().add(y)}else if(m===d.COLUMBUS_VIEW){p.transform=new l(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);var C=n.getMaximumRadius(),x=e.multiplyByScalar(e.normalize(new e(0,-1,1)),5*C),S=e.normalize(e.subtract(e.ZERO,x)),E=e.cross(S,e.UNIT_Z),b=e.cross(E,S);g={destination:x,duration:a,up:b,direction:S},y=h.createAnimation(r,g),r.getAnimations().add(y)}}var v=function(e,t,n,s){if(!i(e))throw new o("scene is required.");n=r(n,a.WGS84),s=r(s,1500),this._scene=e,this._ellipsoid=n,this._transitioner=t,this._flightDuration=s;var l=this;this._command=m(function(){f(l._scene,l._ellipsoid,l._transitioner,l._flightDuration)}),this.tooltip="View Home",p.track(this,["tooltip"])};return n(v.prototype,{sceneTransitioner:{get:function(){return this._transitioner}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},command:{get:function(){return this._command}},flightDuration:{get:function(){return this._flightDuration},set:function(e){if(0>e)throw new o("value must be positive.");this._flightDuration=e}}}),v}),r("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./HomeButtonViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r,s,l,u){if(!e(t))throw new i("container is required.");t=n(t);var c=new o(r,s,l,u);c._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-home-button",h.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),t.appendChild(h),a.applyBindings(c,h),this._container=t,this._viewModel=c,this._element=h};return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return a.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),r("Widgets/Observable",["../Core/DeveloperError"],function(e){"use strict";var t=function(){throw new e("This type should not be instantiated directly.")};return t}),r("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defineProperties","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e){if(!t(e))throw new i("transitioner is required.");this._transitioner=e;var r=this,l=function(e,t,i){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new n,this._eventHelper.add(e.transitionStart,l),this.sceneMode=e.getScene().mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===o.SCENE2D?r.tooltip2D:e===o.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=a(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=a(function(){e.morphTo2D()}),this._morphTo3D=a(function(){e.morphTo3D()}),this._morphToColumbusView=a(function(){e.morphToColumbusView()}),this._sceneMode=o};return e(l.prototype,{sceneTransitioner:{get:function(){return this._transitioner}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},l}),r("Widgets/SceneModePicker/SceneModePicker",["../../Core/defineProperties","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./SceneModePickerViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",l="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",u="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z",c=function(e,r){if(!t(e))throw new i("container is required.");if(!t(r))throw new i("transitioner is required.");e=n(e);var c=new o(r);c._globePath=s,c._flatMapPath=l,c._columbusViewPath=u;var h=document.createElement("span");h.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(h);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),d.innerHTML='',h.appendChild(d);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),h.appendChild(m);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),h.appendChild(p);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),h.appendChild(f),a.applyBindings(c,h),this._viewModel=c,this._container=e,this._wrapper=h,this._closeDropDown=function(e){h.contains(e.target)||(c.dropDownVisible=!1)},document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0)};return e(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._viewModel.destroy(),document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0),a.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),r(this)},c}),r("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined"],function(e,t){"use strict";function r(t,r,i,n){this.interval=t,this.height=r,this.color=i||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var i=this.interval.start,n=this.interval.stop,o=r.startJulian,a=r.startJulian.addSeconds(r.duration);if(i.lessThan(o)&&n.greaterThan(a))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(a)&&n.greaterThanOrEquals(o)){var s,l,u;for(s=0;si&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t='')}return e.y+=this._height,t},e}),r("Widgets/Timeline/Timeline",["../../Core/DeveloperError","../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/JulianDate","../getElement","./TimelineTrack","./TimelineHighlightRange"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,i){if(!r(t))throw new e("container is required.");if(!r(i))throw new e("clock is required.");t=o(t),this.container=t;var n=document.createElement("div");n.className="cesium-timeline-main",t.appendChild(n),this._topDiv=n,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=i,this._scrubJulian=i.currentTime,this._mainTicSpan=-1,this._mouseMode=g.none,this._touchMode=_.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='
',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(i.startTime,i.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=m(this),this._onTouchStart=p(this),this._onTouchMove=v(this),this._onTouchEnd=f(this);var a=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),a.addEventListener("mousedown",this._onMouseDown,!1),a.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),a.addEventListener("mousewheel",this._onMouseWheel,!1),a.addEventListener("touchstart",this._onTouchStart,!1),a.addEventListener("touchmove",this._onTouchMove,!1),a.addEventListener("touchend",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},i.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return 10>e?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==g.touchOnly&&(0===t.button?(e._mouseMode=g.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,e._mouseMode=2===t.button?g.zoom:g.slide)),t.preventDefault()}}function h(e){return function(){e._mouseMode=g.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0px 0px"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var r;if(e._mouseMode===g.scrub){t.preventDefault();var i=t.clientX-e._topDiv.getBoundingClientRect().left;0>i?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===g.slide){if(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r){var n=r*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(e._startJulian.addSeconds(n),e._endJulian.addSeconds(n))}}else e._mouseMode===g.zoom&&(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r&&e.zoomFrom(Math.pow(1.01,r)))}}function m(e){return function(t){var r=t.wheelDeltaY||t.wheelDelta||-t.detail;y=Math.max(Math.min(Math.abs(r),y),1),r/=y,e.zoomFrom(Math.pow(1.05,-r))}}function p(e){return function(t){var r,i,n=t.touches.length,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=g.touchOnly,1===n?(r=e._startJulian.getSecondsDifference(e._scrubJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-i)<50?(e._touchMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===n?"-16px 0":"0 0")):(e._touchMode=_.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):2===n?(e._touchMode=_.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=_.ignore}}function f(e){return function(t){var r=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===_.singleTap?(e._touchMode=_.scrub,e._handleTouchMove(t)):e._touchMode===_.scrub&&e._handleTouchMove(t),e._mouseMode=g.touchOnly,1!==r?e._touchMode=r>0?_.ignore:_.none:e._touchMode===_.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function v(e){return function(t){var i,n,o,a,s,l,u=1,c=e._topDiv.getBoundingClientRect().left;e._touchMode===_.singleTap&&(e._touchMode=_.slideZoom),e._mouseMode=g.touchOnly,e._touchMode===_.scrub?(t.preventDefault(),1===t.changedTouches.length&&(n=t.changedTouches[0].clientX-c,n>=0&&n<=e._topDiv.clientWidth&&e._setTimeBarTime(n,n*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===_.slideZoom&&(o=t.touches.length,2===o?(a=.5*(t.touches[0].clientX+t.touches[1].clientX)-c,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):1===o&&(a=t.touches[0].clientX-c,s=0),r(a)&&(s>0&&e._touchState.spanX>0?(u=e._touchState.spanX/s,l=e._startJulian.addSeconds((e._touchState.centerX*e._timeBarSecondsSpan-a*e._timeBarSecondsSpan*u)/e._topDiv.clientWidth)):(i=e._touchState.centerX-a,l=e._startJulian.addSeconds(i*e._timeBarSecondsSpan/e._topDiv.clientWidth)),e.zoomTo(l,l.addSeconds(e._timeBarSecondsSpan*u)),e._touchState.centerX=a,e._touchState.spanX=s))}}var y=1e12,g={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},_={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},w=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,r){this._topDiv.addEventListener(e,t,r)},l.prototype.removeEventListener=function(e,t,r){this._topDiv.removeEventListener(e,t,r)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t){var r=new s(e,t);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,r,i){var n=new a(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(r,i){if(this._timeBarSecondsSpan=r.getSecondsDifference(i),this._timeBarSecondsSpan<=0)throw new e("Start time must come before end time.");if(this._startJulian=r,this._endJulian=i,this._clock&&this._clock.clockRange!==t.UNBOUNDED){var n=this._clock.startTime,o=this._clock.stopTime,a=n.getSecondsDifference(o),s=this._startJulian.getSecondsDifference(n),l=this._endJulian.getSecondsDifference(o);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=this._endJulian.addSeconds(s),this._startJulian=n,this._timeBarSecondsSpan=this._startJulian.getSecondsDifference(this._endJulian)):0>l&&(this._startJulian=this._startJulian.addSeconds(l),this._endJulian=o,this._timeBarSecondsSpan=this._startJulian.getSecondsDifference(this._endJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=this._startJulian.getSecondsDifference(this._scrubJulian);e>1||0>t||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var r=this._timeBarSecondsSpan-t;this.zoomTo(this._startJulian.addSeconds(t-t*e),this._endJulian.addSeconds(r*e-r))},l.prototype.makeLabel=function(e){var t=e.toGregorianDate(),r=t.millisecond,i=" UTC";if(r>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(r).toString();i.length<3;)i="0"+i;i="."+i}return C[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+i},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(x/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-x)/v}function i(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=this._startJulian.getSecondsDifference(this._scrubJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,m=31536e6,p=1e-10,f=0,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=this._startJulian.addSeconds(d)):v>m&&(v=m,this._timeBarSecondsSpan=m,this._endJulian=this._startJulian.addSeconds(m));var y=this._timeBarEle.clientWidth;10>y&&(y=10);var g,_=this._startJulian,C=Math.min(1e-5*(v/y),.4);g=v>31536e4?n.fromIso8601(_.toDate().toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(_.toDate().toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(_.toDate().toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(_.toDate().toISOString().substring(0,10)+"T00:00:00Z");var x=g.addSeconds(C).getSecondsDifference(this._startJulian),S=x+v;this._epochJulian=g,this._rulerEle.innerHTML=this.makeLabel(this._endJulian.addSeconds(-d));var E=this._rulerEle.offsetWidth+20,b=f;f-=p;var T={y:0,startTime:x,startJulian:_,epochJulian:g,duration:v,timeBarWidth:y,getAlpha:r};this._highlightRanges.forEach(function(e){h+=e.render(T)});var A=0,D=0,P=0,M=E/y;M>1&&(M=1),M*=this._timeBarSecondsSpan;var I,O=-1,R=-1,L=w.length;for(I=0;L>I;++I){var z=w[I];if(++O,A=z,z>M&&z>f)break;0>R&&y*(z/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=O)}if(O>0){for(;O>0;)if(--O,Math.abs(i(A,w[O]))<1e-5){w[O]>=f&&(D=w[O]);break}if(R>=0)for(;O>R;){if(Math.abs(i(D,w[R]))<1e-5&&w[R]>=f){P=w[R];break}++R}}f=b,f>p&&1e-5>P&&Math.abs(f-A)>p&&(P=f,A+p>=f&&(D=0));var N,B=-999999;if(y*(P/this._timeBarSecondsSpan)>=3)for(o=e(P);S>=o;o=t(o,P))h+='';if(y*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);S>=o;o=t(o,D))h+='';if(y*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,S+=A,o=e(A);for(var F=g.getTaiMinusUtc();S>=o;){var V=_.addSeconds(o-x);if(A>2.1){var k=V.getTaiMinusUtc();Math.abs(k-F)>.1&&(o+=k-F,V=_.addSeconds(o-x))}var U=Math.round(y*r(o)),W=this.makeLabel(V); -this._rulerEle.innerHTML=W,N=this._rulerEle.offsetWidth;var q=U-(N/2-1);q>B?(B=q+N+5,h+=''+''+W+""):h+='',o=t(o,A)}}else this._mainTicSpan=-1;h+='',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),T.y=0,this._trackList.forEach(function(e){e.render(c._context,T),T.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(r(this._scrubElement)){var t=this._startJulian.getSecondsDifference(this._scrubJulian),i=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}r(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(this._startJulian.addSeconds(this._timelineDrag),this._endJulian.addSeconds(this._timelineDrag)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=this._startJulian.addSeconds(t),this._scrubElement){var r=e-8;this._scrubElement.style.left=r.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var r=1;this._trackList.forEach(function(e){r+=e.height}),this._trackListEle.style.height=r.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=r,this._makeTics(),this._lastWidth=e,this._lastHeight=t}},l}),r("Widgets/Viewer/Viewer",["../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/destroyObject","../../Core/Event","../../Core/EventHelper","../../Core/requestAnimationFrame","../../DynamicScene/DataSourceCollection","../../DynamicScene/DataSourceDisplay","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultBaseLayers","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../subscribeAndEvaluate","../HomeButton/HomeButton","../SceneModePicker/SceneModePicker","../Timeline/Timeline"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x){"use strict";function S(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function E(e){function t(){if(!e.isDestroyed())try{e._useDefaultRenderLoop?(e.resize(),e.render(),s(t)):e._renderLoopRunning=!1}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._renderLoopError.raiseEvent(e,r),e._showRenderLoopErrors&&(e.cesiumWidget.showErrorPanel("An error occurred while rendering. Rendering has stopped.",r),console.error(r))}}e._renderLoopRunning=!0,s(t)}var b=function(i,n){function s(e){M.update(e.currentTime)}function E(e,r){if(1===e.getLength()){var i=r.getClock();t(i)&&(i.getValue(I),t(G)&&(G.updateFromClock(),G.zoomTo(i.startTime,i.stopTime)))}}if(!t(i))throw new r("container is required.");i=g(i),n=e(n,e.EMPTY_OBJECT);var b=!t(n.baseLayerPicker)||n.baseLayerPicker!==!1;if(b&&t(n.imageryProvider))throw new r("options.imageryProvider is not available when using the BaseLayerPicker widget. Either specify options.selectedImageryProviderViewModel instead or set options.baseLayerPicker to false.");if(!b&&t(n.selectedImageryProviderViewModel))throw new r("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.imageryProvider instead or set options.baseLayerPicker to true.");var T=document.createElement("div");T.className="cesium-viewer",i.appendChild(T);var A=document.createElement("div");A.className="cesium-viewer-cesiumWidgetContainer",T.appendChild(A);var D=new p(A,{terrainProvider:n.terrainProvider,imageryProvider:b?!1:n.imageryProvider,skyBox:n.skyBox,sceneMode:n.sceneMode,contextOptions:n.contextOptions,useDefaultRenderLoop:!1}),P=new l,M=new u(D.scene,P),I=D.clock,O=new f(I),R=new a,L=document.createElement("div");L.className="cesium-viewer-toolbar",T.appendChild(L);var z;if(!t(n.geocoder)||n.geocoder!==!1){var N=document.createElement("div");N.className="cesium-viewer-geocoderContainer",L.appendChild(N),z=new y({container:N,scene:D.scene,ellipsoid:D.centralBody.getEllipsoid()})}var B;t(n.homeButton)&&n.homeButton===!1||(B=new w(L,D.scene,D.sceneTransitioner,D.centralBody.getEllipsoid()),t(z)&&R.add(B.viewModel.command.afterExecute,function(){var e=z.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}));var F;t(n.sceneModePicker)&&n.sceneModePicker===!1||(F=new C(L,D.sceneTransitioner));var V;if(b){var k=e(n.imageryProviderViewModels,m());V=new d(L,D.centralBody.getImageryLayers(),k),V.viewModel.selectedItem=e(n.selectedImageryProviderViewModel,k[0]);var U=L.getElementsByClassName("cesium-baseLayerPicker-dropDown");this._baseLayerPickerDropDown=U[0]}var W;if(!t(n.animation)||n.animation!==!1){var q=document.createElement("div");q.className="cesium-viewer-animationContainer",T.appendChild(q),W=new c(q,new h(O))}var G;if(!t(n.timeline)||n.timeline!==!1){var H=document.createElement("div");H.className="cesium-viewer-timelineContainer",T.appendChild(H),G=new x(H,I),G.addEventListener("settime",S,!1),G.zoomTo(I.startTime,I.stopTime)}var j;if(t(n.fullscreenButton)&&n.fullscreenButton===!1)t(G)&&(G.container.style.right=0);else{var Y=document.createElement("div");Y.className="cesium-viewer-fullscreenContainer",T.appendChild(Y),j=new v(Y,e(n.fullscreenElement,i)),this._fullscreenSubscription=_(j.viewModel,"isFullscreenEnabled",function(e){Y.style.display=e?"block":"none",t(G)&&(G.container.style.right=Y.clientWidth+"px",G.resize())})}R.add(I.onTick,s),R.add(P.dataSourceAdded,E),this._container=i,this._element=T,this._cesiumWidget=D,this._dataSourceCollection=P,this._dataSourceDisplay=M,this._clockViewModel=O,this._toolbar=L,this._homeButton=B,this._sceneModePicker=F,this._baseLayerPicker=V,this._animation=W,this._timeline=G,this._fullscreenButton=j,this._geocoder=z,this._eventHelper=R,this._lastWidth=0,this._lastHeight=0,this._useDefaultRenderLoop=void 0,this._renderLoopRunning=!1,this._showRenderLoopErrors=e(n.showRenderLoopErrors,!0),this._renderLoopError=new o,this.useDefaultRenderLoop=e(n.useDefaultRenderLoop,!0)};return i(b.prototype,{container:{get:function(){return this._container}},cesiumWidget:{get:function(){return this._cesiumWidget}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},centralBody:{get:function(){return this._cesiumWidget.centralBody}},clock:{get:function(){return this._cesiumWidget.clock}},sceneTransitioner:{get:function(){return this._cesiumWidget.sceneTransitioner}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},renderLoopError:{get:function(){return this._renderLoopError}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&E(this))}}}),b.prototype.extend=function(e,i){if(!t(e))throw new r("mixin is required.");e(this,i)},b.prototype.resize=function(){var e=this._cesiumWidget;e.resize();var r=this._container,i=r.clientWidth,n=r.clientHeight;if(i!==this._lastWidth||n!==this._lastHeight){var o=this._baseLayerPickerDropDown;if(t(o)){var a=n-125;o.style.maxHeight=a+"px"}var s,l=t(this._timeline),u=t(this._animation),c=!u,h=0;if(u){var d=this._lastWidth;s=this._animation.container,i>900?900>=d&&(h=169,s.style.width="169px",s.style.height="112px",c=!0,this._animation.resize()):i>=600?(600>d||d>900)&&(h=136,s.style.width="136px",s.style.height="90px",c=!0,this._animation.resize()):(d>600||0===d)&&(h=106,s.style.width="106px",s.style.height="70px",c=!0,this._animation.resize())}if(c){var m=0,p=h+5;if(l&&(m=this._timeline.container.clientHeight+3,this._timeline.container.style.left=h+"px"),l||u){var f=e.creditContainer;f.style.bottom=m+"px",f.style.left=p+"px"}}l&&this._timeline.resize(),this._lastWidth=i,this._lastHeight=n}},b.prototype.render=function(){this._cesiumWidget.render()},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),t(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),t(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),t(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),t(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),t(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),t(this._timeline)&&(this._timeline.removeEventListener("settime",S,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),t(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._dataSourceCollection=this._dataSourceCollection.destroy(),n(this)},b}),r("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/Event","../../Core/wrapFunction","../../DynamicScene/CzmlDataSource","../../DynamicScene/GeoJsonDataSource","../../ThirdParty/when","../getElement"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e.stopPropagation(),e.preventDefault()}function h(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",c,!1),i.removeEventListener("dragover",c,!1),i.removeEventListener("dragexit",c,!1))}function d(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",c,!1),e.addEventListener("dragover",c,!1),e.addEventListener("dragexit",c,!1)}function m(e,t){var r=e.length,i=t.length;return r>i&&-1!==e.indexOf(t,r-i)}function p(e,t){var r,i=t.toUpperCase();if(m(i,".CZML"))r=a;else{if(!(m(i,".GEOJSON")||m(i,".JSON")||m(i,".TOPOJSON")))return e.dropError.raiseEvent(e,t,"Unrecognized file extension: "+t),void 0;r=s}return function(i){var n=new r;try{l(n.load(JSON.parse(i.target.result),t),function(){e.dataSources.add(n)},function(r){e.dropError.raiseEvent(e,t,r)})}catch(o){e.dropError.raiseEvent(e,t,o)}}}function f(e,t){return function(r){e.dropError.raiseEvent(e,t,r.target.error)}}var v=function(a,s){function l(e){c(e),y&&a.dataSources.removeAll();for(var t=e.dataTransfer.files,r=t.length,i=0;r>i;i++){var n=t[i],o=new FileReader;o.onload=p(a,n.name),o.onerror=f(a,n.name),o.readAsText(n)}}if(!t(a))throw new r("viewer is required.");if(a.hasOwnProperty("dropTarget"))throw new r("dropTarget is already defined by another mixin.");if(a.hasOwnProperty("dropEnabled"))throw new r("dropEnabled is already defined by another mixin.");if(a.hasOwnProperty("dropError"))throw new r("dropError is already defined by another mixin.");if(a.hasOwnProperty("clearOnDrop"))throw new r("clearOnDrop is already defined by another mixin.");s=e(s,e.EMPTY_OBJECT);var m=!0,v=new n,y=e(s.clearOnDrop,!0),g=e(s.dropTarget,a.container);g=u(g),i(a,{dropTarget:{get:function(){return g},set:function(e){if(!t(e))throw new r("value is required.");h(g,l),g=e,d(g,l)}},dropEnabled:{get:function(){return m},set:function(e){e!==m&&(e?d(g,l):h(g,l),m=e)}},dropError:{get:function(){return v}},clearOnDrop:{get:function(){return y},set:function(e){y=e}}}),d(g,l),a.destroy=o(a,a.destroy,function(){a.dropEnabled=!1}),a._handleDrop=l};return v}),r("Widgets/Viewer/viewerDynamicObjectMixin",["../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/Event","../../Core/EventHelper","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../Scene/SceneMode","../../DynamicScene/DynamicObjectView"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(u){function c(t){e(y)&&y.update(t.currentTime)}function h(t){var r=u.scene.pick(t.position);e(r)&&e(r.primitive)&&e(r.primitive.dynamicObject)&&e(r.primitive.dynamicObject.position)&&(u.trackedObject=r.primitive.dynamicObject)}function d(){u.trackedObject=void 0}function m(e,t,r){for(var i=r.length,n=0;i>n;n++){var o=r[n];if(u.trackedObject===o){u.homeButton.viewModel.command();break}}}function p(e,t){t.getDynamicObjectCollection().collectionChanged.addEventListener(m)}function f(t,r){r.getDynamicObjectCollection().collectionChanged.removeEventListener(m),e(v)&&r.getDynamicObjectCollection().getById(u.trackedObject.id)===u.trackedObject&&u.homeButton.viewModel.command()}if(!e(u))throw new t("viewer is required.");if(u.hasOwnProperty("trackedObject"))throw new t("trackedObject is already defined by another mixin.");if(u.hasOwnProperty("objectTracked"))throw new t("objectTracked is already defined by another mixin.");var v,y,g=new n,_=new i;g.add(u.clock.onTick,c),e(u.homeButton)&&g.add(u.homeButton.viewModel.command.beforeExecute,d),e(u.geocoder)&&g.add(u.geocoder.viewModel.search.beforeExecute,d);for(var w=u.dataSources,C=w.getLength(),x=0;C>x;x++)p(w,w.get(x));g.add(u.dataSources.dataSourceAdded,p),g.add(u.dataSources.dataSourceRemoved,f),u.screenSpaceEventHandler.setInputAction(h,o.LEFT_CLICK),r(u,{trackedObject:{get:function(){return v},set:function(t){var r=u.scene.getFrameState().mode;(r===s.COLUMBUS_VIEW||r===s.SCENE2D)&&(u.scene.getScreenSpaceCameraController().enableTranslate=!e(t)),(r===s.COLUMBUS_VIEW||r===s.SCENE3D)&&(u.scene.getScreenSpaceCameraController().enableTilt=!e(t)),v!==t&&(v=t,y=e(t)?new l(t,u.scene,u.centralBody.getEllipsoid()):void 0,_.raiseEvent(u,t))}},objectTracked:{get:function(){return _}}}),u.destroy=a(u,u.destroy,function(){g.removeAll(),u.screenSpaceEventHandler.removeInputAction(o.LEFT_CLICK);for(var e=u.dataSources,t=e.getLength(),r=0;t>r;r++)f(e,e.get(r))})};return u}),r("Widgets/checkForChromeFrame",["../Core/FeatureDetection","./getElement","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){e=t(e);var r=document.createElement("div");r.className="cesium-chromeFrameOverlay";var i=document.createElement("div");r.appendChild(i),i.innerHTML='Cesium requires WebGL, an open standard for displaying 3D content in a web browser. To enable WebGL in Internet Explorer, we recommend installing Google Chrome Frame, a free, unobtrusive plug-in offered by Google. To learn more about WebGL, visit http://www.khronos.org/webgl/.

Would you like to install Chrome Frame now?

';var n=document.createElement("p");i.appendChild(n);var o=document.createElement("a");o.href="#",o.innerHTML="Yes, install Google Chrome Frame",o.onclick=function(){window.CFInstall.check({mode:"overlay",destination:document.URL}),e.removeChild(r)},n.appendChild(o),n=document.createElement("p"),i.appendChild(n);var a=document.createElement("a");a.href="#",a.innerHTML="No, not at this time",a.onclick=function(){e.removeChild(r)},n.appendChild(a),e.appendChild(r)}var n=function(t){var n=r.defer();if(e.isInternetExplorer()){var o=document.createElement("script");o.type="text/javascript",o.src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js";var a=document.getElementsByTagName("head")[0];a.appendChild(o);var s=setInterval(function(){if(window.CFInstall){clearInterval(s);var e=!1;window.CFInstall.check({mode:"overlay",preventPrompt:!0,onmissing:function(){e=!0}}),e&&i(t),n.resolve(e)}},50)}else n.resolve(!1);return n.promise};return n}),r("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";var r=function(r){var i,n=[],o={id:void 0,result:void 0,error:void 0};return function(a){var s=a.data;n.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,n)}catch(l){o.error=l}t(i)||(i=e(self.webkitPostMessage,self.postMessage));try{i(o,n)}catch(l){o.result=void 0,o.error="postMessage failed with error: "+l+"\n with responseMessage: "+JSON.stringify(o),i(o)}}};return r}),r("Cesium",["./Core/AxisAlignedBoundingBox","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/DeveloperError","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidalOccluder","./Core/EncodedCartesian3","./Core/Enumeration","./Core/Event","./Core/EventHelper","./Core/Extent","./Core/ExtentGeometry","./Core/ExtentOutlineGeometry","./Core/FAR","./Core/FeatureDetection","./Core/Fullscreen","./Core/GeographicProjection","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/IntersectionTests","./Core/Interval","./Core/Iso8601","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/NearFarScalar","./Core/ObjectOrientedBoundingBox","./Core/Occluder","./Core/Packable","./Core/PackableForInterpolation","./Core/Plane","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/Queue","./Core/Ray","./Core/ReferenceFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/Shapes","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/TaskProcessor","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TridiagonalSystemSolver","./Core/VertexFormat","./Core/Visibility","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebMercatorProjection","./Core/WindingOrder","./Core/barycentricCoordinates","./Core/binarySearch","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/clone","./Core/combine","./Core/createGuid","./Core/defaultValue","./Core/defineProperties","./Core/defined","./Core/destroyObject","./Core/freezeObject","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/jsonp","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/pointInsideTriangle","./Core/requestAnimationFrame","./Core/throttleRequestByServer","./Core/wrapFunction","./Core/writeTextToCanvas","./DynamicScene/ColorMaterialProperty","./DynamicScene/CompositeDynamicObjectCollection","./DynamicScene/CompositeMaterialProperty","./DynamicScene/CompositePositionProperty","./DynamicScene/CompositeProperty","./DynamicScene/ConstantPositionProperty","./DynamicScene/ConstantProperty","./DynamicScene/CzmlDataSource","./DynamicScene/DataSource","./DynamicScene/DataSourceCollection","./DynamicScene/DataSourceDisplay","./DynamicScene/DynamicBillboard","./DynamicScene/DynamicBillboardVisualizer","./DynamicScene/DynamicClock","./DynamicScene/DynamicCone","./DynamicScene/DynamicConeVisualizerUsingCustomSensor","./DynamicScene/DynamicDirectionsProperty","./DynamicScene/DynamicEllipse","./DynamicScene/DynamicEllipsoid","./DynamicScene/DynamicEllipsoidVisualizer","./DynamicScene/DynamicLabel","./DynamicScene/DynamicLabelVisualizer","./DynamicScene/DynamicObject","./DynamicScene/DynamicObjectCollection","./DynamicScene/DynamicObjectView","./DynamicScene/DynamicPath","./DynamicScene/DynamicPathVisualizer","./DynamicScene/DynamicPoint","./DynamicScene/DynamicPointVisualizer","./DynamicScene/DynamicPolygon","./DynamicScene/DynamicPolygonVisualizer","./DynamicScene/DynamicPolyline","./DynamicScene/DynamicPolylineVisualizer","./DynamicScene/DynamicPyramid","./DynamicScene/DynamicPyramidVisualizer","./DynamicScene/DynamicVector","./DynamicScene/DynamicVectorVisualizer","./DynamicScene/DynamicVertexPositionsProperty","./DynamicScene/GeoJsonDataSource","./DynamicScene/GridMaterialProperty","./DynamicScene/ImageMaterialProperty","./DynamicScene/MaterialProperty","./DynamicScene/PolylineOutlineMaterialProperty","./DynamicScene/PositionProperty","./DynamicScene/Property","./DynamicScene/ReferenceProperty","./DynamicScene/SampledPositionProperty","./DynamicScene/SampledProperty","./DynamicScene/TimeIntervalCollectionPositionProperty","./DynamicScene/TimeIntervalCollectionProperty","./DynamicScene/VisualizerCollection","./DynamicScene/createDynamicPropertyDescriptor","./Renderer/AutomaticUniforms","./Renderer/BlendEquation","./Renderer/BlendFunction","./Renderer/BlendingState","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/Context","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/CullFace","./Renderer/DepthFunction","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/PixelFormat","./Renderer/RenderState","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/StencilFunction","./Renderer/StencilOperation","./Renderer/Texture","./Renderer/TextureAtlas","./Renderer/TextureAtlasBuilder","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformDatatype","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/VertexLayout","./Renderer/createShaderSource","./Renderer/loadCubeMap","./Scene/AnimationCollection","./Scene/Appearance","./Scene/ArcGisImageServerTerrainProvider","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/Camera","./Scene/CameraColumbusViewMode","./Scene/CameraController","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/CentralBody","./Scene/CentralBodySurface","./Scene/CentralBodySurfaceShaderSet","./Scene/CesiumTerrainProvider","./Scene/CompositePrimitive","./Scene/Credit","./Scene/CreditDisplay","./Scene/CullingVolume","./Scene/CustomSensorVolume","./Scene/DebugAppearance","./Scene/DebugModelMatrixPrimitive","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/EllipsoidTerrainProvider","./Scene/ExtentPrimitive","./Scene/FrameState","./Scene/FrustumCommands","./Scene/GeographicTilingScheme","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/HeightmapTerrainData","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/Material","./Scene/MaterialAppearance","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/PerInstanceColorAppearance","./Scene/PerformanceDisplay","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/Polygon","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/RectangularPyramidSensorVolume","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/SensorVolumeCollection","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainData","./Scene/TerrainMesh","./Scene/TerrainProvider","./Scene/TerrainState","./Scene/TexturePool","./Scene/Tile","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileMapServiceImageryProvider","./Scene/TileProviderError","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TilingScheme","./Scene/VRTheWorldTerrainProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMercatorTilingScheme","./Scene/createTangentSpaceDebugPrimitive","./Scene/sampleTerrain","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/knockout-3.0.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/weakmap","./ThirdParty/when","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/ImageryProviderViewModel","./Widgets/BaseLayerPicker/createDefaultBaseLayers","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/Observable","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerDynamicObjectMixin","./Widgets/checkForChromeFrame","./Widgets/createCommand","./Widgets/getElement","./Widgets/subscribeAndEvaluate","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M,I,O,R,L,z,N,B,F,V,k,U,W,q,G,H,j,Y,X,Z,J,K,Q,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,mt,pt,ft,vt,yt,gt,_t,wt,Ct,xt,St,Et,bt,Tt,At,Dt,Pt,Mt,It,Ot,Rt,Lt,zt,Nt,Bt,Ft,Vt,kt,Ut,Wt,qt,Gt,Ht,jt,Yt,Xt,Zt,Jt,Kt,Qt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,hr,dr,mr,pr,fr,vr,yr,gr,_r,wr,Cr,xr,Sr,Er,br,Tr,Ar,Dr,Pr,Mr,Ir,Or,Rr,Lr,zr,Nr,Br,Fr,Vr,kr,Ur,Wr,qr,Gr,Hr,jr,Yr,Xr,Zr,Jr,Kr,Qr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,hi,di,mi,pi,fi,vi,yi,gi,_i,wi,Ci,xi,Si,Ei,bi,Ti,Ai,Di,Pi,Mi,Ii,Oi,Ri,Li,zi,Ni,Bi,Fi,Vi,ki,Ui,Wi,qi,Gi,Hi,ji,Yi,Xi,Zi,Ji,Ki,Qi,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,mn,pn,fn,vn,yn,gn,_n,wn,Cn,xn,Sn,En,bn,Tn,An,Dn,Pn,Mn,In,On,Rn,Ln,zn,Nn,Bn,Fn,Vn,kn,Un,Wn,qn,Gn,Hn,jn,Yn,Xn,Zn,Jn,Kn,Qn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,mo,po,fo,vo,yo,go,_o,wo,Co,xo,So,Eo,bo,To,Ao,Do,Po,Mo,Io,Oo,Ro,Lo,zo,No,Bo,Fo,Vo,ko,Uo,Wo,qo,Go,Ho,jo,Yo,Xo,Zo,Jo,Ko,Qo,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,ha,da,ma,pa,fa,va,ya,ga,_a,wa,Ca,xa,Sa,Ea,ba,Ta,Aa,Da,Pa,Ma,Ia,Oa,Ra,La,za,Na,Ba,Fa,Va,ka,Ua,Wa,qa,Ga,Ha,ja,Ya,Xa,Za,Ja,Ka,Qa,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,hs,ds,ms,ps,fs){"use strict";var vs={_shaders:{}};return vs.AxisAlignedBoundingBox=e,vs.BingMapsApi=t,vs.BoundingRectangle=r,vs.BoundingSphere=i,vs.BoxGeometry=n,vs.BoxOutlineGeometry=o,vs.Cartesian2=a,vs.Cartesian3=s,vs.Cartesian4=l,vs.Cartographic=u,vs.CatmullRomSpline=c,vs.CircleGeometry=h,vs.CircleOutlineGeometry=d,vs.Clock=m,vs.ClockRange=p,vs.ClockStep=f,vs.Color=v,vs.ColorGeometryInstanceAttribute=y,vs.ComponentDatatype=g,vs.CornerType=_,vs.CorridorGeometry=w,vs.CorridorGeometryLibrary=C,vs.CorridorOutlineGeometry=x,vs.CubicRealPolynomial=S,vs.CylinderGeometry=E,vs.CylinderGeometryLibrary=b,vs.CylinderOutlineGeometry=T,vs.DefaultProxy=A,vs.DeveloperError=D,vs.EarthOrientationParameters=P,vs.EarthOrientationParametersSample=M,vs.EllipseGeometry=I,vs.EllipseGeometryLibrary=O,vs.EllipseOutlineGeometry=R,vs.Ellipsoid=L,vs.EllipsoidGeodesic=z,vs.EllipsoidGeometry=N,vs.EllipsoidOutlineGeometry=B,vs.EllipsoidTangentPlane=F,vs.EllipsoidalOccluder=V,vs.EncodedCartesian3=k,vs.Enumeration=U,vs.Event=W,vs.EventHelper=q,vs.Extent=G,vs.ExtentGeometry=H,vs.ExtentOutlineGeometry=j,vs.FAR=Y,vs.FeatureDetection=X,vs.Fullscreen=Z,vs.GeographicProjection=J,vs.Geometry=K,vs.GeometryAttribute=Q,vs.GeometryAttributes=$,vs.GeometryInstance=et,vs.GeometryInstanceAttribute=tt,vs.GeometryPipeline=rt,vs.HeightmapTessellator=it,vs.HermitePolynomialApproximation=nt,vs.HermiteSpline=ot,vs.Iau2000Orientation=at,vs.Iau2006XysData=st,vs.Iau2006XysSample=lt,vs.IauOrientationAxes=ut,vs.IauOrientationParameters=ct,vs.IndexDatatype=ht,vs.InterpolationAlgorithm=dt,vs.Intersect=mt,vs.IntersectionTests=pt,vs.Interval=ft,vs.Iso8601=vt,vs.JulianDate=yt,vs.KeyboardEventModifier=gt,vs.LagrangePolynomialApproximation=_t,vs.LeapSecond=wt,vs.LinearApproximation=Ct,vs.LinearSpline=xt,vs.Math=St,vs.Matrix2=Et,vs.Matrix3=bt,vs.Matrix4=Tt,vs.NearFarScalar=At,vs.ObjectOrientedBoundingBox=Dt,vs.Occluder=Pt,vs.Packable=Mt,vs.PackableForInterpolation=It,vs.Plane=Ot,vs.PolygonGeometry=Rt,vs.PolygonGeometryLibrary=Lt,vs.PolygonOutlineGeometry=zt,vs.PolygonPipeline=Nt,vs.PolylineGeometry=Bt,vs.PolylinePipeline=Ft,vs.PolylineVolumeGeometry=Vt,vs.PolylineVolumeGeometryLibrary=kt,vs.PolylineVolumeOutlineGeometry=Ut,vs.PrimitiveType=Wt,vs.QuadraticRealPolynomial=qt,vs.QuarticRealPolynomial=Gt,vs.Quaternion=Ht,vs.QuaternionSpline=jt,vs.Queue=Yt,vs.Ray=Xt,vs.ReferenceFrame=Zt,vs.RequestErrorEvent=Jt,vs.RuntimeError=Kt,vs.ScreenSpaceEventHandler=Qt,vs.ScreenSpaceEventType=$t,vs.Shapes=er,vs.ShowGeometryInstanceAttribute=tr,vs.Simon1994PlanetaryPositions=rr,vs.SimplePolylineGeometry=ir,vs.SphereGeometry=nr,vs.SphereOutlineGeometry=or,vs.Spherical=ar,vs.Spline=sr,vs.TaskProcessor=lr,vs.TimeConstants=ur,vs.TimeInterval=cr,vs.TimeIntervalCollection=hr,vs.TimeStandard=dr,vs.Tipsify=mr,vs.Transforms=pr,vs.TridiagonalSystemSolver=fr,vs.VertexFormat=vr,vs.Visibility=yr,vs.WallGeometry=gr,vs.WallGeometryLibrary=_r,vs.WallOutlineGeometry=wr,vs.WebMercatorProjection=Cr,vs.WindingOrder=xr,vs.barycentricCoordinates=Sr,vs.binarySearch=Er,vs.buildModuleUrl=br,vs.cancelAnimationFrame=Tr,vs.clone=Ar,vs.combine=Dr,vs.createGuid=Pr,vs.defaultValue=Mr,vs.defineProperties=Ir,vs.defined=Or,vs.destroyObject=Rr,vs.freezeObject=Lr,vs.getFilenameFromUri=zr,vs.getImagePixels=Nr,vs.isCrossOriginUrl=Br,vs.isLeapYear=Fr,vs.jsonp=Vr,vs.loadArrayBuffer=kr,vs.loadBlob=Ur,vs.loadImage=Wr,vs.loadImageViaBlob=qr,vs.loadJson=Gr,vs.loadText=Hr,vs.loadWithXhr=jr,vs.loadXML=Yr,vs.pointInsideTriangle=Xr,vs.requestAnimationFrame=Zr,vs.throttleRequestByServer=Jr,vs.wrapFunction=Kr,vs.writeTextToCanvas=Qr,vs.ColorMaterialProperty=$r,vs.CompositeDynamicObjectCollection=ei,vs.CompositeMaterialProperty=ti,vs.CompositePositionProperty=ri,vs.CompositeProperty=ii,vs.ConstantPositionProperty=ni,vs.ConstantProperty=oi,vs.CzmlDataSource=ai,vs.DataSource=si,vs.DataSourceCollection=li,vs.DataSourceDisplay=ui,vs.DynamicBillboard=ci,vs.DynamicBillboardVisualizer=hi,vs.DynamicClock=di,vs.DynamicCone=mi,vs.DynamicConeVisualizerUsingCustomSensor=pi,vs.DynamicDirectionsProperty=fi,vs.DynamicEllipse=vi,vs.DynamicEllipsoid=yi,vs.DynamicEllipsoidVisualizer=gi,vs.DynamicLabel=_i,vs.DynamicLabelVisualizer=wi,vs.DynamicObject=Ci,vs.DynamicObjectCollection=xi,vs.DynamicObjectView=Si,vs.DynamicPath=Ei,vs.DynamicPathVisualizer=bi,vs.DynamicPoint=Ti,vs.DynamicPointVisualizer=Ai,vs.DynamicPolygon=Di,vs.DynamicPolygonVisualizer=Pi,vs.DynamicPolyline=Mi,vs.DynamicPolylineVisualizer=Ii,vs.DynamicPyramid=Oi,vs.DynamicPyramidVisualizer=Ri,vs.DynamicVector=Li,vs.DynamicVectorVisualizer=zi,vs.DynamicVertexPositionsProperty=Ni,vs.GeoJsonDataSource=Bi,vs.GridMaterialProperty=Fi,vs.ImageMaterialProperty=Vi,vs.MaterialProperty=ki,vs.PolylineOutlineMaterialProperty=Ui,vs.PositionProperty=Wi,vs.Property=qi,vs.ReferenceProperty=Gi,vs.SampledPositionProperty=Hi,vs.SampledProperty=ji,vs.TimeIntervalCollectionPositionProperty=Yi,vs.TimeIntervalCollectionProperty=Xi,vs.VisualizerCollection=Zi,vs.createDynamicPropertyDescriptor=Ji,vs.AutomaticUniforms=Ki,vs.BlendEquation=Qi,vs.BlendFunction=$i,vs.BlendingState=en,vs.Buffer=tn,vs.BufferUsage=rn,vs.ClearCommand=nn,vs.Context=on,vs.CubeMap=an,vs.CubeMapFace=sn,vs.CullFace=ln,vs.DepthFunction=un,vs.DrawCommand=cn,vs.Framebuffer=hn,vs.MipmapHint=dn,vs.Pass=mn,vs.PassState=pn,vs.PickFramebuffer=fn,vs.PixelDatatype=vn,vs.PixelFormat=yn,vs.RenderState=gn,vs.Renderbuffer=_n,vs.RenderbufferFormat=wn,vs.ShaderCache=Cn,vs.ShaderProgram=xn,vs.StencilFunction=Sn,vs.StencilOperation=En,vs.Texture=bn,vs.TextureAtlas=Tn,vs.TextureAtlasBuilder=An,vs.TextureMagnificationFilter=Dn,vs.TextureMinificationFilter=Pn,vs.TextureWrap=Mn,vs.UniformDatatype=In,vs.UniformState=On,vs.VertexArray=Rn,vs.VertexArrayFacade=Ln,vs.VertexLayout=zn,vs.createShaderSource=Nn,vs.loadCubeMap=Bn,vs.AnimationCollection=Fn,vs.Appearance=Vn,vs.ArcGisImageServerTerrainProvider=kn,vs.ArcGisMapServerImageryProvider=Un,vs.Billboard=Wn,vs.BillboardCollection=qn,vs.BingMapsImageryProvider=Gn,vs.BingMapsStyle=Hn,vs.Camera=jn,vs.CameraColumbusViewMode=Yn,vs.CameraController=Xn,vs.CameraEventAggregator=Zn,vs.CameraEventType=Jn,vs.CameraFlightPath=Kn,vs.CentralBody=Qn,vs.CentralBodySurface=$n,vs.CentralBodySurfaceShaderSet=eo,vs.CesiumTerrainProvider=to,vs.CompositePrimitive=ro,vs.Credit=io,vs.CreditDisplay=no,vs.CullingVolume=oo,vs.CustomSensorVolume=ao,vs.DebugAppearance=so,vs.DebugModelMatrixPrimitive=lo,vs.DiscardMissingTileImagePolicy=uo,vs.EllipsoidPrimitive=co,vs.EllipsoidSurfaceAppearance=ho,vs.EllipsoidTerrainProvider=mo,vs.ExtentPrimitive=po,vs.FrameState=fo,vs.FrustumCommands=vo,vs.GeographicTilingScheme=yo,vs.GoogleEarthImageryProvider=go,vs.GridImageryProvider=_o,vs.HeightmapTerrainData=wo,vs.HorizontalOrigin=Co,vs.Imagery=xo,vs.ImageryLayer=So,vs.ImageryLayerCollection=Eo,vs.ImageryProvider=bo,vs.ImageryState=To,vs.Label=Ao,vs.LabelCollection=Do,vs.LabelStyle=Po,vs.Material=Mo,vs.MaterialAppearance=Io,vs.Moon=Oo,vs.NeverTileDiscardPolicy=Ro,vs.OpenStreetMapImageryProvider=Lo,vs.OrthographicFrustum=zo,vs.PerInstanceColorAppearance=No,vs.PerformanceDisplay=Bo,vs.PerspectiveFrustum=Fo,vs.PerspectiveOffCenterFrustum=Vo,vs.Polygon=ko,vs.Polyline=Uo,vs.PolylineCollection=Wo,vs.PolylineColorAppearance=qo,vs.PolylineMaterialAppearance=Go,vs.Primitive=Ho,vs.PrimitivePipeline=jo,vs.PrimitiveState=Yo,vs.RectangularPyramidSensorVolume=Xo,vs.Scene=Zo,vs.SceneMode=Jo,vs.SceneTransforms=Ko,vs.SceneTransitioner=Qo,vs.ScreenSpaceCameraController=$o,vs.SensorVolumeCollection=ea,vs.SingleTileImageryProvider=ta,vs.SkyAtmosphere=ra,vs.SkyBox=ia,vs.Sun=na,vs.SunPostProcess=oa,vs.TerrainData=aa,vs.TerrainMesh=sa,vs.TerrainProvider=la,vs.TerrainState=ua,vs.TexturePool=ca,vs.Tile=ha,vs.TileCoordinatesImageryProvider=da,vs.TileDiscardPolicy=ma,vs.TileImagery=pa,vs.TileMapServiceImageryProvider=fa,vs.TileProviderError=va,vs.TileReplacementQueue=ya,vs.TileState=ga,vs.TileTerrain=_a,vs.TilingScheme=wa,vs.VRTheWorldTerrainProvider=Ca,vs.VerticalOrigin=xa,vs.ViewportQuad=Sa,vs.WebMapServiceImageryProvider=Ea,vs.WebMercatorTilingScheme=ba,vs.createTangentSpaceDebugPrimitive=Ta,vs.sampleTerrain=Aa,vs.Tween=Da,vs.Uri=Pa,vs["knockout-3.0.0"]=Ma,vs["knockout-es5"]=Ia,vs.knockout=Oa,vs.measureText=Ra,vs["mersenne-twister"]=La,vs.sprintf=za,vs.topojson=Na,vs.weakmap=Ba,vs.when=Fa,vs.Animation=Va,vs.AnimationViewModel=ka,vs.BaseLayerPicker=Ua,vs.BaseLayerPickerViewModel=Wa,vs.ImageryProviderViewModel=qa,vs.createDefaultBaseLayers=Ga,vs.CesiumWidget=Ha,vs.ClockViewModel=ja,vs.Command=Ya,vs.FullscreenButton=Xa,vs.FullscreenButtonViewModel=Za,vs.Geocoder=Ja,vs.GeocoderViewModel=Ka,vs.HomeButton=Qa,vs.HomeButtonViewModel=$a,vs.Observable=es,vs.SceneModePicker=ts,vs.SceneModePickerViewModel=rs,vs.SvgPathBindingHandler=is,vs.Timeline=ns,vs.TimelineHighlightRange=os,vs.TimelineTrack=as,vs.ToggleButtonViewModel=ss,vs.Viewer=ls,vs.viewerDragDropMixin=us,vs.viewerDynamicObjectMixin=cs,vs.checkForChromeFrame=hs,vs.createCommand=ds,vs.getElement=ms,vs.subscribeAndEvaluate=ps,vs.createTaskProcessorWorker=fs,vs -}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file +!function(){var e,t,r;!function(i){function n(e,t){return C.call(e,t)}function o(e,t){var r,i,n,o,a,s,l,u,c,h,d=t&&t.split("/"),m=_.map,p=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),u=0;u0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||p)&&m){for(r=e.split("/"),u=r.length;u>0;u-=1){if(i=r.slice(0,u).join("/"),d)for(c=d.length;c>0;c-=1)if(n=m[d.slice(0,c).join("/")],n&&(n=n[i])){o=n,a=u;break}if(o)break;!s&&p&&p[i]&&(s=p[i],l=u)}!o&&s&&(o=s,a=l),o&&(r.splice(0,a,o),e=r.join("/"))}return e}function a(e,t){return function(){return m.apply(i,S.call(arguments,0).concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(g,e)){var t=g[e];delete g[e],y[e]=!0,d.apply(i,t)}if(!n(v,e)&&!n(y,e))throw new Error("No "+e);return v[e]}function c(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function h(e){return function(){return _&&_.config&&_.config[e]||{}}}var d,m,p,f,v={},g={},_={},y={},C=Object.prototype.hasOwnProperty,S=[].slice;p=function(e,t){var r,i=c(e),n=i[0];return e=i[1],n&&(n=o(n,t),r=u(n)),n?e=r&&r.normalize?r.normalize(e,s(t)):o(e,t):(e=o(e,t),i=c(e),n=i[0],e=i[1],n&&(r=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:r}},f={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,r,o){var s,c,h,d,m,_,C=[];if(o=o||e,"function"==typeof r){for(t=!t.length&&r.length?["require","exports","module"]:t,m=0;md;d++){var m=e[d],p=m.x,f=m.y,v=m.z;n=Math.min(p,n),l=Math.max(p,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(v,s),c=Math.max(v,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var _=r.maximum;_.x=l,_.y=u,_.z=c;var y=i.add(g,_,r.center);return i.multiplyByScalar(y,.5,y),r},o.clone=function(e,r){return t(e)?t(r)?(r.minimum=i.clone(e.minimum,r.minimum),r.maximum=i.clone(e.maximum,r.maximum),r.center=i.clone(e.center,r.center),r):new o(e.minimum,e.maximum):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&i.equals(e.center,r.center)&&i.equals(e.minimum,r.minimum)&&i.equals(e.maximum,r.maximum)};var a=new i;return o.intersect=function(e,t){a=i.subtract(e.maximum,e.minimum,a);var r=i.multiplyByScalar(a,.5,a),o=r.x*Math.abs(t.x)+r.y*Math.abs(t.y)+r.z*Math.abs(t.z),s=i.dot(e.center,t)+t.w;return s-o>0?n.INSIDE:0>s+o?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersect=function(e){return o.intersect(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),r("Core/BingMapsApi",["./defined"],function(e){"use strict";var t={};t.defaultKey=void 0;var r=!1;return t.getKey=function(i){return e(i)?i:e(t.defaultKey)?t.defaultKey:(r||(console.log("This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API."),r=!0),"Aj1ony_-Typ-KjG9SJWiKSHY23U1KmK7yAmZa9lDmuF2osXWkcZ22VPsqmCt0TCt")},t}),r("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";var n=function(t,r){this.x=e(t,0),this.y=e(r,0)};n.fromElements=function(e,r,i){return t(i)?(i.x=e,i.y=r,i):new n(e,r)},n.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new n(e.x,e.y):void 0},n.fromCartesian3=n.clone,n.fromCartesian4=n.clone,n.packedLength=2,n.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i]=t.y},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.x=r[i++],o.y=r[i],o},n.fromArray=n.unpack,n.getMaximumComponent=function(e){return Math.max(e.x,e.y)},n.getMinimumComponent=function(e){return Math.min(e.x,e.y)},n.getMinimumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.min(e.x,r.x),i.y=Math.min(e.y,r.y),i},n.getMaximumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.max(e.x,r.x),i.y=Math.max(e.y,r.y),i},n.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},n.magnitude=function(e){return Math.sqrt(n.magnitudeSquared(e))};var o=new n;n.distance=function(e,t){return n.subtract(e,t,o),n.magnitude(o)},n.normalize=function(e,r){var i=n.magnitude(e);return t(r)?(r.x=e.x/i,r.y=e.y/i,r):new n(e.x/i,e.y/i)},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.multiplyComponents=function(e,r,i){return t(i)?(i.x=e.x*r.x,i.y=e.y*r.y,i):new n(e.x*r.x,e.y*r.y)},n.add=function(e,r,i){return t(i)?(i.x=e.x+r.x,i.y=e.y+r.y,i):new n(e.x+r.x,e.y+r.y)},n.subtract=function(e,r,i){return t(i)?(i.x=e.x-r.x,i.y=e.y-r.y,i):new n(e.x-r.x,e.y-r.y)},n.multiplyByScalar=function(e,r,i){return t(i)?(i.x=e.x*r,i.y=e.y*r,i):new n(e.x*r,e.y*r)},n.divideByScalar=function(e,r,i){return t(i)?(i.x=e.x/r,i.y=e.y/r,i):new n(e.x/r,e.y/r)},n.negate=function(e,r){return t(r)?(r.x=-e.x,r.y=-e.y,r):new n(-e.x,-e.y)},n.abs=function(e,r){return t(r)?(r.x=Math.abs(e.x),r.y=Math.abs(e.y),r):new n(Math.abs(e.x),Math.abs(e.y))};var a=new n;n.lerp=function(e,t,r,i){return n.multiplyByScalar(t,r,a),i=n.multiplyByScalar(e,1-r,i),n.add(a,i,i)};var s=new n,l=new n;n.angleBetween=function(e,t){return n.normalize(e,s),n.normalize(t,l),Math.acos(n.dot(s,l))};var u=new n;return n.mostOrthogonalAxis=function(e,t){var r=n.normalize(e,u);return n.abs(r,r),t=r.x<=r.y?n.clone(n.UNIT_X,t):n.clone(n.UNIT_Y,t)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},n.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i},n.ZERO=i(new n(0,0)),n.UNIT_X=i(new n(1,0)),n.UNIT_Y=i(new n(0,1)),n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.x+", "+this.y+")"},n}),r("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r>>1^t[1&e];for(;r>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),r("Core/Math",["./defaultValue","./defined","./DeveloperError","../ThirdParty/mersenne-twister"],function(e,t,r,i){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},n.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},n.lerp=function(e,t,r){return(1-r)*e+r*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+t)>e;)e+=i;if(-r>e)return-r;for(;e>r+t;)e-=i;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(t,r,i){return i=e(i,0),Math.abs(t-r)<=i};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var r=o[t-1],i=t;e>=i;i++)o.push(r*i);return o[e]},n.incrementWrap=function(t,r,i){return i=e(i,0),++t,t>r&&(t=i),t},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new i;return n.setRandomNumberSeed=function(e){a=new i(e)},n.nextRandomNumber=function(){return a.random()},n}),r("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(i,0)};return o.fromDegrees=function(r,i,a,s){return r=n.toRadians(e(r,0)),i=n.toRadians(e(i,0)),a=e(a,0),t(s)?(s.longitude=r,s.latitude=i,s.height=a,s):new o(r,i,a)},o.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new o(e.longitude,e.latitude,e.height):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},o.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=i&&Math.abs(e.latitude-r.latitude)<=i&&Math.abs(e.height-r.height)<=i},o.toString=function(e){return"("+e.longitude+", "+e.latitude+", "+e.height+")"},o.ZERO=i(new o(0,0,0)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return o.toString(this)},o}),r("Core/Ellipsoid",["./freezeObject","./defaultValue","./defined","./defineProperties","./DeveloperError","./Math","./Cartesian3","./Cartographic"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,r,i){e=t(e,0),r=t(r,0),i=t(i,0),this._radii=new a(e,r,i),this._radiiSquared=new a(e*e,r*r,i*i),this._radiiToTheFourth=new a(e*e*e*e,r*r*r*r,i*i*i*i),this._oneOverRadii=new a(0===e?0:1/e,0===r?0:1/r,0===i?0:1/i),this._oneOverRadiiSquared=new a(0===e?0:1/(e*e),0===r?0:1/(r*r),0===i?0:1/(i*i)),this._minimumRadius=Math.min(e,r,i),this._maximumRadius=Math.max(e,r,i),this._centerToleranceSquared=o.EPSILON1};i(l.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}}}),l.clone=function(e,t){if(!r(e))return void 0;var i=e._radii;return r(t)?(a.clone(i,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 l(i.x,i.y,i.z)},l.fromCartesian3=function(e){return r(e)?new l(e.x,e.y,e.z):new l},l.WGS84=e(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=e(new l(1,1,1)),l.MOON=e(new l(o.LUNAR_RADIUS,o.LUNAR_RADIUS,o.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.geocentricSurfaceNormal=a.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,n=e.latitude,o=Math.cos(n),s=o*Math.cos(i),l=o*Math.sin(i),u=Math.sin(n);return r(t)||(t=new a),t.x=s,t.y=l,t.z=u,a.normalize(t,t)},l.prototype.geodeticSurfaceNormal=function(e,t){return t=a.multiplyComponents(e,this._oneOverRadiiSquared,t),a.normalize(t,t)};var u=new a,c=new a;l.prototype.cartographicToCartesian=function(e,t){var r=u,i=c;this.geodeticSurfaceNormalCartographic(e,r),a.multiplyComponents(this._radiiSquared,r,i);var n=Math.sqrt(a.dot(r,i));return a.divideByScalar(i,n,i),a.multiplyByScalar(r,e.height,r),a.add(i,r,t)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var h=new a,d=new a,m=new a;l.prototype.cartesianToCartographic=function(e,t){var i=this.scaleToGeodeticSurface(e,d);if(!r(i))return void 0;var n=this.geodeticSurfaceNormal(i,h),l=a.subtract(e,i,m),u=Math.atan2(n.y,n.x),c=Math.asin(n.z),p=o.sign(a.dot(l,e))*a.magnitude(l);return r(t)?(t.longitude=u,t.latitude=c,t.height=p,t):new s(u,c,p)},l.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t};var p=new a,f=new a;return l.prototype.scaleToGeodeticSurface=function(e,t){var i=e.x,n=e.y,s=e.z,l=this._oneOverRadii,u=l.x,c=l.y,h=l.z,d=i*i*u*u,m=n*n*c*c,v=s*s*h*h,g=d+m+v,_=Math.sqrt(1/g),y=a.multiplyByScalar(e,_,p);if(go.EPSILON12);return r(t)?(t.x=i*A,t.y=n*P,t.z=s*D,t):new a(i*A,n*P,s*D)},l.prototype.scaleToGeocentricSurface=function(e,t){var r=e.x,i=e.y,n=e.z,o=this._oneOverRadiiSquared,s=1/Math.sqrt(r*r*o.x+i*i*o.y+n*n*o.z);return a.multiplyByScalar(e,s,t)},l.prototype.transformPositionToScaledSpace=function(e,t){return a.multiplyComponents(e,this._oneOverRadii,t)},l.prototype.transformPositionFromScaledSpace=function(e,t){return a.multiplyComponents(e,this._radii,t)},l.prototype.equals=function(e){return this===e||r(e)&&a.equals(this._radii,e._radii)},l.prototype.toString=function(){return this._radii.toString()},l}),r("Core/GeographicProjection",["./defaultValue","./defined","./defineProperties","./Cartesian3","./Cartographic","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";var a=function(t){this._ellipsoid=e(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return r(a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),a.prototype.project=function(e,r){var n=this._semimajorAxis,o=e.longitude*n,a=e.latitude*n,s=e.height;return t(r)?(r.x=o,r.y=a,r.z=s,r):new i(o,a,s)},a.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,o=e.x*i,a=e.y*i,s=e.z;return t(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new n(o,a,s)},a}),r("Core/BoundingRectangle",["./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartographic","./GeographicProjection","./Intersect"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r,i,n){this.x=e(t,0),this.y=e(r,0),this.width=e(i,0),this.height=e(n,0)};s.fromPoints=function(e,r){if(t(r)||(r=new s),!t(e)||0===e.length)return r.x=0,r.y=0,r.width=0,r.height=0,r;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,l=e[0].y,u=1;i>u;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),l=Math.max(d,l)}return r.x=n,r.y=o,r.width=a-n,r.height=l-o,r};var l=new o,u=new n,c=new n;return s.fromExtent=function(r,n,o){if(t(o)||(o=new s),!t(r))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=e(n,l);var a=n.project(r.getSouthwest(u)),h=n.project(r.getNortheast(c));return i.subtract(h,a,h),o.x=a.x,o.y=a.y,o.width=h.x,o.height=h.y,o},s.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.width=e.width,r.height=e.height,r):new s(e.x,e.y,e.width,e.height):void 0},s.union=function(e,r,i){t(i)||(i=new s);var n=Math.min(e.x,r.x),o=Math.min(e.y,r.y),a=Math.max(e.x+e.width,r.x+r.width),l=Math.max(e.y+e.height,r.y+r.height);return i.x=n,i.y=o,i.width=a-n,i.height=l-o,i},s.expand=function(e,t,r){r=s.clone(e,r);var i=t.x-r.x,n=t.y-r.y;return i>r.width?r.width=i:0>i&&(r.width-=i,r.x=t.x),n>r.height?r.height=n:0>n&&(r.height-=n,r.y=t.y),r},s.intersect=function(e,t){var r=e.x,i=e.y,n=t.x,o=t.y;return r>n+t.width||r+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.union=function(e,t){return s.union(this,e,t)},s.prototype.expand=function(e,t){return s.expand(this,e,t)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),r("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),r("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";var n=function(t,r,i,n){this.x=e(t,0),this.y=e(r,0),this.z=e(i,0),this.w=e(n,0)};n.fromElements=function(e,r,i,o,a){return t(a)?(a.x=e,a.y=r,a.z=i,a.w=o,a):new n(e,r,i,o)},n.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new n(e.x,e.y,e.z,e.w):void 0},n.packedLength=4,n.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i++]=t.y,r[i++]=t.z,r[i]=t.w},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.x=r[i++],o.y=r[i++],o.z=r[i++],o.w=r[i],o},n.fromArray=n.unpack,n.getMaximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},n.getMinimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},n.getMinimumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.min(e.x,r.x),i.y=Math.min(e.y,r.y),i.z=Math.min(e.z,r.z),i.w=Math.min(e.w,r.w),i},n.getMaximumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.max(e.x,r.x),i.y=Math.max(e.y,r.y),i.z=Math.max(e.z,r.z),i.w=Math.max(e.w,r.w),i},n.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},n.magnitude=function(e){return Math.sqrt(n.magnitudeSquared(e))};var o=new n;n.distance=function(e,t){return n.subtract(e,t,o),n.magnitude(o)},n.normalize=function(e,r){var i=n.magnitude(e);return t(r)?(r.x=e.x/i,r.y=e.y/i,r.z=e.z/i,r.w=e.w/i,r):new n(e.x/i,e.y/i,e.z/i,e.w/i)},n.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},n.multiplyComponents=function(e,r,i){return t(i)?(i.x=e.x*r.x,i.y=e.y*r.y,i.z=e.z*r.z,i.w=e.w*r.w,i):new n(e.x*r.x,e.y*r.y,e.z*r.z,e.w*r.w)},n.add=function(e,r,i){return t(i)?(i.x=e.x+r.x,i.y=e.y+r.y,i.z=e.z+r.z,i.w=e.w+r.w,i):new n(e.x+r.x,e.y+r.y,e.z+r.z,e.w+r.w)},n.subtract=function(e,r,i){return t(i)?(i.x=e.x-r.x,i.y=e.y-r.y,i.z=e.z-r.z,i.w=e.w-r.w,i):new n(e.x-r.x,e.y-r.y,e.z-r.z,e.w-r.w)},n.multiplyByScalar=function(e,r,i){return t(i)?(i.x=e.x*r,i.y=e.y*r,i.z=e.z*r,i.w=e.w*r,i):new n(e.x*r,e.y*r,e.z*r,e.w*r)},n.divideByScalar=function(e,r,i){return t(i)?(i.x=e.x/r,i.y=e.y/r,i.z=e.z/r,i.w=e.w/r,i):new n(e.x/r,e.y/r,e.z/r,e.w/r)},n.negate=function(e,r){return t(r)?(r.x=-e.x,r.y=-e.y,r.z=-e.z,r.w=-e.w,r):new n(-e.x,-e.y,-e.z,-e.w)},n.abs=function(e,r){return t(r)?(r.x=Math.abs(e.x),r.y=Math.abs(e.y),r.z=Math.abs(e.z),r.w=Math.abs(e.w),r):new n(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z),Math.abs(e.w))};var a=new n;n.lerp=function(e,t,r,i){return n.multiplyByScalar(t,r,a),i=n.multiplyByScalar(e,1-r,i),n.add(a,i,i)};var s=new n;return n.mostOrthogonalAxis=function(e,t){var r=n.normalize(e,s);return n.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?n.clone(n.UNIT_X,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t):r.y<=r.z?r.y<=r.w?n.clone(n.UNIT_Y,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},n.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i&&Math.abs(e.z-r.z)<=i&&Math.abs(e.w-r.w)<=i},n.ZERO=i(new n(0,0,0,0)),n.UNIT_X=i(new n(1,0,0,0)),n.UNIT_Y=i(new n(0,1,0,0)),n.UNIT_Z=i(new n(0,0,1,0)),n.UNIT_W=i(new n(0,0,0,1)),n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},n}),r("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e){for(var t=0,r=0;9>r;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var i=e[u.getElementIndex(h[r],c[r])];t+=2*i*i}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,i=0,n=1,a=0;3>a;++a){var s=Math.abs(e[u.getElementIndex(h[a],c[a])]);s>i&&(n=a,i=s)}var l=1,d=0,m=c[n],p=h[n];if(Math.abs(e[u.getElementIndex(p,m)])>r){var f,v=e[u.getElementIndex(p,p)],g=e[u.getElementIndex(m,m)],_=e[u.getElementIndex(p,m)],y=(v-g)/2/_;f=0>y?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),l=1/Math.sqrt(1+f*f),d=f*l}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(m,m)]=t[u.getElementIndex(p,p)]=l,t[u.getElementIndex(p,m)]=d,t[u.getElementIndex(m,p)]=-d,t}var u=function(e,r,i,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(r,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(i,0),this[7]=t(a,0),this[8]=t(u,0)};u.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},u.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new u),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n[4]=e[i+4],n[5]=e[i+5],n[6]=e[i+6],n[7]=e[i+7],n[8]=e[i+8],n[9]=e[i+9],n},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var i=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,l=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,m=e.w*e.w,p=i-s-h+m,f=2*(n-d),v=2*(o+c),g=2*(n+d),_=-i+s-h+m,y=2*(l-a),C=2*(o-c),S=2*(l+a),w=-i-s+h+m;return r(t)?(t[0]=p,t[1]=g,t[2]=C,t[3]=f,t[4]=_,t[5]=S,t[6]=v,t[7]=y,t[8]=w,t):new u(p,f,v,g,_,y,C,S,w)},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new u(e,0,0,0,e,0,0,0,e)},u.fromRotationX=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=n,t[6]=0,t[7]=-n,t[8]=i,t):new u(1,0,0,0,i,-n,0,n,i)},u.fromRotationY=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=i,t):new u(i,0,n,0,1,0,-n,0,i)},u.fromRotationZ=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(i,-n,0,n,i,0,0,0,1)},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(t,i,n){var o=3*i,a=t[o],s=t[o+1],l=t[o+2];return r(n)?(n.x=a,n.y=s,n.z=l,n):new e(a,s,l)},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},u.getRow=function(t,i,n){var o=t[i],a=t[i+3],s=t[i+6];return r(n)?(n.x=o,n.y=a,n.z=s,n):new e(o,a,s)},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i},u.multiply=function(e,t,i){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],l=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],h=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],m=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r(i)?(i[0]=n,i[1]=o,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i[6]=h,i[7]=d,i[8]=m,i):new u(n,s,h,o,l,d,a,c,m)},u.multiplyByVector=function(t,i,n){var o=i.x,a=i.y,s=i.z,l=t[0]*o+t[3]*a+t[6]*s,u=t[1]*o+t[4]*a+t[7]*s,c=t[2]*o+t[5]*a+t[8]*s; +return r(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByScalar=function(e,t,i){return r(i)?(i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i):new u(e[0]*t,e[3]*t,e[6]*t,e[1]*t,e[4]*t,e[7]*t,e[2]*t,e[5]*t,e[8]*t)},u.negate=function(e,t){return r(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t):new u(-e[0],-e[3],-e[6],-e[1],-e[4],-e[7],-e[2],-e[5],-e[8])},u.transpose=function(e,t){var i=e[0],n=e[3],o=e[6],a=e[1],s=e[4],l=e[7],c=e[2],h=e[5],d=e[8];return r(t)?(t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=h,t[8]=d,t):new u(i,a,c,n,s,h,o,l,d)};var c=[1,0,0],h=[2,2,1],d=new u,m=new u;return u.getEigenDecomposition=function(e,t){var i=o.EPSILON20,n=10,c=0,h=0;r(t)||(t={});for(var p=t.unitary=u.clone(u.IDENTITY,t.unitary),f=t.diagonal=u.clone(e,t.diagonal),v=i*a(f);n>h&&s(f)>v;)l(f,d),u.transpose(d,m),u.multiply(f,d,f),u.multiply(m,f,f),u.multiply(p,d,p),++c>2&&(++h,c=0);return t},u.abs=function(e,t){return r(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t):new u(Math.abs(e[0]),Math.abs(e[3]),Math.abs(e[6]),Math.abs(e[1]),Math.abs(e[4]),Math.abs(e[7]),Math.abs(e[2]),Math.abs(e[5]),Math.abs(e[8]))},u.determinant=function(e){var t=e[0],r=e[3],i=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*i-r*u)+s*(r*a-o*i)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],s=e[3],l=e[4],c=e[5],h=e[6],d=e[7],m=e[8],p=u.determinant(e);if(Math.abs(p)<=o.EPSILON15)throw new i("matrix is not invertible");var f=new u(l*m-d*c,h*c-s*m,s*d-h*l,d*a-n*m,r*m-h*a,h*n-r*d,n*c-l*a,s*a-r*c,r*l-s*n),v=1/p;return u.multiplyByScalar(f,v,t)},u.equals=function(e,t){return e===t||r(e)&&r(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]},u.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},u.IDENTITY=n(new u(1,0,0,0,1,0,0,0,1)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},u}),r("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),r("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(e,t,i,n,o,a,s,l,u,c,h,d,m,p,f,v){this[0]=r(e,0),this[1]=r(o,0),this[2]=r(u,0),this[3]=r(m,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(c,0),this[7]=r(p,0),this[8]=r(i,0),this[9]=r(s,0),this[10]=r(h,0),this[11]=r(f,0),this[12]=r(n,0),this[13]=r(l,0),this[14]=r(d,0),this[15]=r(v,0)};u.clone=function(e,t){return i(e)?i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},u.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new u),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n[9]=e[t+9],n[10]=e[t+10],n[11]=e[t+11],n[12]=e[t+12],n[13]=e[t+13],n[14]=e[t+14],n[15]=e[t+15],n},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},u.fromRotationTranslation=function(e,t,r){return i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=0,r[4]=e[3],r[5]=e[4],r[6]=e[5],r[7]=0,r[8]=e[6],r[9]=e[7],r[10]=e[8],r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r):new u(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},new s,u.fromTranslationQuaternionRotationScale=function(e,t,r,n){i(n)||(n=new u);var o=r.x,a=r.y,s=r.z,l=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,m=t.y*t.y,p=t.y*t.z,f=t.y*t.w,v=t.z*t.z,g=t.z*t.w,_=t.w*t.w,y=l-m-v+_,C=2*(c-g),S=2*(h+f),w=2*(c+g),E=-l+m-v+_,x=2*(p-d),b=2*(h-f),T=2*(p+d),A=-l-m+v+_;return n[0]=y*o,n[1]=w*o,n[2]=b*o,n[3]=0,n[4]=C*a,n[5]=E*a,n[6]=T*a,n[7]=0,n[8]=S*s,n[9]=x*s,n[10]=A*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},u.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,d=new e;u.fromCamera=function(t,r){var n=t.eye,o=t.target,a=t.up;e.normalize(e.subtract(o,n,c),c),e.normalize(e.cross(c,a,h),h),e.normalize(e.cross(h,c,d),d);var s=h.x,l=h.y,m=h.z,p=c.x,f=c.y,v=c.z,g=d.x,_=d.y,y=d.z,C=n.x,S=n.y,w=n.z,E=s*-C+l*-S+m*-w,x=g*-C+_*-S+y*-w,b=p*C+f*S+v*w;return i(r)?(r[0]=s,r[1]=g,r[2]=-p,r[3]=0,r[4]=l,r[5]=_,r[6]=-f,r[7]=0,r[8]=m,r[9]=y,r[10]=-v,r[11]=0,r[12]=E,r[13]=x,r[14]=b,r[15]=1,r):new u(s,l,m,E,g,_,y,x,-p,-f,-v,b,0,0,0,1)},u.computePerspectiveFieldOfView=function(e,t,r,n,o){var a=Math.tan(.5*e),s=1/a,l=s/t,c=(n+r)/(r-n),h=2*n*r/(r-n);return i(o)?(o[0]=l,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o):new u(l,0,0,0,0,s,0,0,0,0,c,h,0,0,-1,0)},u.computeOrthographicOffCenter=function(e,t,r,n,o,a,s){var l=1/(t-e),c=1/(n-r),h=1/(a-o),d=-(t+e)*l,m=-(n+r)*c,p=-(a+o)*h;return l*=2,c*=2,h*=-2,i(s)?(s[0]=l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=h,s[11]=0,s[12]=d,s[13]=m,s[14]=p,s[15]=1,s):new u(l,0,0,d,0,c,0,m,0,0,h,p,0,0,0,1)},u.computePerspectiveOffCenter=function(e,t,r,n,o,a,s){var l=2*o/(t-e),c=2*o/(n-r),h=(t+e)/(t-e),d=(n+r)/(n-r),m=-(a+o)/(a-o),p=-1,f=-2*a*o/(a-o);return i(s)?(s[0]=l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=h,s[9]=d,s[10]=m,s[11]=p,s[12]=0,s[13]=0,s[14]=f,s[15]=0,s):new u(l,0,h,0,0,c,d,0,0,0,m,f,0,0,p,0)},u.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,a){var s=2*o/(t-e),l=2*o/(n-r),c=(t+e)/(t-e),h=(n+r)/(n-r),d=-1,m=-1,p=-2*o;return i(a)?(a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=c,a[9]=h,a[10]=d,a[11]=m,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a):new u(s,0,c,0,0,l,h,0,0,0,d,p,0,0,m,0)},u.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),s=r(e.y,0),l=r(e.width,0),c=r(e.height,0);t=r(t,0),n=r(n,1);var h=.5*l,d=.5*c,m=.5*(n-t),p=h,f=d,v=m,g=a+h,_=s+d,y=t+m,C=1;return i(o)?(o[0]=p,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=f,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=v,o[11]=0,o[12]=g,o[13]=_,o[14]=y,o[15]=C,o):new u(p,0,0,g,0,f,0,_,0,0,v,y,0,0,0,C)},u.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},u.getElementIndex=function(e,t){return 4*e+t},u.getColumn=function(e,r,n){var o=4*r,a=e[o],s=e[o+1],l=e[o+2],u=e[o+3];return i(n)?(n.x=a,n.y=s,n.z=l,n.w=u,n):new t(a,s,l,u)},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=4*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i[n+3]=r.w,i},u.getRow=function(e,r,n){var o=e[r],a=e[r+4],s=e[r+8],l=e[r+12];return i(n)?(n.x=o,n.y=a,n.z=s,n.w=l,n):new t(o,a,s,l)},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+4]=r.y,i[t+8]=r.z,i[t+12]=r.w,i},u.multiply=function(e,t,r){var n=e[0],o=e[1],a=e[2],s=e[3],l=e[4],c=e[5],h=e[6],d=e[7],m=e[8],p=e[9],f=e[10],v=e[11],g=e[12],_=e[13],y=e[14],C=e[15],S=t[0],w=t[1],E=t[2],x=t[3],b=t[4],T=t[5],A=t[6],P=t[7],D=t[8],M=t[9],I=t[10],O=t[11],R=t[12],L=t[13],N=t[14],B=t[15],z=n*S+l*w+m*E+g*x,F=o*S+c*w+p*E+_*x,V=a*S+h*w+f*E+y*x,k=s*S+d*w+v*E+C*x,U=n*b+l*T+m*A+g*P,W=o*b+c*T+p*A+_*P,G=a*b+h*T+f*A+y*P,H=s*b+d*T+v*A+C*P,j=n*D+l*M+m*I+g*O,q=o*D+c*M+p*I+_*O,Y=a*D+h*M+f*I+y*O,X=s*D+d*M+v*I+C*O,Z=n*R+l*L+m*N+g*B,J=o*R+c*L+p*N+_*B,Q=a*R+h*L+f*N+y*B,K=s*R+d*L+v*N+C*B;return i(r)?(r[0]=z,r[1]=F,r[2]=V,r[3]=k,r[4]=U,r[5]=W,r[6]=G,r[7]=H,r[8]=j,r[9]=q,r[10]=Y,r[11]=X,r[12]=Z,r[13]=J,r[14]=Q,r[15]=K,r):new u(z,U,j,Z,F,W,q,J,V,G,Y,Q,k,H,X,K)},u.multiplyTransformation=function(e,t,r){var n=e[0],o=e[1],a=e[2],s=e[4],l=e[5],c=e[6],h=e[8],d=e[9],m=e[10],p=e[12],f=e[13],v=e[14],g=t[0],_=t[1],y=t[2],C=t[4],S=t[5],w=t[6],E=t[8],x=t[9],b=t[10],T=t[12],A=t[13],P=t[14],D=n*g+s*_+h*y,M=o*g+l*_+d*y,I=a*g+c*_+m*y,O=n*C+s*S+h*w,R=o*C+l*S+d*w,L=a*C+c*S+m*w,N=n*E+s*x+h*b,B=o*E+l*x+d*b,z=a*E+c*x+m*b,F=n*T+s*A+h*P+p,V=o*T+l*A+d*P+f,k=a*T+c*A+m*P+v;return i(r)?(r[0]=D,r[1]=M,r[2]=I,r[3]=0,r[4]=O,r[5]=R,r[6]=L,r[7]=0,r[8]=N,r[9]=B,r[10]=z,r[11]=0,r[12]=F,r[13]=V,r[14]=k,r[15]=1,r):new u(D,O,N,F,M,R,B,V,I,L,z,k,0,0,0,1)},u.multiplyByTranslation=function(e,t,r){var n=t.x,o=t.y,a=t.z,s=n*e[0]+o*e[4]+a*e[8]+e[12],l=n*e[1]+o*e[5]+a*e[9]+e[13],c=n*e[2]+o*e[6]+a*e[10]+e[14];return i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=s,r[13]=l,r[14]=c,r[15]=e[15],r):new u(e[0],e[4],e[8],s,e[1],e[5],e[9],l,e[2],e[6],e[10],c,e[3],e[7],e[11],e[15])};var m=new e;return u.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,u.multiplyByScale(e,m,r)},u.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,a=t.z;return 1===n&&1===o&&1===a?u.clone(e,r):i(r)?(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r):new u(n*e[0],o*e[4],a*e[8],e[12],n*e[1],o*e[5],a*e[9],e[13],n*e[2],o*e[6],a*e[10],e[14],0,0,0,1)},u.multiplyByVector=function(e,r,n){var o=r.x,a=r.y,s=r.z,l=r.w,u=e[0]*o+e[4]*a+e[8]*s+e[12]*l,c=e[1]*o+e[5]*a+e[9]*s+e[13]*l,h=e[2]*o+e[6]*a+e[10]*s+e[14]*l,d=e[3]*o+e[7]*a+e[11]*s+e[15]*l;return i(n)?(n.x=u,n.y=c,n.z=h,n.w=d,n):new t(u,c,h,d)},u.multiplyByPointAsVector=function(t,r,n){var o=r.x,a=r.y,s=r.z,l=t[0]*o+t[4]*a+t[8]*s,u=t[1]*o+t[5]*a+t[9]*s,c=t[2]*o+t[6]*a+t[10]*s;return i(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByPoint=function(t,r,n){var o=r.x,a=r.y,s=r.z,l=t[0]*o+t[4]*a+t[8]*s+t[12],u=t[1]*o+t[5]*a+t[9]*s+t[13],c=t[2]*o+t[6]*a+t[10]*s+t[14];return i(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByScalar=function(e,t,r){return i(r)?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r):new u(e[0]*t,e[4]*t,e[8]*t,e[12]*t,e[1]*t,e[5]*t,e[9]*t,e[13]*t,e[2]*t,e[6]*t,e[10]*t,e[14]*t,e[3]*t,e[7]*t,e[11]*t,e[15]*t)},u.negate=function(e,t){return i(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t):new u(-e[0],-e[4],-e[8],-e[12],-e[1],-e[5],-e[9],-e[13],-e[2],-e[6],-e[10],-e[14],-e[3],-e[7],-e[11],-e[15])},u.transpose=function(e,t){if(!i(t))return new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);var r=e[1],n=e[2],o=e[3],a=e[6],s=e[7],l=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=l,t[15]=e[15],t},u.abs=function(e,t){return i(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t):new u(Math.abs(e[0]),Math.abs(e[4]),Math.abs(e[8]),Math.abs(e[12]),Math.abs(e[1]),Math.abs(e[5]),Math.abs(e[9]),Math.abs(e[13]),Math.abs(e[2]),Math.abs(e[6]),Math.abs(e[10]),Math.abs(e[14]),Math.abs(e[3]),Math.abs(e[7]),Math.abs(e[11]),Math.abs(e[15]))},u.equals=function(e,t){return e===t||i(e)&&i(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]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},u.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(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&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},u.getTranslation=function(t,r){return i(r)?(r.x=t[12],r.y=t[13],r.z=t[14],r):new e(t[12],t[13],t[14])},u.getRotation=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t):new s(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10])},u.inverse=function(e,t){var r=e[0],n=e[4],o=e[8],s=e[12],c=e[1],h=e[5],d=e[9],m=e[13],p=e[2],f=e[6],v=e[10],g=e[14],_=e[3],y=e[7],C=e[11],S=e[15],w=v*S,E=g*C,x=f*S,b=g*y,T=f*C,A=v*y,P=p*S,D=g*_,M=p*C,I=v*_,O=p*y,R=f*_,L=w*h+b*d+T*m-(E*h+x*d+A*m),N=E*c+P*d+I*m-(w*c+D*d+M*m),B=x*c+D*h+O*m-(b*c+P*h+R*m),z=A*c+M*h+R*d-(T*c+I*h+O*d),F=E*n+x*o+A*s-(w*n+b*o+T*s),V=w*r+D*o+M*s-(E*r+P*o+I*s),k=b*r+P*n+R*s-(x*r+D*n+O*s),U=T*r+I*n+O*o-(A*r+M*n+R*o);w=o*m,E=s*d,x=n*m,b=s*h,T=n*d,A=o*h,P=r*m,D=s*c,M=r*d,I=o*c,O=r*h,R=n*c;var W=w*y+b*C+T*S-(E*y+x*C+A*S),G=E*_+P*C+I*S-(w*_+D*C+M*S),H=x*_+D*y+O*S-(b*_+P*y+R*S),j=A*_+M*y+R*C-(T*_+I*y+O*C),q=x*v+A*g+E*f-(T*g+w*f+b*v),Y=M*g+w*p+D*v-(P*v+I*g+E*p),X=P*f+R*g+b*p-(O*g+x*p+D*f),Z=O*v+T*p+I*f-(M*f+R*v+A*p),J=r*L+n*N+o*B+s*z;if(Math.abs(J)b;b++){e.clone(t[b],n);var T=n.x,A=n.y,P=n.z;Tl.x&&e.clone(n,l),Au.y&&e.clone(n,u),PE.z&&e.clone(n,E)}var D=e.magnitudeSquared(e.subtract(l,o,_)),M=e.magnitudeSquared(e.subtract(u,a,_)),I=e.magnitudeSquared(e.subtract(E,s,_)),O=o,R=l,L=D;M>L&&(L=M,O=a,R=u),I>L&&(L=I,O=s,R=E);var N=y;N.x=.5*(O.x+R.x),N.y=.5*(O.y+R.y),N.z=.5*(O.z+R.z);var B=e.magnitudeSquared(e.subtract(R,N,_)),z=Math.sqrt(B),F=C;F.x=o.x,F.y=a.y,F.z=s.z;var V=S;V.x=l.x,V.y=u.y,V.z=E.z;var k=e.multiplyByScalar(e.add(F,V,_),.5,w),U=0;for(b=0;x>b;b++){e.clone(t[b],n);var W=e.magnitude(e.subtract(n,k,_));W>U&&(U=W);var G=e.magnitudeSquared(e.subtract(n,N,_));if(G>B){var H=Math.sqrt(G);z=.5*(z+H),B=z*z;var j=H-z;N.x=(z*N.x+j*n.x)/H,N.y=(z*N.y+j*n.y)/H,N.z=(z*N.z+j*n.z)/H}}return U>z?(e.clone(N,r.center),r.radius=z):(e.clone(k,r.center),r.radius=U),r};var E=new a,x=new e,b=new e,T=new t,A=new t;c.fromExtent2D=function(e,t,r){return c.fromExtentWithHeights2D(e,t,0,0,r)},c.fromExtentWithHeights2D=function(t,n,o,a,s){if(i(s)||(s=new c),!i(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=r(n,E),t.getSouthwest(T),T.height=o,t.getNortheast(A),A.height=a;var l=n.project(T,x),u=n.project(A,b),h=u.x-l.x,d=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(h*h+d*d+m*m);var p=s.center;return p.x=l.x+.5*h,p.y=l.y+.5*d,p.z=l.z+.5*m,s};var P=[];c.fromExtent3D=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0);var s;return i(e)&&(s=e.subsample(t,n,P)),c.fromPoints(s,a)},c.fromVertices=function(t,n,o,a){if(i(a)||(a=new c),!i(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;n=r(n,e.ZERO),o=r(o,3);var s=g;s.x=t[0]+n.x,s.y=t[1]+n.y,s.z=t[2]+n.z;for(var l=e.clone(s,h),u=e.clone(s,d),E=e.clone(s,m),x=e.clone(s,p),b=e.clone(s,f),T=e.clone(s,v),A=t.length,P=0;A>P;P+=o){var D=t[P]+n.x,M=t[P+1]+n.y,I=t[P+2]+n.z;s.x=D,s.y=M,s.z=I,Dx.x&&e.clone(s,x),Mb.y&&e.clone(s,b),IT.z&&e.clone(s,T)}var O=e.magnitudeSquared(e.subtract(x,l,_)),R=e.magnitudeSquared(e.subtract(b,u,_)),L=e.magnitudeSquared(e.subtract(T,E,_)),N=l,B=x,z=O;R>z&&(z=R,N=u,B=b),L>z&&(z=L,N=E,B=T);var F=y;F.x=.5*(N.x+B.x),F.y=.5*(N.y+B.y),F.z=.5*(N.z+B.z);var V=e.magnitudeSquared(e.subtract(B,F,_)),k=Math.sqrt(V),U=C;U.x=l.x,U.y=u.y,U.z=E.z;var W=S;W.x=x.x,W.y=b.y,W.z=T.z;var G=e.multiplyByScalar(e.add(U,W,_),.5,w),H=0;for(P=0;A>P;P+=o){s.x=t[P]+n.x,s.y=t[P+1]+n.y,s.z=t[P+2]+n.z;var j=e.magnitude(e.subtract(s,G,_));j>H&&(H=j);var q=e.magnitudeSquared(e.subtract(s,F,_));if(q>V){var Y=Math.sqrt(q);k=.5*(k+Y),V=k*k;var X=Y-k;F.x=(k*F.x+X*s.x)/Y,F.y=(k*F.y+X*s.y)/Y,F.z=(k*F.z+X*s.z)/Y}}return H>k?(e.clone(F,a.center),a.radius=k):(e.clone(G,a.center),a.radius=H),a},c.fromCornerPoints=function(t,r,n){i(n)||(n=new c);var o=n.center;return e.add(t,r,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,r),n},c.fromEllipsoid=function(t,r){return i(r)||(r=new c),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},c.clone=function(t,r){return i(t)?i(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new c(t.center,t.radius):void 0};var D=new e,M=new e;c.union=function(t,r,n){i(n)||(n=new c);var o=t.center,a=r.center;e.add(o,a,M);var s=e.multiplyByScalar(M,.5,M),l=e.magnitude(e.subtract(o,s,D))+t.radius,u=e.magnitude(e.subtract(a,s,D))+r.radius;return n.radius=Math.max(l,u),e.clone(s,n.center),n};var I=new e;c.expand=function(t,r,i){i=c.clone(t,i);var n=e.magnitude(e.subtract(r,i.center,I));return n>i.radius&&(i.radius=n),i},c.intersect=function(t,r){var i=t.center,n=t.radius,o=e.dot(r,i)+r.w;return-n>o?s.OUTSIDE:n>o?s.INTERSECTING:s.INSIDE};var O=new e;c.transform=function(t,r,n){return i(n)||(n=new c),n.center=u.multiplyByPoint(r,t.center,n.center),n.radius=Math.max(e.magnitude(u.getColumn(r,0,O)),e.magnitude(u.getColumn(r,1,O)),e.magnitude(u.getColumn(r,2,O)))*t.radius,n},c.transformWithoutScale=function(e,t,r){return i(r)||(r=new c),r.center=u.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var R=new e;c.getPlaneDistances=function(t,r,n,o){i(o)||(o=new l);var a=e.subtract(t.center,r,R),s=e.multiplyByScalar(n,e.dot(n,a),R),u=e.magnitude(s);return o.start=u-t.radius,o.stop=u+t.radius,o};for(var L=new e,N=new e,B=new e,z=new e,F=new e,V=new t,k=new Array(8),U=0;8>U;++U)k[U]=new e;var W=new a;return c.projectTo2D=function(t,i,n){i=r(i,W);var o=i.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,L),u=e.cross(e.UNIT_Z,l,N);e.normalize(u,u);var h=e.cross(l,u,B);e.normalize(h,h),e.multiplyByScalar(l,s,l),e.multiplyByScalar(h,s,h),e.multiplyByScalar(u,s,u);var d=e.negate(h,F),m=e.negate(u,z),p=k,f=p[0];e.add(l,h,f),e.add(f,u,f),f=p[1],e.add(l,h,f),e.add(f,m,f),f=p[2],e.add(l,d,f),e.add(f,m,f),f=p[3],e.add(l,d,f),e.add(f,u,f),e.negate(l,l),f=p[4],e.add(l,h,f),e.add(f,u,f),f=p[5],e.add(l,h,f),e.add(f,m,f),f=p[6],e.add(l,d,f),e.add(f,m,f),f=p[7],e.add(l,d,f),e.add(f,u,f);for(var v=p.length,g=0;v>g;++g){var _=p[g];e.add(a,_,_);var y=o.cartesianToCartographic(_,V);i.project(y,_)}n=c.fromPoints(p,n),a=n.center;var C=a.x,S=a.y,w=a.z;return a.x=w,a.y=C,a.z=S,n},c.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.union=function(e,t){return c.union(this,e,t)},c.prototype.expand=function(e,t){return c.expand(this,e,t)},c.prototype.intersect=function(e){return c.intersect(this,e)},c.prototype.getPlaneDistances=function(e,t,r){return c.getPlaneDistances(this,e,t,r)},c.prototype.projectTo2D=function(e,t){return c.projectTo2D(this,e,t)},c.prototype.equals=function(e){return c.equals(this,e)},c}),r("Core/Fullscreen",["./defined"],function(e){"use strict";var t,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return i.supportsFullscreen=function(){if(e(t))return t;t=!1;var i=document.body;if("function"==typeof i.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",t=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;s>a;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof i[n]?(r.requestFullscreen=n,t=!0):(n=l+"RequestFullScreen","function"==typeof i[n]&&(r.requestFullscreen=n,t=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",e(document[n])?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?r.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(r.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return t},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[r.requestFullscreen]()},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i.isFullscreenEnabled=function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0},i.getFullscreenElement=function(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0},i.isFullscreen=function(){return i.supportsFullscreen()?null!==i.getFullscreenElement():void 0},i.getFullscreenChangeEventName=function(){return i.supportsFullscreen()?r.fullscreenchange:void 0},i.getFullscreenErrorEventName=function(){return i.supportsFullscreen()?r.fullscreenerror:void 0},i}),r("Core/FeatureDetection",["./defined","./Fullscreen"],function(e,t){"use strict";function r(e){for(var t=e.split("."),r=0,i=t.length;i>r;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!e(h)){var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null===t?h=!1:(h=!0,d=r(t[1]))}return h}function n(){return i()&&d}function o(){if(!e(m))if(i()||!/ Safari\/[\.0-9]+/.test(navigator.userAgent))m=!1;else{var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null===t?m=!1:(m=!0,p=r(t[1]))}return m}function a(){return o()&&p}function s(){if(!e(f)){var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null===t?f=!1:(f=!0,v=r(t[1]),v.isNightly=!!t[2])}return f}function l(){return s()&&v}function u(){if(!e(g)){var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,_=r(t[1]))):"Netscape"===navigator.appName?(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,_=r(t[1]))):g=!1}return g}function c(){return u()&&_}var h,d,m,p,f,v,g,_,y={isChrome:i,chromeVersion:n,isSafari:o,safariVersion:a,isWebkit:s,webkitVersion:l,isInternetExplorer:u,internetExplorerVersion:c};y.supportsFullscreen=function(){return t.supportsFullscreen()},y.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer};var C;return y.supportsTransferringArrayBuffers=function(){if(!e(C)){if(!y.supportsTypedArrays())return C=!1,void 0;var t=new ArrayBuffer(1);try{postMessage({value:t},[t]),C=!0}catch(r){C=!1}}return C},y}),r("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./Enumeration"],function(e,t,r,i,n){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:new n(5120,"BYTE",{sizeInBytes:Int8Array.BYTES_PER_ELEMENT}),UNSIGNED_BYTE:new n(5121,"UNSIGNED_BYTE",{sizeInBytes:Uint8Array.BYTES_PER_ELEMENT}),SHORT:new n(5122,"SHORT",{sizeInBytes:Int16Array.BYTES_PER_ELEMENT}),UNSIGNED_SHORT:new n(5123,"UNSIGNED_SHORT",{sizeInBytes:Uint16Array.BYTES_PER_ELEMENT}),FLOAT:new n(5126,"FLOAT",{sizeInBytes:Float32Array.BYTES_PER_ELEMENT}),DOUBLE:new n(5130,"DOUBLE",{sizeInBytes:Float64Array.BYTES_PER_ELEMENT})};return o.validate=function(e){return t(e)&&t(e.value)&&(e.value===o.BYTE.value||e.value===o.UNSIGNED_BYTE.value||e.value===o.SHORT.value||e.value===o.UNSIGNED_SHORT.value||e.value===o.FLOAT.value||e.value===o.DOUBLE.value)},o.createTypedArray=function(e,t){switch(e.value){case o.BYTE.value:return new Int8Array(t);case o.UNSIGNED_BYTE.value:return new Uint8Array(t);case o.SHORT.value:return new Int16Array(t);case o.UNSIGNED_SHORT.value:return new Uint16Array(t);case o.FLOAT.value:return new Float32Array(t);case o.DOUBLE.value:return new Float64Array(t);default:throw new r("componentDatatype is not a valid enumeration value.")}},o.createArrayBufferView=function(t,i,n,a){switch(n=e(n,0),a=e(a,(i.byteLength-n)/t.sizeInBytes),t.value){case o.BYTE.value:return new Int8Array(i,n,a);case o.UNSIGNED_BYTE.value:return new Uint8Array(i,n,a);case o.SHORT.value:return new Int16Array(i,n,a);case o.UNSIGNED_SHORT.value:return new Uint16Array(i,n,a);case o.FLOAT.value:return new Float32Array(i,n,a);case o.DOUBLE.value:return new Float64Array(i,n,a);default:throw new r("componentDatatype is not a valid enumeration value.")}},o}),r("Core/PrimitiveType",[],function(){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return e}),r("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),r("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color};return t}),r("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1)};return r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),r("Core/Geometry",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType,this.boundingSphere=t.boundingSphere};return i.computeNumberOfVertices=function(e){var i=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(i!==a&&-1!==i)throw new r("All attribute lists must have the same number of attributes.");i=a}return i},i}),r("Core/BoxGeometry",["./defined","./DeveloperError","./Cartesian3","./ComponentDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./GeometryAttribute","./GeometryAttributes","./VertexFormat","./Geometry"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=new r,d=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.minimumCorner,i=e.maximumCorner,n=o(e.vertexFormat,u.DEFAULT);this._minimumCorner=r.clone(t),this._maximumCorner=r.clone(i),this._vertexFormat=n,this._workerName="createBoxGeometry"};return d.fromDimensions=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.dimensions,i=r.multiplyByScalar(t,.5),n=r.negate(i),a=i,s={minimumCorner:n,maximumCorner:a,vertexFormat:e.vertexFormat};return new d(s)},d.createGeometry=function(e){var t,o,u=e._minimumCorner,d=e._maximumCorner,m=e._vertexFormat,p=new l;if(m.position&&(m.st||m.normal||m.binormal||m.tangent)){if(m.position&&(o=new Float64Array(72),o[0]=u.x,o[1]=u.y,o[2]=d.z,o[3]=d.x,o[4]=u.y,o[5]=d.z,o[6]=d.x,o[7]=d.y,o[8]=d.z,o[9]=u.x,o[10]=d.y,o[11]=d.z,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=d.x,o[16]=u.y,o[17]=u.z,o[18]=d.x,o[19]=d.y,o[20]=u.z,o[21]=u.x,o[22]=d.y,o[23]=u.z,o[24]=d.x,o[25]=u.y,o[26]=u.z,o[27]=d.x,o[28]=d.y,o[29]=u.z,o[30]=d.x,o[31]=d.y,o[32]=d.z,o[33]=d.x,o[34]=u.y,o[35]=d.z,o[36]=u.x,o[37]=u.y,o[38]=u.z,o[39]=u.x,o[40]=d.y,o[41]=u.z,o[42]=u.x,o[43]=d.y,o[44]=d.z,o[45]=u.x,o[46]=u.y,o[47]=d.z,o[48]=u.x,o[49]=d.y,o[50]=u.z,o[51]=d.x,o[52]=d.y,o[53]=u.z,o[54]=d.x,o[55]=d.y,o[56]=d.z,o[57]=u.x,o[58]=d.y,o[59]=d.z,o[60]=u.x,o[61]=u.y,o[62]=u.z,o[63]=d.x,o[64]=u.y,o[65]=u.z,o[66]=d.x,o[67]=u.y,o[68]=d.z,o[69]=u.x,o[70]=u.y,o[71]=d.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o})),m.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,p.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f}) +}if(m.st){var v=new Float32Array(48);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=1,v[5]=1,v[6]=0,v[7]=1,v[8]=1,v[9]=0,v[10]=0,v[11]=0,v[12]=0,v[13]=1,v[14]=1,v[15]=1,v[16]=0,v[17]=0,v[18]=1,v[19]=0,v[20]=1,v[21]=1,v[22]=0,v[23]=1,v[24]=1,v[25]=0,v[26]=0,v[27]=0,v[28]=0,v[29]=1,v[30]=1,v[31]=1,v[32]=1,v[33]=0,v[34]=0,v[35]=0,v[36]=0,v[37]=1,v[38]=1,v[39]=1,v[40]=0,v[41]=0,v[42]=1,v[43]=0,v[44]=1,v[45]=1,v[46]=0,v[47]=1,p.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:v})}if(m.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,p.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(m.binormal){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,p.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}t=new Uint16Array(36),t[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3,t[6]=6,t[7]=5,t[8]=4,t[9]=7,t[10]=6,t[11]=4,t[12]=8,t[13]=9,t[14]=10,t[15]=8,t[16]=10,t[17]=11,t[18]=14,t[19]=13,t[20]=12,t[21]=15,t[22]=14,t[23]=12,t[24]=18,t[25]=17,t[26]=16,t[27]=19,t[28]=18,t[29]=16,t[30]=20,t[31]=21,t[32]=22,t[33]=20,t[34]=22,t[35]=23}else o=new Float64Array(24),o[0]=u.x,o[1]=u.y,o[2]=u.z,o[3]=d.x,o[4]=u.y,o[5]=u.z,o[6]=d.x,o[7]=d.y,o[8]=u.z,o[9]=u.x,o[10]=d.y,o[11]=u.z,o[12]=u.x,o[13]=u.y,o[14]=d.z,o[15]=d.x,o[16]=u.y,o[17]=d.z,o[18]=d.x,o[19]=d.y,o[20]=d.z,o[21]=u.x,o[22]=d.y,o[23]=d.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),t=new Uint16Array(36),t[0]=4,t[1]=5,t[2]=6,t[3]=4,t[4]=6,t[5]=7,t[6]=1,t[7]=0,t[8]=3,t[9]=1,t[10]=3,t[11]=2,t[12]=1,t[13]=6,t[14]=5,t[15]=1,t[16]=2,t[17]=6,t[18]=2,t[19]=3,t[20]=7,t[21]=2,t[22]=7,t[23]=6,t[24]=3,t[25]=0,t[26]=4,t[27]=3,t[28]=4,t[29]=7,t[30]=0,t[31]=1,t[32]=5,t[33]=0,t[34]=5,t[35]=4;var y=r.subtract(d,u,h),C=.5*r.magnitude(y);return new c({attributes:p,indices:t,primitiveType:n.TRIANGLES,boundingSphere:new a(r.ZERO,C)})},d}),r("Core/BoxOutlineGeometry",["./defined","./DeveloperError","./Cartesian3","./ComponentDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=new r,h=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.minimumCorner,i=e.maximumCorner;this._min=r.clone(t),this._max=r.clone(i),this._workerName="createBoxOutlineGeometry"};return h.fromDimensions=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.dimensions,i=r.multiplyByScalar(t,.5),n=r.negate(i),a=i,s={minimumCorner:n,maximumCorner:a};return new h(s)},h.createGeometry=function(e){var t=e._min,o=e._max,h=new u,d=new Uint16Array(24),m=new Float64Array(24);m[0]=t.x,m[1]=t.y,m[2]=t.z,m[3]=o.x,m[4]=t.y,m[5]=t.z,m[6]=o.x,m[7]=o.y,m[8]=t.z,m[9]=t.x,m[10]=o.y,m[11]=t.z,m[12]=t.x,m[13]=t.y,m[14]=o.z,m[15]=o.x,m[16]=t.y,m[17]=o.z,m[18]=o.x,m[19]=o.y,m[20]=o.z,m[21]=t.x,m[22]=o.y,m[23]=o.z,h.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var p=r.subtract(o,t,c),f=.5*r.magnitude(p);return new s({attributes:h,indices:d,primitiveType:n.LINES,boundingSphere:new a(r.ZERO,f)})},h}),r("Core/Spline",["../Core/defaultValue","../Core/defined","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(){this.times=void 0,this.points=void 0,r.throwInstantiationError()};return i.prototype.evaluate=r.throwInstantiationError,i.prototype.findTimeInterval=function(t,r){var i=this.times,n=i.length;if(r=e(r,0),t>=i[r]){if(n>r+1&&tr+2&&t=0&&t>=i[r-1])return r-1;var o;if(t>i[r])for(o=r;n-1>o&&!(t>=i[o]&&t=0&&!(t>=i[o]&&t=0;--u)s[u]=r.subtract(a[u],r.multiplyByScalar(s[u+1],o[u]));return s},i}),r("Core/HermiteSpline",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./Matrix4","./Cartesian4","./Spline","./LinearSpline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,r,n){var o=h,a=m,s=d,u=p;o.length=a.length=e.length-1,s.length=u.length=e.length;var c;o[0]=s[0]=1,a[0]=0;var f=u[0];for(t(f)||(f=u[0]=new i),i.clone(r,f),c=1;c2&&(t(a)||(a=d,n.multiplyByScalar(i[1],2,a),n.subtract(a,i[2],a),n.subtract(a,i[0],a),n.multiplyByScalar(a,.5,a)),!t(s))){var u=i.length-1;s=m,n.multiplyByScalar(i[u-1],2,s),n.subtract(i[u],s,s),n.add(s,i[u-2],s),n.multiplyByScalar(s,.5,s)}this.times=o,this.points=i,this.firstTangent=n.clone(a),this.lastTangent=n.clone(s),this._evaluateFunction=l(this),this._lastTimeIndex=0};return p.catmullRomCoefficientMatrix=new i(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),p.prototype.findTimeInterval=a.prototype.findTimeInterval,p.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},p}),r("Core/IndexDatatype",["./defined","./DeveloperError","./Math"],function(e,t,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i}),r("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,i,n,o,a,s){"use strict";var l,u=function(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)};u.fromAxisAngle=function(t,i,n){var o=i/2,a=Math.sin(o);l=e.normalize(t,l);var s=l.x*a,c=l.y*a,h=l.z*a,d=Math.cos(o);return r(n)?(n.x=s,n.y=c,n.z=h,n.w=d,n):new u(s,c,h,d)};var c=[1,2,0],h=new Array(3);u.fromRotationMatrix=function(e,t){var i,n,o,a,l,d=e[s.COLUMN0ROW0],m=e[s.COLUMN1ROW1],p=e[s.COLUMN2ROW2],f=d+m+p;if(f>0)i=Math.sqrt(f+1),l=.5*i,i=.5/i,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*i,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*i,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*i;else{var v=c,g=0;m>d&&(g=1),p>d&&p>m&&(g=2);var _=v[g],y=v[_];i=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*i,i=.5/i,l=(e[s.getElementIndex(y,_)]-e[s.getElementIndex(_,y)])*i,C[_]=(e[s.getElementIndex(_,g)]+e[s.getElementIndex(g,_)])*i,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*i,n=-C[0],o=-C[1],a=-C[2]}return r(t)?(t.x=n,t.y=o,t.z=a,t.w=l,t):new u(n,o,a,l)};var d=new e,m=new e,p=new u,f=new u,v=new u;u.packedLength=4,u.pack=function(e,r,i){i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w},u.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new u),n.x=e[i],n.y=e[i+1],n.z=e[i+2],n.w=e[i+3],n},u.packedInterpolationLength=3,u.convertPackedArrayForInterpolation=function(e,t,r,i){u.unpack(e,4*r,v),u.conjugate(v,v);for(var n=0,o=r-t+1;o>n;n++){var a=3*n;u.unpack(e,4*(t+n),p),u.multiply(p,v,p),p.w<0&&u.negate(p,p),u.getAxis(p,d);var s=u.getAngle(p);i[a]=d.x*s,i[a+1]=d.y*s,i[a+2]=d.z*s}},u.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new u),e.fromArray(t,0,m);var s=e.magnitude(m);return u.unpack(i,4*o,f),0===s?u.clone(u.IDENTITY,p):u.fromAxisAngle(m,s,p),u.multiply(p,f,a)},u.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new u(e.x,e.y,e.z,e.w):void 0},u.conjugate=function(e,t){return r(t)?(t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t):new u(-e.x,-e.y,-e.z,e.w)},u.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},u.magnitude=function(e){return Math.sqrt(u.magnitudeSquared(e))},u.normalize=function(e,t){var i=1/u.magnitude(e),n=e.x*i,o=e.y*i,a=e.z*i,s=e.w*i;return r(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new u(n,o,a,s)},u.inverse=function(e,t){var r=u.magnitudeSquared(e);return t=u.conjugate(e,t),u.multiplyByScalar(t,1/r,t)},u.add=function(e,t,i){return r(i)?(i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i):new u(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w)},u.subtract=function(e,t,i){return r(i)?(i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i):new u(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w)},u.negate=function(e,t){return r(t)?(t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t):new u(-e.x,-e.y,-e.z,-e.w)},u.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},u.multiply=function(e,t,i){var n=e.x,o=e.y,a=e.z,s=e.w,l=t.x,c=t.y,h=t.z,d=t.w,m=s*l+n*d+o*h-a*c,p=s*c-n*h+o*d+a*l,f=s*h+n*c-o*l+a*d,v=s*d-n*l-o*c-a*h;return r(i)?(i.x=m,i.y=p,i.z=f,i.w=v,i):new u(m,p,f,v)},u.multiplyByScalar=function(e,t,i){return r(i)?(i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i):new u(e.x*t,e.y*t,e.z*t,e.w*t)},u.divideByScalar=function(e,t,i){return r(i)?(i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i):new u(e.x/t,e.y/t,e.z/t,e.w/t)},u.getAxis=function(t,i){var n=t.w;if(Math.abs(n-1)n&&(n=-n,o=_=u.negate(t,_)),1-nI;++I){var O=I+1,R=2*O+1;A[I]=1/(O*R),P[I]=O/R}return A[7]=T/136,P[7]=8*T/17,u.fastSlerp=function(e,t,i,n){r(n)||(n=new u);var o,a=u.dot(e,t);a>=0?o=1:(o=-1,a=-a);for(var s=a-1,l=1-i,c=i*i,h=l*l,d=7;d>=0;--d)D[d]=(A[d]*c-P[d])*s,M[d]=(A[d]*h-P[d])*s;var m=o*i*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),p=l*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),f=u.multiplyByScalar(e,p,b);return u.multiplyByScalar(t,m,n),u.add(f,n,n)},u.fastSquad=function(e,t,r,i,n,o){var a=u.fastSlerp(e,t,n,E),s=u.fastSlerp(r,i,n,x);return u.fastSlerp(a,s,2*n*(1-n),o)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},u.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},u.ZERO=o(new u(0,0,0,0)),u.IDENTITY=o(new u(0,0,0,1)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},u}),r("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,i){"use strict";function n(t,n,o,c,h,d,m,p,f,v){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(m*_+h*y),S=C/p;return i.fromAxisAngle(a,S,l),r.fromQuaternion(l,u),r.multiplyByVector(u,f,v),e.normalize(v,v),e.multiplyByScalar(v,p,v),v}var o={},a=new e,s=new e,l=new i,u=new r,c=new e,h=new e,d=new e,m=new e;o.raisePositionsToHeight=function(t,r,i){for(var n=r.ellipsoid,o=r.height,a=r.extrudedHeight,s=i?2*(t.length/3):t.length/3,l=new Float64Array(3*s),u=m,p=t.length,f=i?p:0,v=0;p>v;v+=3){var g,_=v+1,y=v+2,C=e.fromArray(t,v,c);C=n.scaleToGeodeticSurface(C,C),g=e.clone(C,h),u=n.geodeticSurfaceNormal(C,u);var S=e.multiplyByScalar(u,o,d);C=e.add(C,S,C),i&&(S=e.multiplyByScalar(u,a,S),g=e.add(g,S,g),l[v+f]=g.x,l[_+f]=g.y,l[y+f]=g.z),l[v]=C.x,l[_]=C.y,l[y]=C.z}return l};var p=new e,f=new e,v=new e;return o.computeEllipsePositions=function(r,i,o){var a=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,m=r.granularity,g=2.31,_=a*a,y=s*s,C=s*a,S=e.magnitude(u),w=e.normalize(u,p),E=e.cross(e.UNIT_Z,u,f);E=e.normalize(E,E);var x,b,T,A,P,D=e.cross(w,E,v),M=1+Math.ceil(t.PI_OVER_TWO/m),I=g/(M-1),O=2*M*(M+1),R=i?new Array(3*O):void 0,L=0,N=c,B=h,z=o?[]:void 0,F=o?[]:void 0,V=t.PI_OVER_TWO;for(x=0;M>x&&V>0;++x){if(N=n(V,l,D,E,_,C,y,S,w,N),B=n(Math.PI-V,l,D,E,_,C,y,S,w,B),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,T=2*x+2,b=1;T-1>b;++b)A=b/(T-1),P=e.lerp(N,B,A,d),R[L++]=P.x,R[L++]=P.y,R[L++]=P.z;R[L++]=B.x,R[L++]=B.y,R[L++]=B.z}o&&(F.unshift(N.x,N.y,N.z),0!==x&&z.push(B.x,B.y,B.z)),V=t.PI_OVER_TWO-(x+1)*I}for(M=x,x=M;x>0;--x){if(V=t.PI_OVER_TWO-(x-1)*I,N=n(-V,l,D,E,_,C,y,S,w,N),B=n(V+Math.PI,l,D,E,_,C,y,S,w,B),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,T=2*(x-1)+2,b=1;T-1>b;++b)A=b/(T-1),P=e.lerp(N,B,A,d),R[L++]=P.x,R[L++]=P.y,R[L++]=P.z;R[L++]=B.x,R[L++]=B.y,R[L++]=B.z}o&&(F.unshift(N.x,N.y,N.z),1!==x&&z.push(B.x,B.y,B.z))}var k={};return i&&(R.length!==L&&(O=L/3,R.length=L),k.positions=R,k.numPts=M),o&&(k.outerPositions=F.concat(z)),k},o}),r("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=new t,n=new t,o=new t,a=function(a,s,l,u,c){r(c)||(c=new t);var h,d,m,p,f,v,g,_;r(s.z)?(h=t.subtract(l,s,i),d=t.subtract(u,s,n),m=t.subtract(a,s,o),p=t.dot(h,h),f=t.dot(h,d),v=t.dot(h,m),g=t.dot(d,d),_=t.dot(d,m)):(h=e.subtract(l,s,i),d=e.subtract(u,s,n),m=e.subtract(a,s,o),p=e.dot(h,h),f=e.dot(h,d),v=e.dot(h,m),g=e.dot(d,d),_=e.dot(d,m));var y=1/(p*g-f*f);return c.y=(g*v-f*_)*y,c.z=(p*_-f*v)*y,c.x=1-c.y-c.z,c};return a}),r("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var i;return e>=0?(i=65536*Math.floor(e/65536),r.high=i,r.low=e-i):(i=65536*Math.floor(-e/65536),r.high=-i,r.low=e+i),r};var i={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var o=n.high,a=n.low;return r.encode(e.x,i),o.x=i.high,a.x=i.low,r.encode(e.y,i),o.y=i.high,a.y=i.low,r.encode(e.z,i),o.z=i.high,a.z=i.low,n};var n=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,n);var o=n.high,a=n.low;t[i]=o.x,t[i+1]=o.y,t[i+2]=o.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),r("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,i){var n=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))a&&a/ss&&s/ao)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-i/e,0>o?[o,0]:[0,o];var u=i*i,c=4*e*n,h=r(u,-c,t.EPSILON14);if(0>h)return[];var d=-.5*r(i,t.sign(i)*Math.sqrt(h),t.EPSILON14);return i>0?[d/e,n/d]:[n/d,d/e]},i}),r("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,h=s*u,d=s*s,m=l*l,p=a*l-d,f=a*u-s*l,v=s*u-m,g=4*p*v-f*f;if(0>g){var _,y,C;d*h>=c*m?(_=a,y=p,C=-2*s*p+a*f):(_=u,y=v,C=-u*f+2*l*v);var S=0>C?-1:1,w=-S*Math.abs(_)*Math.sqrt(-g);o=-C+w;var E=o/2,x=0>E?-Math.pow(-E,1/3):Math.pow(E,1/3),b=o===w?-x:-y/x;return n=0>=y?x+b:-C/(x*x+b*b+y),d*h>=c*m?[(n-s)/a]:[-u/(n+l)]}var T=p,A=-2*s*p+a*f,P=v,D=-u*f+2*l*v,M=Math.sqrt(g),I=Math.sqrt(3)/2,O=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-T);var R=Math.cos(O);o=n*R;var L=n*(-R/2-I*Math.sin(O)),N=o+L>2*s?o-s:L-s,B=a,z=N/B;O=Math.abs(Math.atan2(u*M,-D)/3),n=2*Math.sqrt(-P),R=Math.cos(O),o=n*R,L=n*(-R/2-I*Math.sin(O));var F=-u,V=2*l>o+L?o+l:L+l,k=F/V,U=B*V,W=-N*V-B*F,G=N*F,H=(l*W-s*G)/(-s*W+l*U);return H>=z?k>=z?k>=H?[z,H,k]:[z,k,H]:[k,z,H]:k>=z?[H,z,k]:k>=H?[H,k,z]:[k,H,z]}var i={};return i.discriminant=function(e,t,r,i){var n=e*e,o=t*t,a=r*r,s=i*i,l=18*e*t*r*i+o*a-27*n*s-4*(e*a*r+o*t*i);return l},i.realRoots=function(e,i,n,o){var a,s;if(0===e)return t.realRoots(i,n,o);if(0===i){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.realRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):r(e,0,n,o)}return 0===n?0===o?(s=-i/e,0>s?[s,0,0]:[0,0,s]):r(e,i,0,o):0===o?(a=t.realRoots(e,i,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):r(e,i,n,o)},i}),r("Core/QuarticRealPolynomial",["./DeveloperError","./Math","./CubicRealPolynomial","./QuadraticRealPolynomial"],function(e,t,r,i){"use strict";function n(e,n,o,a){var s=e*e,l=n-3*s/8,u=o-n*e/2+s*e/8,c=a-o*e/4+n*s/16-3*s*s/256,h=r.realRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-e/4,m=h[h.length-1];if(Math.abs(m)=0&&g>=0){var _=Math.sqrt(v),y=Math.sqrt(g);return[d-y,d-_,d+_,d+y]}if(v>=0&&0>g)return f=Math.sqrt(v),[d-f,d+f];if(0>v&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(m>0){var C=Math.sqrt(m),S=(l+m-u/C)/2,w=(l+m+u/C)/2,E=i.realRoots(1,C,S),x=i.realRoots(1,-C,w);return 0!==E.length?(E[0]+=d,E[1]+=d,0!==x.length?(x[0]+=d,x[1]+=d,E[1]<=x[0]?[E[0],E[1],x[0],x[1]]:x[1]<=E[0]?[x[0],x[1],E[0],E[1]]:E[0]>=x[0]&&E[1]<=x[1]?[x[0],E[0],E[1],x[1]]:x[0]>=E[0]&&x[1]<=E[1]?[E[0],x[0],x[1],E[1]]:E[0]>x[0]&&E[0]0){var p,f,v=m[0],g=n-v,_=g*g,y=e/2,C=g/2,S=_-4*a,w=_+4*Math.abs(a),E=u-4*v,x=u+4*Math.abs(v);if(0>v||E*w>S*x){var b=Math.sqrt(E);p=b/2,f=0===b?0:(e*C-o)/b}else{var T=Math.sqrt(S);p=0===T?0:(e*C-o)/T,f=T/2}var A,P;0===y&&0===p?(A=0,P=0):t.sign(y)===t.sign(p)?(A=y+p,P=v/A):(P=y-p,A=v/P);var D,M;0===C&&0===f?(D=0,M=0):t.sign(C)===t.sign(f)?(D=C+f,M=a/D):(M=C-f,D=a/M);var I=i.realRoots(1,A,D),O=i.realRoots(1,P,M);if(0!==I.length)return 0!==O.length?I[1]<=O[0]?[I[0],I[1],O[0],O[1]]:O[1]<=I[0]?[O[0],O[1],I[0],I[1]]:I[0]>=O[0]&&I[1]<=O[1]?[O[0],I[0],I[1],O[1]]:O[0]>=I[0]&&O[1]<=I[1]?[I[0],O[0],O[1],I[1]]:I[0]>O[0]&&I[0]u?1:0;switch(m+=0>c?m+1:m,m+=0>h?m+1:m,m+=0>d?m+1:m){case 0:return n(u,c,h,d);case 1:return o(u,c,h,d);case 2:return o(u,c,h,d);case 3:return n(u,c,h,d);case 4:return n(u,c,h,d);case 5:return o(u,c,h,d);case 6:return n(u,c,h,d);case 7:return n(u,c,h,d);case 8:return o(u,c,h,d);case 9:return n(u,c,h,d);case 10:return n(u,c,h,d);case 11:return o(u,c,h,d);case 12:return n(u,c,h,d);case 13:return n(u,c,h,d);case 14:return n(u,c,h,d);case 15:return n(u,c,h,d);default:return void 0}},a}),r("Core/IntersectionTests",["./defined","./DeveloperError","./Math","./Cartesian3","./Cartographic","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i){var n=e+t;return r.sign(e)!==r.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))L;++L){var N,B=h[L],z=B*B,F=Math.max(1-z,0),V=Math.sqrt(F);N=r.sign(p)===r.sign(v)?l(p*z+v,f*B,r.EPSILON12):r.sign(v)===r.sign(f*B)?l(p*z,f*B+v,r.EPSILON12):l(p*z+f*B,v,r.EPSILON12);var k=l(g*B,_,r.EPSILON15),U=N*k;0>U?y.push(new i(u,c*B,c*V)):U>0?y.push(new i(u,c*B,c*-V)):0!==V?(y.push(new i(u,c*B,c*-V)),y.push(new i(u,c*B,c*V)),++L):y.push(new i(u,c*B,c*V))}return y}var c={};c.rayPlane=function(e,t,n){var o=e.origin,a=e.direction,s=t.normal,l=i.dot(s,a);if(Math.abs(l)u?void 0:(n=i.multiplyByScalar(a,u,n),i.add(o,n,n))};var h=new i,d=new i;c.rayEllipsoid=function(e,t){var r,n,o,a,s,l=t.oneOverRadii,u=i.multiplyComponents(l,e.origin,h),c=i.multiplyComponents(l,e.direction,d),m=i.magnitudeSquared(u),p=i.dot(u,c);if(m>1){if(p>=0)return void 0;var f=p*p;if(r=m-1,n=i.magnitudeSquared(c),o=n*r,o>f)return void 0;if(f>o){a=p*p-o,s=-p+Math.sqrt(a);var v=s/n,g=r/s;return g>v?{start:v,stop:g}:{start:g,stop:v}}var _=Math.sqrt(r/n);return{start:_,stop:_}}return 1>m?(r=m-1,n=i.magnitudeSquared(c),o=n*r,a=p*p-o,s=-p+Math.sqrt(a),{start:0,stop:s/n}):0>p?(n=i.magnitudeSquared(c),{start:0,stop:-p/n}):void 0},c.grazingAltitudeLocation=function(t,a){var s=t.origin,l=t.direction,c=a.geodeticSurfaceNormal(s);if(i.dot(l,c)>=0)return s;var h,d,m=e(this.rayEllipsoid(t,a)),p=a.transformPositionToScaledSpace(l),f=i.normalize(p),v=i.mostOrthogonalAxis(p),g=i.normalize(i.cross(v,f)),_=i.normalize(i.cross(f,g)),y=new o(f.x,g.x,_.x,f.y,g.y,_.y,f.z,g.z,_.z),C=o.transpose(y),S=o.fromScale(a.radii),w=o.fromScale(a.oneOverRadii),E=new o(0,l.z,-l.y,-l.z,0,l.x,l.y,-l.x,0),x=o.multiply(o.multiply(C,w),E),b=o.multiply(o.multiply(x,S),y),T=o.multiplyByVector(x,s),A=u(b,i.negate(T),0,0,1),P=A.length;if(P>0){for(var D=i.ZERO,M=Number.NEGATIVE_INFINITY,I=0;P>I;++I){h=o.multiplyByVector(S,o.multiplyByVector(y,A[I]));var O=i.normalize(i.subtract(h,s)),R=i.dot(O,l);R>M&&(M=R,D=h)}var L=a.cartesianToCartographic(D);return M=r.clamp(M,0,1),d=i.magnitude(i.subtract(D,s))*Math.sqrt(1-M*M),d=m?-d:d,a.cartographicToCartesian(new n(L.longitude,L.latitude,d))}return void 0};var m=new i;return c.lineSegmentPlane=function(t,n,o,a){var s=i.subtract(n,t,m),l=o.normal,u=i.dot(l,s);if(Math.abs(u)h||h>1?void 0:(e(a)||(a=new i),i.multiplyByScalar(s,h,a),i.add(t,a,a),a)},c.trianglePlaneIntersection=function(e,t,r,n){var o=n.normal,a=n.distance,s=i.dot(o,e)+a<0,l=i.dot(o,t)+a<0,u=i.dot(o,r)+a<0,h=0;h+=s?1:0,h+=l?1:0,h+=u?1:0;var d,m;if((1===h||2===h)&&(d=new i,m=new i),1===h){if(s)return c.lineSegmentPlane(e,t,n,d),c.lineSegmentPlane(e,r,n,m),{positions:[e,t,r,d,m],indices:[0,3,4,1,2,4,1,4,3]};if(l)return c.lineSegmentPlane(t,r,n,d),c.lineSegmentPlane(t,e,n,m),{positions:[e,t,r,d,m],indices:[1,3,4,2,0,4,2,4,3]};if(u)return c.lineSegmentPlane(r,e,n,d),c.lineSegmentPlane(r,t,n,m),{positions:[e,t,r,d,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===h){if(!s)return c.lineSegmentPlane(t,e,n,d),c.lineSegmentPlane(r,e,n,m),{positions:[e,t,r,d,m],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return c.lineSegmentPlane(r,t,n,d),c.lineSegmentPlane(e,t,n,m),{positions:[e,t,r,d,m],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return c.lineSegmentPlane(e,r,n,d),c.lineSegmentPlane(t,r,n,m),{positions:[e,t,r,d,m],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},c}),r("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(i,n,o){var a=-e.dot(n,i);return t(o)?(e.clone(n,o.normal),o.distance=a,o):new r(n,a)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r.prototype.getPointDistance=function(e){return r.getPointDistance(this,e)},r}),r("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.indices,n=r.maximumIndex,o=e(r.cacheSize,24),a=i.length;if(!t(n)){n=0;for(var s=0,l=i[s];a>s;)l>n&&(n=l),++s,l=i[s]}for(var u=[],c=0;n+1>c;c++)u[c]=0;for(var h=o+1,d=0;a>d;++d)h-u[i[d]]>o&&(u[i[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(r){function i(e,t,r,i){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;i>o;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,h=0;hc||-1===c)&&(c=l,u=d)),++h}return-1===u?i(n,a,e,s):u}r=e(r,e.EMPTY_OBJECT);var o,a=r.indices,s=r.maximumIndex,l=e(r.cacheSize,24),u=a.length,c=0,h=0,d=a[h],m=u;if(t(s))c=s+1;else{for(;m>h;)d>c&&(c=d),++h,d=a[h];if(-1===c)return 0;++c}for(var p=[],f=0;c>f;f++)p[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var v=0;m>h;)p[a[h]].vertexTriangles.push(v),++p[a[h]].numLiveTriangles,p[a[h+1]].vertexTriangles.push(v),++p[a[h+1]].numLiveTriangles,p[a[h+2]].vertexTriangles.push(v),++p[a[h+2]].numLiveTriangles,++v,h+=3;var g=0,_=l+1;o=1;var y,C,S=[],w=[],E=0,x=[],b=u/3,T=[];for(f=0;b>f;f++)T[f]=!1;for(var A,P;-1!==g;){S=[],C=p[g],P=C.vertexTriangles.length;for(var D=0;P>D;++D)if(v=C.vertexTriangles[D],!T[v]){T[v]=!0,h=v+v+v;for(var M=0;3>M;++M)A=a[h],S.push(A),w.push(A),x[E]=A,++E,y=p[A],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++h +}g=n(a,l,S,p,_,w,c)}return x},r}),r("Core/GeometryPipeline",["./barycentricCoordinates","./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./EncodedCartesian3","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./GeographicProjection","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./Tipsify","./BoundingSphere","./Geometry","./GeometryAttribute"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w){"use strict";function E(e,t,r,i,n){e[t++]=r,e[t++]=i,e[t++]=i,e[t++]=n,e[t++]=n,e[t]=r}function x(e){for(var t=e.length,r=6*(t/3),i=g.createTypedArray(t,r),n=0,o=0;t>o;o+=3,n+=6)E(i,n,e[o],e[o+1],e[o+2]);return i}function b(e){var t=e.length;if(t>=3){var r=6*(t-2),i=g.createTypedArray(t,r);E(i,0,e[0],e[1],e[2]);for(var n=6,o=3;t>o;++o,n+=6)E(i,n,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function T(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=g.createTypedArray(t,r),n=e[0],o=0,a=1;t>a;++a,o+=6)E(i,o,n,e[a],e[a+1]);return i}return new Uint16Array}function A(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&r(e[i])&&r(e[i].values)){var n=e[i];t[i]=new w({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function P(e,t,i){for(var n in t)if(t.hasOwnProperty(n)&&r(t[n])&&r(t[n].values))for(var o=t[n],a=0;aa;a+=3)o.unpack(i,a,Z),m.multiplyByPoint(e,Z,Z),o.pack(Z,i,a)}function M(e,t){if(r(t))for(var i=t.values,n=i.length,a=0;n>a;a+=3)o.unpack(i,a,Z),d.multiplyByVector(e,Z,Z),Z=o.normalize(Z,Z),o.pack(Z,i,a)}function I(e){var t,i=e.length,n={},o=e[0].geometry.attributes;for(t in o)if(o.hasOwnProperty(t)&&r(o[t])&&r(o[t].values)){for(var a=o[t],s=a.values.length,l=!0,u=1;i>u;++u){var c=e[u].geometry.attributes[t];if(!r(c)||a.componentDatatype.value!==c.componentDatatype.value||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){l=!1;break}s+=c.values.length}l&&(n[t]=new w({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:v.createTypedArray(a.componentDatatype,s)}))}return n}function O(e){if(r(e.indices))return e;for(var t=S.computeNumberOfVertices(e),i=g.createTypedArray(t,t),n=0;t>n;++n)i[n]=n;return e.indices=i,e}function R(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var i=3,n=3;t>n;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;return e.indices=r,e.primitiveType=_.TRIANGLES,e}function L(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var i=6,n=3;t-1>n;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,t>n+2&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);return e.indices=r,e.primitiveType=_.TRIANGLES,e}function N(e){if(r(e.indices))return e;for(var t=S.computeNumberOfVertices(e),i=g.createTypedArray(t,t),n=0;t>n;++n)i[n]=n;return e.indices=i,e}function B(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var i=2,n=2;t>n;++n)r[i++]=n-1,r[i++]=n;return e.indices=r,e.primitiveType=_.LINES,e}function z(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var i=2,n=2;t>n;++n)r[i++]=n-1,r[i++]=n;return r[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=_.LINES,e}function F(e){switch(e.primitiveType){case _.TRIANGLE_FAN:return R(e);case _.TRIANGLE_STRIP:return L(e);case _.TRIANGLES:return O(e);case _.LINE_STRIP:return B(e);case _.LINE_LOOP:return z(e);case _.LINES:return N(e)}return e}function V(e,t){Math.abs(e.y)=0||t.x>=0||r.x>=0)return void 0;var i=e.y<0,n=t.y<0,o=r.y<0;V(e,i),V(t,n),V(r,o);var a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=ct.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(k(e,t,at,lt),k(e,r,st,ut),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(k(t,r,at,lt),k(t,e,st,ut),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(k(r,e,at,lt),k(r,t,st,ut),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?n?o||(k(r,e,at,lt),k(r,t,st,ut),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(k(t,r,at,lt),k(t,e,st,ut),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(k(e,t,at,lt),k(e,r,st,ut),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=ct.positions;return l[0]=e,l[1]=t,l[2]=r,ct.length=3,(1===a||2===a)&&(l[3]=at,l[4]=st,l[5]=lt,l[6]=ut,ct.length=7),ct}function W(t,i,a,s,l,u,c,h){if(r(l)||r(u)||r(c)||r(h)){var d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M=s.positions,I=M[0],O=M[1],R=M[2];r(l)&&(d=o.fromArray(l,3*t),m=o.fromArray(l,3*i),p=o.fromArray(l,3*a)),r(u)&&(f=o.fromArray(u,3*t),v=o.fromArray(u,3*i),g=o.fromArray(u,3*a)),r(c)&&(_=o.fromArray(c,3*t),y=o.fromArray(c,3*i),C=o.fromArray(c,3*a)),r(h)&&(S=n.fromArray(h,2*t),w=n.fromArray(h,2*i),E=n.fromArray(h,2*a));for(var L=3;Ly;y+=3){var C=u[y],w=u[y+1],E=u[y+2],x=o.fromArray(i,3*C),b=o.fromArray(i,3*w),T=o.fromArray(i,3*E),A=U(x,b,T);if(r(A))if(c[3*C+1]=A.positions[0].y,c[3*w+1]=A.positions[1].y,c[3*E+1]=A.positions[2].y,A.length>3){for(var P=c.length/3,D=0;DM?f.push(u[y+M]):f.push(M-3+P)}for(var I=3;Id;d+=2){var m=n[d],f=n[d+1],v=o.fromArray(i,3*m),_=o.fromArray(i,3*f);if(Math.abs(v.y)c;c+=3)l[u++]=o[c],l[u++]=o[c+1],l[u++]=o[c+2],l[u++]=o[c]+a[c]*n,l[u++]=o[c+1]+a[c+1]*n,l[u++]=o[c+2]+a[c+2]*n;var h,d=e.boundingSphere;return r(d)&&(h=new C(d.center,d.radius+n)),new S({attributes:{position:new w({componentDatatype:v.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:_.LINES,boundingSphere:h})},j.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent"],n=e.attributes,o={},a=0,s=i.length;for(t=0;s>t;++t){var l=i[t];r(n[l])&&(o[l]=a++)}for(var u in n)n.hasOwnProperty(u)&&!r(o[u])&&(o[u]=a++);return o},j.reorderForPreVertexCache=function(e){var t=S.computeNumberOfVertices(e),i=e.indices;if(r(i)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var a,s=i,l=s.length,u=g.createTypedArray(t,l),c=0,h=0,d=0;l>c;)a=n[s[c]],-1!==a?u[h]=a:(a=s[c],n[a]=d,u[h]=d,++d),++c,++h;e.indices=u;var m=e.attributes;for(var p in m)if(m.hasOwnProperty(p)&&r(m[p])&&r(m[p].values)){for(var f=m[p],_=f.values,y=0,C=f.componentsPerAttribute,w=v.createTypedArray(f.componentDatatype,d*C);t>y;){var E=n[y];if(-1!==E)for(o=0;C>o;o++)w[C*E+o]=_[C*y+o];++y}f.values=w}}return e},j.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===_.TRIANGLES&&r(i)){for(var n=i.length,o=0,a=0;n>a;a++)i[a]>o&&(o=i[a]);e.indices=y.tipsify({indices:i,maximumIndex:o,cacheSize:t})}return e},j.fitToUnsignedShortIndices=function(e){var t=[],i=S.computeNumberOfVertices(e);if(r(e.indices)&&i>h.SIXTY_FOUR_KILOBYTES){var n,o=[],a=[],s=0,l=A(e.attributes),u=e.indices,c=u.length;e.primitiveType===_.TRIANGLES?n=3:e.primitiveType===_.LINES?n=2:e.primitiveType===_.POINTS&&(n=1);for(var d=0;c>d;d+=n){for(var m=0;n>m;++m){var p=u[d+m],f=o[p];r(f)||(f=s++,o[p]=f,P(l,e.attributes,p)),a.push(f)}s+n>h.SIXTY_FOUR_KILOBYTES&&(t.push(new S({attributes:l,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),o=[],a=[],s=0,l=A(e.attributes))}0!==a.length&&t.push(new S({attributes:l,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var q=new o,Y=new s;j.projectTo2D=function(e,t,n,a,s){var l=e.attributes[t];s=r(s)?s:new f;for(var u=s.ellipsoid,c=l.values,h=new Float64Array(c.length),d=0,m=0;mc;++c)l.encode(o[c],X),s[c]=X.high,u[c]=X.low;var h=n.componentsPerAttribute;return e.attributes[r]=new w({componentDatatype:v.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[i]=new w({componentDatatype:v.FLOAT,componentsPerAttribute:h,values:u}),delete e.attributes[t],e};var Z=new o,J=new m,Q=new d;j.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(m.equals(t,m.IDENTITY))return e;var i=e.geometry.attributes;D(t,i.position),D(t,i.prevPosition),D(t,i.nextPosition),(r(i.normal)||r(i.binormal)||r(i.tangent))&&(m.inverse(t,J),m.transpose(J,J),m.getRotation(J,Q),M(Q,i.normal),M(Q,i.binormal),M(Q,i.tangent));var n=e.geometry.boundingSphere;return r(n)&&(e.geometry.boundingSphere=C.transform(n,t,n)),e.modelMatrix=m.clone(m.IDENTITY),e},j.combine=function(e){var t,i,n,a,s=e.length;e[0].modelMatrix;var l,u,c,h=r(e[0].geometry.indices),d=e[0].geometry.primitiveType,m=I(e);for(t in m)if(m.hasOwnProperty(t))for(l=m[t].values,a=0,i=0;s>i;++i)for(u=e[i].geometry.attributes[t].values,c=u.length,n=0;c>n;++n)l[a++]=u[n];var p;if(h){var f=0;for(i=0;s>i;++i)f+=e[i].geometry.indices.length;var v=S.computeNumberOfVertices(new S({attributes:m,primitiveType:_.POINTS})),y=g.createTypedArray(v,f),w=0,E=0;for(i=0;s>i;++i){var x=e[i].geometry.indices,b=x.length;for(a=0;b>a;++a)y[w++]=E+x[a];E+=S.computeNumberOfVertices(e[i].geometry)}p=y}var T,A=new o,P=0;for(i=0;s>i;++i){if(T=e[i].geometry.boundingSphere,!r(T)){A=void 0;break}o.add(T.center,A,A)}if(r(A))for(o.divideByScalar(A,s,A),i=0;s>i;++i){T=e[i].geometry.boundingSphere;var D=o.magnitude(o.subtract(T.center,A))+T.radius;D>P&&(P=D)}return new S({attributes:m,indices:p,primitiveType:d,boundingSphere:r(A)?new C(A,P):void 0})};var K=new o,$=new o,et=new o,tt=new o;j.computeNormal=function(e){for(var t=e.indices,r=e.attributes,i=r.position.values,n=r.position.values.length/3,a=t.length,s=new Array(n),l=new Array(a/3),u=new Array(a),c=0;n>c;c++)s[c]={indexOffset:0,count:0,currentCount:0};var h=0;for(c=0;a>c;c+=3){var d=t[c],m=t[c+1],p=t[c+2],f=3*d,g=3*m,_=3*p;$.x=i[f],$.y=i[f+1],$.z=i[f+2],et.x=i[g],et.y=i[g+1],et.z=i[g+2],tt.x=i[_],tt.y=i[_+1],tt.z=i[_+2],s[d].count++,s[m].count++,s[p].count++,o.subtract(et,$,et),o.subtract(tt,$,tt),l[h]=o.cross(et,tt),h++}var y=0;for(c=0;n>c;c++)s[c].indexOffset+=y,y+=s[c].count;h=0;var C;for(c=0;a>c;c+=3){C=s[t[c]];var S=C.indexOffset+C.currentCount;u[S]=h,C.currentCount++,C=s[t[c+1]],S=C.indexOffset+C.currentCount,u[S]=h,C.currentCount++,C=s[t[c+2]],S=C.indexOffset+C.currentCount,u[S]=h,C.currentCount++,h++}var E=new Float32Array(3*n);for(c=0;n>c;c++){var x=3*c;if(C=s[c],C.count>0){for(o.clone(o.ZERO,K),h=0;hu;u+=3){var m=t[u],p=t[u+1],f=t[u+2];c=3*m,h=3*p,d=3*f;var g=2*m,_=2*p,y=2*f,C=r[c],S=r[c+1],E=r[c+2],x=n[g],b=n[g+1],T=n[_+1]-b,A=n[y+1]-b,P=1/((n[_]-x)*A-(n[y]-x)*T),D=(A*(r[h]-C)-T*(r[d]-C))*P,M=(A*(r[h+1]-S)-T*(r[d+1]-S))*P,I=(A*(r[h+2]-E)-T*(r[d+2]-E))*P;l[c]+=D,l[c+1]+=M,l[c+2]+=I,l[h]+=D,l[h+1]+=M,l[h+2]+=I,l[d]+=D,l[d+1]+=M,l[d+2]+=I}var O=new Float32Array(3*a),R=new Float32Array(3*a);for(u=0;a>u;u++){c=3*u,h=c+1,d=c+2;var L=o.fromArray(i,c,rt),N=o.fromArray(l,c,nt),B=o.dot(L,N);o.multiplyByScalar(L,B,it),o.normalize(o.subtract(N,it,N),N),R[c]=N.x,R[h]=N.y,R[d]=N.z,o.normalize(o.cross(L,N,N),N),O[c]=N.x,O[h]=N.y,O[d]=N.z}return e.attributes.tangent=new w({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.binormal=new w({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:O}),e};var ot=new o,at=new o,st=new o,lt=new o,ut=new o,ct={positions:new Array(7),indices:new Array(9)};return j.wrapLongitude=function(e){var t=e.boundingSphere;if(r(t)){var i=t.center.x-t.radius;if(i>0||C.intersect(t,a.UNIT_Y)!==u.INTERSECTING)return e}return F(e),e.primitiveType===_.TRIANGLES?G(e):e.primitiveType===_.LINES&&H(e),e},j}),r("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=i.clone(e(t.modelMatrix,i.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{})};return n}),r("Core/EllipseGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./EllipseGeometryLibrary","./GeographicProjection","./Geometry","./GeometryPipeline","./GeometryInstance","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S){"use strict";function w(e,t,r){var i=t.vertexFormat,o=t.center,s=t.semiMajorAxis,l=t.ellipsoid,u=t.stRotation,d=r?2*(e.length/3):e.length/3,m=i.st?new Float32Array(2*d):void 0,p=i.normal?new Float32Array(3*d):void 0,g=i.tangent?new Float32Array(3*d):void 0,y=i.binormal?new Float32Array(3*d):void 0,S=0,w=N,E=B,x=z,b=new h(l),T=b.project(l.cartesianToCartographic(o,F),V),A=l.scaleToGeodeticSurface(o,P);l.geodeticSurfaceNormal(A,A);for(var I=C.fromAxisAngle(A,u,L),k=_.fromQuaternion(I,R),U=e.length,W=r?U:0,G=2*(W/3),H=0;U>H;H+=3){var j=H+1,q=H+2,Y=n.fromArray(e,H,P);if(i.st){var X=_.multiplyByVector(k,Y,D),Z=b.project(l.cartesianToCartographic(X,F),M);n.subtract(Z,T,Z),O.x=(Z.x+s)/(2*s),O.y=(Z.y+s)/(2*s),r&&(m[S+G]=O.x,m[S+1+G]=O.y),m[S++]=O.x,m[S++]=O.y}w=l.geodeticSurfaceNormal(Y,w),(i.normal||i.tangent||i.binormal)&&((i.tangent||i.binormal)&&(E=n.cross(n.UNIT_Z,w,E),_.multiplyByVector(k,E,E)),i.normal&&(p[H]=w.x,p[j]=w.y,p[q]=w.z,r&&(p[H+W]=-w.x,p[j+W]=-w.y,p[q+W]=-w.z)),i.tangent&&(g[H]=E.x,g[j]=E.y,g[q]=E.z,r&&(g[H+W]=-E.x,g[j+W]=-E.y,g[q+W]=-E.z)),i.binormal&&(x=n.cross(w,E,x),y[H]=x.x,y[j]=x.y,y[q]=x.z,r&&(y[H+W]=x.x,y[j+W]=x.y,y[q+W]=x.z)))}var J=new v;if(i.position){var Q=c.raisePositionsToHeight(e,t,r);J.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:Q})}return i.st&&(J.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(J.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(J.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),i.binormal&&(J.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:y})),J}function E(e){var t,r,i,n,o,a=new Array(2*e*(e+1)),s=0;for(n=1;e>n;++n){for(i=n*(n+1),t=(n-1)*n,a[s++]=i++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=i++,a[s++]=t,a[s++]=i}for(r=2*e,++i,++t,n=0;r-1>n;++n)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;for(++t,++i,n=e-1;n>0;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=t++,a[s++]=t++,a[s++]=i++}return a}function x(e){var t=e.center;k=n.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,k),e.height,k),k=n.add(t,k,k);var i=new r(k,e.semiMajorAxis),o=c.computeEllipsePositions(e,!0,!1),a=o.positions,l=o.numPts,u=w(a,e,!1),h=E(l);return h=s.createTypedArray(a.length/3,h),{boundingSphere:i,attributes:u,indices:h}}function b(e,t){var r=t.vertexFormat,i=t.center,o=t.semiMajorAxis,s=t.ellipsoid,l=t.height,u=t.extrudedHeight,c=t.stRotation,d=2*(e.length/3),m=new Float64Array(3*d),p=r.st?new Float32Array(2*d):void 0,g=r.normal?new Float32Array(3*d):void 0,y=r.tangent?new Float32Array(3*d):void 0,S=r.binormal?new Float32Array(3*d):void 0,w=0,E=N,x=B,b=z,T=new h(s),A=T.project(s.cartesianToCartographic(i,F),V),k=s.scaleToGeodeticSurface(i,P);s.geodeticSurfaceNormal(k,k);for(var U=C.fromAxisAngle(k,c,L),W=_.fromQuaternion(U,R),G=e.length,H=2*(G/3),j=0;G>j;j+=3){var q,Y=j+1,X=j+2,Z=n.fromArray(e,j,P);if(r.st){var J=_.multiplyByVector(W,Z,D),Q=T.project(s.cartesianToCartographic(J,F),M);n.subtract(Q,A,Q),O.x=(Q.x+o)/(2*o),O.y=(Q.y+o)/(2*o),p[w+H]=O.x,p[w+1+H]=O.y,p[w++]=O.x,p[w++]=O.y}Z=s.scaleToGeodeticSurface(Z,Z),q=n.clone(Z,D),E=s.geodeticSurfaceNormal(Z,E);var K=n.multiplyByScalar(E,l,I);if(Z=n.add(Z,K,Z),K=n.multiplyByScalar(E,u,K),q=n.add(q,K,q),r.position&&(m[j+G]=q.x,m[Y+G]=q.y,m[X+G]=q.z,m[j]=Z.x,m[Y]=Z.y,m[X]=Z.z),r.normal||r.tangent||r.binormal){b=n.clone(E,b);var $=n.fromArray(e,(j+3)%G,I);n.subtract($,Z,$);var et=n.subtract(q,Z,M);E=n.normalize(n.cross(et,$,E),E),r.normal&&(g[j]=E.x,g[Y]=E.y,g[X]=E.z,g[j+G]=E.x,g[Y+G]=E.y,g[X+G]=E.z),r.tangent&&(x=n.normalize(n.cross(b,E,x),x),y[j]=x.x,y[Y]=x.y,y[X]=x.z,y[j+G]=x.x,y[j+1+G]=x.y,y[j+2+G]=x.z),r.binormal&&(S[j]=b.x,S[Y]=b.y,S[X]=b.z,S[j+G]=b.x,S[Y+G]=b.y,S[X+G]=b.z)}}var tt=new v;return r.position&&(tt.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:m})),r.st&&(tt.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:p})),r.normal&&(tt.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),r.tangent&&(tt.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:y})),r.binormal&&(tt.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),tt}function T(e){for(var t,r,i,n,o=e.length/3,a=s.createTypedArray(o,6*o),l=0,u=0;o-1>u;u++)t=u,i=u+o,r=t+1,n=r+o,a[l++]=t,a[l++]=i,a[l++]=r,a[l++]=r,a[l++]=i,a[l++]=n;return t=o-1,i=u+o,r=0,n=r+o,a[l++]=t,a[l++]=i,a[l++]=r,a[l++]=r,a[l++]=i,a[l++]=n,a}function A(e){var t=e.center,i=e.ellipsoid,o=e.semiMajorAxis,a=n.multiplyByScalar(i.geodeticSurfaceNormal(t,P),e.height,P);U.center=n.add(t,a,U.center),U.radius=o,a=n.multiplyByScalar(i.geodeticSurfaceNormal(t,a),e.extrudedHeight,a),W.center=n.add(t,a,W.center),W.radius=o;var l=c.computeEllipsePositions(e,!0,!0),u=l.positions,h=l.numPts,f=l.outerPositions,v=r.union(U,W),g=w(u,e,!0),_=E(h),C=_.length;_.length=2*C;for(var S=u.length/3,x=0;C>x;x+=3)_[x+C]=_[x+2]+S,_[x+1+C]=_[x+1]+S,_[x+2+C]=_[x]+S;var A=s.createTypedArray(2*S/3,_),D=new d({attributes:g,indices:A,primitiveType:y.TRIANGLES}),M=b(f,e);_=T(f);var I=s.createTypedArray(2*f.length/3,_),O=new d({attributes:M,indices:I,primitiveType:y.TRIANGLES}),R=m.combine([new p({geometry:D}),new p({geometry:O})]);return{boundingSphere:v,attributes:R.attributes,indices:R.indices}}var P=new n,D=new n,M=new n,I=new n,O=new i,R=new _,L=new C,N=new n,B=new n,z=new n,F=new o,V=new n,k=new n,U=new r,W=new r,G=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.center,o=r.semiMajorAxis,a=r.semiMinorAxis,s=e(r.granularity,g.RADIANS_PER_DEGREE),l=e(r.height,0),c=r.extrudedHeight,h=t(c)&&!g.equalsEpsilon(l,c,1);this._center=n.clone(i),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=e(r.ellipsoid,u.WGS84),this._rotation=e(r.rotation,0),this._stRotation=e(r.stRotation,0),this._height=l,this._granularity=s,this._vertexFormat=e(r.vertexFormat,S.DEFAULT),this._extrudedHeight=c,this._extrude=h,this._workerName="createEllipseGeometry"};return G.createGeometry=function(e){var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=A(r)):t=x(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},G}),r("Core/CircleGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseGeometry"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.radius,n={center:t.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,vertexFormat:t.vertexFormat,stRotation:t.stRotation};this._ellipseGeometry=new i(n),this._workerName="createCircleGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/EllipseOutlineGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./EllipseGeometryLibrary","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e){var t=e.center;g=i.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=i.add(t,g,g);for(var a=new r(g,e.semiMajorAxis),s=l.computeEllipsePositions(e,!1,!0).outerPositions,u=new h({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l.raisePositionsToHeight(s,e,!1)})}),d=s.length/3,m=o.createTypedArray(d,2*d),p=0,f=0;d-1>f;f++)m[p++]=f,m[p++]=f+1;return m[p++]=d-1,m[p++]=0,{boundingSphere:a,attributes:u,indices:m}}function f(t){var a=e(t.numberOfVerticalLines,16);a=Math.max(a,0);var s=t.center,u=t.ellipsoid,d=t.semiMajorAxis,m=i.multiplyByScalar(u.geodeticSurfaceNormal(s,v),t.height,v);_.center=i.add(s,m,_.center),_.radius=d,m=i.multiplyByScalar(u.geodeticSurfaceNormal(s,m),t.extrudedHeight,m),y.center=i.add(s,m,y.center),y.radius=d;var p=l.computeEllipsePositions(t,!1,!0).outerPositions,f=new h({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l.raisePositionsToHeight(p,t,!0)})});p=f.position.values;var g=r.union(_,y),C=p.length/3,S=o.createTypedArray(C,2*C+2*a);C/=2;for(var w=0,E=0;C-1>E;E++)S[w++]=E,S[w++]=E+1,S[w++]=E+C,S[w++]=E+C+1;S[w++]=C-1,S[w++]=0,S[w++]=C+C-1,S[w++]=C;var x;if(a>0){var b=Math.min(a,C);x=Math.round(C/b)}var T=Math.min(x*a,C);if(a>0)for(E=0;T>E;E+=x)S[w++]=E,S[w++]=E+C;return{boundingSphere:g,attributes:f,indices:S}}var v=new i,g=new i,_=new r,y=new r,C=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.center,o=r.semiMajorAxis,a=r.semiMinorAxis,l=e(r.granularity,d.RADIANS_PER_DEGREE),u=e(r.height,0),c=r.extrudedHeight,h=t(c)&&!d.equalsEpsilon(u,c,1);this._center=i.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=e(r.ellipsoid,s.WGS84),this._rotation=e(r.rotation,0),this._height=u,this._granularity=l,this._extrudedHeight=c,this._extrude=h,this._numberOfVerticalLines=Math.max(e(r.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"};return C.createGeometry=function(e){var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=f(r)):t=p(r),new u({attributes:t.attributes,indices:t.indices,primitiveType:m.LINES,boundingSphere:t.boundingSphere})},C}),r("Core/CircleOutlineGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.radius,n={center:t.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,numberOfVerticalLines:t.numberOfVerticalLines};this._ellipseGeometry=new i(n),this._workerName="createCircleOutlineGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/ClockRange",["./Enumeration"],function(e){"use strict";var t={UNBOUNDED:new e(0,"UNBOUNDED"),CLAMPED:new e(1,"CLAMPED"),LOOP_STOP:new e(2,"LOOP_STOP")};return t}),r("Core/ClockStep",["./Enumeration"],function(e){"use strict";var t={TICK_DEPENDENT:new e(0,"TICK_DEPENDENT"),SYSTEM_CLOCK_MULTIPLIER:new e(1,"SYSTEM_CLOCK_MULTIPLIER"),SYSTEM_CLOCK:new e(2,"SYSTEM_CLOCK")};return t}),r("Core/Event",["./DeveloperError"],function(){"use strict";var e=function(){this._listeners=[],this._scopes=[]};return e.prototype.getNumberOfListeners=function(){return this._listeners.length},e.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var r=this;return function(){r.removeEventListener(e,t)}},e.prototype.removeEventListener=function(e,t){for(var r=this._listeners,i=this._scopes,n=-1,o=0;oi;i++)e[i].apply(t[i],arguments)},e}),r("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),r("Core/binarySearch",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t,r){for(var i,n,o=0,a=e.length-1;a>=o;)if(i=~~((o+a)/2),n=r(e[i],t),0>n)o=i+1;else{if(!(n>0))return i;a=i-1}return~(a+1)};return e}),r("Core/TimeConstants",[],function(){"use strict";var e={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e}),r("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),r("Core/LeapSecond",["./defined","./DeveloperError","./isArray"],function(){"use strict";var e=function(e,t){this.julianDate=e,this.offset=t};return e.setLeapSeconds=function(t){e._leapSeconds=t,e._leapSeconds.sort(e.compareLeapSecondDate)},e.getLeapSeconds=function(){return e._leapSeconds},e.prototype.equals=function(e){return this.julianDate.equals(e.julianDate)&&this.offset===e.offset},e.compareLeapSecondDate=function(e,t){return e.julianDate.compareTo(t.julianDate)},e._leapSeconds=[],e}),r("Core/TimeStandard",[],function(){"use strict";var e={UTC:0,TAI:1};return e}),r("Core/isLeapYear",["./DeveloperError"],function(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),r("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,i=t[r++],n=function(e,t,r,i){r||(r=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return i?e+n:n+e},o=function(e,t,r,i,o,a){var s=i-e.length;return s>0&&(e=r||!o?n(e,i,a,r):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,i,a,s,l){var u=e>>>0;return r=r&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+n(u.toString(t),s||0,"0",!1),o(e,r,i,a,l)},s=function(e,t,r,i,n,a){return null!=i&&(e=e.slice(0,i)),o(e,"",t,r,n,a)},l=function(e,i,l,u,c,h,d){var m,p,f,v,g;if("%%"==e)return"%";for(var _=!1,y="",C=!1,S=!1,w=" ",E=l.length,x=0;l&&E>x;x++)switch(l.charAt(x)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":w=l.charAt(x+1);break;case"0":C=!0;break;case"#":S=!0}if(u=u?"*"==u?+t[r++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,0>u&&(u=-u,_=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[r++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,g=i?t[i.slice(0,-1)]:t[r++],d){case"s":return s(String(g),_,u,h,C,w);case"c":return s(String.fromCharCode(+g),_,u,h,C);case"b":return a(g,2,S,_,u,h,C);case"o":return a(g,8,S,_,u,h,C);case"x":return a(g,16,S,_,u,h,C);case"X":return a(g,16,S,_,u,h,C).toUpperCase();case"u":return a(g,10,S,_,u,h,C);case"i":case"d":return m=+g||0,m=Math.round(m-m%1),p=0>m?"-":y,g=p+n(String(Math.abs(m)),h,"0",!1),o(g,p,_,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return m=+g,p=0>m?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=p+Math.abs(m)[f](h),o(g,p,_,u,C)[v]();default:return e}};return i.replace(e,l)}return e}),r("Core/JulianDate",["./DeveloperError","./binarySearch","./defined","./defaultValue","./TimeConstants","./LeapSecond","./TimeStandard","./isLeapYear","../ThirdParty/sprintf"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){g.julianDate=e;var r=o.getLeapSeconds(),i=t(r,g,o.compareLeapSecondDate);0>i&&(i=~i),i>=r.length&&(i=r.length-1);var n=r[i].offset;if(i>0){var a=e.getSecondsDifference(r[i].julianDate);a>n&&(i--,n=r[i].offset)}e.addSeconds(n,e)}function c(e,r){g.julianDate=e;var i=o.getLeapSeconds(),n=t(i,g,o.compareLeapSecondDate);if(0>n&&(n=~n),0===n)return e.addSeconds(-i[0].offset,r);if(n>=i.length)return e.addSeconds(-i[n-1].offset,r);var a=e.getSecondsDifference(i[n].julianDate); +return 0===a?e.addSeconds(-i[n].offset,r):1>=a?void 0:e.addSeconds(-i[--n].offset,r)}function h(e,t,i){var o=0|t/n.SECONDS_PER_DAY;return e+=o,t-=n.SECONDS_PER_DAY*o,0>t&&(e--,t+=n.SECONDS_PER_DAY),r(i)?(i._julianDayNumber=e,i._secondsOfDay=t,i):new P(e,t,a.TAI)}function d(e,t,r,i,o,a,s){var l=0|(t-14)/12,u=e+4800+l,c=(0|1461*u/4)+(0|367*(t-2-12*l)/12)-(0|3*((u+100)/100)/4)+r-32075;i-=12,0>i&&(i+=24);var h=a+(i*n.SECONDS_PER_HOUR+o*n.SECONDS_PER_MINUTE+s*n.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function m(e){return d(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())}var p=function(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s},f=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g={julianDate:void 0},_=/^(\d{4})$/,y=/^(\d{4})-(\d{2})$/,C=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,w=/^(\d{4})-?(\d{2})-?(\d{2})$/,E=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+E.source,b=/^(\d{2}):?(\d{2})(\.\d+)?/.source+E.source,T=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+E.source,A="Valid ISO 8601 date string required.",P=function(e,t,o){this._julianDayNumber=void 0,this._secondsOfDay=void 0;var s,l;if(r(e)||r(t)||r(o))o=i(o,a.UTC),s=0|e,l=t+(e-s)*n.SECONDS_PER_DAY;else{var c=new Date,d=m(c);s=d[0],l=d[1],o=a.UTC}h(s,l,this),o===a.UTC&&u(this)};P.clone=function(e,t){return r(e)?r(t)?(t._julianDayNumber=e._julianDayNumber,t._secondsOfDay=e._secondsOfDay,t):new P(e._julianDayNumber,e._secondsOfDay,a.TAI):void 0},P.fromDate=function(e,t){var r=m(e);return new P(r[0],r[1],t)},P.fromIso8601=function(t){t=t.replace(",",".");var i,n,o,l=t.split("T"),u=1,c=1,h=0,m=0,p=0,g=0,E=l[0],D=l[1];if(!r(E))throw new e(A);var M;if(l=E.match(w),null!==l){if(M=E.split("-").length-1,M>0&&2!==M)throw new e(A);i=+l[1],u=+l[2],c=+l[3]}else if(l=E.match(y),null!==l)i=+l[1],u=+l[2];else if(l=E.match(_),null!==l)i=+l[1];else{var I;if(l=E.match(C),null!==l){if(i=+l[1],I=+l[2],o=s(i),1>I||o&&I>366||!o&&I>365)throw new e(A)}else{if(l=E.match(S),null===l)throw new e(A);i=+l[1];var O=+l[2],R=+l[3]||0;if(M=E.split("-").length-1,M>0&&(!r(l[3])&&1!==M||r(l[3])&&2!==M))throw new e(A);var L=new Date(Date.UTC(i,0,4));I=7*O+R-L.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),u=n.getUTCMonth()+1,c=n.getUTCDate()}if(o=s(i),1>u||u>12||1>c||(2!==u||!o)&&c>f[u-1]||o&&2===u&&c>v)throw new e(A);var N;if(r(D)){if(l=D.match(T),null!==l){if(M=D.split(":").length-1,M>0&&2!==M&&3!==M)throw new e(A);h=+l[1],m=+l[2],p=+l[3],g=1e3*+(l[4]||0),N=5}else if(l=D.match(b),null!==l){if(M=D.split(":").length-1,M>0&&1!==M)throw new e(A);h=+l[1],m=+l[2],p=60*+(l[3]||0),N=4}else{if(l=D.match(x),null===l)throw new e(A);h=+l[1],m=60*+(l[2]||0),N=3}if(m>=60||p>=61||h>24||24===h&&(m>0||p>0||g>0))throw new e(A);var B=l[N],z=+l[N+1],F=+(l[N+2]||0);switch(B){case"+":h-=z,m-=F;break;case"-":h+=z,m+=F;break;case"Z":break;default:m+=new Date(Date.UTC(i,u-1,c,h,m)).getTimezoneOffset()}}else m+=new Date(Date.UTC(i,u-1,c)).getTimezoneOffset();var V=60===p;for(V&&p--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===u?v:f[u-1];c>n;)c-=n,u++,u>12&&(u-=12,i++),n=o&&2===u?v:f[u-1];for(;0>m;)m+=60,h--;for(;0>h;)h+=24,c--;for(;1>c;)u--,1>u&&(u+=12,i--),n=o&&2===u?v:f[u-1],c+=n;var k=d(i,u,c,h,m,p,g),U=new P(k[0],k[1],a.UTC);return V&&U.addSeconds(1,U),U},P.fromTotalDays=function(e,t){return new P(e,0,t)},P.compare=function(e,t){var r=e._julianDayNumber-t._julianDayNumber;return 0!==r?r:e._secondsOfDay-t._secondsOfDay},P.equals=function(e,t){return e===t||r(e)&&r(t)&&e._julianDayNumber===t._julianDayNumber&&e._secondsOfDay===t._secondsOfDay},P.equalsEpsilon=function(e,t,r){return Math.abs(e.getSecondsDifference(t))<=r},P.prototype.clone=function(e){return P.clone(this,e)},P.prototype.getTotalDays=function(){return this._julianDayNumber+this._secondsOfDay/n.SECONDS_PER_DAY},P.prototype.getJulianDayNumber=function(){return this._julianDayNumber},P.prototype.getJulianTimeFraction=function(){return this._secondsOfDay/n.SECONDS_PER_DAY},P.prototype.getSecondsOfDay=function(){return this._secondsOfDay};var D=new P(0,0,a.TAI);return P.prototype.toGregorianDate=function(){var e=!1,t=c(this,D);r(t)||(this.addSeconds(-1,D),t=c(D,D),e=!0);var i=t._julianDayNumber,o=t._secondsOfDay;o>=43200&&(i+=1);var a=0|i+68569,s=0|4*a/146097;a=0|a-(0|(146097*s+3)/4);var l=0|4e3*(a+1)/1461001;a=0|a-(0|1461*l/4)+31;var u=0|80*a/2447,h=0|a-(0|2447*u/80);a=0|u/11;var d=0|u+2-12*a,m=0|100*(s-49)+l+a,f=0|o/n.SECONDS_PER_HOUR,v=o-f*n.SECONDS_PER_HOUR,g=0|v/n.SECONDS_PER_MINUTE;v-=g*n.SECONDS_PER_MINUTE;var _=0|v,y=(v-_)/n.SECONDS_PER_MILLISECOND;return f+=12,f>23&&(f-=24),e&&(_+=1),new p(m,d,h,f,g,_,y,e)},P.prototype.toDate=function(){var e=this.toGregorianDate(),t=e.second;return e.isLeapSecond&&(t-=1),new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,t,e.millisecond))},P.prototype.toIso8601=function(e){var t,i=this.toGregorianDate();return r(e)||0===i.millisecond?r(e)&&0!==e?(t=(.01*i.millisecond).toFixed(e).replace(".","").slice(0,e),l("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,t)):l("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(t=(.01*i.millisecond).toString().replace(".",""),l("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,t))},P.prototype.getSecondsDifference=function(e){var t=this,r=e,i=(r._julianDayNumber-t._julianDayNumber)*n.SECONDS_PER_DAY;return i+(r._secondsOfDay-t._secondsOfDay)},P.prototype.getMinutesDifference=function(e){return this.getSecondsDifference(e)/n.SECONDS_PER_MINUTE},P.prototype.getDaysDifference=function(e){var t=this,r=e,i=r._julianDayNumber-t._julianDayNumber,o=(r._secondsOfDay-t._secondsOfDay)/n.SECONDS_PER_DAY;return i+o},P.prototype.getTaiMinusUtc=function(){g.julianDate=this;var e=o.getLeapSeconds(),r=t(e,g,o.compareLeapSecondDate);return 0>r&&(r=~r,--r,0>r&&(r=0)),e[r].offset},P.prototype.addSeconds=function(e,t){return h(this._julianDayNumber,this._secondsOfDay+e,t)},P.prototype.addMinutes=function(e){var t=this._secondsOfDay+e*n.SECONDS_PER_MINUTE;return new P(this._julianDayNumber,t,a.TAI)},P.prototype.addHours=function(e){var t=this._secondsOfDay+e*n.SECONDS_PER_HOUR;return new P(this._julianDayNumber,t,a.TAI)},P.prototype.addDays=function(e){var t=this._julianDayNumber+e;return new P(t,this._secondsOfDay,a.TAI)},P.prototype.lessThan=function(e){return P.compare(this,e)<0},P.prototype.lessThanOrEquals=function(e){return P.compare(this,e)<=0},P.prototype.greaterThan=function(e){return P.compare(this,e)>0},P.prototype.greaterThanOrEquals=function(e){return P.compare(this,e)>=0},P.prototype.compareTo=function(e){return P.compare(this,e)},P.prototype.equals=function(e){return P.equals(this,e)},P.prototype.equalsEpsilon=function(e,t){return P.equalsEpsilon(this,e,t)},0===o._leapSeconds.length&&(o._leapSeconds=[new o(new P(2441317,43210,a.TAI),10),new o(new P(2441499,43211,a.TAI),11),new o(new P(2441683,43212,a.TAI),12),new o(new P(2442048,43213,a.TAI),13),new o(new P(2442413,43214,a.TAI),14),new o(new P(2442778,43215,a.TAI),15),new o(new P(2443144,43216,a.TAI),16),new o(new P(2443509,43217,a.TAI),17),new o(new P(2443874,43218,a.TAI),18),new o(new P(2444239,43219,a.TAI),19),new o(new P(2444786,43220,a.TAI),20),new o(new P(2445151,43221,a.TAI),21),new o(new P(2445516,43222,a.TAI),22),new o(new P(2446247,43223,a.TAI),23),new o(new P(2447161,43224,a.TAI),24),new o(new P(2447892,43225,a.TAI),25),new o(new P(2448257,43226,a.TAI),26),new o(new P(2448804,43227,a.TAI),27),new o(new P(2449169,43228,a.TAI),28),new o(new P(2449534,43229,a.TAI),29),new o(new P(2450083,43230,a.TAI),30),new o(new P(2450630,43231,a.TAI),31),new o(new P(2451179,43232,a.TAI),32),new o(new P(2453736,43233,a.TAI),33),new o(new P(2454832,43234,a.TAI),34),new o(new P(2456109,43235,a.TAI),35)]),P}),r("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(n){n=r(n,r.EMPTY_OBJECT);var l=n.startTime,u=!i(l),c=n.stopTime,h=!i(c),d=n.currentTime,m=!i(d);u&&h&&m?(d=new s,l=s.clone(d),c=d.addDays(1)):u&&h?(l=s.clone(d),c=d.addDays(1)):u&&m?(l=c.addDays(-1),d=s.clone(l)):m&&h?(d=s.clone(l),c=l.addDays(1)):m?d=s.clone(l):h?c=d.addDays(1):u&&(l=s.clone(d)),this.startTime=l,this.stopTime=c,this.currentTime=d,this.multiplier=r(n.multiplier,1),this.clockStep=r(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=r(n.clockRange,e.UNBOUNDED),this.shouldAnimate=r(n.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=a()};return l.prototype.tick=function(){var r=a(),i=this.currentTime,n=this.startTime,o=this.stopTime,l=this.multiplier;if(this.shouldAnimate)if(this.clockStep===t.SYSTEM_CLOCK)i=new s;else{if(this.clockStep===t.TICK_DEPENDENT)i=i.addSeconds(l);else{var u=r-this._lastSystemTime;i=i.addSeconds(l*(u/1e3))}if(this.clockRange===e.CLAMPED)i.lessThan(n)?i=n:i.greaterThan(o)&&(i=o);else if(this.clockRange===e.LOOP_STOP)for(i.lessThan(n)&&(i=s.clone(n));i.greaterThan(o);)i=n.addSeconds(o.getSecondsDifference(i))}return this.currentTime=i,this._lastSystemTime=r,this.onTick.raiseEvent(this),i},l}),r("Core/Color",["./defaultValue","./defined","./freezeObject","./DeveloperError","./FeatureDetection","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var s=function(t,r,i,n){this.red=e(t,1),this.green=e(r,1),this.blue=e(i,1),this.alpha=e(n,1)};s.fromBytes=function(t,r,i,n){return t=s.byteToFloat(e(t,255)),r=s.byteToFloat(e(r,255)),i=s.byteToFloat(e(i,255)),n=s.byteToFloat(e(n,255)),new s(t,r,i,n)};var l,u,c;n.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(t,r,i,n){t=e(t,0)%1,r=e(r,0),i=e(i,0),n=e(n,1);var o=i,l=i,u=i;if(0!==r){var c;c=.5>i?i*(1+r):i+r-i*r;var h=2*i-c;o=a(h,c,t+1/3),l=a(h,c,t),u=a(h,c,t-1/3)}return new s(o,l,u,n)},s.fromRandom=function(r,i){r=e(r,e.EMPTY_OBJECT);var n=r.red;if(!t(n)){var a=e(r.minimumRed,0),l=e(r.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=r.green;if(!t(u)){var c=e(r.minimumGreen,0),h=e(r.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=r.blue;if(!t(d)){var m=e(r.minimumBlue,0),p=e(r.maximumBlue,1);d=m+o.nextRandomNumber()*(p-m)}var f=r.alpha;if(!t(f)){var v=e(r.minimumAlpha,0),g=e(r.maximumAlpha,1);f=v+o.nextRandomNumber()*(g-v)}return t(i)?(i.red=n,i.green=u,i.blue=d,i.alpha=f,i):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,m=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,p=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){var i=s[r.toUpperCase()];if(t(i))return s.clone(i);var n=h.exec(r);return null!==n?new s(parseInt(n[1],16)/15,parseInt(n[2],16)/15,parseInt(n[3],16)/15):(n=d.exec(r),null!==n?new s(parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255):(n=m.exec(r),null!==n?new s(parseFloat(n[1])/("%"===n[1].substr(-1)?100:255),parseFloat(n[2])/("%"===n[2].substr(-1)?100:255),parseFloat(n[3])/("%"===n[3].substr(-1)?100:255),parseFloat(e(n[4],"1.0"))):(n=p.exec(r),null!==n?s.fromHsl(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(e(n[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,r,i){i=e(i,0),r[i++]=t.red,r[i++]=t.green,r[i++]=t.blue,r[i]=t.alpha},s.unpack=function(r,i,n){return i=e(i,0),t(n)||(n=new s),n.red=r[i++],n.green=r[i++],n.blue=r[i++],n.alpha=r[i],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:0|256*e},s.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new s(e.red,e.green,e.blue,e.alpha):void 0},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var r=s.floatToByte(this.red),i=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=i,e[2]=n,e[3]=o,e):[r,i,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.ALICEBLUE=r(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=r(s.fromCssColorString("#FAEBD7")),s.AQUA=r(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=r(s.fromCssColorString("#7FFFD4")),s.AZURE=r(s.fromCssColorString("#F0FFFF")),s.BEIGE=r(s.fromCssColorString("#F5F5DC")),s.BISQUE=r(s.fromCssColorString("#FFE4C4")),s.BLACK=r(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=r(s.fromCssColorString("#FFEBCD")),s.BLUE=r(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=r(s.fromCssColorString("#8A2BE2")),s.BROWN=r(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=r(s.fromCssColorString("#DEB887")),s.CADETBLUE=r(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=r(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=r(s.fromCssColorString("#D2691E")),s.CORAL=r(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=r(s.fromCssColorString("#6495ED")),s.CORNSILK=r(s.fromCssColorString("#FFF8DC")),s.CRIMSON=r(s.fromCssColorString("#DC143C")),s.CYAN=r(s.fromCssColorString("#00FFFF")),s.DARKBLUE=r(s.fromCssColorString("#00008B")),s.DARKCYAN=r(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=r(s.fromCssColorString("#B8860B")),s.DARKGRAY=r(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=r(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=r(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=r(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=r(s.fromCssColorString("#556B2F")),s.DARKORANGE=r(s.fromCssColorString("#FF8C00")),s.DARKORCHID=r(s.fromCssColorString("#9932CC")),s.DARKRED=r(s.fromCssColorString("#8B0000")),s.DARKSALMON=r(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=r(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=r(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=r(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=r(s.fromCssColorString("#00CED1")),s.DARKVIOLET=r(s.fromCssColorString("#9400D3")),s.DEEPPINK=r(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=r(s.fromCssColorString("#00BFFF")),s.DIMGRAY=r(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=r(s.fromCssColorString("#1E90FF")),s.FIREBRICK=r(s.fromCssColorString("#B22222")),s.FLORALWHITE=r(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=r(s.fromCssColorString("#228B22")),s.FUSCHIA=r(s.fromCssColorString("#FF00FF")),s.GAINSBORO=r(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=r(s.fromCssColorString("#F8F8FF")),s.GOLD=r(s.fromCssColorString("#FFD700")),s.GOLDENROD=r(s.fromCssColorString("#DAA520")),s.GRAY=r(s.fromCssColorString("#808080")),s.GREEN=r(s.fromCssColorString("#008000")),s.GREENYELLOW=r(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=r(s.fromCssColorString("#F0FFF0")),s.HOTPINK=r(s.fromCssColorString("#FF69B4")),s.INDIANRED=r(s.fromCssColorString("#CD5C5C")),s.INDIGO=r(s.fromCssColorString("#4B0082")),s.IVORY=r(s.fromCssColorString("#FFFFF0")),s.KHAKI=r(s.fromCssColorString("#F0E68C")),s.LAVENDER=r(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=r(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=r(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=r(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=r(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=r(s.fromCssColorString("#F08080")),s.LIGHTCYAN=r(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=r(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=r(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=r(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=r(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=r(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=r(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=r(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=r(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=r(s.fromCssColorString("#FFFFE0")),s.LIME=r(s.fromCssColorString("#00FF00")),s.LIMEGREEN=r(s.fromCssColorString("#32CD32")),s.LINEN=r(s.fromCssColorString("#FAF0E6")),s.MAGENTA=r(s.fromCssColorString("#FF00FF")),s.MAROON=r(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=r(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=r(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=r(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=r(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=r(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=r(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=r(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=r(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=r(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=r(s.fromCssColorString("#191970")),s.MINTCREAM=r(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=r(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=r(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=r(s.fromCssColorString("#FFDEAD")),s.NAVY=r(s.fromCssColorString("#000080")),s.OLDLACE=r(s.fromCssColorString("#FDF5E6")),s.OLIVE=r(s.fromCssColorString("#808000")),s.OLIVEDRAB=r(s.fromCssColorString("#6B8E23")),s.ORANGE=r(s.fromCssColorString("#FFA500")),s.ORANGERED=r(s.fromCssColorString("#FF4500")),s.ORCHID=r(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=r(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=r(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=r(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=r(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=r(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=r(s.fromCssColorString("#FFDAB9")),s.PERU=r(s.fromCssColorString("#CD853F")),s.PINK=r(s.fromCssColorString("#FFC0CB")),s.PLUM=r(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=r(s.fromCssColorString("#B0E0E6")),s.PURPLE=r(s.fromCssColorString("#800080")),s.RED=r(s.fromCssColorString("#FF0000")),s.ROSYBROWN=r(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=r(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=r(s.fromCssColorString("#8B4513")),s.SALMON=r(s.fromCssColorString("#FA8072")),s.SANDYBROWN=r(s.fromCssColorString("#F4A460")),s.SEAGREEN=r(s.fromCssColorString("#2E8B57")),s.SEASHELL=r(s.fromCssColorString("#FFF5EE")),s.SIENNA=r(s.fromCssColorString("#A0522D")),s.SILVER=r(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=r(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=r(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=r(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=r(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=r(s.fromCssColorString("#00FF7F")),s.STEELBLUE=r(s.fromCssColorString("#4682B4")),s.TAN=r(s.fromCssColorString("#D2B48C")),s.TEAL=r(s.fromCssColorString("#008080")),s.THISTLE=r(s.fromCssColorString("#D8BFD8")),s.TOMATO=r(s.fromCssColorString("#FF6347")),s.TURQUOISE=r(s.fromCssColorString("#40E0D0")),s.VIOLET=r(s.fromCssColorString("#EE82EE")),s.WHEAT=r(s.fromCssColorString("#F5DEB3")),s.WHITE=r(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=r(s.fromCssColorString("#F5F5F5")),s.YELLOW=r(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=r(s.fromCssColorString("#9ACD32")),s}),r("Core/ColorGeometryInstanceAttribute",["./defaultValue","./defined","./Color","./ComponentDatatype","./DeveloperError"],function(e,t,r,i){"use strict";var n=function(t,n,o,a){t=e(t,1),n=e(n,1),o=e(o,1),a=e(a,1),this.componentDatatype=i.UNSIGNED_BYTE,this.componentsPerAttribute=4,this.normalize=!0,this.value=new Uint8Array([r.floatToByte(t),r.floatToByte(n),r.floatToByte(o),r.floatToByte(a)])};return n.fromColor=function(e){return new n(e.red,e.green,e.blue,e.alpha)},n.toValue=function(e,r){return t(r)?e.toBytes(r):new Uint8Array(e.toBytes())},n}),r("Core/CornerType",["../Core/Enumeration"],function(e){"use strict";var t={ROUNDED:new e(0,"ROUNDED"),MITERED:new e(1,"MITERED"),BEVELED:new e(2,"BEVELED")};return t}),r("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,n=(r-i)/r,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,m=1-d,p=Math.sqrt(m),f=t/4,v=f*f,g=v*f,_=v*v,y=1+f-3*v/4+5*g/4-175*_/64,C=1-f+15*v/8-35*g/8,S=1-3*f+35*v/4,w=1-5*f,E=y*c-C*Math.sin(2*c)*f/2-S*Math.sin(4*c)*v/16-w*Math.sin(6*c)*g/48-5*Math.sin(8*c)*_/512,x=e._constants;x.a=r,x.b=i,x.f=n,x.cosineHeading=o,x.sineHeading=a,x.tanU=s,x.cosineU=l,x.sineU=u,x.sigma=c,x.sineAlpha=h,x.sineSquaredAlpha=d,x.cosineSquaredAlpha=m,x.cosineAlpha=p,x.u2Over4=f,x.u4Over16=v,x.u6Over64=g,x.u8Over256=_,x.a0=y,x.a1=C,x.a2=S,x.a3=w,x.distanceRatio=E}function l(e,t){return e*t*(4+e*(4-3*t))/16}function u(e,t,r,i,n,o,a){var s=l(e,r);return(1-s)*e*t*(i+s*n*(a+s*o*(2*a*a-1)))}function c(e,t,r,i,n,o,s){var l,c,h,d,m,p=(t-r)/t,f=o-i,v=Math.atan((1-p)*Math.tan(n)),g=Math.atan((1-p)*Math.tan(s)),_=Math.cos(v),y=Math.sin(v),C=Math.cos(g),S=Math.sin(g),w=_*C,E=_*S,x=y*S,b=y*C,T=f,A=a.TWO_PI,P=Math.cos(T),D=Math.sin(T);do{P=Math.cos(T),D=Math.sin(T);var M=E-b*P;h=Math.sqrt(C*C*D*D+M*M),c=x+w*P,l=Math.atan2(h,c);var I;0===h?(I=0,d=1):(I=w*D/h,d=1-I*I),A=T,m=c-2*x/d,isNaN(m)&&(m=0),T=f+u(p,I,d,l,h,c,m)}while(Math.abs(T-A)>a.EPSILON12);var O=d*(t*t-r*r)/(r*r),R=1+O*(4096+O*(O*(320-175*O)-768))/16384,L=O*(256+O*(O*(74-47*O)-128))/1024,N=m*m,B=L*h*(m+L*(c*(2*N-1)-L*m*(4*h*h-3)*(4*N-3)/6)/4),z=r*R*(l-B),F=Math.atan2(C*D,E-b*P),V=Math.atan2(_*D,E*P-b);e._distance=z,e._startHeading=F,e._endHeading=V,e._uSquared=O}function h(r,i,n,o){e.normalize(o.cartographicToCartesian(i,m),d),e.normalize(o.cartographicToCartesian(n,m),m),c(r,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),i.height=0,n.height=0,r._start=t.clone(i,r._start),r._end=t.clone(n,r._end),s(r)}var d=new e,m=new e,p=function(e,n,a){var s=r(a,o.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,i(e)&&i(n)&&h(this,e,n,s)};return p.prototype.getSurfaceDistance=function(){return this._distance},p.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},p.prototype.getStart=function(){return this._start},p.prototype.getEnd=function(){return this._end},p.prototype.getStartHeading=function(){return this._startHeading},p.prototype.getEndHeading=function(){return this._endHeading},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,r){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),c=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),m=Math.sin(8*o),p=o*o,f=o*p,v=n.u8Over256,g=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*f*v*a/3+o*(1-g+7*y/4-15*_/4+579*v/64-(y-15*_/4+187*v/16)*a-(5*_/4-115*v/16)*s-29*v*l/16)+(g/2-y+71*_/32-85*v/16)*c+(5*y/16-5*_/4+383*v/96)*h-p*((_-11*v/2)*c+5*v*h/2)+(29*_/96-29*v/16)*d+539*v*m/1536,S=Math.asin(Math.sin(C)*n.cosineAlpha),w=Math.atan(n.a/n.b*Math.tan(S));C-=n.sigma;var E=Math.cos(2*n.sigma+C),x=Math.sin(C),b=Math.cos(C),T=n.cosineU*b,A=n.sineU*x,P=Math.atan2(x*n.sineHeading,T-A*n.cosineHeading),D=P-u(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,x,b,E);return i(r)?(r.longitude=this._start.longitude+D,r.latitude=w,r.height=0,r):new t(this._start.longitude+D,w,0)},p}),r("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(t,r,i,n){var o=n.scaleToGeodeticSurface(t,T),a=n.scaleToGeodeticSurface(r,A),s=e.angleBetween(o,a),l=Math.ceil(s/i),u=new Array(3*l),c=n.cartesianToCartographic(o,E),h=n.cartesianToCartographic(a,x);P.setEndPoints(c,h);var d=P.getSurfaceDistance()/l,m=0;c.height=0;var p=n.cartographicToCartesian(c,b);u[m++]=p.x,u[m++]=p.y,u[m++]=p.z;for(var f=1;l>f;f++){var v=P.interpolateUsingSurfaceDistance(f*d,x);p=n.cartographicToCartesian(v,b),u[m++]=p.x,u[m++]=p.y,u[m++]=p.z}return u}function m(t,r,i){var n=D;return i.geodeticSurfaceNormal(t,n),e.multiplyByScalar(n,r,n),e.add(t,n,t),t}var p={},f=new c,v=new e,g=new e,_=new h(e.ZERO,0),y=new e,C=new h(e.ZERO,0),S=new e,w=new e,E=new t,x=new t,b=new e,T=new e,A=new e,P=new a,D=new e,M=new e;return p.wrapLongitude=function(t,n){var o=[],a=[];if(i(t)&&t.length>0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,f),u=c.multiplyByPoint(l,e.ZERO,v),d=c.multiplyByPointAsVector(l,e.UNIT_Y,g),m=h.fromPointNormal(u,d,_),p=c.multiplyByPointAsVector(l,e.UNIT_X,y),E=h.fromPointNormal(u,p,C),x=1;o.push(e.clone(t[0]));for(var b=o[0],T=t.length,A=1;T>A;++A){var P=t[A];if(h.getPointDistance(E,b)<0||h.getPointDistance(E,P)<0){var D=s.lineSegmentPlane(b,P,m,S);if(i(D)){var M=e.multiplyByScalar(d,5e-9,w);h.getPointDistance(m,b)<0&&e.negate(M,M),o.push(e.add(D,M)),a.push(x+1),e.negate(M,M),o.push(e.add(D,M)),x=1}}o.push(e.clone(t[A])),x++,b=P}a.push(x)}return{positions:o,lengths:a}},p.removeDuplicates=function(t){var r=t.length;if(2>r)return t.slice(0);var i=[];i.push(t[0]);for(var n=1;r>n;++n){var o=t[n-1],a=t[n];e.equals(o,a)||i.push(a)}return i},p.scaleToSurface=function(e,t,i){t=r(t,u.RADIANS_PER_DEGREE),i=r(i,o.WGS84);for(var n=e.length,a=[],s=0;n-1>s;s++){var l=e[s],c=e[s+1];a=a.concat(d(l,c,t,i))}var h=e[n-1],m=i.cartesianToCartographic(h,E);m.height=0;var p=i.cartographicToCartesian(m,b);return a.push(p.x,p.y,p.z),a},p.scaleToGeodeticHeight=function(t,a,s,u){s=r(s,o.WGS84);var c,h,d=t.length,p=M;if(i(u)){if(u.length!==t.length)throw new n("result.length must be equal to positions.length");h=u}else h=new Array(t.length);if(0===a){for(c=0;d>c;c+=3)p=s.scaleToGeodeticSurface(e.fromArray(t,c,p),p),h[c]=p.x,h[c+1]=p.y,h[c+2]=p.z;return h}var f;if(l(a)){if(a.length!==d/3)throw new n("height.length must be equal to positions.length");for(c=0;d>c;c+=3)f=a[c/3],p=e.fromArray(t,c,p),p=m(p,f,s),h[c]=p.x,h[c+1]=p.y,h[c+2]=p.z}else for(f=a,c=0;d>c;c+=3)p=e.fromArray(t,c,p),p=m(p,f,s),h[c]=p.x,h[c+1]=p.y,h[c+2]=p.z;return h},p}),r("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=i.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function r(e,t,r,i){return(t||"")+r.toLowerCase()+(i||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var i=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,r).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(r.path=t.authority&&""==t.path?"/"+this.path:t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],i=""==t[0];for(i&&t.shift(),""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);("."==e||".."==e)&&r.push(""),i&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),r("Core/buildModuleUrl",["require","./defined","./DeveloperError","../ThirdParty/Uri"],function(e,t,r,i){"use strict";function n(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var i=e[t].getAttribute("src"),n=h.exec(i);if(null!==n)return n[1]}return void 0}function o(){if(t(l))return l;var e;if(e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:n(),!t(e))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new i(e).resolve(new i(document.location.href))}function a(t){return e.toUrl("../"+t)}function s(e){return new i(e).resolve(o()).toString()}var l,u,c,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(r){t(u)||(u=t(e.toUrl)?a:s),t(c)||(c=document.createElement("a"));var i=u(r);return c.href=i,c.href=c.href,c.href};return d._cesiumScriptRegex=h,d}),r("Core/Iau2006XysSample",[],function(){"use strict";var e=function(e,t,r){this.x=e,this.y=t,this.s=r};return e}),r("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(r,i){if(null===r||"object"!=typeof r)return r;i=e(i,!1);var n=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i&&(a=t(a,i)),n[o]=a}return n};return t}),r("Core/parseResponseHeaders",[],function(){"use strict";var e=function(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),i=0;i0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t};return e}),r("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";var r=function(e,r,i){this.statusCode=e,this.response=r,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))};return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,i,n){return t(e).then(r,i,n)}function t(e){var t,r;return e instanceof i?t=e:s(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=n(e),t}function r(t){return e(t,o)}function i(e){this.then=e}function n(e){var r=new i(function(r){try{return t(r?r(e):e)}catch(i){return o(i)}});return r}function o(e){var r=new i(function(r,i){try{return i?t(i(e)):o(e)}catch(n){return o(n)}});return r}function a(){function e(e,t,r){return d(e,t,r) +}function r(e){return p(e)}function n(e){return p(o(e))}function s(e){return m(e)}var l,u,c,h,d,m,p;return u=new i(e),l={then:e,resolve:r,reject:n,progress:s,promise:u,resolver:{resolve:r,reject:n,progress:s}},c=[],h=[],d=function(e,t,r){var i,n;return i=a(),n="function"==typeof r?function(e){try{i.progress(r(e))}catch(t){i.progress(t)}}:function(e){i.progress(e)},c.push(function(r){r.then(e,t).then(i.resolve,i.reject,n)}),h.push(n),i.promise},m=function(e){return f(h,e),e},p=function(e){return e=t(e),d=e.then,p=t,m=g,f(c,e),h=c=S,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,r,i,n,o){return v(2,arguments),e(t,function(t){function s(e){f(e)}function l(e){p(e)}var u,c,h,d,m,p,f,v,_,y;if(_=t.length>>>0,u=Math.max(0,Math.min(r,_)),h=[],c=_-u+1,d=[],m=a(),u)for(v=m.progress,f=function(e){d.push(e),--c||(p=f=g,m.reject(d))},p=function(e){h.push(e),--u||(p=f=g,m.resolve(h))},y=0;_>y;++y)y in t&&e(t[y],l,s,v);else m.resolve(h);return m.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return v(1,arguments),d(e,_).then(t,r,i)}function h(){return d(arguments,_)}function d(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;n>l;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function m(t,r){var i=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},y.apply(t,i)})}function p(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function f(e,t){for(var r,i=0;r=e[i++];)r(t)}function v(e,t){for(var r,i=t.length;i>e;)if(r=t[--i],null!=r&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function g(){}function _(e){return e}var y,C,S;return e.defer=a,e.resolve=t,e.reject=r,e.join=h,e.all=c,e.map=d,e.reduce=m,e.any=u,e.some=l,e.chain=p,e.isPromise=s,i.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(S,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(S,t)})})}},C=[].slice,y=[].reduce||function(e){var t,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;n>o;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof r&&r.amd?r:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),r("Core/loadWithXhr",["./defined","./defaultValue","./DeveloperError","./RequestErrorEvent","../ThirdParty/when"],function(e,t,r,i,n){"use strict";var o=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.responseType,i=t(e.method,"GET"),a=e.data,s=e.headers;return n(e.url,function(e){var t=n.defer();return o.load(e,r,i,a,s,t),t.promise})};return o.load=function(t,r,n,o,a,s){var l=new XMLHttpRequest;if(l.open(n,t,!0),e(a))for(var u in a)a.hasOwnProperty(u)&&l.setRequestHeader(u,a[u]);e(r)&&(l.responseType=r),l.onload=function(){200===l.status?s.resolve(l.response):s.reject(new i(l.status,l.response,l.getAllResponseHeaders()))},l.onerror=function(){s.reject(new i)},l.send(o)},o.defaultLoad=o.load,o}),r("Core/loadText",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,headers:r})};return t}),r("Core/loadJson",["./clone","./defined","./loadText","./DeveloperError"],function(e,t,r){"use strict";var i={Accept:"application/json,*/*;q=0.01"},n=function(n,o){return t(o)?t(o.Accept)||(o=e(o),o.Accept=i.Accept):o=i,r(n,o).then(function(e){return JSON.parse(e)})};return n}),r("Core/Iau2006XysData",["./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard","../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=h;return i._julianDayNumber=t,i._secondsOfDay=r,e._sampleZeroDateTT.getDaysDifference(i)}function u(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];var n=s.defer();t._chunkDownloadsInProgress[i]=n;var a,l=t._xysFileUrlTemplate;return a=r(l)?l.replace("{0}",i):e("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),s(o(a),function(e){t._chunkDownloadsInProgress[i]=!1;for(var r=t._samples,o=e.samples,a=3*i*t._samplesPerXysFile,s=0,l=o.length;l>s;++s)r[a+s]=o[s];n.resolve()}),n.promise}var c=function(e){e=t(e,t.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=t(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=t(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new n(this._sampleZeroJulianEphemerisDate,0,a.TAI),this._stepSizeDays=t(e.stepSizeDays,1),this._samplesPerXysFile=t(e.samplesPerXysFile,1e3),this._totalSamples=t(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var r=this._interpolationOrder,i=this._denominators=new Array(r+1),o=this._xTable=new Array(r+1),s=Math.pow(this._stepSizeDays,r),l=0;r>=l;++l){i[l]=s,o[l]=l*this._stepSizeDays;for(var u=0;r>=u;++u)u!==l&&(i[l]*=l-u);i[l]=1/i[l]}this._work=new Array(r+1),this._coef=new Array(r+1)},h=new n(0,0,a.TAI);return c.prototype.preload=function(e,t,r,i){var n=l(this,e,t),o=l(this,r,i),a=0|n/this._stepSizeDays-this._interpolationOrder/2;0>a&&(a=0);var c=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);for(var h=0|a/this._samplesPerXysFile,d=0|c/this._samplesPerXysFile,m=[],p=h;d>=p;++p)m.push(u(this,p));return s.all(m)},c.prototype.computeXysRadians=function(e,t,n){var o=l(this,e,t);if(0>o)return void 0;var a=0|o/this._stepSizeDays;if(a>=this._totalSamples)return void 0;var s=this._interpolationOrder,c=a-(0|s/2);0>c&&(c=0);var h=c+s;h>=this._totalSamples&&(h=this._totalSamples-1,c=h-s,0>c&&(c=0));var d=!1,m=this._samples;if(r(m[3*c])||(u(this,0|c/this._samplesPerXysFile),d=!0),r(m[3*h])||(u(this,0|h/this._samplesPerXysFile),d=!0),d)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var p,f,v=o-c*this._stepSizeDays,g=this._work,_=this._denominators,y=this._coef,C=this._xTable;for(p=0;s>=p;++p)g[p]=v-C[p];for(p=0;s>=p;++p){for(y[p]=1,f=0;s>=f;++f)f!==p&&(y[p]*=g[f]);y[p]*=_[p];var S=3*(c+p);n.x+=y[p]*m[S++],n.y+=y[p]*m[S++],n.s+=y[p]*m[S]}return n},c}),r("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(e,t,r,i,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=i,this.ut1MinusUtc=n};return e}),r("Core/EarthOrientationParameters",["./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./loadJson","./JulianDate","./LeapSecond","./RuntimeError","./TimeConstants","./TimeStandard","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){return a.compare(e.julianDate,t)}function m(t,i){if(!r(i.columnNames))return t._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(i.samples))return t._dataError="Error in loaded EOP data: The samples property is required.",void 0;var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),h=i.columnNames.indexOf("ut1MinusUtcSeconds"),m=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>h||0>m||0>p||0>f)return t._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var v=t._samples=i.samples,g=t._dates=[];t._dateColumn=n,t._xPoleWanderRadiansColumn=o,t._yPoleWanderRadiansColumn=l,t._ut1MinusUtcSecondsColumn=h,t._xCelestialPoleOffsetRadiansColumn=m,t._yCelestialPoleOffsetRadiansColumn=p,t._taiMinusUtcSecondsColumn=f,t._columnCount=i.columnNames.length,t._lastIndex=void 0;for(var _,y=t._addNewLeapSeconds,C=0,S=v.length;S>C;C+=t._columnCount){var w=v[C+n],E=v[C+f],x=w+u.MODIFIED_JULIAN_DATE_DIFFERENCE,b=new a(x,E,c.TAI);if(g.push(b),y){if(E!==_&&r(_)){var T=s.getLeapSeconds(),A=e(T,b,d);if(0>A){var P=new s(b,E);T.splice(~A,0,P)}}_=E}}}function p(e,t,r,i,n){var o=r*i;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function f(e,t,r){return t+e*(r-t)}function v(e,t,r,i,n,o,a){var s=e._columnCount;if(o>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;var l=t[n],u=t[o];if(l.equals(u)||i.equals(l))return p(e,r,n,s,a),a;if(i.equals(u))return p(e,r,o,s,a),a;var c=l.getSecondsDifference(i)/l.getSecondsDifference(u),h=n*s,d=o*s,m=r[h+e._ut1MinusUtcSecondsColumn],v=r[d+e._ut1MinusUtcSecondsColumn],g=v-m;if(g>.5||-.5>g){var _=r[h+e._taiMinusUtcSecondsColumn],y=r[d+e._taiMinusUtcSecondsColumn];_!==y&&(u.equals(i)?m=v:v-=y-_)}return a.xPoleWander=f(c,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),a.yPoleWander=f(c,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),a.xPoleOffset=f(c,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=f(c,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=f(c,m,v),a}var g=function(e){if(e=t(e,t.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=t(e.addNewLeapSeconds,!0),r(e.data))m(this,e.data);else if(r(e.url)){var i=this;this._downloadPromise=h(o(e.url),function(e){m(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+e.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return g.NONE=n({getPromiseToLoad:function(){return h()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),g.prototype.getPromiseToLoad=function(){return h(this._downloadPromise)},g.prototype.compute=function(t,n){if(!r(this._samples)){if(r(this._dataError))throw new l(this._dataError);return void 0}if(r(n)||(n=new i(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var o=this._dates,s=this._lastIndex,u=0,c=0;if(r(s)){var h=o[s],d=o[s+1],m=h.lessThanOrEquals(t),p=!r(d),f=p||d.greaterThanOrEquals(t);if(m&&f)return u=s,!p&&d.equals(t)&&++u,c=u+1,v(this,o,this._samples,t,u,c,n),n}var g=e(o,t,a.compare,this._dateColumn);return g>=0?(gu&&(u=0)),this._lastIndex=u,v(this,o,this._samples,t,u,c,n),n},g}),r("Core/Transforms",["./defaultValue","./defined","./DeveloperError","./Iau2006XysData","./Iau2006XysSample","./Math","./Matrix3","./Matrix4","./Cartesian2","./Cartesian3","./Cartesian4","./TimeConstants","./Ellipsoid","./EarthOrientationParameters","./EarthOrientationParametersSample","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";var v={},g=new u,_=new u,y=new u;v.eastNorthUpToFixedFrame=function(r,i,n){if(o.equalsEpsilon(r.x,0,o.EPSILON14)&&o.equalsEpsilon(r.y,0,o.EPSILON14)){var a=o.sign(r.z);return t(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-a,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(0,-a,0,r.x,1,0,0,r.y,0,0,a,r.z,0,0,0,1)}var l=g,c=_,h=y;return i=e(i,d.WGS84),i.geodeticSurfaceNormal(r,l),c.x=-r.y,c.y=r.x,c.z=0,u.normalize(c,c),u.cross(l,c,h),t(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=h.x,n[5]=h.y,n[6]=h.z,n[7]=0,n[8]=l.x,n[9]=l.y,n[10]=l.z,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(c.x,h.x,l.x,r.x,c.y,h.y,l.y,r.y,c.z,h.z,l.z,r.z,0,0,0,1)};var C=new u,S=new u,w=new u;v.northEastDownToFixedFrame=function(r,i,n){if(o.equalsEpsilon(r.x,0,o.EPSILON14)&&o.equalsEpsilon(r.y,0,o.EPSILON14)){var a=o.sign(r.z);return t(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-a,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(-a,0,0,r.x,0,1,0,r.y,0,0,-a,r.z,0,0,0,1)}var l=C,c=S,h=w;return i=e(i,d.WGS84),i.geodeticSurfaceNormal(r,l),c.x=-r.y,c.y=r.x,c.z=0,u.normalize(c,c),u.cross(l,c,h),t(n)?(n[0]=h.x,n[1]=h.y,n[2]=h.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=-l.x,n[9]=-l.y,n[10]=-l.z,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(h.x,c.x,-l.x,r.x,h.y,c.y,-l.y,r.y,h.z,c.z,-l.z,r.z,0,0,0,1)};var E=24110.54841,x=8640184.812866,b=.093104,T=-62e-7,A=1.1772758384668e-19,P=72921158553e-15,D=o.TWO_PI/86400;v.computeTemeToPseudoFixedMatrix=function(e,r){var i,n=e.addSeconds(-e.getTaiMinusUtc()),s=n.getJulianDayNumber(),l=n.getSecondsOfDay(),u=s-2451545;i=l>=43200?(u+.5)/h.DAYS_PER_JULIAN_CENTURY:(u-.5)/h.DAYS_PER_JULIAN_CENTURY;var c=E+i*(x+i*(b+i*T)),d=c*D%o.TWO_PI,m=P+A*(s-2451545.5),p=(l+.5*h.SECONDS_PER_DAY)%h.SECONDS_PER_DAY,f=d+m*p,v=Math.cos(f),g=Math.sin(f);return t(r)?(r[0]=v,r[1]=-g,r[2]=0,r[3]=g,r[4]=v,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new a(v,g,0,-g,v,0,0,0,1)},v.iau2006XysData=new i,v.earthOrientationParameters=m.NONE;var M=32.184,I=2451545;v.preloadIcrfFixed=function(e){var t=e.start.getJulianDayNumber(),r=e.start.getSecondsOfDay()+M,i=e.stop.getJulianDayNumber(),n=e.stop.getSecondsOfDay()+M,o=v.iau2006XysData.preload(t,r,i,n),a=v.earthOrientationParameters.getPromiseToLoad();return f.all([o,a])},v.computeIcrfToFixedMatrix=function(e,r){var i=v.computeFixedToIcrfMatrix(e,r);return t(i)?a.transpose(i,r):void 0};var O=new n(0,0,0),R=new p(0,0,0,0,0,0),L=new a,N=new a;v.computeFixedToIcrfMatrix=function(e,r){var i=v.earthOrientationParameters.compute(e,R);if(!t(i))return void 0;var n=e.getJulianDayNumber(),s=e.getSecondsOfDay()+M,l=v.iau2006XysData.computeXysRadians(n,s,O);if(!t(l))return void 0;var u=l.x+i.xPoleOffset,c=l.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-u*u-c*c)),m=L;m[0]=1-d*u*u,m[3]=-d*u*c,m[6]=u,m[1]=-d*u*c,m[4]=1-d*c*c,m[7]=c,m[2]=-u,m[5]=-c,m[8]=1-d*(u*u+c*c);var p=a.fromRotationZ(-l.s,N),f=a.multiply(m,p,L),g=e.getJulianDayNumber(),_=e.getSecondsOfDay()-e.getTaiMinusUtc()+i.ut1MinusUtc,y=g-2451545,C=_/h.SECONDS_PER_DAY,S=.779057273264+C+.00273781191135448*(y+C);S=S%1*o.TWO_PI;var w=a.fromRotationZ(S,N),E=a.multiply(f,w,L),x=Math.cos(i.xPoleWander),b=Math.cos(i.yPoleWander),T=Math.sin(i.xPoleWander),A=Math.sin(i.yPoleWander),P=n-I+s/h.SECONDS_PER_DAY;P/=36525;var D=-47e-6*P*o.RADIANS_PER_DEGREE/3600,B=Math.cos(D),z=Math.sin(D),F=N;return F[0]=x*B,F[1]=x*z,F[2]=T,F[3]=-b*z+A*T*B,F[4]=b*B+A*T*z,F[5]=-A*x,F[6]=-A*z-b*T*B,F[7]=A*B-b*T*z,F[8]=b*x,a.multiply(E,F,r)};var B=new c;return v.pointToWindowCoordinates=function(e,t,r,i){var n=B;return s.multiplyByVector(e,c.fromElements(r.x,r.y,r.z,1,n),n),c.multiplyByScalar(n,1/n.w,n),s.multiplyByVector(t,n,n),l.fromCartesian4(n,i)},v}),r("Core/Ray",["./DeveloperError","./defaultValue","./Cartesian3"],function(e,t,r){"use strict";var i=function(e,i){i=r.clone(t(i,r.ZERO)),r.equals(i,r.ZERO)||r.normalize(i,i),this.origin=r.clone(t(e,r.ZERO)),this.direction=i};return i.prototype.getPoint=function(e,t){return t=r.multiplyByScalar(this.direction,e,t),r.add(this.origin,t,t)},i}),r("Core/EllipsoidTangentPlane",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Transforms","./AxisAlignedBoundingBox","./IntersectionTests","./Cartesian2","./Cartesian3","./Ellipsoid","./Matrix4","./Ray","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(t,r){r=e(r,u.WGS84),t=r.scaleToGeodeticSurface(t);var i=n.eastNorthUpToFixedFrame(t,r);this._ellipsoid=r,this._origin=l.clone(t),this._xAxis=l.fromCartesian4(c.getColumn(i,0)),this._yAxis=l.fromCartesian4(c.getColumn(i,1));var o=l.fromCartesian4(c.getColumn(i,2));this._plane=d.fromPointNormal(t,o)};r(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new o;m.fromPoints=function(e,t){var r=o.fromPoints(e,p);return new m(r.center,t)};var f=new h,v=new l;m.prototype.projectPointOntoPlane=function(e,r){var i=f;i.origin=e,l.normalize(e,i.direction);var n=a.rayPlane(i,this._plane,v);if(t(n)||(l.negate(i.direction,i.direction),n=a.rayPlane(i,this._plane,v)),t(n)){var o=l.subtract(n,this._origin,n),u=l.dot(this._xAxis,o),c=l.dot(this._yAxis,o);return t(r)?(r.x=u,r.y=c,r):new s(u,c)}return void 0},m.prototype.projectPointsOntoPlane=function(e,r){t(r)||(r=[]);for(var i=0,n=e.length,o=0;n>o;o++){var a=this.projectPointOntoPlane(e[o],r[i]);t(a)&&(r[i]=a,i++)}return r.length=i,r};var g=new l;return m.prototype.projectPointsOntoEllipsoid=function(e,r){var i=e.length;t(r)?r.length=i:r=new Array(i);for(var n=this._ellipsoid,o=this._origin,a=this._xAxis,s=this._yAxis,u=g,c=0;i>c;++c){var h=e[c];l.multiplyByScalar(a,h.x,u);var d=r[c]=l.add(o,u,r[c]);l.multiplyByScalar(s,h.y,u),l.add(d,u,d),n.scaleToGeocentricSurface(d,d)}return r},m}),r("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){for(var r=new Array(e.length),i=0;io;o++)c[o]=r;return c.push(i),c}var h=i-r,d=h/u;for(o=1;u>o;o++){var m=r+o*d;c[o]=m}return c[0]=r,c.push(i),c}function p(r,i,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,r,Y),Y),u=s.projectPointOntoPlane(t.add(n,i,X),X),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function f(e,r,i,n,o,a,u,c){var d=k,m=U;B=h.eastNorthUpToFixedFrame(e,o,B),d=l.multiplyByPointAsVector(B,N,d),d=t.normalize(d,d);var f=p(d,r,e,o);F=s.fromRotationZ(f,F),W.z=a,B=l.multiplyTransformation(B,l.fromRotationTranslation(F,W,z),B);var v=V;v[0]=u;for(var g=0;c>g;g++)for(var _=0;_l;l++){s=e[l];var u=s.x-o,c=s.y-a;i[n++]=u,i[n++]=0,i[n++]=c,i[n++]=u,i[n++]=0,i[n++]=c}return s=e[0],i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a,i}function _(e,t){for(var r=e.length,i=new Array(3*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;r>s;s++)i[n++]=e[s].x-o,i[n++]=0,i[n++]=e[s].y-a;return i}function y(e,r,i,o,l,u,h,d,m,p){var v,g=t.angleBetween(t.subtract(r,e,I),t.subtract(i,e,O)),_=o.value===n.BEVELED.value?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,I),g/(_+1),H),q):s.fromQuaternion(c.fromAxisAngle(e,g/(_+1),H),q);var y,C;if(r=t.clone(r,j),_>0)for(var S=p?2:1,w=0;_>w;w++)r=s.multiplyByVector(v,r,r),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,m,1,S);else y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,m,1,1),i=t.clone(i,j),y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,O),h=f(C,y,d,h,u,m,1,1);return h}function C(e,t){return a.equalsEpsilon(e.latitude,t.latitude,a.EPSILON6)&&a.equalsEpsilon(e.longitude,t.longitude,a.EPSILON6)}var S=[new t,new t],w=new t,E=new t,x=new t,b=new t,T=new t,A=new t,P=new t,D=new t,M=new t,I=new t,O=new t,R={},L=new i,N=new t(-1,0,0),B=new l,z=new l,F=new s,V=s.IDENTITY.clone(),k=new t,U=new r,W=new t,G=new t,H=new c,j=new t,q=new s;R.removeDuplicatesFromShape=function(t){for(var r=t.length,i=[],n=r-1,o=0;r>o;n=o++){var a=t[n],s=t[o];e.equals(a,s)||i.push(s)}return i};var Y=new t,X=new t;R.angleIsGreaterThanPi=function(e,r,i,n){var a=new o(i,n),s=a.projectPointOntoPlane(t.add(i,e,Y),Y),l=a.projectPointOntoPlane(t.add(i,r,X),X);return l.x*s.y-l.y*s.x>=0};var Z=new i,J=new i;return R.removeDuplicatesFromPositions=function(e,t){var r=e.length;if(2>r)return e.slice(0);var i=[];i.push(e[0]);for(var n=1;r>n;++n){var o=e[n-1],a=e[n],s=t.cartesianToCartographic(o,Z),l=t.cartesianToCartographic(a,J);C(s,l)||i.push(a)}return i},R.computePositions=function(e,r,i,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,p=o._cornerType,C=s?g(r,i):_(r,i),O=s?_(r,i):void 0,L=i.height/2,N=i.width/2,B=e.length,z=[],F=s?[]:void 0,V=w,k=E,U=x,W=b,G=T,H=A,j=P,q=D,Y=M,X=e[0],Z=e[1];W=l.geodeticSurfaceNormal(X,W),V=t.subtract(Z,X,V),V=t.normalize(V,V),q=t.cross(W,V,q),q=t.normalize(q,q);var J=c[0],Q=c[1];s&&(F=f(X,q,O,F,l,J+L,1,1)),Y=t.clone(X,Y),X=Z,k=t.negate(V,k);for(var K,$,et=1;B-1>et;et++){var tt=s?2:1;Z=e[et+1],V=t.subtract(Z,X,V),V=t.normalize(V,V),U=t.add(V,k,U),U=t.normalize(U,U),W=l.geodeticSurfaceNormal(X,W);var rt=!t.equalsEpsilon(t.negate(U,I),W,a.EPSILON2);if(rt){U=t.cross(U,W,U),U=t.cross(W,U,U),U=t.normalize(U,U);var it=1/Math.max(.25,t.magnitude(t.cross(U,k,I))),nt=R.angleIsGreaterThanPi(V,k,X,l);nt?(G=t.add(X,t.multiplyByScalar(U,it*N,U),G),H=t.add(G,t.multiplyByScalar(q,N,H),H),S[0]=t.clone(Y,S[0]),S[1]=t.clone(H,S[1]),K=m(S,J+L,Q+L,h),$=u.scaleToSurface(S),z=v($,q,C,z,l,K,1),q=t.cross(W,V,q),q=t.normalize(q,q),j=t.add(G,t.multiplyByScalar(q,N,j),j),p.value===n.ROUNDED.value||p.value===n.BEVELED.value?y(G,H,j,p,nt,l,z,C,Q+L,s):(U=t.negate(U,U),z=f(X,U,C,z,l,Q+L,it,tt)),Y=t.clone(j,Y)):(G=t.add(X,t.multiplyByScalar(U,it*N,U),G),H=t.add(G,t.multiplyByScalar(q,-N,H),H),S[0]=t.clone(Y,S[0]),S[1]=t.clone(H,S[1]),K=m(S,J+L,Q+L,h),$=u.scaleToSurface(S,h,l),z=v($,q,C,z,l,K,1),q=t.cross(W,V,q),q=t.normalize(q,q),j=t.add(G,t.multiplyByScalar(q,-N,j),j),p.value===n.ROUNDED.value||p.value===n.BEVELED.value?y(G,H,j,p,nt,l,z,C,Q+L,s):z=f(X,U,C,z,l,Q+L,it,tt),Y=t.clone(j,Y)),k=t.negate(V,k)}else z=f(Y,q,C,z,l,J+L,1,1),Y=X;J=Q,Q=c[et+1],X=Z}S[0]=t.clone(Y,S[0]),S[1]=t.clone(X,S[1]),K=m(S,J+L,Q+L,h),$=u.scaleToSurface(S,h,l),z=v($,q,C,z,l,K,1),s&&(F=f(X,q,O,F,l,Q+L,1,1)),B=z.length;var ot=s?B+F.length:B,at=new Float64Array(ot);return at.set(z),s&&at.set(F,B),at},R}),r("Core/CorridorGeometryLibrary",["./defined","./Cartesian3","./CornerType","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Matrix3","./Quaternion","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,i,n,l,u){var c=t.angleBetween(t.subtract(i,e,p),t.subtract(n,e,f)),h=l.value===r.BEVELED.value?1:Math.ceil(c/s.toRadians(5))+1,d=3*h,m=new Array(d);m[d-3]=n.x,m[d-2]=n.y,m[d-1]=n.z;var v;v=u?o.fromQuaternion(a.fromAxisAngle(t.negate(e,p),c/h,D),M):o.fromQuaternion(a.fromAxisAngle(e,c/h,D),M);var g=0;i=t.clone(i,p);for(var _=0;h>_;_++)i=o.multiplyByVector(v,i,i),m[g++]=i.x,m[g++]=i.y,m[g++]=i.z;return m}function u(e){var i=y,n=C,o=S,a=e[1];n=t.fromArray(e[1],a.length-3,n),o=t.fromArray(e[0],0,o),i=t.multiplyByScalar(t.add(n,o,i),.5,i);var s=l(i,n,o,r.ROUNDED,!1),u=e.length-1,c=e[u-1];a=e[u],n=t.fromArray(c,c.length-3,n),o=t.fromArray(a,0,o),i=t.multiplyByScalar(t.add(n,o,i),.5,i);var h=l(i,n,o,r.ROUNDED,!1);return[s,h]}function c(e,r,i,n){var o=p;return n?o=t.add(e,r,o):(r=t.negate(r,r),o=t.add(e,r,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function h(e,r,i,n){for(var o=new Array(e.length),a=new Array(e.length),s=t.multiplyByScalar(r,i,p),l=t.negate(s,f),u=0,c=e.length-1,h=0;hj;j++){D=m.geodeticSurfaceNormal(W,D),G=a[j+1],M=t.normalize(t.subtract(G,W,M),M),R=t.normalize(t.add(M,I,R),R);var X=!t.equalsEpsilon(t.negate(R,p),D,s.EPSILON2);if(X){R=t.cross(R,D,R),R=t.cross(D,R,R);var Z=f/Math.max(.25,t.magnitude(t.cross(R,I,p))),J=n.angleIsGreaterThanPi(M,I,W,m);R=t.multiplyByScalar(R,Z,R),J?(B=t.add(W,R,B),F=t.add(B,t.multiplyByScalar(O,f,F),F),z=t.add(B,t.multiplyByScalar(O,2*f,z),z),_[0]=t.clone(N,_[0]),_[1]=t.clone(F,_[1]),H=i.scaleToSurface(_,o,m),V=h(H,O,f,V),g&&(k.push(O.x,O.y,O.z),U.push(D.x,D.y,D.z)),L=t.clone(z,L),O=t.normalize(t.cross(D,M,O),O),z=t.add(B,t.multiplyByScalar(O,2*f,z),z),N=t.add(B,t.multiplyByScalar(O,f,N),N),v.value===r.ROUNDED.value||v.value===r.BEVELED.value?q.push({leftPositions:l(B,L,z,v,J)}):q.push({leftPositions:c(W,t.negate(R,R),z,J)})):(z=t.add(W,R,z),F=t.add(z,t.negate(t.multiplyByScalar(O,f,F),F),F),B=t.add(z,t.negate(t.multiplyByScalar(O,2*f,B),B),B),_[0]=t.clone(N,_[0]),_[1]=t.clone(F,_[1]),H=i.scaleToSurface(_,o,m),V=h(H,O,f,V),g&&(k.push(O.x,O.y,O.z),U.push(D.x,D.y,D.z)),L=t.clone(B,L),O=t.normalize(t.cross(D,M,O),O),B=t.add(z,t.negate(t.multiplyByScalar(O,2*f,B),B),B),N=t.add(z,t.negate(t.multiplyByScalar(O,f,N),N),N),v.value===r.ROUNDED.value||v.value===r.BEVELED.value?q.push({rightPositions:l(z,L,B,v,J)}):q.push({rightPositions:c(W,R,B,J)})),I=t.negate(M,I)}W=G}D=m.geodeticSurfaceNormal(W,D),_[0]=t.clone(N,_[0]),_[1]=t.clone(W,_[1]),H=i.scaleToSurface(_,o,m),V=h(H,O,f,V),g&&(k.push(O.x,O.y,O.z),U.push(D.x,D.y,D.z));var Q;return v.value===r.ROUNDED.value&&(Q=u(V)),{positions:V,corners:q,lefts:k,normals:U,endPositions:Q}},m}),r("Core/CorridorGeometry",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./CornerType","./CorridorGeometryLibrary","./ComponentDatatype","./Ellipsoid","./Geometry","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./BoundingSphere","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,t,r,n,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=i.normalize(i.cross(r,t,P),P);s.normal&&o.addAttribute(l,t,n,a),s.binormal&&o.addAttribute(c,r,n,a),s.tangent&&o.addAttribute(u,h,n,a)}function _(e,r,n){var s,l,h,d=e.positions,m=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,C=new f,S=0,T=0,M=0;for(l=0;ll;l++)V=i.fromArray($,3*(J-1-l),V),F=i.fromArray($,3*(J+l),F),o.addAttribute(U,F,q),o.addAttribute(U,V,void 0,Y),g(j,X,Z,q,Y,r),N=q/3,z=N+1,L=(Y-2)/3,B=L-1,Q[K++]=L,Q[K++]=N,Q[K++]=B,Q[K++]=B,Q[K++]=N,Q[K++]=z,q+=3,Y-=3}var et=0,tt=0,rt=d[et++],it=d[et++];U.set(rt,q),U.set(it,Y-it.length+1),Z=i.fromArray(_,tt,Z);var nt,ot;for(h=it.length-3,l=0;h>l;l+=3)nt=n.geodeticSurfaceNormal(i.fromArray(rt,l,P),P),ot=n.geodeticSurfaceNormal(i.fromArray(it,h-l,D),D),X=i.normalize(i.add(nt,ot,X),X),g(j,X,Z,q,Y,r),N=q/3,z=N+1,L=(Y-2)/3,B=L-1,Q[K++]=L,Q[K++]=N,Q[K++]=B,Q[K++]=B,Q[K++]=N,Q[K++]=z,q+=3,Y-=3;for(nt=n.geodeticSurfaceNormal(i.fromArray(rt,h,P),P),ot=n.geodeticSurfaceNormal(i.fromArray(it,h,D),D),X=i.normalize(i.add(nt,ot,X),X),tt+=3,l=0;ll;l++)V=i.fromArray(pt,3*(O-l-1),V),F=i.fromArray(pt,3*l,F),o.addAttribute(U,V,void 0,Y),o.addAttribute(U,F,q),g(j,X,Z,q,Y,r),z=q/3,N=z-1,B=(Y-2)/3,L=B+1,Q[K++]=L,Q[K++]=N,Q[K++]=B,Q[K++]=B,Q[K++]=N,Q[K++]=z,q+=3,Y-=3}if(C.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:U}),r.st){var ft,vt,gt=new Float32Array(2*(k/3)),_t=0;if(R){S/=3,T/=3;var yt=Math.PI/(O+1);vt=1/(S-O+1),ft=1/(T-O+1);var Ct,St=O/2;for(l=St+1;O+1>l;l++)Ct=c.PI_OVER_TWO+yt*l,gt[_t++]=ft*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=1;T-O+1>l;l++)gt[_t++]=l*ft,gt[_t++]=0;for(l=O;l>St;l--)Ct=c.PI_OVER_TWO-l*yt,gt[_t++]=1-ft*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=St;l>0;l--)Ct=c.PI_OVER_TWO-yt*l,gt[_t++]=1-vt*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=S-O;l>0;l--)gt[_t++]=l*vt,gt[_t++]=1;for(l=1;St+1>l;l++)Ct=c.PI_OVER_TWO+yt*l,gt[_t++]=vt*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct))}else{for(S/=3,T/=3,vt=1/(S-1),ft=1/(T-1),l=0;T>l;l++)gt[_t++]=l*ft,gt[_t++]=0;for(l=S;l>0;l--)gt[_t++]=(l-1)*vt,gt[_t++]=1}C.st=new p({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:gt})}return r.normal&&(C.normal=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:j.normals})),r.tangent&&(C.tangent=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:j.tangents})),r.binormal&&(C.binormal=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:j.binormals})),{attributes:C,indices:Q}}function y(e,t){if(!(t.normal||t.binormal||t.tangent||t.st))return e;var r,n,a=e.position.values;(t.normal||t.binormal)&&(r=e.normal.values,n=e.binormal.values); +var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(t.normal||t.binormal||t.tangent){var d=t.normal?new Float32Array(6*u):void 0,m=t.binormal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=w,v=E,g=x,_=b,y=T,C=A,S=h;for(s=0;u>s;s+=3){var P=S+h;f=i.fromArray(a,s,f),v=i.fromArray(a,s+u,v),g=i.fromArray(a,(s+3)%u,g),v=i.subtract(v,f,v),g=i.subtract(g,f,g),_=i.normalize(i.cross(v,g,_),_),t.normal&&(o.addAttribute(d,_,P),o.addAttribute(d,_,P+3),o.addAttribute(d,_,S),o.addAttribute(d,_,S+3)),(t.tangent||t.binormal)&&(C=i.fromArray(r,s,C),t.binormal&&(o.addAttribute(m,C,P),o.addAttribute(m,C,P+3),o.addAttribute(m,C,S),o.addAttribute(m,C,S+3)),t.tangent&&(y=i.normalize(i.cross(C,_,y),y),o.addAttribute(p,y,P),o.addAttribute(p,y,P+3),o.addAttribute(p,y,S),o.addAttribute(p,y,S+3))),S+=6}if(t.normal){for(d.set(r),s=0;u>s;s+=3)d[s+u]=-r[s],d[s+u+1]=-r[s+1],d[s+u+2]=-r[s+2];e.normal.values=d}else e.normal=void 0;if(t.binormal?(m.set(n),m.set(n,u),e.binormal.values=m):e.binormal=void 0,t.tangent){var D=e.tangent.values;p.set(D),p.set(D,u),e.tangent.values=p}}if(t.st){var M=e.st.values,I=new Float32Array(6*c);I.set(M),I.set(M,c);for(var O=2*c,R=0;2>R;R++){for(I[O++]=M[0],I[O++]=M[1],s=2;c>s;s+=2){var L=M[s],N=M[s+1];I[O++]=L,I[O++]=N,I[O++]=L,I[O++]=N}I[O++]=M[0],I[O++]=M[1]}e.st.values=I}return e}function C(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;iw;w+=3){var A=d[w],P=d[w+1],D=d[w+2];b[T++]=D+p,b[T++]=P+p,b[T++]=A+p}c=y(c,t);var M,I,O,R;for(w=0;x>w;w+=2)M=w+x,I=M+x,O=M+1,R=I+1,b[T++]=M,b[T++]=I,b[T++]=O,b[T++]=O,b[T++]=I,b[T++]=R;return{attributes:c,indices:b}}var w=new i,E=new i,x=new i,b=new i,T=new i,A=new i,P=new i,D=new i,M=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.positions,i=t.width;this._positions=r,this._width=i,this._ellipsoid=e(t.ellipsoid,s.WGS84),this._height=e(t.height,0),this._extrudedHeight=e(t.extrudedHeight,this._height),this._cornerType=e(t.cornerType,n.ROUNDED),this._vertexFormat=e(t.vertexFormat,v.DEFAULT),this._granularity=e(t.granularity,c.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry"};return M.createGeometry=function(e){var t,r=e._positions,i=e._height,n=e._extrudedHeight,a=i!==n,s=h.removeDuplicates(r),u=e._ellipsoid,c=e._vertexFormat,p={ellipsoid:u,positions:s,width:e._width,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};if(a){var f=Math.max(i,n);n=Math.min(i,n),i=f,p.height=i,p.extrudedHeight=n,t=S(p,c)}else{var v=o.computePositions(p);t=_(v,c,u),t.attributes.position.values=h.scaleToGeodeticHeight(t.attributes.position.values,i,u,t.attributes.position.values)}var g=t.attributes,y=m.fromVertices(g.position.values,void 0,3);return c.position||(t.attributes.position.values=void 0),new l({attributes:g,indices:t.indices,primitiveType:d.TRIANGLES,boundingSphere:y})},M}),r("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,o){var s,l,u,m=[],p=e.positions,f=e.corners,v=e.endPositions,g=new h,S=0,w=0,E=0;for(l=0;ll;l++)O=t.fromArray(k,3*(z-1-l),O),I=t.fromArray(k,3*(z+l),I),n.addAttribute(L,I,N),n.addAttribute(L,O,void 0,B),P=N/3,M=P+1,A=(B-2)/3,D=A-1,F[V++]=A,F[V++]=D,F[V++]=P,F[V++]=M,N+=3,B-=3}var U=0,W=p[U++],G=p[U++];for(L.set(W,N),L.set(G,B-G.length+1),u=G.length-3,m.push(N/3,(B-2)/3),l=0;u>l;l+=3)P=N/3,M=P+1,A=(B-2)/3,D=A-1,F[V++]=A,F[V++]=D,F[V++]=P,F[V++]=M,N+=3,B-=3;for(l=0;ll;l++)O=t.fromArray(Z,3*(b-l-1),O),I=t.fromArray(Z,3*l,I),n.addAttribute(L,O,void 0,B),n.addAttribute(L,I,N),M=N/3,P=M-1,D=(B-2)/3,A=D+1,F[V++]=A,F[V++]=D,F[V++]=P,F[V++]=M,N+=3,B-=3;m.push(N/3)}else m.push(N/3,(B-2)/3);return F[V++]=N/3,F[V++]=(B-2)/3,g.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:L}),{attributes:g,indices:F,wallIndices:m}}function g(e){var t=e.ellipsoid,r=n.computePositions(e),i=v(r,e.cornerType),o=i.wallIndices,a=e.height,s=e.extrudedHeight,l=i.attributes,u=i.indices,c=l.position.values,h=c.length,m=new Float64Array(h);m.set(c);var f=new Float64Array(2*h);c=p.scaleToGeodeticHeight(c,a,t,c),m=p.scaleToGeodeticHeight(m,s,t,m),f.set(c),f.set(m,h),l.position.values=f,h/=3;var g,_=u.length,y=d.createTypedArray(f.length/3,2*(_+o.length));y.set(u);var C=_;for(g=0;_>g;g+=2){var S=u[g],w=u[g+1];y[C++]=S+h,y[C++]=w+h}var E,x;for(g=0;ga;a++){var v=a/n*e.TWO_PI,g=Math.cos(v),_=Math.sin(v),y=g*i,C=_*i,S=g*r,w=_*r;h[m+p]=y,h[m+p+1]=C,h[m+p+2]=l,h[m+f]=S,h[m+f+1]=w,h[m+f+2]=s,m+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=S,h[d++]=w,h[d++]=s)}return h},t}),r("Core/CylinderGeometry",["./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartesian3","./CylinderGeometryLibrary","./Math","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new i,v=new n,g=new n,_=new n,y=new n,C=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.length,i=t.topRadius,n=t.bottomRadius,o=e(t.vertexFormat,p.DEFAULT),a=e(t.slices,128);this._length=r,this._topRadius=i,this._bottomRadius=n,this._vertexFormat=o,this._slices=a,this._workerName="createCylinderGeometry"};return C.createGeometry=function(e){var t,r=e._length,p=e._topRadius,C=e._bottomRadius,S=e._vertexFormat,w=e._slices,E=w+w,x=w+E,b=E+E,T=o.computePositions(r,p,C,w,!0),A=S.st?new Float32Array(2*b):void 0,P=S.normal?new Float32Array(3*b):void 0,D=S.tangent?new Float32Array(3*b):void 0,M=S.binormal?new Float32Array(3*b):void 0,I=S.normal||S.tangent||S.binormal;if(I){var O=S.tangent||S.binormal,R=0,L=0,N=0,B=v;B.z=0;var z=_,F=g;for(t=0;w>t;t++){var V=t/w*a.TWO_PI,k=Math.cos(V),U=Math.sin(V);I&&(B.x=k,B.y=U,O&&(z=n.normalize(n.cross(n.UNIT_Z,B,z),z)),S.normal&&(P[R++]=k,P[R++]=U,P[R++]=0,P[R++]=k,P[R++]=U,P[R++]=0),S.tangent&&(D[L++]=z.x,D[L++]=z.y,D[L++]=z.z,D[L++]=z.x,D[L++]=z.y,D[L++]=z.z),S.binormal&&(F=n.normalize(n.cross(B,z,F),F),M[N++]=F.x,M[N++]=F.y,M[N++]=F.z,M[N++]=F.x,M[N++]=F.y,M[N++]=F.z))}for(t=0;w>t;t++)S.normal&&(P[R++]=0,P[R++]=0,P[R++]=-1),S.tangent&&(D[L++]=1,D[L++]=0,D[L++]=0),S.binormal&&(M[N++]=0,M[N++]=-1,M[N++]=0);for(t=0;w>t;t++)S.normal&&(P[R++]=0,P[R++]=0,P[R++]=1),S.tangent&&(D[L++]=1,D[L++]=0,D[L++]=0),S.binormal&&(M[N++]=0,M[N++]=1,M[N++]=0)}var W=12*w-12,G=l.createTypedArray(b,W),H=0,j=0;for(t=0;w-1>t;t++)G[H++]=j,G[H++]=j+2,G[H++]=j+3,G[H++]=j,G[H++]=j+3,G[H++]=j+1,j+=2;for(G[H++]=E-2,G[H++]=0,G[H++]=1,G[H++]=E-2,G[H++]=1,G[H++]=E-1,t=1;w-1>t;t++)G[H++]=E+t+1,G[H++]=E+t,G[H++]=E;for(t=1;w-1>t;t++)G[H++]=x,G[H++]=x+t,G[H++]=x+t+1;var q=0;if(S.st){var Y=Math.max(p,C);for(t=0;b>t;t++){var X=n.fromArray(T,3*t,y);A[q++]=(X.x+Y)/(2*Y),A[q++]=(X.y+Y)/(2*Y)}}var Z=new m;S.position&&(Z.position=new d({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:T})),S.normal&&(Z.normal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:P})),S.tangent&&(Z.tangent=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:D})),S.binormal&&(Z.binormal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:M})),S.st&&(Z.st=new d({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:A})),f.x=.5*r,f.y=Math.max(C,p);var J=new c(n.ZERO,i.magnitude(f));return new h({attributes:Z,indices:G,primitiveType:u.TRIANGLES,boundingSphere:J})},C}),r("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=new t,p=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=r,this._bottomRadius=i,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"};return p.createGeometry=function(o){var a,s=o._length,p=o._topRadius,f=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,p,f,v,!1),C=2*v;if(g>0){var S=Math.min(g,v);a=Math.round(v/S),C+=S}for(var w=h.createTypedArray(_,2*C),E=0,x=0;v-1>x;x++)w[E++]=x,w[E++]=x+1,w[E++]=x+v,w[E++]=x+1+v;if(w[E++]=v-1,w[E++]=0,w[E++]=v+v-1,w[E++]=v,g>0)for(x=0;v>x;x+=a)w[E++]=x,w[E++]=x+v;var b=new c;b.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*s,m.y=Math.max(f,p);var T=new e(r.ZERO,t.magnitude(m));return new l({attributes:b,indices:w,primitiveType:d.LINES,boundingSphere:T})},p}),r("Core/DefaultProxy",[],function(){"use strict";var e=function(e){this.proxy=e};return e.prototype.getURL=function(e){return this.proxy+"?"+encodeURIComponent(e)},e}),r("Core/EllipsoidGeometry",["./defaultValue","./DeveloperError","./Cartesian2","./Cartesian3","./Math","./Ellipsoid","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new i,f=new i,v=new i,g=new i,_=new i,y=new i(1,1,1),C=Math.cos,S=Math.sin,w=function(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.radii,y),n=e(t.stackPartitions,64),o=e(t.slicePartitions,64),a=e(t.vertexFormat,m.DEFAULT);this._radii=i.clone(r),this._stackPartitions=n,this._slicePartitions=o,this._vertexFormat=a,this._workerName="createEllipsoidGeometry"};return w.createGeometry=function(e){var t,m,y=e._radii,w=o.fromCartesian3(y),E=e._vertexFormat,x=e._slicePartitions+1,b=e._stackPartitions+1,T=b*x,A=new Float64Array(3*T),P=6*(x-1)*(b-1),D=s.createTypedArray(T,P),M=E.normal?new Float32Array(3*T):void 0,I=E.tangent?new Float32Array(3*T):void 0,O=E.binormal?new Float32Array(3*T):void 0,R=E.st?new Float32Array(2*T):void 0,L=new Array(x),N=new Array(x),B=0;for(t=0;x>t;t++){var z=n.TWO_PI*t/(x-1);L[t]=C(z),N[t]=S(z),A[B++]=0,A[B++]=0,A[B++]=y.z}for(t=1;b-1>t;t++){var F=Math.PI*t/(b-1),V=S(F),k=y.x*V,U=y.y*V,W=y.z*C(F);for(m=0;x>m;m++)A[B++]=L[m]*k,A[B++]=N[m]*U,A[B++]=W}for(t=0;x>t;t++)A[B++]=0,A[B++]=0,A[B++]=-y.z;var G=new d;E.position&&(G.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:A}));var H=0,j=0,q=0,Y=0;if(E.st||E.normal||E.tangent||E.binormal){for(t=0;T>t;t++){var X=i.fromArray(A,3*t,p),Z=w.geodeticSurfaceNormal(X,f);if(E.st){var J=r.negate(Z,_);r.magnitude(J)A.length&&(B=3*(t-x*Math.floor(.5*b))),i.fromArray(A,B,J),w.geodeticSurfaceNormal(J,J),r.negate(J,J)),R[H++]=Math.atan2(J.y,J.x)/n.TWO_PI+.5,R[H++]=Math.asin(Z.z)/Math.PI+.5}if(E.normal&&(M[j++]=Z.x,M[j++]=Z.y,M[j++]=Z.z),E.tangent||E.binormal){var Q=v;if(x>t||t>T-x-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),E.tangent&&(I[q++]=Q.x,I[q++]=Q.y,I[q++]=Q.z),E.binormal){var K=i.cross(Z,Q,g);i.normalize(K,K),O[Y++]=K.x,O[Y++]=K.y,O[Y++]=K.z}}}E.st&&(G.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:R})),E.normal&&(G.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:M})),E.tangent&&(G.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:I})),E.binormal&&(G.binormal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:O}))}for(B=0,t=0;b>t;t++){var $=t*x,et=(t+1)*x;for(m=0;x-1>m;m++)D[B++]=et+m,D[B++]=et+m+1,D[B++]=$+m+1,D[B++]=et+m,D[B++]=$+m+1,D[B++]=$+m}return new c({attributes:G,indices:D,primitiveType:l.TRIANGLES,boundingSphere:u.fromEllipsoid(w)})},w}),r("Core/EllipsoidOutlineGeometry",["./defaultValue","./DeveloperError","./Cartesian3","./Math","./Ellipsoid","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=new r(1,1,1),m=Math.cos,p=Math.sin,f=function(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.radii,d),n=e(t.stackPartitions,10),o=e(t.slicePartitions,8),a=e(t.subdivisions,128);this._radii=r.clone(i),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"};return f.createGeometry=function(e){var t,r,d,f,v,g,_=e._radii,y=n.fromCartesian3(_),C=e._stackPartitions,S=e._slicePartitions,w=e._subdivisions,E=w*(C+S-1),x=E-S+2,b=new Float64Array(3*x),T=a.createTypedArray(x,2*E),A=0,P=new Array(w),D=new Array(w);for(t=0;w>t;t++)d=i.TWO_PI*t/w,P[t]=m(d),D[t]=p(d);for(t=1;C>t;t++)for(f=Math.PI*t/C,v=m(f),g=p(f),r=0;w>r;r++)b[A++]=_.x*P[r]*g,b[A++]=_.y*D[r]*g,b[A++]=_.z*v;for(P.length=S,D.length=S,t=0;S>t;t++)d=i.TWO_PI*t/S,P[t]=m(d),D[t]=p(d);for(b[A++]=0,b[A++]=0,b[A++]=_.z,t=1;w>t;t++)for(f=Math.PI*t/w,v=m(f),g=p(f),r=0;S>r;r++)b[A++]=_.x*P[r]*g,b[A++]=_.y*D[r]*g,b[A++]=_.z*v;for(b[A++]=0,b[A++]=0,b[A++]=-_.z,A=0,t=0;C-1>t;++t){var M=t*w;for(r=0;w-1>r;++r)T[A++]=M+r,T[A++]=M+r+1;T[A++]=M+w-1,T[A++]=M}var I=w*(C-1);for(r=1;S+1>r;++r)T[A++]=I,T[A++]=I+r;for(t=0;w-2>t;++t){var O=t*S+1+I,R=(t+1)*S+1+I;for(r=0;S-1>r;++r)T[A++]=R+r,T[A++]=O+r;T[A++]=R+S-1,T[A++]=O+S-1}var L=b.length/3-1;for(r=L-1;r>L-S-1;--r)T[A++]=L,T[A++]=r;var N=new h({position:new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:b})});return new u({attributes:N,indices:T,primitiveType:s.LINES,boundingSphere:l.fromEllipsoid(y)})},f}),r("Core/EllipsoidalOccluder",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Cartesian3","./BoundingSphere"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){var i=e.transformPositionToScaledSpace(t,m),o=n.magnitudeSquared(i),a=Math.sqrt(o),s=n.divideByScalar(i,a,p);o=Math.max(1,o),a=Math.max(1,a);var l=n.dot(s,r),u=n.magnitude(n.cross(s,r)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function s(e,t,r){return 0>=t||t===1/0||t!==t?void 0:n.multiplyByScalar(e,t,r)}function l(e,t){return e.transformPositionToScaledSpace(t,f),n.normalize(f,f)}var u=function(e,r){this._ellipsoid=e,this._cameraPosition=new n,this._cameraPositionInScaledSpace=new n,this._distanceToLimbInScaledSpaceSquared=0,t(r)&&(this.cameraPosition=r)};r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=n.magnitudeSquared(r)-1;n.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=i}}});var c=new n;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,c);return this.isScaledSpacePointVisible(r)},u.prototype.isScaledSpacePointVisible=function(e){var t=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,i=n.subtract(e,t,c),o=-n.dot(i,t),a=o>r&&o*o/n.magnitudeSquared(i)>r;return!a},u.prototype.computeHorizonCullingPoint=function(e,t,r){for(var i=this._ellipsoid,n=l(i,e),o=0,u=0,c=t.length;c>u;++u){var h=t[u],d=a(i,h,n);o=Math.max(o,d)}return s(n,o,r)};var h=new n;u.prototype.computeHorizonCullingPointFromVertices=function(t,r,i,o,u){o=e(o,n.ZERO);for(var c=this._ellipsoid,d=l(c,t),m=0,p=0,f=r.length;f>p;p+=i){h.x=r[p]+o.x,h.y=r[p+1]+o.y,h.z=r[p+2]+o.z;var v=a(c,h,d);m=Math.max(m,v)}return s(d,m,u)};var d=[];u.prototype.computeHorizonCullingPointFromExtent=function(e,t,r){var i=e.subsample(t,0,d),a=o.fromPoints(i);return n.magnitude(a.center)<.1*t.minimumRadius?void 0:this.computeHorizonCullingPoint(a.center,i,r)};var m=new n,p=new n,f=new n;return u}),r("Core/EventHelper",["./defined","./DeveloperError"],function(){"use strict";var e=function(){this._removalFunctions=[]};return e.prototype.add=function(e,t,r){var i=e.addEventListener(t,r);this._removalFunctions.push(i);var n=this;return function(){i();var e=n._removalFunctions;e.splice(e.indexOf(i),1)}},e.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,r=e.length;r>t;++t)e[t]();e.length=0},e}),r("Core/Extent",["./freezeObject","./defaultValue","./defined","./Ellipsoid","./Cartographic","./DeveloperError","./Math"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,i,n){this.west=t(e,0),this.south=t(r,0),this.east=t(i,0),this.north=t(n,0)};s.fromDegrees=function(e,i,n,o,l){return e=a.toRadians(t(e,0)),i=a.toRadians(t(i,0)),n=a.toRadians(t(n,0)),o=a.toRadians(t(o,0)),r(l)?(l.west=e,l.south=i,l.east=n,l.north=o,l):new s(e,i,n,o)},s.fromCartographicArray=function(e,t){for(var i=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=0,u=e.length;u>l;l++){var c=e[l];i=Math.min(i,c.longitude),n=Math.max(n,c.longitude),o=Math.min(o,c.latitude),a=Math.max(a,c.latitude)}return r(t)?(t.west=i,t.south=o,t.east=n,t.north=a,t):new s(i,o,n,a)},s.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.prototype.validate=function(){},s.prototype.getSouthwest=function(e){return r(e)?(e.longitude=this.west,e.latitude=this.south,e.height=0,e):new n(this.west,this.south)},s.prototype.getNorthwest=function(e){return r(e)?(e.longitude=this.west,e.latitude=this.north,e.height=0,e):new n(this.west,this.north)},s.prototype.getNortheast=function(e){return r(e)?(e.longitude=this.east,e.latitude=this.north,e.height=0,e):new n(this.east,this.north)},s.prototype.getSoutheast=function(e){return r(e)?(e.longitude=this.east,e.latitude=this.south,e.height=0,e):new n(this.east,this.south)},s.prototype.getCenter=function(e){return r(e)?(e.longitude=.5*(this.west+this.east),e.latitude=.5*(this.south+this.north),e.height=0,e):new n(.5*(this.west+this.east),.5*(this.south+this.north))},s.prototype.intersectWith=function(e,t){var i=Math.max(this.west,e.west),n=Math.max(this.south,e.south),o=Math.min(this.east,e.east),a=Math.min(this.north,e.north);return r(t)?(t.west=i,t.south=n,t.east=o,t.north=a,t):new s(i,n,o,a)},s.prototype.contains=function(e){return e.longitude>=this.west&&e.longitude<=this.east&&e.latitude>=this.south&&e.latitude<=this.north},s.prototype.isEmpty=function(){return this.west>=this.east||this.south>=this.north};var l=new n;return s.prototype.subsample=function(e,n,o){e=t(e,i.WGS84),n=t(n,0),r(o)||(o=[]);var s=0,u=this.north,c=this.south,h=this.east,d=this.west,m=l;m.height=n,m.longitude=d,m.latitude=u,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=h,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.latitude=c,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=d,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.latitude=0>u?u:c>0?c:0;for(var p=1;8>p;++p){var f=-Math.PI+p*a.PI_OVER_TWO;f>d&&h>f&&(m.longitude=f,o[s]=e.cartographicToCartesian(m,o[s]),s++)}return 0===m.latitude&&(m.longitude=d,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=h,o[s]=e.cartographicToCartesian(m,o[s]),s++),o.length=s,o},s.MAX_VALUE=e(new s(-Math.PI,-a.PI_OVER_TWO,Math.PI,a.PI_OVER_TWO)),s}),r("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i,n){"use strict";var o=function(e,r,i,n){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(r,0),this[3]=t(n,0)};return o.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3]):void 0},o.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new o),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t):new o(i,-n,n,i)},o.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(t,i,n){var o=2*i,a=t[o],s=t[o+1];return r(n)?(n.x=a,n.y=s,n):new e(a,s)},o.setColumn=function(e,t,r,i){i=o.clone(e,i);var n=2*t;return i[n]=r.x,i[n+1]=r.y,i},o.getRow=function(t,i,n){var o=t[i],a=t[i+2];return r(n)?(n.x=o,n.y=a,n):new e(o,a)},o.setRow=function(e,t,r,i){return i=o.clone(e,i),i[t]=r.x,i[t+2]=r.y,i},o.multiply=function(e,t,i){var n=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],s=e[1]*t[0]+e[3]*t[1],l=e[1]*t[2]+e[3]*t[3];return r(i)?(i[0]=n,i[1]=s,i[2]=a,i[3]=l,i):new o(n,a,s,l)},o.multiplyByVector=function(t,i,n){var o=t[0]*i.x+t[2]*i.y,a=t[1]*i.x+t[3]*i.y;return r(n)?(n.x=o,n.y=a,n):new e(o,a)},o.multiplyByScalar=function(e,t,i){return r(i)?(i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i):new o(e[0]*t,e[2]*t,e[1]*t,e[3]*t)},o.negate=function(e,t){return r(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t):new o(-e[0],-e[2],-e[1],-e[3])},o.transpose=function(e,t){var i=e[0],n=e[2],a=e[1],s=e[3];return r(t)?(t[0]=i,t[1]=n,t[2]=a,t[3]=s,t):new o(i,a,n,s)},o.abs=function(e,t){return r(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t):new o(Math.abs(e[0]),Math.abs(e[2]),Math.abs(e[1]),Math.abs(e[3]))},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},o.IDENTITY=n(new o(1,0,0,1)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n"+"("+this[1]+", "+this[3]+")"},o}),r("Core/ExtentGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./Extent","./Geometry","./GeometryInstance","./GeometryPipeline","./GeographicProjection","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix2","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w){"use strict";function E(e,t){return e<-g.PI_OVER_TWO||e>g.PI_OVER_TWO?!1:t>g.PI||t<-g.PI?!1:!0}function x(e,r,i,n,o){var a=e.radiiSquared;O=N.latitude-e.granYCos*r+i*e.granXSin;var s=et(O),l=tt(O),u=a.z*l;R=N.longitude+r*e.granYSin+i*e.granXCos;var c=s*et(R),h=s*tt(R),d=a.x*c,m=a.y*h,p=rt(d*c+m*h+u*l),f=d/p,v=m/p,g=u/p;t(n)&&(G.x=f+c*n,G.y=v+h*n,G.z=g+l*n),t(o)&&(Y.x=f+c*o,Y.y=v+h*o,Y.z=g+l*o)}function b(e,t){var r=new h({attributes:new v,primitiveType:C.TRIANGLES});return e.position&&(r.attributes.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:t.positions})),e.normal&&(r.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(r.attributes.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.binormals})),r}function T(e,t,r,i,o){var a=e.length,s=t.normal?new Float32Array(a):void 0,l=t.tangent?new Float32Array(a):void 0,u=t.binormal?new Float32Array(a):void 0,c=0,h=i?a/2:0;a=i&&o?a/2:a;for(var d=0;a>d;d+=3){var m=n.fromArray(e,d,G),p=c+1,f=c+2;(t.normal||t.tangent||t.binormal)&&(H=r.geodeticSurfaceNormal(m,H),(t.tangent||t.binormal)&&(n.cross(n.UNIT_Z,H,j),y.multiplyByVector(U,j,j),n.normalize(j,j),t.binormal&&n.normalize(n.cross(H,j,q),q)),i&&(t.normal&&(s[c]=H.x,s[p]=H.y,s[f]=H.z),t.tangent&&(l[c]=j.x,l[p]=j.y,l[f]=j.z),t.binormal&&(u[c]=q.x,u[p]=q.y,u[f]=q.z)),o&&(t.normal&&(s[c+h]=-H.x,s[p+h]=-H.y,s[f+h]=-H.z),t.tangent&&(l[c+h]=-j.x,l[p+h]=-j.y,l[f+h]=-j.z),t.binormal&&(u[c+h]=q.x,u[p+h]=q.y,u[f+h]=q.z))),c+=3}return b(t,{positions:e,normals:s,tangents:l,binormals:u})}function A(e,t,r){for(var i=e.length,o=t.normal?new Float32Array(i):void 0,a=t.tangent?new Float32Array(i):void 0,s=t.binormal?new Float32Array(i):void 0,l=0,u=!0,c=i/2,h=0;c>h;h+=3){var d=n.fromArray(e,h,G),m=l+1,p=l+2;if(t.normal||t.tangent||t.binormal){var f=n.fromArray(e,h+3,J);if(u){var v=n.fromArray(e,h+c,Q);n.subtract(f,d,f),n.subtract(v,d,v),H=n.normalize(n.cross(v,f,H),H),u=!1}n.equalsEpsilon(f,d,g.EPSILON10)&&(u=!0),(t.tangent||t.binormal)&&(q=r.geodeticSurfaceNormal(d,q),t.tangent&&(j=n.normalize(n.cross(q,H,j),j))),t.normal&&(o[l]=H.x,o[m]=H.y,o[p]=H.z,o[l+c]=H.x,o[m+c]=H.y,o[p+c]=H.z),t.tangent&&(a[l]=j.x,a[m]=j.y,a[p]=j.z,a[l+c]=j.x,a[m+c]=j.y,a[p+c]=j.z),t.binormal&&(s[l]=q.x,s[m]=q.y,s[p]=q.z,s[l+c]=q.x,s[m+c]=q.y,s[p+c]=q.z)}l+=3}return b(t,{positions:e,normals:o,tangents:a,binormals:s})}function P(e,r,i,n,o){return K.x=(R-F.west)*n.lonScalar-.5,K.y=(O-F.south)*n.latScalar-.5,_.multiplyByVector(V,K,K),K.x+=.5,K.y+=.5,t(o)&&(i[r+o]=K.x,i[r+1+o]=K.y),i[r++]=K.x,i[r++]=K.y,r}function D(e,t,r){return e[t+r]=Y.x,e[t++]=G.x,e[t+r]=Y.y,e[t++]=G.y,e[t+r]=Y.z,e[t++]=G.z,e}function M(e,t){for(var i=t.ellipsoid,n=t.size,o=t.height,l=t.width,u=t.surfaceHeight,c=0,h=e.position?new Float64Array(3*n):void 0,d=e.st?new Float32Array(2*n):void 0,m=0,p=0;o>p;++p)for(var v=0;l>v;++v)x(t,p,v,u),h[m++]=G.x,h[m++]=G.y,h[m++]=G.z,e.st&&(K.x=(R-F.west)*t.lonScalar-.5,K.y=(O-F.south)*t.latScalar-.5,_.multiplyByVector(V,K,K),K.x+=.5,K.y+=.5,d[c++]=K.x,d[c++]=K.y);for(var g=T(h,e,i,!0,!1),y=6*(l-1)*(o-1),C=s.createTypedArray(n,y),S=0,w=0,E=0;o-1>E;++E){for(var b=0;l-1>b;++b){var A=S,P=A+l,D=P+1,M=A+1;C[w++]=A,C[w++]=P,C[w++]=M,C[w++]=M,C[w++]=P,C[w++]=D,++S}++S}return g.indices=C,e.st&&(g.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:d})),{boundingSphere:r.fromExtent3D(t.extent,i,u),geometry:g}}function I(t,i){var o=i.surfaceHeight,l=i.extrudedHeight,u=Math.min(l,o),c=Math.max(l,o);if(g.equalsEpsilon(u,c,.1))return M(t,i);var h,p=i.height,v=i.width,_=i.size,y=i.ellipsoid,C=e(i.closeTop,!0),S=e(i.closeBottom,!0),w=2*v+2*p-4,E=2*(w+4),b=new Float64Array(3*E),I=t.st?new Float32Array(2*E):void 0,O=0,R=0,L=0,N=3*(E/2);for(h=0;p>h;h++)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));for(h=p-1,O=0;v>O;O++)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));for(O=v-1,h=p-1;h>=0;h--)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));for(h=0,O=v-1;O>=0;O--)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));var B=A(b,t,y);t.st&&(B.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:I}));var z,F,V,k,U,W=s.createTypedArray(E,6*w),H=b.length/6,j=0;for(U=0;H-1>U;U++){z=U,k=z+1;var q=n.fromArray(b,3*z,J),K=n.fromArray(b,3*k,Q);n.equalsEpsilon(q,K,g.EPSILON10)||(F=z+H,V=F+1,W[j++]=z,W[j++]=F,W[j++]=k,W[j++]=k,W[j++]=F,W[j++]=V)}if(B.indices=W,S||C){var $,et,tt=0,rt=0;C&&(tt+=_,rt+=6*(v-1)*(p-1),$=c),S&&(tt+=_,rt+=6*(v-1)*(p-1),et=u);var it=new Float64Array(3*tt),nt=t.st?new Float32Array(2*tt):void 0,ot=s.createTypedArray(tt,rt);for(R=0,L=0,N=S&&C?3*_:0,h=0;p>h;++h)for(O=0;v>O;++O)x(i,h,O,$,et),S&&(it[R+N]=Y.x,it[R+1+N]=Y.y,it[R+2+N]=Y.z),C&&(it[R]=G.x,it[R+1]=G.y,it[R+2]=G.z),t.st&&(L=P(t,L,nt,i,2*_)),R+=3;var at=T(it,t,y,C,S);t.st&&(at.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:nt}));var st=0;for(j=0,N/=3,U=0;p-1>U;++U){for(var lt=0;v-1>lt;++lt)z=j,F=z+v,V=F+1,k=z+1,S&&(ot[st++]=k+N,ot[st++]=F+N,ot[st++]=z+N,ot[st++]=V+N,ot[st++]=F+N,ot[st++]=k+N),C&&(ot[st++]=z,ot[st++]=F,ot[st++]=k,ot[st++]=k,ot[st++]=F,ot[st++]=V),++j;++j}at.indices=ot,B=m.combine([new d({geometry:at}),new d({geometry:B})])}var ut=r.fromExtent3D(i.extent,y,c,Z),ct=r.fromExtent3D(i.extent,y,u,X),ht=r.union(ut,ct);return{boundingSphere:ht,geometry:B}}var O,R,L=new n,N=new o,B=new o,z=new n,F=new c,V=new _,k=new _,U=new y,W=new p,G=new n,H=new n,j=new n,q=new n,Y=new n,X=new r,Z=new r,J=new n,Q=new n,K=new i,$=new S,et=Math.cos,tt=Math.sin,rt=Math.sqrt,it=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.extent,i=e(t.granularity,g.RADIANS_PER_DEGREE),n=e(t.ellipsoid,u.WGS84),o=e(t.height,0),a=t.rotation,s=t.stRotation,l=e(t.vertexFormat,w.DEFAULT);this._extent=r,this._granularity=i,this._ellipsoid=n,this._surfaceHeight=o,this._rotation=a,this._stRotation=s,this._vertexFormat=l,this._extrudedHeight=t.extrudedHeight,this._closeTop=t.closeTop,this._closeBottom=t.closeBottom,this._workerName="createExtentGeometry" +};return it.createGeometry=function(e){var r=e._extent,i=e._granularity,o=e._ellipsoid,a=e._surfaceHeight,s=e._rotation,u=e._stRotation,d=e._vertexFormat,m=e._extrudedHeight,p=e._closeTop,f=e._closeBottom,g=Math.ceil((r.east-r.west)/i)+1,C=Math.ceil((r.north-r.south)/i)+1,w=(r.east-r.west)/(g-1),x=(r.north-r.south)/(C-1),b=o.radiiSquared;c.clone(r,F),r.getNorthwest(N),r.getCenter(B);var T=x,A=w,P=0,D=0;if(t(s)){var O=et(s);T*=O,A*=O;var R=tt(s);P=x*R,D=w*R,W.project(N,L),W.project(B,z),n.subtract(L,z,L),_.fromRotation(s,k),_.multiplyByVector(k,L,L),n.add(L,z,L),W.unproject(L,N);var G=N.latitude,H=G+(g-1)*D,j=G-T*(C-1),q=G-T*(C-1)+(g-1)*D,Y=Math.max(G,H,j,q),X=Math.min(G,H,j,q),Z=N.longitude,Q=Z+(g-1)*A,K=Z+(C-1)*P,rt=Z+(C-1)*P+(g-1)*A,it=Math.max(Z,Q,K,rt),nt=Math.min(Z,Q,K,rt);if(!(E(Y,nt)&&E(Y,it)&&E(X,nt)&&E(X,it)))throw new l("Rotated extent is invalid.");F.north=Y,F.south=X,F.east=it,F.west=nt}var ot=1/(F.east-F.west),at=1/(F.north-F.south),st=g*C;if(t(u)){_.fromRotation(-u,V);var lt=o.cartographicToCartesian(B,J);n.normalize(lt,lt),S.fromAxisAngle(lt,-u,$),y.fromQuaternion($,U)}else _.clone(_.IDENTITY,V),y.clone(y.IDENTITY,U);var ut,ct={granYCos:T,granYSin:P,granXCos:A,granXSin:D,radiiSquared:b,ellipsoid:o,lonScalar:ot,latScalar:at,extent:r,width:g,height:C,surfaceHeight:a,size:st,extrudedHeight:m,closeTop:p,closeBottom:f};ut=t(m)?I(d,ct):M(d,ct);var ht=ut.boundingSphere;return ut=ut.geometry,new h({attributes:new v(ut.attributes),indices:ut.indices,primitiveType:ut.primitiveType,boundingSphere:ht})},it}),r("Core/ExtentOutlineGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix2","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,t){return e<-m.PI_OVER_TWO||e>m.PI_OVER_TWO?!1:t>m.PI||t<-m.PI?!1:!0}function g(e,r,i,n,o){var a=e.radiiSquared;C=E.latitude-e.granYCos*r+i*e.granXSin;var s=O(C),l=R(C),u=a.z*l;S=E.longitude+r*e.granYSin+i*e.granXCos;var c=s*O(S),h=s*R(S),d=a.x*c,m=a.y*h,p=L(d*c+m*h+u*l),f=d/p,v=m/p,g=u/p;t(n)&&(P.x=f+c*n,P.y=v+h*n,P.z=g+l*n),t(o)&&(D.x=f+c*o,D.y=v+h*o,D.z=g+l*o)}function _(e){var t,i=e.extent,n=e.ellipsoid,o=e.size,s=e.height,l=e.width,u=e.surfaceHeight,c=new Float64Array(3*o),h=0,d=0;for(t=0;l>t;t++)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(t=l-1,d=1;s>d;d++)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(d=s-1,t=l-2;t>=0;t--)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(t=0,d=s-2;d>0;d--)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(var m=2*(c.length/3),p=a.createTypedArray(c.length/3,m),f=0,v=0;vs;s++)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(s=c-1,f=1;u>f;f++)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(f=u-1,s=c-2;s>=0;s--)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(s=0,f=u-2;f>0;f--)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(var y=2*(v.length/3)+8,C=a.createTypedArray(v.length/3,y),S=v.length/6,w=0,E=0;S-1>E;E++)C[w++]=E,C[w++]=E+1,C[w++]=E+S,C[w++]=E+S+1;C[w++]=S-1,C[w++]=0,C[w++]=S+S-1,C[w++]=S,C[w++]=0,C[w++]=S,C[w++]=c-1,C[w++]=S+c-1,C[w++]=c+u-2,C[w++]=c+u-2+S,C[w++]=2*c+u-3,C[w++]=2*c+u-3+S;var x=r.fromExtent3D(l,d,o,I),b=r.fromExtent3D(l,d,n,M),T=r.union(x,b);return{boundingSphere:T,positions:v,indices:C}}var C,S,w=new i,E=new n,x=new n,b=new i,T=new p,A=new u,P=new i,D=new i,M=new r,I=new r,O=Math.cos,R=Math.sin,L=Math.sqrt,N=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.extent,i=e(t.granularity,m.RADIANS_PER_DEGREE),n=e(t.ellipsoid,l.WGS84),o=e(t.height,0),a=t.rotation;this._extent=r,this._granularity=i,this._ellipsoid=n,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=t.extrudedHeight,this._workerName="createExtentOutlineGeometry"};return N.createGeometry=function(e){var r=e._extent,n=e._granularity,a=e._ellipsoid,l=e._surfaceHeight,u=e._rotation,m=e._extrudedHeight,g=Math.ceil((r.east-r.west)/n)+1,C=Math.ceil((r.north-r.south)/n)+1,S=(r.east-r.west)/(g-1),P=(r.north-r.south)/(C-1),D=a.radiiSquared;r.getNorthwest(E),r.getCenter(x);var M=P,I=S,L=0,N=0;if(t(u)){var B=O(u);M*=B,I*=B;var z=R(u);L=P*z,N=S*z,A.project(E,w),A.project(x,b),i.subtract(w,b,w),p.fromRotation(u,T),p.multiplyByVector(T,w,w),i.add(w,b,w),A.unproject(w,E);var F=E.latitude,V=F+(g-1)*N,k=F-M*(C-1),U=F-M*(C-1)+(g-1)*N,W=Math.max(F,V,k,U),G=Math.min(F,V,k,U),H=E.longitude,j=H+(g-1)*I,q=H+(C-1)*L,Y=H+(C-1)*L+(g-1)*I,X=Math.max(H,j,q,Y),Z=Math.min(H,j,q,Y);if(!(v(W,Z)&&v(W,X)&&v(G,Z)&&v(G,X)))throw new s("Rotated extent is invalid.")}var J,Q=2*g+2*C-4,K={granYCos:M,granYSin:L,granXCos:I,granXSin:N,radiiSquared:D,ellipsoid:a,extent:r,width:g,height:C,surfaceHeight:l,size:Q};J=t(m)?y(K,m):_(K);var $=new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:J.positions})});return new c({attributes:$,indices:J.indices,primitiveType:f.LINES,boundingSphere:J.boundingSphere})},N}),r("Core/FAR",[],function(){"use strict";var e=5906376272e3;return e}),r("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value};return t}),r("Core/HeightmapTessellator",["./defaultValue","./defined","./freezeObject","./DeveloperError","./Cartesian3","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a){"use strict";var s={};return s.DEFAULT_STRUCTURE=r({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1}),s.computeVertices=function(r){var i,l,u,c,h=Math.cos,d=Math.sin,m=Math.sqrt,p=Math.atan,f=Math.exp,v=a.PI_OVER_TWO,g=a.toRadians,_=r.vertices,y=r.heightmap,C=r.width,S=r.height,w=r.skirtHeight,E=e(r.isGeographic,!0),x=e(r.ellipsoid,o.WGS84),b=1/x.maximumRadius,T=r.nativeExtent,A=r.extent;t(A)?(i=A.west,l=A.south,u=A.east,c=A.north):E?(i=g(T.west),l=g(T.south),u=g(T.east),c=g(T.north)):(i=T.west*b,l=v-2*p(f(-T.south*b)),u=T.east*b,c=v-2*p(f(-T.north*b)));var P=e(r.relativeToCenter,n.ZERO),D=e(r.structure,s.DEFAULT_STRUCTURE),M=e(D.heightScale,s.DEFAULT_STRUCTURE.heightScale),I=e(D.heightOffset,s.DEFAULT_STRUCTURE.heightOffset),O=e(D.elementsPerHeight,s.DEFAULT_STRUCTURE.elementsPerHeight),R=e(D.stride,s.DEFAULT_STRUCTURE.stride),L=e(D.elementMultiplier,s.DEFAULT_STRUCTURE.elementMultiplier),N=e(D.isBigEndian,s.DEFAULT_STRUCTURE.isBigEndian),B=(T.east-T.west)/(C-1),z=(T.north-T.south)/(S-1),F=x.radiiSquared,V=F.x,k=F.y,U=F.z,W=0,G=65536,H=-65536,j=0,q=S,Y=0,X=C;w>0&&(--j,++q,--Y,++X);for(var Z=j;q>Z;++Z){var J=Z;0>J&&(J=0),J>=S&&(J=S-1);var Q=T.north-z*J;Q=E?g(Q):v-2*p(f(-Q*b));for(var K=h(Q),$=d(Q),et=U*$,tt=(Q-l)/(c-l),rt=Y;X>rt;++rt){var it=rt;0>it&&(it=0),it>=C&&(it=C-1);var nt=T.west+B*it;E?nt=g(nt):nt*=b;var ot,at=J*C*R+it*R;if(1===O)ot=y[at];else{ot=0;var st;if(N)for(st=0;O>st;++st)ot=ot*L+y[at+st];else for(st=O-1;st>=0;--st)ot=ot*L+y[at+st]}ot=ot*M+I,H=Math.max(H,ot),G=Math.min(G,ot),(rt!==it||Z!==J)&&(ot-=w);var lt=K*h(nt),ut=K*d(nt),ct=V*lt,ht=k*ut,dt=m(ct*lt+ht*ut+et*$),mt=1/dt,pt=ct*mt,ft=ht*mt,vt=et*mt;_[W++]=pt+lt*ot-P.x,_[W++]=ft+ut*ot-P.y,_[W++]=vt+$*ot-P.z,_[W++]=ot;var gt=(nt-i)/(u-i);_[W++]=gt,_[W++]=tt}}return{maximumHeight:H,minimumHeight:G}},s}),r("Core/HermitePolynomialApproximation",["./defined","./Math"],function(e,t){"use strict";function r(e,t,i,n,o,a){var s,l,u,c=0;if(n>0){for(l=0;o>l;l++){for(s=!1,u=0;ul;l++){for(s=!1,u=0;ul;l++){s[l]=0;var v=new Array(p);for(f[l]=v,u=0;p>u;u++)v[u]=[]}var g=p,_=new Array(g);for(l=0;g>l;l++)_[l]=l;var y=p-1;for(h=0;a>h;h++){for(u=0;g>u;u++)m=_[u]*a+h,f[h][0].push(o[m]);for(l=1;g>l;l++){var C=!1;for(u=0;g-l>u;u++){var S,w=n[_[u]],E=n[_[u+l]];0>=E-w?(m=_[u]*a+a*l+h,S=o[m],f[h][l].push(S/i(l))):(S=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(S/(E-w))),C=C||0!==S}C||(y=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;y>=l;l++){var x=r(t,_,n,c,l,[]);for(h=0;a>h;h++){var b=f[h][l][0];s[h+c*a]+=b*x}}return s},n}),r("Core/IauOrientationParameters",[],function(){"use strict";var e=function(e,t,r,i){this.rightAscension=e,this.declination=t,this.rotation=r,this.rotationRate=i};return e}),r("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,r,i,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,m=26.4057084,p=13.064993,f=.3287146,v=1.7484877,g=-.1589763,_=.0036096,y=.1643573,C=12.9590088;return o.ComputeMoon=function(o,S){e(o)||(o=new r);var w=o.addSeconds(a),E=w.getTotalDays()-s,x=E/n.DAYS_PER_JULIAN_CENTURY,b=(125.045+l*E)*i.RADIANS_PER_DEGREE,T=(250.089+u*E)*i.RADIANS_PER_DEGREE,A=(260.008+c*E)*i.RADIANS_PER_DEGREE,P=(176.625+h*E)*i.RADIANS_PER_DEGREE,D=(357.529+d*E)*i.RADIANS_PER_DEGREE,M=(311.589+m*E)*i.RADIANS_PER_DEGREE,I=(134.963+p*E)*i.RADIANS_PER_DEGREE,O=(276.617+f*E)*i.RADIANS_PER_DEGREE,R=(34.226+v*E)*i.RADIANS_PER_DEGREE,L=(15.134+g*E)*i.RADIANS_PER_DEGREE,N=(119.743+_*E)*i.RADIANS_PER_DEGREE,B=(239.961+y*E)*i.RADIANS_PER_DEGREE,z=(25.053+C*E)*i.RADIANS_PER_DEGREE,F=Math.sin(b),V=Math.sin(T),k=Math.sin(A),U=Math.sin(P),W=Math.sin(D),G=Math.sin(M),H=Math.sin(I),j=Math.sin(O),q=Math.sin(R),Y=Math.sin(L),X=Math.sin(N),Z=Math.sin(B),J=Math.sin(z),Q=Math.cos(b),K=Math.cos(T),$=Math.cos(A),et=Math.cos(P),tt=Math.cos(D),rt=Math.cos(M),it=Math.cos(I),nt=Math.cos(O),ot=Math.cos(R),at=Math.cos(L),st=Math.cos(N),lt=Math.cos(B),ut=Math.cos(z),ct=(269.9949+.0031*x-3.8787*F-.1204*V+.07*k-.0172*U+.0072*G-.0052*Y+.0043*J)*i.RADIANS_PER_DEGREE,ht=(66.5392+.013*x+1.5419*Q+.0239*K-.0278*$+.0068*et-.0029*rt+9e-4*it+8e-4*at-9e-4*ut)*i.RADIANS_PER_DEGREE,dt=(38.3213+13.17635815*E-1.4e-12*E*E+3.561*F+.1208*V-.0642*k+.0158*U+.0252*W-.0066*G-.0047*H-.0046*j+.0028*q+.0052*Y+.004*X+.0019*Z-.0044*J)*i.RADIANS_PER_DEGREE,mt=(13.17635815-1.4e-12*2*E+3.561*Q*l+.1208*K*u-.0642*$*c+.0158*et*h+.0252*tt*d-.0066*rt*m-.0047*it*p-.0046*nt*f+.0028*ot*v+.0052*at*g+.004*st*_+.0019*lt*y-.0044*ut*C)/86400*i.RADIANS_PER_DEGREE;return e(S)||(S=new t),S.rightAscension=ct,S.declination=ht,S.rotation=dt,S.rotationRate=mt,S},o}),r("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,r,i,n,o,a){"use strict";function s(r,i,a){var s=u;s.x=Math.cos(r+n.PI_OVER_TWO),s.y=Math.sin(r+n.PI_OVER_TWO),s.z=0;var l=Math.cos(i),d=h;d.x=l*Math.cos(r),d.y=l*Math.sin(r),d.z=Math.sin(i);var m=e.cross(d,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=m.x,a[2]=d.x,a[3]=s.y,a[4]=m.y,a[5]=d.y,a[6]=s.z,a[7]=m.z,a[8]=d.z,a}var l=function(e){t(e)&&"function"==typeof e||(e=r.ComputeMoon),this._computeFunction=e},u=new e,c=new e,h=new e,d=new o,m=new a;return l.prototype.evaluate=function(r,l){t(r)||(r=new i);var u=this._computeFunction(r),c=s(u.rightAscension,u.declination,l),h=n.zeroToTwoPi(u.rotation),p=a.fromAxisAngle(e.UNIT_Z,h,m),f=o.fromQuaternion(a.conjugate(p,p),d),v=o.multiply(f,c,c);return v},l}),r("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t}),r("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,r,i,n,o,a){t(a)?a.length=0:a=[];var s,l,u;r?(s=e>i,l=e>n,u=e>o):(s=i>e,l=n>e,u=o>e);var c,h,d,m,p,f,v=s+l+u;return 1===v?s?(c=(e-i)/(n-i),h=(e-i)/(o-i),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),m=(e-n)/(i-n),a.push(2),a.push(0),1!==m&&(a.push(-1),a.push(1),a.push(0),a.push(m)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(p=(e-o)/(i-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==p&&(a.push(-1),a.push(2),a.push(0),a.push(p))):2===v?s||i===e?l||n===e?u||o===e||(h=(e-i)/(o-i),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-i)/(n-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(m=(e-n)/(i-n),p=(e-o)/(i-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(m),a.push(-1),a.push(2),a.push(0),a.push(p)):3===v||(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(r,i,n,o,a,s,l,u,c){var h=n-l,d=l-a,m=s-u,p=o-u,f=1/(m*h+d*p),v=i-u,g=r-l,_=(m*g+d*v)*f,y=(-p*g+h*v)*f,C=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=C,c):new e(_,y,C)},r}),r("Core/TimeInterval",["./defined","./DeveloperError","./freezeObject","./JulianDate","./TimeStandard"],function(e,t,r,i,n){"use strict";var o=function(t,r,n,o,a){e(n)||(n=!0),e(o)||(o=!0);var s=i.compare(r,t);this.start=t,this.stop=r,this.data=a,this.isStartIncluded=n,this.isStopIncluded=o,this.isEmpty=0>s||0===s&&(!n||!o)};return o.fromIso8601=function(e,t,r,n){var a=e.split("/"),s=i.fromIso8601(a[0]),l=i.fromIso8601(a[1]);return new o(s,l,t,r,n)},o.equals=function(t,r,n){return t===r||e(t)&&e(r)&&(t.isEmpty&&r.isEmpty||t.isStartIncluded===r.isStartIncluded&&t.isStopIncluded===r.isStopIncluded&&i.equals(t.start,r.start)&&i.equals(t.stop,r.stop)&&(t.data===r.data||e(n)&&n(t.data,r.data)))},o.equalsEpsilon=function(t,r,n,o){return t===r||e(t)&&e(r)&&(t.isEmpty&&r.isEmpty||t.isStartIncluded===r.isStartIncluded&&t.isStopIncluded===r.isStopIncluded&&i.equalsEpsilon(t.start,r.start,n)&&i.equalsEpsilon(t.stop,r.stop,n)&&(t.data===r.data||e(o)&&o(t.data,r.data)))},o.prototype.clone=function(){return new o(this.start,this.stop,this.isStartIncluded,this.isStopIncluded,this.data)},o.EMPTY=r(new o(new i(0,0,n.TAI),new i(0,0,n.TAI),!1,!1)),o.prototype.intersect=function(t,r){if(!e(t))return o.EMPTY;var n,a,s,l=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded,d=this.start,m=this.stop,p=this.isStartIncluded,f=this.isStopIncluded;return l.greaterThanOrEquals(d)&&m.greaterThanOrEquals(l)?(a=!i.equals(l,d)&&c||p&&c,s=f&&h,n=e(r)?r(this.data,t.data):this.data,m.greaterThanOrEquals(u)?(s=s||!i.equals(u,m)&&h,new o(l,u,a,s,n)):(s=s||f,new o(l,m,a,s,n))):l.lessThanOrEquals(d)&&d.lessThanOrEquals(u)?(a=i.equals(l,d)===!1&&p||p&&c,s=f&&h,n=e(r)?r(this.data,t.data):this.data,m.greaterThanOrEquals(u)?(s=s||i.equals(u,m)===!1&&h,new o(d,u,a,s,n)):(s=s||f,new o(d,m,a,s,n))):o.EMPTY},o.prototype.contains=function(e){if(this.isEmpty)return!1;var t=i.compare(this.start,e);if(0===t)return this.isStartIncluded;var r=i.compare(e,this.stop);return 0===r?this.isStopIncluded:0>t&&0>r},o.prototype.equals=function(e,t){return o.equals(this,e,t)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o}),r("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,r){"use strict";var i=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new r(i,n,!0,!0)),a={MINIMUM_VALUE:i,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),r("Core/KeyboardEventModifier",["./Enumeration"],function(e){"use strict";var t={SHIFT:new e(0,"SHIFT"),CTRL:new e(1,"CTRL"),ALT:new e(2,"ALT")};return t}),r("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l=r.length;for(a=0;n>a;a++)o[a]=0;for(a=0;l>a;a++){var u=1;for(s=0;l>s;s++)if(s!==a){var c=r[a]-r[s];u*=(t-r[s])/c}for(s=0;n>s;s++)o[s]+=u*i[a*n+s]}return o},t}),r("Core/LinearApproximation",["./defined","./DeveloperError"],function(e){"use strict";var t={type:"Linear"};return t.getRequiredDataPoints=function(){return 2},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l,u=r[0],c=r[1];for(a=0;n>a;a++)s=i[a],l=i[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},t}),r("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)};return r.clone=function(e,i){return t(e)?t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue):void 0},r.packedLength=4,r.pack=function(t,r,i){i=e(i,0),r[i++]=t.near,r[i++]=t.nearValue,r[i++]=t.far,r[i]=t.farValue},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),r("Core/ObjectOrientedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Matrix3"],function(e,t,r,i,n){"use strict";function o(e,t,r,i,o){var a=t[e]+r[0]*i[n.getElementIndex(0,e)]+r[1]*i[n.getElementIndex(1,e)]+r[2]*i[n.getElementIndex(2,e)];return Math.abs(o[e])>a?!0:!1}function a(e,t,r,i,o){var a=o[0]*i[n.getElementIndex(0,e)]+o[1]*i[n.getElementIndex(1,e)]+o[2]*i[n.getElementIndex(2,e)],s=r[e]+t[0]*i[n.getElementIndex(0,e)]+t[1]*i[n.getElementIndex(1,e)]+t[2]*i[n.getElementIndex(2,e)];return Math.abs(a)>s?!0:!1}function s(e,t,r,i,o,a){var s=a[(e+2)%3]*o[n.getElementIndex((e+1)%3,t)]-a[(e+1)%3]*o[n.getElementIndex((e+2)%3,t)],l=r[(e+1)%3]*o[n.getElementIndex((e+2)%3,t)]+r[(e+2)%3]*o[n.getElementIndex((e+1)%3,t)];return l+=i[(t+1)%3]*o[n.getElementIndex(e,(t+2)%3)]+i[(t+2)%3]*o[n.getElementIndex(e,(t+1)%3)],Math.abs(s)>l?!0:!1}var l=function(r,i,o){this.rotation=n.clone(t(r,n.IDENTITY)),this.translation=e.clone(t(i,e.ZERO)),this.scale=e.clone(t(o,e.ZERO))},u=new e,c=new e,h=new e,d=new e,m=new e,p=new n,f={unitary:new n,diagonal:new n};l.fromPoints=function(t,i){if(r(i)||(i=new l),!r(t)||0===t.length)return i.tranformMatrix=n.IDENTITY,i.translation=e.ZERO,i.scale=e.ZERO,i;var o,a=t.length,s=e.clone(t[0],u);for(o=1;a>o;o++)e.add(s,t[o],s);var v=1/a;e.multiplyByScalar(s,v,s);var g,_=0,y=0,C=0,S=0,w=0,E=0;for(o=0;a>o;o++)g=e.subtract(t[o],s,c),_+=g.x*g.x,y+=g.x*g.y,C+=g.x*g.z,S+=g.y*g.y,w+=g.y*g.z,E+=g.z*g.z;_*=v,y*=v,C*=v,S*=v,w*=v,E*=v;var x=p;x[0]=_,x[1]=y,x[2]=C,x[3]=y,x[4]=S,x[5]=w,x[6]=C,x[7]=w,x[8]=E;var b=n.getEigenDecomposition(x,f),T=n.transpose(b.unitary,i.rotation);g=e.subtract(t[0],s,c);var A=n.multiplyByVector(T,g,h),P=e.clone(A,d),D=e.clone(A,m);for(o=1;a>o;o++)g=e.subtract(t[o],s,g),n.multiplyByVector(T,g,A),e.getMinimumByComponent(D,A,D),e.getMaximumByComponent(P,A,P);var M=e.add(D,P,h);e.multiplyByScalar(M,.5,M),n.multiplyByVector(T,M,M),e.add(s,M,i.translation);var I=e.subtract(P,D,h);return e.multiplyByScalar(I,.5,i.scale),i},l.fromBoundingRectangle=function(e,t,i){r(i)||(i=new l),r(t)?n.fromRotationZ(t,i.rotation):n.clone(n.IDENTITY,i.rotation);var o=i.scale;o.x=.5*e.width,o.y=.5*e.height,o.z=0;var a=n.multiplyByVector(i.rotation,o,i.translation);return a.x+=e.x,a.y+=e.y,i},l.clone=function(t,i){return r(t)?r(i)?(n.clone(t.rotation,i.rotation),e.clone(t.translation,i.translation),e.clone(t.scale,i.scale),i):new l(t.rotation,t.translation,t.scale):void 0};var v=new n,g=new n,_=new e,y=new Array(3),C=new Array(3),S=new Array(3);return l.intersect=function(t,r){var i=n.transpose(t.rotation,v),l=n.multiply(i,r.rotation,g);n.abs(l,l);var u=y,c=C,h=S;return e.subtract(t.translation,r.translation,_),n.multiplyByVector(i,_,_),e.pack(_,u),e.pack(t.scale,c),e.pack(r.scale,h),o(0,c,h,l,u)?!1:o(1,c,h,l,u)?!1:o(2,c,h,l,u)?!1:a(0,c,h,l,u)?!1:a(1,c,h,l,u)?!1:a(2,c,h,l,u)?!1:s(0,0,c,h,l,u)?!1:s(1,0,c,h,l,u)?!1:s(2,0,c,h,l,u)?!1:s(0,1,c,h,l,u)?!1:s(1,1,c,h,l,u)?!1:s(2,1,c,h,l,u)?!1:s(0,2,c,h,l,u)?!1:s(1,2,c,h,l,u)?!1:s(2,2,c,h,l,u)?!1:!0},l.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.transformedPosition,i.transformedPosition)&&n.equals(t.transformMatrix,i.transformMatrix)&&e.equals(t.extent,i.extent)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),r("Core/Visibility",["./Enumeration"],function(e){"use strict";var t={NONE:new e(-1,"NONE"),PARTIAL:new e(0,"PARTIAL"),FULL:new e(1,"FULL")};return t}),r("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Math","./Visibility"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,r){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.setCameraPosition(r)};l.fromBoundingSphere=function(e,r,o){if(!i(e))throw new n("occluderBoundingSphere is required.");if(!i(r))throw new n("camera position is required.");return i(o)?(t.clone(e.center,o._occluderPosition),o._occluderRadius=e.radius,o.setCameraPosition(r),o):new l(e,r)},l.prototype.getPosition=function(){return this._occluderPosition},l.prototype.getRadius=function(){return this._occluderRadius};var u=new t;l.prototype.setCameraPosition=function(e){if(!i(e))throw new n("cameraPosition is required.");e=t.clone(e,this._cameraPosition);var r,o,a,s=t.subtract(this._occluderPosition,e,u),l=t.magnitudeSquared(s),c=this._occluderRadius*this._occluderRadius;if(l>c){r=Math.sqrt(l-c),l=1/Math.sqrt(l),o=t.multiplyByScalar(s,l,u);var h=r*r*l;a=t.add(e,t.multiplyByScalar(o,h,u),u)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=a,this._cameraPosition=e};var c=new t;l.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var r=t.subtract(e,this._occluderPosition,c),i=this._occluderRadius;if(i=t.magnitudeSquared(r)-i*i,i>0)return i=Math.sqrt(i)+this._horizonDistance,r=t.subtract(e,this._cameraPosition,r),i*i>t.magnitudeSquared(r)}return!1};var h=new t;l.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,h),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,c),o=this._occluderRadius-i;if(o=t.magnitudeSquared(n)-o*o,i0?(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n),o*o+i*i>t.magnitudeSquared(n)):!1;if(o>0){n=t.subtract(r,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=i*i;return(this._horizonDistance*this._horizonDistance+s)*l>a*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1},l.prototype.getVisibility=function(e){if(!i(e))throw new n("occludeeBS is required.");var r=t.clone(e.center),o=e.radius;if(o>this._occluderRadius)return s.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var a=t.subtract(r,this._occluderPosition),l=this._occluderRadius-o,u=t.magnitudeSquared(a);if(l=u-l*l,l>0){l=Math.sqrt(l)+this._horizonDistance,a=t.subtract(r,this._cameraPosition);var c=t.magnitudeSquared(a);return c>l*l+o*o?s.NONE:(l=this._occluderRadius+o,l=u-l*l,l>0?(l=Math.sqrt(l)+this._horizonDistance,l*l+o*o>c?s.FULL:s.PARTIAL):(a=t.subtract(r,this._horizonPlanePosition),t.dot(a,this._horizonPlaneNormal)>-o?s.PARTIAL:s.FULL))}}return s.NONE},l.getOccludeePoint=function(e,r,i){var o=t.clone(r),a=t.clone(e.center),s=e.radius,u=i.length;if(t.equals(a,r))throw new n("occludeePosition must be different than occluderBoundingSphere.center");var c=t.normalize(t.subtract(o,a)),h=-t.dot(c,a),d=l._anyRotationVector(a,c,h),m=l._horizonToPlaneNormalDotProduct(e,c,h,d,i[0]);if(!m)return void 0;for(var p,f=1;u>f;++f){if(p=l._horizonToPlaneNormalDotProduct(e,c,h,d,i[f]),!p)return void 0;m>p&&(m=p)}if(.0017453283658983088>m)return void 0;var v=s/m;return t.add(a,t.multiplyByScalar(c,v))};var d=[];return l.computeOccludeePointFromExtent=function(i,n){n=r(n,o.WGS84);var a=i.subsample(n,0,d),s=e.fromPoints(a),u=t.ZERO;return t.equals(u,s.center)?void 0:l.getOccludeePoint(new e(u,n.minimumRadius),s.center,a)},l._anyRotationVector=function(e,r,i){var n=t.abs(r),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var s=(t.dot(r,n)+i)/-t.dot(r,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,s)),e))},l._rotationVector=function(e,r,i,n,o){var s=t.subtract(n,e);if(s=t.normalize(s),t.dot(r,s)<.9999999847691291){var l=t.cross(r,s),u=t.magnitude(l);if(u>a.EPSILON13)return t.normalize(l)}return o},l._horizonToPlaneNormalDotProduct=function(e,r,i,n,o){var a=t.clone(o),s=t.clone(e.center),l=e.radius,u=t.subtract(s,a),c=t.magnitudeSquared(u),h=l*l;if(h>c)return!1;var d=c-h,m=Math.sqrt(d),p=Math.sqrt(c),f=1/p,v=m*f,g=v*m;u=t.normalize(u);var _=t.add(a,t.multiplyByScalar(u,g)),y=Math.sqrt(d-g*g),C=this._rotationVector(s,r,i,a,n),S=new t(C.x*C.x*u.x+(C.x*C.y-C.z)*u.y+(C.x*C.z+C.y)*u.z,(C.x*C.y+C.z)*u.x+C.y*C.y*u.y+(C.y*C.z-C.x)*u.z,(C.x*C.z-C.y)*u.x+(C.y*C.z+C.x)*u.y+C.z*C.z*u.z);S=t.normalize(S);var w=t.multiplyByScalar(S,y);C=t.normalize(t.subtract(t.add(_,w),s));var E=t.dot(r,C);C=t.normalize(t.subtract(t.subtract(_,w),s));var x=t.dot(r,C);return x>E?E:x},l}),r("Core/Packable",["../Core/DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),r("Core/PackableForInterpolation",["../Core/DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),r("Core/PolygonGeometryLibrary",["./defaultValue","./defined","./Cartesian3","./Ellipsoid"],function(e,t,r,i){"use strict";function n(e,t,i,n){return r.subtract(t,e,a),r.multiplyByScalar(a,i/n,a),r.add(e,a,a),[a.x,a.y,a.z]}var o={},a=new r;o.subdivideLine=function(e,t,i){var o=r.distance(e,t),a=r.angleBetween(e,t),s=a/i,l=Math.ceil(Math.log(s)/Math.log(2));1>l&&(l=0);var u=Math.pow(2,l),c=o/u,h=new Array(3*u),d=0;h[d++]=e.x,h[d++]=e.y,h[d++]=e.z;for(var m=1;u>m;m++){var p=n(e,t,m*c,o);h[d++]=p[0],h[d++]=p[1],h[d++]=p[2]}return h};var s=new r,l=new r,u=new r,c=new r;return o.scaleToGeodeticHeightExtruded=function(n,o,a,h,d){h=e(h,i.WGS84);var m=s,p=l,f=u,v=c;if(t(n)&&t(n.attributes)&&t(n.attributes.position))for(var g=n.attributes.position.values,_=g.length/2,y=0;_>y;y+=3)r.fromArray(g,y,f),h.geodeticSurfaceNormal(f,m),v=h.scaleToGeodeticSurface(f,v),p=r.multiplyByScalar(m,a,p),p=r.add(v,p,p),g[y+_]=p.x,g[y+1+_]=p.y,g[y+2+_]=p.z,d&&(v=r.clone(f,v)),p=r.multiplyByScalar(m,o,p),p=r.add(v,p,p),g[y]=p.x,g[y+1]=p.y,g[y+2]=p.z;return n},o}),r("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var r=new t,i=function(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0};return i}),r("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this.length--,r},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),r("Core/WindingOrder",["./Enumeration"],function(e){"use strict";var t={CLOCKWISE:new e(2304,"CLOCKWISE"),COUNTER_CLOCKWISE:new e(2305,"COUNTER_CLOCKWISE"),validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return t}),r("Core/PolygonPipeline",["./DeveloperError","./Math","./Cartesian2","./Cartesian3","./defined","./Geometry","./GeometryAttribute","./Ellipsoid","./EllipsoidTangentPlane","./defaultValue","./pointInsideTriangle","./ComponentDatatype","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t,i){var n=r.subtract(t,e),o=r.subtract(i,t);return n.x*o.y-n.y*o.x>=0}function v(e){for(var t=e[0].x,r=0,i=0;it&&(t=e[i].x,r=i);return r}function g(e){for(var t=e[0][0].x,r=0,i=0;it&&(t=n,r=i)}return r}function _(e){for(var t=[],r=0;rc&&(c=t[h].x);c+=c-l;var d=new i(c,e.y,0);for(h=0;h=e.x||p.x>=e.x)&&(m.y>=e.y&&p.y<=e.y||m.y<=e.y&&p.y>=e.y)){var f=(p.y-m.y)*(d.x-e.x)-(p.x-m.x)*(d.y-e.y);if(0!==f){f=1/f;var g=((p.x-m.x)*(e.y-m.y)-(p.y-m.y)*(e.x-m.x))*f,_=((d.x-e.x)*(e.y-m.y)-(d.y-e.y)*(e.x-m.x))*f;if(g>=0&&1>=g&&_>=0&&1>=_){var y=new r(e.x+g*(d.x-e.x),e.y+g*(d.y-e.y)),C=r.subtract(y,e);f=r.magnitudeSquared(C),o>f&&(s=y,o=f,n[0]=h,n[1]=(h+1)%t.length)}}}}return s}function S(e,t){var i=g(t),n=t[i],o=v(n),a=n[o],s=[],l=C(a,e,s),u=y(e,l);if(-1!==u)return u;var h=r.magnitudeSquared(r.subtract(e[s[0]],a)),d=r.magnitudeSquared(r.subtract(e[s[1]],a)),m=d>h?e[s[0]]:e[s[1]],p=_(e),f=p.indexOf(m);-1!==f&&p.splice(f,1);for(var S=[],w=0;w0){var b=new r(1,0);for(w=0;wP&&(x=P,m=S[w])}}}return e.indexOf(m)}function w(e,t,r){for(var n=G.computeWindingOrder2D(e),o=0;oi&&(i=t.length-1),i===t.length&&(i=0),P(i,t),i +}function P(t,n){var o=t-1,a=t+1;0>o&&(o=n.length-1),a===n.length&&(a=0);var s=r.subtract(n[o].position,n[t].position),l=r.subtract(n[a].position,n[t].position);if(s=new i(s.x,s.y,0),l=new i(l.x,l.y,0),D(s,l)){var u=new e("Superfluous vertex found.");throw u.vertexIndex=t,u}}function D(e,t){return 0===i.cross(e,t).z}function M(e,t){return i.cross(e,t).z<0}function I(e,t){return i.cross(e,t).z>0}function O(e,t,r){return i.cross(e,r).z>0&&i.cross(r,t).z>0}function R(e,t,r){return i.cross(e,r).z<0&&i.cross(r,t).z<0}function L(e,t,i){for(var n=0;nt||e>r)&&(t>e||r>e)||t===r&&t===e}function z(t){var r=t.length;if(3===r)return N(t)?[]:[t[0].index,t[1].index,t[2].index];if(t.length<3)throw new e("Invalid polygon: must have at least three vertices.");for(var i=!1,n=0;!i;){var o=10*t.length;if(n>o)return[];n++;for(var a=E(t.length),s=a+1;Math.abs(a-s)<2||Math.abs(a-s)>t.length-2;)s=E(t.length);if(a>s){var l=a;a=s,s=l}try{if(x(a,s,t)){var u=t.splice(a,s-a+1,t[a],t[s]);return z(t).concat(z(u))}}catch(c){if(c.hasOwnProperty("vertexIndex"))return t.splice(c.vertexIndex,1),z(t);throw c}}}var F=0,V=-1,k=1,U=new i,W=new i,G={removeDuplicates:function(e){for(var t=e.length,r=[],n=t-1,o=0;t>o;n=o++){var a=e[n],s=e[o];i.equals(a,s)||r.push(s)}return r},computeArea2D:function(e){for(var t=e.length,r=0,i=t-1,n=0;t>n;i=n++){var o=e[i],a=e[n];r+=o.x*a.y-a.x*o.y}return.5*r},computeWindingOrder2D:function(e){var t=G.computeArea2D(e);return t>=0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},triangulate:function(e){for(var t=e.length,r=[],i=0;t>i;++i)r[i]={position:e[i],index:i};return z(r)},resetSeed:function(e){F=u(e,0)},computeSubdivision:function(e,r,n){n=u(n,t.RADIANS_PER_DEGREE);for(var s=new m,l=r.length,c=0;l>c;c+=3)s.enqueue({i0:r[c],i1:r[c+1],i2:r[c+2]});for(var p,f=e.slice(0),v=[],g={};s.length>0;){var _,y,C=s.dequeue(),S=f[C.i0],w=f[C.i1],E=f[C.i2],x=i.angleBetween(S,w),b=i.angleBetween(w,E),T=i.angleBetween(E,S),A=Math.max(x,Math.max(b,T));A>n?x===A?(_=Math.min(C.i0,C.i1).toString()+" "+Math.max(C.i0,C.i1).toString(),p=g[_],p||(y=i.add(S,w),i.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),s.enqueue({i0:C.i0,i1:p,i2:C.i2}),s.enqueue({i0:p,i1:C.i1,i2:C.i2})):b===A?(_=Math.min(C.i1,C.i2).toString()+" "+Math.max(C.i1,C.i2).toString(),p=g[_],p||(y=i.add(w,E),i.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),s.enqueue({i0:C.i1,i1:p,i2:C.i0}),s.enqueue({i0:p,i1:C.i2,i2:C.i0})):T===A&&(_=Math.min(C.i2,C.i0).toString()+" "+Math.max(C.i2,C.i0).toString(),p=g[_],p||(y=i.add(E,S),i.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),s.enqueue({i0:C.i2,i1:p,i2:C.i1}),s.enqueue({i0:p,i1:C.i0,i2:C.i1})):(v.push(C.i0),v.push(C.i1),v.push(C.i2))}var P=f.length,D=new Array(3*P),M=0;for(p=0;P>p;p++){var I=f[p];D[M++]=I.x,D[M++]=I.y,D[M++]=I.z}return new o({attributes:{position:new a({componentDatatype:h.DOUBLE,componentsPerAttribute:3,values:D})},indices:v,primitiveType:d.TRIANGLES})},scaleToGeodeticHeight:function(e,t,r,o){r=u(r,s.WGS84);var a=U,l=W;if(t=u(t,0),o=u(o,!0),n(e)&&n(e.attributes)&&n(e.attributes.position))for(var c=e.attributes.position.values,h=c.length,d=0;h>d;d+=3)i.fromArray(c,d,l),o&&(l=r.scaleToGeodeticSurface(l,l)),a=r.geodeticSurfaceNormal(l,a),i.multiplyByScalar(a,t,a),i.add(l,a,l),c[d]=l.x,c[d+1]=l.y,c[d+2]=l.z;return e},eliminateHoles:function(e,t,r){r=u(r,s.WGS84);for(var n=[],o=0;o0;)c=w(c,n,r);return c}};return G}),r("Core/PolygonGeometry",["./defaultValue","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Quaternion","./Queue","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x){"use strict";function b(e,t,r,i){for(var o=S.fromAxisAngle(e._plane.normal,r,O),s=g.fromQuaternion(o,R),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,m=0;d>m;++m){var p=n.clone(t[m],I);g.multiplyByVector(s,p,p);var f=e.projectPointOntoPlane(p,M);a(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return i.x=l,i.y=c,i.width=u-l,i.height=h-c,i}function T(e,t,r,i){var n=u.fromPoints(t,e),a=n.projectPointsOntoPlane(t,L),s=y.computeWindingOrder2D(a);s===x.CLOCKWISE&&(a.reverse(),t.reverse());var l=y.triangulate(a);l.length<3&&(l=[0,1,2]);var d;if(i){for(var p=t.length,f=new Array(3*p),v=0,g=0;p>g;g++){var _=t[g];f[v++]=_.x,f[v++]=_.y,f[v++]=_.z}d=new c({attributes:{position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:C.TRIANGLES})}else d=y.computeSubdivision(t,l,r);return new m({geometry:d})}function A(e,t,r,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(r,a),m=b(d,r,s,N),p=G;p.x=m.x,p.y=m.y;var f=t.attributes.position.values,_=f.length,y=e.st?new Float32Array(2*(_/3)):void 0,C=e.normal?new Float32Array(_):void 0,w=e.tangent?new Float32Array(_):void 0,E=e.binormal?new Float32Array(_):void 0,x=0,T=0,A=z,P=F,D=V,M=!0,I=S.fromAxisAngle(d._plane.normal,s,q),O=g.fromQuaternion(I,Y),R=_/2,L=_/3;l&&(_/=2);for(var k=0;_>k;k+=3){var X=n.fromArray(f,k,j);if(e.st){var Z=g.multiplyByVector(O,X,B),J=d.projectPointOntoPlane(Z,H);i.subtract(J,p,J),l&&(y[x+L]=J.x/m.width,y[x+1+L]=J.y/m.height),y[x]=J.x/m.width,y[x+1]=J.y/m.height,x+=2}if(e.normal||e.tangent||e.binormal){var Q=T+1,K=T+2;if(c){if(_>k+3){var $=n.fromArray(f,k+3,U);if(M){var et=n.fromArray(f,k+_,W);n.subtract($,X,$),n.subtract(et,X,et),A=n.normalize(n.cross(et,$,A),A),M=!1}n.equalsEpsilon($,X,v.EPSILON10)&&(M=!0)}(e.tangent||e.binormal)&&(D=a.geodeticSurfaceNormal(X,D),e.tangent&&(P=n.normalize(n.cross(D,A,P),P)))}else A=a.geodeticSurfaceNormal(X,A),(e.tangent||e.binormal)&&(P=n.cross(n.UNIT_Z,A,P),P=n.normalize(g.multiplyByVector(O,P,P),P),e.binormal&&(D=n.normalize(n.cross(A,P,D),D)));e.normal&&(l&&!c?(C[T+R]=-A.x,C[Q+R]=-A.y,C[K+R]=-A.z):(C[T+R]=A.x,C[Q+R]=A.y,C[K+R]=A.z),C[T]=A.x,C[Q]=A.y,C[K]=A.z),e.tangent&&(l&&!c?(w[T+R]=-P.x,w[Q+R]=-P.y,w[K+R]=-P.z):(w[T+R]=P.x,w[Q+R]=P.y,w[K+R]=P.z),w[T]=P.x,w[Q]=P.y,w[K]=P.z),e.binormal&&(l&&(E[T+R]=D.x,E[Q+R]=D.y,E[K+R]=D.z),E[T]=D.x,E[Q]=D.y,E[K]=D.z),T+=3}}e.st&&(t.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:y})),e.normal&&(t.attributes.normal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:C})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:w})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:E}))}return t}function P(e,t,r){var i,a,s,l,u,m,p,g,y,S=[],w=e.length;if(r)for(p=0;w>p;p++)g=e[p],y=e[(p+1)%w],S.push(g.x,g.y,g.z,y.x,y.y,y.z);else for(p=0;w>p;p++)g=e[p],y=e[(p+1)%w],i=_.subdivideLine(g,y,t),i.push(y.x,y.y,y.z),S=S.concat(i);S=S.concat(S),w=S.length;var E=f.createTypedArray(w/3,w-6*e.length);for(a=0,w/=6,p=0;w>p;p++)s=p,l=s+1,g=n.fromArray(S,3*s,U),y=n.fromArray(S,3*l,W),n.equalsEpsilon(g,y,v.EPSILON6)||(u=s+w,m=u+1,E[a++]=s,E[a++]=u,E[a++]=l,E[a++]=l,E[a++]=u,E[a++]=m);return new c({attributes:new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:S})}),indices:E,primitiveType:C.TRIANGLES})}function D(e,t,r,i,n){var a=T(e,t,r,n).geometry,s=a.attributes.position.values,l=a.indices,u=s.concat(s),p=u.length/3,v=f.createTypedArray(p,2*l.length);v.set(l);var g,_=l.length,C=p/2;for(g=0;_>g;g+=3){var S=v[g]+C,w=v[g+1]+C,E=v[g+2]+C;v[g+_]=E,v[g+1+_]=w,v[g+2+_]=S}var b=new c({attributes:new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:u})}),indices:v,primitiveType:a.primitiveType}),A={topAndBottom:new m({geometry:b})};A.walls=[];var D=i.outerRing,M=y.computeWindingOrder2D(D);M===x.CLOCKWISE&&(D=D.reverse());var I=P(D,r,n);A.walls.push(new m({geometry:I}));var O=i.holes;for(g=0;gP;P++){var N=O[P];if(N.positions=y.removeDuplicates(N.positions),N.positions.length<3)throw new s("At least three positions are required.");L.push(N.positions);var F=0;a(N.holes)&&(F=N.holes.length);for(var V=0;F>V;V++)b.enqueue(N.holes[V])}S.push({outerRing:I,holes:L});var U=y.eliminateHoles(I,L);x.push(U)}}l=x[0],t=r.fromPoints(l);var W,G=[];if(C){for(P=0;P_;_++){var E=o[_],x=o[(_+1)%S];C.push(E.x,E.y,E.z,x.x,x.y,x.z)}else for(_=0;S>_;_++)C=C.concat(f.subdivideLine(o[_],o[(_+1)%S],r));S=C.length/3;var b=2*S,T=m.createTypedArray(C.length/3,b),A=0;for(_=0;S-1>_;_++)T[A++]=_,T[A++]=_+1;return T[A++]=S-1,T[A++]=0,new h({geometry:new l({attributes:new c({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:new Float64Array(C)})}),indices:T,primitiveType:g.LINES})})}function S(e,t,r,i){var o=v.removeDuplicates(t),a=s.fromPoints(o,e),d=a.projectPointsOntoPlane(o,w),p=v.computeWindingOrder2D(d);p===y.CLOCKWISE&&(d.reverse(),o.reverse());var _,C=[],S=o.length,E=new Array(S);if(E[0]=0,i){var x,b;for(_=0;S-1>_;_++)x=o[_],b=o[(_+1)%S],C.push(x.x,x.y,x.z,b.x,b.y,b.z),E[_+1]=C.length/3;x=o[S-1],b=o[0],C.push(x.x,x.y,x.z,b.x,b.y,b.z)}else{for(_=0;S-1>_;_++)C=C.concat(f.subdivideLine(o[_],o[_+1],r)),E[_+1]=C.length/3;C=C.concat(f.subdivideLine(o[S-1],o[0],r))}S=C.length/3;var T=2*(2*S+E.length),A=m.createTypedArray(C.length/3,T),P=0;for(_=0;S-1>_;_++)A[P++]=_,A[P++]=_+1,A[P++]=_+S,A[P++]=_+1+S;for(A[P++]=S-1,A[P++]=0,A[P++]=S+S-1,A[P++]=S,_=0;_T;T++){var M=A.holes[T];y.push(M.positions);var I=0;t(M.holes)&&(I=M.holes.length);for(var O=0;I>O;O++)w.enqueue(M.holes[O])}y.push(P)}a=y[0],n=r.fromPoints(a);var R,L=[];if(m)for(T=0;To;++o)T+=4*b[o]-4;var P,D,M=new Float64Array(3*T),I=new Float64Array(3*T),O=new Float64Array(3*T),R=new Float32Array(2*T),L=C.st?new Float32Array(2*T):void 0,N=e(S)?new Uint8Array(4*T):void 0,B=0,z=0,F=0,V=0,k=0,U=0,W=x.length;for(u=0;W>u;++u){0===u?(D=f,s.subtract(x[0],x[1],D),s.add(x[0],D,D)):D=x[u-1],s.clone(D,g),s.clone(x[u],v),u===W-1?(D=f,s.subtract(x[W-1],x[W-2],D),s.add(x[W-1],D,D)):D=x[u+1],s.clone(D,_),P=b[k],u===U+P&&(U+=P,++k);var G,H,j=0===u-U,q=u===U+b[k]-1,Y=j?2:0,X=q?2:4;if(e(N)){var Z=u-k;G=j||w?S[Z]:S[Z-1],q||(H=S[Z])}for(p=Y;X>p;++p){s.pack(v,M,B),s.pack(g,I,B),s.pack(_,O,B),B+=3;var J=0>p-2?-1:1;if(R[z++]=2*(p%2)-1,R[z++]=J*y,C.st&&(L[F++]=u/(W-1),L[F++]=Math.max(R[z-2],0)),e(N)){var Q=2>p?G:H;N[V++]=m.floatToByte(Q.red),N[V++]=m.floatToByte(Q.green),N[V++]=m.floatToByte(Q.blue),N[V++]=m.floatToByte(Q.alpha)}}}var K=new d;K.position=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:M}),K.prevPosition=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:I}),K.nextPosition=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:O}),K.expandAndWidth=new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:R}),C.st&&(K.st=new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:L})),e(N)&&(K.color=new h({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:N,normalize:!0})),A=b.length;var $=i.createTypedArray(T,6*x.length-6*A),et=0,tt=0;for(o=0;A>o;++o)for(P=b[o]-1,u=0;P>u;++u)$[tt++]=et,$[tt++]=et+2,$[tt++]=et+1,$[tt++]=et+1,$[tt++]=et+2,$[tt++]=et+3,et+=4;return new c({attributes:K,indices:$,primitiveType:n.TRIANGLES,boundingSphere:a.fromPoints(x)})},p}),r("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";function y(e,i,n,o){var a=new c;o.position&&(a.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:e}));var s,m,f,g,_,y,C=i.length,S=e.length/3,w=(S-2*C)/(2*C),E=p.triangulate(i),x=6*(w-1)*C+2*E.length,b=d.createTypedArray(S,x),T=2*C,A=0;for(s=0;w-1>s;s++){for(m=0;C-1>m;m++)f=2*m+2*s*C,y=f+T,g=f+1,_=g+T,b[A++]=g,b[A++]=f,b[A++]=_,b[A++]=_,b[A++]=f,b[A++]=y;f=2*C-2+2*s*C,g=f+1,_=g+T,y=f+T,b[A++]=g,b[A++]=f,b[A++]=_,b[A++]=_,b[A++]=f,b[A++]=y}if(o.st||o.tangent||o.binormal){var P,D,M=new Float32Array(2*S),I=1/(w-1),O=1/n.height,R=n.height/2,L=0;for(s=0;w>s;s++){for(P=s*I,D=O*(i[0].y+R),M[L++]=P,M[L++]=D,m=1;C>m;m++)D=O*(i[m].y+R),M[L++]=P,M[L++]=D,M[L++]=P,M[L++]=D;D=O*(i[0].y+R),M[L++]=P,M[L++]=D}for(m=0;C>m;m++)P=0,D=O*(i[m].y+R),M[L++]=P,M[L++]=D;for(m=0;C>m;m++)P=(w-1)*I,D=O*(i[m].y+R),M[L++]=P,M[L++]=D;a.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var N=S-2*C;for(s=0;sa;a++)v[g++]=a+_,v[g++]=a+_+1;for(v[g++]=s-1+_,v[g++]=_,o=p-1,_=o*s,a=0;s-1>a;a++)v[g++]=a+_,v[g++]=a+_+1;for(v[g++]=s-1+_,v[g++]=_,o=0;p-1>o;o++){var y=s*o,C=y+s;for(a=0;s>a;a++)v[g++]=a+y,v[g++]=a+C}var S=new l({attributes:n,indices:h.createTypedArray(d,v),boundingSphere:t.fromVertices(e),primitiveType:f.LINES});return S}var _=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=n(e.ellipsoid,s.WGS84),this._cornerType=n(e.cornerType,i.ROUNDED),this._granularity=n(e.granularity,d.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry"},y=new e;return _.createGeometry=function(t){var r=t._positions,i=p.removeDuplicatesFromPositions(r,t._ellipsoid),n=t._shape;n=p.removeDuplicatesFromShape(n),m.computeWindingOrder2D(n).value===v.CLOCKWISE.value&&n.reverse();var o=e.fromPoints(n,y),a=p.computePositions(i,n,o,t,!1);return g(a,n)},_}),r("Core/QuaternionSpline",["./defaultValue","./defined","./DeveloperError","./Spline","./Quaternion"],function(e,t,r,i,n){"use strict";function o(e,r,i){var o=e.length,a=new Array(o);a[0]=t(r)?r:e[0],a[o-1]=t(i)?i:e[o-1];for(var s=1;o-1>s;++s)a[s]=n.innerQuadrangle(e[s-1],e[s],e[s+1]);return a}function a(e){var t=e.points,r=e.innerQuadrangles,i=e.times;if(t.length<3){var o=i[0],a=1/(i[1]-o),s=t[0],l=t[1];return function(e,t){var r=(e-o)*a;return n.fastSlerp(s,l,r,t)}}return function(o,a){var s=e._lastTimeIndex=e.findTimeInterval(o,e._lastTimeIndex),l=(o-i[s])/(i[s+1]-i[s]),u=t[s],c=t[s+1],h=r[s],d=r[s+1];return n.fastSquad(u,c,h,d,l,a)}}var s=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.points,i=t.times,n=t.firstInnerQuadrangle,s=t.lastInnerQuadrangle,l=o(r,n,s);this.times=i,this.points=r,this.innerQuadrangles=l,this._evaluateFunction=a(this),this._lastTimeIndex=0};return s.prototype.findTimeInterval=i.prototype.findTimeInterval,s.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},s}),r("Core/ReferenceFrame",["./Enumeration"],function(e){"use strict";var t={FIXED:new e(0,"FIXED"),INERTIAL:new e(1,"INERTIAL")};return t}),r("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function r(){return!0}var i=function(i,n){function o(){throw new t(n)}n=e(n,"This object was destroyed, i.e., destroy() was called.");for(var a in i)"function"==typeof i[a]&&(i[a]=o);return i.isDestroyed=r,void 0};return i}),r("Core/ScreenSpaceEventType",["./Enumeration"],function(e){"use strict";var t={LEFT_DOWN:new e(0,"LEFT_DOWN"),LEFT_UP:new e(1,"LEFT_UP"),LEFT_CLICK:new e(2,"LEFT_CLICK"),LEFT_DOUBLE_CLICK:new e(3,"LEFT_DOUBLE_CLICK"),RIGHT_DOWN:new e(5,"RIGHT_DOWN"),RIGHT_UP:new e(6,"RIGHT_UP"),RIGHT_CLICK:new e(7,"RIGHT_CLICK"),RIGHT_DOUBLE_CLICK:new e(8,"RIGHT_DOUBLE_CLICK"),MIDDLE_DOWN:new e(10,"MIDDLE_DOWN"),MIDDLE_UP:new e(11,"MIDDLE_UP"),MIDDLE_CLICK:new e(12,"MIDDLE_CLICK"),MIDDLE_DOUBLE_CLICK:new e(13,"MIDDLE_DOUBLE_CLICK"),MOUSE_MOVE:new e(15,"MOUSE_MOVE"),WHEEL:new e(16,"WHEEL"),PINCH_START:new e(17,"PINCH_START"),PINCH_END:new e(18,"PINCH_END"),PINCH_MOVE:new e(19,"PINCH_MOVE")};return t}),r("Core/ScreenSpaceEventHandler",["./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./ScreenSpaceEventType","./KeyboardEventModifier"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){if(e._element===document)return r.x=t.clientX,r.y=t.clientY,r;var i=e._element.getBoundingClientRect();return r.x=t.clientX-i.left,r.y=t.clientY-i.top,r}function l(e,t){var i=e.name;return r(t)&&(i+="+"+t.name),i}function u(e){return e.shiftKey?a.SHIFT:e.ctrlKey?a.CTRL:e.altKey?a.ALT:void 0}function c(e,t){var i=s(e,t,C.position);if(e._lastMousePosition.x=i.x,e._lastMousePosition.y=i.y,e._totalPixels=0,!e._seenAnyTouchEvents){var n,a=u(t);0===t.button?(e._leftMouseButtonDown=!0,n=e.getInputAction(o.LEFT_DOWN,a)):1===t.button?(e._middleMouseButtonDown=!0,n=e.getInputAction(o.MIDDLE_DOWN,a)):2===t.button&&(e._rightMouseButtonDown=!0,n=e.getInputAction(o.RIGHT_DOWN,a)),r(n)&&n(C),t.preventDefault()}}function h(e,t){var i,n,a=u(t);if(!e._seenAnyTouchEvents){0===t.button?(e._leftMouseButtonDown=!1,i=e.getInputAction(o.LEFT_UP,a),n=e.getInputAction(o.LEFT_CLICK,a)):1===t.button?(e._middleMouseButtonDown=!1,i=e.getInputAction(o.MIDDLE_UP,a),n=e.getInputAction(o.MIDDLE_CLICK,a)):2===t.button&&(e._rightMouseButtonDown=!1,i=e.getInputAction(o.RIGHT_UP,a),n=e.getInputAction(o.RIGHT_CLICK,a));var l=s(e,t,S.position),c=e._lastMousePosition.x-l.x,h=e._lastMousePosition.y-l.y;e._totalPixels+=Math.sqrt(c*c+h*h),r(i)&&i(S),r(n)&&e._totalPixels0)){var h=s(e,t.changedTouches[0],b.position),d=e._lastMousePosition.x-h.x,p=e._lastMousePosition.y-h.y;e._totalPixels+=Math.sqrt(d*d+p*p),r(i)&&i(b),r(n)&&e._totalPixelsP;P++,p+=v,++_){S=v>0?m[p]+f:f-m[p],E=S+d,x=-Math.cos(E),T=o.multiplyByScalar(c,x),x=Math.sin(E),A=o.multiplyByScalar(h,x),T=o.add(T,A,T),x=Math.cos(S),x*=x,b=Math.sin(S),b*=b,w=n/Math.sqrt(i*x+r*b),C=w/t,x=Math.sin(C/2);var D=a.normalize(new a(T.x*x,T.y*x,T.z*x,Math.cos(C/2))),M=s.fromQuaternion(D),I=s.multiplyByVector(M,u),O=o.normalize(I);I=o.multiplyByScalar(O,t),g[_]=I}}var u={computeCircleBoundary:function(t,r,n,o){return o=e(o,i.RADIANS_PER_DEGREE),this.computeEllipseBoundary(t,r,n,n,0,o) +},computeEllipseBoundary:function(t,r,n,a,s,u){if(s=e(s,0),u=e(u,i.RADIANS_PER_DEGREE),a>n){var c=n;n=a,a=c}for(var h=2.31,d=n*n,m=a*a,p=n*a,f=1-m/d,v=Math.sqrt(f),g=o.clone(r),_=o.magnitude(g),y=new o(0,0,1),C=1/_,S=o.multiplyByScalar(g,C),w=o.normalize(o.cross(y,g)),E=o.cross(S,w),x=1+Math.ceil(i.PI_OVER_TWO/u),b=h/(x-1),T=[],A=0,P=0,D=0;x>D;D++,P+=b,++A)if(T[A]=P-v*Math.sin(P),T[A]>=i.PI_OVER_TWO){T[A]=i.PI_OVER_TWO,x=D+1;break}var M=[];return l(t,_,d,m,p,v,S,w,E,s,T,0,0,1,M,0,x-1),l(t,_,d,m,p,v,S,w,E,s,T,x-1,Math.PI,-1,M,x-1,x-1),l(t,_,d,m,p,v,S,w,E,s,T,0,Math.PI,1,M,2*x-2,x-1),l(t,_,d,m,p,v,S,w,E,s,T,x-1,i.TWO_PI,-1,M,3*x-3,x),M.push(o.clone(M[0])),M},compute2DCircle:function(t,r){t=e(t,1),r=e(r,2*i.RADIANS_PER_DEGREE);for(var o=[],a=i.toRadians(1),s=2*Math.PI/a,l=0;s>l;l++)o.push(new n(t*Math.cos(a*l),t*Math.sin(a*l)));return o}};return u}),r("Core/ShowGeometryInstanceAttribute",["./defaultValue","./defined","./ComponentDatatype","./DeveloperError"],function(e,t,r){"use strict";var i=function(t){t=e(t,!0),this.componentDatatype=r.UNSIGNED_BYTE,this.componentsPerAttribute=1,this.normalize=!0,this.value=i.toValue(t)};return i.toValue=function(e,r){return t(r)?(r[0]=e,r):new Uint8Array([e])},i}),r("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=e.addSeconds(C,t);var r=t.getTotalDays()-S;return t=t.addSeconds(l(r),t)}function c(i,a,s,l,u,c,m,p){if(0>s&&(s=-s,u+=n.PI),0>s||s>n.PI)throw new r("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var v=i*(1-a),g=l-u,_=u,y=d(c-l,a),C=h(a,0);if("Hyperbolic"===C&&Math.abs(n.NegativePiToPi(y))>=Math.acos(-1/a))throw new r("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");f(g,s,_,D);var S=v*(1+a),w=Math.cos(y),E=Math.sin(y),x=1+a*w;if(x<=n.Epsilon10)throw new r("elements cannot be converted to cartesian");var b=S/x;return t(p)?(p.x=b*w,p.y=b*E,p.z=0):p=new e(b*w,b*E,0),o.multiplyByVector(D,p,p)}function h(e,t){if(0>e)throw new r("eccentricity cannot be negative.");return t>=e?"Circular":1-t>e?"Elliptical":1+t>=e?"Parabolic":"Hyperbolic"}function d(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=m(e,t);return p(i,t)}function m(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;M>o&&Math.abs(s-a)>I;++o){s=a;var l=s-t*Math.sin(s)-e,u=1-t*Math.cos(s);a=s-l/u}if(o>=M)throw new r("Kepler equation did not converge");return s=a+i*n.TWO_PI}function p(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o=Math.cos(e)-t,a=Math.sin(e)*Math.sqrt(1-t*t),s=Math.atan2(a,o);return s=n.zeroToTwoPi(s),0>e&&(s-=n.TWO_PI),s+=i*n.TWO_PI}function f(e,i,a,s){if(0>i||i>n.PI)throw new r("inclination out of range");var l=Math.cos(e),u=Math.sin(e),c=Math.cos(i),h=Math.sin(i),d=Math.cos(a),m=Math.sin(a);return t(s)?(s[0]=d*l-m*u*c,s[1]=m*l+d*u*c,s[2]=u*h,s[3]=-d*u-m*l*c,s[4]=-m*u+d*l*c,s[5]=l*h,s[6]=m*h,s[7]=-d*h,s[8]=c):s=new o(d*l-m*u*c,-d*u-m*l*c,m*h,m*l+d*u*c,-m*u+d*l*c,-d*h,u*h,l*h,c),s}function v(e,t){u(e,Dt);var r=Dt.getJulianDayNumber()-w.getJulianDayNumber()+(Dt.getSecondsOfDay()-w.getSecondsOfDay())/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=O+G*Math.cos(N*n)+Q*Math.sin(N*n)+H*Math.cos(B*n)+K*Math.sin(B*n)+j*Math.cos(z*n)+$*Math.sin(z*n)+q*Math.cos(F*n)+et*Math.sin(F*n)+Y*Math.cos(V*n)+tt*Math.sin(V*n)+X*Math.cos(k*n)+rt*Math.sin(k*n)+Z*Math.cos(U*n)+it*Math.sin(U*n)+J*Math.cos(W*n)+nt*Math.sin(W*n),s=R+L*i+mt*Math.cos(ot*n)+St*Math.sin(ot*n)+pt*Math.cos(at*n)+wt*Math.sin(at*n)+ft*Math.cos(st*n)+Et*Math.sin(st*n)+vt*Math.cos(lt*n)+xt*Math.sin(lt*n)+gt*Math.cos(ut*n)+bt*Math.sin(ut*n)+_t*Math.cos(ct*n)+Tt*Math.sin(ct*n)+yt*Math.cos(ht*n)+At*Math.sin(ht*n)+Ct*Math.cos(dt*n)+Pt*Math.sin(dt*n),l=.0167086342-.0004203654*i,h=102.93734808*T+11612.3529*A*i,d=469.97289*A*i,m=174.87317577*T-8679.27034*A*i;return c(o,l,d,h,m,s,x,t)}function g(e,t){u(e,Dt);var r=Dt.getJulianDayNumber()-w.getJulianDayNumber()+(Dt.getSecondsOfDay()-w.getSecondsOfDay())/a.SECONDS_PER_DAY,i=r/a.DAYS_PER_JULIAN_CENTURY,n=i*i,o=n*i,s=o*i,l=383397.7725+.004*i,h=.055545526-1.6e-8*i,d=5.15668983*T,m=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,p=83.35324312*T,f=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,v=125.04455501*T,g=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*T,y=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,C=297.85019547*T+A*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),S=93.27209062*T+A*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),x=134.96340251*T+A*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),P=357.52910918*T+A*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),D=310.17137918*T-A*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),M=2*C,I=4*C,O=6*C,R=2*x,L=3*x,N=4*x,B=2*S;l+=3400.4*Math.cos(M)-635.6*Math.cos(M-x)-235.6*Math.cos(x)+218.1*Math.cos(M-P)+181*Math.cos(M+x),h+=.014216*Math.cos(M-x)+.008551*Math.cos(M-R)-.001383*Math.cos(x)+.001356*Math.cos(M+x)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-R)+869e-6*Math.cos(M-P-x)-627e-6*Math.cos(M)-394e-6*Math.cos(I-N)+282e-6*Math.cos(M-P-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(I)+229e-6*Math.cos(O-N)-201e-6*Math.cos(R-B),m+=486.26*Math.cos(M-B)-40.13*Math.cos(M)+37.51*Math.cos(B)+25.73*Math.cos(R-B)+19.97*Math.cos(M-P-B),f+=-55609*Math.sin(M-x)-34711*Math.sin(M-R)-9792*Math.sin(x)+9385*Math.sin(I-L)+7505*Math.sin(I-R)+5318*Math.sin(M+x)+3484*Math.sin(I-N)-3417*Math.sin(M-P-x)-2530*Math.sin(O-N)-2376*Math.sin(M)-2075*Math.sin(M-L)-1883*Math.sin(R)-1736*Math.sin(O-5*x)+1626*Math.sin(P)-1370*Math.sin(O-L),g+=-5392*Math.sin(M-B)-540*Math.sin(P)-441*Math.sin(M)+423*Math.sin(B)-288*Math.sin(R-B),y+=-3332.9*Math.sin(M)+1197.4*Math.sin(M-x)-662.5*Math.sin(P)+396.3*Math.sin(x)-218*Math.sin(M-P);var z=2*D,F=3*D;m+=46.997*Math.cos(D)*i-.614*Math.cos(M-B+D)*i+.614*Math.cos(M-B-D)*i-.0297*Math.cos(z)*n-.0335*Math.cos(D)*n+.0012*Math.cos(M-B+z)*n-16e-5*Math.cos(D)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(z)*o;var V=2.116*Math.sin(D)*i-.111*Math.sin(M-B-D)*i-.0015*Math.sin(D)*n;f+=V,y+=V,g+=-520.77*Math.sin(D)*i+13.66*Math.sin(M-B+D)*i+1.12*Math.sin(M-D)*i-1.06*Math.sin(B-D)*i+.66*Math.sin(z)*n+.371*Math.sin(D)*n-.035*Math.sin(M-B+z)*n-.015*Math.sin(M-B+D)*n+.0014*Math.sin(D)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(z)*o,l*=b;var k=d+m*A,U=p+f*A,W=_+y*A,G=v+g*A;return c(l,h,k,U,G,W,E,t)}function _(t,r){return r=g(t,r),e.multiplyByScalar(r,It,r)}var y={},C=32.184,S=2451545,w=i.fromTotalDays(2451545,s.TAI),E=398600435e6,x=328900.56*1.012300034*E,b=1e3,T=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,P=14959787e4,D=new o,M=50,I=n.EPSILON8,O=1.0000010178*P,R=100.46645683*T,L=1295977422.83429*A,N=16002,B=21863,z=32004,F=10931,V=14529,k=16368,U=15318,W=32794,G=64e-7*P,H=-152*1e-7*P,j=62e-7*P,q=-8e-7*P,Y=32e-7*P,X=-41*1e-7*P,Z=19e-7*P,J=-11*1e-7*P,Q=-150*1e-7*P,K=-46*1e-7*P,$=68*1e-7*P,et=54e-7*P,tt=14e-7*P,rt=24e-7*P,it=-28*1e-7*P,nt=22e-7*P,ot=10,at=16002,st=21863,lt=10931,ut=1473,ct=32004,ht=4387,dt=73,mt=-325*1e-7,pt=-322*1e-7,ft=-79*1e-7,vt=232*1e-7,gt=-52*1e-7,_t=97e-7,yt=55e-7,Ct=-41*1e-7,St=-105*1e-7,wt=-137*1e-7,Et=258e-7,xt=35e-7,bt=-116*1e-7,Tt=-88*1e-7,At=-112*1e-7,Pt=-80*1e-7,Dt=new i,Mt=.012300034,It=-1*(Mt/(Mt+1)),Ot=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Rt=new e;return y.ComputeSunPositionInEarthInertialFrame=function(r,n){return t(r)||(r=new i),Rt=v(r,Rt),n=e.negate(Rt,n),_(r,Rt),e.subtract(n,Rt,n),o.multiplyByVector(Ot,n,n),n},y.ComputeMoonPositionInEarthInertialFrame=function(e,r){return t(e)||(e=new i),r=g(e,r),o.multiplyByVector(Ot,r,r),r},y}),r("Core/SimplePolylineGeometry",["./defined","./DeveloperError","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./Color","./Cartesian3"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.colors,i=o(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._perVertex=i,this._workerName="createSimplePolylineGeometry"};return d.createGeometry=function(t){var o,d=t._positions,m=t._colors,p=t._perVertex,f=e(m)&&!p,v=0,g=0,_=d.length,y=f?2*d.length-2:d.length,C=new Float64Array(3*y),S=e(m)?new Uint8Array(4*y):void 0;for(o=0;_>o;++o){var w,E=d[o];if(f&&o>0&&(h.pack(E,C,v),v+=3,w=m[o-1],S[g++]=c.floatToByte(w.red),S[g++]=c.floatToByte(w.green),S[g++]=c.floatToByte(w.blue),S[g++]=c.floatToByte(w.alpha)),f&&o===_-1)break;h.pack(E,C,v),v+=3,e(m)&&(w=m[o],S[g++]=c.floatToByte(w.red),S[g++]=c.floatToByte(w.green),S[g++]=c.floatToByte(w.blue),S[g++]=c.floatToByte(w.alpha))}var x=new u;x.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}),e(m)&&(x.color=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));var b=f?y:2*(y-1),T=i.createTypedArray(y,b),A=f?2:1;for(v=0,o=0;y-1>o;o+=A)T[v++]=o,T[v++]=o+1;return new s({attributes:x,indices:T,primitiveType:n.LINES,boundingSphere:a.fromPoints(d)})},d}),r("Core/SphereGeometry",["./defaultValue","./Cartesian3","./EllipsoidGeometry"],function(e,t,r){"use strict";var i=function(i){var n=e(i.radius,1),o=new t(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new r(a),this._workerName="createSphereGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/SphereOutlineGeometry",["./defaultValue","./Cartesian3","./EllipsoidOutlineGeometry"],function(e,t,r){"use strict";var i=function(i){var n=e(i.radius,1),o=new t(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new r(a),this._workerName="createSphereOutlineGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/Spherical",["./DeveloperError","./defaultValue","./defined"],function(e,t,r){"use strict";var i=function(e,r,i){this.clock=t(e,0),this.cone=t(r,0),this.magnitude=t(i,1)};return i.fromCartesian3=function(e,t){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return r(t)||(t=new i),t.clock=Math.atan2(o,n),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},i.clone=function(e,t){return r(e)?r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new i(e.clock,e.cone,e.magnitude):void 0},i.normalize=function(e,t){return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new i(e.clock,e.cone,1)},i.equals=function(e,t){return e===t||r(e)&&r(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},i.equalsEpsilon=function(e,i,n){return n=t(n,0),e===i||r(e)&&r(i)&&Math.abs(e.clock-i.clock)<=n&&Math.abs(e.cone-i.cone)<=n&&Math.abs(e.magnitude-i.magnitude)<=n},i.toString=function(e){return"("+e.clock+", "+e.cone+", "+e.magnitude+")"},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.normalize=function(e){return i.normalize(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return i.toString(this)},i}),r("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";var t,r=function(r){e(t)||(t=document.createElement("a")),t.href=window.location.href;var i=t.host,n=t.protocol;return t.href=r,t.href=t.href,n!==t.protocol||i!==t.host};return r}),r("Core/TaskProcessor",["require","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./isCrossOriginUrl","../ThirdParty/when","../ThirdParty/Uri"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){--e._activeTasks;var r=t.data,n=r.id;if(i(n)){var o=e._deferreds,a=o[n];i(r.error)?a.reject(r.error):a.resolve(r.result),delete o[n]}}function u(){if(i(h))return h;if(h=t("Workers/cesiumWorkerBootstrapper.js"),o(h)){var e,r='importScripts("'+h+'");';try{e=new Blob([r],{type:"application/javascript"})}catch(n){var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new a;s.append(r),e=s.getBlob("application/javascript")}var l=window.URL||window.webkitURL;h=l.createObjectURL(e)}return h}function c(n){var o=u(),a=new Worker(o);a.postMessage=r(a.webkitPostMessage,a.postMessage);var c={loaderConfig:{},workerModule:d._workerModulePrefix+n._workerName};if(i(d._loaderConfig))c.loaderConfig=d._loaderConfig;else if(i(e.toUrl)){var h=new s("..").resolve(new s(t("Workers/cesiumWorkerBootstrapper.js"))).toString();c.loaderConfig.baseUrl=h}else c.loaderConfig.paths={Workers:t("Workers")};a.postMessage(c),a.onmessage=function(e){l(n,e)},n._worker=a}var h,d=function(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0},m=[];return d.prototype.scheduleTask=function(e,t){if(i(this._worker)||c(this),this._activeTasks>=this._maximumActiveTasks)return void 0;++this._activeTasks,i(t)||(t=m);var r=this._nextID++,n=a.defer();return this._deferreds[r]=n,this._worker.postMessage({id:r,parameters:e},t),n.promise},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return i(this._worker)&&this._worker.terminate(),n(this)},d._defaultWorkerModulePrefix="Workers/",d._workerModulePrefix=d._defaultWorkerModulePrefix,d._loaderConfig=void 0,d}),r("Core/TimeIntervalCollection",["./defined","./defineProperties","./DeveloperError","./Event","./binarySearch","./TimeInterval","./JulianDate"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){return a.compare(e.start,t.start)}function l(t,r,i,n){for(var o=0,a=0,s=new u,l=t._intervals,c=r._intervals;oa;a++)if(!o.equals(r[a],i[a],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.clear=function(){this._intervals.length>0&&(this._intervals.length=0,this._intervalsChanged.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0},u.prototype.indexOf=function(e){var t=this._intervals,r=n(t,new o(e,e,!0,!0),s);return r>=0?t[r].isStartIncluded?r:r>0&&t[r-1].stop.equals(e)&&t[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-1s;s++)if(o=a[s],!(e(t)&&!o.start.equals(t)||e(r)&&!o.stop.equals(r)||e(i)&&o.isStartIncluded!==i||e(n)&&o.isStopIncluded!==n))return a[s];return void 0},u.prototype.addInterval=function(t,r){if(!t.isEmpty){var i,l,u=this._intervals;if(0===u.length||t.start.greaterThan(u[u.length-1].stop))return u.push(t),this._intervalsChanged.raiseEvent(this),void 0;for(l=n(u,t,s),0>l?l=~l:l>0&&t.isStartIncluded&&u[l-1].isStartIncluded&&u[l-1].start.equals(t.start)?--l:l0&&(i=a.compare(u[l-1].stop,t.start),(i>0||0===i&&(u[l-1].isStopIncluded||t.isStartIncluded))&&((e(r)?r(u[l-1].data,t.data):u[l-1].data===t.data)?(t=t.stop.greaterThan(u[l-1].stop)?new o(u[l-1].start,t.stop,u[l-1].isStartIncluded,t.isStopIncluded,t.data):new o(u[l-1].start,u[l-1].stop,u[l-1].isStartIncluded,u[l-1].isStopIncluded||t.stop.equals(u[l-1].stop)&&t.isStopIncluded,t.data),u.splice(l-1,1),--l):(i=a.compare(u[l-1].stop,t.stop),i>0||0===i&&u[l-1].isStopIncluded&&!t.isStopIncluded?u.splice(l-1,1,new o(u[l-1].start,t.start,u[l-1].isStartIncluded,!t.isStartIncluded,u[l-1].data),new o(t.stop,u[l-1].stop,!t.isStopIncluded,u[l-1].isStopIncluded,u[l-1].data)):u[l-1]=new o(u[l-1].start,t.start,u[l-1].isStartIncluded,!t.isStartIncluded,u[l-1].data))));l0||0===i&&(t.isStopIncluded||u[l].isStartIncluded));)if(e(r)?r(u[l].data,t.data):u[l].data===t.data)t=new o(t.start,u[l].stop.greaterThan(t.stop)?u[l].stop:t.stop,t.isStartIncluded,u[l].stop.greaterThan(t.stop)?u[l].isStopIncluded:t.isStopIncluded,t.data),u.splice(l,1);else{if(u[l]=new o(t.stop,u[l].stop,!t.isStopIncluded,u[l].isStopIncluded,u[l].data),!u[l].isEmpty)break;u.splice(l,1)}u.splice(l,0,t),this._intervalsChanged.raiseEvent(this)}},u.prototype.removeInterval=function(e){if(e.isEmpty)return!1;var t=!1,r=this._intervals,i=n(r,e,s);0>i&&(i=~i);var a=e.start,l=e.stop,u=e.isStartIncluded,c=e.isStopIncluded;if(i>0){var h=r[i-1],d=h.stop;(d.greaterThan(a)||d.equals(a)&&h.isStopIncluded&&u)&&(t=!0,(d.greaterThan(l)||h.isStopIncluded&&!c&&d.equals(l))&&r.splice(i,0,new o(l,d,!c,h.isStopIncluded,h.data)),r[i-1]=new o(h.start,a,h.isStartIncluded,!u,h.data))}var m=r[i];for(ia;a++)u[a]=i;return u}var c=n-i,h=c/l;for(a=1;l>a;a++){var d=i+a*h;u[a]=d}return u[0]=i,u}function c(e,t){return s.equalsEpsilon(e.latitude,t.latitude,s.EPSILON14)&&s.equalsEpsilon(e.longitude,t.longitude,s.EPSILON14)}function h(r,i,n,o){var a=e(o),s=e(n),l=[],u=[],h=a?[]:void 0,d=i.length;if(2>d)return{positions:i};var f=i[0];l.push(f);var v=r.cartesianToCartographic(f,m);s&&(v.height=n[0]),u.push(v.height),a&&h.push(o[0]);for(var g=1;d>g;++g){var _=i[g],y=r.cartesianToCartographic(_,p);s&&(y.height=n[g]),c(v,y)?v.height=3){var f=n.fromPoints(r,t),v=f.projectPointsOntoPlane(r);o.computeWindingOrder2D(v)===l.CLOCKWISE&&(r.reverse(),i.reverse(),p&&s.reverse())}var g,_=r.length,y=[],C=p?[]:void 0,S=[];for(g=0;_-1>g;g++){var w=r[g],E=r[g+1],x=i[g],b=i[g+1];y=y.concat(u(w,E,x,b,c)),d&&y.push(b),p&&(w=r[g],E=r[g+1],x=s[g],b=s[g+1],C=C.concat(u(w,E,x,b,c)),d&&C.push(b)),d&&(S=S.concat(a.scaleToSurface([w,E],c,t)))}d||(S=a.scaleToSurface(r,c,t),y.push(i[_-1]),p&&C.push(s[_-1]));var T=p?a.scaleToGeodeticHeight(S,C,t):S.slice(0),A=a.scaleToGeodeticHeight(S,y,t);return{newWallPositions:S,bottomPositions:T,topPositions:A}},d}),r("Core/WallGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new i,v=new i,g=new i,_=new i,y=new i,C=new i,S=new i,w=new i,E=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.positions,i=t.maximumHeights,n=t.minimumHeights,o=e(t.vertexFormat,m.DEFAULT),a=e(t.granularity,h.RADIANS_PER_DEGREE),l=e(t.ellipsoid,s.WGS84);this._positions=r,this._minimumHeights=n,this._maximumHeights=i,this._vertexFormat=o,this._granularity=a,this._ellipsoid=l,this._workerName="createWallGeometry"};return E.fromConstantHeights=function(r){r=e(r,e.EMPTY_OBJECT);var i,n,o=r.positions,a=r.minimumHeight,s=r.maximumHeight,l=t(a),u=t(s);if(l||u){var c=o.length;i=l?new Array(c):void 0,n=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(i[h]=a),u&&(n[h]=s)}var d={positions:o,maximumHeights:n,minimumHeights:i,ellipsoid:r.ellipsoid,vertexFormat:r.vertexFormat};return new E(d)},E.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,s=e._maximumHeights,m=e._vertexFormat,E=e._granularity,x=e._ellipsoid,b=p.computePositions(x,t,s,a,E,!0),T=b.newWallPositions,A=b.bottomPositions,P=b.topPositions,D=T.length,M=2*D,I=m.position?new Float64Array(M):void 0,O=m.normal?new Float32Array(M):void 0,R=m.tangent?new Float32Array(M):void 0,L=m.binormal?new Float32Array(M):void 0,N=m.st?new Float32Array(2*(M/3)):void 0,B=0,z=0,F=0,V=0,k=0,U=w,W=S,G=C,H=!0;D/=3;var j;for(j=0;D>j;++j){var q=3*j,Y=i.fromArray(P,q,f),X=i.fromArray(A,q,v);if(m.position&&(I[B++]=X.x,I[B++]=X.y,I[B++]=X.z,I[B++]=Y.x,I[B++]=Y.y,I[B++]=Y.z),m.normal||m.tangent||m.binormal){var Z,J=new i,Q=i.fromArray(T,q,v);if(D>j+1&&(Z=i.fromArray(T,q+3,g),J=i.fromArray(P,q+3,y)),H){var K=i.subtract(J,Y,_),$=i.subtract(Q,Y,f);U=i.normalize(i.cross($,K,U),U),H=!1}i.equalsEpsilon(Z,Q,h.EPSILON6)?H=!0:(m.tangent&&(W=i.normalize(i.subtract(Z,Q,W),W)),m.binormal&&(G=i.normalize(i.cross(U,W,G),G))),m.normal&&(O[z++]=U.x,O[z++]=U.y,O[z++]=U.z,O[z++]=U.x,O[z++]=U.y,O[z++]=U.z),m.tangent&&(R[V++]=W.x,R[V++]=W.y,R[V++]=W.z,R[V++]=W.x,R[V++]=W.y,R[V++]=W.z),m.binormal&&(L[F++]=G.x,L[F++]=G.y,L[F++]=G.z,L[F++]=G.x,L[F++]=G.y,L[F++]=G.z)}if(m.st){var et=j/(D-1);N[k++]=et,N[k++]=0,N[k++]=et,N[k++]=1}}var tt=new c;m.position&&(tt.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:I})),m.normal&&(tt.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:O})),m.tangent&&(tt.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:R})),m.binormal&&(tt.binormal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(tt.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:N}));var rt=M/3;M-=6;var it=o.createTypedArray(rt,M),nt=0;for(j=0;rt-2>j;j+=2){var ot=j,at=j+2,st=i.fromArray(I,3*ot,f),lt=i.fromArray(I,3*at,v);if(!i.equalsEpsilon(st,lt,h.EPSILON6)){var ut=j+1,ct=j+3;it[nt++]=ut,it[nt++]=ot,it[nt++]=ct,it[nt++]=ct,it[nt++]=ot,it[nt++]=at}}return new l({attributes:tt,indices:it,primitiveType:d.TRIANGLES,boundingSphere:new r.fromVertices(I)})},E}),r("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new t,f=new t,v=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,r=e.maximumHeights,n=e.minimumHeights,o=i(e.granularity,h.RADIANS_PER_DEGREE),s=i(e.ellipsoid,a.WGS84);this._positions=t,this._minimumHeights=n,this._maximumHeights=r,this._granularity=o,this._ellipsoid=s,this._workerName="createWallOutlineGeometry"};return v.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,r=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(r[h]=s)}var d={positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid};return new v(d)},v.createGeometry=function(i){var n=i._positions,o=i._minimumHeights,a=i._maximumHeights,v=i._granularity,g=i._ellipsoid,_=m.computePositions(g,n,a,o,v,!1),y=_.newWallPositions,C=_.bottomPositions,S=_.topPositions,w=y.length,E=2*w,x=new Float64Array(E),b=0;w/=3;var T;for(T=0;w>T;++T){var A=3*T,P=t.fromArray(S,A,p),D=t.fromArray(C,A,f);x[b++]=D.x,x[b++]=D.y,x[b++]=D.z,x[b++]=P.x,x[b++]=P.y,x[b++]=P.z}var M=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x})}),I=E/3;E=2*I-4+I;var O=c.createTypedArray(I,E),R=0;for(T=0;I-2>T;T+=2){var L=T,N=T+2,B=t.fromArray(x,3*L,p),z=t.fromArray(x,3*N,f);if(!t.equalsEpsilon(B,z,h.EPSILON6)){var F=T+1,V=T+3;O[R++]=F,O[R++]=L,O[R++]=F,O[R++]=V,O[R++]=L,O[R++]=N}}return O[R++]=I-2,O[R++]=I-1,new s({attributes:M,indices:O,primitiveType:d.LINES,boundingSphere:new e.fromVertices(x)})},v}),r("Core/WebMercatorProjection",["./defaultValue","./defined","./defineProperties","./Cartesian3","./Cartographic","./Math","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){this._ellipsoid=e(t,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return r(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return o.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(e,r){var n=this._semimajorAxis,o=e.longitude*n,a=s.geodeticLatitudeToMercatorAngle(e.latitude)*n,l=e.height;return t(r)?(r.x=o,r.y=a,r.z=l,r):new i(o,a,l)},s.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,o=e.x*i,a=s.mercatorAngleToGeodeticLatitude(e.y*i),l=e.z;return t(r)?(r.longitude=o,r.latitude=a,r.height=l,r):new n(o,a,l)},s}),r("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";var t=window.cancelAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"CancelAnimationFrame"],e(t)||(t=window[r[i]+"CancelRequestAnimationFrame"]),++i;e(t)||(t=clearTimeout)}();var r=function(e){t(e)};return r}),r("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";var r=function(i,n,o){o=e(o,!1);var a,s,l,u={},c=t(i),h=t(n);if(c)for(a in i)i.hasOwnProperty(a)&&(s=i[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],u[a]="object"==typeof l?r(s,l,o):s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u};return r}),r("Core/createGuid",[],function(){"use strict";var e=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=0|16*Math.random(),r="x"===e?t:8|3&t;return r.toString(16)})};return e}),r("Core/formatError",["./defined"],function(e){"use strict";var t=function(t){var r,i=t.name,n=t.message;r=e(i)&&e(n)?i+": "+n:t.toString();var o=t.stack;return e(o)&&(r+="\n"+o),r};return t}),r("Core/getFilenameFromUri",["./defined","./DeveloperError","../ThirdParty/Uri"],function(e,t,r){"use strict";var i=function(e){var t=new r(e);t.normalize();var i=t.path,n=i.lastIndexOf("/");return-1!==n&&(i=i.substr(n+1)),i};return i}),r("Core/getImagePixels",["./defined"],function(e){"use strict";var t={},r=function(r,i,n){e(i)||(i=r.width),e(n)||(n=r.height);var o=t[i];e(o)||(o={},t[i]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=i,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(r,0,0,i,n),a.getImageData(0,0,i,n).data};return r}),r("Core/jsonp",["./defaultValue","./defined","./DeveloperError","../ThirdParty/when"],function(e,t,r,i){"use strict";function n(e,t,r){e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}var o=function(r,a){a=e(a,e.EMPTY_OBJECT);var s,l=i.defer();do s="jsonp"+Math.random().toString().substring(2,8);while(t(window[s]));window[s]=function(e){l.resolve(e);try{delete window[s]}catch(t){window[s]=void 0}};var u=e(a.callbackParameterName,"callback"),c=[];n(c,u,s);var h=e(a.parameters,e.EMPTY_OBJECT);for(var d in h)h.hasOwnProperty(d)&&n(c,d,h[d]);c.length>0&&(r+=-1===r.indexOf("?")?"?":"&",r+=c.join("&"));var m=a.proxy;return t(m)&&(r=m.getURL(r)),o.loadAndExecuteScript(r,s,l),l.promise};return o.loadAndExecuteScript=function(e,t,r){var i=document.createElement("script");i.async=!0,i.src=e;var n=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,n.removeChild(i)},i.onerror=function(e){r.reject(e)},n.appendChild(i)},o.defaultLoadAndExecuteScript=o.loadAndExecuteScript,o}),r("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"arraybuffer",headers:r})};return t}),r("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"blob",headers:r})};return t}),r("Core/loadImage",["./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","../ThirdParty/when"],function(e,t,r,i,n){"use strict";var o=/^data:/,a=function(t,r){return r=e(r,!0),n(t,function(e){var t;t=o.test(e)||!r?!1:i(e);var s=n.defer();return a.createImage(e,t,s),s.promise})};return a.createImage=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(i)},i.onerror=function(e){r.reject(e)},t&&(i.crossOrigin=""),i.src=e},a.defaultCreateImage=a.createImage,a}),r("Core/loadImageViaBlob",["./loadBlob","./loadImage","../ThirdParty/when"],function(e,t,r){"use strict";var i=/^data:/,n=function(n){return i.test(n)?t(n):e(n).then(function(e){var i=window.URL.createObjectURL(e);return t(i,!1).then(function(t){return t.blob=e,window.URL.revokeObjectURL(i),t},function(e){return window.URL.revokeObjectURL(i),r.reject(e)})})},o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(t){return!1}}();return o?n:t}),r("Core/loadXML",["./defined","./DeveloperError","./RequestErrorEvent","../ThirdParty/when"],function(e,t,r,i){"use strict";var n=function(e,t){return i(e,function(e){var r=i.defer();return n.loadXML(e,t,r),r.promise})};return n.loadXML=function(t,i,n){var o=new XMLHttpRequest;if(o.overrideMimeType("text/xml"),o.open("GET",t,!0),e(i))for(var a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a,i[a]);o.onload=function(){200===o.status?n.resolve(o.responseXML):n.reject(new r(o.status,o.response))},o.onerror=function(){n.reject(new r)},o.send()},n.defaultLoadXML=n.loadXML,n}),r("Core/requestAnimationFrame",["./defined"],function(e){"use strict";var t=window.requestAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"RequestAnimationFrame"],++i;if(!e(t)){var o=0;t=function(e){var t=Date.now(),r=Math.max(16-(t-o),0);return o=t+r,setTimeout(function(){e(o)},r)}}}();var r=function(e){return t(e)};return r}),r("Core/throttleRequestByServer",["./defaultValue","./defined","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){return t(o)||(o=document.createElement("a")),o.href=e,o.hostname+"%"+o.port +}function n(t,n){var o=i(t),l=e(s[o],0);return l>a?void 0:(s[o]=l+1,r(n(t),function(e){return s[o]--,e},function(e){return s[o]--,r.reject(e)}))}var o,a=6,s={};return n}),r("Core/wrapFunction",["./DeveloperError"],function(){"use strict";var e=function(e,t,r){return function(){r.apply(e,arguments),t.apply(e,arguments)}};return e}),r("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,r,i,n){var o=t.measureText(r),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=!/\S/.test(r);o.fontsize=s;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+"px "+a,u.innerHTML=r+"
"+r,document.body.appendChild(u),o.leading=1.2*s;var c=e(u,"height");if(c=c.replace("px",""),c>=2*s&&(o.leading=0|c/2),document.body.removeChild(u),l)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var h=document.createElement("canvas"),d=100;h.width=o.width+d,h.height=3*s,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=s;var m=h.getContext("2d");m.font=s+"px "+a;var p=h.width,f=h.height,v=f/2;m.fillStyle="white",m.fillRect(-1,-1,p+2,f+2),i&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(r,d/2,v)),n&&(m.fillStyle="black",m.fillText(r,d/2,v));for(var g=m.getImageData(0,0,p,f).data,_=0,y=4*p,C=g.length;++_0&&255===g[_];);var w=0|_/y;for(_=0;C>_&&255===g[_];)_+=y,_>=C&&(_=_-C+4);var E=0|_%y/4,x=1;for(_=C-3;_>=0&&255===g[_];)_-=y,0>_&&(_=C-3-4*x++);var b=0|_%y/4+1;o.ascent=v-S,o.descent=w-v,o.bounds={minx:E-d/2,maxx:b-d/2,miny:0,maxy:w-S},o.height=1+(w-S)}return o};return t}),r("Core/writeTextToCanvas",["./defaultValue","./defined","./DeveloperError","./Color","../ThirdParty/measureText"],function(e,t,r,i,n){"use strict";var o=function(t,r){if(""===t)return void 0;r=e(r,e.EMPTY_OBJECT);var o=e(r.font,"10px sans-serif"),a=document.createElement("canvas");a.width=a.height=1,a.style.font=o;var s=a.getContext("2d");s.font=o,s.textBaseline=e(r.textBaseline,"bottom"),a.style.visibility="hidden",document.body.appendChild(a);var l=e(r.stroke,!1),u=e(r.fill,!0),c=2*e(r.strokeWidth,1);s.lineWidth=c;var h=n(s,t,l,u);a.dimensions=h,document.body.removeChild(a),a.style.visibility="";var d=h.height-h.ascent;a.width=h.width,a.height=h.height;var m=a.height-d;if(s.font=o,l){var p=e(r.strokeColor,i.BLACK);s.strokeStyle=p.toCssColorString(),s.lineWidth=c,s.strokeText(t,0,m)}if(u){var f=e(r.fillColor,i.WHITE);s.fillStyle=f.toCssColorString(),s.fillText(t,0,m)}return a};return o}),r("DynamicScene/createDynamicPropertyDescriptor",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";function r(e,r,i,n){return{configurable:n,get:function(){return this[r]},set:function(n){var o=this[r],a=this[i];t(a)&&(a(),this[i]=void 0),o!==n&&(this[r]=n,this._definitionChanged.raiseEvent(this,e,n,o)),t(n)&&t(n.definitionChanged)&&(this[i]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function i(t,i){return r(t,"_"+t,"_"+t+"Subscription",e(i,!1))}return i}),r("DynamicScene/ConstantProperty",["../Core/defineProperties","../Core/DeveloperError","../Core/Enumeration","../Core/Event","../Core/isArray"],function(e,t,r,i,n){"use strict";var o=function(e){this._value=void 0,this._simple=!0,this._definitionChanged=new i,this.setValue(e)};return e(o.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getValue=function(e,t){return this._simple?this._value:this._value.clone(t)},o.prototype.setValue=function(e){var t=this._value,i=this._simple;(i&&t!==e||!i&&!t.equals(e))&&(i="object"!=typeof e||n(e)||e instanceof r,this._value=i?e:e.clone(),this._simple=i,this._definitionChanged.raiseEvent(this))},o.prototype.equals=function(e){return this===e||e instanceof o&&(this._simple&&this._value===e._value||!this._simple&&this._value.equals(e._value))},o}),r("DynamicScene/Property",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(){r.throwInstantiationError()};return t(i.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),i.prototype.getValue=r.throwInstantiationError,i.prototype.equals=r.throwInstantiationError,i.equals=function(t,r){return t===r||e(t)&&t.equals(r)},i.arrayEquals=function(t,r){if(t===r)return!0;if(!e(t)||!e(r)||t.length!==r.length)return!1;for(var n=t.length,o=0;n>o;o++)if(!i.equals(t[o],r[o]))return!1;return!0},i.isConstant=function(t){return!e(t)||t.isConstant},i}),r("DynamicScene/ColorMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r){this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=t(r,new s(e.WHITE))};return u.fromColor=function(e){return new u(new s(e))},i(u.prototype,{isConstant:{get:function(){return l.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),u.prototype.getType=function(){return"Color"},u.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=r(this._color)?this._color.getValue(e,t.color):void 0,t},u.prototype.equals=function(e){return this===e||e instanceof u&&l.equals(this._color,e._color)},u.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},u}),r("DynamicScene/DynamicObject",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){this._cachedAvailabilityDate=void 0,this._cachedAvailabilityValue=void 0,r(t)||(t=e()),this._id=t,this._availability=void 0,this._parent=void 0,this._name=void 0,this._definitionChanged=new o,this._position=void 0,this._positionSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._billboard=void 0,this._billboardSubscription=void 0,this._cone=void 0,this._coneSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._pyramid=void 0,this._pyramidSubscription=void 0,this._vertexPositions=void 0,this._vertexPositionsSubscription=void 0,this._vector=void 0,this._vectorSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._propertyNames=["parent","position","orientation","billboard","cone","ellipsoid","ellipse","label","path","point","polygon","polyline","pyramid","vertexPositions","vector","viewFrom","description"]};return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},propertyNames:{get:function(){return this._propertyNames}},id:{get:function(){return this._id}},name:{configurable:!1,get:function(){return this._name},set:function(e){var t=this._name;t!==e&&(this._name=e,this._definitionChanged.raiseEvent(this,"name",e,t))}},availability:a("availability"),position:a("position"),orientation:a("orientation"),viewFrom:a("viewFrom"),billboard:a("billboard"),cone:a("cone"),ellipsoid:a("ellipsoid"),ellipse:a("ellipse"),label:a("label"),model:a("model","_model"),parent:a("parent"),path:a("path"),point:a("point"),polygon:a("polygon"),polyline:a("polyline"),pyramid:a("pyramid"),vertexPositions:a("vertexPositions"),vector:a("vector"),description:a("description")}),s.prototype.isAvailable=function(e){var t=this._availability;return!r(t)||t.contains(e)},s.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,a(e,!0))},s.prototype.removeProperty=function(e){this._propertyNames,this._propertyNames.push(e),delete this[e]},s.prototype.merge=function(e){this.name=t(this.name,e.name),this.availability=t(e.availability,this.availability);for(var i=this._propertyNames,n=i.length,o=0;n>o;o++){var a=i[o],s=this[a],l=e[a];r(l)&&(r(s)?r(s.merge)&&s.merge(l):this[a]=r(l.merge)&&r(l.clone)?l.clone():l)}},s}),r("DynamicScene/DynamicObjectCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TimeInterval","../Core/Iso8601","../Core/DeveloperError","../Core/RuntimeError","./DynamicObject"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){if(0===e._suspendCount){var t=e._addedObjects,r=e._removedObjects;(0!==t.length||0!==r.length)&&(e._collectionChanged.raiseEvent(e,t.values,r.values),t.removeAll(),r.removeAll())}}var h=function(){this._objects=new e,this._addedObjects=new e,this._removedObjects=new e,this._suspendCount=0,this._collectionChanged=new n,this._id=t()};return h.prototype.suspendEvents=function(){this._suspendCount++},h.prototype.resumeEvents=function(){this._suspendCount--,c(this)},h.collectionChangedEventCallback=void 0,i(h.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}}}),h.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,i=this._objects.values,n=0,s=i.length;s>n;n++){var l=i[n],u=l.availability;if(r(u)){var c=u.start,h=u.stop;c.lessThan(e)&&!c.equals(a.MINIMUM_VALUE)&&(e=c),h.greaterThan(t)&&!h.equals(a.MAXIMUM_VALUE)&&(t=h)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new o(e,t,!0,!0)},h.prototype.add=function(e){var t=e.id,i=this._objects;if(r(i.get(t)))throw new l("An object with id "+t+" already exists in this collection.");i.set(t,e),this._removedObjects,this._removedObjects.remove(t)||this._addedObjects.set(t,e),c(this)},h.prototype.remove=function(e){return this.removeById(e.id)},h.prototype.removeById=function(e){var t=this._objects,r=t.get(e);return this._objects.remove(e)?(this._addedObjects.remove(e)||this._removedObjects.set(e,r),c(this),!0):!1},h.prototype.removeAll=function(){for(var e=this._objects,t=e.length,i=e.values,n=this._addedObjects,o=this._removedObjects,a=0;t>a;a++){var s=i[a],l=s.id,u=n.get(l);r(u)||o.set(l,s)}e.removeAll(),n.removeAll(),c(this)},h.prototype.getById=function(e){return this._objects.get(e)},h.prototype.getObjects=function(){return this._objects.values},h.prototype.getOrCreateObject=function(e){var t=this._objects.get(e);return r(t)||(t=new u(e),this.add(t)),t},h}),r("DynamicScene/CompositeDynamicObjectCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./DynamicObject","./DynamicObjectCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,r=t.length,i=0;r>i;i++)e[t[i]]=void 0}function l(e,r,i){return function(n,o){for(var a=r.id,s=e._composite,l=s.getById(a),u=l[i],c=e._collections,h=c.length,d=h-1;d>=0;d--){var m=c[d].getById(r.id);if(t(m)){var p=m[i];if(t(p)){var f=p[o];if(t(f))return u[o]=f,void 0}}}u[o]=void 0}}function u(e,r){var i=e._composite,n=e._eventHash;return function(o,a){var s=o.id,l=i.getById(s),u=l[a];h(n,r,o,a),c(e,n,r,o,a,o[a]);for(var d=e._collections,m=d.length,p=!0,f=m-1;f>=0;f--){var v=d[f].getById(o.id);if(t(v)){var g=v[a];if(t(g)){if(p){if(p=!1,!t(g.merge)||!t(g.clone)){u=g;break}u=g.clone(u)}u.merge(g)}}}l[a]=u}}function c(e,r,i,n,o,a){if(t(a)&&t(a.definitionChanged)){var s=l(e,n,o);g[0]=i,g[1]=n.id,g[2]=o,r[JSON.stringify(g)]=a.definitionChanged.addEventListener(s)}}function h(e,r,i,n){g[0]=r,g[1]=i.id,g[2]=n;var o=JSON.stringify(g),a=e[o];t(a)&&(a(),e[o]=void 0)}function d(e,t,r,i){_[0]=r,_[1]=i.id,t[JSON.stringify(_)]=i.definitionChanged.addEventListener(u(e,r));for(var n=i.propertyNames,o=n.length,a=0;o>a;a++){var s=n[a];c(e,t,r,i,s,i[s])}}function m(e,t,r,i){_[0]=r,_[1]=i.id;var n=JSON.stringify(_);t[n](),t[n]=void 0;for(var o=i.propertyNames,a=o.length,s=0;a>s;s++){var l=o[s];h(t,r,i,l)}}function p(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var r,i,n,l,u,c,h=e._collections,p=h.length,f=e._collectionsCopy,v=f.length,g=e._composite,_=new a,C=e._eventHash;for(r=0;v>r;r++)for(u=f[r],u.collectionChanged.removeEventListener(y.prototype._onCollectionChanged,e),n=u.getObjects(),c=u.id,l=n.length-1;l>-1;l--)i=n[l],m(e,C,c,i);for(r=p-1;r>=0;r--)for(u=h[r],u.collectionChanged.addEventListener(y.prototype._onCollectionChanged,e),n=u.getObjects(),c=u.id,l=n.length-1;l>-1;l--){i=n[l],d(e,C,c,i);var S=_.getById(i.id);t(S)||(S=g.getById(i.id),t(S)?s(S):S=new o(i.id),_.add(S)),S.merge(i)}e._collectionsCopy=h.slice(0),g.suspendEvents(),g.removeAll();var w=_.getObjects();for(r=0;ru;u++){var _=i[u];m(this,v,g,_);var y=_.id;for(c=a-1;c>=0;c--)h=n[c].getById(y),t(h)&&(t(p)||(p=l.getById(y),s(p)),p.merge(h));t(p)||l.removeById(y)}var C=r.length;for(u=0;C>u;u++){var S=r[u];d(this,v,g,S);var w=S.id;for(c=a-1;c>=0;c--)h=n[c].getById(w),t(h)&&(t(p)||(p=l.getById(w),t(p)?s(p):(p=new o(w),l.add(p))),p.merge(h))}l.resumeEvents()},y}),r("DynamicScene/CompositeProperty",["./Property","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,i,n){var o=function(){i.raiseEvent(e)},a=[];r.removeAll();for(var s=n.length,l=0;s>l;l++){var u=n.get(l);t(u.data)&&-1===a.indexOf(u.data)&&r.add(u.data.definitionChanged,o)}}var l=function(){this._eventHelper=new o,this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)};return r(l.prototype,{isConstant:{get:function(){return this._intervals.empty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(e,r){var i=this._intervals.findDataForIntervalContainingDate(e);return t(i)?i.getValue(e,r):void 0},l.prototype.equals=function(t){return this===t||t instanceof l&&this._intervals.equals(t._intervals,e.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,r,i,n,o){"use strict";var a=function(){this._definitionChanged=new i,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)};return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var r=this._composite._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getType(t):void 0},a.prototype.getValue=function(t,r){var i=this._composite._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getValue(t,r):void 0},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),r("DynamicScene/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)};return r(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._composite._intervals.findDataForIntervalContainingDate(e);return t(n)?n.getValueInReferenceFrame(e,r,i):void 0},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,r,i,n,o,a){"use strict";var s=function(){i.throwInstantiationError()};r(s.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError},referenceFrame:{get:i.throwInstantiationError}}),s.prototype.getValue=i.throwInstantiationError,s.prototype.getValueInReferenceFrame=i.throwInstantiationError,s.prototype.equals=i.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(r,i,s,u,c){if(!t(i))return i;if(s===u)return e.clone(i,c);var h=a.computeIcrfToFixedMatrix(r,l);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(r,l)),s===o.INERTIAL?n.multiplyByVector(h,i,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,l),i,c):void 0},s}),r("DynamicScene/ConstantPositionProperty",["./PositionProperty","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,i){this._definitionChanged=new a,this._value=t.clone(e),this._referenceFrame=r(i,s.FIXED)};return n(l.prototype,{isConstant:{get:function(){return!i(this._value)||this._referenceFrame===s.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,s.FIXED,t)},l.prototype.setValue=function(e,r){var n=!1;t.equals(this._value,e)||(n=!0,this._value=t.clone(e)),i(r)&&this._referenceFrame!==r&&(n=!0,this._referenceFrame=r),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(t,r,i){return e.convertToReferenceFrame(t,this._value,this._referenceFrame,r,i)},l.prototype.equals=function(e){return this===e||e instanceof l&&t.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame},l}),r("Scene/HorizontalOrigin",["../Core/Enumeration"],function(e){"use strict";var t={CENTER:new e(0,"CENTER"),LEFT:new e(1,"LEFT"),RIGHT:new e(-1,"RIGHT")};return t}),r("Scene/LabelStyle",["../Core/Enumeration"],function(e){"use strict";var t={FILL:new e(0,"FILL"),OUTLINE:new e(1,"OUTLINE"),FILL_AND_OUTLINE:new e(2,"FILL_AND_OUTLINE")};return t}),r("Scene/VerticalOrigin",["../Core/Enumeration"],function(e){"use strict";var t={CENTER:new e(0,"CENTER"),BOTTOM:new e(1,"BOTTOM"),TOP:new e(-1,"TOP")};return t}),r("DynamicScene/DynamicBillboard",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._image=void 0,this._imageSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this._color,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e},a.prototype.merge=function(t){this.color=e(this._color,t._color),this.eyeOffset=e(this._eyeOffset,t._eyeOffset),this.horizontalOrigin=e(this._horizontalOrigin,t._horizontalOrigin),this.image=e(this._image,t._image),this.pixelOffset=e(this._pixelOffset,t._pixelOffset),this.scale=e(this._scale,t._scale),this.rotation=e(this._rotation,t._rotation),this.alignedAxis=e(this._alignedAxis,t._alignedAxis),this.show=e(this._show,t._show),this.verticalOrigin=e(this._verticalOrigin,t._verticalOrigin),this.width=e(this._width,t._width),this.height=e(this._height,t._height),this.scaleByDistance=e(this._scaleByDistance,t._scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t._translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t._pixelOffsetScaleByDistance)},a}),r("DynamicScene/DynamicClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o};return i(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return r(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||r(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(t){return r(t)||(t=new e),t.startTime=this.startTime,t.stopTime=this.stopTime,t.clockRange=this.clockRange,t.clockStep=this.clockStep,t.multiplier=this.multiplier,t.currentTime=this.currentTime,t},l}),r("DynamicScene/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=new o(e.WHITE),this.outlineColor=new o(e.BLACK),this.outlineWidth=new o(0)};return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color"),outlineColor:n("outlineColor"),outlineWidth:n("outlineWidth")}),s.prototype.getType=function(){return"PolylineOutline"},s.prototype.getValue=function(e,r){return t(r)||(r={}),r.color=t(this._color)?this._color.getValue(e,r.color):void 0,r.outlineColor=t(this._outlineColor)?this._outlineColor.getValue(e,r.outlineColor):void 0,r.outlineWidth=t(this._outlineWidth)?this._outlineWidth.getValue(e):void 0,r},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),r("DynamicScene/DynamicCone",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._minimumClockAngle=void 0,this._minimumClockAngleSubscription=void 0,this._maximumClockAngle=void 0,this._maximumClockAngleSubscription=void 0,this._innerHalfAngle=void 0,this._innerHalfAngleSubscription=void 0,this._outerHalfAngle=void 0,this._outerHalfAngleSubscription=void 0,this._capMaterial=void 0,this._capMaterialSubscription=void 0,this._innerMaterial=void 0,this._innerMaterialSubscription=void 0,this._outerMaterial=void 0,this._outerMaterialSubscription=void 0,this._silhouetteMaterial=void 0,this._silhouetteMaterialSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},minimumClockAngle:o("minimumClockAngle"),maximumClockAngle:o("maximumClockAngle"),innerHalfAngle:o("innerHalfAngle"),outerHalfAngle:o("outerHalfAngle"),capMaterial:o("capMaterial"),innerMaterial:o("innerMaterial"),outerMaterial:o("outerMaterial"),silhouetteMaterial:o("silhouetteMaterial"),intersectionColor:o("intersectionColor"),intersectionWidth:o("intersectionWidth"),showIntersection:o("showIntersection"),radius:o("radius"),show:o("show")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.innerHalfAngle=this.innerHalfAngle,e.outerHalfAngle=this.outerHalfAngle,e.minimumClockAngle=this.minimumClockAngle,e.maximumClockAngle=this.maximumClockAngle,e.radius=this.radius,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.capMaterial=this.capMaterial,e.innerMaterial=this.innerMaterial,e.outerMaterial=this.outerMaterial,e.silhouetteMaterial=this.silhouetteMaterial,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.innerHalfAngle=e(this.innerHalfAngle,t.innerHalfAngle),this.outerHalfAngle=e(this.outerHalfAngle,t.outerHalfAngle),this.minimumClockAngle=e(this.minimumClockAngle,t.minimumClockAngle),this.maximumClockAngle=e(this.maximumClockAngle,t.maximumClockAngle),this.radius=e(this.radius,t.radius),this.showIntersection=e(this.showIntersection,t.showIntersection),this.intersectionColor=e(this.intersectionColor,t.intersectionColor),this.intersectionWidth=e(this.intersectionWidth,t.intersectionWidth),this.capMaterial=e(this.capMaterial,t.capMaterial),this.innerMaterial=e(this.innerMaterial,t.innerMaterial),this.outerMaterial=e(this.outerMaterial,t.outerMaterial),this.silhouetteMaterial=e(this.silhouetteMaterial,t.silhouetteMaterial)},a}),r("DynamicScene/DynamicLabel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._definitionChanged=new n +};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t._translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t._pixelOffsetScaleByDistance)},a}),r("DynamicScene/DynamicEllipse",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:o("semiMajorAxis"),semiMinorAxis:o("semiMinorAxis"),rotation:o("rotation"),show:o("show"),material:o("material"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),numberOfVerticalLines:o("numberOfVerticalLines")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.numberOfVerticalLines=this.numberOfVerticalLines,e},a.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines)},a}),r("DynamicScene/DynamicEllipsoid",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),radii:o("radii"),material:o("material"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),stackPartitions:o("stackPartitions"),slicePartitions:o("slicePartitions"),subdivisions:o("subdivisions")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions)},a}),r("DynamicScene/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this.color=new a(t.WHITE),this.cellAlpha=new a(.1),this.lineCount=new a(new e(8,8)),this.lineThickness=new a(new e(1,1))};return i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),cellAlpha:o("cellAlpha"),lineCount:o("lineCount"),lineThickness:o("lineThickness")}),l.prototype.getType=function(){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=r(this._color)?this._color.getValue(e,t.color):void 0,t.cellAlpha=r(this._cellAlpha)?this._cellAlpha.getValue(e):void 0,t.lineCount=r(this._lineCount)?this._lineCount.getValue(e,t.lineCount):void 0,t.lineThickness=r(this._lineThickness)?this._lineThickness.getValue(e,t.lineThickness):void 0,t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/ImageMaterialProperty",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._definitionChanged=new i,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.repeat=new o(new e(1,1))};return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._image)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:n("image"),repeat:n("repeat")}),s.prototype.getType=function(){return"Image"},s.prototype.getValue=function(e,r){return t(r)||(r={}),r.image=t(this._image)?this._image.getValue(e):void 0,r.repeat=t(this._repeat)?this._repeat.getValue(e,r.repeat):void 0,r},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._image,e._image)&&a.equals(this._repeat,e._repeat)},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),r("DynamicScene/DynamicModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),uri:o("uri")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.scale=this.scale,e.uri=this.uri,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.scale=e(this.scale,t.scale),this.uri=e(this.uri,t.uri)},a}),r("DynamicScene/DynamicPath",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),width:o("width"),resolution:o("resolution"),leadTime:o("leadTime"),trailTime:o("trailTime")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.width=this.width,e.resolution=this.resolution,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime)},a}),r("DynamicScene/DynamicPoint",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance)},a}),r("DynamicScene/DynamicPolyline",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),width:o("width")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.material=this.material,e.width=this.width,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.width=e(this.width,t.width)},a}),r("DynamicScene/DynamicPolygon",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),perPositionHeight:o("perPositionHeight")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.perPositionHeight=this.perPositionHeight,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight)},a}),r("DynamicScene/DynamicPyramid",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._directions=void 0,this._directionsSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),directions:o("directions"),radius:o("radius"),showIntersection:o("showIntersection"),intersectionColor:o("intersectionColor"),intersectionWidth:o("intersectionWidth"),material:o("material")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.directions=this.directions,e.radius=this.radius,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.material=this.material,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.directions=e(this.directions,t.directions),this.radius=e(this.radius,t.radius),this.showIntersection=e(this.showIntersection,t.showIntersection),this.intersectionColor=e(this.intersectionColor,t.intersectionColor),this.intersectionWidth=e(this.intersectionWidth,t.intersectionWidth),this.material=e(this.material,t.material)},a}),r("DynamicScene/DynamicVector",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._colorSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._direction=void 0,this._directionSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),show:o("show"),width:o("width"),direction:o("direction"),length:o("length")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.width=this.width,e.direction=this.direction,e.length=this.length,e.show=this.show,e},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.width=e(this.width,t.width),this.direction=e(this.direction,t.direction),this.length=e(this.length,t.length),this.show=e(this.show,t.show)},a}),r("DynamicScene/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t,r){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(r,a.FIXED),this.setValue(t)};return r(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var r=e.length,i=0;r>i;i++)if(!s.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._value;if(!t(n))return void 0;var o=n.length;t(i)||(i=new Array(o));for(var a=0,s=0;o>a;){var l=n[a],u=l.getValueInReferenceFrame(e,r,i[a]);t(u)&&(i[s]=u,s++),a++}return i.length=s,i},l.prototype.setValue=function(e){var r=this._eventHelper;if(r.removeAll(),t(e)){this._value=e.slice();for(var i=e.length,n=0;i>n;n++){var o=e[n];t(o)&&r.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../DynamicScene/Property"],function(e,t,r,i,n){"use strict";function o(t){var r=t._targetProperty;if(!e(r)){var i=t._dynamicObjectCollection,n=i.getById(t._targetObjectId);e(n)&&(r=n[t._targetPropertyName],t._targetProperty=r,t._targetObject=n)}return r}var a=function(e,t,r){this._targetProperty=void 0,this._dynamicObjectCollection=e,this._targetObjectId=t,this._targetObject=void 0,this._targetPropertyName=r,this._definitionChanged=new i};return t(a.prototype,{isConstant:{get:function(){return n.isConstant(o(this))}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.fromString=function(e,t){var r=t.split(".");return new a(e,r[0],r[1])},a.prototype.getValue=function(t,r){var i=o(this);return e(i)&&this._targetObject.isAvailable(t)?i.getValue(t,r):void 0},a.prototype.getValueInReferenceFrame=function(t,r,i){var n=o(this);return e(n)&&this._targetObject.isAvailable(t)?n.getValueInReferenceFrame(t,r,i):void 0},a.prototype.equals=function(e){return this===e||this._dynamicObjectCollection===e._dynamicObjectCollection&&this._targetObjectId===e._targetObjectId&&this._targetPropertyName===e._targetPropertyName},a}),r("DynamicScene/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i,n=e.length,o=r.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;o>i;i++)e[t++]=r[i]}function u(e,t){return e instanceof a?e:"string"==typeof e?a.fromIso8601(e):t.addSeconds(e)}var c={packedLength:1,pack:function(e,r,i){i=t(i,0),r[i]=e},unpack:function(e,r){return r=t(r,0),e[r]}},h=[],d=[],m=function(t,i,n,o,s){for(var c,m,p,f,v,g,_=0;_p){for(p=~p,f=p*s,m=void 0,g=i[p];_=0||r(g)&&a.compare(v,g)>=0));){for(h[y++]=v,_+=1,c=0;s>c;c++)d[C++]=o[_],_+=1;m=v}y>0&&(d.length=C,l(n,f,d),h.length=y,l(i,p,h))}else{for(c=0;s>c;c++)_++,n[p*s+c]=o[_];_++}}},p=function(e){var r=e;r===Number&&(r=c);var i=t(r.packedInterpolationLength,r.packedLength);this._type=e,this._innerType=r,this._interpolationDegree=1,this._interpolationAlgorithm=s,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedInterpolationLength=i,this._updateTableLength=!0,this._interpolationResult=new Array(i),this._definitionChanged=new o};return i(p.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}}}),p.prototype.getValue=function(t,i){var n=this._innerType,o=this._times,s=this._values,l=e(o,t,a.compare);if(0>l){var u=this._xTable,c=this._yTable,h=this._interpolationAlgorithm,d=this._packedInterpolationLength;if(this._updateTableLength){this._updateTableLength=!1;var m=Math.min(h.getRequiredDataPoints(this._interpolationDegree),o.length);m!==this._numberOfPoints&&(this._numberOfPoints=m,u.length=m,c.length=m*d)}var p=this._numberOfPoints-1;if(1>p)return void 0;l=~l,l>=o.length&&(l=o.length-1);var f=0,v=o.length-1,g=v-f+1;if(p+1>g);else{var _=l-(0|p/2)-1;f>_&&(_=f);var y=_+p;y>v&&(y=v,_=y-p,f>_&&(_=f)),f=_,v=y}for(var C=v-f+1,S=0;C>S;++S)u[S]=o[v].getSecondsDifference(o[f+S]);if(r(n.convertPackedArrayForInterpolation))n.convertPackedArrayForInterpolation(s,f,v,c);else for(var w=0,E=n.packedLength,x=f*E,b=(v+1)*E;b>x;)c[w]=s[x],x++,w++;var T=o[v].getSecondsDifference(t),A=h.interpolateOrderZero(T,u,c,d,this._interpolationResult);return r(n.unpackInterpolationResult)?n.unpackInterpolationResult(A,s,f,v,i):n.unpack(A,0,i)}return n.unpack(this._values,l*n.packedLength,i)},p.prototype.setInterpolationOptions=function(e){var t=!1,r=e.interpolationAlgorithm,i=e.interpolationDegree;this._interpolationAlgorithm!==r&&(this._interpolationAlgorithm=r,t=!0),this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},p.prototype.addSample=function(e,t){var r=this._innerType,i=[e];r.pack(t,i,1),m(void 0,this._times,this._values,i,r.packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.addSamples=function(e,t){for(var r=this._innerType,i=e.length,n=[],o=0;i>o;o++)n.push(e[o]),r.pack(t[o],n,n.length);m(void 0,this._times,this._values,n,r.packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.addSamplesPackedArray=function(e,t){m(t,this._times,this._values,e,this._innerType.packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;var t=this._times,i=e._times,n=t.length;if(n!==i.length)return!1;var o;for(o=0;n>o;o++)if(!a.equals(t[o],i[o]))return!1;var s=this._values,l=e._values;for(o=0;n>o;o++)if(s[o]!==l[o])return!1;return this._type===e._type&&this._interpolationDegree===e._interpolationDegree&&this._interpolationAlgorithm===e._interpolationAlgorithm},p._mergeNewSamples=m,p}),r("DynamicScene/SampledPositionProperty",["./PositionProperty","./Property","./SampledProperty","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(e){this._property=new r(i),this._definitionChanged=new l,this._referenceFrame=n(e,u.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)};return a(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,u.FIXED,t)},c.prototype.getValueInReferenceFrame=function(t,r,i){return i=this._property.getValue(t,i),o(i)?e.convertToReferenceFrame(t,i,this._referenceFrame,r,i):i},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t){this._property.addSample(e,t)},c.prototype.addSamples=function(e,t){this._property.addSamples(e,t)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||t.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),r("DynamicScene/TimeIntervalCollectionPositionProperty",["./PositionProperty","./Property","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(e){this._definitionChanged=new a,this._intervals=new l,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=r(e,s.FIXED)};return n(u.prototype,{isConstant:{get:function(){return this._intervals.empty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,s.FIXED,t)},u.prototype.getValueInReferenceFrame=function(t,r,n){var o=this._intervals.findDataForIntervalContainingDate(t);return i(o)?e.convertToReferenceFrame(t,o,this._referenceFrame,r,n):void 0},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,t.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),r("DynamicScene/TimeIntervalCollectionProperty",["./Property","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Enumeration","../Core/Event","../Core/isArray","../Core/TimeIntervalCollection"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){this._definitionChanged=new o,this._intervals=new s,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)};return r(l.prototype,{isConstant:{get:function(){return this._intervals.empty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(e,r){var i=this._intervals.findDataForIntervalContainingDate(e);return!t(i)||"object"!=typeof i||a(i)||i instanceof n?i:i.clone(r)},l.prototype.equals=function(t){return this===t||t instanceof l&&this._intervals.equals(t._intervals,e.equals)},l.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/CzmlDataSource",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Color","../Core/ClockRange","../Core/ClockStep","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/Quaternion","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./createDynamicPropertyDescriptor","./DynamicBillboard","./DynamicClock","./ColorMaterialProperty","./PolylineOutlineMaterialProperty","./DynamicCone","./DynamicLabel","./DynamicEllipse","./DynamicEllipsoid","./GridMaterialProperty","./ImageMaterialProperty","./DynamicModel","./DynamicObject","./DynamicObjectCollection","./DynamicPath","./DynamicPoint","./DynamicPolyline","./DynamicPolygon","./DynamicPyramid","./DynamicVector","./PositionPropertyArray","./ReferenceProperty","./SampledPositionProperty","./SampledProperty","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","../ThirdParty/Uri","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N,B,z,F,V,k,U,W,G,H,j,q,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut){"use strict";function ct(e,t,r){return l(t)||l(r)?(e instanceof Yt||(e=new Yt),_t(Number,e,"x",t),_t(Number,e,"y",r),e):e}function ht(e){var t=e.rgbaf;if(l(t))return t;var r=e.rgba;if(!l(r))return void 0;if(r.length===i.length)return[i.byteToFloat(r[0]),i.byteToFloat(r[1]),i.byteToFloat(r[2]),i.byteToFloat(r[3])];var n=r.length;t=new Array(n);for(var o=0;n>o;o+=5)t[o]=r[o],t[o+1]=i.byteToFloat(r[o+1]),t[o+2]=i.byteToFloat(r[o+2]),t[o+3]=i.byteToFloat(r[o+3]),t[o+4]=i.byteToFloat(r[o+4]);return t}function dt(e,t){var r=s(e.image,e);if(l(t)){var i=new lt(document.location.href);t=new lt(t),r=new lt(r).resolve(t.resolve(i)).toString()}return r}function mt(e,t){var r=s(e.uri,e);if(l(t)){var i=new lt(document.location.href);t=new lt(t),r=new lt(r).resolve(t.resolve(i)).toString()}return r}function pt(e){if(l(e.cartesian))return e.cartesian;if(l(e.unitCartesian))return e.unitCartesian;var r,i,n,o=e.unitSpherical;if(l(o)){if(i=o.length,2===i)Zt.clock=o[0],Zt.cone=o[1],t.fromSpherical(Zt,Xt),n=[Xt.x,Xt.y,Xt.z];else{var a=0;for(n=new Array(4*(i/3)),r=0;i>r;r+=4)n[r]=o[a++],Zt.clock=o[a++],Zt.cone=o[a++],t.fromSpherical(Zt,Xt),n[r+1]=Xt.x,n[r+2]=Xt.y,n[r+3]=Xt.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)Jt.longitude=s[0],Jt.latitude=s[1],Jt.height=s[2],h.WGS84.cartographicToCartesian(Jt,Xt),n=[Xt.x,Xt.y,Xt.z];else for(i=s.length,n=new Array(i),r=0;i>r;r+=4)Jt.longitude=s[r+1],Jt.latitude=s[r+2],Jt.height=s[r+3],h.WGS84.cartographicToCartesian(Jt,Xt),n[r]=s[r],n[r+1]=Xt.x,n[r+2]=Xt.y,n[r+3]=Xt.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new x(JSON.stringify(e)+" is not a valid CZML interval."); +if(3===u.length)Jt.longitude=S.toRadians(u[0]),Jt.latitude=S.toRadians(u[1]),Jt.height=u[2],h.WGS84.cartographicToCartesian(Jt,Xt),n=[Xt.x,Xt.y,Xt.z];else for(i=u.length,n=new Array(i),r=0;i>r;r+=4)Jt.longitude=S.toRadians(u[r+1]),Jt.latitude=S.toRadians(u[r+2]),Jt.height=u[r+3],h.WGS84.cartographicToCartesian(Jt,Xt),n[r]=u[r],n[r+1]=Xt.x,n[r+2]=Xt.y,n[r+3]=Xt.z;return n}function ft(r,n,o){switch(r){case Boolean:return s(n["boolean"],n);case e:return n.cartesian2;case t:return pt(n);case i:return ht(n);case P:return P[s(n.horizontalOrigin,n)];case Image:return dt(n,o);case g:return g.fromIso8601(s(n.date,n));case D:return D[s(n.labelStyle,n)];case Number:return s(n.number,n);case String:return s(n.string,n);case Array:return n.array;case w:var a=n.unitQuaternion;if(l(a)){if(4===a.length)return[-a[0],-a[1],-a[2],a[3]];a=a.slice(0);for(var u=0;ud;if(!p&&!h)return t[r]=l(e.unpack)?new N(e.unpack(c,0)):new N(c),!0;var f,_=!1,y=t[r],C=i.epoch;if(l(C)&&(f=g.fromIso8601(C)),p&&!h)return y instanceof ot||(y=new ot(e),t[r]=y,_=!0),y.addSamplesPackedArray(c,f),vt(i,y),_;var S;if(!p&&h)return a=a.clone(),a.data=l(e.unpack)?e.unpack(c,0):c,l(y)||(y=new st,t[r]=y,_=!0),y instanceof st?y.intervals.addInterval(a):y instanceof R?(a.data=new N(a.data),y.intervals.addInterval(a)):(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new R,t[r]=y,y.intervals.addInterval(S),a.data=new N(a.data),y.intervals.addInterval(a)),_;l(y)||(_=!0,y=new R,t[r]=y),y instanceof R||(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new R,t[r]=y,y.intervals.addInterval(S));var w=y.intervals;return S=w.findInterval(a.start,a.stop,a.isStartIncluded,a.isStopIncluded),l(S)&&S.data instanceof ot||(S=a.clone(),S.data=new ot(e),w.addInterval(S)),S.data.addSamplesPackedArray(c,f),vt(i,S.data),_}function _t(e,t,r,i,n,o){if(l(i))if(f(i))for(var a=0,s=i.length;s>a;a++)gt(e,t,r,i[a],n,o);else gt(e,t,r,i,n,o)}function yt(e,r,i,n){var o,a=i.interval;l(a)?(o=T.fromIso8601(a),l(n)&&(o=o.intersect(n))):l(n)&&(o=n);var u=s(E[i.referenceFrame],void 0),c=pt(i),h=l(o)&&!o.equals(v.MAXIMUM_INTERVAL),d=t.packedLength,m=s(c.length,1),p="string"!=typeof c&&m>d;if(!p&&!h)return e[r]=new L(t.unpack(c),u),!0;var f,_=!1,y=e[r],C=i.epoch;if(l(C)&&(f=g.fromIso8601(C)),p&&!h)return(!(y instanceof nt)||l(u)&&y.referenceFrame!==u)&&(y=new nt(u),e[r]=y,_=!0),y.addSamplesPackedArray(c,f),vt(i,y),_;var S;if(!p&&h)return o=o.clone(),o.data=t.unpack(c),l(y)||(y=new at(u),e[r]=y,_=!0),y instanceof at&&l(u)&&y.referenceFrame===u?y.intervals.addInterval(o):y instanceof O?(o.data=new L(o.data,u),y.intervals.addInterval(o)):(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new O(y.referenceFrame),e[r]=y,y.intervals.addInterval(S),o.data=new L(o.data,u),y.intervals.addInterval(o)),_;l(y)?y instanceof O||(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new O(y.referenceFrame),e[r]=y,y.intervals.addInterval(S)):(_=!0,y=new O(u),e[r]=y);var w=y.intervals;return S=w.findInterval(o.start,o.stop,o.isStartIncluded,o.isStopIncluded),l(S)&&S.data instanceof nt&&(!l(u)||S.data.referenceFrame===u)||(S=o.clone(),S.data=new nt(u),w.addInterval(S)),S.data.addSamplesPackedArray(c,f),vt(i,S.data),_}function Ct(e,t,r,i,n){if(l(r))if(f(r))for(var o=0,a=r.length;a>o;o++)yt(e,t,r[o],i,n);else yt(e,t,r,i,n)}function St(e,t,r,n,o){var a,s=r.interval;l(s)?(a=T.fromIso8601(s),l(n)&&(a=a.intersect(n))):l(n)&&(a=n);var u,c,h=e[t];if(l(a)){h instanceof I||(h=new I,e[t]=h);var d=h.intervals;c=d.findInterval(a.start,a.stop),l(c)?u=c.data:(c=a.clone(),d.addInterval(c))}else u=h;var m;l(r.solidColor)?(u instanceof V||(u=new V),m=r.solidColor,_t(i,u,"color",m.color)):l(r.grid)?(u instanceof j||(u=new j),m=r.grid,_t(i,u,"color",m.color,void 0,o),_t(Number,u,"cellAlpha",m.cellAlpha,void 0,o),u.lineThickness=ct(u.lineThickness,m.rowThickness,m.columnThickness),u.lineCount=ct(u.lineCount,m.rowCount,m.columnCount)):l(r.image)&&(u instanceof q||(u=new q),m=r.image,_t(Image,u,"image",m.image,void 0,o),u.repeat=ct(u.repeat,m.horizontalRepeat,m.verticalRepeat)),l(c)?c.data=u:e[t]=u}function wt(e,t,r,i,n){if(l(r))if(f(r))for(var o=0,a=r.length;a>o;o++)St(e,t,r[o],i,n);else St(e,t,r,i,n)}function Et(e,t){e.name=s(t.name,e.name)}function xt(e,t,r,i){var n=t.description;l(n)&&_t(String,e,"description",n,void 0,i)}function bt(e,t,r,i){var n=t.position;l(n)&&Ct(e,"position",n,void 0,i)}function Tt(e,r,i,n){var o=r.viewFrom;l(o)&&_t(t,e,"viewFrom",o,void 0,n)}function At(e,t,r,i){var n=t.orientation;l(n)&&_t(w,e,"orientation",n,void 0,i)}function Pt(e,i,n){var o,a,s=i.references;if(l(s)){var u=[];for(o=0,a=s.length;a>o;o++)u.push(it.fromString(n,s[o]));var c=i.interval;l(c)?(c=T.fromIso8601(c),e.vertexPositions instanceof O||(e.vertexPositions=new O,c.data=new rt(u),e.vertexPositions.intervals.addInterval(c))):e.vertexPositions=new rt(u)}else{var d=[],m=i.cartesian;if(l(m)){for(o=0,a=m.length;a>o;o+=3)d.push(new t(m[o],m[o+1],m[o+2]));i.array=d}else if(m=i.cartographicRadians,l(m)){for(o=0,a=m.length;a>o;o+=3)d.push(h.WGS84.cartographicToCartesian(new r(m[o],m[o+1],m[o+2])));i.array=d}else if(m=i.cartographicDegrees,l(m)){for(o=0,a=m.length;a>o;o+=3)d.push(h.WGS84.cartographicToCartesian(r.fromDegrees(m[o],m[o+1],m[o+2])));i.array=d}l(i.array)&&_t(Array,e,"vertexPositions",i)}}function Dt(e,t,r){var i=t.vertexPositions;if(l(i))if(f(i))for(var n=i.length,o=0;n>o;o++)Pt(e,i[o],r);else Pt(e,i,r)}function Mt(e,t){var r,i=t.availability;if(l(i)){var n;if(f(i))for(var o=i.length,a=0;o>a;a++)l(n)||(n=new A),r=T.fromIso8601(i[a]),n.addInterval(r);else r=T.fromIso8601(i),n=new A,n.addInterval(r);e.availability=n}}function It(r,n,o,a){var s=n.billboard;if(l(s)){var u=s.interval;l(u)&&(u=T.fromIso8601(u));var c=r.billboard;l(c)||(r.billboard=c=new z),_t(i,c,"color",s.color,u,a),_t(t,c,"eyeOffset",s.eyeOffset,u,a),_t(P,c,"horizontalOrigin",s.horizontalOrigin,u,a),_t(Image,c,"image",s.image,u,a),_t(e,c,"pixelOffset",s.pixelOffset,u,a),_t(Number,c,"scale",s.scale,u,a),_t(Number,c,"rotation",s.rotation,u,a),_t(t,c,"alignedAxis",s.alignedAxis,u,a),_t(Boolean,c,"show",s.show,u,a),_t(M,c,"verticalOrigin",s.verticalOrigin,u,a)}}function Ot(e,t){var r=t.clock;if(l(r)&&"document"===e.id){var i=e.clock;if(l(i)||(i=new F,i.startTime=v.MAXIMUM_INTERVAL.start,i.stopTime=v.MAXIMUM_INTERVAL.stop,i.clockRange=n.LOOP_STOP,i.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,i.multiplier=1,e.clock=i),l(r.interval)){var a=T.fromIso8601(r.interval);i.startTime=a.start,i.stopTime=a.stop}l(r.currentTime)&&(i.currentTime=g.fromIso8601(r.currentTime)),l(r.range)&&(i.clockRange=n[r.range]),l(r.step)&&(i.clockStep=o[r.step]),l(r.multiplier)&&(i.multiplier=r.multiplier)}}function Rt(e,t,r,n){var o=t.cone;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.cone;l(s)||(e.cone=s=new U),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"radius",o.radius,a,n),_t(Boolean,s,"showIntersection",o.showIntersection,a,n),_t(i,s,"intersectionColor",o.intersectionColor,a,n),_t(Number,s,"intersectionWidth",o.intersectionWidth,a,n),_t(Number,s,"innerHalfAngle",o.innerHalfAngle,a,n),_t(Number,s,"outerHalfAngle",o.outerHalfAngle,a,n),_t(Number,s,"minimumClockAngle",o.minimumClockAngle,a,n),_t(Number,s,"maximumClockAngle",o.maximumClockAngle,a,n),wt(s,"capMaterial",o.capMaterial,a,n),wt(s,"innerMaterial",o.innerMaterial,a,n),wt(s,"outerMaterial",o.outerMaterial,a,n),wt(s,"silhouetteMaterial",o.silhouetteMaterial,a,n)}}function Lt(e,t,r,n){var o=t.ellipse;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.ellipse;l(s)||(e.ellipse=s=new G),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"rotation",o.rotation,a,n),_t(Number,s,"semiMajorAxis",o.semiMajorAxis,a,n),_t(Number,s,"semiMinorAxis",o.semiMinorAxis,a,n),_t(Number,s,"height",o.height,a,n),_t(Number,s,"extrudedHeight",o.extrudedHeight,a,n),_t(Number,s,"granularity",o.granularity,a,n),_t(Number,s,"stRotation",o.stRotation,a,n),wt(s,"material",o.material,a,n),_t(Boolean,s,"fill",o.fill,a,n),_t(Boolean,s,"outline",o.outline,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,a,n)}}function Nt(e,r,n,o){var a=r.ellipsoid;if(l(a)){var s=a.interval;l(s)&&(s=T.fromIso8601(s));var u=e.ellipsoid;l(u)||(e.ellipsoid=u=new H),_t(Boolean,u,"show",a.show,s,o),_t(t,u,"radii",a.radii,s,o),wt(u,"material",a.material,s,o),_t(Boolean,u,"fill",a.fill,s,o),_t(Boolean,u,"outline",a.outline,s,o),_t(i,u,"outlineColor",a.outlineColor,s,o)}}function Bt(r,n,o,a){var s=n.label;if(l(s)){var u=s.interval;l(u)&&(u=T.fromIso8601(u));var c=r.label;l(c)||(r.label=c=new W),_t(i,c,"fillColor",s.fillColor,u,a),_t(i,c,"outlineColor",s.outlineColor,u,a),_t(Number,c,"outlineWidth",s.outlineWidth,u,a),_t(t,c,"eyeOffset",s.eyeOffset,u,a),_t(P,c,"horizontalOrigin",s.horizontalOrigin,u,a),_t(String,c,"text",s.text,u,a),_t(e,c,"pixelOffset",s.pixelOffset,u,a),_t(Number,c,"scale",s.scale,u,a),_t(Boolean,c,"show",s.show,u,a),_t(M,c,"verticalOrigin",s.verticalOrigin,u,a),_t(String,c,"font",s.font,u,a),_t(D,c,"style",s.style,u,a)}}function zt(e,t,r,i){var n=t.model;if("undefined"!=typeof n){var o=n.interval;l(o)&&(o=T.fromIso8601(o));var a=e.model;l(a)||(e.model=a=new Y),_t(Boolean,a,"show",n.show,o,i),_t(Number,a,"scale",n.scale,o,i),_t(lt,a,"uri",n.gltf,o,i)}}function Ft(e,t,r,n){var o=t.path;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.path;l(s)||(e.path=s=new J),_t(i,s,"color",o.color,a,n),_t(Number,s,"width",o.width,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Number,s,"outlineWidth",o.outlineWidth,a,n),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"resolution",o.resolution,a,n),_t(Number,s,"leadTime",o.leadTime,a,n),_t(Number,s,"trailTime",o.trailTime,a,n)}}function Vt(e,t,r,n){var o=t.point;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.point;l(s)||(e.point=s=new Q),_t(i,s,"color",o.color,a,n),_t(Number,s,"pixelSize",o.pixelSize,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Number,s,"outlineWidth",o.outlineWidth,a,n),_t(Boolean,s,"show",o.show,a,n)}}function kt(e,t,r,n){var o=t.polygon;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.polygon;l(s)||(e.polygon=s=new $),_t(Boolean,s,"show",o.show,a,n),wt(s,"material",o.material,a,n),_t(Number,s,"height",o.height,a,n),_t(Number,s,"extrudedHeight",o.extrudedHeight,a,n),_t(Number,s,"granularity",o.granularity,a,n),_t(Number,s,"stRotation",o.stRotation,a,n),_t(Boolean,s,"fill",o.fill,a,n),_t(Boolean,s,"outline",o.outline,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Boolean,s,"perPositionHeight",o.perPositionHeight,a,n)}}function Ut(e,t,r,n){var o=t.polyline;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.polyline;l(s)||(e.polyline=s=new K);var u=s.material;if(l(a)){var c,h=u;h instanceof I||(h=new I,s.material=h,l(u)&&(c=v.MAXIMUM_INTERVAL.clone(),c.data=u,h.intervals.addInterval(c))),c=h.intervals.findInterval(a.start,a.stop,a.isStartIncluded,a.isStopIncluded),l(c)?u=c.data:(u=new k,c=a.clone(),c.data=u,h.intervals.addInterval(c))}else u instanceof k||(u=new k,s.material=u);_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"width",o.width,a,n),_t(i,u,"color",o.color,a,n),_t(i,u,"outlineColor",o.outlineColor,a,n),_t(Number,u,"outlineWidth",o.outlineWidth,a,n)}}function Wt(e,r,i,n){var o,a,s=[],u=r.unitSpherical;if(l(u)){for(o=0,a=u.length;a>o;o+=2)s.push(new b(u[o],u[o+1]));r.array=s}if(u=r.unitCartesian,l(u)){for(o=0,a=u.length;a>o;o+=3)s.push(b.fromCartesian3(new t(u[o],u[o+1],u[o+2])));r.array=s}_t(Array,e,"directions",r,i,n)}function Gt(e,t,r,n){var o=t.pyramid;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.pyramid;l(s)||(e.pyramid=s=new et),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"radius",o.radius,a,n),_t(Boolean,s,"showIntersection",o.showIntersection,a,n),_t(i,s,"intersectionColor",o.intersectionColor,a,n),_t(Number,s,"intersectionWidth",o.intersectionWidth,a,n),wt(s,"material",o.material,a,n);var u=o.directions;if(l(u))if(f(u))for(var c=u.length,h=0;c>h;h++)Wt(s,u[h],a,n);else Wt(s,u,a,n)}}function Ht(e,r,n,o){var a=r.vector;if(l(a)){var s=a.interval;l(s)&&(s=T.fromIso8601(s));var u=e.vector;l(u)||(e.vector=u=new tt),_t(i,u,"color",a.color,s,o),_t(Boolean,u,"show",a.show,s,o),_t(Number,u,"width",a.width,s,o),_t(t,u,"direction",a.direction,s,o),_t(Number,u,"length",a.length,s,o)}}function jt(e,t,r,i,n){var o=e.id;if(l(o)||(o=a()),e["delete"]===!0)t.removeById(o);else{var s;s="document"===o?n._document:t.getOrCreateObject(o);var u=e.parent;l(u)&&(s.parent=t.getOrCreateObject(u));for(var c=r.length-1;c>-1;c--)r[c](s,e,t,i)}}function qt(e,t,r){var i=e._dynamicObjectCollection;i.suspendEvents(),Kt._processCzml(t,i,r,void 0,e);var a,s=e._document,u=!1;if(l(s.clock))a=s.clock;else{var c=i.computeAvailability();if(!c.start.equals(v.MINIMUM_VALUE)){var h=c.start,d=c.stop,p=h.getSecondsDifference(d),f=Math.round(p/120);a=new F,a.startTime=h,a.stopTime=d,a.clockRange=n.LOOP_STOP,a.multiplier=f,a.currentTime=h,a.clockStep=o.SYSTEM_CLOCK_MULTIPLIER}}l(a)&&(l(e._clock)||(e._clock=new F,u=!0),a.equals(e._clock)||(a.clone(e._clock),u=!0));var g;l(s.name)?g=s.name:l(r)&&(g=m(r)),e._name!==g&&(e._name=g,u=!0),i.resumeEvents(),u&&e._changed.raiseEvent(e)}var Yt=function(){this._definitionChanged=new d,this._x=void 0,this._xSubscription=void 0,this._y=void 0,this._ySubscription=void 0,this.x=new N(0),this.y=new N(.1)};u(Yt.prototype,{isConstant:{get:function(){return this._x.isConstant&&this._y.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},x:B("x"),y:B("y")}),Yt.prototype.getValue=function(t,r){return l(r)||(r=new e),r.x=this._x.getValue(t),r.y=this._y.getValue(t),r},Yt.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Xt=new t,Zt=new b,Jt=new r,Qt={HERMITE:p,LAGRANGE:_,LINEAR:y},Kt=function(e){this._name=e,this._changed=new d,this._error=new d,this._clock=void 0,this._dynamicObjectCollection=new Z,this._timeVarying=!0,this._document=new X};return Kt.updaters=[Ot,It,Lt,Nt,Rt,Bt,zt,Et,xt,Ft,Vt,kt,Ut,Gt,Ht,bt,Tt,At,Dt,Mt],Kt.prototype.getChangedEvent=function(){return this._changed},Kt.prototype.getErrorEvent=function(){return this._error},Kt.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},Kt.prototype.getName=function(){return this._name},Kt.prototype.getClock=function(){return this._clock},Kt.prototype.getIsTimeVarying=function(){return this._timeVarying},Kt.prototype.process=function(e,t){qt(this,e,t)},Kt.prototype.load=function(e,t){this._document=new X("document"),this._dynamicObjectCollection.removeAll(),qt(this,e,t)},Kt.prototype.processUrl=function(e){var t=this;return ut(C(e),function(r){t.process(r,e)},function(e){return t._error.raiseEvent(t,e),ut.reject(e)})},Kt.prototype.loadUrl=function(e){var t=this;return ut(C(e),function(r){t.load(r,e)},function(e){return t._error.raiseEvent(t,e),ut.reject(e)})},Kt.processPacketData=_t,Kt.processPositionPacketData=Ct,Kt.processMaterialPacketData=wt,Kt._processCzml=function(e,t,r,i,n){if(i=l(i)?i:Kt.updaters,f(e))for(var o=0,a=e.length;a>o;o++)jt(e[o],t,i,r,n);else jt(e,t,i,r,n)},Kt}),r("DynamicScene/DataSource",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.getChangedEvent=e.throwInstantiationError,t.prototype.getErrorEvent=e.throwInstantiationError,t.prototype.getDynamicObjectCollection=e.throwInstantiationError,t.prototype.getName=e.throwInstantiationError,t.prototype.getClock=e.throwInstantiationError,t.prototype.getIsTimeVarying=e.throwInstantiationError,t}),r("DynamicScene/DataSourceCollection",["../Core/DeveloperError","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Event"],function(e,t,r,i,n){"use strict";var o=function(){this._dataSources=[],this.dataSourceAdded=new n,this.dataSourceRemoved=new n};return r(o.prototype,{length:{get:function(){return this._dataSources.length}}}),o.prototype.add=function(e){this._dataSources.push(e),this.dataSourceAdded.raiseEvent(this,e)},o.prototype.remove=function(e,t){var r=this._dataSources.indexOf(e);return-1!==r?(this._dataSources.splice(r,1),this.dataSourceRemoved.raiseEvent(this,e),"function"==typeof e.destroy&&t&&e.destroy(),!0):!1},o.prototype.removeAll=function(e){for(var t=this._dataSources,r=t.length-1;r>=0;r--)this.remove(t[r],e)},o.prototype.contains=function(e){return-1!==this.indexOf(e)},o.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},o.prototype.get=function(e){return this._dataSources[e]},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return this.removeAll(!0),i(this)},o}),r("Renderer/BlendEquation",["../Core/Enumeration"],function(e){"use strict";var t={ADD:new e(32774,"ADD"),SUBTRACT:new e(32778,"SUBTRACT"),REVERSE_SUBTRACT:new e(32779,"REVERSE_SUBTRACT"),validate:function(e){return e===t.ADD||e===t.SUBTRACT||e===t.REVERSE_SUBTRACT}};return t}),r("Renderer/BlendFunction",["../Core/Enumeration"],function(e){"use strict";var t={ZERO:new e(0,"ZERO"),ONE:new e(1,"ONE"),SOURCE_COLOR:new e(768,"SOURCE_COLOR"),ONE_MINUS_SOURCE_COLOR:new e(769,"ONE_MINUS_SOURCE_COLOR"),DESTINATION_COLOR:new e(774,"DESTINATION_COLOR"),ONE_MINUS_DESTINATION_COLOR:new e(775,"ONE_MINUS_DESTINATION_COLOR"),SOURCE_ALPHA:new e(770,"SOURCE_ALPHA"),ONE_MINUS_SOURCE_ALPHA:new e(771,"ONE_MINUS_SOURCE_ALPHA"),DESTINATION_ALPHA:new e(772,"DESTINATION_ALPHA"),ONE_MINUS_DESTINATION_ALPHA:new e(773,"ONE_MINUS_DESTINATION_ALPHA"),CONSTANT_COLOR:new e(32769,"CONSTANT_COLOR"),ONE_MINUS_CONSTANT_COLOR:new e(32770,"ONE_MINUS_CONSTANT_COLOR"),CONSTANT_ALPHA:new e(32771,"CONSTANT_ALPHA"),ONE_MINUS_CONSTANT_ALPHA:new e(32772,"ONE_MINUS_CONSTANT_ALPHA"),SOURCE_ALPHA_SATURATE:new e(776,"SOURCE_ALPHA_SATURATE"),validate:function(e){return e===t.ZERO||e===t.ONE||e===t.SOURCE_COLOR||e===t.ONE_MINUS_SOURCE_COLOR||e===t.DESTINATION_COLOR||e===t.ONE_MINUS_DESTINATION_COLOR||e===t.SOURCE_ALPHA||e===t.ONE_MINUS_SOURCE_ALPHA||e===t.DESTINATION_ALPHA||e===t.ONE_MINUS_DESTINATION_ALPHA||e===t.CONSTANT_COLOR||e===t.ONE_MINUS_CONSTANT_COLOR||e===t.CONSTANT_ALPHA||e===t.ONE_MINUS_CONSTANT_ALPHA||e===t.SOURCE_ALPHA_SATURATE}};return t}),r("Renderer/BlendingState",["./BlendEquation","./BlendFunction"],function(e,t){"use strict";var r={DISABLED:{enabled:!1},ALPHA_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.SOURCE_ALPHA,functionSourceAlpha:t.SOURCE_ALPHA,functionDestinationRgb:t.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:t.ONE_MINUS_SOURCE_ALPHA},PRE_MULTIPLIED_ALPHA_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.ONE,functionSourceAlpha:t.ONE,functionDestinationRgb:t.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:t.ONE_MINUS_SOURCE_ALPHA},ADDITIVE_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.SOURCE_ALPHA,functionSourceAlpha:t.SOURCE_ALPHA,functionDestinationRgb:t.ONE,functionDestinationAlpha:t.ONE}};return r}),r("Renderer/BufferUsage",["../Core/Enumeration"],function(e){"use strict";var t={STREAM_DRAW:new e(35040,"STREAM_DRAW"),STATIC_DRAW:new e(35044,"STATIC_DRAW"),DYNAMIC_DRAW:new e(35048,"DYNAMIC_DRAW"),validate:function(e){return e===t.STREAM_DRAW||e===t.STATIC_DRAW||e===t.DYNAMIC_DRAW}};return t}),r("Renderer/DrawCommand",[],function(){"use strict";var e=function(){this.boundingVolume=void 0,this.cull=!0,this.modelMatrix=void 0,this.primitiveType=void 0,this.vertexArray=void 0,this.count=void 0,this.offset=0,this.shaderProgram=void 0,this.uniformMap=void 0,this.renderState=void 0,this.framebuffer=void 0,this.pass=void 0,this.executeInClosestFrustum=!1,this.owner=void 0,this.debugShowBoundingVolume=!1,this.debugOverlappingFrustums=0};return e.prototype.execute=function(e,t){e.draw(this,t)},e}),r("Renderer/Pass",[],function(){"use strict";var e={OPAQUE:0,TRANSLUCENT:1,OVERLAY:2};return e}),r("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./BufferUsage"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var i=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=r(i);if(!o||i.getSizeInBytes()0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function u(e){var t=e.vaByPurpose;if(r(t)){for(var i in t)if(t.hasOwnProperty(i))for(var n=t[i],o=n.length,a=0;o>a;++a)n[a].va.destroy();e.vaByPurpose=void 0}}var c=function(e,t,i){function n(e,t){return t.componentDatatype.sizeInBytes-e.componentDatatype.sizeInBytes}var o=c._verifyAttributes(t);i=i||0;for(var s,l,u,h,d={},m=[],p=o.length,f=0;p>f;++f){var v=o[f];v.vertexBuffer?m.push(v):(u=v.purpose,s=d[u],r(s)||(s=d[u]={}),h=v.usage.toString(),l=s[h],r(l)||(l=s[h]=[]),l.push(v))}this._buffersByPurposeAndUsage={},this._allBuffers=[];for(u in d)if(d.hasOwnProperty(u)){s=d[u];var g=this._buffersByPurposeAndUsage[u];r(g)||(g=this._buffersByPurposeAndUsage[u]={});for(h in s)if(s.hasOwnProperty(h)){l=s[h],l.sort(n);var _,y=c._vertexSizeInBytes(l);switch(h){case a.STATIC_DRAW.toString():_=a.STATIC_DRAW;break;case a.STREAM_DRAW.toString():_=a.STREAM_DRAW;break;case a.DYNAMIC_DRAW.toString():_=a.DYNAMIC_DRAW}var C={purpose:u,vertexSizeInBytes:y,vertexBuffer:void 0,usage:_,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(l,y)};g[h]=C,this._allBuffers.push(C)}}this._size=0,this._precreated=m,this._context=e,this.writers=void 0,this.vaByPurpose=void 0,this.resize(i)};c._verifyAttributes=function(i){for(var o=[],s=0;si;++i){var n=e[i];t+=n.componentsPerAttribute*n.componentDatatype.sizeInBytes}var o=r>0?e[0].componentDatatype.sizeInBytes:0,a=o>0?t%o:0,s=0===a?0:o-a;return t+=s},c._createArrayViews=function(e,t){for(var r=[],i=0,n=e.length,o=0;n>o;++o){var a=e[o],s=a.componentDatatype;r.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/s.sizeInBytes,view:void 0}),i+=a.componentsPerAttribute*s.sizeInBytes}return r},c.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers={};for(var i=0,n=t.length;n>i;++i){var o=t[i];c._resize(o,this._size);var a=this.writers[o.purpose];r(a)||(a=this.writers[o.purpose]=[]),c._appendWriters(a,o)}u(this)},c._resize=function(t,r){if(t.vertexSizeInBytes>0){var i=new ArrayBuffer(r*t.vertexSizeInBytes);if(t.arrayBuffer)for(var n=new Uint8Array(i),o=new Uint8Array(t.arrayBuffer),a=o.length,s=0;a>s;++s)n[s]=o[s];for(var l=t.arrayViews,u=l.length,c=0;u>c;++c){var h=l[c];h.view=e.createArrayBufferView(h.componentDatatype,i,h.offsetInBytes)}t.arrayBuffer=i}};var h=[function(e,t,r){return function(i,n){t[i*r]=n,e.needsCommit=!0}},function(e,t,r){return function(i,n,o){var a=i*r;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a){var s=i*r;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a,s){var l=i*r;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return c._appendWriters=function(e,t){for(var r=t.arrayViews,i=r.length,n=0;i>n;++n){var o=r[n];e[o.index]=h[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},c.prototype.commit=function(e){for(var t,i=!1,n=this._allBuffers,a=0,l=n.length;l>a;++a)t=n[a],i=s(this,t)||i;if(i||!r(this.vaByPurpose)){var h=this._buffersByPurposeAndUsage;u(this),this.vaByPurpose={};for(var d in h)if(h.hasOwnProperty(d)){for(var m=h[d],p=[],f=Math.ceil(this._size/o.SIXTY_FOUR_KILOBYTES),v=0;f>v;++v){var g=[],_=h.all;if(_!==m)for(var y in _)if(_.hasOwnProperty(y)){var C=_[y];c._appendAttributes(g,C,v*C.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES)}for(var S in m)m.hasOwnProperty(S)&&(t=m[S],c._appendAttributes(g,t,v*t.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES));g=g.concat(this._precreated),p.push({va:this._context.createVertexArray(g,e),indicesCount:1.5*(v!==f-1?o.SIXTY_FOUR_KILOBYTES:this._size%o.SIXTY_FOUR_KILOBYTES)})}this.vaByPurpose[d]=p}}},c._appendAttributes=function(e,t,r){for(var i=t.arrayViews,n=i.length,o=0;n>o;++o){var a=i[o];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:r+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes})}},c.prototype.subCommit=function(e,t){for(var r=this._allBuffers,i=0,n=r.length;n>i;++i)l(r[i],e,t)},c.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t)e[t].needsCommit=!1},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return u(this),i(this)},c}),r("Renderer/createShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError"],function(e,t,r){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT);var n=i.defines,o=i.sources,a=i.pickColorQualifier;if(t(a)&&"uniform"!==a&&"varying"!==a)throw new r("options.pickColorQualifier must be 'uniform' or 'varying'.");var s,l,u="";if(t(n)&&n.length>0)for(l=n.length,s=0;l>s;++s)0!==n[s].length&&(u+="#define "+n[s]+"\n");if(t(o)&&o.length>0)for(l=o.length,s=0;l>s;++s)u+="\n#line 0\n"+o[s];if(t(a)){var c=u.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),h=a+" vec4 czm_pickColor; \n"+"void main() \n"+"{ \n"+" czm_old_main(); \n"+" if (gl_FragColor.a == 0.0) { \n"+" discard; \n"+" } \n"+" gl_FragColor = czm_pickColor; \n"+"}";u=c+"\n"+h}return u}return i}),r("Scene/SceneMode",["../Core/Enumeration"],function(e){"use strict";var t={SCENE2D:new e(0,"SCENE2D",{morphTime:0}),COLUMBUS_VIEW:new e(1,"COLUMBUS_VIEW",{morphTime:0}),SCENE3D:new e(2,"SCENE3D",{morphTime:1}),MORPHING:new e(3,"MORPHING")};return t}),r("Scene/SceneTransforms",["../Core/defined","../Core/DeveloperError","../Core/Cartographic","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Matrix4","../Core/BoundingRectangle","../Core/Math","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c,h={},d=new o(0,0,0,1),m=new o;h.wgs84ToWindowCoordinates=function(t,r,i){if(h.computeActualWgs84Position(t.frameState,r,d),!e(d))return i=void 0,void 0;var n=t.camera;return c=a.multiply(n.frustum.projectionMatrix,n.viewMatrix,c),a.multiplyByVector(c,d,m),h.clipToWindowCoordinates(t.context,m,i)},h.wgs84ToDrawingBufferCoordinates=function(t,r,i){if(h.computeActualWgs84Position(t.frameState,r,d),!e(d))return void 0;var n=t.context.getUniformState().getViewProjection();return a.multiplyByVector(n,o.fromElements(d.x,d.y,d.z,1,m),m),h.clipToDrawingBufferCoordinates(t.context,m,i)};var p=new n,f=new r;h.computeActualWgs84Position=function(t,r,i){var o=t.mode;if(o===u.SCENE3D)return n.clone(r,i);var a=t.scene2D.projection;if(a.ellipsoid.cartesianToCartographic(r,f),!e(f))return i=void 0;if(a.project(f,p),o===u.COLUMBUS_VIEW)return n.fromElements(p.z,p.x,p.y,i);if(o===u.SCENE2D)return n.fromElements(0,p.x,p.y,i);var s=t.morphTime;return n.fromElements(l.lerp(p.z,r.x,s),l.lerp(p.x,r.y,s),l.lerp(p.y,r.z,s),i)};var v=new n,g=new n,_=new s,y=new a;return h.clipToWindowCoordinates=function(e,t,r){var o=e.getCanvas();return n.divideByScalar(t,t.w,v),_.width=o.clientWidth,_.height=o.clientHeight,a.computeViewportTransformation(_,0,1,y),a.multiplyByPoint(y,v,g),i.fromCartesian3(g,r)},h.clipToDrawingBufferCoordinates=function(e,t,r){return n.divideByScalar(t,t.w,v),_.width=e.getDrawingBufferWidth(),_.height=e.getDrawingBufferHeight(),a.computeViewportTransformation(_,0,1,y),a.multiplyByPoint(y,v,g),i.fromCartesian3(g,r)},h.transformWindowToDrawingBuffer=function(e,t,r){var n=e.getCanvas(),o=e.getDrawingBufferWidth()/n.clientWidth,a=e.getDrawingBufferHeight()/n.clientHeight;return i.fromElements(t.x*o,t.y*a,r)},h}),r("Scene/Billboard",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/NearFarScalar","../Core/Matrix4","./HorizontalOrigin","./VerticalOrigin","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,r){var i=e._billboardCollection;t(i)&&(i._updateBillboard(e,r),e._dirty=!0)}var p=function(t,r){t=e(t,e.EMPTY_OBJECT),this._show=e(t.show,!0),this._position=o.clone(e(t.position,o.ZERO)),this._actualPosition=o.clone(this._position),this._pixelOffset=n.clone(e(t.pixelOffset,n.ZERO)),this._translate=new n(0,0),this._eyeOffset=o.clone(e(t.eyeOffset,o.ZERO)),this._verticalOrigin=e(t.verticalOrigin,c.CENTER),this._horizontalOrigin=e(t.horizontalOrigin,u.CENTER),this._scale=e(t.scale,1),this._imageIndex=e(t.imageIndex,-1),this._color=i.clone(e(t.color,i.WHITE)),this._rotation=e(t.rotation,0),this._alignedAxis=o.clone(e(t.alignedAxis,o.ZERO)),this._width=t.width,this._height=t.height,this._scaleByDistance=t.scaleByDistance,this._translucencyByDistance=t.translucencyByDistance,this._pixelOffsetScaleByDistance=t.pixelOffsetScaleByDistance,this._id=t.id,this._collection=e(t.collection,r),this._pickId=void 0,this._pickIdThis=t._pickIdThis,this._billboardCollection=r,this._dirty=!1,this._index=-1},f=p.SHOW_INDEX=0,v=p.POSITION_INDEX=1,g=p.PIXEL_OFFSET_INDEX=2,_=p.EYE_OFFSET_INDEX=3,y=p.HORIZONTAL_ORIGIN_INDEX=4,C=p.VERTICAL_ORIGIN_INDEX=5,S=p.SCALE_INDEX=6,w=p.IMAGE_INDEX_INDEX=7,E=p.COLOR_INDEX=8,x=p.ROTATION_INDEX=9,b=p.ALIGNED_AXIS_INDEX=10,T=p.SCALE_BY_DISTANCE_INDEX=11,A=p.TRANSLUCENCY_BY_DISTANCE_INDEX=12,P=p.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;p.NUMBER_OF_PROPERTIES=14,p.prototype.getPickId=function(r){return t(this._pickId)||(this._pickId=r.createPickId({primitive:e(this._pickIdThis,this),collection:this._collection,id:this._id})),this._pickId},p.prototype.getShow=function(){return this._show},p.prototype.setShow=function(e){e!==this._show&&(this._show=e,m(this,f))},p.prototype.getPosition=function(){return this._position},p.prototype.setPosition=function(e){var t=this._position;o.equals(t,e)||(o.clone(e,t),o.clone(e,this._actualPosition),m(this,v))},p.prototype._getActualPosition=function(){return this._actualPosition +},p.prototype._setActualPosition=function(e){o.clone(e,this._actualPosition),m(this,v)},p.prototype.getPixelOffset=function(){return this._pixelOffset},p.prototype.setPixelOffset=function(e){var t=this._pixelOffset;n.equals(t,e)||(n.clone(e,t),m(this,g))},p.prototype._setTranslate=function(e){var t=this._translate;n.equals(t,e)||(n.clone(e,t),m(this,g))},p.prototype.getScaleByDistance=function(){return this._scaleByDistance},p.prototype.setScaleByDistance=function(e){s.equals(this._scaleByDistance,e)||(m(this,T),this._scaleByDistance=s.clone(e,this._scaleByDistance))},p.prototype.getTranslucencyByDistance=function(){return this._translucencyByDistance},p.prototype.setTranslucencyByDistance=function(e){s.equals(this._translucencyByDistance,e)||(m(this,A),this._translucencyByDistance=s.clone(e,this._translucencyByDistance))},p.prototype.getPixelOffsetScaleByDistance=function(){return this._pixelOffsetScaleByDistance},p.prototype.setPixelOffsetScaleByDistance=function(e){s.equals(this._pixelOffsetScaleByDistance,e)||(m(this,P),this._pixelOffsetScaleByDistance=s.clone(e,this._pixelOffsetScaleByDistance))},p.prototype.getEyeOffset=function(){return this._eyeOffset},p.prototype.setEyeOffset=function(e){var t=this._eyeOffset;o.equals(t,e)||(o.clone(e,t),m(this,_))},p.prototype.getHorizontalOrigin=function(){return this._horizontalOrigin},p.prototype.setHorizontalOrigin=function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,m(this,y))},p.prototype.getVerticalOrigin=function(){return this._verticalOrigin},p.prototype.setVerticalOrigin=function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,m(this,C))},p.prototype.getScale=function(){return this._scale},p.prototype.setScale=function(e){this._scale!==e&&(this._scale=e,m(this,S))},p.prototype.getImageIndex=function(){return this._imageIndex},p.prototype.setImageIndex=function(e){this._imageIndex!==e&&(this._imageIndex=e,m(this,w))},p.prototype.getColor=function(){return this._color},p.prototype.setColor=function(e){var t=this._color;i.equals(t,e)||(i.clone(e,t),m(this,E))},p.prototype.getRotation=function(){return this._rotation},p.prototype.setRotation=function(e){this._rotation!==e&&(this._rotation=e,m(this,x))},p.prototype.getAlignedAxis=function(){return this._alignedAxis},p.prototype.setAlignedAxis=function(e){var t=this._alignedAxis;o.equals(t,e)||(o.clone(e,t),m(this,b))},p.prototype.getWidth=function(){return this._width},p.prototype.setWidth=function(e){this._width!==e&&(this._width=e,m(this,w))},p.prototype.getHeight=function(){return this._height},p.prototype.setHeight=function(e){this._height!==e&&(this._height=e,m(this,w))},p.prototype.getId=function(){return this._id};var D=new a;p._computeActualPosition=function(e,t,r){return t.mode===h.SCENE3D?e:(l.multiplyByPoint(r,e,D),d.computeActualWgs84Position(t,D))};var M=new l,I=new a,O=new o,R=new n;p._computeScreenSpacePosition=function(e,t,r,i,s,u){var c=u.camera,h=c.viewMatrix,m=c.frustum.projectionMatrix,p=l.multiplyTransformation(h,e,M),f=l.multiplyByVector(p,a.fromElements(t.x,t.y,t.z,1,I),I),v=o.multiplyComponents(r,o.normalize(f,O),O);f.x+=r.x+v.x,f.y+=r.y+v.y,f.z+=v.z;var g=l.multiplyByVector(m,f,I),_=d.clipToWindowCoordinates(s,g,new n),y=s.getUniformState(),C=n.multiplyByScalar(i,y.getHighResolutionSnapScale(),R);return _.x+=C.x,_.y+=C.y,_};var L=new n(0,0);return p.prototype.computeScreenSpacePosition=function(e,t){var r=this._billboardCollection;n.clone(this._pixelOffset,L),n.add(L,this._translate,L);var i=r.modelMatrix;return p._computeScreenSpacePosition(i,this._actualPosition,this._eyeOffset,L,e,t)},p.prototype.equals=function(e){return this===e||t(e)&&this._show===e._show&&this._imageIndex===e._imageIndex&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&o.equals(this._position,e._position)&&i.equals(this._color,e._color)&&n.equals(this._pixelOffset,e._pixelOffset)&&n.equals(this._translate,e._translate)&&o.equals(this._eyeOffset,e._eyeOffset)&&s.equals(this._scaleByDistance,e._scaleByDistance)&&s.equals(this._translucencyByDistance,e._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&this._id===e._id},p.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},p}),r("Shaders/BillboardCollectionVS",[],function(){"use strict";return"attribute vec3 positionHigh;\nattribute vec3 positionLow;\nattribute vec2 direction;\nattribute vec4 textureCoordinatesAndImageSize;\nattribute vec3 originAndShow;\nattribute vec4 pixelOffsetAndTranslate;\nattribute vec4 eyeOffsetAndScale;\nattribute vec4 rotationAndAlignedAxis;\nattribute vec4 scaleByDistance;\nattribute vec4 translucencyByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\n#ifdef RENDER_FOR_PICK\nattribute vec4 pickColor;\n#else\nattribute vec4 color;\n#endif\nconst vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nfloat getNearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\ncameraDistSq = clamp(cameraDistSq, nearDistanceSq, farDistanceSq);\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(t, 0.15);\nreturn mix(valueAtMin, valueAtMax, t);\n}\nvoid main()\n{\nvec3 eyeOffset = eyeOffsetAndScale.xyz;\nfloat scale = eyeOffsetAndScale.w;\nvec2 textureCoordinates = textureCoordinatesAndImageSize.xy;\nvec2 imageSize = textureCoordinatesAndImageSize.zw;\nvec2 origin = originAndShow.xy;\nfloat show = originAndShow.z;\nvec2 pixelOffset = pixelOffsetAndTranslate.xy;\nvec2 translate = pixelOffsetAndTranslate.zw;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= getNearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = getNearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = getNearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = imageSize * scale * czm_highResolutionSnapScale;\nhalfSize *= ((direction * 2.0) - 1.0);\npositionWC.xy += (origin * abs(halfSize));\n#ifdef ROTATION\nfloat rotation = rotationAndAlignedAxis.x;\nvec3 alignedAxis = rotationAndAlignedAxis.yzw;\nif (!all(equal(rotationAndAlignedAxis, vec4(0.0))))\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\npositionWC.xy += halfSize;\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_highResolutionSnapScale);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),r("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),r("Scene/BillboardCollection",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Color","../Core/defaultValue","../Core/destroyObject","../Core/Cartesian2","../Core/Cartesian3","../Core/EncodedCartesian3","../Core/Matrix4","../Core/ComponentDatatype","../Core/IndexDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/VertexArrayFacade","../Renderer/createShaderSource","./SceneMode","./Billboard","./HorizontalOrigin","../Shaders/BillboardCollectionVS","../Shaders/BillboardCollectionFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x){"use strict";function b(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],r=e._billboards,i=r.length,n=0,o=0;i>n;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function T(t){var r=16384,i=t.cache.billboardCollection_directionsVertexBuffer;if(e(i))return i;for(var n=new Uint8Array(2*4*r),o=0,a=0;r>o;++o)n[a++]=0,n[a++]=0,n[a++]=255,n[a++]=0,n[a++]=255,n[a++]=255,n[a++]=0,n[a++]=255;return i=t.createVertexBuffer(n,f.STATIC_DRAW),i.setVertexArrayDestroyable(!1),t.cache.billboardCollection_directionsVertexBuffer=i,i}function A(t){var r=16384,i=t.cache.billboardCollection_indexBuffer;if(e(i))return i;for(var n=6*r,o=new Uint16Array(n),a=0,s=0;n>a;a+=6,s+=4)o[a]=s,o[a+1]=s+1,o[a+2]=s+2,o[a+3]=s+0,o[a+4]=s+2,o[a+5]=s+3;return i=t.createIndexBuffer(o,f.STATIC_DRAW,h.UNSIGNED_SHORT),i.setVertexArrayDestroyable(!1),t.cache.billboardCollection_indexBuffer=i,i}function P(e,t,r){var i=T(e);return new _(e,[{index:ot.positionHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,usage:r[j]},{index:ot.positionLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,usage:r[j]},{index:ot.pixelOffsetAndTranslate,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[q]},{index:ot.eyeOffsetAndScale,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[J]},{index:ot.textureCoordinatesAndImageSize,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[Q]},{index:ot.pickColor,componentsPerAttribute:4,normalize:!0,componentDatatype:c.UNSIGNED_BYTE,usage:f.STATIC_DRAW,purpose:lt},{index:ot.color,componentsPerAttribute:4,normalize:!0,componentDatatype:c.UNSIGNED_BYTE,usage:r[K],purpose:st},{index:ot.originAndShow,componentsPerAttribute:3,componentDatatype:c.BYTE,usage:r[H]},{index:ot.direction,vertexBuffer:i,componentsPerAttribute:2,normalize:!0,componentDatatype:c.UNSIGNED_BYTE},{index:ot.rotationAndAlignedAxis,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[$]},{index:ot.scaleByDistance,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[tt]},{index:ot.translucencyByDistance,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[rt]},{index:ot.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[it]}],4*t)}function D(e,t,r,i,n){var o=4*n._index,a=n._getActualPosition();e._mode===C.SCENE3D&&(e._baseVolume.expand(a,e._baseVolume),e._boundingVolumeDirty=!0),l.fromCartesian(a,ct);var s=i[at],u=s[ot.positionHigh],c=ct.high;u(o+0,c.x,c.y,c.z),u(o+1,c.x,c.y,c.z),u(o+2,c.x,c.y,c.z),u(o+3,c.x,c.y,c.z);var h=s[ot.positionLow],d=ct.low;h(o+0,d.x,d.y,d.z),h(o+1,d.x,d.y,d.z),h(o+2,d.x,d.y,d.z),h(o+3,d.x,d.y,d.z)}function M(e,t,r,i,n){var o=4*n._index,a=n.getPixelOffset(),s=n._translate;e._maxPixelOffset=Math.max(e._maxPixelOffset,a.x+s.x,a.y+s.y);var l=i[at],u=l[ot.pixelOffsetAndTranslate];u(o+0,a.x,a.y,s.x,s.y),u(o+1,a.x,a.y,s.x,s.y),u(o+2,a.x,a.y,s.x,s.y),u(o+3,a.x,a.y,s.x,s.y)}function I(e,t,r,i,n){var o=4*n._index,a=n.getEyeOffset(),s=n.getScale();e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(a.z)),e._maxScale=Math.max(e._maxScale,s);var l=i[at],u=l[ot.eyeOffsetAndScale];u(o+0,a.x,a.y,a.z,s),u(o+1,a.x,a.y,a.z,s),u(o+2,a.x,a.y,a.z,s),u(o+3,a.x,a.y,a.z,s)}function O(e,t,r,n,o){var a=4*o._index,s=n[lt],l=s[ot.pickColor],u=o.getPickId(t).color,c=i.floatToByte(u.red),h=i.floatToByte(u.green),d=i.floatToByte(u.blue),m=i.floatToByte(u.alpha);l(a+0,c,h,d,m),l(a+1,c,h,d,m),l(a+2,c,h,d,m),l(a+3,c,h,d,m)}function R(e,t,r,n,o){var a=4*o._index,s=n[st],l=s[ot.color],u=o.getColor(),c=i.floatToByte(u.red),h=i.floatToByte(u.green),d=i.floatToByte(u.blue),m=i.floatToByte(u.alpha);l(a+0,c,h,d,m),l(a+1,c,h,d,m),l(a+2,c,h,d,m),l(a+3,c,h,d,m)}function L(e,t,r,i,n){var o=4*n._index,a=n.getHorizontalOrigin().value,s=n.getVerticalOrigin().value,l=n.getShow();0===n.getColor().alpha&&(l=!1),e._allHorizontalCenter=e._allHorizontalCenter&&a===w.CENTER.value;var u=i[at],c=u[ot.originAndShow];c(o+0,a,s,l),c(o+1,a,s,l),c(o+2,a,s,l),c(o+3,a,s,l)}function N(e,t,r,i,o){var a=4*o._index,s=0,l=0,u=0,c=0,h=o.getImageIndex();if(-1!==h){var d=r[h];s=d.x,l=d.y,u=d.width,c=d.height}var m=s+u,p=l+c,f=e._textureAtlas.getTexture().getDimensions(),v=.5*n(o.getWidth(),f.x*u),g=.5*n(o.getHeight(),f.y*c);e._maxSize=Math.max(e._maxSize,v,g);var _=i[at],y=_[ot.textureCoordinatesAndImageSize];y(a+0,s,l,v,g),y(a+1,m,l,v,g),y(a+2,m,p,v,g),y(a+3,s,p,v,g)}function B(e,t,r,i,n){var o=4*n._index,a=n.getRotation(),l=n.getAlignedAxis();0===a&&s.equals(l,s.ZERO)||(e._shaderRotation=!0);var u=l.x,c=l.y,h=l.z,d=i[at],m=d[ot.rotationAndAlignedAxis];m(o+0,a,u,c,h),m(o+1,a,u,c,h),m(o+2,a,u,c,h),m(o+3,a,u,c,h)}function z(t,r,i,n,o){var a=4*o._index,s=n[at],l=s[ot.scaleByDistance],u=0,c=1,h=1,d=1,m=o.getScaleByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderScaleByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function F(t,r,i,n,o){var a=4*o._index,s=n[at],l=s[ot.translucencyByDistance],u=0,c=1,h=1,d=1,m=o.getTranslucencyByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderTranslucencyByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function V(t,r,i,n,o){var a=4*o._index,s=n[at],l=s[ot.pixelOffsetScaleByDistance],u=0,c=1,h=1,d=1,m=o.getPixelOffsetScaleByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderPixelOffsetScaleByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function k(e,t,r,i,n){D(e,t,r,i,n),M(e,t,r,i,n),I(e,t,r,i,n),O(e,t,r,i,n),R(e,t,r,i,n),L(e,t,r,i,n),N(e,t,r,i,n),B(e,t,r,i,n),z(e,t,r,i,n),F(e,t,r,i,n),V(e,t,r,i,n)}function U(t,r,i,n,o,a){var s;n.mode===C.SCENE3D?(s=t._baseVolume,t._boundingVolumeDirty=!0):s=t._baseVolume2D;for(var l=[],u=0;i>u;++u){var c=r[u],h=c.getPosition(),d=S._computeActualPosition(h,n,o);e(d)&&(c._setActualPosition(d),a?l.push(d):s.expand(d,s))}a&&m.fromPoints(l,s)}function W(e,t){var r=t.mode,i=t.scene2D.projection,n=e._billboards,o=e._billboardsToUpdate,a=e._modelMatrix;e._mode!==r||e._projection!==i||r!==C.SCENE3D&&!u.equals(a,e.modelMatrix)?(e._mode=r,e._projection=i,u.clone(e.modelMatrix,a),e._createVertexArray=!0,(r===C.SCENE3D||r===C.SCENE2D||r===C.COLUMBUS_VIEW)&&U(e,n,n.length,t,a,!0)):r===C.MORPHING?U(e,n,n.length,t,a,!0):(r===C.SCENE2D||r===C.COLUMBUS_VIEW)&&U(e,o,e._billboardsToUpdateIndex,t,a,!1)}function G(e,t,r,i){var n,o,a,l=r.camera,u=l.frustum,c=s.subtract(l.positionWC,i.center,dt),h=s.multiplyByScalar(l.directionWC,s.dot(c,l.directionWC),mt),d=Math.max(0,s.magnitude(h)-i.radius);ht.x=t.getDrawingBufferWidth(),ht.y=t.getDrawingBufferHeight();var m=u.getPixelSize(ht,d);n=Math.max(m.x,m.y),o=2*n*e._maxScale*e._maxSize,e._allHorizontalCenter&&(o*=.5),a=n*e._maxPixelOffset+e._maxEyeOffset,i.radius+=o+a}var H=S.SHOW_INDEX,j=S.POSITION_INDEX,q=S.PIXEL_OFFSET_INDEX,Y=S.EYE_OFFSET_INDEX,X=S.HORIZONTAL_ORIGIN_INDEX,Z=S.VERTICAL_ORIGIN_INDEX,J=S.SCALE_INDEX,Q=S.IMAGE_INDEX_INDEX,K=S.COLOR_INDEX,$=S.ROTATION_INDEX,et=S.ALIGNED_AXIS_INDEX,tt=S.SCALE_BY_DISTANCE_INDEX,rt=S.TRANSLUCENCY_BY_DISTANCE_INDEX,it=S.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,nt=S.NUMBER_OF_PROPERTIES,ot={positionHigh:0,positionLow:1,pixelOffsetAndTranslate:2,eyeOffsetAndScale:3,textureCoordinatesAndImageSize:4,originAndShow:5,direction:6,pickColor:7,color:7,rotationAndAlignedAxis:8,scaleByDistance:9,translucencyByDistance:10,pixelOffsetScaleByDistance:11},at="all",st="color",lt="pick",ut=function(e){e=n(e,n.EMPTY_OBJECT),this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._propertiesChanged=new Uint32Array(nt),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._baseVolume=new m,this._baseVolumeWC=new m,this._baseVolume2D=new m,this._boundingVolume=new m,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=u.clone(n(e.modelMatrix,u.IDENTITY)),this._modelMatrix=u.clone(u.IDENTITY),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!1),this._mode=C.SCENE3D,this._projection=void 0,this._buffersUsage=[f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW];var t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.getTexture()}}};t(ut.prototype,{length:{get:function(){return b(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),ut.prototype.add=function(e){var t=new S(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},ut.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},ut.prototype.removeAll=function(){this._destroyBillboards(),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},ut.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},ut.prototype.contains=function(t){return e(t)&&t._billboardCollection===this},ut.prototype.get=function(e){return b(this),this._billboards[e]},ut.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;nt>i;++i){var n=0===r[i]?f.STATIC_DRAW:f.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var ct=new l,ht=new a,dt=new s,mt=new s;return ut.prototype.update=function(t,r,i){var n=this._textureAtlas;if(e(n)){var o=n.getTextureCoordinates();if(0!==o.length){b(this),W(this,r);var a=this._billboards,s=a.length,l=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,f=n.getGUID(),_=this._createVertexArray||this._textureAtlasGUID!==f;this._textureAtlasGUID=f;var S,w=r.passes,T=w.pick;if(_||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var O=0;nt>O;++O)h[O]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),s>0){this._vaf=P(t,s,this._buffersUsage),S=this._vaf.writers;for(var U=0;s>U;++U){var at=this._billboards[U];at._dirty=!1,k(this,t,o,S,at)}this._vaf.commit(A(t))}this._billboardsToUpdateIndex=0}else if(c>0){var ut=[];if(h[j]&&ut.push(D),h[q]&&ut.push(M),(h[Y]||h[J])&&ut.push(I),h[Q]&&ut.push(N),h[K]&&ut.push(R),(h[X]||h[Z]||h[H])&&ut.push(L),(h[$]||h[et])&&ut.push(B),h[tt]&&ut.push(z),h[rt]&&ut.push(F),h[it]&&ut.push(V),S=this._vaf.writers,c/s>.1){for(var ct=0;c>ct;++ct){var ht=l[ct];ht._dirty=!1;for(var dt=0;dtmt;++mt){var pt=l[mt];pt._dirty=!1;for(var ft=0;ft1.5*s&&(l.length=s),e(this._vaf)&&e(this._vaf.vaByPurpose)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,m.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var vt,gt=u.IDENTITY;r.mode===C.SCENE3D?(gt=this.modelMatrix,vt=m.clone(this._baseVolumeWC,this._boundingVolume)):vt=m.clone(this._baseVolume2D,this._boundingVolume),G(this,t,r,vt);var _t,yt,Ct,St;if(w.render){var wt=this._colorCommands;for(e(this._rs)||(this._rs=t.createRenderState({depthTest:{enabled:!0},blending:p.ALPHA_BLEND})),(!e(this._sp)||this._shaderRotation&&!this._compiledShaderRotation||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistance)&&(this._sp=t.getShaderCache().replaceShaderProgram(this._sp,y({defines:[this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[E]}),x,ot),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),_t=this._vaf.vaByPurpose[st],yt=_t.length,wt.length=yt,St=0;yt>St;++St)Ct=wt[St],e(Ct)||(Ct=wt[St]=new v),Ct.boundingVolume=vt,Ct.modelMatrix=gt,Ct.primitiveType=d.TRIANGLES,Ct.count=_t[St].indicesCount,Ct.shaderProgram=this._sp,Ct.uniformMap=this._uniforms,Ct.vertexArray=_t[St].va,Ct.renderState=this._rs,Ct.pass=g.OPAQUE,Ct.owner=this,Ct.debugShowBoundingVolume=this.debugShowBoundingVolume,i.push(Ct)}if(T){var Et=this._pickCommands;for((!e(this._spPick)||this._shaderRotation&&!this._compiledShaderRotationPick||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistancePick)&&(this._spPick=t.getShaderCache().replaceShaderProgram(this._spPick,y({defines:["RENDER_FOR_PICK",this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[E]}),y({defines:["RENDER_FOR_PICK"],sources:[x]}),ot),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),_t=this._vaf.vaByPurpose[lt],yt=_t.length,Et.length=yt,St=0;yt>St;++St)Ct=Et[St],e(Ct)||(Ct=Et[St]=new v),Ct.boundingVolume=vt,Ct.modelMatrix=gt,Ct.primitiveType=d.TRIANGLES,Ct.count=_t[St].indicesCount,Ct.shaderProgram=this._spPick,Ct.uniformMap=this._uniforms,Ct.vertexArray=_t[St].va,Ct.renderState=this._rs,Ct.pass=g.OPAQUE,Ct.owner=this,i.push(Ct)}}}}},ut.prototype.isDestroyed=function(){return!1},ut.prototype.destroy=function(){return this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.release(),this._spPick=this._spPick&&this._spPick.release(),this._vaf=this._vaf&&this._vaf.destroy(),this._destroyBillboards(),o(this)},ut.prototype._destroyBillboards=function(){for(var e=this._billboards,t=e.length,r=0;t>r;++r)e[r]&&e[r]._destroy()},ut}),r("Renderer/TextureAtlasBuilder",["../Core/Event","../Core/defined","../Core/DeveloperError","../Core/loadImage"],function(e,t,r,i){"use strict";function n(){this.imageLoaded=new e,this.index=-1,this.loaded=!1}var o=function(e){this.textureAtlas=e,this._idHash={}};return o.prototype.addTextureFromUrl=function(e,t){this.addTextureFromFunction(e,function(e,t){i(e).then(t)},t)},o.prototype.addTextureFromFunction=function(e,r,i){var o=this._idHash[e];if(t(o))return o.loaded?i(o.index):o.imageLoaded.addEventListener(i),void 0;this._idHash[e]=o=new n,o.imageLoaded.addEventListener(i);var a=this;r(e,function(t){if(!a.textureAtlas.isDestroyed()){var r=o.index=a.textureAtlas.addImage(t);o.loaded=!0,o.imageLoaded.raiseEvent(r,e),o.imageLoaded=void 0}})},o}),r("DynamicScene/DynamicBillboardVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","../Renderer/TextureAtlasBuilder"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r,i){return function(n){var o=e._billboardVisualizerIndex;if(t(o)){var a=r.get(o);a._visualizerUrl===i&&(a._visualizerTextureAvailable=!0,a.setImageIndex(n))}}}function h(e,r,a){var u=a._billboard;if(t(u)){var h=a._position;if(t(h)){var d=u._image;if(t(d)){var g,_=u._show,y=a._billboardVisualizerIndex,C=a.isAvailable(r)&&(!t(_)||_.getValue(r));if(!C)return t(y)&&(g=e._billboardCollection.get(y),g.setShow(!1),g.setImageIndex(-1),g._visualizerUrl=void 0,g._visualizerTextureAvailable=!1,a._billboardVisualizerIndex=void 0,e._unusedIndexes.push(y)),void 0;if(t(y))g=e._billboardCollection.get(y);else{var S=e._unusedIndexes,w=S.length;w>0?(y=S.pop(),g=e._billboardCollection.get(y)):(y=e._billboardCollection.length,g=e._billboardCollection.add()),a._billboardVisualizerIndex=y,g.id=a,g._visualizerUrl=void 0,g._visualizerTextureAvailable=!1,g.setColor(i.WHITE),g.setEyeOffset(o.ZERO),g.setPixelOffset(n.ZERO),g.setScale(1),g.setHorizontalOrigin(s.CENTER),g.setVerticalOrigin(l.CENTER)}var E=d.getValue(r);if(E!==g._visualizerUrl&&(g._visualizerUrl=E,g._visualizerTextureAvailable=!1,e._textureAtlasBuilder.addTextureFromUrl(E,c(a,e._billboardCollection,E))),g.setShow(g._visualizerTextureAvailable),g._visualizerTextureAvailable){m=h.getValue(r,m),t(m)&&g.setPosition(m);var x=u._color;if(t(x)&&(p=x.getValue(r,p),t(p)&&g.setColor(p)),x=u._eyeOffset,t(x)&&(f=x.getValue(r,f),t(f)&&g.setEyeOffset(f)),x=u._pixelOffset,t(x)&&(v=x.getValue(r,v),t(v)&&g.setPixelOffset(v)),x=u._scale,t(x)){var b=x.getValue(r);t(b)&&g.setScale(b)}if(x=u._rotation,t(x)){var T=x.getValue(r);t(T)&&g.setRotation(T)}if(x=u._alignedAxis,t(x)){var A=x.getValue(r);t(A)&&g.setAlignedAxis(A)}if(x=u._horizontalOrigin,t(x)){var P=x.getValue(r);t(P)&&g.setHorizontalOrigin(P)}if(x=u._verticalOrigin,t(x)){var D=x.getValue(r);t(D)&&g.setVerticalOrigin(D)}x=u._width,t(x)&&g.setWidth(x.getValue(r)),x=u._height,t(x)&&g.setHeight(x.getValue(r)),x=u._scaleByDistance,t(x)&&g.setScaleByDistance(x.getValue(r)),x=u._translucencyByDistance,t(x)&&g.setTranslucencyByDistance(x.getValue(r)),x=u._pixelOffsetScaleByDistance,t(x)&&g.setPixelOffsetScaleByDistance(x.getValue(r))}}}}}var d=function(e,t){this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;var r=this._billboardCollection=new a,i=this._textureAtlas=e.context.createTextureAtlas();this._textureAtlasBuilder=new u(i),r.textureAtlas=i,e.primitives.add(r),this.setDynamicObjectCollection(t)};d.prototype.getScene=function(){return this._scene},d.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},d.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(d.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(d.prototype._onObjectsRemoved,this))},d.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)h(this,e,r[i])},d.prototype.removeAllPrimitives=function(){if(t(this._dynamicObjectCollection)){this._unusedIndexes=[],this._billboardCollection.removeAll();for(var e=this._dynamicObjectCollection.getObjects(),r=e.length-1;r>-1;r--)e[r]._billboardVisualizerIndex=void 0}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._billboardCollection),r(this)};var m,p,f,v;return d.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._billboardCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._billboardVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),u.setImageIndex(-1),u._visualizerUrl=void 0,u._visualizerTextureAvailable=!1,s._billboardVisualizerIndex=void 0,o.push(l)}}},d}),r("Renderer/CullFace",["../Core/Enumeration"],function(e){"use strict";var t={FRONT:new e(1028,"FRONT"),BACK:new e(1029,"BACK"),FRONT_AND_BACK:new e(1032,"FRONT_AND_BACK"),validate:function(e){return e===t.FRONT||e===t.BACK||e===t.FRONT_AND_BACK}};return t}),r("Renderer/MipmapHint",["../Core/Enumeration"],function(e){"use strict";var t={DONT_CARE:new e(4352,"DONT_CARE"),FASTEST:new e(4353,"FASTEST"),NICEST:new e(4354,"NICEST"),validate:function(e){return e===t.DONT_CARE||e===t.FASTEST||e===t.NICEST}};return t}),r("Renderer/PixelDatatype",[],function(){"use strict";var e={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,UNSIGNED_INT_24_8_WEBGL:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,validate:function(t){return t===e.UNSIGNED_BYTE||t===e.UNSIGNED_SHORT||t===e.UNSIGNED_INT||t===e.FLOAT||t===e.UNSIGNED_INT_24_8_WEBGL||t===e.UNSIGNED_SHORT_4_4_4_4||t===e.UNSIGNED_SHORT_5_5_5_1||t===e.UNSIGNED_SHORT_5_6_5}};return e}),r("Renderer/PixelFormat",[],function(){"use strict";var e={DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,validate:function(t){return t===e.DEPTH_COMPONENT||t===e.DEPTH_STENCIL||t===e.ALPHA||t===e.RGB||t===e.RGBA||t===e.LUMINANCE||t===e.LUMINANCE_ALPHA},isColorFormat:function(t){return t===e.ALPHA||t===e.RGB||t===e.RGBA||t===e.LUMINANCE||t===e.LUMINANCE_ALPHA},isDepthFormat:function(t){return t===e.DEPTH_COMPONENT||t===e.DEPTH_STENCIL}};return e}),r("Renderer/TextureMagnificationFilter",[],function(){"use strict";var e={NEAREST:9728,LINEAR:9729,validate:function(t){return t===e.NEAREST||t===e.LINEAR}};return e}),r("Renderer/TextureMinificationFilter",[],function(){"use strict";var e={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,validate:function(t){return t===e.NEAREST||t===e.LINEAR||t===e.NEAREST_MIPMAP_NEAREST||t===e.LINEAR_MIPMAP_NEAREST||t===e.NEAREST_MIPMAP_LINEAR||t===e.LINEAR_MIPMAP_LINEAR +}};return e}),r("Renderer/TextureWrap",[],function(){"use strict";var e={CLAMP_TO_EDGE:33071,REPEAT:10497,MIRRORED_REPEAT:33648,validate:function(t){return t===e.CLAMP_TO_EDGE||t===e.REPEAT||t===e.MIRRORED_REPEAT}};return e}),r("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./MipmapHint","./PixelDatatype","./PixelFormat","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(t,r,i,n,o,a,s,l,u,c){this._gl=t,this._textureFilterAnisotropic=r,this._textureTarget=i,this._texture=n,this._pixelFormat=o,this._pixelDatatype=a,this._width=s,this._height=l,this._dimensions=new e(s,l),this._preMultiplyAlpha=u,this._flipY=c,this._sampler=void 0,this.setSampler()};return d.prototype.copyFrom=function(e,r,i){r=t(r,0),i=t(i,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,r,i,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,r,i,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},d.prototype.copyFromFramebuffer=function(e,r,i,n,o,a){e=t(e,0),r=t(r,0),i=t(i,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,r,i,n,o,a),s.bindTexture(l,null)},d.prototype.generateMipmap=function(e){e=t(e,a.DONT_CARE);var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},d.prototype.getSampler=function(){return this._sampler},d.prototype.setSampler=function(e){if(!r(e)){var t=c.LINEAR,i=u.LINEAR;this._pixelDatatype===s.FLOAT&&(t=c.NEAREST,i=u.NEAREST),e={wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i,maximumAnisotropy:1}}if(this._pixelDatatype===s.FLOAT){if(e.minificationFilter!==c.NEAREST&&e.minificationFilter!==c.NEAREST_MIPMAP_NEAREST)throw new n("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(e.magnificationFilter!==u.NEAREST)throw new n("Only the NEAREST magnification filter is supported for floating point textures.")}var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,e.minificationFilter),o.texParameteri(a,o.TEXTURE_MAG_FILTER,e.magnificationFilter),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),r(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler={wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy}},d.prototype.getPixelFormat=function(){return this._pixelFormat},d.prototype.getPixelDatatype=function(){return this._pixelDatatype},d.prototype.getDimensions=function(){return this._dimensions},d.prototype.getPreMultiplyAlpha=function(){return this._preMultiplyAlpha},d.prototype.getFlipY=function(){return this._flipY},d.prototype.getWidth=function(){return this._width},d.prototype.getHeight=function(){return this._height},d.prototype._getTexture=function(){return this._texture},d.prototype._getTarget=function(){return this._textureTarget},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),i(this)},d}),r("Renderer/CubeMapFace",["../Core/defaultValue","../Core/DeveloperError","./PixelDatatype"],function(e){"use strict";var t=function(e,t,r,i,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=r,this._targetFace=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l};return t.prototype.copyFrom=function(t,r,i){r=e(r,0),i=e(i,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,r,i,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,r,i,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},t.prototype.copyFromFramebuffer=function(t,r,i,n,o,a){t=e(t,0),r=e(r,0),i=e(i,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,r,i,n,o,a),s.bindTexture(l,null)},t.prototype.getPixelFormat=function(){return this._pixelFormat},t.prototype.getPixelDatatype=function(){return this._pixelDatatype},t.prototype._getTexture=function(){return this._texture},t.prototype._getTarget=function(){return this._targetFace},t}),r("Renderer/CubeMap",["../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/defaultValue","../Core/Math","./MipmapHint","./PixelDatatype","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap","./CubeMapFace"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(e,t,r,i,n,o,a,s,l){this._gl=e,this._textureFilterAnisotropic=t,this._textureTarget=r,this._texture=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l,this._sampler=void 0,this._positiveX=new c(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_X,n,o,a,s,l),this._negativeX=new c(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_X,n,o,a,s,l),this._positiveY=new c(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Y,n,o,a,s,l),this._negativeY=new c(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,n,o,a,s,l),this._positiveZ=new c(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Z,n,o,a,s,l),this._negativeZ=new c(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Z,n,o,a,s,l),this.setSampler()};return h.prototype.getPositiveX=function(){return this._positiveX},h.prototype.getNegativeX=function(){return this._negativeX},h.prototype.getPositiveY=function(){return this._positiveY},h.prototype.getNegativeY=function(){return this._negativeY},h.prototype.getPositiveZ=function(){return this._positiveZ},h.prototype.getNegativeZ=function(){return this._negativeZ},h.prototype.generateMipmap=function(e){e=i(e,o.DONT_CARE);var t=this._gl,r=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(r,this._texture),t.generateMipmap(r),t.bindTexture(r,null)},h.prototype.setSampler=function(r){if(!e(r)){var i=l.LINEAR,n=s.LINEAR;this._pixelDatatype===a.FLOAT&&(i=l.NEAREST,n=s.NEAREST),r={wrapS:u.CLAMP_TO_EDGE,wrapT:u.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:n,maximumAnisotropy:1}}if(this._pixelDatatype===a.FLOAT){if(r.minificationFilter!==l.NEAREST&&r.minificationFilter!==l.NEAREST_MIPMAP_NEAREST)throw new t("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(r.magnificationFilter!==s.NEAREST)throw new t("Only the NEAREST magnification filter is supported for floating point textures.")}var o=this._gl,c=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(c,this._texture),o.texParameteri(c,o.TEXTURE_MIN_FILTER,r.minificationFilter),o.texParameteri(c,o.TEXTURE_MAG_FILTER,r.magnificationFilter),o.texParameteri(c,o.TEXTURE_WRAP_S,r.wrapS),o.texParameteri(c,o.TEXTURE_WRAP_T,r.wrapT),e(this._textureFilterAnisotropic)&&o.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.maximumAnisotropy),o.bindTexture(c,null),this._sampler={wrapS:r.wrapS,wrapT:r.wrapT,minificationFilter:r.minificationFilter,magnificationFilter:r.magnificationFilter,maximumAnisotropy:r.maximumAnisotropy}},h.prototype.getSampler=function(){return this._sampler},h.prototype.getPixelFormat=function(){return this._pixelFormat},h.prototype.getPixelDatatype=function(){return this._pixelDatatype},h.prototype.getWidth=function(){return this._size},h.prototype.getHeight=function(){return this._size},h.prototype.getPreMultiplyAlpha=function(){return this._preMultiplyAlpha},h.prototype.getFlipY=function(){return this._flipY},h.prototype._getTexture=function(){return this._texture},h.prototype._getTarget=function(){return this._textureTarget},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},h}),r("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),r("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/FresnelMaterial",[],function(){"use strict";return"czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nfloat cosAngIncidence = max(dot(normalWC, positionWC), 0.0);\nmaterial.diffuse = mix(reflection.diffuse, refraction.diffuse, cosAngIncidence);\nreturn material;\n}\n"}),r("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = lineThickness - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),r("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),r("Shaders/Materials/ReflectionMaterial",[],function(){"use strict";return"uniform samplerCube cubeMap;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 reflectedWC = reflect(positionWC, normalWC);\nmaterial.diffuse = textureCube(cubeMap, reflectedWC).channels;\nreturn material;\n}\n"}),r("Shaders/Materials/RefractionMaterial",[],function(){"use strict";return"uniform samplerCube cubeMap;\nuniform float indexOfRefractionRatio;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 refractedWC = refract(positionWC, -normalWC, indexOfRefractionRatio);\nmaterial.diffuse = textureCube(cubeMap, refractedWC).channels;\nreturn material;\n}\n"}),r("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(lightColor, darkColor, step(0.5, value));\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),r("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),r("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),r("Scene/Material",["../ThirdParty/when","../Core/loadImage","../Core/DeveloperError","../Core/createGuid","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Cartesian2","../Core/isArray","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/Texture","../Renderer/CubeMap","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FresnelMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/ReflectionMaterial","../Shaders/Materials/RefractionMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O){"use strict";function R(e,t){e=s(e,s.EMPTY_OBJECT),t._strict=s(e.strict,!1),t._count=s(e.count,0),t._template=n(s(e.fabric,s.EMPTY_OBJECT)),t._template.uniforms=n(s(t._template.uniforms,s.EMPTY_OBJECT)),t._template.materials=n(s(t._template.materials,s.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:i(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];var r,o=Y._materialCache.getMaterial(t.type);if(l(o)){var u=n(o.fabric,!0);t._template=a(t._template,u,!0),r=o.translucent}z(t),l(o)||Y._materialCache.addMaterial(t.type,t),F(t),U(t),H(t);var c=0===t._translucentFunctions.length?!0:void 0;if(r=s(r,c),r=s(e.translucent,r),l(r))if("function"==typeof r){var h=function(){return r(t)};t._translucentFunctions.push(h)}else t._translucentFunctions.push(r)}function L(e,t,r,i){if(l(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(i&&!o||!i&&o)&&r(n,t)}}function N(e,t){for(var i="fabric: property name '"+e+"' is not valid. It should be ",n=0;n0&&(n[s]={type:"ivec3",x:1,y:1},W(e,s))}var u="uniform "+a+" "+t+";\n";-1===e.shaderSource.indexOf(u)&&(e.shaderSource=u+e.shaderSource);var c=t+"_"+e._count++;if(1===j(e,t,c)&&i)throw new r("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=o,"sampler2D"===a)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if("samplerCube"===a)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(k(t));else if(-1!==a.indexOf("mat")){var h=new J[a];e._uniforms[c]=function(){return J[a].fromColumnMajorArray(e.uniforms[t],h)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function G(e){var t=e.type;if(!l(t)){var r=typeof e;if("number"===r)t="float";else if("boolean"===r)t="bool";else if("string"===r)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===Y.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===r)if(d(e))(4===e.length||9===e.length||16===e.length)&&(t="mat"+Math.sqrt(e.length));else{var i=0;for(var n in e)e.hasOwnProperty(n)&&(i+=1);i>=2&&4>=i?t="vec"+i:6===i&&(t="samplerCube")}}return t}function H(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new Y({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=a(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var s="czm_getMaterial",l=s+"_"+e._count++;j(o,s,l),e.shaderSource=o.shaderSource+e.shaderSource;var u=l+"(materialInput)";if(0===j(e,n,u)&&t)throw new r("strict: shader source does not use material '"+n+"'.")}}function j(e,t,r,i){i=s(i,!0);var n=0,o="a-zA-Z0-9_",a="(["+o+"])?",l="(["+o+(i?".":"")+"])?",u=new RegExp(l+t+a,"g");return e.shaderSource=e.shaderSource.replace(u,function(e,t,i){return t||i?e:(n+=1,r)}),n}function q(e,t,r){return j(e,t,t,r)}var Y=function(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],R(e,this),u(this,{type:{value:this.type,writable:!1}}),l(Y._uniformList[this.type])||(Y._uniformList[this.type]=Object.keys(this._uniforms))};Y._uniformList={},Y.fromType=function(e,t){var r=new Y({fabric:{type:e}});if(l(t))for(var i in t)t.hasOwnProperty(i)&&(r.uniforms[i]=t[i]);return r},Y.prototype.isTranslucent=function(){if(l(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,r=t.length,i=0;r>i;++i){var n=t[i];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},Y.prototype.update=function(e){var t,r,i=this._loadedImages,n=i.length;for(t=0;n>t;++t){var o=i[t];r=o.id;var a=o.image,s=Y._textureCache.getTexture(this._texturePaths[r]);l(s)||(s=e.createTexture2D({source:a}),Y._textureCache.addTexture(this._texturePaths[r],s)),this._textures[r]=s;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=s._width,c.y=s._height}}i.length=0;var h=this._loadedCubeMaps;for(n=h.length,t=0;n>t;++t){var d=h[t];r=d.id;var m=d.images,p=Y._textureCache.getTexture(this._texturePaths[r]);l(p)||(p=e.createCubeMap({source:{positiveX:m[0],negativeX:m[1],positiveY:m[2],negativeY:m[3],positiveZ:m[4],negativeZ:m[5]}}),Y._textureCache.addTexture(this._texturePaths[r],p)),this._textures[r]=p}h.length=0;var f=this._updateFunctions;for(n=f.length,t=0;n>t;++t)f[t](this,e);var v=this.materials;for(var g in v)v.hasOwnProperty(g)&&v[g].update(e)},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e=this.materials,t=this.uniforms;for(var r in t)if(t.hasOwnProperty(r)){var i=this._texturePaths[r];Y._textureCache.releaseTexture(i)}for(var n in e)e.hasOwnProperty(n)&&e[n].destroy();return c(this)};var X=["type","materials","uniforms","components","source"],Z=["diffuse","specular","shininess","normal","emission","alpha"],J={mat2:m,mat3:p,mat4:f};return Y._textureCache={_textures:{},addTexture:function(e,t){this._textures[e]={texture:t,count:1}},getTexture:function(e){var t=this._textures[e];return l(t)?(t.count++,t.texture):void 0},releaseTexture:function(e){var t=this._textures[e];l(t)&&0===--t.count&&(t.texture=t.texture&&t.texture.destroy(),this._textures[e]=void 0)}},Y._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},Y.DefaultImageId="czm_defaultImage",Y.DefaultCubeMapId="czm_defaultCubeMap",Y.ColorType="Color",Y._materialCache.addMaterial(Y.ColorType,{fabric:{type:Y.ColorType,uniforms:{color:new o(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Y.ImageType="Image",Y._materialCache.addMaterial(Y.ImageType,{fabric:{type:Y.ImageType,uniforms:{image:Y.DefaultImageId,repeat:new h(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a"}},translucent:!0}),Y.DiffuseMapType="DiffuseMap",Y._materialCache.addMaterial(Y.DiffuseMapType,{fabric:{type:Y.DiffuseMapType,uniforms:{image:Y.DefaultImageId,channels:"rgb",repeat:new h(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Y.AlphaMapType="AlphaMap",Y._materialCache.addMaterial(Y.AlphaMapType,{fabric:{type:Y.AlphaMapType,uniforms:{image:Y.DefaultImageId,channel:"a",repeat:new h(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),Y.SpecularMapType="SpecularMap",Y._materialCache.addMaterial(Y.SpecularMapType,{fabric:{type:Y.SpecularMapType,uniforms:{image:Y.DefaultImageId,channel:"r",repeat:new h(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),Y.EmissionMapType="EmissionMap",Y._materialCache.addMaterial(Y.EmissionMapType,{fabric:{type:Y.EmissionMapType,uniforms:{image:Y.DefaultImageId,channels:"rgb",repeat:new h(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Y.BumpMapType="BumpMap",Y._materialCache.addMaterial(Y.BumpMapType,{fabric:{type:Y.BumpMapType,uniforms:{image:Y.DefaultImageId,channel:"r",strength:.8,repeat:new h(1,1)},source:_},translucent:!1}),Y.NormalMapType="NormalMap",Y._materialCache.addMaterial(Y.NormalMapType,{fabric:{type:Y.NormalMapType,uniforms:{image:Y.DefaultImageId,channels:"rgb",strength:.8,repeat:new h(1,1)},source:E},translucent:!1}),Y.ReflectionType="Reflection",Y._materialCache.addMaterial(Y.ReflectionType,{fabric:{type:Y.ReflectionType,uniforms:{cubeMap:Y.DefaultCubeMapId,channels:"rgb"},source:x},translucent:!1}),Y.RefractionType="Refraction",Y._materialCache.addMaterial(Y.RefractionType,{fabric:{type:Y.RefractionType,uniforms:{cubeMap:Y.DefaultCubeMapId,channels:"rgb",indexOfRefractionRatio:.9},source:b},translucent:!1}),Y.FresnelType="Fresnel",Y._materialCache.addMaterial(Y.FresnelType,{fabric:{type:Y.FresnelType,materials:{reflection:{type:Y.ReflectionType},refraction:{type:Y.RefractionType}},source:S},translucent:!1}),Y.GridType="Grid",Y._materialCache.addMaterial(Y.GridType,{fabric:{type:Y.GridType,uniforms:{color:new o(0,1,0,1),cellAlpha:.1,lineCount:new h(8,8),lineThickness:new h(1,1)},source:w},translucent:function(e){var t=e.uniforms; +return t.color.alpha<1||t.cellAlpha<1}}),Y.StripeType="Stripe",Y._materialCache.addMaterial(Y.StripeType,{fabric:{type:Y.StripeType,uniforms:{horizontal:!0,lightColor:new o(1,1,1,.5),darkColor:new o(0,0,1,.5),offset:0,repeat:5},source:T},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),Y.CheckerboardType="Checkerboard",Y._materialCache.addMaterial(Y.CheckerboardType,{fabric:{type:Y.CheckerboardType,uniforms:{lightColor:new o(1,1,1,.5),darkColor:new o(0,0,0,.5),repeat:new h(5,5)},source:y},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),Y.DotType="Dot",Y._materialCache.addMaterial(Y.DotType,{fabric:{type:Y.DotType,uniforms:{lightColor:new o(1,1,0,.75),darkColor:new o(0,1,1,.75),repeat:new h(5,5)},source:C},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),Y.WaterType="Water",Y._materialCache.addMaterial(Y.WaterType,{fabric:{type:Y.WaterType,uniforms:{baseWaterColor:new o(.2,.3,.6,1),blendColor:new o(0,1,.699,1),specularMap:Y.DefaultImageId,normalMap:Y.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:A},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),Y.RimLightingType="RimLighting",Y._materialCache.addMaterial(Y.RimLightingType,{fabric:{type:Y.RimLightingType,uniforms:{color:new o(1,0,0,.7),rimColor:new o(1,1,1,.4),width:.3},source:P},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),Y.FadeType="Fade",Y._materialCache.addMaterial(Y.FadeType,{fabric:{type:Y.FadeType,uniforms:{fadeInColor:new o(1,0,0,1),fadeOutColor:new o(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new h(.5,.5)},source:D},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<0}}),Y.PolylineArrowType="PolylineArrow",Y._materialCache.addMaterial(Y.PolylineArrowType,{fabric:{type:Y.PolylineArrowType,uniforms:{color:new o(1,1,1,1)},source:M},translucent:!0}),Y.PolylineGlowType="PolylineGlow",Y._materialCache.addMaterial(Y.PolylineGlowType,{fabric:{type:Y.PolylineGlowType,uniforms:{color:new o(0,.5,1,1),glowPower:.1},source:I},translucent:!0}),Y.PolylineOutlineType="PolylineOutline",Y._materialCache.addMaterial(Y.PolylineOutlineType,{fabric:{type:Y.PolylineOutlineType,uniforms:{color:new o(1,1,1,1),outlineColor:new o(1,0,0,1),outlineWidth:1},source:O},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),Y}),r("Shaders/SensorVolume",[],function(){"use strict";return"uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nbool inSensorShadow(vec3 coneVertexWC, czm_ellipsoid ellipsoidEC, vec3 pointWC)\n{\nvec3 D = ellipsoidEC.inverseRadii;\nvec3 q = D * coneVertexWC;\nfloat qMagnitudeSquared = dot(q, q);\nfloat test = qMagnitudeSquared - 1.0;\nvec3 temp = D * pointWC - q;\nfloat d = dot(temp, q);\nreturn (d < -test) && (d / length(temp) < -sqrt(test));\n}\nvec4 getIntersectionColor()\n{\nreturn u_intersectionColor;\n}\nfloat getIntersectionWidth()\n{\nreturn u_intersectionWidth;\n}\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC)\n{\nfloat t = pointMC.z / sensorRadius;\nfloat s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\ns = s - floor(s);\nreturn vec2(s, t);\n}\n"}),r("Shaders/CustomSensorVolumeVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec3 normal;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\ngl_Position = czm_modelViewProjection * position;\nv_positionWC = (czm_model * position).xyz;\nv_positionEC = (czm_modelView * position).xyz;\nv_normalEC = czm_normal * normal;\n}\n"}),r("Shaders/CustomSensorVolumeFS",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_sensorRadius;\nuniform float u_normalDirection;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{\nczm_materialInput materialInput;\nvec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\nmaterialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\nmaterialInput.str = pointMC / sensorRadius;\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nvec3 normalEC = normalize(v_normalEC);\nmaterialInput.normalEC = u_normalDirection * normalEC;\nczm_material material = czm_getMaterial(materialInput);\nreturn mix(czm_phong(normalize(positionToEyeEC), material), vec4(material.diffuse, material.alpha), 0.4);\n}\nbool isOnBoundary(float value, float epsilon)\n{\nfloat width = getIntersectionWidth();\nfloat tolerance = width * epsilon;\n#ifdef GL_OES_standard_derivatives\nfloat delta = max(abs(dFdx(value)), abs(dFdy(value)));\nfloat pixels = width * delta;\nfloat temp = abs(value);\nreturn temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n#else\nreturn abs(value) < tolerance;\n#endif\n}\nvec4 shade(bool isOnBoundary)\n{\nif (u_showIntersection && isOnBoundary)\n{\nreturn getIntersectionColor();\n}\nreturn getColor(u_sensorRadius, v_positionEC);\n}\nfloat ellipsoidSurfaceFunction(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * point;\nreturn dot(scaled, scaled) - 1.0;\n}\nvoid main()\n{\nvec3 sensorVertexWC = czm_model[3].xyz;\nvec3 sensorVertexEC = czm_modelView[3].xyz;\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nfloat ellipsoidValue = ellipsoidSurfaceFunction(ellipsoid, v_positionWC);\nif (!u_showThroughEllipsoid)\n{\nif (ellipsoidValue < 0.0)\n{\ndiscard;\n}\nif (inSensorShadow(sensorVertexWC, ellipsoid, v_positionWC))\n{\ndiscard;\n}\n}\nif (distance(v_positionEC, sensorVertexEC) > u_sensorRadius)\n{\ndiscard;\n}\nbool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\ngl_FragColor = shade(isOnEllipsoid);\n}\n"}),r("Scene/CustomSensorVolume",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Color","../Core/combine","../Core/destroyObject","../Core/FAR","../Core/Cartesian3","../Core/Matrix4","../Core/ComponentDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Renderer/BufferUsage","../Renderer/BlendingState","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/CullFace","../Renderer/Pass","./Material","../Shaders/SensorVolume","../Shaders/CustomSensorVolumeVS","../Shaders/CustomSensorVolumeFS","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w){"use strict";function E(e){for(var t=e._directions,r=t.length,i=new Float32Array(3*r),n=isFinite(e.radius)?e.radius:a,o=[s.ZERO],l=r-2,u=r-1,c=0;r>c;l=u++,u=c++){var d=s.fromSpherical(t[l]),m=s.fromSpherical(t[u]),p=s.fromSpherical(t[c]),f=Math.max(s.angleBetween(d,m),s.angleBetween(m,p)),v=n/Math.cos(.5*f),g=s.multiplyByScalar(m,v);i[3*u]=g.x,i[3*u+1]=g.y,i[3*u+2]=g.z,o.push(g)}return h.fromPoints(o,e._boundingSphere),i}function x(e,t){for(var r=E(e),i=e._directions.length,n=new Float32Array(18*i),o=0,a=i-1,l=0;i>l;a=l++){var c=new s(r[3*a],r[3*a+1],r[3*a+2]),h=new s(r[3*l],r[3*l+1],r[3*l+2]),d=s.normalize(s.cross(h,c));n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z,n[o++]=h.x,n[o++]=h.y,n[o++]=h.z,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z,n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z}var m=t.createVertexBuffer(new Float32Array(n),e.bufferUsage),p=6*Float32Array.BYTES_PER_ELEMENT,f=[{index:b.position,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:u.FLOAT,offsetInBytes:0,strideInBytes:p},{index:b.normal,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:u.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p}];return t.createVertexArray(f)}var b={position:0,normal:1},T=function(r){r=e(r,e.EMPTY_OBJECT),this._pickId=void 0,this._pickIdThis=e(r._pickIdThis,this),this._frontFaceColorCommand=new p,this._backFaceColorCommand=new p,this._pickCommand=new p,this._boundingSphere=new h,this._boundingSphereWC=new h,this._frontFaceColorCommand.primitiveType=c.TRIANGLES,this._frontFaceColorCommand.boundingVolume=this._boundingSphereWC,this._frontFaceColorCommand.owner=this,this._backFaceColorCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._backFaceColorCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._backFaceColorCommand.owner=this,this._pickCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._pickCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._pickCommand.owner=this,this.show=e(r.show,!0),this.showIntersection=e(r.showIntersection,!0),this.showThroughEllipsoid=e(r.showThroughEllipsoid,!1),this._showThroughEllipsoid=this.showThroughEllipsoid,this.modelMatrix=l.clone(e(r.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this.bufferUsage=e(r.bufferUsage,d.STATIC_DRAW),this._bufferUsage=this.bufferUsage,this.radius=e(r.radius,Number.POSITIVE_INFINITY),this._directions=void 0,this._directionsDirty=!1,this.setDirections(r.directions),this.material=t(r.material)?r.material:_.fromType(_.ColorType),this._material=void 0,this._translucent=void 0,this.intersectionColor=i.clone(e(r.intersectionColor,i.WHITE)),this.intersectionWidth=e(r.intersectionWidth,5),this.id=r.id,this._id=void 0;var n=this;this._uniforms={u_showThroughEllipsoid:function(){return n.showThroughEllipsoid},u_showIntersection:function(){return n.showIntersection},u_sensorRadius:function(){return isFinite(n.radius)?n.radius:a},u_intersectionColor:function(){return n.intersectionColor},u_intersectionWidth:function(){return n.intersectionWidth},u_normalDirection:function(){return 1}},this._mode=w.SCENE3D};return T.prototype.setDirections=function(e){this._directions=e,this._directionsDirty=!0},T.prototype.getDirections=function(){return this._directions},T.prototype.update=function(e,r,i){if(this._mode=r.mode,this.show&&this._mode===w.SCENE3D){var o=this.material.isTranslucent();if(this._showThroughEllipsoid!==this.showThroughEllipsoid||!t(this._frontFaceColorCommand.renderState)||this._translucent!==o){this._showThroughEllipsoid=this.showThroughEllipsoid,this._translucent=o;var a;o?(a=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND,cull:{enabled:!0,face:v.BACK}}),this._frontFaceColorCommand.renderState=a,this._frontFaceColorCommand.pass=g.TRANSLUCENT,a=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND,cull:{enabled:!0,face:v.FRONT}}),this._backFaceColorCommand.renderState=a,this._backFaceColorCommand.pass=g.TRANSLUCENT,a=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND}),this._pickCommand.renderState=a):(a=e.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._frontFaceColorCommand.renderState=a,this._frontFaceColorCommand.pass=g.OPAQUE,a=e.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._pickCommand.renderState=a)}var s=this._directionsDirty||this._bufferUsage!==this.bufferUsage;if(s){this._directionsDirty=!1,this._bufferUsage=this.bufferUsage,this._va=this._va&&this._va.destroy();var u=this._directions;u&&u.length>=3&&(this._frontFaceColorCommand.vertexArray=x(this,e),this._backFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray,this._pickCommand.vertexArray=this._frontFaceColorCommand.vertexArray)}if(t(this._frontFaceColorCommand.vertexArray)){var c=r.passes,d=!l.equals(this.modelMatrix,this._modelMatrix);d&&l.clone(this.modelMatrix,this._modelMatrix),(s||d)&&h.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC),this._frontFaceColorCommand.modelMatrix=this.modelMatrix,this._backFaceColorCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix,this._pickCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix;var p=this._material!==this.material;if(this._material=this.material,this._material.update(e),c.render){var _=this._frontFaceColorCommand,E=this._backFaceColorCommand;if(p||!t(_.shaderProgram)){var T=f({sources:[y,this._material.shaderSource,S]});_.shaderProgram=e.getShaderCache().replaceShaderProgram(_.shaderProgram,C,T,b),_.uniformMap=n(this._uniforms,this._material._uniforms),E.shaderProgram=_.shaderProgram,E.uniformMap=n(this._uniforms,this._material._uniforms),E.uniformMap.u_normalDirection=function(){return-1}}o?i.push(this._backFaceColorCommand,this._frontFaceColorCommand):i.push(this._frontFaceColorCommand)}if(c.pick){var A=this._pickCommand;if(t(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=e.createPickId({primitive:this._pickIdThis,id:this.id})),p||!t(A.shaderProgram)){var P=f({sources:[y,this._material.shaderSource,S],pickColorQualifier:"uniform"});A.shaderProgram=e.getShaderCache().replaceShaderProgram(A.shaderProgram,C,P,b);var D=this,M={czm_pickColor:function(){return D._pickId.color}};A.uniformMap=n(n(this._uniforms,this._material._uniforms),M)}A.pass=o?g.TRANSLUCENT:g.OPAQUE,i.push(A)}}}},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._frontFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray&&this._frontFaceColorCommand.vertexArray.destroy(),this._frontFaceColorCommand.shaderProgram=this._frontFaceColorCommand.shaderProgram&&this._frontFaceColorCommand.shaderProgram.release(),this._pickCommand.shaderProgram=this._pickCommand.shaderProgram&&this._pickCommand.shaderProgram.release(),this._pickId=this._pickId&&this._pickId.destroy(),o(this)},T}),r("DynamicScene/MaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,r,i){"use strict";var n=function(){r.throwInstantiationError()};return t(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),n.prototype.getType=r.throwInstantiationError,n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.getValue=function(t,r,n){if(e(r)){var o=r.getType(t);e(o)&&(e(n)&&n.type===o||(n=i.fromType(o)),r.getValue(t,n.uniforms))}return n},n}),r("DynamicScene/DynamicConeVisualizerUsingCustomSensor",["../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Quaternion","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Spherical","../Scene/CustomSensorVolume","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,t,i,n){var o=t[e];r(o)||(t[e]=o=new u),o.clock=i,o.cone=n,o.magnitude=1}function p(e,t,r,i,n){var o,s=0,l=a.toRadians(2);if(0===e&&t===a.TWO_PI)for(o=0;oo;o+=l)m(s++,n,o,i);if(m(s++,n,t,i),r){for(o=t;o>e;o-=l)m(s++,n,o,r);m(s++,n,e,r)}else m(s++,n,t,0)}return n.length=s,n}function f(i,n,u){var m=u._cone;if(r(m)){var f=u._position;if(r(f)){var g=u._orientation;if(r(g)){var C,S=m._show,w=u._coneVisualizerIndex,E=u.isAvailable(n)&&(!r(S)||S.getValue(n));if(!E)return r(w)&&(C=i._coneCollection[w],C.show=!1,u._coneVisualizerIndex=void 0,i._unusedIndexes.push(w)),void 0;if(r(w))C=i._coneCollection[w];else{var x=i._unusedIndexes,b=x.length;b>0?(w=x.pop(),C=i._coneCollection[w]):(w=i._coneCollection.length,C=new c,C._directionsScratch=[],i._coneCollection.push(C),i._primitives.add(C)),u._coneVisualizerIndex=w,C.id=u,C.material=h.fromType(h.ColorType),C.intersectionColor=t.clone(t.YELLOW),C.intersectionWidth=5,C.radius=Number.POSITIVE_INFINITY,C.showIntersection=!0}C.show=!0;var T,A=m._minimumClockAngle;r(A)&&(T=A.getValue(n)),r(T)||(T=0);var P;A=m._maximumClockAngle,r(A)&&(P=A.getValue(n)),r(P)||(P=a.TWO_PI);var D;A=m._innerHalfAngle,r(A)&&(D=A.getValue(n)),r(D)||(D=0);var M;if(A=m._outerHalfAngle,r(A)&&(M=A.getValue(n)),r(M)||(M=Math.PI),(T!==C.minimumClockAngle||P!==C.maximumClockAngle||D!==C.innerHalfAngle||M!==C.outerHalfAngle)&&(C.setDirections(p(T,P,D,M,C._directionsScratch)),C.innerHalfAngle=D,C.maximumClockAngle=P,C.outerHalfAngle=M,C.minimumClockAngle=T),A=m._radius,r(A)){var I=A.getValue(n);r(I)&&(C.radius=I)}var O=f.getValue(n,_),R=g.getValue(n,y);if(!r(O)||!r(R)||e.equals(O,C._visualizerPosition)&&o.equals(R,C._visualizerOrientation)||(l.fromRotationTranslation(s.fromQuaternion(R,v),O,C.modelMatrix),C._visualizerPosition=e.clone(O,C._visualizerPosition),C._visualizerOrientation=o.clone(R,C._visualizerOrientation)),C.material=d.getValue(n,m._outerMaterial,C.material),A=m._intersectionColor,r(A)&&A.getValue(n,C.intersectionColor),A=m._intersectionWidth,r(A)){var L=A.getValue(n);r(L)&&(C.intersectionWidth=L)}}}}}var v=new s,g=function(e,t){this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives,this._coneCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};g.prototype.getScene=function(){return this._scene},g.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},g.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(g.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(g.prototype._onObjectsRemoved,this))},g.prototype.update=function(e){if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,n=t.length;n>i;i++)f(this,e,t[i])},g.prototype.removeAllPrimitives=function(){var e,t;for(e=0,t=this._coneCollection.length;t>e;e++)this._primitives.remove(this._coneCollection[e]);if(r(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._coneVisualizerIndex=void 0}this._unusedIndexes=[],this._coneCollection=[]},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),i(this)};var _=new e,y=new o;return g.prototype._onObjectsRemoved=function(e,t,i){for(var n=this._coneCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._coneVisualizerIndex;if(r(l)){var u=n[l];u.show=!1,o.push(l),s._coneVisualizerIndex=void 0}}},g}),r("Scene/Label",["../Core/defaultValue","../Core/DeveloperError","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/NearFarScalar","./Billboard","./LabelStyle","./HorizontalOrigin","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function d(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}var m=function(t,o){t=e(t,e.EMPTY_OBJECT),this._text=e(t.text,""),this._show=e(t.show,!0),this._font=e(t.font,"30px sans-serif"),this._fillColor=n.clone(e(t.fillColor,n.WHITE)),this._outlineColor=n.clone(e(t.outlineColor,n.BLACK)),this._outlineWidth=e(t.outlineWidth,1),this._style=e(t.style,l.FILL),this._verticalOrigin=e(t.verticalOrigin,c.BOTTOM),this._horizontalOrigin=e(t.horizontalOrigin,u.LEFT),this._pixelOffset=r.clone(e(t.pixelOffset,r.ZERO)),this._eyeOffset=i.clone(e(t.eyeOffset,i.ZERO)),this._position=i.clone(e(t.position,i.ZERO)),this._scale=e(t.scale,1),this._id=t.id,this._translucencyByDistance=t.translucencyByDistance,this._pixelOffsetScaleByDistance=t.pixelOffsetScaleByDistance,this._labelCollection=o,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0};return m.prototype.getShow=function(){return this._show},m.prototype.setShow=function(e){if(e!==this._show){this._show=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var n=t[r];o(n.billboard)&&n.billboard.setShow(e)}}},m.prototype.getPosition=function(){return this._position},m.prototype.setPosition=function(e){var t=this._position;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;a>n;n++){var s=r[n];o(s.billboard)&&s.billboard.setPosition(e)}}},m.prototype.getText=function(){return this._text},m.prototype.setText=function(e){e!==this._text&&(this._text=e,h(this))},m.prototype.getFont=function(){return this._font},m.prototype.setFont=function(e){this._font!==e&&(this._font=e,h(this))},m.prototype.getFillColor=function(){return this._fillColor},m.prototype.setFillColor=function(e){var t=this._fillColor;n.equals(t,e)||(n.clone(e,t),h(this))},m.prototype.getOutlineColor=function(){return this._outlineColor},m.prototype.setOutlineColor=function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),h(this))},m.prototype.getOutlineWidth=function(){return this._outlineWidth},m.prototype.setOutlineWidth=function(e){this._outlineWidth!==e&&(this._outlineWidth=e,h(this))},m.prototype.getStyle=function(){return this._style},m.prototype.setStyle=function(e){this._style!==e&&(this._style=e,h(this))},m.prototype.getPixelOffset=function(){return this._pixelOffset},m.prototype.setPixelOffset=function(e){var t=this._pixelOffset;r.equals(t,e)||(r.clone(e,t),d(this))},m.prototype.getTranslucencyByDistance=function(){return this._translucencyByDistance},m.prototype.setTranslucencyByDistance=function(e){a.equals(this._translucencyByDistance,e)||(this._translucencyByDistance=a.clone(e,this._translucencyByDistance),h(this))},m.prototype.getPixelOffsetScaleByDistance=function(){return this._pixelOffsetScaleByDistance},m.prototype.setPixelOffsetScaleByDistance=function(e){a.equals(this._pixelOffsetScaleByDistance,e)||(this._pixelOffsetScaleByDistance=a.clone(e,this._pixelOffsetScaleByDistance),h(this))},m.prototype.getEyeOffset=function(){return this._eyeOffset},m.prototype.setEyeOffset=function(e){var t=this._eyeOffset;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;a>n;n++){var s=r[n];o(s.billboard)&&s.billboard.setEyeOffset(e)}}},m.prototype.getHorizontalOrigin=function(){return this._horizontalOrigin},m.prototype.setHorizontalOrigin=function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,d(this))},m.prototype.getVerticalOrigin=function(){return this._verticalOrigin},m.prototype.setVerticalOrigin=function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,d(this))},m.prototype.getScale=function(){return this._scale},m.prototype.getId=function(){return this._id},m.prototype.setScale=function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var n=t[r];o(n.billboard)&&n.billboard.setScale(e)}d(this)}},m.prototype.computeScreenSpacePosition=function(e,t){var r=this._labelCollection,i=r.modelMatrix,n=s._computeActualPosition(this._position,t,i);return s._computeScreenSpacePosition(i,n,this._eyeOffset,this._pixelOffset,e,t)},m.prototype.equals=function(e){return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._text===e._text&&this._font===e._font&&i.equals(this._position,e._position)&&n.equals(this._fillColor,e._fillColor)&&n.equals(this._outlineColor,e._outlineColor)&&r.equals(this._pixelOffset,e._pixelOffset)&&i.equals(this._eyeOffset,e._eyeOffset)&&a.equals(this._translucencyByDistance,e._translucencyByDistance)&&a.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&this._id===e._id},m.prototype.isDestroyed=function(){return!1},m}),r("Scene/LabelCollection",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Cartesian2","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./Label","./LabelStyle","./HorizontalOrigin","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function p(e,t,r){this.labelCollection=e,this.index=t,this.dimensions=r}function f(e,t,r,i,n,o,a){return C.font=t,C.fillColor=r,C.strokeColor=i,C.strokeWidth=n,C.textBaseline=a===d.BOTTOM?"bottom":a===d.TOP?"top":"middle",C.fill=o===c.FILL||o===c.FILL_AND_OUTLINE,C.stroke=o===c.OUTLINE||o===c.FILL_AND_OUTLINE,s(e,C)}function v(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;i(r)&&(r.setShow(!1),r.setImageIndex(-1),r._pickId=r._pickId&&r._pickId.destroy(),e._spareBillboards.push(r),t.billboard=void 0)}function g(e,t){var r,n,o,a=t._text,s=a.length,l=t._glyphs,u=l.length;if(u>s)for(n=s;u>n;++n)v(e,l[n]);l.length=s;var c=e._glyphTextureCache,d=e._textureAtlas;for(o=0;s>o;++o){var g=a.charAt(o),_=t._font,y=t._fillColor,C=t._outlineColor,S=t._outlineWidth,w=t._style,E=t._verticalOrigin,x=JSON.stringify([g,_,y.toRgba(),C.toRgba(),S,+w,+E]),b=c[x];if(!i(b)){var T=f(g,_,y,C,S,w,E),A=-1;T.width>0&&T.height>0&&(A=d.addImage(T)),b=new p(e,A,T.dimensions),c[x]=b}if(r=l[o],i(r)?-1===b.index?v(e,r):i(r.textureInfo)&&(r.textureInfo=void 0):(r=new m,l[o]=r),r.textureInfo=b,r.dimensions=b.dimensions,-1!==b.index){var P=r.billboard;i(P)||(r.billboard=P=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add(),P.setShow(t._show),P.setPosition(t._position),P.setEyeOffset(t._eyeOffset),P.setPixelOffset(t._pixelOffset),P.setHorizontalOrigin(h.LEFT),P.setVerticalOrigin(t._verticalOrigin),P.setScale(t._scale),P._pickIdThis=t,P._id=t._id,P._collection=t._labelCollection),r.billboard.setImageIndex(b.index),r.billboard.setTranslucencyByDistance(t._translucencyByDistance),r.billboard.setPixelOffsetScaleByDistance(t._pixelOffsetScaleByDistance)}}t._repositionAllGlyphs=!0}function _(e){var t,r,n=e._glyphs,o=0,a=0,s=0,l=n.length;for(s=0;l>s;++s)t=n[s],r=t.dimensions,o+=r.width,a=Math.max(a,r.height);var u=e._scale,c=e._horizontalOrigin,m=0;c===h.CENTER?m-=o/2*u:c===h.RIGHT&&(m-=o*u),S.x=m,S.y=0;var p=e._verticalOrigin;for(s=0;l>s;++s)t=n[s],r=t.dimensions,p===d.BOTTOM||r.height===a?S.y=-r.descent*u:p===d.TOP?S.y=-(a-r.height)*u-r.descent*u:p===d.CENTER&&(S.y=-(a-r.height)/2*u-r.descent*u),i(t.billboard)&&t.billboard._setTranslate(S),S.x+=r.width*u}function y(e,t){for(var r=t._glyphs,i=0,o=r.length;o>i;++i)v(e,r[i]);t._labelCollection=void 0,n(t)}var C={},S=new o,w=function(t){t=e(t,e.EMPTY_OBJECT),this._textureAtlas=void 0,this._billboardCollection=new l,this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this.modelMatrix=a.clone(e(t.modelMatrix,a.IDENTITY)),this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1)};return t(w.prototype,{length:{get:function(){return this._labels.length}}}),w.prototype.add=function(e){var t=new u(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},w.prototype.remove=function(e){if(i(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),y(this,e),!0}return!1},w.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;r>t;++t)y(this,e[t]);e.length=0},w.prototype.contains=function(e){return i(e)&&e._labelCollection===this},w.prototype.get=function(e){return this._labels[e]},w.prototype.update=function(e,t,r){var n=this._billboardCollection;n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume,i(this._textureAtlas)||(this._textureAtlas=e.createTextureAtlas(),n.textureAtlas=this._textureAtlas);for(var o=this._labelsToUpdate,a=0,s=o.length;s>a;++a){var l=o[a];if(!l.isDestroyed()){var u=l._glyphs.length;l._rebindAllGlyphs&&(g(this,l),l._rebindAllGlyphs=!1),l._repositionAllGlyphs&&(_(l),l._repositionAllGlyphs=!1);var c=l._glyphs.length-u;this._totalGlyphCount+=c}}o.length=0,n.update(e,t,r)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),n(this)},w}),r("DynamicScene/DynamicLabelVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/HorizontalOrigin","../Scene/VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r,a){var c=a._label;if(t(c)){var h=c._text;if(t(h)){var g=a._position;if(t(g)){var _,y=c._show,C=a._labelVisualizerIndex,S=a.isAvailable(r)&&(!t(y)||y.getValue(r));if(!S)return t(C)&&(_=e._labelCollection.get(C),_.setShow(!1),e._unusedIndexes.push(C),a._labelVisualizerIndex=void 0),void 0;if(t(C))_=e._labelCollection.get(C);else{var w=e._unusedIndexes,E=w.length;E>0?(C=w.pop(),_=e._labelCollection.get(C)):(C=e._labelCollection.length,_=e._labelCollection.add()),a._labelVisualizerIndex=C,_.id=a,_.setText(""),_.setScale(1),_.setFont("30px sans-serif"),_.setFillColor(i.WHITE),_.setOutlineColor(i.BLACK),_.setOutlineWidth(1),_.setStyle(s.FILL),_.setPixelOffset(n.ZERO),_.setEyeOffset(o.ZERO),_.setHorizontalOrigin(l.CENTER),_.setVerticalOrigin(u.CENTER)}_.setShow(S);var x=h.getValue(r);t(x)&&_.setText(x),d=g.getValue(r,d),t(d)&&_.setPosition(d);var b=c._scale;if(t(b)){var T=b.getValue(r);t(T)&&_.setScale(T)}if(b=c._font,t(b)){var A=b.getValue(r);t(A)&&_.setFont(A)}if(b=c._fillColor,t(b)&&(m=b.getValue(r,m),t(m)&&_.setFillColor(m)),b=c._outlineColor,t(b)&&(p=b.getValue(r,p),t(p)&&_.setOutlineColor(p)),b=c._outlineWidth,t(b)){var P=b.getValue(r);t(P)&&_.setOutlineWidth(P)}if(b=c._style,t(b)){var D=b.getValue(r);t(D)&&_.setStyle(D)}if(b=c._pixelOffset,t(b)&&(v=b.getValue(r,v),t(v)&&_.setPixelOffset(v)),b=c._eyeOffset,t(b)&&(f=b.getValue(r,f),t(f)&&_.setEyeOffset(f)),b=c._horizontalOrigin,t(b)){var M=b.getValue(r);t(M)&&_.setHorizontalOrigin(M)}if(b=c._verticalOrigin,t(b)){var I=b.getValue(r);t(I)&&_.setVerticalOrigin(I)}b=c._translucencyByDistance,t(b)&&_.setTranslucencyByDistance(b.getValue(r)),b=c._pixelOffsetScaleByDistance,t(b)&&_.setPixelOffsetScaleByDistance(b.getValue(r))}}}}var h=function(e,t){this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;var r=this._labelCollection=new a;e.primitives.add(r),this.setDynamicObjectCollection(t)};h.prototype.getScene=function(){return this._scene},h.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},h.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(h.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(h.prototype._onObjectsRemoved,this))},h.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)c(this,e,r[i])},h.prototype.removeAllPrimitives=function(){if(this._unusedIndexes=[],this._labelCollection.removeAll(),t(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),r=e.length-1;r>-1;r--)e[r]._labelVisualizerIndex=void 0},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._labelCollection),r(this)};var d,m,p,f,v;return h.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._labelCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._labelVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),o.push(l),s._labelVisualizerIndex=void 0}}},h}),r("Scene/ModelTypes",["../Core/ComponentDatatype"],function(e){"use strict";var t={};return"undefined"==typeof WebGLRenderingContext?t:(t[WebGLRenderingContext.FLOAT]={componentsPerAttribute:1,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,r)}},t[WebGLRenderingContext.FLOAT_VEC2]={componentsPerAttribute:2,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r) +}},t[WebGLRenderingContext.FLOAT_VEC3]={componentsPerAttribute:3,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_VEC4]={componentsPerAttribute:4,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_MAT2]={componentsPerAttribute:4,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_MAT3]={componentsPerAttribute:9,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_MAT4]={componentsPerAttribute:16,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t)}),r("Scene/ModelAnimationCache",["../Core/defined","../Core/Cartesian3","../Core/Quaternion","../Core/LinearSpline","../Core/QuaternionSpline","./ModelTypes"],function(e,t,r,i,n,o){"use strict";function a(e,t){var r=e.gltf,i=r.buffers,n=r.bufferViews,a=n[t.bufferView],s=i[a.buffer],l=a.byteOffset+t.byteOffset,u=t.count*o[t.type].componentsPerAttribute;return e.basePath+s.path+":"+l+":"+u}function s(e,t,r){return e.basePath+":"+t+":"+r}var l=function(){},u={},c=new t;l.getAnimationParameterValues=function(i,n){var s=a(i,n),l=u[s];if(!e(l)){var h,d=i._loadResources.buffers,m=i.gltf,p=m.bufferViews,f=p[n.bufferView],v=n.type,g=n.count,_=o[v].createArrayBufferView(d[f.buffer],f.byteOffset+n.byteOffset,n.count);if(v===WebGLRenderingContext.FLOAT)l=_;else if(v===WebGLRenderingContext.FLOAT_VEC3)for(l=new Array(g),h=0;g>h;++h)l[h]=t.fromArray(_,3*h);else if(v===WebGLRenderingContext.FLOAT_VEC4)for(l=new Array(g),h=0;g>h;++h){var y=4*h;l[h]=r.fromAxisAngle(t.fromArray(_,y,c),_[y+3])}u[s]=l}return l};var h={},d=function(e){this._value=e};return d.prototype.evaluate=function(){return this._value},l.getAnimationSpline=function(t,r,o,a,l,u){var c=s(t,r,a),m=h[c];if(!e(m)){var p=u[l.input],f=t.gltf.accessors[o.parameters[l.output]],v=u[l.output];1===p.length&&1===v.length?m=new d(v[0]):"LINEAR"===l.interpolation&&(f.type===WebGLRenderingContext.FLOAT_VEC3?m=new i({times:p,points:v}):f.type===WebGLRenderingContext.FLOAT_VEC4&&(m=new n({times:p,points:v}))),h[c]=m}return m},l}),r("Scene/ModelAnimationLoop",[],function(){"use strict";var e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e}),r("Scene/ModelAnimationState",[],function(){"use strict";return{STOPPED:0,ANIMATING:1}}),r("Scene/ModelAnimation",["../Core/defaultValue","../Core/Event","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i){"use strict";var n=function(n,o,a){this.name=n.name,this.startTime=n.startTime,this.startOffset=e(n.startOffset,0),this.stopTime=n.stopTime,this.removeOnStop=e(n.removeOnStop,!1),this.speedup=e(n.speedup,1),this.reverse=e(n.reverse,!1),this.loop=e(n.loop,r.NONE),this.start=new t,this.update=new t,this.stop=new t,this._state=i.STOPPED,this._runtimeAnimation=a,this._startTime=void 0,this._duration=void 0;var s=this;this._raiseStartEvent=function(){s.start.raiseEvent(o,s)},this._updateEventTime=0,this._raiseUpdateEvent=function(){s.update.raiseEvent(o,s,s._updateEventTime)},this._raiseStopEvent=function(){s.stop.raiseEvent(o,s)}};return n}),r("Scene/ModelAnimationCollection",["../Core/clone","../Core/defined","../Core/defineProperties","../Core/defaultValue","../Core/DeveloperError","../Core/Math","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState","./ModelAnimation"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t){for(var r=e.channelEvaluators,i=r.length,n=0;i>n;++n)r[n](t)}function d(e,t,r){return function(){e.animationRemoved.raiseEvent(t,r)}}var m=function(e){this.animationAdded=new a,this.animationRemoved=new a,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0};r(m.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),m.prototype.add=function(e){e=i(e,i.EMPTY_OBJECT);var t=this._model,r=t._runtime.animations,n=r[e.name],o=new c(e,t,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(t,o),o},m.prototype.addAll=function(t){t=i(t,i.EMPTY_OBJECT),t=e(t);var r=[],n=this._model.gltf.animations;for(var o in n)n.hasOwnProperty(o)&&(t.name=o,r.push(this.add(t)));return r},m.prototype.remove=function(e){if(t(e)){var r=this._scheduledAnimations,i=r.indexOf(e);if(-1!==i)return r.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},m.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,r=t.length;this._scheduledAnimations=[];for(var i=0;r>i;++i)this.animationRemoved.raiseEvent(e,t[i])},m.prototype.contains=function(e){return t(e)?-1!==this._scheduledAnimations.indexOf(e):!1},m.prototype.get=function(e){return this._scheduledAnimations[e]};var p=[];return m.prototype.update=function(e){if(s.equals(e.time,this._previousTime))return!1;this._previousTime=s.clone(e.time,this._previousTime);for(var r=!1,n=e.time,a=this._model,c=this._scheduledAnimations,m=c.length,f=0;m>f;++f){var v=c[f],g=v._runtimeAnimation;t(v._startTime)||(v._startTime=i(v.startTime,n).addSeconds(v.startOffset)),t(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._startTime,y=v._duration,C=v.stopTime,S=0!==y?_.getSecondsDifference(n)/y:0,w=S>=0,E=w&&(1>=S||v.loop===l.REPEAT||v.loop===l.MIRRORED_REPEAT)&&(!t(C)||n.lessThanOrEquals(C));if(E){if(v._state===u.STOPPED&&(v._state=u.ANIMATING,v.start.getNumberOfListeners()>0&&e.afterRender.push(v._raiseStartEvent)),v.loop===l.REPEAT)S-=Math.floor(S);else if(v.loop===l.MIRRORED_REPEAT){var x=Math.floor(S),b=S-x;S=1===x%2?1-b:b}v.reverse&&(S=1-S);var T=S*y*v.speedup;T=o.clamp(T,g.startTime,g.stopTime),h(g,T),v.update.getNumberOfListeners()>0&&(v._updateEventTime=T,e.afterRender.push(v._raiseUpdateEvent)),r=!0}else w&&v._state===u.ANIMATING&&(v._state=u.STOPPED,v.stop.getNumberOfListeners()>0&&e.afterRender.push(v._raiseStopEvent),v.removeOnStop&&p.push(v))}m=p.length;for(var A=0;m>A;++A){var P=p[A];c.splice(c.indexOf(P),1),e.afterRender.push(d(this,a,P))}return p.length=0,r},m}),r("Scene/ModelMesh",[],function(){"use strict";var e=function(e){this.name=e};return e}),r("Scene/ModelNode",["../Core/defaultValue","../Core/defineProperties","../Core/Matrix4"],function(e,t,r){"use strict";var i=function(t,i,n){this._model=t,this._runtimeNode=n,this.name=i.name,this.useMatrix=!1,this._matrix=r.clone(e(i.matrix,r.IDENTITY))};return t(i.prototype,{matrix:{get:function(){return this._matrix},set:function(e){this._matrix=r.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}}}),i}),r("ThirdParty/gltfDefaults",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";function r(e){if(t(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];t(i.matrix)||(t(i.translation)&&t(i.rotation)&&t(i.scale)?(t(i.translation)||(i.translation=[0,0,0]),t(i.rotation)||(i.rotation=[1,0,0,0]),t(i.scale)||(i.scale=[1,1,1])):i.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function i(r){if(t(r))for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];n.type=e(n.type,WebGLRenderingContext.UNSIGNED_BYTE)}}var n=function(e){return t(e)?(r(e.nodes),i(e.textures),e):void 0};return n}),r("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/defined","../Core/defaultValue","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadImage","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ModelAnimationCache","./ModelAnimationCollection","./ModelMesh","./ModelNode","./ModelTypes","./SceneMode","../ThirdParty/gltfDefaults"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N){"use strict";function B(){this.buffersToCreate=new C,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new C,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new C,this.pendingTextureLoads=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.skinnedNodesNames=[]}function z(e,t,r){return function(){e._loadError=new S("Failed to load external "+t+": "+r),e._state=Mt.FAILED}}function F(e,t){return function(r){var i=e._loadResources;i.buffers[t]=r,--i.pendingBufferLoads}}function V(e){var t=e.gltf.buffers;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingBufferLoads;var i=e.basePath+t[r].path;h(i).then(F(e,r),z(e,"buffer",i))}}function k(e){var t=e.gltf.bufferViews;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.buffersToCreate.enqueue(r)}function U(e,t){return function(r){var i=e._loadResources;i.shaders[t]=r,--i.pendingShaderLoads}}function W(e){var t=e.gltf.shaders;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingShaderLoads;var i=e.basePath+t[r].path;m(i).then(U(e,r),z(e,"shader",i))}}function G(e){var t=e.gltf.programs;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.programsToCreate.enqueue(r)}function H(e,t){return function(r){var i=e._loadResources;--i.pendingTextureLoads,i.texturesToCreate.enqueue({name:t,image:r})}}function j(e){var t=e.gltf.images,r=e.gltf.textures;for(var i in r)if(r.hasOwnProperty(i)){++e._loadResources.pendingTextureLoads;var n=e.basePath+t[r[i].source].path;d(n).then(H(e,i),z(e,"image",n))}}function q(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesNames,a=e.gltf.nodes;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,transformToRoot:new g,computedMatrix:new g,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointId:l.jointId,children:[],parents:[],publicNode:void 0};u.publicNode=new O(e,l,u),t[s]=u,r[l.name]=u,o(l.instanceSkin)&&(n.push(s),i.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function Y(e){var t={},r=e.gltf.meshes;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];t[n.name]=new I(n.name)}e._runtime.meshesByName=t}function X(e){V(e),k(e),W(e),G(e),j(e),Y(e),q(e)}function Z(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){for(var i,n,a=e.gltf.bufferViews,s=r.buffers,l=e._rendererResources.buffers;r.buffersToCreate.length>0;){var u=r.buffersToCreate.dequeue();if(n=a[u],n.target===WebGLRenderingContext.ARRAY_BUFFER){i=new Uint8Array(s[n.buffer],n.byteOffset,n.byteLength);var c=t.createVertexBuffer(i,E.STATIC_DRAW);c.setVertexArrayDestroyable(!1),l[u]=c}}var h=e.gltf.accessors;for(var d in h)if(h.hasOwnProperty(d)){var m=h[d];if(n=a[m.bufferView],n.target===WebGLRenderingContext.ELEMENT_ARRAY_BUFFER&&!o(l[m.bufferView])){i=new Uint8Array(s[n.buffer],n.byteOffset,n.byteLength);var p=t.createIndexBuffer(i,E.STATIC_DRAW,m.type);p.setVertexArrayDestroyable(!1),l[m.bufferView]=p}}}}function J(e){for(var t={},r=e.length,i=0;r>i;++i)t[e[i]]=i;return t}function Q(e,t){var r=e._loadResources;if(0===r.pendingShaderLoads){var i=e.gltf.programs,n=r.shaders;if(r.programsToCreate.length>0){var o=r.programsToCreate.dequeue(),a=i[o],s=J(a.attributes),l=n[a.vertexShader],u=n[a.fragmentShader];if(e._rendererResources.programs[o]=t.getShaderCache().getShaderProgram(l,u,s),e.allowPicking){var c=x({sources:[u],pickColorQualifier:"uniform"});e._rendererResources.pickPrograms[o]=t.getShaderCache().getShaderProgram(l,c,s)}}}}function K(e,t){var r=e._loadResources;if(r.createSamplers){r.createSamplers=!1;var i=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];i[o]=t.createSampler({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function $(e,t){var r=e._loadResources,i=e.gltf.textures,n=e._rendererResources.samplers;if(r.texturesToCreate.length>0){var o=r.texturesToCreate.dequeue(),a=i[o.name],s=n[a.sampler],l=s.minificationFilter===A.NEAREST_MIPMAP_NEAREST||s.minificationFilter===A.NEAREST_MIPMAP_LINEAR||s.minificationFilter===A.LINEAR_MIPMAP_NEAREST||s.minificationFilter===A.LINEAR_MIPMAP_LINEAR,u=l||s.wrapS===P.REPEAT||s.wrapS===P.MIRRORED_REPEAT||s.wrapT===P.REPEAT||s.wrapT===P.MIRRORED_REPEAT,c=o.image,h=!p.isPowerOfTwo(c.width)||!p.isPowerOfTwo(c.height);if(u&&h){var d=document.createElement("canvas");d.width=p.nextPowerOfTwo(c.width),d.height=p.nextPowerOfTwo(c.height);var m=d.getContext("2d");m.drawImage(c,0,0,c.width,c.height,0,0,d.width,d.height),c=d}var f;a.target===WebGLRenderingContext.TEXTURE_2D&&(f=t.createTexture2D({source:c,pixelFormat:a.internalFormat,pixelDatatype:a.type,flipY:!1})),l&&f.generateMipmap(),f.setSampler(s),e._rendererResources.textures[o.name]=f}}function et(e,t){var r=e.gltf;r.programs;var i=r.techniques,n=r.materials,o={},a=i[n[t.material].instanceTechnique.technique],s=a.parameters,l=a.passes[a.pass],u=l.instanceProgram,c=u.attributes,h=e._rendererResources.programs[u.program].getVertexAttributes();for(var d in c)if(c.hasOwnProperty(d)){var m=s[c[d]];o[m.semantic]=h[d].index}return o}function tt(e,t){for(var r=e.length,i=0;r>i;++i)for(var n=[e[i]];n.length>0;){var o=n.pop();if(o.jointId===t)return o;for(var a=o.children,s=a.length,l=0;s>l;++l)n.push(a[l])}return void 0}function rt(e,t){for(var r=e.gltf,i=r.skins,n=r.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesNames,s=a.length,l=0;s>l;++l){var u=a[l],c=o[u],h=n[u].instanceSkin,d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var m=[],p=h.skeletons,f=p.length,v=0;f>v;++v)m.push(o[p[v]]);for(var g=i[h.skin].joints,_=g.length,y=0;_>y;++y){var C=g[y];c.joints.push(tt(m,C))}}}function it(e){var t=e._loadResources;if(t.finishedBuffersCreation()&&t.createSkins){t.createSkins=!1;var r=e.gltf,i=t.buffers,n=r.bufferViews,o=r.skins,a={};for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],u=l.inverseBindMatrices,c=n[u.bufferView],h=u.type,d=u.count,m=R[h].createArrayBufferView(i[c.buffer],c.byteOffset+u.byteOffset,d),p=new Array(d);if(h===WebGLRenderingContext.FLOAT_MAT4)for(var f=0;d>f;++f)p[f]=g.fromArray(m,16*f);var v;g.equals(l.bindShapeMatrix,g.IDENTITY)||(v=g.clone(l.bindShapeMatrix)),a[s]={inverseBindMatrices:p,bindShapeMatrix:v}}rt(e,a)}}function nt(e,t,r,i){return function(n){t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber}}function ot(e){var t=e._loadResources;if(t.finishedPendingLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var r,i=e._runtime.nodes,n=e.gltf.animations,o=e.gltf.accessors;for(var a in n)if(n.hasOwnProperty(a)){var s=n[a],l=s.channels,u=s.parameters,c=s.samplers,h={};for(r in u)u.hasOwnProperty(r)&&(h[r]=D.getAnimationParameterValues(e,o[u[r]]));for(var d=Number.MAX_VALUE,m=-Number.MAX_VALUE,p=l.length,f=new Array(p),v=0;p>v;++v){var g=l[v],_=g.target,y=c[g.sampler],C=h[y.input];d=Math.min(d,C[0]),m=Math.max(m,C[C.length-1]);var S=D.getAnimationSpline(e,a,s,g.sampler,y,h);f[v]=nt(e,i[_.id],_.path,S)}e._runtime.animations[a]={startTime:d,stopTime:m,channelEvaluators:f}}}}function at(e,t){var r=e._loadResources;if(r.finishedBuffersCreation()&&r.finishedProgramCreation()&&r.createVertexArrays){r.createVertexArrays=!1;var i=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,a=e.gltf,s=a.accessors,l=a.meshes;for(var u in l)if(l.hasOwnProperty(u))for(var c=l[u].primitives,h=c.length,d=0;h>d;++d){var m=c[d],p=et(e,m),f=[],v=m.attributes;for(var g in v)if(v.hasOwnProperty(g)){var _=p[g];if(o(_)){var y=s[v[g]],C=R[y.type];f.push({index:_,vertexBuffer:i[y.bufferView],componentsPerAttribute:C.componentsPerAttribute,componentDatatype:C.componentDatatype,normalize:!1,offsetInBytes:y.byteOffset,strideInBytes:y.byteStride})}}var S=s[m.indices],w=i[S.bufferView];n[u+".primitive."+d]=t.createVertexArray(f,w)}}}function st(e,t){var r=e._loadResources;if(r.createRenderStates){r.createRenderStates=!1;var i=e._rendererResources.renderStates,n=e.gltf.techniques;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],s=a.passes[a.pass],l=s.states;i[o]=t.createRenderState({cull:{enabled:!!l.cullFaceEnable},depthTest:{enabled:!!l.depthTestEnable},depthMask:!!l.depthMask,blending:l.blendEnable?w.ALPHA_BLEND:w.DISABLED})}}}function lt(e){return function(){return e}}function ut(e){var r=t.fromArray(e);return function(){return r}}function ct(e){var t=r.fromArray(e);return function(){return t}}function ht(e){var t=i.fromArray(e);return function(){return t}}function dt(e){var t=f.fromColumnMajorArray(e);return function(){return t}}function mt(e){var t=v.fromColumnMajorArray(e);return function(){return t}}function pt(e){var t=g.fromColumnMajorArray(e);return function(){return t}}function ft(e,t){var r=t._rendererResources.textures[e];return function(){return r}}function vt(e,t){var r=t._runtime.nodes[e];return function(){return r.computedMatrix}}function gt(e,t){var r=e._loadResources;if(r.finishedTextureCreation()&&r.finishedProgramCreation()&&r.createUniformMaps){r.createUniformMaps=!1;var i=e.gltf,n=i.materials,a=i.techniques;i.programs;var s=e._rendererResources.uniformMaps;for(var l in n)if(n.hasOwnProperty(l)){var u,c=n[l],h=c.instanceTechnique,d=h.values,m=a[h.technique],p=m.parameters,f=m.passes[m.pass],v=f.instanceProgram,g=v.uniforms,_=e._rendererResources.programs[v.program].getAllUniforms(),y={};for(var C in g)if(g.hasOwnProperty(C)&&o(_[C])){var S,w=g[C],E=p[w];o(d[w])?S=Bt[E.type](d[w],e):o(E.semantic)?"JOINT_MATRIX"!==E.semantic?S=Nt[E.semantic](t.getUniformState()):(S=void 0,u=C):o(E.source)?S=vt(E.source,e):o(E.value)&&(S=Bt[E.type](E.value,e)),o(S)&&(y[w]={uniformName:C,func:S})}var x={};for(C in y)if(y.hasOwnProperty(C)){var b=y[C];x[b.uniformName]=b.func}s[l]={uniformMap:x,jointMatrixUniformName:u}}}}function _t(e){return function(){return e}}function yt(e){return function(){return e.computedJointMatrices}}function Ct(t,i,a,s){for(var l=t._renderCommands,u=t._pickCommands,h=t._pickIds,d=t.allowPicking,m=t._runtime.meshesByName,p=t.debugShowBoundingVolume,f=t._rendererResources,v=f.vertexArrays,_=f.programs,y=f.pickPrograms,C=f.renderStates,S=f.uniformMaps,w=t.gltf,E=w.accessors,x=w.meshes,A=w.techniques,P=w.materials,D=o(i.meshes)?i.meshes:i.instanceSkin.sources,M=D.length,I=0;M>I;++I)for(var O=D[I],R=x[O],L=R.primitives,N=L.length,B=0;N>B;++B){var z,F=L[B],V=E[F.indices],k=P[F.material].instanceTechnique,U=A[k.technique],W=U.passes[U.pass],G=W.instanceProgram,H=F.attributes.POSITION;if(o(H)){var j=E[H];z=e.fromCornerPoints(r.fromArray(j.min),r.fromArray(j.max))}var q=v[O+".primitive."+B],Y=V.count,X=V.byteOffset/c.getSizeInBytes(V.type),Z=S[F.material],J=Z.uniformMap;if(o(Z.jointMatrixUniformName)){var Q={};Q[Z.jointMatrixUniformName]=yt(a),J=n(J,Q)}var K=W.states.blendEnable,$=C[k.technique],et={primitive:t,id:t.id,node:a.publicNode,mesh:m[R.name]},tt=new b;tt.boundingVolume=new e,tt.modelMatrix=new g,tt.primitiveType=F.primitive,tt.vertexArray=q,tt.count=Y,tt.offset=X,tt.shaderProgram=_[G.program],tt.uniformMap=J,tt.renderState=$,tt.owner=et,tt.debugShowBoundingVolume=p,tt.pass=K?T.TRANSLUCENT:T.OPAQUE,l.push(tt);var rt;if(d){var it=s.createPickId(et);h.push(it);var nt=n(J,{czm_pickColor:_t(it.color)});rt=new b,rt.boundingVolume=new e,rt.modelMatrix=new g,rt.primitiveType=F.primitive,rt.vertexArray=q,rt.count=Y,rt.offset=X,rt.shaderProgram=y[G.program],rt.uniformMap=nt,rt.renderState=$,rt.owner=et,rt.pass=K?T.TRANSLUCENT:T.OPAQUE,u.push(rt)}a.commands.push({command:tt,pickCommand:rt,boundingSphere:z})}}function St(e,t){var i=e._loadResources;if(i.finishedPendingLoads()&&i.finishedResourceCreation()&&i.createRuntimeNodes){i.createRuntimeNodes=!1;for(var n=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,u=s.scenes[s.scene],c=u.nodes,h=c.length,d=[],m=new r,p=0;h>p;++p)for(d.push({parentRuntimeNode:void 0,gltfNode:l[c[p]],id:c[p]});d.length>0;){var f=d.pop(),v=f.parentRuntimeNode,_=f.gltfNode,C=a[f.id];0===C.parents.length&&(o(_.matrix)?C.matrix=g.fromColumnMajorArray(_.matrix):(m=r.fromArray(_.rotation,0,m),C.translation=r.fromArray(_.translation),C.rotation=y.fromAxisAngle(m,_.rotation[3]),C.scale=r.fromArray(_.scale))),o(v)?(v.children.push(C),C.parents.push(v)):n.push(C),(o(_.meshes)||o(_.instanceSkin))&&Ct(e,_,C,t);for(var S=_.children,w=S.length,E=0;w>E;++E)d.push({parentRuntimeNode:C,gltfNode:l[S[E]],id:S[E]})}e._runtime.rootNodes=n,e._runtime.nodes=a}}function wt(e,t){Z(e,t),Q(e,t),K(e,t),$(e,t),it(e),ot(e),at(e,t),st(e,t),gt(e,t),St(e,t)}function Et(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&o(i)?g.clone(i,t):o(e.matrix)?g.clone(e.matrix,t):g.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)}function xt(t,r,i){for(var n=t._maxDirtyNumber,o=t.allowPicking,a=t._runtime.rootNodes,s=a.length,l=zt,u=t._computedModelMatrix,c=0;s>c;++c){var h=a[c];for(Et(h,h.transformToRoot),l.push(h);l.length>0;){h=l.pop();var d=h.transformToRoot,m=h.commands;if(h.dirtyNumber===n||r||i){var p=m.length;if(p>0)for(var f=0;p>f;++f){var v=m[f],_=v.command;if(g.multiplyTransformation(u,d,_.modelMatrix),e.transform(v.boundingSphere,_.modelMatrix,_.boundingVolume),o){var y=v.pickCommand;g.clone(_.modelMatrix,y.modelMatrix),e.clone(_.boundingVolume,y.boundingVolume)}}else h.computedMatrix=g.multiplyTransformation(u,d,h.computedMatrix)}for(var C=h.children,S=C.length,w=0;S>w;++w){var E=C[w];E.dirtyNumber=Math.max(E.dirtyNumber,h.dirtyNumber),(E.dirtyNumber===n||i)&&(Et(E,E.transformToRoot),g.multiplyTransformation(d,E.transformToRoot,E.transformToRoot)),l.push(E)}}}++t._maxDirtyNumber}function bt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;r>i;++i){var n=t[i];Ft=g.inverseTransformation(n.transformToRoot,Ft);for(var a=n.computedJointMatrices,s=n.joints,l=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)a[h]=g.multiplyTransformation(Ft,s[h].transformToRoot,a[h]),a[h]=g.multiplyTransformation(a[h],u[h],a[h]),o(l)&&(a[h]=g.multiplyTransformation(a[h],l,a[h]))}}function Tt(e,t){var r=e.id;if(e._id!==r){e._id=r;for(var i=e._pickIds,n=i.length,o=0;n>o;++o)t.getObjectByPickColor(i[o].color).id=r}}function At(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?_.LINES:_.TRIANGLES,r=e._renderCommands,i=r.length,n=0;i>n;++n)r[n].primitiveType=t}}function Pt(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function Dt(e){for(var t in e)e.hasOwnProperty(t)&&e[t].release()}var Mt={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};B.prototype.finishedPendingLoads=function(){return 0===this.pendingBufferLoads&&0===this.pendingShaderLoads&&0===this.pendingTextureLoads},B.prototype.finishedResourceCreation=function(){return 0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.texturesToCreate.length},B.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},B.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},B.prototype.finishedTextureCreation=function(){return 0===this.pendingTextureLoads&&0===this.texturesToCreate.length};var It=function(e){e=a(e,a.EMPTY_OBJECT),this.gltf=N(e.gltf),this.basePath=a(e.basePath,""),this.show=a(e.show,!0),this.modelMatrix=g.clone(a(e.modelMatrix,g.IDENTITY)),this._modelMatrix=g.clone(this.modelMatrix),this.scale=a(e.scale,1),this._scale=this.scale,this.id=e.id,this._id=e.id,this.allowPicking=a(e.allowPicking,!0),this.readyToRender=new u,this.activeAnimations=new M(this),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.debugWireframe=a(e.debugWireframe,!1),this._debugWireframe=!1,this._computedModelMatrix=new g,this._state=Mt.NEEDS_LOAD,this._loadError=void 0,this._loadResources=void 0,this._cesiumAnimationsDirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},textures:{},samplers:{},renderStates:{},uniformMaps:{}},this._renderCommands=[],this._pickCommands=[],this._pickIds=[]};It.fromGltf=function(e){var t=e.url,r="",i=t.lastIndexOf("/");-1!==i&&(r=t.substring(0,i+1));var n=new It(e);return m(t,e.headers).then(function(e){n.gltf=N(JSON.parse(e)),n.basePath=r}),n},It.prototype.getNode=function(e){var t=this._runtime.nodesByName[e];return o(t)?t.publicNode:void 0},It.prototype.getMesh=function(e){return this._runtime.meshesByName[e]};var Ot=new r,Rt=[],Lt=new r;It.prototype.computeWorldBoundingSphere=function(t){o(t)||(t=new e),r.clone(r.ZERO,Ot),Rt.length=0;for(var i=Rt,n=this._renderCommands,a=n.length,s=0;a>s;++s){var l=n[s];r.add(l.boundingVolume.center,Ot,Ot),i.push(l.boundingVolume)}if(i.length>0){var u=0;for(a=i.length,r.divideByScalar(Ot,a,Ot),s=0;a>s;++s){var c=i[s],h=r.magnitudeSquared(r.subtract(c.center,Ot,Lt))+c.radius*c.radius;h>u&&(u=h)}r.clone(Ot,t.center),t.radius=Math.sqrt(u)}return t};var Nt={MODEL:function(e){return function(){return e.getModel()}},VIEW:function(e){return function(){return e.getView()}},PROJECTION:function(e){return function(){return e.getProjection()}},MODELVIEW:function(e){return function(){return e.getModelView()}},MODELVIEWPROJECTION:function(e){return function(){return e.getModelViewProjection()}},MODELINVERSE:function(e){return function(){return e.getInverseModel()}},VIEWINVERSE:function(e){return function(){return e.getInverseView()}},PROJECTIONINVERSE:function(e){return function(){return e.getInverseProjection()}},MODELVIEWINVERSE:function(e){return function(){return e.getInverseModelView()}},MODELVIEWPROJECTIONINVERSE:function(e){return function(){return e.getInverseModelViewProjection()}},MODELINVERSETRANSPOSE:function(e){return function(){return e.getInverseTranposeModel()}},MODELVIEWINVERSETRANSPOSE:function(e){return function(){return e.getNormal()}},VIEWPORT:function(e){return function(){return e.getViewportCartesian4()}}},Bt={};"undefined"!=typeof WebGLRenderingContext&&(Bt[WebGLRenderingContext.FLOAT]=lt,Bt[WebGLRenderingContext.FLOAT_VEC2]=ut,Bt[WebGLRenderingContext.FLOAT_VEC3]=ct,Bt[WebGLRenderingContext.FLOAT_VEC4]=ht,Bt[WebGLRenderingContext.INT]=lt,Bt[WebGLRenderingContext.INT_VEC2]=ut,Bt[WebGLRenderingContext.INT_VEC3]=ct,Bt[WebGLRenderingContext.INT_VEC4]=ht,Bt[WebGLRenderingContext.BOOL]=lt,Bt[WebGLRenderingContext.BOOL_VEC2]=ut,Bt[WebGLRenderingContext.BOOL_VEC3]=ct,Bt[WebGLRenderingContext.BOOL_VEC4]=ht,Bt[WebGLRenderingContext.FLOAT_MAT2]=dt,Bt[WebGLRenderingContext.FLOAT_MAT3]=mt,Bt[WebGLRenderingContext.FLOAT_MAT4]=pt,Bt[WebGLRenderingContext.SAMPLER_2D]=ft);var zt=[],Ft=new g;return It.prototype.update=function(e,t,r){if(t.mode===L.SCENE3D){this._state===Mt.NEEDS_LOAD&&o(this.gltf)&&(this._state=Mt.LOADING,this._loadResources=new B,X(this));var i=!1;if(this._state===Mt.FAILED)throw this._loadError;if(this._state===Mt.LOADING){wt(this,e);var n=this._loadResources;n.finishedPendingLoads()&&n.finishedResourceCreation()&&(this._state=Mt.LOADED,this._loadResources=void 0,i=!0)}if(this.show&&this._state===Mt.LOADED||i){var a=this.activeAnimations.update(t)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1;var s=!g.equals(this._modelMatrix,this.modelMatrix)||this._scale!==this.scale;(s||i)&&(g.clone(this.modelMatrix,this._modelMatrix),this._scale=this.scale,g.multiplyByUniformScale(this.modelMatrix,this.scale,this._computedModelMatrix)),(a||s||i)&&(xt(this,s,i),(a||i)&&bt(this)),Tt(this,e),At(this)}if(i){var l=this;return t.afterRender.push(function(){l.readyToRender.raiseEvent(l)}),void 0}if(this.show){var u,c,h,d=t.passes;if(d.render)for(h=this._renderCommands,c=h.length,u=0;c>u;++u)r.push(h[u]);if(d.pick)for(h=this._pickCommands,c=h.length,u=0;c>u;++u)r.push(h[u])}}},It.prototype.isDestroyed=function(){return!1},It.prototype.destroy=function(){var e=this._rendererResources;Pt(e.buffers),Pt(e.vertexArrays),Dt(e.programs),Dt(e.pickPrograms),Pt(e.textures),e=void 0,this._rendererResources=void 0;for(var t=this._pickIds,r=t.length,i=0;r>i;++i)t[i].destroy();return s(this)},It}),r("DynamicScene/DynamicModelVisualizer",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Scene/Model"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=new o,c=function(e,t){this._scene=e,this._primitives=e.primitives,this._modelCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};return c.prototype.getScene=function(){return this._scene},c.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},c.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(c.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(c.prototype._onObjectsRemoved,this))},c.prototype.update=function(e){if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,n=t.length;n>i;i++)this._updateObject(e,t[i])},c.prototype.removeAllPrimitives=function(){if(r(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),t=e.length-1;t>-1;t--){var i=e[t]._modelPrimitive;r(i)&&(this._primitives.remove(i),i.isDestroyed()||i.destroy(),i=void 0)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAllPrimitives(),i(this)},c.prototype._updateObject=function(i,n){var c=this._scene.context,h=n.model;if(r(h)){var d=h._uri;if(r(d)){var m=n.position;if(r(m)){var p=n._modelPrimitive,f=h._show,v=n.isAvailable(i)&&(!r(f)||f.getValue(i)),g=d.getValue(i,c);if(!v||!r(g))return r(p)&&(p.show=!1),void 0;r(p)&&g===n._modelPrimitiveUri||(r(p)&&(this._primitives.remove(p),p.isDestroyed()||p.destroy()),p=l.fromGltf({url:g}),n._modelPrimitiveUri=g,p.id=n,p.scale=1,p._visualizerOrientation=s.clone(s.IDENTITY),this._primitives.add(p),n._modelPrimitive=p),p.show=!0;var _,y=t(m.getValue(i,y),p._visualizerPosition),C=n.orientation;_=r(C)?t(C.getValue(i,_),p._visualizerOrientation):p._visualizerOrientation,!r(y)||!r(_)||e.equals(y,p._visualizerPosition)&&s.equals(_,p._visualizerOrientation)||(a.fromRotationTranslation(o.fromQuaternion(_,u),y,p.modelMatrix),p._visualizerPosition=e.clone(y,p._visualizerPosition),p._visualizerOrientation=s.clone(_,p._visualizerOrientation));var S=h._scale;if(r(S)){var w=S.getValue(i);r(w)&&(p.scale=w)}}}}},c.prototype._onObjectsRemoved=function(e,t,i){for(var n=i.length-1;n>-1;n--){var o=i[n],a=o._modelPrimitive;r(a)&&(this._primitives.remove(a),a.isDestroyed()||a.destroy(),o._modelPrimitive=void 0)}},c}),r("Scene/Polyline",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/BoundingSphere","../Core/Color","../Core/PolylinePipeline","../Core/Matrix4","../Core/Cartesian3","./Material"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,r){++e._propertiesChanged[r];var i=e._polylineCollection;t(i)&&(i._updatePolyline(e,r),e._dirty=!0)}var c=function(r,u){r=e(r,e.EMPTY_OBJECT),this._show=e(r.show,!0),this._width=e(r.width,1),this._loop=e(r.loop,!1),this._material=r.material,t(this._material)||(this._material=l.fromType(l.ColorType,{color:new n(1,1,1,1)}));var c=r.positions;t(c)||(c=[]),this._positions=c,this._loop&&c.length>2&&!s.equals(c[0],c[c.length-1])&&c.push(s.clone(c[0])),this._length=c.length,this._id=r.id;var h;t(u)&&(h=a.clone(u.modelMatrix)),this._modelMatrix=h,this._segments=o.wrapLongitude(c,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(v),this._polylineCollection=u,this._dirty=!1,this._pickId=void 0,this._pickIdThis=r._pickIdThis,this._boundingVolume=i.fromPoints(this._positions),this._boundingVolumeWC=i.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new i +},h=c.SHOW_INDEX=0,d=c.WIDTH_INDEX=1,m=c.POSITION_INDEX=2,p=c.MATERIAL_INDEX=3,f=c.POSITION_SIZE_INDEX=4,v=c.NUMBER_OF_PROPERTIES=5;return c.prototype.getShow=function(){return this._show},c.prototype.setShow=function(e){e!==this._show&&(this._show=e,u(this,h))},c.prototype.getPositions=function(){return this._positions},c.prototype.setPositions=function(e){this._loop&&e.length>2&&!s.equals(e[0],e[e.length-1])&&e.push(s.clone(e[0])),(this._positions.length!==e.length||this._positions.length!==this._length)&&u(this,f),this._positions=e,this._length=e.length,this._boundingVolume=i.fromPoints(this._positions,this._boundingVolume),this._boundingVolumeWC=i.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),u(this,m),this.update()},c.prototype.update=function(){var e=a.IDENTITY;t(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,n=this._segments.lengths,s=this._propertiesChanged[m]>0||this._propertiesChanged[f]>0;if((!a.equals(e,this._modelMatrix)||s)&&(this._segments=o.wrapLongitude(this._positions,e),this._boundingVolumeWC=i.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==r)u(this,f);else for(var l=n.length,c=0;l>c;++c)if(n[c]!==this._segments.lengths[c]){u(this,f);break}},c.prototype.getMaterial=function(){return this._material},c.prototype.setMaterial=function(e){this._material!==e&&(this._material=e,u(this,p))},c.prototype.getWidth=function(){return this._width},c.prototype.setWidth=function(e){var t=this._width;e!==t&&(this._width=e,u(this,d))},c.prototype.getLoop=function(){return this._loop},c.prototype.setLoop=function(e){if(e!==this._loop){var t=this._positions;e?t.length>2&&!s.equals(t[0],t[t.length-1])&&t.push(s.clone(t[0])):t.length>2&&s.equals(t[0],t[t.length-1])&&t.pop(),this._loop=e,u(this,f)}},c.prototype.getId=function(){return this._id},c.prototype.getPickId=function(r){return t(this._pickId)||(this._pickId=r.createPickId({primitive:e(this._pickIdThis,this),collection:this._polylineCollection,id:this._id})),this._pickId},c.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;v-1>t;++t)e[t]=0},c.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},c}),r("Shaders/PolylineCommon",[],function(){"use strict";return"const vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvoid clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(normalize(previous.xyz - position.xyz), vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(normalize(next.xyz - position.xyz), vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_highResolutionSnapScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),r("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),r("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),r("Scene/PolylineCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Color","../Core/destroyObject","../Core/Cartesian3","../Core/Cartesian4","../Core/EncodedCartesian3","../Core/Matrix4","../Core/Math","../Core/ComponentDatatype","../Core/IndexDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Core/Intersect","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","./Material","./SceneMode","./Polyline","../Shaders/PolylineCommon","../Shaders/PolylineVS","../Shaders/PolylineFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T){"use strict";function A(e,r,i,n,o,a,s){for(var l=n.length,u=0,c=!0,h=e._vertexArrays,d=e.debugShowBoundingVolume,f=h.length,v=0;f>v;++v)for(var g=h[v],y=g.buckets,S=y.length,E=0;S>E;++E){for(var x,b,T,A=y[E],P=A.offset,D=s?A.bucket.shaderProgram:A.bucket.pickShaderProgram,I=A.bucket.polylines,O=I.length,R=0,L=0;O>L;++L){var N=I[L],B=M(N._material);if(B!==x){if(t(x)&&R>0){var z=b.isTranslucent();u>=l?(T=new _,T.owner=e,n.push(T)):T=n[u],++u,T.boundingVolume=p.clone(Y,T.boundingVolume),T.modelMatrix=a,T.primitiveType=m.TRIANGLES,T.shaderProgram=D,T.vertexArray=g.va,T.renderState=z?e._translucentRS:e._opaqueRS,T.pass=z?C.TRANSLUCENT:C.OPAQUE,T.debugShowBoundingVolume=s?d:!1,T.uniformMap=b._uniforms,T.count=R,T.offset=P,P+=R,R=0,c=!0,o.push(T)}b=N._material,b.update(r),x=B}for(var F=N._locatorBuckets,V=F.length,k=0;V>k;++k){var U=F[k];U.locator===A&&(R+=U.count)}var W;i.mode===w.SCENE3D?W=N._boundingVolumeWC:i.mode===w.COLUMBUS_VIEW?W=N._boundingVolume2D:i.mode===w.SCENE2D?t(N._boundingVolume2D)&&(W=p.clone(N._boundingVolume2D,X),W.center.x=0):t(N._boundingVolumeWC)&&t(N._boundingVolume2D)&&(W=p.union(N._boundingVolumeWC,N._boundingVolume2D,X)),c?(c=!1,p.clone(W,Y)):p.union(W,Y,Y)}t(x)&&R>0&&(u>=l?(T=new _,T.owner=e,n.push(T)):T=n[u],++u,T.boundingVolume=p.clone(Y,T.boundingVolume),T.modelMatrix=a,T.primitiveType=m.TRIANGLES,T.shaderProgram=D,T.vertexArray=g.va,T.renderState=b.isTranslucent()?e._translucentRS:e._opaqueRS,T.pass=b.isTranslucent()?C.TRANSLUCENT:C.OPAQUE,T.debugShowBoundingVolume=s?d:!1,T.uniformMap=b._uniforms,T.count=R,T.offset=P,c=!0,o.push(T)),x=void 0}n.length=u}function P(e){for(var t=e._buffersUsage,r=!1,i=e._propertiesChanged,n=0;H-2>n;++n){var o=t[n];i[n]?o.bufferUsage!==g.STREAM_DRAW?(r=!0,o.bufferUsage=g.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==g.STATIC_DRAW&&(0===o.frameCount?(r=!0,o.bufferUsage=g.STATIC_DRAW):o.frameCount--)}return r}function D(e,r){e._createVertexArray=!1,L(e),N(e),I(e);var i,n,o=[[]],a=o[0],s=[0],l=0,u=[[]],m=0,p=e._polylineBuckets;for(i in p)p.hasOwnProperty(i)&&(n=p[i],n.updateShader(r),m+=n.lengthOfPositions);if(m>0){var f,v=e._mode,_=new Float32Array(3*6*m),y=new Uint8Array(4*m),C=new Float32Array(4*m),S=0,E=0,x=0;for(i in p)if(p.hasOwnProperty(i)){n=p[i],n.write(_,y,C,S,E,x,r),v===w.MORPHING&&(t(f)||(f=new Float32Array(3*6*m)),n.writeForMorph(f,S));var b=n.lengthOfPositions;S+=3*6*b,E+=4*b,x+=4*b,l=n.updateIndices(o,s,u,l)}var T=e._buffersUsage[U].bufferUsage,A=e._buffersUsage[V].bufferUsage,P=e._buffersUsage[k].bufferUsage,D=A===g.STREAM_DRAW||P===g.STREAM_DRAW?g.STREAM_DRAW:g.STATIC_DRAW;e._positionBuffer=r.createVertexBuffer(_,T);var M;t(f)&&(M=r.createVertexBuffer(f,T)),e._pickColorBuffer=r.createVertexBuffer(y,g.STATIC_DRAW),e._texCoordExpandWidthAndShowBuffer=r.createVertexBuffer(C,D);for(var O=4*Uint8Array.BYTES_PER_ELEMENT,R=3*Float32Array.BYTES_PER_ELEMENT,B=4*Float32Array.BYTES_PER_ELEMENT,z=0,F=o.length,W=0;F>W;++W)if(a=o[W],a.length>0){var G=new Uint16Array(a),H=r.createIndexBuffer(G,g.STATIC_DRAW,d.UNSIGNED_SHORT);z+=s[W];var q,Y,X,J,Q=6*(W*R*c.SIXTY_FOUR_KILOBYTES-z*R),K=R+Q,$=R+K,et=R+$,tt=R+et,rt=R+tt,it=W*O*c.SIXTY_FOUR_KILOBYTES-z*O,nt=W*B*c.SIXTY_FOUR_KILOBYTES-z*B,ot=[{index:j.position3DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:Q,strideInBytes:6*R},{index:j.position3DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:K,strideInBytes:6*R},{index:j.position2DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:Q,strideInBytes:6*R},{index:j.position2DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:K,strideInBytes:6*R},{index:j.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:$,strideInBytes:6*R},{index:j.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:et,strideInBytes:6*R},{index:j.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:$,strideInBytes:6*R},{index:j.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:et,strideInBytes:6*R},{index:j.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:tt,strideInBytes:6*R},{index:j.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:rt,strideInBytes:6*R},{index:j.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:tt,strideInBytes:6*R},{index:j.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:rt,strideInBytes:6*R},{index:j.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:h.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:nt},{index:j.pickColor,componentsPerAttribute:4,componentDatatype:h.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:it,normalize:!0}];v===w.SCENE3D?(q=e._positionBuffer,Y="vertexBuffer",X=Z,J="value"):v===w.SCENE2D||v===w.COLUMBUS_VIEW?(q=Z,Y="value",X=e._positionBuffer,J="vertexBuffer"):(q=M,Y="vertexBuffer",X=e._positionBuffer,J="vertexBuffer"),ot[0][Y]=q,ot[1][Y]=q,ot[2][J]=X,ot[3][J]=X,ot[4][Y]=q,ot[5][Y]=q,ot[6][J]=X,ot[7][J]=X,ot[8][Y]=q,ot[9][Y]=q,ot[10][J]=X,ot[11][J]=X;var at=r.createVertexArray(ot,H);e._vertexArrays.push({va:at,buckets:u[W]})}}}function M(e){var t=S._uniformList[e.type],r=t.length;J.length=2*r;for(var i=0,n=0;r>n;++n){var o=t[n];J[i]=o,J[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(J)}function I(e){for(var r=e._mode,i=e._projection,n=e._modelMatrix,o=e._polylineBuckets={},a=e._polylines,s=a.length,l=0;s>l;++l){var u=a[l];if(u.getPositions().length>1){u.update();var c=u.getMaterial(),h=o[c.type];t(h)||(h=o[c.type]=new Q(c,r,i,n)),h.addPolyline(u)}}}function O(e,t){var r=t.mode,i=t.scene2D.projection;e._mode===r&&e._projection===i&&u.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._projection=i,e._modelMatrix=u.clone(e.modelMatrix),e._createVertexArray=!0)}function R(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var r=[],i=e._polylines.length,n=0,o=0;i>n;++n){var a=e._polylines[n];t(a)&&(a._index=o++,r.push(a))}e._polylines=r}}function L(e){for(var r=e._polylines,i=r.length,n=0;i>n;++n)if(t(r[n])){var o=r[n]._bucket;t(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.release())}}function N(e){for(var t=e._vertexArrays.length,r=0;t>r;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function B(e){for(var r=e._polylines,i=r.length,n=0;i>n;++n)t(r[n])&&r[n]._destroy()}function z(e,t,r){this.count=e,this.offset=t,this.bucket=r}function F(e){return a.dot(a.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersect(s.UNIT_Y)===f.INTERSECTING}var V=E.SHOW_INDEX,k=E.WIDTH_INDEX,U=E.POSITION_INDEX,W=E.MATERIAL_INDEX,G=E.POSITION_SIZE_INDEX,H=E.NUMBER_OF_PROPERTIES,j={texCoordExpandWidthAndShow:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12,pickColor:13},q=function(t){t=e(t,e.EMPTY_OBJECT),this.modelMatrix=u.clone(e(t.modelMatrix,u.IDENTITY)),this._modelMatrix=u.clone(u.IDENTITY),this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(H),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:g.STATIC_DRAW,frameCount:0},{bufferUsage:g.STATIC_DRAW,frameCount:0},{bufferUsage:g.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0};r(q.prototype,{length:{get:function(){return R(this),this._polylines.length}}}),q.prototype.add=function(e){var t=new E(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},q.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,t(e._bucket)){var r=e._bucket;r.shaderProgram=r.shaderProgram&&r.shaderProgram.release(),r.pickShaderProgram=r.pickShaderProgram&&r.pickShaderProgram.release()}return e._destroy(),!0}return!1},q.prototype.removeAll=function(){L(this),B(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},q.prototype.contains=function(e){return t(e)&&e._polylineCollection===this},q.prototype.get=function(e){return R(this),this._polylines[e]},q.prototype.update=function(e,r,i){if(R(this),0!==this._polylines.length){O(this,r);var n,o=this._propertiesChanged;if(this._createVertexArray||P(this))D(this,e);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==w.SCENE3D)for(var s=a.length,l=0;s>l;++l)n=a[l],n.update();if(o[G]||o[W])D(this,e);else for(var c=a.length,h=this._polylineBuckets,d=0;c>d;++d){n=a[d],o=n._propertiesChanged;var m=n._bucket,p=0;for(var f in h)if(h.hasOwnProperty(f)){if(h[f]===m){(o[U]||o[V]||o[k])&&m.writeUpdate(p,n,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer);break}p+=h[f].lengthOfPositions}n._clean()}a.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var g=0;H>g;++g)o[g]=0;var _=u.IDENTITY;r.mode===w.SCENE3D&&(_=this.modelMatrix);var y=r.passes,C=0!==r.morphTime;if(t(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===C||(this._opaqueRS=e.createRenderState({depthMask:C,depthTest:{enabled:C}})),t(this._translucentRS)&&this._translucentRS.depthTest.enabled===C||(this._translucentRS=e.createRenderState({blending:v.ALPHA_BLEND,depthMask:!C,depthTest:{enabled:C}})),y.render){var S=this._colorCommands;A(this,e,r,S,i,_,!0)}if(y.pick){var E=this._pickCommands;A(this,e,r,E,i,_,!1)}}};var Y=new p,X=new p;q.prototype.isDestroyed=function(){return!1},q.prototype.destroy=function(){return N(this),L(this),B(this),o(this)};var Z=[0,0,0],J=[];q.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};var Q=function(e,t,r,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.projection=r,this.ellipsoid=r.ellipsoid,this.modelMatrix=i};Q.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Q.prototype.updateShader=function(e){if(!t(this.shaderProgram)){var r=y({sources:[x,b]}),i=y({sources:[this.material.shaderSource,T]}),n=y({sources:[i],pickColorQualifier:"varying"});this.shaderProgram=e.getShaderCache().getShaderProgram(r,i,j),this.pickShaderProgram=e.getShaderCache().getShaderProgram(r,n,j)}},Q.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===w.SCENE3D||!F(e))return t=e.getPositions().length,4*t-4;var r=0,i=e._segments.lengths;t=i.length;for(var n=0;t>n;++n)r+=4*i[n]-4;return r};var K=new a,$=new a,et=new a,tt=new a;Q.prototype.write=function(e,t,r,i,o,s,u){for(var c=this.mode,h=this.polylines,d=h.length,m=0;d>m;++m)for(var p,f=h[m],v=f.getWidth(),g=f.getShow()&&v>0,_=this.getSegments(f),y=_.positions,C=_.lengths,S=y.length,E=f.getPickId(u).color,x=0,b=0,T=0;S>T;++T){0===T?f._loop?p=y[S-2]:(p=tt,a.subtract(y[0],y[1],p),a.add(y[0],p,p)):p=y[T-1],$.x=p.x,$.y=p.y,$.z=c!==w.SCENE2D?p.z:0,p=y[T],K.x=p.x,K.y=p.y,K.z=c!==w.SCENE2D?p.z:0,T===S-1?f._loop?p=y[1]:(p=tt,a.subtract(y[S-1],y[S-2],p),a.add(y[S-1],p,p)):p=y[T+1],et.x=p.x,et.y=p.y,et.z=c!==w.SCENE2D?p.z:0;var A=C[x];T===b+A&&(b+=A,++x);for(var P=0===T-b,D=T===b+C[x]-1,M=P?2:0,I=D?2:4,O=M;I>O;++O){l.writeElements(K,e,i),l.writeElements($,e,i+6),l.writeElements(et,e,i+12),t[o]=n.floatToByte(E.red),t[o+1]=n.floatToByte(E.green),t[o+2]=n.floatToByte(E.blue),t[o+3]=n.floatToByte(E.alpha);var R=0>O-2?-1:1;r[s]=T/(S-1),r[s+1]=2*(O%2)-1,r[s+2]=R*v,r[s+3]=g,i+=18,o+=4,s+=4}}};var rt=new a,it=new a,nt=new a,ot=new a;Q.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,i=this.polylines,n=i.length,o=0;n>o;++o)for(var s=i[o],c=s._segments.positions,h=s._segments.lengths,d=c.length,m=0,p=0,f=0;d>f;++f){var v;0===f?s._loop?v=c[d-2]:(v=ot,a.subtract(c[0],c[1],v),a.add(c[0],v,v)):v=c[f-1],v=u.multiplyByPoint(r,v,it);var g,_=u.multiplyByPoint(r,c[f],rt);f===d-1?s._loop?g=c[1]:(g=ot,a.subtract(c[d-1],c[d-2],g),a.add(c[d-1],g,g)):g=c[f+1],g=u.multiplyByPoint(r,g,nt);var y=h[m];f===p+y&&(p+=y,++m);for(var C=0===f-p,S=f===p+h[m]-1,w=C?2:0,E=S?2:4,x=w;E>x;++x)l.writeElements(_,e,t),l.writeElements(v,e,t+6),l.writeElements(g,e,t+12),t+=18}};var at=new Array(1);Q.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new z(0,i,this);r[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,h=u.length,d=0;h>d;++d){var m=u[d];m._locatorBuckets=[];var p;if(this.mode===w.SCENE3D){p=at;var f=m.getPositions().length;if(!(f>0))continue;p[0]=f}else p=m._segments.lengths;var v=p.length;if(v>0){for(var g=0,_=0;v>_;++_)for(var y=p[_]-1,C=0;y>C;++C)l+4>=c.SIXTY_FOUR_KILOBYTES-1&&(m._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,i=0,o=new z(0,0,this),r[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,i+=6,l+=4;m._locatorBuckets.push({locator:o,count:g}),l+4>=c.SIXTY_FOUR_KILOBYTES-1&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new z(0,0,this),r[++n]=[o])}m._clean()}return o.count=a,i},Q.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,r=0,i=t.length,n=0;i>n;++n){var o=t[n];if(o===e)break;r+=o._actualLength}return r};var st={positions:void 0,lengths:void 0},lt=new Array(1);Q.prototype.getSegments=function(e){var t=e.getPositions();if(this.mode===w.SCENE3D)return lt[0]=t.length,st.positions=t,st.lengths=lt,st;F(e)&&(t=e._segments.positions);for(var r,i,n=this.ellipsoid,o=this.projection,s=[],l=this.modelMatrix,c=t.length,h=0;c>h;++h)r=t[h],i=u.multiplyByPoint(l,r),s.push(o.project(n.cartesianToCartographic(i)));if(s.length>0){e._boundingVolume2D=p.fromPoints(s,e._boundingVolume2D);var d=e._boundingVolume2D.center;e._boundingVolume2D.center=new a(d.z,d.x,d.y)}return st.positions=s,st.lengths=e._segments.lengths,st};var ut,ct;return Q.prototype.writeUpdate=function(e,r,i,n){var o=this.mode,s=r._actualLength;if(s){e+=this.getPolylineStartIndex(r);var u=ut,c=ct,h=3*6*s;!t(u)||u.lengthh&&(u=new Float32Array(u.buffer,0,h),c=new Float32Array(c.buffer,0,4*s));var d,m=0,p=0,f=this.getSegments(r),v=f.positions,g=f.lengths,_=0,y=0,C=r.getWidth(),S=r.getShow()&&C>0;s=v.length;for(var E=0;s>E;++E){0===E?r._loop?d=v[s-2]:(d=tt,a.subtract(v[0],v[1],d),a.add(v[0],d,d)):d=v[E-1],$.x=d.x,$.y=d.y,$.z=o!==w.SCENE2D?d.z:0,d=v[E],K.x=d.x,K.y=d.y,K.z=o!==w.SCENE2D?d.z:0,E===s-1?r._loop?d=v[1]:(d=tt,a.subtract(v[s-1],v[s-2],d),a.add(v[s-1],d,d)):d=v[E+1],et.x=d.x,et.y=d.y,et.z=o!==w.SCENE2D?d.z:0;var x=g[_];E===y+x&&(y+=x,++_);for(var b=0===E-y,T=E===y+g[_]-1,A=b?2:0,P=T?2:4,D=A;P>D;++D){l.writeElements(K,u,m),l.writeElements($,u,m+6),l.writeElements(et,u,m+12);var M=0>D-2?-1:1;c[p]=E/(s-1),c[p+1]=2*(D%2)-1,c[p+2]=M*C,c[p+3]=S,m+=18,p+=4}}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(c,4*Float32Array.BYTES_PER_ELEMENT*e)}},q}),r("DynamicScene/DynamicPathVisualizer",["../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Cartesian3","../Core/Matrix3","../Core/Matrix4","../Core/Color","../Core/Transforms","../Core/ReferenceFrame","./SampledPositionProperty","./CompositePositionProperty","./TimeIntervalCollectionPositionProperty","../Scene/Material","../Scene/SceneMode","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(t,r,i,n,o,a,s,l){var u,c=t._property._times,h=s;u=t.getValueInReferenceFrame(r,o,l[h]),e(u)&&(l[h++]=u);for(var d,m,p,f=!e(n)||n.lessThanOrEquals(r)||n.greaterThanOrEquals(i),v=0,g=c.length,_=c[v],y=i,C=!1;g>v;){if(!f&&_.greaterThanOrEquals(n)&&(u=t.getValueInReferenceFrame(n,o,l[h]),e(u)&&(l[h++]=u),f=!0),_.greaterThan(r)&&_.lessThan(y)&&!_.equals(n)&&(u=t.getValueInReferenceFrame(_,o,l[h]),e(u)&&(l[h++]=u)),g-1>v){if(!C){var S=c[v+1],w=_.getSecondsDifference(S);C=w>a,C&&(d=Math.floor(w/a),m=0,p=w/Math.max(d,2),d=Math.max(d-2,1))}if(C&&d>m){_=_.addSeconds(p),m++;continue}}C=!1,v++,_=c[v]}return u=t.getValueInReferenceFrame(i,o,l[h]),e(u)&&(l[h++]=u),h}function v(t,r,i,n,o,a,s,l){for(var u,c=0,h=s,d=r,m=!e(n)||n.lessThanOrEquals(r)||n.greaterThanOrEquals(i);d.lessThan(i);)!m&&d.greaterThanOrEquals(n)&&(m=!0,u=t.getValueInReferenceFrame(n,o,l[h]),e(u)&&(l[h]=u,h++)),u=t.getValueInReferenceFrame(d,o,l[h]),e(u)&&(l[h]=u,h++),c++,d=r.addSeconds(a*c);return u=t.getValueInReferenceFrame(i,o,l[h]),e(u)&&(l[h]=u,h++),h}function g(t,r,i,n,o,a,s,l){for(var u=s,c=t.getIntervals(),h=0;h0?(h=x.pop(),o=this._polylineCollection.get(h)):(h=this._polylineCollection.length,o=this._polylineCollection.add()),r._pathVisualizerIndex=h,o.id=r,o.setWidth(1);var T=o.getMaterial();e(T)&&T.type===d.PolylineOutlineType||(T=d.fromType(d.PolylineOutlineType),o.setMaterial(T)),E=T.uniforms,a.clone(a.WHITE,E.color),a.clone(a.BLACK,E.outlineColor),E.outlineWidth=0}o.setShow(!0);var A=60;if(s=i._resolution,e(s)&&(A=s.getValue(t)),o.setPositions(y(n,l,u,t,this._referenceFrame,A,o.getPositions())),s=i._color,e(s)&&(E.color=s.getValue(t,E.color)),s=i._outlineColor,e(s)&&(E.outlineColor=s.getValue(t,E.outlineColor)),s=i._outlineWidth,e(s)&&(E.outlineWidth=s.getValue(t)),s=i._width,e(s)){var P=s.getValue(t);e(P)&&o.setWidth(P)}}}},S.prototype.removeObject=function(t){var r=t._pathVisualizerIndex;if(e(r)){var i=this._polylineCollection.get(r);i.setShow(!1),this._unusedIndexes.push(r),t._pathVisualizerIndex=void 0}},S.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)};var w=function(e,t){this._scene=e,this._updaters={},this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};return w.prototype.getScene=function(){return this._scene},w.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},w.prototype.setDynamicObjectCollection=function(t){var r=this._dynamicObjectCollection;r!==t&&(e(r)&&(r.collectionChanged.removeEventListener(w.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=t,e(t)&&t.collectionChanged.addEventListener(w.prototype._onObjectsRemoved,this))},w.prototype.update=function(t){if(e(this._dynamicObjectCollection)){var r=this._updaters;for(var i in r)r.hasOwnProperty(i)&&r[i].update(t);for(var n=this._dynamicObjectCollection.getObjects(),o=0,a=n.length;a>o;o++){var s=n[o];if(e(s._path)){var u=s._position;if(e(u)){var c=s._pathUpdater,h=l.FIXED;this._scene.mode===m.SCENE3D&&(h=u._referenceFrame);var d=this._updaters[h];c===d&&e(d)?d.updateObject(t,s):(e(c)&&c.removeObject(s),e(d)||(d=new S(this._scene,h),d.update(t),this._updaters[h]=d),s._pathUpdater=d,e(d)&&d.updateObject(t,s))}}}}},w.prototype.removeAllPrimitives=function(){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].destroy();if(this._updaters={},e(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=i.length-1;n>-1;n--)i[n]._pathUpdater=void 0,i[n]._pathVisualizerIndex=void 0},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),r(this)},w.prototype._onObjectsRemoved=function(t,r,i){for(var n=i.length-1;n>-1;n--){var o=i[n],a=o._pathUpdater;e(a)&&a.removeObject(o)}},w}),r("DynamicScene/DynamicPointVisualizer",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/BillboardCollection","../Renderer/TextureAtlasBuilder"],function(e,t,r,i,n,o,a){"use strict";function s(i,n,o){var a=o._point;if(r(a)){var s=o._position;if(r(s)){var l,m=a._show,p=o._pointVisualizerIndex,f=o.isAvailable(n)&&(!r(m)||m.getValue(n));if(!f)return r(p)&&(l=i._billboardCollection.get(p),l.setShow(!1),l.setImageIndex(-1),o._pointVisualizerIndex=void 0,i._unusedIndexes.push(p)),void 0;var v=!1;if(r(p))l=i._billboardCollection.get(p);else{var g=i._unusedIndexes,_=g.length;_>0?(p=g.pop(),l=i._billboardCollection.get(p)):(p=i._billboardCollection.length,l=i._billboardCollection.add()),o._pointVisualizerIndex=p,l.id=o,l._visualizerColor=e.clone(e.WHITE,l._visualizerColor),l._visualizerOutlineColor=e.clone(e.BLACK,l._visualizerOutlineColor),l._visualizerOutlineWidth=0,l._visualizerPixelSize=1,v=!0}l.setShow(!0),c=s.getValue(n,c),r(c)&&l.setPosition(c);var y=a._color;if(r(y)&&(u=y.getValue(n,u),e.equals(l._visualizerColor,u)||(e.clone(u,l._visualizerColor),v=!0)),y=a._outlineColor,r(y)&&(h=y.getValue(n,h),e.equals(l._visualizerOutlineColor,h)||(e.clone(h,l._visualizerOutlineColor),v=!0)),y=a._outlineWidth,r(y)){var C=y.getValue(n);l._visualizerOutlineWidth!==C&&(l._visualizerOutlineWidth=C,v=!0)}if(y=a._pixelSize,r(y)){var S=y.getValue(n);l._visualizerPixelSize!==S&&(l._visualizerPixelSize=S,v=!0)}if(y=a._scaleByDistance,r(y)&&(d=y.getValue(n,d),r(d)&&l.setScaleByDistance(d)),v){var w=t(l._visualizerColor,e.WHITE).toCssColorString(),E=t(l._visualizerOutlineColor,e.BLACK).toCssColorString(),x=t(l._visualizerPixelSize,3),b=t(l._visualizerOutlineWidth,2),T=JSON.stringify([w,x,E,b]);i._textureAtlasBuilder.addTextureFromFunction(T,function(e,t){var r=document.createElement("canvas"),i=x+2*b;r.height=r.width=i;var n=r.getContext("2d");n.clearRect(0,0,i,i),0!==b&&(n.beginPath(),n.arc(i/2,i/2,i/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=E,n.fill()),n.beginPath(),n.arc(i/2,i/2,x/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=w,n.fill(),t(r)},function(e){l.setImageIndex(e)})}}}}var l=function(e,t){this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=void 0; +var r=this._billboardCollection=new o,i=this._textureAtlas=e.context.createTextureAtlas();this._textureAtlasBuilder=new a(i),r.textureAtlas=i,e.primitives.add(r),this.setDynamicObjectCollection(t)};l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(e){if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,n=t.length;n>i;i++)s(this,e,t[i])},l.prototype.removeAllPrimitives=function(){if(this._unusedIndexes=[],this._billboardCollection.removeAll(),r(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),t=e.length-1;t>-1;t--)e[t]._pointVisualizerIndex=void 0},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._billboardCollection),i(this)};var u,c,h,d;return l.prototype._onObjectsRemoved=function(e,t,i){for(var n=this._billboardCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._pointVisualizerIndex;if(r(l)){var u=n.get(l);u.setShow(!1),u.setImageIndex(-1),s._pointVisualizerIndex=void 0,o.push(l)}}},l}),r("DynamicScene/DynamicPyramidVisualizer",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Cartesian3","../Core/Color","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Scene/CustomSensorVolume","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(r,i,d){var p=d._pyramid;if(t(p)){var g=p._directions;if(t(g)){var _=d._position;if(t(_)){var y=d._orientation;if(t(y)){var C,S=p._show,w=d._pyramidVisualizerIndex,E=d.isAvailable(i)&&(!t(S)||S.getValue(i));if(!E)return t(w)&&(C=r._pyramidCollection[w],C.show=!1,d._pyramidVisualizerIndex=void 0,r._unusedIndexes.push(w)),void 0;if(t(w))C=r._pyramidCollection[w];else{var x=r._unusedIndexes,b=x.length;b>0?(w=x.pop(),C=r._pyramidCollection[w]):(w=r._pyramidCollection.length,C=new u,r._pyramidCollection.push(C),r._primitives.add(C)),d._pyramidVisualizerIndex=w,C.id=d,C.radius=Number.POSITIVE_INFINITY,C.showIntersection=!0,C.intersectionColor=o.YELLOW,C.intersectionWidth=5,C.material=c.fromType(c.ColorType)}C.show=!0;var T=g.getValue(i);t(T)&&C._visualizerDirections!==T&&(C.setDirections(T),C._visualizerDirections=T),f=e(_.getValue(i,f),C._visualizerPosition),v=e(y.getValue(i,v),C._visualizerOrientation),!t(f)||!t(v)||n.equals(f,C._visualizerPosition)&&l.equals(v,C._visualizerOrientation)||(s.fromRotationTranslation(a.fromQuaternion(v,m),f,C.modelMatrix),n.clone(f,C._visualizerPosition),l.clone(v,C._visualizerOrientation)),C.material=h.getValue(i,p._material,C.material);var A=p._intersectionColor;if(t(A)){var P=A.getValue(i,P);t(P)&&(C.intersectionColor=P)}if(A=p._intersectionWidth,t(A)){var D=A.getValue(i,D);t(D)&&(C.intersectionWidth=D)}if(A=p._radius,t(A)){var M=A.getValue(i,M);t(M)&&(C.radius=M)}}}}}}var m=new a,p=function(e,t){this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives,this._pyramidCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};p.prototype.getScene=function(){return this._scene},p.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},p.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(p.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(p.prototype._onObjectsRemoved,this))},p.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)d(this,e,r[i])},p.prototype.removeAllPrimitives=function(){var e,r;for(e=0,r=this._pyramidCollection.length;r>e;e++)this._primitives.remove(this._pyramidCollection[e]);if(t(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._pyramidVisualizerIndex=void 0}this._unusedIndexes=[],this._pyramidCollection=[]},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),i(this)};var f,v;return p.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._pyramidCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._pyramidVisualizerIndex;if(t(l)){var u=n[l];u.show=!1,o.push(l),s._pyramidVisualizerIndex=void 0}}},p}),r("DynamicScene/DynamicVectorVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Cartesian3","../Core/Color","../Scene/Material","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,a){var s=a._vector;if(t(s)){var l,u=s._show,c=a._position,h=s._direction,d=s._length,m=a._vectorVisualizerIndex,p=a.isAvailable(r)&&(!t(u)||u.getValue(r));if(!(p&&t(h)&&t(c)&&t(d)))return t(m)&&(l=e._polylineCollection.get(m),l.setShow(!1),a._vectorVisualizerIndex=void 0,e._unusedIndexes.push(m)),void 0;var f;if(t(m))l=e._polylineCollection.get(m),f=l.getMaterial().uniforms;else{var v=e._unusedIndexes;v.length>0?(m=v.pop(),l=e._polylineCollection.get(m)):(m=e._polylineCollection.length,l=e._polylineCollection.add(),l._visualizerPositions=[new i,new i]),a._vectorVisualizerIndex=m,l.id=a,l.setWidth(1);var g=l.getMaterial();t(g)&&g.type===o.PolylineArrowType||(g=o.fromType(o.PolylineArrowType),l.setMaterial(g)),f=g.uniforms,n.clone(n.WHITE,f.color)}l.setShow(!0);var _=l._visualizerPositions,y=c.getValue(r,_[0]),C=h.getValue(r,_[1]),S=d.getValue(r);t(y)&&t(C)&&t(S)&&(i.add(y,i.multiplyByScalar(i.normalize(C,C),S,C),C),l.setPositions(_));var w=s._color;if(t(w)&&(f.color=w.getValue(r,f.color)),w=s._width,t(w)){var E=w.getValue(r);t(E)&&l.setWidth(E)}}}var l=function(e,t){this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives;var r=this._polylineCollection=new a;e.primitives.add(r),this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};return l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)s(this,e,r[i])},l.prototype.removeAllPrimitives=function(){var e;if(this._polylineCollection.removeAll(),t(this._dynamicObjectCollection)){var r=this._dynamicObjectCollection.getObjects();for(e=r.length-1;e>-1;e--)r[e]._vectorVisualizerIndex=void 0}this._unusedIndexes=[]},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._polylineCollection),r(this)},l.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._polylineCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._vectorVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),o.push(l),s._vectorVisualizerIndex=void 0}}},l}),r("Scene/Appearance",["../Core/clone","../Core/defaultValue","../Core/defined","../Renderer/BlendingState","../Renderer/CullFace","../Renderer/createShaderSource"],function(e,t,r,i,n,o){"use strict";var a=function(e){e=t(e,t.EMPTY_OBJECT),this.material=e.material,this.vertexShaderSource=e.vertexShaderSource,this.fragmentShaderSource=e.fragmentShaderSource,this.renderState=e.renderState,this.translucent=t(e.translucent,!0),this.closed=t(e.closed,!1)};return a.prototype.getFragmentShaderSource=function(){return o({defines:[this.flat?"FLAT":"",this.faceForward?"FACE_FORWARD":""],sources:[r(this.material)?this.material.shaderSource:"",this.fragmentShaderSource]})},a.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},a.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=i.ALPHA_BLEND):r.depthMask=!0,r},a.getDefaultRenderState=function(e,t){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=i.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:n.BACK}),r},a}),r("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/freezeObject","../Core/VertexFormat","./Material","./Appearance","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/AllMaterialAppearanceFS"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),a=e(r.closed,!1),s=e(r.materialSupport,d.MaterialSupport.TEXTURED);this.material=t(r.material)?r.material:n.fromType(n.ColorType),this.vertexShaderSource=e(r.vertexShaderSource,s.vertexShaderSource),this.fragmentShaderSource=e(r.fragmentShaderSource,s.fragmentShaderSource),this.renderState=e(r.renderState,o.getDefaultRenderState(i,a)),this.materialSupport=s,this.vertexFormat=s.vertexFormat,this.flat=e(r.flat,!1),this.faceForward=e(r.faceForward,!a),this.translucent=i,this.closed=a};return d.prototype.getFragmentShaderSource=o.prototype.getFragmentShaderSource,d.prototype.isTranslucent=o.prototype.isTranslucent,d.prototype.getRenderState=o.prototype.getRenderState,d.MaterialSupport={BASIC:r({vertexFormat:i.POSITION_AND_NORMAL,vertexShaderSource:a,fragmentShaderSource:s}),TEXTURED:r({vertexFormat:i.POSITION_NORMAL_AND_ST,vertexShaderSource:l,fragmentShaderSource:u}),ALL:r({vertexFormat:i.ALL,vertexShaderSource:c,fragmentShaderSource:h})},d}),r("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),r("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),r("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/VertexFormat","./Appearance","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){t=e(t,e.EMPTY_OBJECT);var l=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?o:i,d=c?a:n,m=c?s.FLAT_VERTEX_FORMAT:s.VERTEX_FORMAT;this.material=void 0,this.vertexShaderSource=e(t.vertexShaderSource,h),this.fragmentShaderSource=e(t.fragmentShaderSource,d),this.renderState=e(t.renderState,r.getDefaultRenderState(l,u)),this.vertexFormat=m,this.flat=c,this.faceForward=e(t.faceForward,!u),this.translucent=l,this.closed=u};return s.VERTEX_FORMAT=t.POSITION_AND_NORMAL,s.FLAT_VERTEX_FORMAT=t.POSITION_ONLY,s.prototype.getFragmentShaderSource=r.prototype.getFragmentShaderSource,s.prototype.isTranslucent=r.prototype.isTranslucent,s.prototype.getRenderState=r.prototype.getRenderState,s}),r("Renderer/VertexLayout",["../Core/Enumeration"],function(e){"use strict";var t={SEPARATE:new e(0,"SEPARATE"),INTERLEAVED:new e(1,"INTERLEAVED"),validate:function(e){return e===t.SEPARATE||e===t.INTERLEAVED}};return t}),r("Scene/PrimitivePipeline",["../Core/defined","../Core/defaultValue","../Core/Color","../Core/ComponentDatatype","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/Matrix4"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r){var i,n=!r,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(i=1;o>i;++i)if(!u.equals(a,e[i].modelMatrix)){n=!0;break}}if(n)for(i=0;o>i;++i)l.transformToWorldCoordinates(e[i]);else u.clone(e[0].modelMatrix,t)}function h(e,t){for(var n=e.length,o=0;n>o;++o){var a=e[o],l=a.geometry,u=l.attributes,c=u.position,h=4*(c.values.length/c.componentsPerAttribute);u.pickColor=new s({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(h)});for(var d=t[o],m=r.floatToByte(d.red),p=r.floatToByte(d.green),f=r.floatToByte(d.blue),v=r.floatToByte(d.alpha),g=u.pickColor.values,_=0;h>_;_+=4)g[_]=m,g[_+1]=p,g[_+2]=f,g[_+3]=v}}function d(t){var r,i=t.length,n=[],o=t[0].attributes;for(r in o)if(o.hasOwnProperty(r)){for(var a=o[r],s=!0,l=1;i>l;++l){var u=t[l].attributes[r];if(!e(u)||a.componentDatatype.value!==u.componentDatatype.value||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&n.push(r)}return n}function m(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],l=o.attributes,u=o.geometry,c=a.computeNumberOfVertices(u),h=t.length,d=0;h>d;++d){for(var m=t[d],p=l[m],f=p.componentDatatype,v=p.value,g=v.length,_=i.createTypedArray(f,c*g),y=0;c>y;++y)_.set(v,y*g);u.attributes[m]=new s({componentDatatype:f,componentsPerAttribute:g,normalize:p.normalize,values:_})}}function p(e){var t,r=e.instances,n=e.pickIds,o=e.projection,a=e.elementIndexUintSupported,s=e.allow3DOnly,u=e.allowPicking,p=e.vertexCacheOptimize,f=e.modelMatrix,v=r.length;if(r[0].geometry.primitiveType,c(r,f,s),!s)for(t=0;v>t;++t)l.wrapLongitude(r[t].geometry);u&&h(r,n);var g=d(r);if(m(r,g),p)for(t=0;v>t;++t)l.reorderForPostVertexCache(r[t].geometry),l.reorderForPreVertexCache(r[t].geometry);var _,y=l.combine(r),C=y.attributes;if(s)for(_ in C)C.hasOwnProperty(_)&&C[_].componentDatatype.value===i.DOUBLE.value&&l.encodeAttribute(y,_,_+"3DHigh",_+"3DLow");else for(_ in C)if(C.hasOwnProperty(_)&&C[_].componentDatatype.value===i.DOUBLE.value){var S=_+"3D",w=_+"2D";l.projectTo2D(y,_,S,w,o),l.encodeAttribute(y,S,S+"High",S+"Low"),l.encodeAttribute(y,w,w+"High",w+"Low")}return a?[y]:l.fitToUnsignedShortIndices(y)}function f(e,t,r){for(var n=[],o=e.attributes,a=r.length,s=0;a>s;++s){var l=r[s],u=o[l],c=u.componentDatatype;c.value===i.DOUBLE.value&&(c=i.FLOAT);var h=i.createTypedArray(c,u.values);n.push({index:t[l],componentDatatype:c,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:h}),delete o[l]}return n}function v(r,i,n){for(var o=[],s=d(r),l=r.length,u={},c={},h=0;l>h;++h)for(var m=r[h],p=a.computeNumberOfVertices(m.geometry),f=s.length,v=0;f>v;++v)for(var g=s[v],_=n[g],y=p;y>0;){for(var C,S=t(c[g],0),w=i[S],E=w.length,x=0;E>x&&(C=w[x],C.index!==_);++x);e(o[h])||(o[h]={}),e(o[h][g])||(o[h][g]={dirty:!1,value:m.attributes[g].value,indices:[]});var b,T=C.values.length/C.componentsPerAttribute,A=t(u[g],0);T>A+y?(b=y,o[h][g].indices.push({attribute:C,offset:A,count:b}),u[g]=A+y):(b=T-A,o[h][g].indices.push({attribute:C,offset:A,count:b}),u[g]=0,c[g]=S+1),y-=b}return o}function g(t){return e(t.constructor.name)?{type:t.constructor.name,buffer:t.buffer}:t}function _(t){return e(t.type)?new C[t.type](t.buffer):t}if(!o.supportsTypedArrays())return{};var y={};y.combineGeometry=function(e){for(var t={instances:e.instances,pickIds:e.pickIds,ellipsoid:e.ellipsoid,projection:e.projection,elementIndexUintSupported:e.elementIndexUintSupported,allow3DOnly:e.allow3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:u.clone(e.modelMatrix)},r=p(t),i=l.createAttributeLocations(r[0]),n=t.instances,o=d(n),a=[],s=r.length,c=0;s>c;++c){var h=r[c];a.push(f(h,i,o))}var m=v(n,a,i);return{geometries:r,modelMatrix:t.modelMatrix,attributeLocations:i,vaAttributes:a,vaAttributeLocations:m}};var C={Int8Array:Int8Array,Uint8Array:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};return y.transferGeometry=function(t,r){var i,n=t.attributes;for(var a in n)n.hasOwnProperty(a)&&e(n[a])&&e(n[a].values)&&(i=n[a].values,o.supportsTransferringArrayBuffers()&&r.indexOf(n[a].values.buffer)<0&&r.push(i.buffer),e(i.type)||(n[a].values=g(i)));e(t.indices)&&(i=t.indices,o.supportsTransferringArrayBuffers()&&r.push(i.buffer),e(i.type)||(t.indices=g(t.indices)))},y.transferGeometries=function(e,t){for(var r=e.length,i=0;r>i;++i)y.transferGeometry(e[i],t)},y.transferPerInstanceAttributes=function(e,t){for(var r=e.length,i=0;r>i;++i)for(var n=e[i],a=n.length,s=0;a>s;++s){var l=n[s].values;o.supportsTransferringArrayBuffers()&&t.push(l.buffer),n[s].values=g(l)}},y.transferInstances=function(e,t){for(var r=e.length,i=0;r>i;++i){var n=e[i];y.transferGeometry(n.geometry,t)}},y.receiveGeometry=function(t){var r=t.attributes;for(var i in r)r.hasOwnProperty(i)&&e(r[i])&&e(r[i].values)&&(r[i].values=_(r[i].values));e(t.indices)&&(t.indices=_(t.indices))},y.receiveGeometries=function(e){for(var t=e.length,r=0;t>r;++r)y.receiveGeometry(e[r])},y.receivePerInstanceAttributes=function(e){for(var t=e.length,r=0;t>r;++r)for(var i=e[r],n=i.length,o=0;n>o;++o)i[o].values=_(i[o].values)},y.receiveInstances=function(e){for(var t=e.length,r=0;t>r;++r){var i=e[r];y.receiveGeometry(i.geometry)}},y}),r("Scene/PrimitiveState",["../Core/Enumeration"],function(e){"use strict";var t={READY:new e(0,"READY"),CREATING:new e(1,"CREATING"),CREATED:new e(2,"CREATED"),COMBINING:new e(3,"COMBINING"),COMBINED:new e(4,"COMBINED"),COMPLETE:new e(5,"COMPLETE"),FAILED:new e(6,"FAILED")};return t}),r("Scene/Primitive",["../Core/BoundingSphere","../Core/clone","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/Matrix4","../Core/TaskProcessor","../Core/GeographicProjection","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/CullFace","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/VertexLayout","./PrimitivePipeline","./PrimitiveState","./SceneMode","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T){"use strict";function A(e){return new c({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function P(t){var r=t.attributes,i=new h;for(var o in r)r.hasOwnProperty(o)&&n(r[o])&&(i[o]=A(r[o]));var a;if(n(t.indices)){var s=t.indices;a=new s.constructor(s)}return new u({attributes:i,indices:a,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function D(e){return new m({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function M(e,t){var r=e.attributes,i={};for(var n in r)r.hasOwnProperty(n)&&(i[n]=D(r[n]));return new d({geometry:t,modelMatrix:p.clone(e.modelMatrix),attributes:i})}function I(e,t){for(var r,i="",n="",o="";null!==(r=V.exec(t));){var a=r[1],s="vec4 czm_compute"+a[0].toUpperCase()+a.substr(1)+"()";"vec4 czm_computePosition()"!==s&&(i+=s+";\n"),e.allow3DOnly?o+=s+"\n"+"{\n"+" return czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow);\n"+"}\n\n":(n+="attribute vec3 "+a+"2DHigh;\n"+"attribute vec3 "+a+"2DLow;\n",o+=s+"\n"+"{\n"+" vec4 p;\n"+" if (czm_morphTime == 1.0)\n"+" {\n"+" p = czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow);\n"+" }\n"+" else if (czm_morphTime == 0.0)\n"+" {\n"+" p = czm_translateRelativeToEye("+a+"2DHigh.zxy, "+a+"2DLow.zxy);\n"+" }\n"+" else\n"+" {\n"+" p = czm_columbusViewMorph(\n"+" czm_translateRelativeToEye("+a+"2DHigh.zxy, "+a+"2DLow.zxy),\n"+" czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow),\n"+" czm_morphTime);\n"+" }\n"+" return p;\n"+"}\n\n")}return _({sources:[i,n,t,o]})}function O(e){var t=e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),r="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+r}function R(e,t){if(!n(e._attributeLocations.show))return t;var r=t.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_non_show_main()"),i="attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}";return r+"\n"+i}function L(e){e.getVertexAttributes()}function N(e,t,r){for(var o=[],a=r.length,s=0;a>s;++s){var l={primitive:i(r[s].pickPrimitive,t)};n(r[s].id)&&(l.id=r[s].id);var u=e.createPickId(l);t._pickIds.push(u),o.push(u.color)}return o}function B(e,t){return function(){return t[e].value}}function z(e,t,r){return function(i){var n=t[e];n.value=i,n.dirty||(r.push(n),n.dirty=!0)}}var F=function(e){e=i(e,i.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=p.clone(p.IDENTITY),this._modelMatrix=new p,this.show=i(e.show,!0),this.vertexCacheOptimize=i(e.vertexCacheOptimize,!1),this.releaseGeometryInstances=i(e.releaseGeometryInstances,!0),this.allow3DOnly=i(e.allow3DOnly,!1),this.allowPicking=i(e.allowPicking,!0),this.asynchronous=i(e.asynchronous,!0),this.debugShowBoundingVolume=i(e.debugShowBoundingVolume,!1),this._translucent=void 0,this._state=x.READY,this._createdGeometries=[],this._geometries=[],this._vaAttributes=void 0,this._error=void 0,this._boundingSphere=void 0,this._boundingSphereWC=void 0,this._boundingSphereCV=void 0,this._boundingSphere2D=void 0,this._perInstanceAttributeLocations=void 0,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._dirtyAttributes=[],this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[]},V=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g,k=new f("taskDispatcher",Number.POSITIVE_INFINITY);return F.prototype.update=function(i,o,a){if(!(!this.show||!n(this.geometryInstances)&&0===this._va.length||n(this.geometryInstances)&&l(this.geometryInstances)&&0===this.geometryInstances.length||!n(this.appearance)||o.mode!==b.SCENE3D&&this.allow3DOnly||!o.passes.render&&!o.passes.pick)){var s,u,c,h,d,m,f,A,D,B,z,F,V,U=o.scene2D.projection,W=this.allowPicking,G=this;if(this._state!==x.COMPLETE&&this._state!==x.COMBINED)if(this.asynchronous){if(this._state===x.FAILED)throw this._error;if(this._state===x.READY){z=l(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],m=z.length;var H=[];for(f=0;m>f;++f)c=z[f].geometry,this._instanceIds.push(z[f].id),n(c.attributes)&&n(c.primitiveType)?this._createdGeometries.push({geometry:P(c),index:f}):H.push(k.scheduleTask({task:c._workerName,geometry:c,index:f}));this._state=x.CREATING,T.all(H,function(e){G._geometries=e,G._state=x.CREATED},function(e){G._error=e,G._state=x.FAILED})}else if(this._state===x.CREATED){for(z=l(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],F=new Array(z.length),V=this._geometries.concat(this._createdGeometries),m=V.length,f=0;m>f;++f)c=V[f],D=c.index,F[D]=M(z[D],c.geometry);m=F.length;var j=[];E.transferInstances(F,j),B=k.scheduleTask({task:"combineGeometry",instances:F,pickIds:W?N(i,this,z):void 0,ellipsoid:U.ellipsoid,isGeographic:U instanceof v,elementIndexUintSupported:i.getElementIndexUint(),allow3DOnly:this.allow3DOnly,allowPicking:W,vertexCacheOptimize:this.vertexCacheOptimize,modelMatrix:this.modelMatrix},j),this._state=x.COMBINING,T(B,function(e){E.receiveGeometries(e.geometries),E.receivePerInstanceAttributes(e.vaAttributes),G._geometries=e.geometries,G._attributeLocations=e.attributeLocations,G._vaAttributes=e.vaAttributes,G._perInstanceAttributeLocations=e.vaAttributeLocations,p.clone(e.modelMatrix,G.modelMatrix),G._state=x.COMBINED},function(e){G._error=e,G._state=x.FAILED})}}else{for(z=l(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],m=z.length,V=this._createdGeometries,f=0;m>f;++f)c=z[f].geometry,this._instanceIds.push(z[f].id),n(c.attributes)&&n(c.primitiveType)?V.push({geometry:P(c),index:f}):V.push({geometry:c.constructor.createGeometry(c),index:f});for(F=new Array(z.length),m=V.length,f=0;m>f;++f)c=V[f],D=c.index,F[D]=M(z[D],c.geometry);var q=E.combineGeometry({instances:F,pickIds:W?N(i,this,z):void 0,ellipsoid:U.ellipsoid,projection:U,elementIndexUintSupported:i.getElementIndexUint(),allow3DOnly:this.allow3DOnly,allowPicking:W,vertexCacheOptimize:this.vertexCacheOptimize,modelMatrix:this.modelMatrix});this._geometries=q.geometries,this._attributeLocations=q.attributeLocations,this._vaAttributes=q.vaAttributes,this._perInstanceAttributeLocations=q.vaAttributeLocations,p.clone(q.modelMatrix,this.modelMatrix),this._state=x.COMBINED}var Y=this._attributeLocations;if(this._state===x.COMBINED){V=this._geometries;var X=this._vaAttributes;this._boundingSphere=e.clone(V[0].boundingSphere);var Z=[];for(m=V.length,f=0;m>f;++f){c=V[f],h=X[f];var J=h.length;for(A=0;J>A;++A)d=h[A],d.vertexBuffer=i.createVertexBuffer(d.values,g.DYNAMIC_DRAW),delete d.values;Z.push(i.createVertexArrayFromGeometry({geometry:c,attributeLocations:Y,bufferUsage:g.STATIC_DRAW,vertexLayout:w.INTERLEAVED,vertexArrayAttributes:h}))}this._va=Z,this._primitiveType=V[0].primitiveType,this.releaseGeometryInstances&&(this.geometryInstances=void 0),this._geometries=void 0,this._createdGeometries=void 0,this._state=x.COMPLETE}if(this._state===x.COMPLETE){var Q=this.appearance,K=Q.material,$=!1,et=!1;this._appearance!==Q?(this._appearance=Q,this._material=K,$=!0,et=!0):this._material!==K&&(this._material=K,et=!0);var tt=this._appearance.isTranslucent();this._translucent!==tt&&(this._translucent=tt,$=!0),n(this._material)&&this._material.update(i);var rt=Q.closed&&tt;if($){var it=Q.getRenderState();if(rt){var nt=t(it,!1);nt.cull={enabled:!0,face:y.BACK},this._frontFaceRS=i.createRenderState(nt),nt.cull.face=y.FRONT,this._backFaceRS=i.createRenderState(nt)}else this._frontFaceRS=i.createRenderState(it),this._backFaceRS=this._frontFaceRS; +if(W)this._pickRS=this._backFaceRS;else{var ot=t(it,!1);ot.colorMask={red:!1,green:!1,blue:!1,alpha:!1},this._pickRS=i.createRenderState(ot)}}if(et){var at=i.getShaderCache(),st=I(this,Q.vertexShaderSource);st=R(this,st);var lt=Q.getFragmentShaderSource();if(this._sp=at.replaceShaderProgram(this._sp,st,lt,Y),L(this._sp,Y),W){var ut=_({sources:[lt],pickColorQualifier:"varying"});this._pickSP=at.replaceShaderProgram(this._pickSP,O(st),ut,Y)}else this._pickSP=at.getShaderProgram(st,lt,Y);L(this._pickSP,Y)}var ct=this._colorCommands,ht=this._pickCommands;if($||et){var dt=n(K)?K._uniforms:void 0,mt=tt?S.TRANSLUCENT:S.OPAQUE;ct.length=this._va.length*(rt?2:1),ht.length=this._va.length,m=ct.length;var pt=0,ft=0;for(f=0;m>f;++f)rt&&(s=ct[f],n(s)||(s=ct[f]=new C),s.owner=this,s.primitiveType=this._primitiveType,s.vertexArray=this._va[pt],s.renderState=this._backFaceRS,s.shaderProgram=this._sp,s.uniformMap=dt,s.pass=mt,++f),s=ct[f],n(s)||(s=ct[f]=new C),s.owner=this,s.primitiveType=this._primitiveType,s.vertexArray=this._va[pt],s.renderState=this._frontFaceRS,s.shaderProgram=this._sp,s.uniformMap=dt,s.pass=mt,u=ht[ft],n(u)||(u=ht[ft]=new C),u.owner=this,u.primitiveType=this._primitiveType,u.vertexArray=this._va[pt],u.renderState=this._pickRS,u.shaderProgram=this._pickSP,u.uniformMap=dt,u.pass=mt,++ft,++pt}if(this._dirtyAttributes.length>0){for(h=this._dirtyAttributes,m=h.length,f=0;m>f;++f){d=h[f];var vt=d.value,gt=d.indices,_t=gt.length;for(A=0;_t>A;++A){D=gt[A];for(var yt=D.offset,Ct=D.count,St=D.attribute,wt=St.componentDatatype,Et=St.componentsPerAttribute,xt=r.createTypedArray(wt,Ct*Et),bt=0;Ct>bt;++bt)xt.set(vt,bt*Et);var Tt=yt*Et*wt.sizeInBytes;St.vertexBuffer.copyFromArrayView(xt,Tt)}d.dirty=!1}h.length=0}p.equals(this.modelMatrix,this._modelMatrix)||(p.clone(this.modelMatrix,this._modelMatrix),this._boundingSphereWC=e.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC),!this.allow3DOnly&&n(this._boundingSphere)&&(this._boundingSphereCV=e.projectTo2D(this._boundingSphereWC,U,this._boundingSphereCV),this._boundingSphere2D=e.clone(this._boundingSphereCV,this._boundingSphere2D),this._boundingSphere2D.center.x=0));var At;o.mode===b.SCENE3D?At=this._boundingSphereWC:o.mode===b.COLUMBUS_VIEW?At=this._boundingSphereCV:o.mode===b.SCENE2D&&n(this._boundingSphere2D)?At=this._boundingSphere2D:n(this._boundingSphereWC)&&n(this._boundingSphereCV)&&(At=e.union(this._boundingSphereWC,this._boundingSphereCV));var Pt=o.passes;if(Pt.render)for(m=ct.length,f=0;m>f;++f)ct[f].modelMatrix=this.modelMatrix,ct[f].boundingVolume=At,ct[f].debugShowBoundingVolume=this.debugShowBoundingVolume,a.push(ct[f]);if(Pt.pick)for(m=ht.length,f=0;m>f;++f)ht[f].modelMatrix=this.modelMatrix,ht[f].boundingVolume=At,a.push(ht[f])}}},F.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,n=i.length,a=0;n>a;++a){var s=(r+a)%n;if(e===i[s]){t=s;break}}if(-1===t)return void 0;var l=this._perInstanceAttributeLocations[t],u={},c={},h=!1;for(var d in l)l.hasOwnProperty(d)&&(h=!0,c[d]={get:B(d,l),set:z(d,l,this._dirtyAttributes)});return h&&o(u,c),this._lastPerInstanceAttributeIndex=t,u},F.prototype.isDestroyed=function(){return!1},F.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.release(),this._pickSP=this._pickSP&&this._pickSP.release();var r=this._va;for(e=r.length,t=0;e>t;++t)r[t].destroy();this._va=void 0;var i=this._pickIds;for(e=i.length,t=0;e>t;++t)i[t].destroy();return this._pickIds=void 0,a(this)},F}),r("DynamicScene/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=m.fromColor(e.WHITE),S=new p(!0),w=new p(!0),E=new p(!1),x=new p(e.BLACK),b=function(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0},T=function(e){this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(T.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new b(e),this._onDynamicObjectPropertyChanged(e,"ellipse",e.ellipse,void 0)};n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:g}}),n(T.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._dynamicObject;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,o,a=this._dynamicObject,l=a.isAvailable(r),u=new d(l&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof m){var h=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){var i=this._dynamicObject,n=i.isAvailable(r);return new c({id:i,geometry:new l(this._options),attributes:{show:new d(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._dynamicObjectSubscription(),o(this)},T.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"position"===t||"ellipse"===t){var n=this._dynamicObject.ellipse;if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(h.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(h.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._dynamicObject.position,c=n.semiMajorAxis,d=n.semiMinorAxis,p=n.show;if(i(p)&&p.isConstant&&!p.getValue(h.MINIMUM_VALUE)||!i(u)||!i(c)||!i(d))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var f=r(n.material,C),y=f instanceof m;this._materialProperty=f,this._fillProperty=r(o,w),this._showProperty=r(p,S),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var b=n.rotation,T=n.height,A=n.extrudedHeight,P=n.granularity,D=n.stRotation,M=n.numberOfVerticalLines;if(this._isClosed=i(A),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&c.isConstant&&d.isConstant&&v.isConstant(b)&&v.isConstant(T)&&v.isConstant(A)&&v.isConstant(P)&&v.isConstant(D)&&v.isConstant(M)){var I=this._options;I.vertexFormat=y?_.VERTEX_FORMAT:g.VERTEX_FORMAT,I.center=u.getValue(h.MINIMUM_VALUE,I.center),I.semiMajorAxis=c.getValue(h.MINIMUM_VALUE,I.semiMajorAxis),I.semiMinorAxis=d.getValue(h.MINIMUM_VALUE,I.semiMinorAxis),I.rotation=i(b)?b.getValue(h.MINIMUM_VALUE):void 0,I.height=i(T)?T.getValue(h.MINIMUM_VALUE):void 0,I.extrudedHeight=i(A)?A.getValue(h.MINIMUM_VALUE):void 0,I.granularity=i(P)?P.getValue(h.MINIMUM_VALUE):void 0,I.stRotation=i(D)?D.getValue(h.MINIMUM_VALUE):void 0,I.numberOfVerticalLines=i(M)?M.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new A(e,this)};var A=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._dynamicObject)};return A.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,a=o.ellipse,u=a.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var h=this._options,d=o.position,m=a.semiMajorAxis,p=a.semiMinorAxis,v=a.rotation,C=a.height,S=a.extrudedHeight,w=a.granularity,E=a.stRotation,x=a.numberOfVerticalLines;if(h.center=d.getValue(r,h.center),h.semiMajorAxis=m.getValue(r,h.semiMajorAxis),h.semiMinorAxis=p.getValue(r,h.semiMinorAxis),h.rotation=i(v)?v.getValue(r,h):void 0,h.height=i(C)?C.getValue(r,h):void 0,h.extrudedHeight=i(S)?S.getValue(r,h):void 0,h.granularity=i(w)?w.getValue(r):void 0,h.stRotation=i(E)?E.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){this._material=f.getValue(r,n.fillMaterialProperty,this._material);var b=this._material,T=new g({material:b,translucent:b.isTranslucent(),closed:i(h.extrudedHeight)});h.vertexFormat=T.vertexFormat,this._primitive=new y({geometryInstances:new c({id:o,geometry:new s(h)}),appearance:T,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){h.vertexFormat=_.VERTEX_FORMAT,h.numberOfVerticalLines=i(x)?x.getValue(r):void 0;var A=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new y({geometryInstances:new c({id:o,geometry:new l(h),attributes:{color:t.fromColor(A)}}),appearance:new _({flat:!0,translucent:1!==A.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},T}),r("DynamicScene/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix3","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/PrimitiveState","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x){"use strict";var b,T,A,P,D=v.fromColor(t.WHITE),M=new g(!0),I=new g(!0),O=new g(!1),R=new g(t.BLACK),L=new e(1,1,1),N=function(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0},B=function(e,t){this._scene=t,this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(B.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new N(e),this._onDynamicObjectPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)};o(B,{perInstanceColorAppearanceType:{value:S},materialAppearanceType:{value:C}}),o(B.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),B.prototype.isOutlineVisible=function(e){var t=this._dynamicObject;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},B.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},B.prototype.createFillGeometryInstance=function(e){var i,o,a=this._dynamicObject,s=a.isAvailable(e),u=new f(s&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof v){var c=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(e)),o=r.fromColor(c),i={show:u,color:o}}else i={show:u};return b=a.position.getValue(d.MINIMUM_VALUE,b),T=a.orientation.getValue(d.MINIMUM_VALUE,T),P=m.fromQuaternion(T,P),new h({id:a,geometry:new l(this._options),modelMatrix:p.fromRotationTranslation(P,b),attributes:i})},B.prototype.createOutlineGeometryInstance=function(e){var i=this._dynamicObject,n=i.isAvailable(e);return b=i.position.getValue(d.MINIMUM_VALUE,b),T=i.orientation.getValue(d.MINIMUM_VALUE,T),P=m.fromQuaternion(T,P),new h({id:i,geometry:new u(this._options),modelMatrix:p.fromRotationTranslation(P,b),attributes:{show:new f(n&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(n?this._outlineColorProperty.getValue(e):t.BLACK)}})},B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){this._dynamicObjectSubscription(),a(this)},B.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var r=this._dynamicObject.ellipsoid;if(!n(r))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=r.fill,a=n(o)&&o.isConstant?o.getValue(d.MINIMUM_VALUE):!0,s=r.outline,l=n(s);if(l&&s.isConstant&&(l=s.getValue(d.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._dynamicObject.position,c=this._dynamicObject.orientation,h=r.radii,m=r.show;if(n(m)&&m.isConstant&&!m.getValue(d.MINIMUM_VALUE)||!n(u)||!n(c)||!n(h))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var p=i(r.material,D),f=p instanceof v;this._materialProperty=p,this._fillProperty=i(o,I),this._showProperty=i(m,M),this._showOutlineProperty=i(r.outline,O),this._outlineColorProperty=l?i(r.outlineColor,R):void 0,this._fillEnabled=a,this._outlineEnabled=l;var g=r.stackPartitions,_=r.slicePartitions,w=r.subdivisions;if(u.isConstant&&c.isConstant&&h.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(w)){var E=this._options;E.vertexFormat=f?S.VERTEX_FORMAT:C.VERTEX_FORMAT,E.radii=h.getValue(d.MINIMUM_VALUE,E.radii),E.stackPartitions=n(g)?g.getValue(d.MINIMUM_VALUE):void 0,E.slicePartitions=n(_)?_.getValue(d.MINIMUM_VALUE):void 0,E.subdivisions=n(w)?w.getValue(d.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},B.prototype.createDynamicUpdater=function(e){return new z(e,this)};var z=function(e,t){this._dynamicObject=t._dynamicObject,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new N(t._dynamicObject),this._modelMatrix=new p,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0};return z.prototype.update=function(e){var o=this._dynamicObject,a=o.ellipsoid,s=a.show;if(!o.isAvailable(e)||n(s)&&!s.getValue(e))return n(this._primitive)&&(this._primitive.show=!1),n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1),void 0;var c,d=!n(a.fill)||a.fill.getValue(e),v=n(a.outline)&&a.outline.getValue(e),g=n(a.outlineColor)?a.outlineColor.getValue(e):t.BLACK,y=_.getValue(e,i(a.material,D),this._material);this._material=y;var M=a.stackPartitions,I=a.slicePartitions,O=a.subdivisions,R=n(M)?M.getValue(e):void 0,N=n(I)?I.getValue(e):void 0,B=n(O)?O.getValue(e):void 0,z=this._options,F=this._scene.mode,V=F===x.SCENE3D,k=this._modelMatrix,U=o.position,W=o.orientation,G=a.radii;b=U.getValue(e,b),T=W.getValue(e,T),P=m.fromQuaternion(T,P),A=G.getValue(e,A),k=p.fromRotationTranslation(P,b,k);var H=!V||this._lastSceneMode!==F||!n(this._primitive)||z.stackPartitions!==R||z.slicePartitions!==N||z.subdivisions!==B;if(H)this._removePrimitives(),this._lastSceneMode=F,z.stackPartitions=R,z.slicePartitions=N,z.subdivisions=B,z.radii=V?L:A,this._material=y,y=this._material,c=new C({material:y,translucent:y.isTranslucent(),closed:!0}),z.vertexFormat=c.vertexFormat,this._primitive=new w({geometryInstances:new h({id:o,geometry:new l(z),modelMatrix:V?void 0:k}),appearance:c,asynchronous:!1,attributes:{show:new f(d)}}),this._primitives.add(this._primitive),z.vertexFormat=S.VERTEX_FORMAT,this._outlinePrimitive=new w({geometryInstances:new h({id:o,geometry:new u(z),modelMatrix:V?void 0:k,attributes:{show:new f(v),color:r.fromColor(g)}}),appearance:new S({flat:!0,translucent:1!==g.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive);else if(this._primitive._state===E.COMPLETE){var j=this._primitive;c=j.appearance,c.material=y;var q=this._attributes;n(q)||(q=j.getGeometryInstanceAttributes(o),this._attributes=q),q.show=f.toValue(d,q.show);var Y=this._outlinePrimitive,X=this._outlineAttributes;n(X)||(X=Y.getGeometryInstanceAttributes(o),this._outlineAttributes=X),X.show=f.toValue(v,X.show),X.color=r.toValue(g,X.color)}V&&(A.x=Math.max(A.x,.001),A.y=Math.max(A.y,.001),A.z=Math.max(A.z,.001),k=p.multiplyByScale(k,A,k),this._primitive.modelMatrix=k,this._outlinePrimitive.modelMatrix=k)},z.prototype.isDestroyed=function(){return!1},z.prototype._removePrimitives=function(){n(this._primitive)&&this._primitives.remove(this._primitive),n(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive)},z.prototype.destroy=function(){this._removePrimitives(),a(this)},B}),r("DynamicScene/StaticGeometryColorBatch",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/AssociativeArray","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","../Scene/PrimitiveState"],function(e,t,r,i,n,o,a){"use strict";var s=new e,l=function(e,t,r,n){this.translucent=t,this.appearanceType=r,this.closed=n,this.primitives=e,this.createPrimitive=!1,this.primitive=void 0,this.geometry=new i,this.updaters=new i,this.updatersWithAttributes=new i,this.attributes=new i,this.itemsToRemove=[]};l.prototype.add=function(e,t){var r=e.dynamicObject.id;this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant||this.updatersWithAttributes.set(r,e)},l.prototype.remove=function(e){var t=e.dynamicObject.id;this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t),this.updatersWithAttributes.remove(t)},l.prototype.update=function(e){var i=0,l=this.primitive,u=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),r(l)&&u.remove(l);var c=this.geometry.values;c.length>0&&(l=new o({asynchronous:!1,geometryInstances:c,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),u.add(l)),this.primitive=l,this.createPrimitive=!1}else if(r(l)&&l._state===a.COMPLETE)for(var h=this.updatersWithAttributes.values,d=h.length,m=0;d>m;m++){var p=h[m],f=this.geometry.get(p.dynamicObject.id),v=this.attributes.get(f.id.id);if(r(v)||(v=l.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,v)),!p.fillMaterialProperty.isConstant){var g=p.fillMaterialProperty.color;g.getValue(e,s),v.color=t.toValue(s,v.color),(this.translucent&&255===v.color[3]||!this.translucent&&255!==v.color[3])&&(this.itemsToRemove[i++]=p)}p.hasConstantFill||(v.show=n.toValue(p.isFilled(e),v.show))}this.itemsToRemove.length=i},l.prototype.removeAllPrimitives=function(){var e=this.primitive;r(e)&&(this.primitives.remove(e),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll())};var u=function(e,t,r){this._solidBatch=new l(e,!1,t,r),this._translucentBatch=new l(e,!0,t,r)};return u.prototype.add=function(e,t){var r=t.createFillGeometryInstance(e);255===r.attributes.color.value[3]?this._solidBatch.add(t,r):this._translucentBatch.add(t,r)},u.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},u.prototype.update=function(e){var t,r;this._solidBatch.update(e),this._translucentBatch.update(e);var i=this._solidBatch.itemsToRemove,n=i.length;if(n>0)for(t=0;n>t;t++)r=i[t],this._solidBatch.remove(r),this._translucentBatch.add(r,r.createFillGeometryInstance(e));i=this._translucentBatch.itemsToRemove;var o=i.length;if(o>0)for(t=0;o>t;t++)r=i[t],this._translucentBatch.remove(r),this._solidBatch.add(r,r.createFillGeometryInstance(e));(n>0||o>0)&&(this._solidBatch.update(e),this._translucentBatch.update(e))},u.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},u}),r("DynamicScene/StaticGeometryPerMaterialBatch",["../Core/defined","../Core/AssociativeArray","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","../Scene/Material","../Scene/PrimitiveState","./MaterialProperty"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,i,o){this.primitives=e,this.appearanceType=r,this.materialProperty=i,this.closed=o,this.updaters=new t,this.createPrimitive=!0,this.primitive=void 0,this.geometry=new t,this.material=n.fromType("Color"),this.updatersWithAttributes=new t,this.attributes=new t,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(s.prototype.onMaterialChanged,this)};s.prototype.onMaterialChanged=function(){this.invalidated=!0},s.prototype.isMaterial=function(t){var r=this.materialProperty,i=t.fillMaterialProperty;return i===r?!0:e(r)?r.equals(i):!1},s.prototype.add=function(e,t){var r=t.dynamicObject.id;this.updaters.set(r,t),this.geometry.set(r,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant||this.updatersWithAttributes.set(r,t),this.createPrimitive=!0},s.prototype.remove=function(e){var t=e.dynamicObject.id;return this.createPrimitive=this.updaters.remove(t),this.geometry.remove(t),this.updatersWithAttributes.remove(t),this.createPrimitive},s.prototype.update=function(t){var n=this.primitive,s=this.primitives,l=this.geometry.values;if(this.createPrimitive)e(n)&&s.remove(n),l.length>0&&(n=new i({asynchronous:!1,geometryInstances:l,appearance:new this.appearanceType({material:a.getValue(t,this.materialProperty,this.material),translucent:this.material.isTranslucent(),closed:this.closed})}),s.add(n)),this.primitive=n,this.createPrimitive=!1;else if(e(n)&&n._state===o.COMPLETE){this.primitive.appearance.material=a.getValue(t,this.materialProperty,this.material);for(var u=this.updatersWithAttributes.values,c=u.length,h=0;c>h;h++){var d=u[h],m=this.geometry.get(d.dynamicObject.id),p=this.attributes.get(m.id.id);e(p)||(p=n.getGeometryInstanceAttributes(m.id),this.attributes.set(m.id.id,p)),d.hasConstantFill||(p.show=r.toValue(d.isFilled(t),p.show))}}},s.prototype.destroy=function(){var t=this.primitive,r=this.primitives;e(t)&&r.remove(t),this.removeMaterialSubscription()};var l=function(e,t,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=r};return l.prototype.add=function(e,t){for(var r=this._items,i=r.length,n=0;i>n;n++){var o=r[n];if(o.isMaterial(t))return o.add(e,t),void 0}var a=new s(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);a.add(e,t),r.push(a)},l.prototype.remove=function(e){for(var t=this._items,r=t.length,i=r-1;i>=0;i--){var n=t[i];if(n.remove(e)){0===n.updaters.length&&(t.splice(i,1),n.destroy());break}}},l.prototype.update=function(e){var t,r=this._items,i=r.length;for(t=i-1;t>=0;t--){var n=r[t];if(n.invalidated){r.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;a>s;t++)this.add(o[s]);n.destroy()}}for(t=0;i>t;t++)r[t].update(e)},l.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,r=0;t>r;r++)e[r].destroy();this._items.length=0},l}),r("DynamicScene/StaticOutlineGeometryBatch",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/AssociativeArray","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/PrimitiveState"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,t,r){this.translucent=t,this.appearanceType=r,this.primitives=e,this.createPrimitive=!1,this.primitive=void 0,this.geometry=new i,this.updaters=new i,this.updatersWithAttributes=new i,this.attributes=new i,this.itemsToRemove=[]};l.prototype.add=function(e,t){var r=e.dynamicObject.id;this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant||this.updatersWithAttributes.set(r,e)},l.prototype.remove=function(e){var t=e.dynamicObject.id;this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t),this.updatersWithAttributes.remove(t)};var u=new e;l.prototype.update=function(e){var i=0,l=this.primitive,c=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),r(l)&&c.remove(l);var h=this.geometry.values;h.length>0&&(l=new a({asynchronous:!1,geometryInstances:h,appearance:new o({flat:!0,translucent:this.translucent})}),c.add(l)),this.primitive=l,this.createPrimitive=!1}else if(r(l)&&l._state===s.COMPLETE)for(var d=this.updatersWithAttributes.values,m=d.length,p=0;m>p;p++){var f=d[p],v=this.geometry.get(f.dynamicObject.id),g=this.attributes.get(v.id.id);r(g)||(g=l.getGeometryInstanceAttributes(v.id),this.attributes.set(v.id.id,g));var _=f.outlineColorProperty;_.getValue(e,u),g.color=t.toValue(u,g.color),(this.translucent&&255===g.color[3]||!this.translucent&&255!==g.color[3])&&(this.itemsToRemove[i++]=f),g.show=n.toValue(f.isOutlineVisible(e),g.show)}this.itemsToRemove.length=i},l.prototype.removeAllPrimitives=function(){var e=this.primitive;r(e)&&(this.primitives.remove(e),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll())};var c=function(e,t){this._solidBatch=new l(e,!1,t),this._translucentBatch=new l(e,!0,t)};return c.prototype.add=function(e,t){var r=t.createOutlineGeometryInstance(e);255===r.attributes.color.value[3]?this._solidBatch.add(t,r):this._translucentBatch.add(t,r)},c.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},c.prototype.update=function(e){var t,r;this._solidBatch.update(e),this._translucentBatch.update(e);var i=this._solidBatch.itemsToRemove,n=i.length;if(n>0)for(t=0;n>t;t++)r=i[t],this._solidBatch.remove(r),this._translucentBatch.add(r,r.createOutlineGeometryInstance(e));i=this._translucentBatch.itemsToRemove;var o=i.length;if(o>0)for(t=0;o>t;t++)r=i[t],this._translucentBatch.remove(r),this._solidBatch.add(r,r.createOutlineGeometryInstance(e));(n>0||o>0)&&(this._solidBatch.update(e),this._translucentBatch.update(e))},c.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},c}),r("DynamicScene/GeometryVisualizer",["../Core/AssociativeArray","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticOutlineGeometryBatch"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e._outlineBatch.remove(t),e._closedColorBatch.remove(t),e._closedMaterialBatch.remove(t),e._openColorBatch.remove(t),e._openMaterialBatch.remove(t),e._dynamicBatch.remove(t)}function u(e,t,r){return r.isDynamic?(e._dynamicBatch.add(t,r),void 0):(r.outlineEnabled&&e._outlineBatch.add(t,r),r.fillEnabled&&(r.isClosed?r.fillMaterialProperty instanceof n?e._closedColorBatch.add(t,r):e._closedMaterialBatch.add(t,r):r.fillMaterialProperty instanceof n?e._openColorBatch.add(t,r):e._openMaterialBatch.add(t,r)),void 0)}var c=[],h=function(t){this._primitives=t,this._dynamicUpdaters=new e};h.prototype.add=function(e,t){this._dynamicUpdaters.set(t.dynamicObject.id,t.createDynamicUpdater(this._primitives))},h.prototype.remove=function(e){var r=e.dynamicObject.id,i=this._dynamicUpdaters.get(r);t(i)&&(this._dynamicUpdaters.remove(r),i.destroy())},h.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,r=0,i=t.length;i>r;r++)t[r].update(e)},h.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,r=e.length;r>t;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};var d=function(t,r,i){this._type=t;var n=r.primitives;this._scene=r,this._primitives=n,this._dynamicObjectCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new s(n),this._closedColorBatch=new o(n,t.perInstanceColorAppearanceType,!0),this._closedMaterialBatch=new a(n,t.materialAppearanceType,!0),this._openColorBatch=new o(n,t.perInstanceColorAppearanceType,!1),this._openMaterialBatch=new a(n,t.materialAppearanceType,!1),this._dynamicBatch=new h(n),this._subscriptions=new e,this._updaters=new e,this.setDynamicObjectCollection(i)};return d.prototype.getScene=function(){return this._scene},d.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},d.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&(e.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._onCollectionChanged(e,e.getObjects(),c)))},d.prototype.update=function(e){var t,r,i,n,o=this._addedObjects,a=o.values,s=this._removedObjects,c=s.values,h=this._changedObjects,m=h.values;for(t=c.length-1;t>-1;t--)r=c[t],i=r.id,n=this._updaters.get(i),l(this,n),n.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i); +for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new this._type(r,this._scene),this._updaters.set(i,n),u(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(d._onGeometryChanged,this));for(t=m.length-1;t>-1;t--)r=m[t],i=r.id,n=this._updaters.get(i),l(this,n),u(this,e,n);o.removeAll(),s.removeAll(),h.removeAll(),this._outlineBatch.update(e),this._closedColorBatch.update(e),this._closedMaterialBatch.update(e),this._openColorBatch.update(e),this._openMaterialBatch.update(e),this._dynamicBatch.update(e)},d.prototype.removeAllPrimitives=function(){this._addedObjects.removeAll(),this._removedObjects.removeAll(),this._outlineBatch.removeAllPrimitives(),this._closedColorBatch.removeAllPrimitives(),this._closedMaterialBatch.removeAllPrimitives(),this._openColorBatch.removeAllPrimitives(),this._openMaterialBatch.removeAllPrimitives(),this._dynamicBatch.removeAllPrimitives();for(var e=this._subscriptions.values,t=e.length,r=0;t>r;r++)e[r]();this._subscriptions.removeAll()},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this.removeAllPrimitives(),r(this)},d._onGeometryChanged=function(e){var r=this._removedObjects,i=this._changedObjects,n=e.dynamicObject,o=n.id;t(r.get(o))||t(i.get(o))||i.set(o,n)},d.prototype._onCollectionChanged=function(e,t,r){var i,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(i=r.length-1;i>-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},d}),r("DynamicScene/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PolygonGeometry","../Core/PolygonOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=m.fromColor(e.WHITE),S=new p(!0),w=new p(!0),E=new p(!1),x=new p(e.BLACK),b=function(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy={positions:void 0},this.perPositionHeight=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0},T=function(e){this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(T.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new b(e),this._onDynamicObjectPropertyChanged(e,"polygon",e.polygon,void 0)};n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:g}}),n(T.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._dynamicObject;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,o,a=this._dynamicObject,l=a.isAvailable(r),u=new d(l&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof m){var h=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){var i=this._dynamicObject,n=i.isAvailable(r);return new c({id:i,geometry:new l(this._options),attributes:{show:new d(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._dynamicObjectSubscription(),o(this)},T.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"vertexPositions"===t||"polygon"===t){var n=this._dynamicObject.polygon;if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(h.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(h.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._dynamicObject.vertexPositions,c=n.show;if(i(c)&&c.isConstant&&!c.getValue(h.MINIMUM_VALUE)||!i(u))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,C),p=d instanceof m;this._materialProperty=d,this._fillProperty=r(o,w),this._showProperty=r(c,S),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var f=n.height,y=n.extrudedHeight,b=n.granularity,T=n.stRotation,A=n.perPositionHeight;if(this._isClosed=i(y),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&v.isConstant(f)&&v.isConstant(y)&&v.isConstant(b)&&v.isConstant(T)&&v.isConstant(A)){var P=this._options;P.vertexFormat=p?_.VERTEX_FORMAT:g.VERTEX_FORMAT,P.polygonHierarchy.positions=u.getValue(h.MINIMUM_VALUE,P.polygonHierarchy.positions),P.height=i(f)?f.getValue(h.MINIMUM_VALUE):void 0,P.extrudedHeight=i(y)?y.getValue(h.MINIMUM_VALUE):void 0,P.granularity=i(b)?b.getValue(h.MINIMUM_VALUE):void 0,P.stRotation=i(T)?T.getValue(h.MINIMUM_VALUE):void 0,P.perPositionHeight=i(A)?A.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new A(e,this)};var A=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._dynamicObject)};return A.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,a=o.polygon,u=a.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var h=this._options,d=o.vertexPositions,m=a.perPositionHeight,p=a.height,v=a.extrudedHeight,C=a.granularity,S=a.stRotation;if(h.polygonHierarchy.positions=d.getValue(r,h.polygonHierarchy.positions),h.height=i(p)?p.getValue(r,h):void 0,h.extrudedHeight=i(v)?v.getValue(r,h):void 0,h.granularity=i(C)?C.getValue(r):void 0,h.stRotation=i(S)?S.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){h.perPositionHeight=i(m)?m.getValue(r):void 0,this._material=f.getValue(r,n.fillMaterialProperty,this._material);var w=this._material,E=new g({material:w,translucent:w.isTranslucent(),closed:i(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=new y({geometryInstances:new c({id:o,geometry:new s(h)}),appearance:E,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){h.vertexFormat=_.VERTEX_FORMAT;var x=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new y({geometryInstances:new c({id:o,geometry:new l(h),attributes:{color:t.fromColor(x)}}),appearance:new _({flat:!0,translucent:1!==x.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},T}),r("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),r("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/VertexFormat","./Material","./Appearance","../Renderer/createShaderSource","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineFS","../Shaders/PolylineCommon"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r){r=e(r,e.EMPTY_OBJECT);var c=e(r.translucent,!0),h=!1,d=o({sources:[l,a]}),m=s,p=u.VERTEX_FORMAT;this.material=t(r.material)?r.material:i.fromType(i.ColorType),this.vertexShaderSource=e(r.vertexShaderSource,d),this.fragmentShaderSource=e(r.fragmentShaderSource,m),this.renderState=e(r.renderState,n.getDefaultRenderState(c,h)),this.vertexFormat=p,this.translucent=c,this.closed=h};return u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,u.prototype.isTranslucent=n.prototype.isTranslucent,u.prototype.getRenderState=n.prototype.getRenderState,u}),r("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),r("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/VertexFormat","./Appearance","../Renderer/createShaderSource","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/PolylineCommon"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){t=e(t,e.EMPTY_OBJECT);var l=e(t.translucent,!0),u=!1,c=i({sources:[a,n]}),h=o,d=s.VERTEX_FORMAT;this.material=void 0,this.vertexShaderSource=e(t.vertexShaderSource,c),this.fragmentShaderSource=e(t.fragmentShaderSource,h),this.renderState=e(t.renderState,r.getDefaultRenderState(l,u)),this.vertexFormat=d,this.translucent=l,this.closed=u};return s.VERTEX_FORMAT=t.POSITION_ONLY,s.prototype.getFragmentShaderSource=r.prototype.getFragmentShaderSource,s.prototype.isTranslucent=r.prototype.isTranslucent,s.prototype.getRenderState=r.prototype.getRenderState,s}),r("DynamicScene/PolylineGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PolylineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/PolylineMaterialAppearance","../Scene/PolylineColorAppearance","../Scene/Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";var y=d.fromColor(e.WHITE),C=new m(!0),S=function(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0},w=function(e){this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(w.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new l,this._showProperty=void 0,this._materialProperty=void 0,this._options=new S(e),this._onDynamicObjectPropertyChanged(e,"polyline",e.polyline,void 0)};n(w,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),n(w.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._dynamicObject.availability)&&f.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),w.prototype.isOutlineVisible=function(){return!1},w.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},w.prototype.createFillGeometryInstance=function(r){var n,o,a=this._dynamicObject,l=a.isAvailable(r),c=new h(l&&this._showProperty.getValue(r));if(this._materialProperty instanceof d){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(m=this._materialProperty.color.getValue(r)),n=t.fromColor(m),o={show:c,color:n}}else o={show:c};return new u({id:a,geometry:new s(this._options),attributes:o})},w.prototype.createOutlineGeometryInstance=function(){},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){this._dynamicObjectSubscription(),o(this)},w.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"vertexPositions"===t||"polyline"===t){var n=this._dynamicObject.polyline;if(!i(n))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=this._dynamicObject.vertexPositions,a=n.show;if(i(a)&&a.isConstant&&!a.getValue(c.MINIMUM_VALUE)||!i(o))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var s=r(n.material,y),l=s instanceof d;this._materialProperty=s,this._showProperty=r(a,C),this._fillEnabled=!0;var u=n.width;if(o.isConstant&&f.isConstant(u)){var h=this._options,m=o.getValue(c.MINIMUM_VALUE,h.positions);if(!i(m)||m.length<2)return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;h.vertexFormat=l?g.VERTEX_FORMAT:v.VERTEX_FORMAT,h.positions=m,h.width=i(u)?u.getValue(c.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},w.prototype.createDynamicUpdater=function(e){return new E(e,this)};var E=function(e,t){this._primitives=e,this._primitive=void 0,this._geometryUpdater=t,this._options=new S(t._dynamicObject)};return E.prototype.update=function(e){var t=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive);var r=t._dynamicObject,n=r.polyline,o=n.show;if(r.isAvailable(e)&&(!i(o)||o.getValue(e))){var a=this._options,l=r.vertexPositions,c=l.getValue(e,a.positions);if(i(c)&&!(c.length<2)){a.positions=c;var h=n.width;a.width=i(h)?h.getValue(e):void 0,this._material=p.getValue(e,t.fillMaterialProperty,this._material);var d=this._material,m=new v({material:d,translucent:d.isTranslucent(),closed:!1});a.vertexFormat=m.vertexFormat,this._primitive=new _({geometryInstances:new u({id:r,geometry:new s(a)}),appearance:m,asynchronous:!1}),this._primitives.add(this._primitive)}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),o(this)},w}),r("DynamicScene/DataSourceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","./DynamicBillboardVisualizer","./DynamicConeVisualizerUsingCustomSensor","./DynamicLabelVisualizer","./DynamicModelVisualizer","./DynamicPathVisualizer","./DynamicPointVisualizer","./DynamicPyramidVisualizer","./DynamicVectorVisualizer","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";var _=function(e,t){var r=t.getDynamicObjectCollection();return[new o(e,r),new f(m,e,r),new f(p,e,r),new f(v,e,r),new f(g,e,r),new a(e,r),new s(e,r),new l(e,r),new c(e,r),new d(e,r),new h(e,r),new u(e,r)]},y=function(t,r,i){this._eventHelper=new n,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=t,this._timeVaryingSources=[],this._staticSourcesToUpdate=[],this._visualizersCallback=e(i,_);for(var o=0,a=r.length;a>o;o++)this._onDataSourceAdded(r,r.get(o))};return y.prototype.getScene=function(){return this._scene},y.prototype.getDataSources=function(){return this._dataSourceCollection},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;i>t;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return r(this)},y.prototype.update=function(e){var t,r,i,n,o=this._timeVaryingSources,a=o.length;for(t=0;a>t;t++)for(i=o[t]._visualizers,n=i.length,r=0;n>r;r++)i[r].update(e);var s=this._staticSourcesToUpdate;for(a=s.length,t=0;a>t;t++)for(i=s[t]._visualizers,n=i.length,r=0;n>r;r++)i[r].update(e);s.length=0},y.prototype._onDataSourceAdded=function(e,t){var r=this._visualizersCallback(this._scene,t);t._visualizers=r,t.getChangedEvent().addEventListener(this._onDataSourceChanged,this),this._onDataSourceChanged(t)},y.prototype._onDataSourceRemoved=function(e,t){t.getChangedEvent().removeEventListener(this._onDataSourceChanged,this);var r=this._timeVaryingSources.indexOf(t);-1!==r&&this._timeVaryingSources.splice(r,1);var i=this._staticSourcesToUpdate.indexOf(t);-1!==i&&this._staticSourcesToUpdate.splice(i,1);for(var n=t._visualizers,o=n.length,a=0;o>a;a++)n[a].destroy(),t._visualizers=void 0},y.prototype._onDataSourceChanged=function(e){var t=this._timeVaryingSources.indexOf(e),r=this._staticSourcesToUpdate.indexOf(e);e.getIsTimeVarying()?(-1===t&&this._timeVaryingSources.push(e),-1!==r&&this._staticSourcesToUpdate.splice(r,1)):(-1===r&&this._staticSourcesToUpdate.push(e),-1!==t&&this._timeVaryingSources.splice(r,1))},y}),r("DynamicScene/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.update=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),r("Scene/CameraColumbusViewMode",["../Core/Enumeration"],function(e){"use strict";var t={FREE:new e(0,"FREE"),LOCKED:new e(1,"LOCKED")};return t}),r("DynamicScene/DynamicObjectView",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Quaternion","../Core/Matrix3","../Core/Matrix4","../Core/Ellipsoid","../Core/Transforms","../Scene/CameraColumbusViewMode","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,r,i,a,s,l,u,c){var h,d=e.scene,m=d.mode!==e._mode;m?(e._mode=d.mode,e._screenSpaceCameraController.enableTranslate=!1,h=o.magnitude(a)):h=i?o.magnitude(a):r.position.z;var p=s.getValue(l,e._lastCartesian);if(t(p)){var f=u.cartesianToCartographic(p,e._lastCartographic);f.height=h,i||m?(r.controller.setPositionCartographic(f),r.up.z=0,o.normalize(r.up,r.up),r.right.z=0,o.normalize(r.right,r.right),n.clone(r.right,e._first2dUp)):r.position=c.project(f),e._lastDistance=r.frustum.right-r.frustum.left,n.clone(r.right,e._last2dUp)}}function v(e,r,n,a,s,l,c){_(e,r,n,a);var m=s.getValue(l,e._lastCartesian);if(t(m)){var p=!1,f=l.addSeconds(.01),v=s.getValue(f,E);if(t(v)&&!o.equalsEpsilon(m,v,i.EPSILON6)){var g,T=d.computeFixedToIcrfMatrix(l,C),A=d.computeFixedToIcrfMatrix(f,S);t(T)&&t(A)?g=u.transpose(T,w):(g=d.computeTemeToPseudoFixedMatrix(l,w),T=u.transpose(g,C),A=d.computeTemeToPseudoFixedMatrix(f,S),u.transpose(A,A));var P=x;o.normalize(m,P),o.normalize(v,v),u.multiplyByVector(T,P,P),u.multiplyByVector(A,v,v);var D=o.cross(P,v,b);if(!o.equalsEpsilon(D,o.ZERO,i.EPSILON6)){var M=o.cross(D,P,E);u.multiplyByVector(g,M,M),u.multiplyByVector(g,D,D),u.multiplyByVector(g,P,P),o.normalize(M,M),o.normalize(D,D),o.normalize(P,P);var I=y;I[0]=M.x,I[1]=M.y,I[2]=M.z,I[3]=0,I[4]=D.x,I[5]=D.y,I[6]=D.z,I[7]=0,I[8]=P.x,I[9]=P.y,I[10]=P.z,I[11]=0,I[12]=m.x,I[13]=m.y,I[14]=m.z,I[15]=0,r.transform=I,p=!0}}p||(r.transform=d.eastNorthUpToFixedFrame(m,c,y)),e._screenSpaceCameraController.ellipsoid=h.UNIT_SPHERE;var O=r.position;o.clone(O,e._lastOffset),e._lastDistance=o.magnitude(O)}}function g(e,r,i,n,a,s,l,u){_(e,r,i,n);var d=a.getValue(s,e._lastCartesian);if(t(d)){var p=l.cartesianToCartographic(d,e._lastCartographic),f=u.project(p);T.x=f.z,T.y=f.x,T.z=f.y;var v=r.transform;c.setColumn(v,3,T,v);var g=e._screenSpaceCameraController;g.enableTranslate=!1,g.ellipsoid=h.UNIT_SPHERE,g.columbusViewMode=m.LOCKED;var y=r.position;o.clone(y,e._lastOffset),e._lastDistance=o.magnitude(y)}}function _(e,t,r,a){var s=e.scene;if(r)t.controller.lookAt(a,o.ZERO,o.UNIT_Z);else if(s.mode!==e._mode){e._mode=s.mode;var c=e._first2dUp,h=e._last2dUp;if(!n.equals(c,h)){var d=Math.acos(c.x);c.y<0&&(d=i.TWO_PI-d);var m=Math.acos(h.x);h.y<0&&(m=i.TWO_PI-m),h.x=0,h.y=0,c.x=0,c.y=0;var p=m-d,f=l.fromAxisAngle(o.UNIT_Z,p,A);u.multiplyByVector(u.fromQuaternion(f,P),a,a)}o.multiplyByScalar(o.normalize(a,a),e._lastDistance,a),t.controller.lookAt(a,o.ZERO,o.UNIT_Z)}}var y=new c,C=new u,S=new u,w=new u,E=new o,x=new o,b=new o,T=new a(0,0,0,1),A=new l,P=new u,D=new o(1e4,-1e4,1e4),M=new o,I=function(t,r,i){this.dynamicObject=t,this.scene=r,this._lastScene=void 0,this.ellipsoid=e(i,h.WGS84),this._lastDynamicObject=void 0,this._mode=void 0,this._lastCartesian=new o,this._lastCartographic=new s,this._lastDistance=void 0,this._lastOffset=new o,this._offsetScratch=new o,this._first2dUp=new n,this._last2dUp=new n};return I.prototype.update=function(e){var r=this.scene,i=this.dynamicObject,n=this.ellipsoid;r!==this._lastScene&&(this._lastScene=r,this._screenSpaceCameraController=r.screenSpaceCameraController);var a=i.position,s=i!==this._lastDynamicObject,l=this._offsetScratch;if(s){this._lastDynamicObject=i;var u=this.dynamicObject.viewFrom;t(u)&&t(u.getValue(e,l))||o.clone(D,l);var c=this._first2dUp,h=this._last2dUp;c.x=c.y=0,h.x=h.y=0,o.clone(l,this._lastOffset),this._lastDistance=o.magnitude(l),o.equals(o.normalize(l,M),o.UNIT_Z)&&(l.y-=.01)}else t(this._lastOffset)?l=this._lastOffset:o.clone(D,l);var d=r.mode;d===p.SCENE2D?f(this,r.camera,s,l,a,e,n,r.scene2D.projection):d===p.SCENE3D?v(this,r.camera,s,l,a,e,n):d===p.COLUMBUS_VIEW&&g(this,r.camera,s,l,a,e,n,r.scene2D.projection)},I}),r("ThirdParty/topojson",[],function(){var e=function(){function e(e,t){function r(t){var r=e.arcs[t],i=r[0],n=[0,0];return r.forEach(function(e){n[0]+=e[0],n[1]+=e[1]}),[i,n]}var i={},n={},o={};t.forEach(function(e){var t=r(e);(i[t[0]]||(i[t[0]]=[])).push(e),(i[t[1]]||(i[t[1]]=[])).push(~e)}),t.forEach(function(e){var t,i,a=r(e),s=a[0],l=a[1];if(t=o[s])if(delete o[t.end],t.push(e),t.end=l,i=n[l]){delete n[i.start];var u=i===t?t:t.concat(i);n[u.start=t.start]=o[u.end=i.end]=u}else if(i=o[l]){delete n[i.start],delete o[i.end];var u=t.concat(i.map(function(e){return~e}).reverse());n[u.start=t.start]=o[u.end=i.start]=u}else n[t.start]=o[t.end]=t;else if(t=n[l])if(delete n[t.start],t.unshift(e),t.start=s,i=o[s]){delete o[i.end];var c=i===t?t:i.concat(t);n[c.start=i.start]=o[c.end=t.end]=c}else if(i=n[s]){delete n[i.start],delete o[i.end];var c=i.map(function(e){return~e}).reverse().concat(t);n[c.start=i.end]=o[c.end=t.end]=c}else n[t.start]=o[t.end]=t;else if(t=n[s])if(delete n[t.start],t.unshift(~e),t.start=l,i=o[l]){delete o[i.end];var c=i===t?t:i.concat(t);n[c.start=i.start]=o[c.end=t.end]=c}else if(i=n[l]){delete n[i.start],delete o[i.end];var c=i.map(function(e){return~e}).reverse().concat(t);n[c.start=i.end]=o[c.end=t.end]=c}else n[t.start]=o[t.end]=t;else if(t=o[l])if(delete o[t.end],t.push(~e),t.end=s,i=o[s]){delete n[i.start];var u=i===t?t:t.concat(i);n[u.start=t.start]=o[u.end=i.end]=u}else if(i=n[s]){delete n[i.start],delete o[i.end];var u=t.concat(i.map(function(e){return~e}).reverse());n[u.start=t.start]=o[u.end=i.start]=u}else n[t.start]=o[t.end]=t;else t=[e],n[t.start=s]=o[t.end=l]=t});var a=[];for(var s in o)a.push(o[s]);return a}function t(t,r,i){function o(e){0>e&&(e=~e),(h[e]||(h[e]=[])).push(c)}function a(e){e.forEach(o)}function s(e){e.forEach(a)}function l(e){"GeometryCollection"===e.type?e.geometries.forEach(l):e.type in d&&(c=e,d[e.type](e.arcs))}var u=[];if(arguments.length>1){var c,h=[],d={LineString:a,MultiLineString:s,Polygon:s,MultiPolygon:function(e){e.forEach(s)}};l(r),h.forEach(arguments.length<3?function(e,t){u.push(t)}:function(e,t){i(e[0],e[e.length-1])&&u.push(t)})}else for(var m=0,p=t.arcs.length;p>m;++m)u.push(m);return n(t,{type:"MultiLineString",arcs:e(t,u)})}function r(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return i(e,t)})}:i(e,t)}function i(e,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:n(e,t)};return null==t.id&&delete r.id,r}function n(e,t){function r(e,t){t.length&&t.pop();for(var r,i=p[0>e?~e:e],n=0,a=i.length,s=0,l=0;a>n;++n)t.push([(s+=(r=i[n])[0])*c+d,(l+=r[1])*h+m]);0>e&&o(t,a)}function i(e){return[e[0]*c+d,e[1]*h+m]}function n(e){for(var t=[],i=0,n=e.length;n>i;++i)r(e[i],t);return t.length<2&&t.push(t[0]),t}function a(e){for(var t=n(e);t.length<4;)t.push(t[0]);return t}function s(e){return e.map(a)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in f?{type:t,coordinates:f[t](e)}:null}var u=e.transform,c=u.scale[0],h=u.scale[1],d=u.translate[0],m=u.translate[1],p=e.arcs,f={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return s(e.arcs)},MultiPolygon:function(e){return e.arcs.map(s)}};return l(t)}function o(e,t){for(var r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function a(e,t){for(var r=0,i=e.length;i>r;){var n=r+i>>>1;e[n]e&&(e=~e);var r=n[e];r?r.push(t):n[e]=[t]})}function r(e,r){e.forEach(function(e){t(e,r)})}function i(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){i(e,t)}):e.type in s&&s[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),s={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var l in n)for(var u=n[l],c=u.length,h=0;c>h;++h)for(var d=h+1;c>d;++d){var m,p=u[h],f=u[d];(m=o[p])[l=a(m,f)]!==f&&m.splice(l,0,f),(m=o[f])[l=a(m,p)]!==p&&m.splice(l,0,p)}return o}return{version:"1.1.4",mesh:t,feature:r,neighbors:s}}();return e}),r("DynamicScene/GeoJsonDataSource",["../Core/createGuid","../Core/Cartographic","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/getFilenameFromUri","../Core/RuntimeError","../Core/Ellipsoid","../Core/Event","../Core/loadJson","./ConstantProperty","./DynamicObject","./DynamicPoint","./DynamicPolyline","./DynamicPolygon","./ColorMaterialProperty","./DynamicObjectCollection","../ThirdParty/when","../ThirdParty/topojson"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";function y(e,t){var r='';for(var n in e)if(e.hasOwnProperty(n)){if(n===t)continue;var o=e[n];i(o)&&(r+="object"==typeof o?"":"")}return r+="
"+n+""+y(o)+"
"+n+""+o+"
"}function C(t,r){var n=t.id;if(i(n)&&"Feature"===t.type){for(var o=2,a=n;i(r.getById(a));)a=n+"_"+o,o++;n=a}else n=e();var s=r.getOrCreateObject(n);s.geoJson=t;var l=t.properties;if(i(l)){var u,c;for(u in l)if(l.hasOwnProperty(u)){var h=u.toUpperCase();if("NAME"===h||"TITLE"===h){c=u,s.name=l[u];break}}if(!i(c))for(u in l)if(l.hasOwnProperty(u)&&(/name/i.test(u)||/title/i.test(u))){c=u,s.name=l[u];break}var d=y(l,c);s.description={getValue:function(){return d}}}return s}function S(e,t){for(var r=new Array(e.length),i=0;ia;a++)w(e,o[a],void 0,i,n)}function x(e,t,r,n,o){for(var s=r.geometries,l=0,u=s.length;u>l;l++){var c=s[l],h=c.type,d=L[h];if(!i(d))throw new a("Unknown geometry type: "+h);d(e,t,c,n,o)}}function b(e,t,r,i){var n=C(t,e._dynamicObjectCollection);n.merge(e.defaultPoint),n.position=new c(i(r.coordinates))}function T(e,t,r,i){for(var n=r.coordinates,o=0;oi;i++)if(!o.isConstant(t[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,r){var i=this._value;if(!e(i))return void 0;var n=i.length;e(r)||(r=new Array(n));for(var o=0,a=0;n>o;){var s=this._value[o],l=s.getValue(t,r[o]);e(l)&&(r[a]=l,a++),o++}return r.length=a,r},a.prototype.setValue=function(t){var r=this._eventHelper;if(r.removeAll(),e(t)){this._value=t.slice();for(var i=t.length,n=0;i>n;n++){var o=t[n];e(o)&&r.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),r("Renderer/UniformDatatype",["../Core/Enumeration"],function(e){"use strict";var t={FLOAT:new e(5126,"FLOAT",{getGLSL:function(){return"float"}}),FLOAT_VEC2:new e(35664,"FLOAT_VEC2",{getGLSL:function(){return"vec2"}}),FLOAT_VEC3:new e(35665,"FLOAT_VEC3",{getGLSL:function(){return"vec3"}}),FLOAT_VEC4:new e(35666,"FLOAT_VEC4",{getGLSL:function(){return"vec4"}}),INT:new e(5124,"INT",{getGLSL:function(){return"int"}}),INT_VEC2:new e(35667,"INT_VEC2",{getGLSL:function(){return"ivec2"}}),INT_VEC3:new e(35668,"INT_VEC3",{getGLSL:function(){return"ivec3"}}),INT_VEC4:new e(35669,"INT_VEC4",{getGLSL:function(){return"ivec4"}}),BOOL:new e(35670,"BOOL",{getGLSL:function(){return"bool"}}),BOOL_VEC2:new e(35671,"BOOL_VEC2",{getGLSL:function(){return"bvec2"}}),BOOL_VEC3:new e(35672,"BOOL_VEC3",{getGLSL:function(){return"bvec3"}}),BOOL_VEC4:new e(35673,"BOOL_VEC4",{getGLSL:function(){return"bvec4"}}),FLOAT_MAT2:new e(35674,"FLOAT_MAT2",{getGLSL:function(){return"mat2"}}),FLOAT_MAT3:new e(35675,"FLOAT_MAT3",{getGLSL:function(){return"mat3"}}),FLOAT_MAT4:new e(35676,"FLOAT_MAT4",{getGLSL:function(){return"mat4"}}),SAMPLER_2D:new e(35678,"SAMPLER_2D",{getGLSL:function(){return"sampler2D"}}),SAMPLER_CUBE:new e(35680,"SAMPLER_CUBE",{getGLSL:function(){return"samplerCube"}})};return t}),r("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","./UniformDatatype"],function(e,t,r){"use strict";var i=new e,n=function(e){this.getSize=e.getSize,this.getDatatype=e.getDatatype,this.getValue=e.getValue};n.prototype.getDeclaration=function(e){var t="uniform "+this.getDatatype().getGLSL()+" "+e,r=this.getSize();return t+=1===r?";":"["+r.toString()+"];"};var o={czm_viewport:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC4},getValue:function(e){return e.getViewportCartesian4()}}),czm_viewportOrthographic:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getViewportOrthographic()}}),czm_viewportTransformation:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getViewportTransformation()}}),czm_model:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getModel()}}),czm_inverseModel:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseModel()}}),czm_view:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getView()}}),czm_view3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getView3D()}}),czm_viewRotation:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getViewRotation()}}),czm_viewRotation3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getViewRotation3D()}}),czm_inverseView:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseView()}}),czm_inverseView3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseView3D()}}),czm_inverseViewRotation:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getInverseViewRotation()}}),czm_inverseViewRotation3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getInverseViewRotation3D()}}),czm_projection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getProjection()}}),czm_inverseProjection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseProjection()}}),czm_infiniteProjection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInfiniteProjection()}}),czm_modelView:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getModelView()}}),czm_modelView3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getModelView3D()}}),czm_modelViewRelativeToEye:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getModelViewRelativeToEye()}}),czm_inverseModelView:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseModelView()}}),czm_inverseModelView3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseModelView3D()}}),czm_viewProjection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getViewProjection()}}),czm_inverseViewProjection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseViewProjection()}}),czm_modelViewProjection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getModelViewProjection()}}),czm_inverseModelViewProjection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getInverseModelViewProjection()}}),czm_modelViewProjectionRelativeToEye:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getModelViewProjectionRelativeToEye()}}),czm_modelViewInfiniteProjection:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT4},getValue:function(e){return e.getModelViewInfiniteProjection()}}),czm_normal:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getNormal()}}),czm_normal3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getNormal3D()}}),czm_inverseNormal:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getInverseNormal()}}),czm_inverseNormal3D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getInverseNormal3D()}}),czm_eyeHeight2D:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC2},getValue:function(e){return e.getEyeHeight2D()}}),czm_entireFrustum:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC2},getValue:function(e){return e.getEntireFrustum()}}),czm_currentFrustum:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC2},getValue:function(e){return e.getCurrentFrustum()}}),czm_pixelSizeInMeters:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT},getValue:function(e){return e.getPixelSize()}}),czm_sunPositionWC:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return e.getSunPositionWC()}}),czm_sunPositionColumbusView:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return e.getSunPositionColumbusView()}}),czm_sunDirectionEC:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return e.getSunDirectionEC()}}),czm_sunDirectionWC:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return e.getSunDirectionWC()}}),czm_moonDirectionEC:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return e.getMoonDirectionEC()}}),czm_encodedCameraPositionMCHigh:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return e.getEncodedCameraPositionMCHigh()}}),czm_encodedCameraPositionMCLow:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return e.getEncodedCameraPositionMCLow()}}),czm_viewerPositionWC:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_VEC3},getValue:function(e){return t.getTranslation(e.getInverseView(),i)}}),czm_frameNumber:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT},getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT},getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT},getValue:function(e){return e.frameState.mode.value}}),czm_temeToPseudoFixed:new n({getSize:function(){return 1},getDatatype:function(){return r.FLOAT_MAT3},getValue:function(e){return e.getTemeToPseudoFixedMatrix()}})};return o}),r("Renderer/Buffer",["../Core/DeveloperError","../Core/defaultValue","../Core/destroyObject"],function(e,t,r){"use strict";var i=function(e,t,r,i,n){this._gl=e,this._bufferTarget=t,this._sizeInBytes=r,this._usage=i,this._buffer=n,this._vertexArrayDestroyable=!0};return i.prototype.copyFromArrayView=function(e,r){r=t(r,0);var i=this._gl,n=this._bufferTarget;i.bindBuffer(n,this._buffer),i.bufferSubData(n,r,e),i.bindBuffer(n,null)},i.prototype._getBuffer=function(){return this._buffer},i.prototype.getSizeInBytes=function(){return this._sizeInBytes},i.prototype.getUsage=function(){return this._usage},i.prototype.getVertexArrayDestroyable=function(){return this._vertexArrayDestroyable},i.prototype.setVertexArrayDestroyable=function(e){this._vertexArrayDestroyable=e},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},i}),r("Renderer/ClearCommand",["../Core/Color","../Core/freezeObject"],function(e,t){"use strict";var r=function(){this.color=void 0,this.depth=void 0,this.stencil=void 0,this.renderState=void 0,this.framebuffer=void 0,this.owner=void 0},i=new r;return i.color=new e(0,0,0,0),i.depth=1,i.stencil=0,r.ALL=t(i),r.prototype.execute=function(e,t){e.clear(this,t)},r}),r("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/destroyObject","./PixelFormat"],function(e,t,r,i){"use strict";function n(e,t,r){var i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,r._getTarget(),r._getTexture(),0)}function o(e,t,r){var i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,r._getRenderbuffer())}var a=function(r,i,a){a=e(a,e.EMPTY_OBJECT),this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=!0,t(a.depthTexture)||t(a.depthRenderbuffer),t(a.depthStencilTexture)||t(a.depthStencilRenderbuffer),this._bind();var s,l,u,c,h;if(t(a.colorTextures)){var d=a.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;c>u;++u)s=d[u],h=this._gl.COLOR_ATTACHMENT0+u,n(this,h,s),this._activeColorAttachments[u]=h,this._colorTextures[u]=s}if(t(a.colorRenderbuffers)){var m=a.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=m.length,u=0;c>u;++u)l=m[u],h=this._gl.COLOR_ATTACHMENT0+u,o(this,h,l),this._activeColorAttachments[u]=h,this._colorRenderbuffers[u]=l}t(a.depthTexture)&&(s=a.depthTexture,n(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),t(a.depthRenderbuffer)&&(l=a.depthRenderbuffer,o(this,this._gl.DEPTH_ATTACHMENT,l),this._depthRenderbuffer=l),t(a.stencilRenderbuffer)&&(l=a.stencilRenderbuffer,o(this,this._gl.STENCIL_ATTACHMENT,l),this._stencilRenderbuffer=l),t(a.depthStencilTexture)&&(s=a.depthStencilTexture,n(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),t(a.depthStencilRenderbuffer)&&(l=a.depthStencilRenderbuffer,o(this,this._gl.DEPTH_STENCIL_ATTACHMENT,l),this._depthStencilRenderbuffer=l),this._unBind()};return a.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},a.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},a.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},a.prototype.getNumberOfColorAttachments=function(){return this._activeColorAttachments.length},a.prototype.getColorTexture=function(e){return this._colorTextures[e]},a.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},a.prototype.getDepthTexture=function(){return this._depthTexture},a.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer},a.prototype.getStencilRenderbuffer=function(){return this._stencilRenderbuffer},a.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture},a.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer},a.prototype.hasDepthAttachment=function(){return!!(this.getDepthTexture()||this.getDepthRenderbuffer()||this.getDepthStencilTexture()||this.getDepthStencilRenderbuffer())},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,r=this._colorTextures,n=r.length;n>e;++e){var o=r[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;n>e;++e){var s=a[e];t(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),i(this)},a}),r("Renderer/PassState",[],function(){"use strict";var e=function(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0};return e}),r("Renderer/RenderbufferFormat",["../Core/Enumeration"],function(e){"use strict";var t={RGBA4:new e(32854,"RGBA4"),RGB5_A1:new e(32855,"RGB5_A1"),RGB565:new e(36194,"RGB565"),DEPTH_COMPONENT16:new e(33189,"DEPTH_COMPONENT16"),STENCIL_INDEX8:new e(36168,"STENCIL_INDEX8"),DEPTH_STENCIL:new e(34041,"DEPTH_STENCIL"),validate:function(e){return e===t.RGBA4||e===t.RGB5_A1||e===t.RGB565||e===t.DEPTH_COMPONENT16||e===t.STENCIL_INDEX8||e===t.DEPTH_STENCIL}};return t}),r("Renderer/PickFramebuffer",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Color","../Core/BoundingRectangle","./PassState","./RenderbufferFormat"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){var t=new o(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new n},this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0};s.prototype.begin=function(e){var r=this._context,i=r.getDrawingBufferWidth(),o=r.getDrawingBufferHeight();return n.clone(e,this._passState.scissorTest.rectangle),t(this._fb)&&this._width===i&&this._height===o||(this._width=i,this._height=o,this._fb=this._fb&&this._fb.destroy(),this._fb=r.createFramebuffer({colorTextures:[r.createTexture2D({width:i,height:o})],depthRenderbuffer:r.createRenderbuffer({format:a.DEPTH_COMPONENT16})}),this._passState.framebuffer=this._fb),this._passState};var l=new i;return s.prototype.end=function(r){for(var n=e(r.width,1),o=e(r.height,1),a=this._context,s=a.readPixels({x:r.x,y:r.y,width:n,height:o,framebuffer:this._fb}),u=Math.max(n,o),c=u*u,h=Math.floor(.5*n),d=Math.floor(.5*o),m=0,p=0,f=0,v=-1,g=0;c>g;++g){if(m>=-h&&h>=m&&p>=-d&&d>=p){var _=4*((d-p)*n+m+h);l.red=i.byteToFloat(s[_]),l.green=i.byteToFloat(s[_+1]),l.blue=i.byteToFloat(s[_+2]),l.alpha=i.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(l);if(t(y))return y}if(m===p||0>m&&-m===p||m>0&&m===1-p){var C=f;f=-v,v=C}m+=f,p+=v}return void 0},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),r(this)},s}),r("Renderer/Renderbuffer",["../Core/destroyObject"],function(e){"use strict";function t(t,r,i,n){var o=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,o),t.renderbufferStorage(t.RENDERBUFFER,r,i,n),t.bindRenderbuffer(t.RENDERBUFFER,null),this.getFormat=function(){return r},this.getWidth=function(){return i},this.getHeight=function(){return n},this._getRenderbuffer=function(){return o},this.isDestroyed=function(){return!1},this.destroy=function(){return t.deleteRenderbuffer(o),e(this)}}return t}),r("Renderer/DepthFunction",["../Core/Enumeration"],function(e){"use strict";var t={NEVER:new e(512,"NEVER"),LESS:new e(513,"LESS"),EQUAL:new e(514,"EQUAL"),LESS_OR_EQUAL:new e(515,"LEQUAL"),GREATER:new e(516,"GREATER"),NOT_EQUAL:new e(517,"NOTEQUAL"),GREATER_OR_EQUAL:new e(518,"GEQUAL"),ALWAYS:new e(519,"ALWAYS"),validate:function(e){return e===t.NEVER||e===t.LESS||e===t.EQUAL||e===t.LESS_OR_EQUAL||e===t.GREATER||e===t.NOT_EQUAL||e===t.GREATER_OR_EQUAL||e===t.ALWAYS}};return t}),r("Renderer/StencilFunction",["../Core/Enumeration"],function(e){"use strict";var t={NEVER:new e(512,"NEVER"),LESS:new e(513,"LESS"),EQUAL:new e(514,"EQUAL"),LESS_OR_EQUAL:new e(515,"LESS_OR_EQUAL"),GREATER:new e(516,"GREATER"),NOT_EQUAL:new e(517,"NOT_EQUAL"),GREATER_OR_EQUAL:new e(518,"GREATER_OR_EQUAL"),ALWAYS:new e(519,"ALWAYS"),validate:function(e){return e===t.NEVER||e===t.LESS||e===t.EQUAL||e===t.LESS_OR_EQUAL||e===t.GREATER||e===t.NOT_EQUAL||e===t.GREATER_OR_EQUAL||e===t.ALWAYS}};return t}),r("Renderer/StencilOperation",["../Core/Enumeration"],function(e){"use strict";var t={ZERO:new e(0,"ZERO"),KEEP:new e(7680,"KEEP"),REPLACE:new e(7681,"REPLACE"),INCREMENT:new e(7682,"INCREMENT"),DECREMENT:new e(7683,"DECREMENT"),INVERT:new e(5386,"INVERT"),INCREMENT_WRAP:new e(34055,"INCREMENT_WRAP"),DECREMENT_WRAP:new e(34056,"DECREMENT_WRAP"),validate:function(e){return e===t.ZERO||e===t.KEEP||e===t.REPLACE||e===t.INCREMENT||e===t.DECREMENT||e===t.INVERT||e===t.INCREMENT_WRAP||e===t.DECREMENT_WRAP}};return t}),r("Renderer/RenderState",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/BoundingRectangle","../Core/RuntimeError","../Core/WindingOrder","./CullFace","./DepthFunction","./BlendEquation","./BlendFunction","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,t,r){r?e.enable(t):e.disable(t)}function p(e,t){e.frontFace(t.frontFace)}function f(e,t){var r=t.cull,i=r.enabled;m(e,e.CULL_FACE,i),i&&e.cullFace(r.face)}function v(e,t){e.lineWidth(t.lineWidth)}function g(e,t){var r=t.polygonOffset,i=r.enabled;m(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(r.factor,r.units)}function _(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(m(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function y(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function C(e,t){var r=t.depthTest,i=r.enabled;m(e,e.DEPTH_TEST,i),i&&e.depthFunc(r.func)}function S(e,t){var r=t.colorMask;e.colorMask(r.red,r.green,r.blue,r.alpha)}function w(e,t){e.depthMask(t.depthMask)}function E(e,t){e.stencilMask(t.stencilMask)}function x(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;if(m(e,e.BLEND,o),o){var a=n.color,s=n.equationRgb,l=n.equationAlpha,u=n.functionSourceRgb,c=n.functionDestinationRgb,h=n.functionSourceAlpha,d=n.functionDestinationAlpha;e.blendColor(a.red,a.green,a.blue,a.alpha),e.blendEquationSeparate(s,l),e.blendFuncSeparate(u,c,h,d)}}function b(e,t){var r=t.stencilTest,i=r.enabled;if(m(e,e.STENCIL_TEST,i),i){var n=r.frontFunction,o=r.backFunction,a=r.reference,s=r.mask;e.stencilFunc(r.frontFunction,r.reference,r.mask),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=r.frontOperation,u=l.fail,c=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,c,h);var d=r.backOperation,p=d.fail,f=d.zFail,v=d.zPass;e.stencilOpSeparate(e.BACK,p,f,v)}}function T(e,t){var r=t.sampleCoverage,i=r.enabled;m(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(r.value,r.invert)}function A(e,t){m(e,e.DITHER,t.dither)}function P(e,t,i){var n=t.viewport;r(n)||(n=I,n.width=i.context.getDrawingBufferWidth(),n.height=i.context.getDrawingBufferHeight()),i.context.getUniformState().setViewport(n),e.viewport(n.x,n.y,n.width,n.height)}function D(e,t){var r=[];return e.frontFace!==t.frontFace&&r.push(p),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&r.push(f),e.lineWidth!==t.lineWidth&&r.push(v),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&r.push(g),r.push(_),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&r.push(y),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&r.push(C),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&r.push(S),e.depthMask!==t.depthMask&&r.push(w),r.push(x),e.stencilMask!==t.stencilMask&&r.push(E),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&r.push(b),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&r.push(T),e.dither!==t.dither&&r.push(A),r.push(P),r}var M=function(i,m){var p=t(m,{}),f=t(p.cull,{}),v=t(p.polygonOffset,{}),g=t(p.scissorTest,{}),_=t(g.rectangle,{}),y=t(p.depthRange,{}),C=t(p.depthTest,{}),S=t(p.colorMask,{}),w=t(p.blending,{}),E=t(w.color,{}),x=t(p.stencilTest,{}),b=t(x.frontOperation,{}),T=t(x.backOperation,{}),A=t(p.sampleCoverage,{}),P=p.viewport;if(this.frontFace=t(p.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:t(f.enabled,!1),face:t(f.face,s.BACK)},this.lineWidth=t(p.lineWidth,1),this.polygonOffset={enabled:t(v.enabled,!1),factor:t(v.factor,0),units:t(v.units,0)},this.scissorTest={enabled:t(g.enabled,!1),rectangle:n.clone(_)},this.depthRange={near:t(y.near,0),far:t(y.far,1)},this.depthTest={enabled:t(C.enabled,!1),func:t(C.func,l.LESS)},this.colorMask={red:t(S.red,!0),green:t(S.green,!0),blue:t(S.blue,!0),alpha:t(S.alpha,!0)},this.depthMask=t(p.depthMask,!0),this.stencilMask=t(p.stencilMask,-1),this.blending={enabled:t(w.enabled,!1),color:new e(t(E.red,0),t(E.green,0),t(E.blue,0),t(E.alpha,0)),equationRgb:t(w.equationRgb,u.ADD),equationAlpha:t(w.equationAlpha,u.ADD),functionSourceRgb:t(w.functionSourceRgb,c.ONE),functionSourceAlpha:t(w.functionSourceAlpha,c.ONE),functionDestinationRgb:t(w.functionDestinationRgb,c.ZERO),functionDestinationAlpha:t(w.functionDestinationAlpha,c.ZERO)},this.stencilTest={enabled:t(x.enabled,!1),frontFunction:t(x.frontFunction,h.ALWAYS),backFunction:t(x.backFunction,h.ALWAYS),reference:t(x.reference,0),mask:t(x.mask,-1),frontOperation:{fail:t(b.fail,d.KEEP),zFail:t(b.zFail,d.KEEP),zPass:t(b.zPass,d.KEEP)},backOperation:{fail:t(T.fail,d.KEEP),zFail:t(T.zFail,d.KEEP),zPass:t(T.zPass,d.KEEP)}},this.sampleCoverage={enabled:t(A.enabled,!1),value:t(A.value,1),invert:t(A.invert,!1)},this.dither=t(p.dither,!0),this.viewport=r(P)?new n(P.x,P.y,r(P.width)?P.width:i.getDrawingBufferWidth(),r(P.height)?P.height:i.getDrawingBufferHeight()):void 0,this.lineWidthi.getMaximumAliasedLineWidth())throw new o("renderState.lineWidth is out of range. Check getMinimumAliasedLineWidth() and getMaximumAliasedLineWidth().");if(r(this.viewport)){if(this.viewport.width>i.getMaximumViewportWidth())throw new o("renderState.viewport.width must be less than or equal to the maximum viewport width ("+this.getMaximumViewportWidth().toString()+"). Check getMaximumViewportWidth().");if(this.viewport.height>i.getMaximumViewportHeight())throw new o("renderState.viewport.height must be less than or equal to the maximum viewport height ("+this.getMaximumViewportHeight().toString()+"). Check getMaximumViewportHeight().")}this.id=0,this._applyFunctions=[]},I=new n;return M.apply=function(e,t,r){p(e,t),f(e,t),v(e,t),g(e,t),_(e,t,r),y(e,t),C(e,t),S(e,t),w(e,t),E(e,t),x(e,t,r),b(e,t),T(e,t),A(e,t),P(e,t,r)},M.partialApply=function(e,t,i,n){var o=i._applyFunctions[t.id];r(o)||(o=D(t,i),i._applyFunctions[t.id]=o);for(var a=o.length,s=0;a>s;++s)o[s](e,i,n)},M}),r("Renderer/ShaderCache",["../Core/defined","../Core/destroyObject"],function(e,t){"use strict";var r=function(e){this._context=e,this._shaders={},this._shadersToRelease={}};return r.prototype.replaceShaderProgram=function(t,r,i,n){return e(t)&&t.release(),this.getShaderProgram(r,i,n)},r.prototype.getShaderProgram=function(e,t,r){var i,n=e+t+JSON.stringify(r);if(this._shaders[n])i=this._shaders[n],delete this._shadersToRelease[n];else{var o=this._context.createShaderProgram(e,t,r);i={cache:this,shaderProgram:o,keyword:n,count:0},o._cachedShader=i,this._shaders[n]=i}return++i.count,i.shaderProgram},r.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];delete this._shaders[r.keyword],r.shaderProgram.destroy()}this._shadersToRelease={}},r.prototype.releaseShaderProgram=function(e){if(e){var t=e._cachedShader;t&&0===--t.count&&(this._shadersToRelease[t.keyword]=t)}return void 0},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){var e=this._shaders;for(var r in e)e.hasOwnProperty(r)&&e[r].shaderProgram.destroy();return t(this)},r}),r("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),r("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),r("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),r("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),r("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),r("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),r("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),r("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),r("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),r("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),r("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),r("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),r("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict"; +return"const float czm_piOverFour = 0.7853981633974483;\n"}),r("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),r("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),r("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),r("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),r("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 0.0;\n"}),r("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 2.0;\n"}),r("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),r("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 3.0;\n"}),r("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),r("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),r("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),r("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),r("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),r("Shaders/Builtin/Structs/material",[],function(){"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),r("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),r("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),r("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),r("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),r("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),r("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),r("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),r("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),r("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),r("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),r("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),r("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),r("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),r("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),r("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),r("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),r("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),r("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),r("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, shininess);\n}\n"}),r("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),r("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),r("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),r("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),r("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),r("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorYLow, float southMercatorYHigh, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nfloat t1 = 0.0 - southMercatorYLow;\nfloat e = t1 - 0.0;\nfloat t2 = ((-southMercatorYLow - e) + (0.0 - (t1 - e))) + mercatorY - southMercatorYHigh;\nfloat highDifference = t1 + t2;\nfloat lowDifference = t2 - (highDifference - t1);\nreturn highDifference * oneOverMercatorHeight + lowDifference * oneOverMercatorHeight;\n}\n"}),r("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),r("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),r("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),r("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material) + czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),r("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),r("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),r("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),r("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x, tangent.y, tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x, normal.y, normal.z);\n}\n"}),r("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),r("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),r("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),r("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Functions/RGBToXYZ","./Functions/XYZToRGB","./Functions/antialias","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/saturation","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/transpose","./Functions/windowToEyeCoordinates"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N,B,z,F,V,k,U,W,G,H,j,q,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt){"use strict";return{czm_degreesPerRadian:e,czm_epsilon1:t,czm_epsilon2:r,czm_epsilon3:i,czm_epsilon4:n,czm_epsilon5:o,czm_epsilon6:a,czm_epsilon7:s,czm_infinity:l,czm_oneOverPi:u,czm_oneOverTwoPi:c,czm_pi:h,czm_piOverFour:d,czm_piOverSix:m,czm_piOverThree:p,czm_piOverTwo:f,czm_radiansPerDegree:v,czm_sceneMode2D:g,czm_sceneMode3D:_,czm_sceneModeColumbusView:y,czm_sceneModeMorphing:C,czm_solarRadius:S,czm_threePiOver2:w,czm_twoPi:E,czm_webMercatorMaxLatitude:x,czm_ellipsoid:b,czm_material:T,czm_materialInput:A,czm_ray:P,czm_raySegment:D,czm_RGBToXYZ:M,czm_XYZToRGB:I,czm_antialias:O,czm_columbusViewMorph:R,czm_computePosition:L,czm_eastNorthUpToEyeCoordinates:N,czm_ellipsoidContainsPoint:B,czm_ellipsoidNew:z,czm_ellipsoidWgs84TextureCoordinates:F,czm_equalsEpsilon:V,czm_eyeOffset:k,czm_eyeToWindowCoordinates:U,czm_geodeticSurfaceNormal:W,czm_getDefaultMaterial:G,czm_getLambertDiffuse:H,czm_getSpecular:j,czm_getWaterNoise:q,czm_getWgs84EllipsoidEC:Y,czm_hue:X,czm_isEmpty:Z,czm_isFull:J,czm_latitudeToWebMercatorFraction:Q,czm_luminance:K,czm_modelToWindowCoordinates:$,czm_multiplyWithColorBalance:et,czm_phong:tt,czm_pointAlongRay:rt,czm_rayEllipsoidIntersectionInterval:it,czm_saturation:nt,czm_tangentToEyeSpaceMatrix:ot,czm_translateRelativeToEye:at,czm_transpose:st,czm_windowToEyeCoordinates:lt}}),r("Renderer/ShaderProgram",["../Core/defined","../Core/DeveloperError","../Core/FeatureDetection","../Core/RuntimeError","../Core/destroyObject","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","./AutomaticUniforms","./UniformDatatype","../Shaders/Builtin/CzmBuiltins"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t){switch(t){case e.FLOAT:return function(){return u.FLOAT};case e.FLOAT_VEC2:return function(){return u.FLOAT_VEC2};case e.FLOAT_VEC3:return function(){return u.FLOAT_VEC3};case e.FLOAT_VEC4:return function(){return u.FLOAT_VEC4};case e.INT:return function(){return u.INT};case e.INT_VEC2:return function(){return u.INT_VEC2};case e.INT_VEC3:return function(){return u.INT_VEC3};case e.INT_VEC4:return function(){return u.INT_VEC4};case e.BOOL:return function(){return u.BOOL};case e.BOOL_VEC2:return function(){return u.BOOL_VEC2};case e.BOOL_VEC3:return function(){return u.BOOL_VEC3};case e.BOOL_VEC4:return function(){return u.BOOL_VEC4};case e.FLOAT_MAT2:return function(){return u.FLOAT_MAT2};case e.FLOAT_MAT3:return function(){return u.FLOAT_MAT3};case e.FLOAT_MAT4:return function(){return u.FLOAT_MAT4};case e.SAMPLER_2D:return function(){return u.SAMPLER_2D};case e.SAMPLER_CUBE:return function(){return u.SAMPLER_CUBE};default:throw new i("Unrecognized uniform type: "+t)}}function d(e,t,r){e.useProgram(t);for(var i=0,n=r.length,o=0;n>o;++o)i=r[o]._setSampler(i);return e.useProgram(null),i}function m(e){var t=e.indexOf("#version");if(-1!==t){var r=e.indexOf("\n",t);if(-1!==t){var i=e.substring(t,r+1),n=e.substring(0,t)+"//"+e.substring(t);return{version:i,source:n}}}return{version:"",source:e}}function p(t,r,i){for(var n,o=0;oc;++c)u+=0===c?"// Comment replaced to prevent problems when determining dependencies on built-in functions\n":"//\n";r=r.replace(s,u)}n={name:t,glslSource:r,dependsOn:[],requiredBy:[],evaluated:!1},i.push(n)}return n}function f(t,r){if(!t.evaluated){t.evaluated=!0;var i=t.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);e(i)&&null!==i&&(i=i.filter(function(e,t){return i.indexOf(e)===t}),i.forEach(function(e){if(e!==t.name&&P._czmBuiltinsAndUniforms.hasOwnProperty(e)){var i=p(e,P._czmBuiltinsAndUniforms[e],r);t.dependsOn.push(i),i.requiredBy.push(t),f(i,r)}}))}}function v(e){for(var r=[],i=[];e.length>0;){var n=e.pop();i.push(n),0===n.requiredBy.length&&r.push(n)}for(;r.length>0;){var o=r.shift();e.push(o);for(var a=0;a=0;--n)i=i+t[n].glslSource+"\n";return i.replace(r.glslSource,"")}function _(){return"#ifdef GL_FRAGMENT_PRECISION_HIGH \n precision highp float; \n#else \n precision mediump float; \n#endif \n\n"}function y(t,r,n,o,a){var s,l=m(n),u=m(o),c=l.version+g(l.source)+"\n#line 0\n"+l.source,h=u.version+_()+g(u.source)+"\n#line 0\n"+u.source,d=t.createShader(t.VERTEX_SHADER);t.shaderSource(d,c),t.compileShader(d);var p=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(p,h),t.compileShader(p);var f=t.createProgram();if(t.attachShader(f,d),t.attachShader(f,p),t.deleteShader(d),t.deleteShader(p),e(a))for(var v in a)a.hasOwnProperty(v)&&t.bindAttribLocation(f,a[v],v);if(t.linkProgram(f),!t.getProgramParameter(f,t.LINK_STATUS)){if(!t.getShaderParameter(p,t.COMPILE_STATUS))throw s=t.getShaderInfoLog(p),t.deleteProgram(f),console.error("[GL] Fragment shader compile log: "+s),new i("Fragment shader failed to compile. Compile log: "+s);if(!t.getShaderParameter(d,t.COMPILE_STATUS))throw s=t.getShaderInfoLog(d),t.deleteProgram(f),console.error("[GL] Vertex shader compile log: "+s),new i("Vertex shader failed to compile. Compile log: "+s);throw s=t.getProgramInfoLog(f),t.deleteProgram(f),console.error("[GL] Shader program link log: "+s),new i("Program failed to link. Link log: "+s)}return r&&(s=t.getShaderInfoLog(d),e(s)&&s.length>0&&console.log("[GL] Vertex shader compile log: "+s)),r&&(s=t.getShaderInfoLog(p),e(s)&&s.length>0&&console.log("[GL] Fragment shader compile log: "+s)),r&&(s=t.getProgramInfoLog(f),e(s)&&s.length>0&&console.log("[GL] Shader program link log: "+s)),f}function C(e,t,r){for(var i={},n=0;r>n;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:a}}return i}function S(e,t){for(var r={},i=[],n=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),a=0;o>a;++a){var s=e.getActiveUniform(t,a),l="[0]",u=-1!==s.name.indexOf(l,s.name.length-l.length)?s.name.slice(0,s.name.length-3):s.name;if(0!==u.indexOf("gl_"))if(s.name.indexOf("[")<0){var c=e.getUniformLocation(t,u),h=e.getUniform(t,c),d=new T(e,s,u,c,h);r[u]=d,i.push(d),d._setSampler&&n.push(d)}else{var m,p,f,v,g=u.indexOf("[");if(g>=0){if(m=r[u.slice(0,g)],"undefined"==typeof m)continue;p=m._getLocations(),p.length<=1&&(f=m.value,v=e.getUniformLocation(t,u),p.push(v),f.push(e.getUniform(t,v)))}else{p=[],f=[];for(var _=0;_i;++i)r.uniform1f(d[i],e[i])};case r.FLOAT_VEC2:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i){var n=e[i];r.uniform2f(d[i],n.x,n.y)}};case r.FLOAT_VEC3:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i){var n=e[i];r.uniform3f(d[i],n.x,n.y,n.z)}};case r.FLOAT_VEC4:return function(){for(var i=this.value,n=i.length,o=0;n>o;++o){var a=i[o];if(e(a.red))r.uniform4f(d[o],a.red,a.green,a.blue,a.alpha);else{if(!e(a.x))throw new t("Invalid vec4 value.");r.uniform4f(d[o],a.x,a.y,a.z,a.w)}}};case r.SAMPLER_2D:case r.SAMPLER_CUBE:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i){var n=e[i],o=this.textureUnitIndex+i;r.activeTexture(r.TEXTURE0+o),r.bindTexture(n._getTarget(),n._getTexture())}};case r.INT:case r.BOOL:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i)r.uniform1i(d[i],e[i])};case r.INT_VEC2:case r.BOOL_VEC2:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i){var n=e[i];r.uniform2i(d[i],n.x,n.y)}};case r.INT_VEC3:case r.BOOL_VEC3:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i){var n=e[i];r.uniform3i(d[i],n.x,n.y,n.z)}};case r.INT_VEC4:case r.BOOL_VEC4:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i){var n=e[i];r.uniform4i(d[i],n.x,n.y,n.z,n.w)}};case r.FLOAT_MAT2:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i)r.uniformMatrix2fv(d[i],!1,o.toArray(e[i],E))};case r.FLOAT_MAT3:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i)r.uniformMatrix3fv(d[i],!1,a.toArray(e[i],x))};case r.FLOAT_MAT4:return function(){for(var e=this.value,t=e.length,i=0;t>i;++i)r.uniformMatrix4fv(d[i],!1,s.toArray(e[i],b))};default:throw new i("Unrecognized uniform type: "+n.type)}}(),(n.type===r.SAMPLER_2D||n.type===r.SAMPLER_CUBE)&&(this._setSampler=function(e){this.textureUnitIndex=e;for(var t=d.length,i=0;t>i;++i){var n=e+i;r.uniform1i(d[i],n)}return e+t})},P=function(e,t,r,i,n){var o=y(e,t,r,i,n),a=e.getProgramParameter(o,e.ACTIVE_ATTRIBUTES),s=S(e,o),l=w(s.uniformsByName);this._gl=e,this._program=o,this._numberOfVertexAttributes=a,this._vertexAttributes=C(e,o,a),this._uniformsByName=s.uniformsByName,this._uniforms=s.uniforms,this._automaticUniforms=l.automaticUniforms,this._manualUniforms=l.manualUniforms,this.maximumTextureUnitIndex=d(e,o,s.samplerUniforms),this.vertexShaderSource=r,this.fragmentShaderSource=i};P._czmBuiltinsAndUniforms={};for(var D in c)c.hasOwnProperty(D)&&(P._czmBuiltinsAndUniforms[D]=c[D]);for(var M in l)if(l.hasOwnProperty(M)){var I=l[M];"function"==typeof I.getDeclaration&&(P._czmBuiltinsAndUniforms[M]=I.getDeclaration(M))}return P.prototype.getVertexAttributes=function(){return this._vertexAttributes},P.prototype.getNumberOfVertexAttributes=function(){return this._numberOfVertexAttributes},P.prototype.getAllUniforms=function(){return this._uniformsByName},P.prototype.getManualUniforms=function(){return this._manualUniforms},P.prototype._bind=function(){this._gl.useProgram(this._program)},P.prototype._setUniforms=function(e,r,i){var n,o,a=this._uniforms,s=this._manualUniforms,l=this._automaticUniforms;if(e)for(var u in s)s.hasOwnProperty(u)&&(s[u].value=e[u]());for(n=l.length,o=0;n>o;++o)l[o].uniform.value=l[o].automaticUniform.getValue(r);for(n=a.length,o=0;n>o;++o)a[o]._set();if(i){var c=this._gl,h=this._program;if(c.validateProgram(h),!c.getProgramParameter(h,c.VALIDATE_STATUS))throw new t("Program validation failed. Link log: "+c.getProgramInfoLog(h)) +}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return this._gl.deleteProgram(this._program),n(this)},P.prototype.release=function(){return this._cachedShader?this._cachedShader.cache.releaseShaderProgram(this):this.destroy()},P}),r("Renderer/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./PixelFormat"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r,n,o,a){this.bottomLeft=i(e,t.ZERO),this.topRight=i(r,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function u(e,r){var i=e.getNumberOfImages(),o=2;if(i>0){var a=e._texture.getWidth(),s=e._texture.getHeight(),u=o*(a+r.width+e._borderWidthInPixels),c=o*(s+r.height+e._borderWidthInPixels),h=a/u,d=s/c,m=new l(new t(a+e._borderWidthInPixels,0),new t(u,s)),p=new l(new t,new t(u,s),e._root,m),f=new l(new t(0,s+e._borderWidthInPixels),new t(u,c)),v=new l(new t,new t(u,c),p,f);e._root=v;for(var g=0;gs||0>u)return void 0;if(0===s&&0===u)return r;if(s>u){r.childNode1=new l(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var h=r.bottomLeft.x+i.width+e._borderWidthInPixels;h0&&this.addImages(c);var h=e.image;n(h)&&this.addImage(h)};return m.prototype.addImage=function(e){var t=this.getNumberOfImages();return h(this,e,t),this._guid=r(),t},m.prototype.addImages=function(e){var t,i=[],n=e.length,o=this.getNumberOfImages();for(t=0;n>t;++t)i.push({image:e[t],index:t+o});for(i.sort(function(e,t){return Math.max(t.image.height,t.image.width)-Math.max(e.image.height,e.image.width)}),t=0;n>t;++t){var a=i[t];h(this,a.image,a.index)}return this._guid=r(),o},m.prototype.addSubRegions=function(t,i){for(var n=this.addImage(t),o=this._texture.getWidth(),a=this._texture.getHeight(),s=this.getNumberOfImages(),l=i.length,u=this._textureCoordinates[n],c=0;l>c;++c){var h=i[c];this._textureCoordinates.push(new e(u.x+h.x/o,u.y+h.y/a,h.width/o,h.height/a))}return this._guid=r(),s},m.prototype.getBorderWidthInPixels=function(){return this._borderWidthInPixels},m.prototype.getTextureCoordinates=function(){return this._textureCoordinates},m.prototype.getTexture=function(){return this._texture},m.prototype.getNumberOfImages=function(){return this._textureCoordinates.length},m.prototype.getGUID=function(){return this._guid},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),o(this)},m}),r("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,t){u.clone(t,e._view),u.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function p(e,t){u.clone(t,e._inverseView),u.getRotation(t,e._inverseViewRotation)}function f(e,t){u.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function v(e,t){u.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function g(e,t){r.clone(t.positionWC,e._cameraPosition),r.clone(t.directionWC,e._cameraDirection),r.clone(t.rightWC,e._cameraRight),r.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function _(e,t){o(h.computeIcrfToFixedMatrix(t.time,V))||(V=h.computeTemeToPseudoFixedMatrix(t.time,V));var i=c.ComputeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);l.multiplyByVector(V,i,i),r.normalize(i,e._sunDirectionWC),i=l.multiplyByVector(e.getViewRotation3D(),i,e._sunDirectionEC),r.normalize(i,i),i=c.ComputeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),l.multiplyByVector(V,i,i),l.multiplyByVector(e.getViewRotation3D(),i,i),r.normalize(i,i);var n=t.scene2D.projection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,k);n.project(s,e._sunPositionColumbusView)}function y(e){if(e._viewportDirty){var t=e._viewport;u.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),u.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function C(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,u.inverse(e._projection,e._inverseProjection))}function S(e){e._modelViewDirty&&(e._modelViewDirty=!1,u.multiplyTransformation(e._view,e._model,e._modelView))}function w(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,u.multiplyTransformation(e.getView3D(),e._model,e._modelView3D))}function E(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.getModelView(),r=e._modelViewRelativeToEye;r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=0,r[13]=0,r[14]=0,r[15]=t[15]}}function x(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,u.inverse(e.getModelView(),e._inverseModelView))}function b(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,u.inverse(e.getModelView3D(),e._inverseModelView3D))}function T(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,u.multiply(e._projection,e._view,e._viewProjection))}function A(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,u.inverse(e.getViewProjection(),e._inverseViewProjection))}function P(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,u.multiply(e._projection,e.getModelView(),e._modelViewProjection))}function D(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,u.inverse(e.getModelViewProjection(),e._inverseModelViewProjection))}function M(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,u.multiply(e._projection,e.getModelViewRelativeToEye(),e._modelViewProjectionRelativeToEye))}function I(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,u.multiply(e._infiniteProjection,e.getModelView(),e._modelViewInfiniteProjection))}function O(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;u.getRotation(e.getInverseModelView(),t),l.transpose(t,t)}}function R(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;u.getRotation(e.getInverseModelView3D(),t),l.transpose(t,t)}}function L(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,u.getRotation(e.getInverseModelView(),e._inverseNormal))}function N(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,u.getRotation(e.getInverseModelView3D(),e._inverseNormal3D))}function B(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,u.multiplyByPoint(e.getInverseModel(),e._cameraPosition,G),a.fromCartesian(G,e._encodedCameraPositionMC))}function z(e,t,i,n,a,l,c,m){var p=H;p.x=e.y,p.y=e.z,p.z=e.x;var f=j;f.x=i.y,f.y=i.z,f.z=i.x;var v=q;v.x=n.y,v.y=n.z,v.z=n.x;var g=Y;g.x=t.y,g.y=t.z,g.z=t.x,l===d.SCENE2D&&(p.z=.5*a);var _=c.unproject(p,X);_.longitude=s.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=s.clamp(_.latitude,-s.PI_OVER_TWO,s.PI_OVER_TWO);var y=c.ellipsoid,C=y.cartographicToCartesian(_,Z),S=h.eastNorthUpToFixedFrame(C,y,J);return u.multiplyByPointAsVector(S,f,f),u.multiplyByPointAsVector(S,v,v),u.multiplyByPointAsVector(S,g,g),o(m)||(m=new u),m[0]=f.x,m[1]=v.x,m[2]=-g.x,m[3]=0,m[4]=f.y,m[5]=v.y,m[6]=-g.y,m[7]=0,m[8]=f.z,m[9]=v.z,m[10]=-g.z,m[11]=0,m[12]=-r.dot(f,C),m[13]=-r.dot(v,C),m[14]=r.dot(g,C),m[15]=1,m}var F=function(){this._viewport=new e,this._viewportCartesian4=new i,this._viewportDirty=!1,this._viewportOrthographicMatrix=u.clone(u.IDENTITY),this._viewportTransformation=u.clone(u.IDENTITY),this._model=u.clone(u.IDENTITY),this._view=u.clone(u.IDENTITY),this._inverseView=u.clone(u.IDENTITY),this._projection=u.clone(u.IDENTITY),this._infiniteProjection=u.clone(u.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._pixelSize=0,this.frameState=void 0,this._temeToPseudoFixed=l.clone(u.IDENTITY),this._view3DDirty=!0,this._view3D=new u,this._inverseView3DDirty=!0,this._inverseView3D=new u,this._inverseModelDirty=!0,this._inverseModel=new u,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new l,this._viewRotation=new l,this._inverseViewRotation=new l,this._viewRotation3D=new l,this._inverseViewRotation3D=new l,this._inverseProjectionDirty=!0,this._inverseProjection=new u,this._modelViewDirty=!0,this._modelView=new u,this._modelView3DDirty=!0,this._modelView3D=new u,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new u,this._inverseModelViewDirty=!0,this._inverseModelView=new u,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new u,this._viewProjectionDirty=!0,this._viewProjection=new u,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new u,this._modelViewProjectionDirty=!0,this._modelViewProjection=new u,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new u,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new u,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new u,this._normalDirty=!0,this._normal=new l,this._normal3DDirty=!0,this._normal3D=new l,this._inverseNormalDirty=!0,this._inverseNormal=new l,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new l,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new a,this._cameraPosition=new r,this._sunPositionWC=new r,this._sunPositionColumbusView=new r,this._sunDirectionWC=new r,this._sunDirectionEC=new r,this._moonDirectionEC=new r,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new r,this._cameraRight=new r,this._cameraUp=new r,this._frustum2DWidth=0,this._eyeHeight2D=new t},V=new l,k=new n;F.prototype.updateFrustum=function(e){f(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&v(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far};var U=new t,W=new t;F.prototype.update=function(e,t){this._mode=t.mode,this._mapProjection=t.scene2D.projection;var r=t.camera;m(this,r.viewMatrix),p(this,r.inverseViewMatrix),g(this,r),t.mode===d.SCENE2D?(this._frustum2DWidth=r.frustum.right-r.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),_(this,t),U.x=e.getDrawingBufferWidth(),U.y=e.getDrawingBufferHeight();var i=r.frustum.getPixelSize(U,void 0,W);this._pixelSize=Math.max(i.x,i.y),this._entireFrustum.x=r.frustum.near,this._entireFrustum.y=r.frustum.far,this.updateFrustum(r.frustum),this.frameState=t,this._temeToPseudoFixed=h.computeTemeToPseudoFixedMatrix(t.time,this._temeToPseudoFixed)},F.prototype.setViewport=function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var r=this._viewport,i=this._viewportCartesian4;i.x=r.x,i.y=r.y,i.z=r.width,i.w=r.height,this._viewportDirty=!0}},F.prototype.getViewport=function(){return this._viewport},F.prototype.getViewportCartesian4=function(){return this._viewportCartesian4},F.prototype.getViewportOrthographic=function(){return y(this),this._viewportOrthographicMatrix},F.prototype.getViewportTransformation=function(){return y(this),this._viewportTransformation},F.prototype.setModel=function(e){u.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._viewProjectionDirty=!0,this._inverseViewProjectionDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0},F.prototype.getModel=function(){return this._model},F.prototype.getInverseModel=function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,u.inverse(this._model,this._inverseModel)),this._inverseModel},F.prototype.getInverseTranposeModel=function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,u.getRotation(this.getInverseModel(),e),l.transpose(e,e)),e},F.prototype.getView=function(){return this._view},F.prototype.getView3D=function(){return this._view3DDirty&&(this._mode===d.SCENE3D?u.clone(this._view,this._view3D):z(this._cameraPosition,this._cameraDirection,this._cameraRight,this._cameraUp,this._frustum2DWidth,this._mode,this._mapProjection,this._view3D),u.getRotation(this._view3D,this._viewRotation3D),this._view3DDirty=!1),this._view3D},F.prototype.getViewRotation=function(){return this._viewRotation},F.prototype.getViewRotation3D=function(){return this.getView3D(),this._viewRotation3D},F.prototype.getInverseView=function(){return this._inverseView},F.prototype.getInverseView3D=function(){return this._inverseView3DDirty&&(u.inverseTransformation(this.getView3D(),this._inverseView3D),u.getRotation(this._inverseView3D,this._inverseViewRotation3D),this._inverseView3DDirty=!1),this._inverseView3D},F.prototype.getInverseViewRotation=function(){return this._inverseViewRotation},F.prototype.getInverseViewRotation3D=function(){return this.getInverseView3D(),this._inverseViewRotation3D},F.prototype.getProjection=function(){return this._projection},F.prototype.getInverseProjection=function(){return C(this),this._inverseProjection},F.prototype.getInfiniteProjection=function(){return this._infiniteProjection},F.prototype.getModelView=function(){return S(this),this._modelView},F.prototype.getModelView3D=function(){return w(this),this._modelView3D},F.prototype.getModelViewRelativeToEye=function(){return E(this),this._modelViewRelativeToEye},F.prototype.getInverseModelView=function(){return x(this),this._inverseModelView},F.prototype.getInverseModelView3D=function(){return b(this),this._inverseModelView3D},F.prototype.getViewProjection=function(){return T(this),this._viewProjection},F.prototype.getInverseViewProjection=function(){return A(this),this._inverseViewProjection},F.prototype.getModelViewProjection=function(){return P(this),this._modelViewProjection},F.prototype.getInverseModelViewProjection=function(){return D(this),this._inverseModelViewProjection},F.prototype.getModelViewProjectionRelativeToEye=function(){return M(this),this._modelViewProjectionRelativeToEye},F.prototype.getModelViewInfiniteProjection=function(){return I(this),this._modelViewInfiniteProjection},F.prototype.getNormal=function(){return O(this),this._normal},F.prototype.getNormal3D=function(){return R(this),this._normal3D},F.prototype.getInverseNormal=function(){return L(this),this._inverseNormal},F.prototype.getInverseNormal3D=function(){return N(this),this._inverseNormal3D},F.prototype.getEntireFrustum=function(){return this._entireFrustum},F.prototype.getCurrentFrustum=function(){return this._currentFrustum},F.prototype.getEyeHeight2D=function(){return this._eyeHeight2D},F.prototype.getPixelSize=function(){return this._pixelSize},F.prototype.getSunPositionWC=function(){return this._sunPositionWC},F.prototype.getSunPositionColumbusView=function(){return this._sunPositionColumbusView},F.prototype.getSunDirectionWC=function(){return this._sunDirectionWC},F.prototype.getSunDirectionEC=function(){return this._sunDirectionEC},F.prototype.getMoonDirectionEC=function(){return this._moonDirectionEC};var G=new r;F.prototype.getEncodedCameraPositionMCHigh=function(){return B(this),this._encodedCameraPositionMC.high},F.prototype.getEncodedCameraPositionMCLow=function(){return B(this),this._encodedCameraPositionMC.low},F.prototype.getTemeToPseudoFixedMatrix=function(){return this._temeToPseudoFixed},F.prototype.getHighResolutionSnapScale=function(){return 1};var H=new r,j=new r,q=new r,Y=new r,X=new n,Z=new r,J=new u;return F}),r("Renderer/VertexArray",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/ComponentDatatype"],function(e,t,r,i,n){"use strict";function o(r,i,o){var a=t(i.vertexBuffer),s=t(i.value),l=i.value?i.value.length:i.componentsPerAttribute,u={index:e(i.index,o),enabled:e(i.enabled,!0),vertexBuffer:i.vertexBuffer,value:s?i.value.slice(0):void 0,componentsPerAttribute:l,componentDatatype:e(i.componentDatatype,n.FLOAT),normalize:e(i.normalize,!1),offsetInBytes:e(i.offsetInBytes,0),strideInBytes:e(i.strideInBytes,0)};if(a)u.vertexAttrib=function(e){e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(this.index,this.componentsPerAttribute,this.componentDatatype.value,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(this.index)},u.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index)};else{switch(u.componentsPerAttribute){case 1:u.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:u.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:u.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:u.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}u.disableVertexAttribArray=function(){}}r.push(u)}function a(e,r,i){for(var n=0;ni;++i){var n=e.getExtension(t[i]);if(n)return n}return void 0}function W(e,t,r,i){var n;"number"==typeof r?n=r:"object"==typeof r&&"number"==typeof r.byteLength&&(n=r.byteLength);var o=e.createBuffer();return e.bindBuffer(t,o),e.bufferData(t,r,i),e.bindBuffer(t,null),new p(e,t,n,i,o)}function G(e){if(e._validateFB){var t=e._gl,r=t.checkFramebufferStatus(t.FRAMEBUFFER);if(r!==t.FRAMEBUFFER_COMPLETE){var n;switch(r){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:n="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:n="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:n="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:n="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new i(n)}}}function H(e,t,r){var i=e._currentRenderState;i!==t&&(e._currentRenderState=t,E.partialApply(e._gl,i,t,r))}function j(e,t,i,n){var o=r(i.renderState)?i.renderState:e._defaultRenderState;if(t!==e._currentFamebuffer){e._currentFramebuffer=t;var a=rt;r(t)&&(t._bind(),G(e,t),a=t._getActiveColorAttachments()),e.getDrawBuffers()&&e._drawBuffers.drawBuffersWEBGL(a)}var s=i.shaderProgram;s._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,s.maximumTextureUnitIndex),H(e,o,n)}function q(e,i){var n=i.primitiveType,o=i.vertexArray,a=i.offset,s=i.count;e._us.setModel(t(i.modelMatrix,d.IDENTITY)),i.shaderProgram._setUniforms(i.uniformMap,e._us,e._validateSP);var l=o.getIndexBuffer();r(l)?(a*=l.getBytesPerIndex(),s=t(s,l.getNumberOfIndices()),o._bind(),e._gl.drawElements(n,s,l.getIndexDatatype(),a),o._unBind()):(s=t(s,o.numberOfVertices),o._bind(),e._gl.drawArrays(n,a,s),o._unBind())}function Y(e,t){r(t)&&t._unBind()}function X(e){return e.values.length/e.componentsPerAttribute}function Z(e){return e.componentDatatype.sizeInBytes*e.componentsPerAttribute}function J(e){var t,i,n,o=[];for(i in e)e.hasOwnProperty(i)&&r(e[i])&&r(e[i].values)&&(o.push(i),e[i].componentDatatype.value===a.DOUBLE.value&&(e[i].componentDatatype=a.FLOAT,e[i].values=a.createTypedArray(a.FLOAT,e[i].values)));var s,u=o.length;if(u>0)for(s=X(e[o[0]]),t=1;u>t;++t){var c=X(e[o[t]]);if(c!==s)throw new l("Each attribute list must have the same number of vertices. Attribute "+o[t]+" has a different number of vertices "+"("+c.toString()+")"+" than attribute "+o[0]+" ("+s.toString()+").")}o.sort(function(t,r){return e[r].componentDatatype.sizeInBytes-e[t].componentDatatype.sizeInBytes});var h=0,d={};for(t=0;u>t;++t)i=o[t],n=e[i],d[i]=h,h+=Z(n);if(h>0){var m=e[o[0]].componentDatatype.sizeInBytes,p=h%m;0!==p&&(h+=m-p);var f=s*h,v=new ArrayBuffer(f),g={};for(t=0;u>t;++t){i=o[t];var _=e[i].componentDatatype.sizeInBytes;g[i]={pointer:a.createTypedArray(e[i].componentDatatype,v),index:d[i]/_,strideInComponentType:h/_}}for(t=0;s>t;++t)for(var y=0;u>y;++y){i=o[y],n=e[i];for(var C=n.values,S=g[i],w=S.pointer,E=n.componentsPerAttribute,x=0;E>x;++x)w[S.index+x]=C[t*E+x];S.index+=S.strideInComponentType}return{buffer:v,offsetsInBytes:d,vertexSizeInBytes:h}}return void 0}function Q(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var K=function(i,n){if("undefined"==typeof WebGLRenderingContext)throw new l("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=i,n=e(n,!0),n=t(n,{}),n.allowTextureFilterAnisotropic=t(n.allowTextureFilterAnisotropic,!0);var a=t(n.webgl,{});if(a.alpha=t(a.alpha,!1),a.stencil=t(a.stencil,!1),a.failIfMajorPerformanceCaveat=t(a.failIfMajorPerformanceCaveat,!0),this._originalGLContext=i.getContext("webgl",a)||i.getContext("experimental-webgl",a)||void 0,!r(this._originalGLContext))throw new l("The browser supports WebGL, but initialization failed.");this._id=h(),this._validateFB=!1,this._validateSP=!1,this._logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new x(this);var s=this._gl=this._originalGLContext;this._version=s.getParameter(s.VERSION),this._shadingLanguageVersion=s.getParameter(s.SHADING_LANGUAGE_VERSION),this._vendor=s.getParameter(s.VENDOR),this._renderer=s.getParameter(s.RENDERER),this._redBits=s.getParameter(s.RED_BITS),this._greenBits=s.getParameter(s.GREEN_BITS),this._blueBits=s.getParameter(s.BLUE_BITS),this._alphaBits=s.getParameter(s.ALPHA_BITS),this._depthBits=s.getParameter(s.DEPTH_BITS),this._stencilBits=s.getParameter(s.STENCIL_BITS),this._maximumCombinedTextureImageUnits=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._maximumCubeMapSize=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),this._maximumFragmentUniformVectors=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),this._maximumTextureImageUnits=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),this._maximumRenderbufferSize=s.getParameter(s.MAX_RENDERBUFFER_SIZE),this._maximumTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),this._maximumVaryingVectors=s.getParameter(s.MAX_VARYING_VECTORS),this._maximumVertexAttributes=s.getParameter(s.MAX_VERTEX_ATTRIBS),this._maximumVertexTextureImageUnits=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._maximumVertexUniformVectors=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),this._aliasedLineWidthRange=s.getParameter(s.ALIASED_LINE_WIDTH_RANGE),this._aliasedPointSizeRange=s.getParameter(s.ALIASED_POINT_SIZE_RANGE),this._maximumViewportDimensions=s.getParameter(s.MAX_VIEWPORT_DIMS),this._antialias=s.getContextAttributes().antialias,this._standardDerivatives=U(s,["OES_standard_derivatives"]),this._elementIndexUint=U(s,["OES_element_index_uint"]),this._depthTexture=U(s,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=U(s,["OES_texture_float"]);var u=n.allowTextureFilterAnisotropic?U(s,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=u,this._maximumTextureFilterAnisotropy=r(u)?s.getParameter(u.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,this._vertexArrayObject=U(s,["OES_vertex_array_object"]),this._fragDepth=U(s,["EXT_frag_depth"]),this._drawBuffers=U(s,["WEBGL_draw_buffers"]),this._maximumDrawBuffers=r(this._drawBuffers)?s.getParameter(this._drawBuffers.MAX_DRAW_BUFFERS_WEBGL):1,this._maximumColorAttachments=r(this._drawBuffers)?s.getParameter(this._drawBuffers.MAX_COLOR_ATTACHMENTS_WEBGL):1;var c=s.getParameter(s.COLOR_CLEAR_VALUE);this._clearColor=new o(c[0],c[1],c[2],c[3]),this._clearDepth=s.getParameter(s.DEPTH_CLEAR_VALUE),this._clearStencil=s.getParameter(s.STENCIL_CLEAR_VALUE);var d=new I,m=new N(this),p=this.createRenderState();this._defaultPassState=m,this._defaultRenderState=p,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=d,this._currentRenderState=p,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=n,this.cache={},E.apply(s,p,m)};K.prototype.getId=function(){return this._id},K.prototype.getCanvas=function(){return this._canvas},K.prototype.getShaderCache=function(){return this._shaderCache},K.prototype.getUniformState=function(){return this._us},K.prototype.getVersion=function(){return this._version},K.prototype.getShadingLanguageVersion=function(){return this._shadingLanguageVersion},K.prototype.getVendor=function(){return this._vendor},K.prototype.getRenderer=function(){return this._renderer},K.prototype.getRedBits=function(){return this._redBits},K.prototype.getGreenBits=function(){return this._greenBits},K.prototype.getBlueBits=function(){return this._blueBits},K.prototype.getAlphaBits=function(){return this._alphaBits},K.prototype.getDepthBits=function(){return this._depthBits},K.prototype.getStencilBits=function(){return this._stencilBits},K.prototype.getMaximumCombinedTextureImageUnits=function(){return this._maximumCombinedTextureImageUnits},K.prototype.getMaximumCubeMapSize=function(){return this._maximumCubeMapSize},K.prototype.getMaximumFragmentUniformVectors=function(){return this._maximumFragmentUniformVectors},K.prototype.getMaximumTextureImageUnits=function(){return this._maximumTextureImageUnits +},K.prototype.getMaximumRenderbufferSize=function(){return this._maximumRenderbufferSize},K.prototype.getMaximumTextureSize=function(){return this._maximumTextureSize},K.prototype.getMaximumVaryingVectors=function(){return this._maximumVaryingVectors},K.prototype.getMaximumVertexAttributes=function(){return this._maximumVertexAttributes},K.prototype.getMaximumVertexTextureImageUnits=function(){return this._maximumVertexTextureImageUnits},K.prototype.getMaximumVertexUniformVectors=function(){return this._maximumVertexUniformVectors},K.prototype.getMinimumAliasedLineWidth=function(){return this._aliasedLineWidthRange[0]},K.prototype.getMaximumAliasedLineWidth=function(){return this._aliasedLineWidthRange[1]},K.prototype.getMinimumAliasedPointSize=function(){return this._aliasedPointSizeRange[0]},K.prototype.getMaximumAliasedPointSize=function(){return this._aliasedPointSizeRange[1]},K.prototype.getMaximumViewportWidth=function(){return this._maximumViewportDimensions[0]},K.prototype.getMaximumViewportHeight=function(){return this._maximumViewportDimensions[1]},K.prototype.getAntialias=function(){return this._antialias},K.prototype.getStandardDerivatives=function(){return!!this._standardDerivatives},K.prototype.getElementIndexUint=function(){return!!this._elementIndexUint},K.prototype.getDepthTexture=function(){return!!this._depthTexture},K.prototype.getFloatingPointTexture=function(){return!!this._textureFloat},K.prototype.getTextureFilterAnisotropic=function(){return!!this._textureFilterAnisotropic},K.prototype.getMaximumTextureFilterAnisotropy=function(){return this._maximumTextureFilterAnisotropy},K.prototype.getVertexArrayObject=function(){return!!this._vertexArrayObject},K.prototype.getFragmentDepth=function(){return!!this._fragDepth},K.prototype.getDrawBuffers=function(){return!!this._drawBuffers},K.prototype.getMaximumDrawBuffers=function(){return this._maximumDrawBuffers},K.prototype.getMaximumColorAttachments=function(){return this._maximumColorAttachments},K.prototype.getValidateFramebuffer=function(){return this._validateFB},K.prototype.setValidateFramebuffer=function(e){this._validateFB=e},K.prototype.getValidateShaderProgram=function(){return this._validateSP},K.prototype.setValidateShaderProgram=function(e){this._validateSP=e},K.prototype.getThrowOnWebGLError=function(){return this._throwOnWebGLError},K.prototype.setThrowOnWebGLError=function(e){this._throwOnWebGLError=e,this._gl=k(this._originalGLContext,e?F:null)},K.prototype.getLogShaderCompilation=function(){return this._logShaderCompilation},K.prototype.setLogShaderCompilation=function(e){this._logShaderCompilation=e},K.prototype.getDefaultTexture=function(){return void 0===this._defaultTexture&&(this._defaultTexture=this.createTexture2D({source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture},K.prototype.getDefaultCubeMap=function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=this.createCubeMap({source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap},K.prototype.getDrawingBufferHeight=function(){return this._gl.drawingBufferHeight},K.prototype.getDrawingBufferWidth=function(){return this._gl.drawingBufferWidth},K.prototype.createShaderProgram=function(e,t,r){return new b(this._gl,this._logShaderCompilation,e,t,r)},K.prototype.createVertexBuffer=function(e,t){return W(this._gl,this._gl.ARRAY_BUFFER,e,t)},K.prototype.createIndexBuffer=function(e,t,r){if(r===s.UNSIGNED_INT&&!this.getElementIndexUint())throw new l("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system.");var i=s.getSizeInBytes(r),n=this._gl,o=W(n,n.ELEMENT_ARRAY_BUFFER,e,t),a=o.getSizeInBytes()/i;return o.getIndexDatatype=function(){return r},o.getBytesPerIndex=function(){return i},o.getNumberOfIndices=function(){return a},o},K.prototype.createVertexArray=function(e,t){return new O(this._gl,this._vertexArrayObject,e,t)},K.prototype.createTexture2D=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.source,n=r(i)?i.width:e.width,o=r(i)?i.height:e.height,a=t(e.pixelFormat,y.RGBA),s=t(e.pixelDatatype,_.UNSIGNED_BYTE);if(s===_.FLOAT&&!this.getFloatingPointTexture())throw new l("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(y.isDepthFormat(a)&&!this.getDepthTexture())throw new l("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check getDepthTexture().");var u=e.preMultiplyAlpha||a===y.RGB||a===y.LUMINANCE,c=t(e.flipY,!0),h=this._gl,d=h.TEXTURE_2D,m=h.createTexture();return h.activeTexture(h.TEXTURE0),h.bindTexture(d,m),r(i)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),r(i.arrayBufferView)?h.texImage2D(d,0,a,n,o,0,a,s,i.arrayBufferView):h.texImage2D(d,0,a,a,s,i)):h.texImage2D(d,0,a,n,o,0,a,s,null),h.bindTexture(d,null),new T(h,this._textureFilterAnisotropic,d,m,a,s,n,o,u,c)},K.prototype.createTexture2DFromFramebuffer=function(e,r,i,n,o){var a=this._gl;e=t(e,y.RGB),r=t(r,0),i=t(i,0),n=t(n,a.drawingBufferWidth),o=t(o,a.drawingBufferHeight);var s=a.TEXTURE_2D,l=a.createTexture();return a.activeTexture(a.TEXTURE0),a.bindTexture(s,l),a.copyTexImage2D(s,0,e,r,i,n,o,0),a.bindTexture(s,null),new T(a,this._textureFilterAnisotropic,s,l,e,void 0,n,o)},K.prototype.createTextureAtlas=function(e){return e=t(e,{}),e.context=this,new A(e)},K.prototype.createCubeMap=function(e){function i(e,t){t.arrayBufferView?p.texImage2D(e,0,c,u,u,0,c,h,t.arrayBufferView):p.texImage2D(e,0,c,c,h,t)}e=t(e,t.EMPTY_OBJECT);var n,o,a=e.source;if(r(a)){var s=[a.positiveX,a.negativeX,a.positiveY,a.negativeY,a.positiveZ,a.negativeZ];n=s[0].width,o=s[0].height}else n=e.width,o=e.height;var u=n,c=t(e.pixelFormat,y.RGBA),h=t(e.pixelDatatype,_.UNSIGNED_BYTE);if(h===_.FLOAT&&!this.getFloatingPointTexture())throw new l("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");var d=e.preMultiplyAlpha||c===y.RGB||c===y.LUMINANCE,m=t(e.flipY,!0),p=this._gl,f=p.TEXTURE_CUBE_MAP,g=p.createTexture();return p.activeTexture(p.TEXTURE0),p.bindTexture(f,g),r(a)?(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,m),i(p.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX),i(p.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX),i(p.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY),i(p.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY),i(p.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ),i(p.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ)):(p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,u,u,0,c,h,null),p.texImage2D(p.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,u,u,0,c,h,null)),p.bindTexture(f,null),new v(p,this._textureFilterAnisotropic,f,g,c,h,u,d,m)},K.prototype.createFramebuffer=function(e){return new g(this._gl,this._maximumColorAttachments,e)},K.prototype.createRenderbuffer=function(e){var i=this._gl;e=t(e,t.EMPTY_OBJECT);var n=t(e.format,w.RGBA4),o=r(e.width)?e.width:i.drawingBufferWidth,a=r(e.height)?e.height:i.drawingBufferHeight;return new S(i,n,o,a)};var $=0,et={};K.prototype.createRenderState=function(e){var t=JSON.stringify(e),i=et[t];if(r(i))return i;var n=new E(this,e),o=JSON.stringify(n);return i=et[o],r(i)||(n.id=$++,i=n,et[o]=i),et[t]=i,i},K.prototype.createSampler=function(e){var i={wrapS:t(e.wrapS,M.CLAMP_TO_EDGE),wrapT:t(e.wrapT,M.CLAMP_TO_EDGE),minificationFilter:t(e.minificationFilter,D.LINEAR),magnificationFilter:t(e.magnificationFilter,P.LINEAR),maximumAnisotropy:r(e.maximumAnisotropy)?e.maximumAnisotropy:1};return i};var tt=new L;K.prototype.clear=function(e,i){e=t(e,tt),i=t(i,this._defaultPassState);var n=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;r(s)&&(o.equals(this._clearColor,s)||(o.clone(s,this._clearColor),n.clearColor(s.red,s.green,s.blue,s.alpha)),a|=n.COLOR_BUFFER_BIT),r(l)&&(l!==this._clearDepth&&(this._clearDepth=l,n.clearDepth(l)),a|=n.DEPTH_BUFFER_BIT),r(u)&&(u!==this._clearStencil&&(this._clearStencil=u,n.clearStencil(u)),a|=n.STENCIL_BUFFER_BIT);var c=t(e.renderState,this._defaultRenderState);H(this,c,i);var h=t(e.framebuffer,i.framebuffer);r(h)&&(h._bind(),G(this,h)),n.clear(a),r(h)&&h._unBind()};var rt;return"undefined"!=typeof WebGLRenderingContext&&(rt=[WebGLRenderingContext.BACK]),K.prototype.draw=function(e,r){r=t(r,this._defaultPassState);var i=t(e.framebuffer,r.framebuffer);j(this,i,e,r),q(this,e),Y(this,i)},K.prototype.endFrame=function(){var e=this._gl;e.useProgram(null);var t=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;t>r;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},K.prototype.readPixels=function(e){var t=this._gl;e=e||{};var r=Math.max(e.x||0,0),i=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer||null,s=new Uint8Array(4*n*o);return a&&(a._bind(),G(this,a)),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),a&&a._unBind(),s},K.prototype.createVertexArrayFromGeometry=function(e){var i,n,o,l=t(e,t.EMPTY_OBJECT),u=t(l.geometry,t.EMPTY_OBJECT),h=t(l.bufferUsage,f.DYNAMIC_DRAW),d=t(l.attributeLocations,t.EMPTY_OBJECT),p=r(l.vertexLayout)&&l.vertexLayout===R.INTERLEAVED,v=l.vertexArrayAttributes,g=r(v)?v:[],_=u.attributes;if(p){var y=J(_);if(r(y)){o=this.createVertexBuffer(y.buffer,h);var C=y.offsetsInBytes,S=y.vertexSizeInBytes;for(i in _)_.hasOwnProperty(i)&&r(_[i])&&(n=_[i],r(n.values)?g.push({index:d[i],vertexBuffer:o,componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,offsetInBytes:C[i],strideInBytes:S}):g.push({index:d[i],value:n.value,componentDatatype:n.componentDatatype,normalize:n.normalize}))}}else for(i in _)if(_.hasOwnProperty(i)&&r(_[i])){n=_[i];var w=n.componentDatatype;w.value===a.DOUBLE.value&&(w=a.FLOAT),o=void 0,r(n.values)&&(o=this.createVertexBuffer(a.createTypedArray(w,n.values),h)),g.push({index:d[i],vertexBuffer:o,value:n.value,componentDatatype:w,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize})}var E,x=u.indices;return r(x)&&(E=c.computeNumberOfVertices(u)>m.SIXTY_FOUR_KILOBYTES&&this.getElementIndexUint()?this.createIndexBuffer(new Uint32Array(x),h,s.UNSIGNED_INT):this.createIndexBuffer(new Uint16Array(x),h,s.UNSIGNED_SHORT)),this.createVertexArray(g,E)},K.prototype.createPickFramebuffer=function(){return new C(this)},K.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},Q.prototype.destroy=function(){return delete this._pickObjects[this.key],void 0},K.prototype.createPickId=function(e){++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new l("Out of unique Pick IDs.");return this._pickObjects[t]=e,new Q(this._pickObjects,t,o.fromRgba(t))},K.prototype.isDestroyed=function(){return!1},K.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];r(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),n(this)},K}),r("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when"],function(e,t,r,i){"use strict";var n=function(e,t,n){var o=[r(t.positiveX,n),r(t.negativeX,n),r(t.positiveY,n),r(t.negativeY,n),r(t.positiveZ,n),r(t.negativeZ,n)];return i.all(o,function(t){return e.createCubeMap({source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})};return n}),r("ThirdParty/Tween",[],function(){var e=e||function(){var e=[];return{REVISION:"12",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)},update:function(t){if(0===e.length)return!1;var r=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();re;e++)f[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return m=e,this},this.interpolation=function(e){return p=e,this},this.chain=function(){return f=arguments,this},this.onStart=function(e){return v=e,this},this.onUpdate=function(e){return _=e,this},this.onComplete=function(e){return y=e,this},this.update=function(e){var t;if(d>e)return!0;g===!1&&(null!==v&&v.call(r),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=m(u);for(t in n){var S=i[t]||0,w=n[t];w instanceof Array?r[t]=p(w,C):("string"==typeof w&&(w=S+parseFloat(w,10)),"number"==typeof w&&(r[t]=S+(w-S)*C))}if(null!==_&&_.call(r,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var E=o[t];o[t]=n[t],n[t]=E,c=!c}i[t]=o[t]}return d=e+h,!0}null!==y&&y.call(r);for(var x=0,b=f.length;b>x;x++)f[x].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/i)))},Out:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/i)+1)},InOut:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/i):.5*r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/i)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return.5>t?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return 0>r?a(t[0],t[1],n):r>1?a(t[i],t[i-1],i-n):a(t[o],t[o+1>i?i:o+1],n-o)},Bezier:function(t,r){var i,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(i=0;o>=i;i++)n+=a(1-r,o-i)*a(r,i)*t[i]*s(o,i);return n},CatmullRom:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(0>r&&(o=Math.floor(n=i*(1+r))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],n-o)):0>r?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):r>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[o?o-1:0],t[o],t[o+1>i?i:o+1],t[o+2>i?i:o+2],n-o)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(t,r){var i=e.Interpolation.Utils.Factorial;return i(t)/i(r)/i(t-r)},Factorial:function(){var e=[1];return function(t){var r,i=1;if(e[t])return e[t];for(r=t;r>1;r--)i*=r;return e[t]=i}}(),CatmullRom:function(e,t,r,i,n){var o=.5*(r-e),a=.5*(i-t),s=n*n,l=n*s;return(2*t-2*r+o+a)*l+(-3*t+3*r-2*o-a)*s+o*n+t}}},e}),r("Scene/AnimationCollection",["../Core/defined","../Core/DeveloperError","../Core/clone","../Core/getTimestamp","../ThirdParty/Tween","../Core/defaultValue"],function(e,t,r,i,n,o){"use strict";var a=function(){this._tweens=[]};return a.prototype.getAll=function(){return this._tweens},a.prototype.add=function(e){if(e=o(e,o.EMPTY_OBJECT),e.duration>0){var t=o(e.delayDuration,0),i=o(e.easingFunction,n.Easing.Linear.None),a=r(e.startValue),s=new n.Tween(a);return s.onCancel=e.onCancel,s.to(e.stopValue,e.duration),s.delay(t),s.easing(i),"function"==typeof e.onUpdate&&s.onUpdate(function(){e.onUpdate(a)}),s.onComplete(o(e.onComplete,null)),s.start().stop(),this._tweens.push(s),{_tween:s}}"function"==typeof e.onComplete&&e.onComplete()},a.prototype.addAlpha=function(t,r,i,a){var s=[];for(var l in t.uniforms)t.uniforms.hasOwnProperty(l)&&e(t.uniforms[l])&&e(t.uniforms[l].alpha)&&s.push(l);r=o(r,0),i=o(i,1),a=o(a,o.EMPTY_OBJECT);var u=o(a.duration,3e3),c=o(a.delayDuration,0),h=o(a.easingFunction,n.Easing.Linear.None),d={alpha:r},m=new n.Tween(d);return m.to({alpha:i},u),m.delay(c),m.easing(h),m.onUpdate(function(){for(var e=s.length,r=0;e>r;++r)t.uniforms[s[r]].alpha=d.alpha}),m.onComplete(o(a.onComplete,null)),m.start().stop(),this._tweens.push(m),{_tween:m}},a.prototype.addProperty=function(e,t,r,i,a){a=o(a,o.EMPTY_OBJECT);var s=o(a.duration,3e3),l=o(a.delayDuration,0),u=o(a.easingFunction,n.Easing.Linear.None),c={value:r},h=new n.Tween(c);return h.to({value:i},s),h.delay(l),h.easing(u),h.onUpdate(function(){e[t]=c.value}),h.onComplete(o(a.onComplete,null)),h.start().stop(),this._tweens.push(h),{_tween:h}},a.prototype.addOffsetIncrement=function(e,t){t=o(t,o.EMPTY_OBJECT);var r=o(t.duration,3e3),i=o(t.delayDuration,0),a=o(t.easingFunction,n.Easing.Linear.None),s={offset:e.uniforms.offset},l=new n.Tween(s);return l.to({offset:e.uniforms.offset+1},r),l.delay(i),l.easing(a),l.onUpdate(function(){e.uniforms.offset=s.offset}),l.repeat(1/0),l.start().stop(),this._tweens.push(l),{_tween:l}},a.prototype.remove=function(t){if(!e(t))return!1;var r=t._tween,i=this._tweens.indexOf(r);return-1!==i?("function"==typeof r.onCancel&&r.onCancel(),this._tweens.splice(i,1),!0):!1},a.prototype.removeAll=function(){for(var e=0;en;n+=3)i=a(r,i,e[n],e[n+1],e[n+2]);return r}var l=function(){r.throwInstantiationError()};t(l.prototype,{errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},ready:{get:r.throwInstantiationError}}),l.attributeLocations={position3DAndHeight:0,textureCoordinates:1};var u=[];return l.getRegularGridIndices=function(t,r){var i=u[t];e(i)||(u[t]=i=[]);var n=i[r];if(!e(n)){n=i[r]=new Uint16Array(6*(t-1)*(r-1));for(var o=0,a=0,s=0;r-1>s;++s){for(var l=0;t-1>l;++l){var c=o,h=c+t,d=h+1,m=c+1;n[a++]=c,n[a++]=h,n[a++]=m,n[a++]=m,n[a++]=h,n[a++]=d,++o}++o}}return n},l.createTileEllipsoidGeometryFromBuffers=function(t,r,a,s){var u=i.FLOAT,c=r.vertices,h=t.createVertexBuffer(c,n.STATIC_DRAW),d=5*u.sizeInBytes,m=3;s&&(d+=u.sizeInBytes,++m);var p=[{index:l.attributeLocations.position3DAndHeight,vertexBuffer:h,componentDatatype:u,componentsPerAttribute:m,offsetInBytes:0,strideInBytes:d},{index:l.attributeLocations.textureCoordinates,vertexBuffer:h,componentDatatype:u,componentsPerAttribute:2,offsetInBytes:m*u.sizeInBytes,strideInBytes:d}],f=r.indices.indexBuffers||{},v=f[t.getId()];if(!e(v)||v.isDestroyed()){var g=r.indices;v=t.createIndexBuffer(g,n.STATIC_DRAW,o.UNSIGNED_SHORT),v.setVertexArrayDestroyable(!1),v.referenceCount=1,f[t.getId()]=v,r.indices.indexBuffers=f}else++v.referenceCount;a.vertexArray=t.createVertexArray(p,v)},l.createWireframeVertexArray=function(e,t,r){var i=s(r.indices),a=e.createIndexBuffer(i,n.STATIC_DRAW,o.UNSIGNED_SHORT);return e.createVertexArray(t._attributes,a)},l.heightmapTerrainQuality=.25,l.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*l.heightmapTerrainQuality/(t*r)},l.prototype.requestTileGeometry=r.throwInstantiationError,l.prototype.getLevelMaximumGeometricError=r.throwInstantiationError,l.prototype.hasWaterMask=r.throwInstantiationError,l}),r("Scene/TileProviderError",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";var i=function(t,r,i,n,o,a){this.provider=t,this.message=r,this.x=i,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1};return i.handleError=function(e,n,o,a,s,l,u,c){var h=e;return t(e)?(h.provider=n,h.message=a,h.x=s,h.y=l,h.level=u,h.retry=!1,++h.timesRetried):h=new i(n,a,s,l,u,0),o.getNumberOfListeners()>0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+r(a)),h.retry&&t(c)&&c(),h},i.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},i}),r("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","./TerrainProvider","./TerrainState","./TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n,l){function u(t){e.data=t,e.state=o.RECEIVED}function c(){e.state=o.FAILED;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+l+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,r,i,n,l,h)}function h(){e.data=t.requestTileGeometry(i,n,l),r(e.data)?(e.state=o.RECEIVING,s(e.data,u,c)):e.state=o.UNLOADED}h()}function u(e,t,i,n,a,l){var u=i.tilingScheme,c=e.data,h=c.createMesh(u,n,a,l);r(h)&&(e.state=o.TRANSFORMING,s(h,function(t){e.mesh=t,e.state=o.TRANSFORMED},function(){e.state=o.FAILED}))}function c(e,t){n.createTileEllipsoidGeometryFromBuffers(t,e.mesh,e,!0),e.state=o.READY}var h=function(e){this.state=o.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e};return h.prototype.freeResources=function(){if(this.state=o.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.getIndexBuffer();this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},h.prototype.publishToTile=function(r){var i=this.mesh;t.clone(i.center,r.center),r.minimumHeight=i.minimumHeight,r.maximumHeight=i.maximumHeight,r.boundingSphere3D=e.clone(i.boundingSphere3D,r.boundingSphere3D),r.occludeePointInScaledSpace=t.clone(i.occludeePointInScaledSpace,r.occludeePointInScaledSpace),r.freeVertexArray(),r.vertexArray=this.vertexArray,this.vertexArray=void 0},h.prototype.processLoadStateMachine=function(e,t,r,i,n){this.state===o.UNLOADED&&l(this,t,r,i,n),this.state===o.RECEIVED&&u(this,e,t,r,i,n),this.state===o.TRANSFORMED&&c(this,e,t,r,i,n)},h.prototype.processUpsampleStateMachine=function(e,t,i,n,a){if(this.state===o.UNLOADED){var l=this.upsampleDetails,h=l.data,d=l.x,m=l.y,p=l.level;if(this.data=h.upsample(t.tilingScheme,d,m,p,i,n,a),!r(this.data))return;this.state=o.RECEIVING;var f=this;s(this.data,function(e){f.data=e,f.state=o.RECEIVED},function(){f.state=o.FAILED})}this.state===o.RECEIVED&&u(this,e,t,i,n,a),this.state===o.TRANSFORMED&&c(this,e,t,i,n,a)},h}),r("Scene/Tile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","./ImageryState","./TerrainState","./TileState","./TileTerrain","../Renderer/PixelDatatype","../Renderer/PixelFormat","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,r,i){var o=g(e);n(o)&&(e.upsampledTerrain=new u(o)),C(e)&&(e.loadedTerrain=new u);for(var a=0,s=i.length;s>a;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,r)}var c=e.tilingScheme.ellipsoid,h=e.extent;c.cartographicToCartesian(h.getSouthwest(),e.southwestCornerCartesian),c.cartographicToCartesian(h.getNortheast(),e.northeastCornerCartesian),P.longitude=h.west,P.latitude=.5*(h.south+h.north),P.height=0;var d=c.cartographicToCartesian(P,T),m=t.cross(d,t.UNIT_Z,x);t.normalize(m,e.westNormal),P.longitude=h.east;var p=c.cartographicToCartesian(P,A),f=t.cross(t.UNIT_Z,p,x);t.normalize(f,e.eastNormal);var v=c.geodeticSurfaceNormalCartographic(h.getSoutheast(),b),_=t.subtract(d,p,x),y=t.cross(v,_,b);t.normalize(y,e.southNormal);var S=c.geodeticSurfaceNormalCartographic(h.getNorthwest(),b),w=t.cross(_,S,b);t.normalize(w,e.northNormal)}function v(e,t,r){var i=e.loadedTerrain,o=e.upsampledTerrain,a=!1;if(n(i)){if(i.processLoadStateMachine(t,r,e.x,e.y,e.level),i.state.value>=s.RECEIVED.value){if(e.terrainData!==i.data){e.terrainData=i.data;var l=e.terrainData.getWaterMask();n(l)&&(n(e.waterMaskTexture)&&(--e.waterMaskTexture.referenceCount,0===e.waterMaskTexture.referenceCount&&e.waterMaskTexture.destroy()),e.waterMaskTexture=S(t,l),e.waterMaskTranslationAndScale.x=0,e.waterMaskTranslationAndScale.y=0,e.waterMaskTranslationAndScale.z=1,e.waterMaskTranslationAndScale.w=1),y(e)}a=!0}i.state===s.READY?(i.publishToTile(e),e.loadedTerrain=void 0,e.upsampledTerrain=void 0):i.state===s.FAILED&&(e.loadedTerrain=void 0)}!a&&n(o)&&(o.processUpsampleStateMachine(t,r,e.x,e.y,e.level),o.state.value>=s.RECEIVED.value&&e.terrainData!==o.data&&(e.terrainData=o.data,r.hasWaterMask()&&w(e,t),_(e)),o.state===s.READY?(o.publishToTile(e),e.upsampledTerrain=void 0):o.state===s.FAILED&&(e.upsampledTerrain=void 0))}function g(e){for(var t=e.parent;n(t)&&!n(t.terrainData);)t=t.parent;return n(t)?{data:t.terrainData,x:t.x,y:t.y,level:t.level}:void 0}function _(e){if(n(e.children))for(var t=0;4>t;++t){var r=e.children[t];if(r.state!==l.START){if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())continue;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new u({data:e.terrainData,x:e.x,y:e.y,level:e.level}),r.state=l.LOADING}}}function y(e){if(n(e.children))for(var t=0;4>t;++t){var r=e.children[t];if(r.state!==l.START){if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())continue;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new u({data:e.terrainData,x:e.x,y:e.y,level:e.level}),e.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(n(r.loadedTerrain)||(r.loadedTerrain=new u)),r.state=l.LOADING}}}function C(e){var t=e.parent;return n(t)?n(t.terrainData)?t.terrainData.isChildAvailable(t.x,t.y,e.x,e.y):!1:!0}function S(e,t){var r,i=e.cache.tile_waterMaskData;n(i)||(i=e.cache.tile_waterMaskData={allWaterTexture:void 0,allLandTexture:void 0,sampler:void 0,destroy:function(){n(this.allWaterTexture)&&this.allWaterTexture.destroy(),n(this.allLandTexture)&&this.allLandTexture.destroy()}});var o=Math.sqrt(t.length);return 1!==o||0!==t[0]&&255!==t[0]?(r=e.createTexture2D({pixelFormat:h.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{width:o,height:o,arrayBufferView:t}}),r.referenceCount=0,n(i.sampler)||(i.sampler=e.createSampler({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:d.LINEAR})),r.setSampler(i.sampler)):(n(i.allWaterTexture)||(i.allWaterTexture=e.createTexture2D({pixelFormat:h.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}}),i.allWaterTexture.referenceCount=1,i.allLandTexture=e.createTexture2D({pixelFormat:h.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([0]),width:1,height:1}}),i.allLandTexture.referenceCount=1),r=0===t[0]?i.allLandTexture:i.allWaterTexture),++r.referenceCount,r}function w(e){for(var t=e.parent;n(t)&&!n(t.terrainData)||t.terrainData.wasCreatedByUpsampling();)t=t.parent;if(n(t)&&n(t.waterMaskTexture)){e.waterMaskTexture=t.waterMaskTexture,++e.waterMaskTexture.referenceCount;var r=t.extent,i=e.extent,o=i.east-i.west,a=i.north-i.south,s=o/(r.east-r.west),l=a/(r.north-r.south);e.waterMaskTranslationAndScale.x=s*(i.west-r.west)/o,e.waterMaskTranslationAndScale.y=l*(i.south-r.south)/a,e.waterMaskTranslationAndScale.z=s,e.waterMaskTranslationAndScale.w=l}}var E=function(i){this.tilingScheme=i.tilingScheme,this.x=i.x,this.y=i.y,this.level=i.level,this.parent=i.parent,this.children=void 0,this.extent=this.tilingScheme.tileXYToExtent(this.x,this.y,this.level),this.state=l.START,this.replacementPrevious=void 0,this.replacementNext=void 0,this.imagery=[],this.distance=0,this.southwestCornerCartesian=new t,this.northeastCornerCartesian=new t,this.westNormal=new t,this.southNormal=new t,this.eastNormal=new t,this.northNormal=new t,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new r(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.occludeePointInScaledSpace=new t,this.isRenderable=!1,this.loadedTerrain=void 0,this.upsampledTerrain=void 0 +};E.prototype.getChildren=function(){if(!n(this.children)){var e=this.tilingScheme,t=this.level+1,r=2*this.x,i=2*this.y;this.children=[new E({tilingScheme:e,x:r,y:i,level:t,parent:this}),new E({tilingScheme:e,x:r+1,y:i,level:t,parent:this}),new E({tilingScheme:e,x:r,y:i+1,level:t,parent:this}),new E({tilingScheme:e,x:r+1,y:i+1,level:t,parent:this})]}return this.children},E.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.state=l.START,this.isRenderable=!1,this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0);var e,t,r=this.imagery;for(e=0,t=r.length;t>e;++e)r[e].freeResources();if(this.imagery.length=0,n(this.children)){for(e=0,t=this.children.length;t>e;++e)this.children[e].freeResources();this.children=void 0}this.freeVertexArray()},E.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.getIndexBuffer(),this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),"undefined"!=typeof this.wireframeVertexArray&&(e=this.wireframeVertexArray.getIndexBuffer(),this.wireframeVertexArray.destroy(),this.wireframeVertexArray=void 0,e.isDestroyed()||"undefined"==typeof e.referenceCount||(--e.referenceCount,0===e.referenceCount&&e.destroy()))},E.prototype.processStateMachine=function(e,t,r){this.state===l.START&&(f(this,t,r),this.state=l.LOADING),this.state===l.LOADING&&v(this,e,t);for(var i=n(this.vertexArray),o=!n(this.loadedTerrain)&&!n(this.upsampledTerrain),s=this.imagery,u=0,c=s.length;c>u;++u){var h=s[u];if(n(h.loadingImagery)){if(h.loadingImagery.state===a.PLACEHOLDER){var d=h.loadingImagery.imageryLayer;if(d.getImageryProvider().ready){h.freeResources(),s.splice(u,1),d._createTileImagerySkeletons(this,t,u),--u,c=s.length;continue}}var m=h.processStateMachine(this,e);o=o&&m,i=i&&(m||n(h.readyImagery))}}u===c&&(i&&(this.isRenderable=!0),o&&(this.state=l.READY))};var x=new t,b=new t,T=new t,A=new t,P=new i;return E}),r("Scene/TilingScheme",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Tile"],function(e,t,r,i){"use strict";var n=function(){throw new r("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")};return t(n.prototype,{ellipsoid:{get:r.throwInstantiationError},extent:{get:r.throwInstantiationError},projection:{get:r.throwInstantiationError}}),n.prototype.getNumberOfXTilesAtLevel=r.throwInstantiationError,n.prototype.getNumberOfYTilesAtLevel=r.throwInstantiationError,n.prototype.createLevelZeroTiles=r.throwInstantiationError,n.prototype.extentToNativeExtent=r.throwInstantiationError,n.prototype.tileXYToNativeExtent=r.throwInstantiationError,n.prototype.tileXYToExtent=r.throwInstantiationError,n.prototype.positionToTileXY=r.throwInstantiationError,n.createRectangleOfLevelZeroTiles=function(t,n,o){if(!e(t))throw new r("tilingScheme is required.");if(!e(n))throw new r("numberOfLevelZeroTilesX is required.");if(!e(o))throw new r("numberOfLevelZeroTilesY is required.");for(var a=new Array(n*o),s=0,l=0;o>l;++l)for(var u=0;n>u;++u)a[s++]=new i({tilingScheme:t,x:u,y:l,level:0});return a},n}),r("Scene/GeographicTilingScheme",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","../Core/Cartesian2","../Core/Ellipsoid","../Core/Extent","../Core/GeographicProjection","./TilingScheme"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(t){t=e(t,{}),this._ellipsoid=e(t.ellipsoid,a.WGS84),this._extent=e(t.extent,s.MAX_VALUE),this._projection=new l(this._ellipsoid),this._numberOfLevelZeroTilesX=e(t.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=e(t.numberOfLevelZeroTilesY,1)};return r(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},extent:{get:function(){return this._extent}},projection:{get:function(){return this._projection}}}),c.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<n.north||e.latituden.east)return void 0;var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=(n.east-n.west)/a,u=(n.north-n.south)/s,c=0|(e.longitude-n.west)/l;c>=a&&(c=a-1);var h=0|(n.north-e.latitude)/u;return h>=s&&(h=s-1),t(i)?(i.x=c,i.y=h,i):new o(c,h)},c}),r("Scene/TerrainMesh",[],function(){"use strict";var e=function(e,t,r,i,n,o,a){this.center=e,this.vertices=t,this.indices=r,this.minimumHeight=i,this.maximumHeight=n,this.boundingSphere3D=o,this.occludeePointInScaledSpace=a};return e}),r("Scene/HeightmapTerrainData",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/HeightmapTessellator","../Core/Math","../Core/TaskProcessor","./GeographicTilingScheme","./TerrainMesh","./TerrainProvider","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i,n,o,a){var s=1,l=e._width,u=e._height,c=o*(l-1),h=c+l-1,d=a*(u-1),m=d+u-1,p=1<1)for(y=w;E>=y;++y)for(_=C;S>=_;++_)for(var R=(y*l+_)*O,L=0;O>L;++L)M[I++]=T[R+L];else for(y=w;E>=y;++y)for(_=C;S>=_;++_)M[I++]=T[y*l+_];return new g({buffer:M,width:x,height:b,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function h(e,t,r,i,o,a,s,l){var u,c,h,p,f=e._width,_=e._height,y=e._structure,C=y.stride,S=e._buffer,w=new S.constructor(f*_*C),E=t.tileXYToExtent(r,i,o),x=t.tileXYToExtent(a,s,l);if(C>1){var b=y.elementsPerHeight,T=y.elementMultiplier,A=y.isBigEndian,P=Math.pow(T,b-1);for(c=0;_>c;++c)for(h=n.lerp(x.north,x.south,c/(_-1)),u=0;f>u;++u){p=n.lerp(x.west,x.east,u/(f-1));var D=m(S,b,T,C,A,E,f,_,p,h);v(w,b,T,P,C,A,c*f+u,D)}}else for(c=0;_>c;++c)for(h=n.lerp(x.north,x.south,c/(_-1)),u=0;f>u;++u)p=n.lerp(x.west,x.east,u/(f-1)),w[c*f+u]=d(S,E,f,_,p,h);return new g({buffer:w,width:f,height:_,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function d(e,t,r,i,n,o){var a=(n-t.west)*(r-1)/(t.east-t.west),s=(o-t.south)*(i-1)/(t.north-t.south),l=0|a,u=l+1;u>=r&&(u=r-1,l=r-2);var c=0|s,h=c+1;h>=i&&(h=i-1,c=i-2);var d=a-l,m=s-c;c=i-1-c,h=i-1-h;var f=e[c*r+l],v=e[c*r+u],g=e[h*r+l],_=e[h*r+u];return p(d,m,f,v,g,_)}function m(e,t,r,i,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south),d=0|c,m=d+1;m>=a&&(m=a-1,d=a-2);var v=0|h,g=v+1;g>=s&&(g=s-1,v=s-2);var _=c-d,y=h-v;v=s-1-v,g=s-1-g;var C=f(e,t,r,i,n,v*a+d),S=f(e,t,r,i,n,v*a+m),w=f(e,t,r,i,n,g*a+d),E=f(e,t,r,i,n,g*a+m);return p(_,y,C,S,w,E)}function p(e,t,r,i,n,o){return e>t?r+e*(i-r)+t*(o-i):r+e*(o-n)+t*(n-r)}function f(e,t,r,i,n,o){o*=i;var a,s=0;if(n)for(a=0;t>a;++a)s=s*r+e[o+a];else for(a=t-1;a>=0;--a)s=s*r+e[o+a];return s}function v(e,t,r,i,n,o,a,s){a*=n;var l;if(o)for(l=0;t>l;++l)e[a+l]=0|s/i,s-=e[a+l]*i,i/=r;else for(l=t-1;l>=0;--l)e[a+l]=0|s/i,s-=e[a+l]*i,i/=r}var g=function(r){this._buffer=r.buffer,this._width=r.width,this._height=r.height,this._childTileMask=e(r.childTileMask,15);var n=i.DEFAULT_STRUCTURE,o=r.structure;t(o)?o!==n&&(o.heightScale=e(o.heightScale,n.heightScale),o.heightOffset=e(o.heightOffset,n.heightOffset),o.elementsPerHeight=e(o.elementsPerHeight,n.elementsPerHeight),o.stride=e(o.stride,n.stride),o.elementMultiplier=e(o.elementMultiplier,n.elementMultiplier),o.isBigEndian=e(o.isBigEndian,n.isBigEndian)):o=n,this._structure=o,this._createdByUpsampling=e(r.createdByUpsampling,!1),this._waterMask=r.waterMask},_=new o("createVerticesFromHeightmap");return g.prototype.createMesh=function(e,r,i,n){var o=e.ellipsoid,c=e.tileXYToNativeExtent(r,i,n),h=e.tileXYToExtent(r,i,n),d=o.cartographicToCartesian(h.getCenter()),m=this._structure,p=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,this._width,e.getNumberOfXTilesAtLevel(0)),f=p/(1<1){var l=a.elementsPerHeight,u=a.elementMultiplier,c=a.isBigEndian;i=m(this._buffer,l,u,s,c,e,n,o,t,r)}else i=d(this._buffer,e,n,o,t,r);return i*a.heightScale+a.heightOffset},g.prototype.upsample=function(e,t,r,i,n,o,a){var s;return s=1===this._width%2&&1===this._height%2?c(this,e,t,r,i,n,o,a):h(this,e,t,r,i,n,o,a)},g.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!==(this._childTileMask&1<l;++l){var h=s[l],d=4*h.x+h.y*o,m=r[d+3];m>0&&(n=!1)}n&&(r=void 0)}u._missingImagePixels=r,u._isReady=!0}function l(){u._missingImagePixels=void 0,u._isReady=!0}if(a=e(a,e.EMPTY_OBJECT),!t(a.missingImageUrl))throw new n("description.missingImageUrl is required.");if(!t(a.pixelsToCheck))throw new n("description.pixelsToCheck is required.");this._pixelsToCheck=a.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var u=this;o(r(a.missingImageUrl),s,l)};return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new n("shouldDiscardImage must not be called before the discard policy is ready.");var r=this._pixelsToCheck,o=this._missingImagePixels;if(!t(o))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var a=i(e),s=e.width,l=0,u=r.length;u>l;++l)for(var c=r[l],h=4*c.x+c.y*s,d=0;4>d;++d){var m=h+d;if(a[m]!==o[m])return!1}return!0},a}),r("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/loadImage","../Core/loadImageViaBlob","../Core/DeveloperError","../Core/throttleRequestByServer"],function(e,t,r,i,n,o){"use strict";var a=function(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,n.throwInstantiationError()};return t(a.prototype,{ready:{get:n.throwInstantiationError},extent:{get:n.throwInstantiationError},tileWidth:{get:n.throwInstantiationError},tileHeight:{get:n.throwInstantiationError},maximumLevel:{get:n.throwInstantiationError},minimumLevel:{get:n.throwInstantiationError},tilingScheme:{get:n.throwInstantiationError},tileDiscardPolicy:{get:n.throwInstantiationError},errorEvent:{get:n.throwInstantiationError},credit:{get:n.throwInstantiationError},proxy:{get:n.throwInstantiationError}}),a.prototype.getTileCredits=n.throwInstantiationError,a.prototype.requestImage=n.throwInstantiationError,a.loadImage=function(t,n){return e(t.tileDiscardPolicy)?o(n,i):o(n,r)},a}),r("Scene/WebMercatorTilingScheme",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Extent","../Core/Cartesian2","../Core/WebMercatorProjection","./TilingScheme"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){if(r=e(r,{}),this._ellipsoid=e(r.ellipsoid,i.WGS84),this._numberOfLevelZeroTilesX=e(r.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=e(r.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),t(r.extentSouthwestInMeters)&&t(r.extentNortheastInMeters))this._extentSouthwestInMeters=r.extentSouthwestInMeters,this._extentNortheastInMeters=r.extentNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._extentSouthwestInMeters=new o(-s,-s),this._extentNortheastInMeters=new o(s,s)}var l=this._projection.unproject(this._extentSouthwestInMeters),u=this._projection.unproject(this._extentNortheastInMeters);this._extent=new n(l.longitude,l.latitude,u.longitude,u.latitude)};return r(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},extent:{get:function(){return this._extent}},projection:{get:function(){return this._projection}}}),l.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<n.north||e.latituden.east)return void 0;var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=this._extentNortheastInMeters.x-this._extentSouthwestInMeters.x,u=l/a,c=this._extentNortheastInMeters.y-this._extentSouthwestInMeters.y,h=c/s,d=this._projection,m=d.project(e),p=m.x-this._extentSouthwestInMeters.x,f=this._extentNortheastInMeters.y-m.y,v=0|p/u;v>=a&&(v=a-1);var g=0|f/h;return g>=s&&(g=s-1),t(i)?(i.x=v,i.y=g,i):new o(v,g)},l}),r("Scene/ArcGisMapServerImageryProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/jsonp","../Core/Cartesian2","../Core/DeveloperError","../Core/Event","./DiscardMissingTileImagePolicy","./GeographicTilingScheme","./ImageryProvider","./TileProviderError","./WebMercatorTilingScheme","./Credit","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e,r,i,n){var o;if(e._useTiles)o=e._url+"/tile/"+n+"/"+i+"/"+r;else{var a=e._tilingScheme.tileXYToNativeExtent(r,i,n),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;o=e._url+"/export?",o+="bbox="+s,o+="&bboxSR=4326&size=256%2C256&imageSR=4326&format=png&transparent=true&f=image"}var l=e._proxy;return t(l)&&(o=l.getURL(o)),o}var f=function(r){function o(e){var r=e.tileInfo;if(g._useTiles&&t(r)){if(g._tileWidth=r.rows,g._tileHeight=r.cols,102100===r.spatialReference.wkid)g._tilingScheme=new h;else{if(4326!==e.tileInfo.spatialReference.wkid){var i="Tile spatial reference WKID "+e.tileInfo.spatialReference.wkid+" is not supported.";return v=c.handleError(v,g,g._errorEvent,i,void 0,void 0,void 0,f),void 0}g._tilingScheme=new l}g._maximumLevel=e.tileInfo.lods.length-1,t(g._tileDiscardPolicy)||(g._tileDiscardPolicy=new s({missingImageUrl:p(g,0,0,g._maximumLevel),pixelsToCheck:[new n(0,0),new n(200,20),new n(20,200),new n(80,110),new n(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),g._useTiles=!0}else g._tileWidth=256,g._tileHeight=256,g._tilingScheme=new l,g._useTiles=!1;t(e.copyrightText)&&e.copyrightText.length>0&&(g._credit=new d(e.copyrightText)),g._ready=!0,c.handleSuccess(v)}function u(){var e="An error occurred while accessing "+g._url+".";v=c.handleError(v,g,g._errorEvent,e,void 0,void 0,void 0,f)}function f(){var e=i(g._url,{parameters:{f:"json"},proxy:g._proxy});m(e,o,u)}r=e(r,{}),this._url=r.url,this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._tilingScheme=void 0,this._credit=void 0,this._useTiles=e(r.usePreCachedTilesIfAvailable,!0),this._errorEvent=new a,this._ready=!1;var v,g=this;f()};return r(f.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},extent:{get:function(){return this._tilingScheme.extent}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}}}),f.prototype.getTileCredits=function(){return void 0},f.prototype.requestImage=function(e,t,r){var i=p(this,e,t,r);return u.loadImage(this,i)},f}),r("Scene/BingMapsStyle",["../Core/Enumeration"],function(e){"use strict";var t={AERIAL:new e(0,"AERIAL",{imagerySetName:"Aerial"}),AERIAL_WITH_LABELS:new e(1,"AERIAL_WITH_LABELS",{imagerySetName:"AerialWithLabels"}),ROAD:new e(2,"ROAD",{imagerySetName:"Road"}),ORDNANCE_SURVEY:new e(3,"ORDNANCE_SURVEY",{imagerySetName:"OrdnanceSurvey"}),COLLINS_BART:new e(4,"COLLINS_BART",{imagerySetName:"CollinsBart"})};return t}),r("Scene/BingMapsImageryProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/jsonp","../Core/BingMapsApi","../Core/Cartesian2","../Core/DeveloperError","../Core/Event","../Core/Extent","../Core/Math","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider","./TileProviderError","./WebMercatorTilingScheme","./Credit","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,r,i,n){var o=e._imageUrlTemplate,a=y.tileXYToQuadKey(r,i,n);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(r+i+n)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return t(u)&&(o=u.getURL(o)),o}function _(e,t,r){++t;for(var i=[],n=0,o=e.length;o>n;++n){for(var a=e[n],s=a.coverageAreas,l=!1,u=0,c=a.coverageAreas.length;!l&&c>u;++u){var h=s[u];if(t>=h.zoomMin&&t<=h.zoomMax){var d=r.intersectWith(h.bbox,S);d.isEmpty()||(l=!0)}}l&&i.push(a.credit)}return i}var y=function w(r){function a(e){var r=e.resourceSets[0].resources[0];S._tileWidth=r.imageWidth,S._tileHeight=r.imageHeight,S._maximumLevel=r.zoomMax-1,S._imageUrlSubdomains=r.imageUrlSubdomains,S._imageUrlTemplate=r.imageUrl.replace("{culture}","");var i=S._tileProtocol;if(!t(i)){var n=document.location.protocol;i=/^http/.test(n)?n:"http:"}S._imageUrlTemplate=S._imageUrlTemplate.replace(/^http:/,i),t(S._tileDiscardPolicy)||(S._tileDiscardPolicy=new h({missingImageUrl:g(S,0,0,S._maximumLevel),pixelsToCheck:[new o(0,0),new o(120,140),new o(130,160),new o(200,50),new o(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var a=S._attributionList=r.imageryProviders;a||(a=S._attributionList=[]);for(var s=0,c=a.length;c>s;++s){var d=a[s];d.credit=new f(d.attribution);for(var p=d.coverageAreas,v=0,_=d.coverageAreas.length;_>v;++v){var C=p[v],w=C.bbox;C.bbox=new l(u.toRadians(w[1]),u.toRadians(w[0]),u.toRadians(w[3]),u.toRadians(w[2]))}}S._ready=!0,m.handleSuccess(y)}function d(){var e="An error occurred while accessing "+C+".";y=m.handleError(y,S,S._errorEvent,e,void 0,void 0,void 0,_)}function _(){var e=i(C,{callbackParameterName:"jsonp",proxy:S._proxy});v(e,a,d)}r=e(r,{}),this._key=n.getKey(r.key),this._url=r.url,this._tileProtocol=r.tileProtocol,this._mapStyle=e(r.mapStyle,c.AERIAL),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._credit=new f("Bing Imagery",w._logoData,"http://www.bing.com"),this.defaultGamma=1,(this._mapStyle===c.AERIAL||this._mapStyle===c.AERIAL_WITH_LABELS)&&(this.defaultGamma=1.3),this._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1;var y,C=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle.imagerySetName+"?incl=ImageryProviders&key="+this._key,S=this;_()};r(y.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},extent:{get:function(){return this._tilingScheme.extent}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}}});var C=new l;y.prototype.getTileCredits=function(e,t,r){if(!this._ready)throw new a("getTileCredits must not be called before the imagery provider is ready.");var i=this._tilingScheme.tileXYToExtent(e,t,r,C);return _(this._attributionList,r,i)},y.prototype.requestImage=function(e,t,r){var i=g(this,e,t,r);return d.loadImage(this,i)},y._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",y.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<=0;--n){var o=1<r&&(t.x=r),t.x<-r&&(t.x=-r);var i=e._maxCoord.y*e.maximumTranslateFactor;t.y>i&&(t.y=i),t.y<-i&&(t.y=-i)}function y(e,t){var r,i=e._camera;return n(t)&&(r=d.clone(i.transform,$),d.multiplyTransformation(t,r,et),e.setTransform(et)),r}function C(e,t){n(t)&&e.setTransform(t)}function S(e,r,i){var o=e._camera,a=y(e,i),s=o.position,l=t.normalize(s,it);if(n(e.constrainedAxis)){var u=t.equalsEpsilon(l,e.constrainedAxis,c.EPSILON2),h=t.equalsEpsilon(l,t.negate(e.constrainedAxis,at),c.EPSILON2);if(u||h)(u&&0>r||h&&r>0)&&e.rotate(o.right,r);else{var d=t.normalize(e.constrainedAxis,nt),m=t.dot(l,d),p=Math.acos(m);r>0&&r>p&&(r=p),m=t.dot(l,t.negate(d,at)),p=Math.acos(m),0>r&&-r>p&&(r=-p);var f=t.cross(d,l,ot);e.rotate(f,r)}}else e.rotate(o.right,r);C(e,a)}function w(e,t,r){n(e.constrainedAxis)?e.rotate(e.constrainedAxis,t,r):e.rotate(e._camera.up,t,r)}function E(e,t){var r=e._camera.frustum;t=.5*t;var i=r.right-t,n=r.left+t,o=e._maxCoord.x*e.maximumZoomFactor;i>o&&(i=o,n=-o),n>=i&&(i=1,n=-1);var a=r.top/r.right;r.right=i,r.left=n,r.top=r.right*a,r.bottom=-r.top}function x(e,t){var r=e._camera;e.move(r.direction,t)}function b(r,i){var n=r._camera,o=.5*-i.height,a=-o,s=n.frustum;if(a>o){var l=s.top/s.right;s.right=a,s.left=o,s.top=s.right*l,s.bottom=-s.top}e.clone(r._projection.project(i),n.position),t.negate(t.UNIT_Z,n.direction),t.clone(t.UNIT_Y,n.up),t.clone(t.UNIT_X,n.right)}function T(e,r){var i=e._camera,n=e._projection;i.position=n.project(r),t.negate(t.UNIT_Z,i.direction),t.clone(t.UNIT_Y,i.up),t.clone(t.UNIT_X,i.right)}function A(e,r){var i=e._camera,n=e._projection.ellipsoid;n.cartographicToCartesian(r,i.position),t.negate(i.position,i.direction),t.normalize(i.direction,i.direction),t.cross(i.direction,t.UNIT_Z,i.right),t.cross(i.right,i.direction,i.up),t.cross(i.direction,i.up,i.right)}function P(e){var t=e._camera;return Math.atan2(t.right.y,t.right.x)}function D(e){var t=e._camera,r=e._projection.ellipsoid,i=f.eastNorthUpToFixedFrame(t.position,r,st),n=d.getRotation(i,lt);h.transpose(n,n);var o=h.multiplyByVector(n,t.right,ut);return Math.atan2(o.y,o.x) +}function M(e,r){var i=P(e);r=i-r,e.look(t.UNIT_Z,r)}function I(e,r){var i=e._camera,n=t.normalize(i.position,ct),o=D(e);r=o-r,e.look(n,r)}function O(e){var t=e._camera;return c.PI_OVER_TWO-Math.acos(-t.direction.z)}function R(e){var r=e._camera,i=t.normalize(r.position,ht);return t.negate(i,i),c.PI_OVER_TWO-Math.acos(t.dot(r.direction,i))}function L(e,r,i,n,o){var a=e;o&&(a=_t);var s=r.north,l=r.south,u=r.east,h=r.west;h>u&&(u+=c.TWO_PI);var d=dt;d.longitude=u,d.latitude=s;var m=i.cartographicToCartesian(d,mt);d.latitude=l;var p=i.cartographicToCartesian(d,vt);d.longitude=h;var f=i.cartographicToCartesian(d,pt);d.latitude=s;var v=i.cartographicToCartesian(d,ft),g=t.subtract(m,f,gt);t.multiplyByScalar(g,.5,g),t.add(f,g,g);var _=t.magnitude(g);_y?(m=v,p=m/_):(p=g,m=y),g=Math.max(2*m,2*p),n(o)||(o=new t),o.x=.5*(d.x-f.x)+f.x,o.y=.5*(d.y-f.y)+f.y,a)h=i.unproject(o,h),h.height=g,o=i.project(h,o);else{var C=e.frustum;C.right=m,C.left=-m,C.top=p,C.bottom=-p;var S=t.clone(t.UNIT_Z,e.direction);t.negate(S,S),t.clone(t.UNIT_X,e.right),t.clone(t.UNIT_Y,e.up)}return o}function z(e,t,r,n){r=i(r,s.WGS84);var o=e.getPickRay(t,bt),a=u.rayEllipsoid(o,r);return a?o.getPoint(a.start,n):void 0}function F(e,t,r,i){var n=e.getPickRay(t,Tt),o=n.origin;o.z=0;var a=r.unproject(o);return a.latitude<-c.PI_OVER_TWO||a.latitude>c.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI?void 0:r.ellipsoid.cartographicToCartesian(a,i)}function V(e,r,i,n){var o=e.getPickRay(r,At),a=-o.origin.x/o.direction.x;o.getPoint(a,n);var s=i.unproject(new t(n.y,n.z,0));return s.latitude<-c.PI_OVER_TWO||s.latitude>c.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI?void 0:i.ellipsoid.cartographicToCartesian(s,n)}function k(e,r,i){var n=e._context._canvas.clientWidth,o=e._context._canvas.clientHeight,a=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*a,l=e.frustum.near,u=2/n*r.x-1,c=2/o*(o-r.y)-1,h=e.positionWC;t.clone(h,i.origin);var d=t.multiplyByScalar(e.directionWC,l,Pt);t.add(h,d,d);var m=t.multiplyByScalar(e.rightWC,u*l*s,Dt),p=t.multiplyByScalar(e.upWC,c*l*a,Mt),f=t.add(d,m,i.direction);return t.add(f,p,f),t.subtract(f,h,f),t.normalize(f,f),i}function U(e,r,i){var n=e._context._canvas.clientWidth,o=e._context._canvas.clientHeight,a=2/n*r.x-1;a*=.5*(e.frustum.right-e.frustum.left);var s=2/o*(o-r.y)-1;s*=.5*(e.frustum.top-e.frustum.bottom);var l=i.origin;return t.clone(e.position,l),t.multiplyByScalar(e.right,a,It),t.add(It,l,l),t.multiplyByScalar(e.up,s,It),t.add(It,l,l),t.clone(e.directionWC,i.direction),i}function W(e,r){var i=e._camera,n=i.position,o=n.x<-e._maxCoord.x||n.x>e._maxCoord.x,a=n.y<-e._maxCoord.y||n.y>e._maxCoord.y,s=o||a,l=i.frustum,u=l.top,h=l.bottom,d=l.right,m=l.left,p=e._frustum,f=d>e._frustum.right;if(s||f){var v=t.clone(n);v.x>e._maxCoord.x?v.x=e._maxCoord.x:v.x<-e._maxCoord.x&&(v.x=-e._maxCoord.x),v.y>e._maxCoord.y?v.y=e._maxCoord.y:v.y<-e._maxCoord.y&&(v.y=-e._maxCoord.y);var _=function(e){s&&(i.position=t.lerp(n,v,e.time)),f&&(i.frustum.top=c.lerp(u,p.top,e.time),i.frustum.bottom=c.lerp(h,p.bottom,e.time),i.frustum.right=c.lerp(d,p.right,e.time),i.frustum.left=c.lerp(m,p.left,e.time))};return{easingFunction:g.Easing.Exponential.Out,startValue:{time:0},stopValue:{time:1},duration:r,onUpdate:_}}return void 0}function G(e,r,i,n,o,a){var s=t.clone(r);i.y>n?s.y-=i.y-n:i.y<-n&&(s.y+=-n-i.y),i.z>o?s.z-=i.z-o:i.z<-o&&(s.z+=-o-i.z);var l=e._camera,u=function(e){var i=t.lerp(r,s,e.time);l.position=d.multiplyByPoint(l.inverseTransform,i,l.position)};return{easingFunction:g.Easing.Exponential.Out,startValue:{time:0},stopValue:{time:1},duration:a,onUpdate:u}}function H(e,r){var i=e._camera,n=i.position,o=i.direction,a=d.multiplyByPointAsVector(i.inverseTransform,t.UNIT_X,Ot),s=-t.dot(a,n)/t.dot(a,o),l=t.add(n,t.multiplyByScalar(o,s,Rt),Rt);l=d.multiplyByPoint(i.transform,l,l),n=d.multiplyByPoint(i.transform,i.position,Lt);var u=Math.tan(.5*e._camera.frustum.fovy),c=e._camera.frustum.aspectRatio*u,h=t.magnitude(t.subtract(n,l,Nt)),m=c*h,p=u*h,f=e._maxCoord.x,v=e._maxCoord.y,g=Math.max(m-f,f),_=Math.max(p-v,v);if(n.z<-g||n.z>g||n.y<-_||n.y>_){var y=l.y<-g||l.y>g,C=l.z<-_||l.z>_;if(y||C)return G(e,n,l,g,_,r)}return void 0}var j=function(e){this._camera=e,this._mode=v.SCENE3D,this._projection=new l,this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumTranslateFactor=1.5,this.maximumZoomFactor=2.5,this._maxCoord=new t,this._frustum=void 0},q=new r(Math.PI,c.PI_OVER_TWO);j.prototype.update=function(e,t){var r=!1;e!==this._mode&&(this._mode=e,r=this._mode===v.SCENE2D);var i=t.projection;if(n(i)&&i!==this._projection&&(this._projection=i,this._maxCoord=i.project(q,this._maxCoord)),r){var o=this._frustum=this._camera.frustum.clone(),a=2,s=o.top/o.right;o.right=this._maxCoord.x*a,o.left=-o.right,o.top=s*o.right,o.bottom=-o.top}};var Y=new t,X=new t,Z=new t;j.prototype.setTransform=function(e){var r=this._camera,i=t.clone(r.positionWC,Y),n=t.clone(r.upWC,X),o=t.clone(r.directionWC,Z);d.clone(e,r.transform);var a=r.inverseTransform;d.multiplyByPoint(a,i,r.position),d.multiplyByPointAsVector(a,o,r.direction),d.multiplyByPointAsVector(a,n,r.up),t.cross(r.direction,r.up,r.right)};var J=new t;j.prototype.move=function(e,r){var i=this._camera.position;t.multiplyByScalar(e,r,J),t.add(i,J,i),this._mode===v.SCENE2D&&_(this,i)},j.prototype.moveForward=function(e){e=i(e,this.defaultMoveAmount),this.move(this._camera.direction,e)},j.prototype.moveBackward=function(e){e=i(e,this.defaultMoveAmount),this.move(this._camera.direction,-e)},j.prototype.moveUp=function(e){e=i(e,this.defaultMoveAmount),this.move(this._camera.up,e)},j.prototype.moveDown=function(e){e=i(e,this.defaultMoveAmount),this.move(this._camera.up,-e)},j.prototype.moveRight=function(e){e=i(e,this.defaultMoveAmount),this.move(this._camera.right,e)},j.prototype.moveLeft=function(e){e=i(e,this.defaultMoveAmount),this.move(this._camera.right,-e)},j.prototype.lookLeft=function(e){e=i(e,this.defaultLookAmount),this.look(this._camera.up,-e)},j.prototype.lookRight=function(e){e=i(e,this.defaultLookAmount),this.look(this._camera.up,e)},j.prototype.lookUp=function(e){e=i(e,this.defaultLookAmount),this.look(this._camera.right,-e)},j.prototype.lookDown=function(e){e=i(e,this.defaultLookAmount),this.look(this._camera.right,e)};var Q=new m,K=new h;j.prototype.look=function(e,t){var r=i(t,this.defaultLookAmount),n=m.fromAxisAngle(e,-r,Q),o=h.fromQuaternion(n,K),a=this._camera.direction,s=this._camera.up,l=this._camera.right;h.multiplyByVector(o,a,a),h.multiplyByVector(o,s,s),h.multiplyByVector(o,l,l)},j.prototype.twistLeft=function(e){e=i(e,this.defaultLookAmount),this.look(this._camera.direction,e)},j.prototype.twistRight=function(e){e=i(e,this.defaultLookAmount),this.look(this._camera.direction,-e)};var $=new d,et=new d,tt=new m,rt=new h;j.prototype.rotate=function(e,r,n){var o=this._camera,a=i(r,this.defaultRotateAmount),s=m.fromAxisAngle(e,-a,tt),l=h.fromQuaternion(s,rt),u=y(this,n);h.multiplyByVector(l,o.position,o.position),h.multiplyByVector(l,o.direction,o.direction),h.multiplyByVector(l,o.up,o.up),t.cross(o.direction,o.up,o.right),t.cross(o.right,o.direction,o.up),C(this,u)},j.prototype.rotateDown=function(e,t){e=i(e,this.defaultRotateAmount),S(this,e,t)},j.prototype.rotateUp=function(e,t){e=i(e,this.defaultRotateAmount),S(this,-e,t)};var it=new t,nt=new t,ot=new t,at=new t;j.prototype.rotateRight=function(e,t){e=i(e,this.defaultRotateAmount),w(this,-e,t)},j.prototype.rotateLeft=function(e,t){e=i(e,this.defaultRotateAmount),w(this,e,t)},j.prototype.zoomIn=function(e){e=i(e,this.defaultZoomAmount),this._mode===v.SCENE2D?E(this,e):x(this,e)},j.prototype.zoomOut=function(e){e=i(e,this.defaultZoomAmount),this._mode===v.SCENE2D?E(this,-e):x(this,-e)},j.prototype.getMagnitude=function(){var e=this._camera;return this._mode===v.SCENE3D?t.magnitude(e.position):this._mode===v.COLUMBUS_VIEW?Math.abs(e.position.z):this._mode===v.SCENE2D?Math.max(e.frustum.right-e.frustum.left,e.frustum.top-e.frustum.bottom):void 0},j.prototype.setPositionCartographic=function(e){this._mode===v.SCENE2D?b(this,e):this._mode===v.COLUMBUS_VIEW?T(this,e):this._mode===v.SCENE3D&&A(this,e)};var st=new d,lt=new h,ut=new t,ct=new t,ht=new t;o(j.prototype,{heading:{get:function(){return this._mode===v.SCENE2D||this._mode===v.COLUMBUS_VIEW?P(this):this._mode===v.SCENE3D?D(this):void 0},set:function(e){this._mode===v.SCENE2D||this._mode===v.COLUMBUS_VIEW?M(this,e):this._mode===v.SCENE3D&&I(this,e)}},tilt:{get:function(){return this._mode===v.COLUMBUS_VIEW?O(this):this._mode===v.SCENE3D?R(this):void 0},set:function(e){if(this._mode===v.COLUMBUS_VIEW||this._mode===v.SCENE3D){var t=this._camera;e=c.clamp(e,0,c.PI_OVER_TWO),e-=this.tilt,this.look(t.right,e)}}}}),j.prototype.lookAt=function(e,r,i){var n=this._camera;n.position=t.clone(e,n.position),n.direction=t.normalize(t.subtract(r,e,n.direction),n.direction),n.right=t.normalize(t.cross(n.direction,i,n.right),n.right),n.up=t.cross(n.right,n.direction,n.up)};var dt=new r,mt=new t,pt=new t,ft=new t,vt=new t,gt=new t,_t={direction:new t,right:new t,up:new t},yt=new r,Ct=new t,St=new t,wt=new r,Et=new t,xt=new t;j.prototype.getExtentCameraCoordinates=function(e,t){return this._mode===v.SCENE3D?L(this._camera,e,this._projection.ellipsoid,t,!0):this._mode===v.COLUMBUS_VIEW?N(this._camera,e,this._projection,t,!0):this._mode===v.SCENE2D?B(this._camera,e,this._projection,t,!0):void 0},j.prototype.viewExtent=function(e,t){t=i(t,s.WGS84),this._mode===v.SCENE3D?L(this._camera,e,t,this._camera.position):this._mode===v.COLUMBUS_VIEW?N(this._camera,e,this._projection,this._camera.position):this._mode===v.SCENE2D&&B(this._camera,e,this._projection,this._camera.position)};var bt=new p,Tt=new p,At=new p;j.prototype.pickEllipsoid=function(e,r,o){return n(o)||(o=new t),r=i(r,s.WGS84),this._mode===v.SCENE3D?o=z(this,e,r,o):this._mode===v.SCENE2D?o=F(this,e,this._projection,o):this._mode===v.COLUMBUS_VIEW&&(o=V(this,e,this._projection,o)),o};var Pt=new t,Dt=new t,Mt=new t,It=new t;j.prototype.getPickRay=function(e,t){n(t)||(t=new p);var r=this._camera,i=r.frustum;return n(i.aspectRatio)&&n(i.fovy)&&n(i.near)?k(r,e,t):U(r,e,t)};var Ot=new t,Rt=new t,Lt=new t,Nt=new t;return j.prototype.createCorrectPositionAnimation=function(e){return this._mode===v.SCENE2D?W(this,e):this._mode===v.COLUMBUS_VIEW?H(this,e):void 0},j}),r("Scene/CullingVolume",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect"],function(e,t,r,i){"use strict";var n=function(t){this.planes=e(t,[])};return n.prototype.getVisibility=function(e){for(var t=this.planes,r=!1,n=0,o=t.length;o>n;++n){var a=e.intersect(t[n]);if(a===i.OUTSIDE)return i.OUTSIDE;a===i.INTERSECTING&&(r=!0)}return r?i.INTERSECTING:i.INSIDE},n}),r("Scene/PerspectiveOffCenterFrustum",["../Core/DeveloperError","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Matrix4","../Scene/CullingVolume"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){var t=e.top,r=e.bottom,i=e.right,n=e.left,o=e.near,a=e.far;(t!==e._top||r!==e._bottom||n!==e._left||i!==e._right||o!==e._near||a!==e._far)&&(e._left=n,e._right=i,e._top=t,e._bottom=r,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,i,r,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,i,r,t,o,e._infinitePerspective))}var c=function(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=void 0,this._infinitePerspective=void 0};i(c.prototype,{projectionMatrix:{get:function(){return u(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return u(this),this._infinitePerspective}}});var h=new o,d=new o,m=new o,p=new o;return c.prototype.computeCullingVolume=function(e,t,i){var n=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,f=this.near,v=this.far,g=o.cross(t,i,h),_=d;o.multiplyByScalar(t,f,_),o.add(e,_,_);var y=m;o.multiplyByScalar(t,v,y),o.add(e,y,y);var C=p;o.multiplyByScalar(g,c,C),o.add(_,C,C),o.subtract(C,e,C),o.normalize(C,C),o.cross(C,i,C);var S=n[0];return r(S)||(S=n[0]=new a),S.x=C.x,S.y=C.y,S.z=C.z,S.w=-o.dot(C,e),o.multiplyByScalar(g,u,C),o.add(_,C,C),o.subtract(C,e,C),o.normalize(C,C),o.cross(i,C,C),S=n[1],r(S)||(S=n[1]=new a),S.x=C.x,S.y=C.y,S.z=C.z,S.w=-o.dot(C,e),o.multiplyByScalar(i,l,C),o.add(_,C,C),o.subtract(C,e,C),o.normalize(C,C),o.cross(g,C,C),S=n[2],r(S)||(S=n[2]=new a),S.x=C.x,S.y=C.y,S.z=C.z,S.w=-o.dot(C,e),o.multiplyByScalar(i,s,C),o.add(_,C,C),o.subtract(C,e,C),o.normalize(C,C),o.cross(C,g,C),S=n[3],r(S)||(S=n[3]=new a),S.x=C.x,S.y=C.y,S.z=C.z,S.w=-o.dot(C,e),S=n[4],r(S)||(S=n[4]=new a),S.x=t.x,S.y=t.y,S.z=t.z,S.w=-o.dot(t,_),o.negate(t,C),S=n[5],r(S)||(S=n[5]=new a),S.x=C.x,S.y=C.y,S.z=C.z,S.w=-o.dot(C,y),this._cullingVolume},c.prototype.getPixelSize=function(e,i,o){u(this);var a=e.x,s=e.y;i=t(i,this.near);var l=1/this.near,c=this.top*l,h=2*i*c/s;c=this.right*l;var d=2*i*c/a;return r(o)?(o.x=d,o.y=h,o):new n(d,h)},c.prototype.clone=function(e){return r(e)||(e=new c),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},c.prototype.equals=function(e){return r(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},c}),r("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/PerspectiveOffCenterFrustum"],function(e,t,r,i){"use strict";function n(e){var t=e._offCenterFrustum;(e.fovy!==e._fovy||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far)&&(e._fovy=e.fovy,e._aspectRatio=e.aspectRatio,e._near=e.near,e._far=e.far,t.top=e.near*Math.tan(.5*e.fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far)}var o=function(){this._offCenterFrustum=new i,this.fovy=void 0,this._fovy=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far};return t(o.prototype,{projectionMatrix:{get:function(){return n(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return n(this),this._offCenterFrustum.infiniteProjectionMatrix}}}),o.prototype.computeCullingVolume=function(e,t,r){return n(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},o.prototype.getPixelSize=function(e,t,r){return n(this),this._offCenterFrustum.getPixelSize(e,t,r)},o.prototype.clone=function(t){return e(t)||(t=new o),t.fovy=this.fovy,t.aspectRatio=this.aspectRatio,t.near=this.near,t.far=this.far,t._fovy=void 0,t._aspectRatio=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},o.prototype.equals=function(t){return e(t)?(n(this),n(t),this.fovy===t.fovy&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum)):!1},o}),r("Scene/Camera",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Math","../Core/Matrix4","./CameraController","./PerspectiveFrustum"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){var r=t._right,i=t._up,n=t._direction,o=t._position,s=t._viewMatrix;s[0]=r.x,s[1]=i.x,s[2]=-n.x,s[3]=0,s[4]=r.y,s[5]=i.y,s[6]=-n.y,s[7]=0,s[8]=r.z,s[9]=i.z,s[10]=-n.z,s[11]=0,s[12]=-e.dot(r,o),s[13]=-e.dot(i,o),s[14]=e.dot(n,o),s[15]=1,a.multiply(s,t._invTransform,t._viewMatrix),a.inverseTransformation(t._viewMatrix,t._invViewMatrix)}function c(t){var r=t._position,i=!e.equals(r,t.position);i&&(r=e.clone(t.position,t._position));var n=t._direction,s=!e.equals(n,t.direction);s&&(n=e.clone(t.direction,t._direction));var l=t._up,c=!e.equals(l,t.up);c&&(l=e.clone(t.up,t._up));var h=t._right,m=!e.equals(h,t.right);m&&(h=e.clone(t.right,t._right));var p=t._transform,f=!a.equals(p,t.transform);if(f&&(p=a.clone(t.transform,t._transform),a.inverseTransformation(t._transform,t._invTransform)),(i||f)&&(t._positionWC=a.multiplyByPoint(p,r,t._positionWC)),s||c||m){var v=e.dot(n,e.cross(l,h,d));if(Math.abs(1-v)>o.EPSILON2){n=e.normalize(n,t._direction),e.clone(n,t.direction);var g=1/e.magnitudeSquared(l),_=e.dot(l,n)*g,y=e.multiplyByScalar(n,_,d);l=e.normalize(e.subtract(l,y,t._up),t._up),e.clone(l,t.up),h=e.cross(n,l,t._right),e.clone(h,t.right)}}(s||f)&&(t._directionWC=a.multiplyByPointAsVector(p,n,t._directionWC)),(c||f)&&(t._upWC=a.multiplyByPointAsVector(p,l,t._upWC)),(m||f)&&(t._rightWC=a.multiplyByPointAsVector(p,h,t._rightWC)),(i||s||c||m||f)&&u(t)}var h=function(t){this.transform=a.clone(a.IDENTITY),this._transform=a.clone(a.IDENTITY),this._invTransform=a.clone(a.IDENTITY);var r=n.WGS84.maximumRadius,i=e.multiplyByScalar(e.normalize(new e(0,-2,1)),2.5*r);this.position=i,this._position=e.clone(i),this._positionWC=e.clone(i);var c=e.normalize(e.negate(i));this.direction=c,this._direction=e.clone(c),this._directionWC=e.clone(c);var h=e.normalize(e.cross(c,e.UNIT_Z)),d=e.cross(h,c);this.up=d,this._up=e.clone(d),this._upWC=e.clone(d),h=e.cross(c,d),this.right=h,this._right=e.clone(h),this._rightWC=e.clone(h),this.frustum=new l,this.frustum.fovy=o.toRadians(60),this.frustum.aspectRatio=t.getDrawingBufferWidth()/t.getDrawingBufferHeight(),this.controller=new s(this),this._viewMatrix=new a,this._invViewMatrix=new a,u(this),this._context=t},d=new e;return r(h.prototype,{inverseTransform:{get:function(){return c(this),this._invTransform}},viewMatrix:{get:function(){return c(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return c(this),this._invViewMatrix}},positionWC:{get:function(){return c(this),this._positionWC}},directionWC:{get:function(){return c(this),this._directionWC}},upWC:{get:function(){return c(this),this._upWC}},rightWC:{get:function(){return c(this),this._rightWC}}}),h.prototype.clone=function(){var t=new h(this._context);return t.position=e.clone(this.position),t.direction=e.clone(this.direction),t.up=e.clone(this.up),t.right=e.clone(this.right),t.transform=a.clone(this.transform),t.frustum=this.frustum.clone(),t},h.prototype.worldToCameraCoordinates=function(e,t){return a.multiplyByVector(this.inverseTransform,e,t)},h.prototype.cameraToWorldCoordinates=function(e,t){return a.multiplyByVector(this.transform,e,t)},h}),r("Scene/CameraEventType",["../Core/Enumeration"],function(e){"use strict";var t={LEFT_DRAG:new e(0,"LEFT_DRAG"),RIGHT_DRAG:new e(1,"RIGHT_DRAG"),MIDDLE_DRAG:new e(2,"MIDDLE_DRAG"),WHEEL:new e(3,"WHEEL"),PINCH:new e(4,"PINCH")};return t}),r("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/KeyboardEventModifier","./CameraEventType"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,r){var i=e.name;return t(r)&&(i+="+"+r.name),i}function c(t,r){e.clone(t.distance.startPosition,r.distance.startPosition),e.clone(t.distance.endPosition,r.distance.endPosition),e.clone(t.angleAndHeight.startPosition,r.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,r.angleAndHeight.endPosition)}function h(r,i,n){var o=u(l.PINCH,i),s=r._update,h=r._isDown,d=r._pressTime,m=r._releaseTime;s[o]=!0,h[o]=!1;var p=r._movement[o];t(p)||(p=r._movement[o]={}),p.distance={startPosition:new e,endPosition:new e},p.angleAndHeight={startPosition:new e,endPosition:new e},p.prevAngle=0,r._eventHandler.setInputAction(function(){r._buttonsDown++,h[o]=!0,d[o]=new Date},a.PINCH_START,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),h[o]=!1,m[o]=new Date},a.PINCH_END,i),r._eventHandler.setInputAction(function(t){if(h[o]){s[o]?(c(t,p),s[o]=!1,p.prevAngle=p.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,p.distance.endPosition),e.clone(t.angleAndHeight.endPosition,p.angleAndHeight.endPosition));for(var r=p.angleAndHeight.endPosition.x,i=p.prevAngle,a=2*Math.PI;r>=i+Math.PI;)r-=a;for(;r0||e},v.prototype.getButtonPressTime=function(e,t){var r=u(e,t);return this._pressTime[r]},v.prototype.getButtonReleaseTime=function(e,t){var r=u(e,t);return this._releaseTime[r]},v.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},v}),r("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/clone","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/HermiteSpline","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Scene/PerspectiveFrustum","../Scene/PerspectiveOffCenterFrustum","../Scene/SceneMode","../ThirdParty/Tween"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,r,i){return t.cross(e,r,D),t.cross(D,e,M),P[0]=D.x,P[1]=M.x,P[2]=-e.x,P[3]=D.y,P[4]=M.y,P[5]=-e.y,P[6]=D.z,P[7]=M.z,P[8]=-e.z,c.fromRotationMatrix(P,i)}function g(e,t,r){var i,n,o;if(e instanceof d){var a=Math.tan(.5*e.fovy);return i=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*i/o,r*i/n)}return e instanceof m?(i=e.near,n=e.top,o=e.right,Math.max(t*i/o,r*i/n)):Math.max(t,r)}function _(e,r,i,n,o,u,h){var d,m,p,f=r.maximumRadius,v=e.frustum,_=g(v,f,f),y=t.dot(t.normalize(i),t.normalize(u));if(t.magnitude(i)>_)m=f+.6*(_-f),p=.35;else{var C=t.subtract(i,u);m=t.magnitude(t.add(t.multiplyByScalar(C,.5),u));var S=t.magnitude(t.multiplyByScalar(n,t.dot(C,n))),w=t.magnitude(t.multiplyByScalar(o,t.dot(C,o)));m+=g(v,S,w),p=s.clamp(y+1,.25,.5)}var E,x,b,T,A=t.multiplyByScalar(t.normalize(u),m),P=t.multiplyByScalar(t.normalize(i),m);if(t.magnitude(u)>_&&y>.75)T=t.add(t.multiplyByScalar(t.subtract(i,u),.5),u),d=[i,T,u];else if(t.magnitude(i)>_&&y>0)T=t.add(t.multiplyByScalar(t.subtract(i,A),.5),A),d=[i,T,u];else{d=[i],x=Math.acos(t.dot(t.normalize(P),t.normalize(A))),E=t.cross(A,P),t.equalsEpsilon(E,t.ZERO,s.EPSILON6)&&(E=t.UNIT_Z);for(var D=p*x,M=x-D,I=M;I>0;I-=D)b=l.fromQuaternion(c.fromAxisAngle(E,I)),d.push(l.multiplyByVector(b,A));d.push(u)}for(var O=new Array(d.length),R=h/(d.length-1),L=0;Ld;++d)u=s[d],t.normalize(t.negate(u,I),I),t.normalize(t.cross(I,t.UNIT_Z,O),O),t.cross(O,I,R),l[d]=v(I,R,L);return u=s[c],n(o)&&n(a)?l[c]=v(o,a):(t.normalize(t.negate(u,I),I),t.normalize(t.cross(I,t.UNIT_Z,O),O),t.cross(O,I,R),l[c]=v(I,R,L)),new h({points:l,times:e.times})}function C(e,r,i,n,o){var a=e.camera,s=e.scene2D.projection.ellipsoid,c=u.multiplyByPoint(a.transform,a.position,N),h=u.multiplyByPointAsVector(a.transform,a.direction,B),d=u.multiplyByPointAsVector(a.transform,a.up,z),m=t.cross(h,d,F),p=_(a,s,c,d,m,r,i),f=y(p,h,d,n,o),v=function(e){var r=e.time,i=f.evaluate(r);l.fromQuaternion(i,A),u.clone(a.transform,V),u.clone(u.IDENTITY,a.transform),a.position=p.evaluate(r,a.position),a.right=l.getRow(A,0,a.right),a.up=l.getRow(A,1,a.up),a.direction=t.negate(l.getRow(A,2,a.direction),a.direction),a.controller.setTransform(V)};return v}function S(e,r,i,n,o){var l,u,c=r.maximumRadius,h=e.frustum,d=g(h,Math.PI*c,s.PI_OVER_TWO*c),m=.5;if(i.z>d)u=.6*d;else{var p=t.subtract(i,n);u=g(h,Math.abs(p.y),Math.abs(p.x))}var f=t.clone(n);f.z=u;var v=t.clone(i);v.z=u;var _;if(n.z>d)_=t.add(t.multiplyByScalar(t.subtract(i,n),.5),n),l=[i,_,n];else if(i.z>d)_=t.add(t.multiplyByScalar(t.subtract(i,f),.5),f),l=[i,_,n];else{l=[i];var y=t.subtract(v,f),C=t.magnitude(y);t.normalize(y,y);for(var S=m*C,w=C-S,E=w;E>0;E-=S)l.push(t.add(t.multiplyByScalar(y,E),f));l.push(n)}for(var x=new Array(l.length),b=o/(l.length-1),T=0;Tl;++l)a[l]=G;return a[s]=n(r)&&n(i)?v(r,i):G,new h({points:a,times:t.times})}function E(e,r,i,n,o){var a=e.camera,s=e.scene2D.projection.ellipsoid,c=S(a,s,t.clone(a.position),r,i),h=w(a,c,n,o),d=function(e){var r=e.time,i=h.evaluate(r);l.fromQuaternion(i,A),u.clone(a.transform,V),u.clone(H,a.transform),a.position=c.evaluate(r,a.position),a.right=l.getRow(A,0,a.right),a.up=l.getRow(A,1,a.up),a.direction=t.negate(l.getRow(A,2,a.direction),a.direction),a.controller.setTransform(V)};return d}function x(e,r,i,n,o){var a=e.camera,s=e.scene2D.projection.ellipsoid,u=t.clone(a.position);u.z=a.frustum.right-a.frustum.left;var c=S(a,s,u,r,i),h=w(a,c,t.negate(t.UNIT_Z),o),d=a.position.z,m=function(e){var r=e.time,i=h.evaluate(r);l.fromQuaternion(i,A),a.position=c.evaluate(r);var n=a.position.z;a.position.z=d,a.right=l.getRow(A,0,a.right),a.up=l.getRow(A,1,a.up),a.direction=t.negate(l.getRow(A,2,a.direction),a.direction);var o=a.frustum,s=o.top/o.right,u=.5*(n-(o.right-o.left));o.right+=u,o.left-=u,o.top=s*o.right,o.bottom=-o.top};return m}var b={},T=new t,A=new l,P=new l,D=new t,M=new t,I=new t,O=new t,R=new t,L=new c,N=new t,B=new t,z=new t,F=new t,V=new u,k=t.negate(t.UNIT_Z),U=t.normalize(t.cross(k,t.UNIT_Y)),W=t.cross(U,k),G=v(k,W),H=new u(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),j=new t,q=new t,Y=new t;return b.createAnimation=function(r,o){o=i(o,i.EMPTY_OBJECT);var a=o.destination,l=o.direction,u=o.up,c=i(o.duration,3e3),h=r.frameState,d=r.screenSpaceCameraController;d.enableInputs=!1;var m=function(e){var t=function(){"function"==typeof e&&e(),d.enableInputs=!0};return t},v=m(o.onComplete),g=m(o.onCancel),_=o.endReferenceFrame;n(_)&&r.camera.controller.setTransform(_);var y=h.camera.frustum;if(h.mode===p.SCENE2D){if(e.equalsEpsilon(h.camera.position,a,s.EPSILON6)&&s.equalsEpsilon(Math.max(y.right-y.left,y.top-y.bottom),a.z,s.EPSILON6))return{duration:0,onComplete:v,onCancel:g}}else if(t.equalsEpsilon(a,h.camera.position,s.EPSILON6))return{duration:0,onComplete:v,onCancel:g};if(0>=c){var S=function(){var e=a;if(h.mode===p.SCENE3D?(n(o.direction)||n(o.up)?(j=o.direction,q=t.normalize(t.cross(j,o.up,q),q)):(j=t.normalize(t.negate(e,j),j),q=t.normalize(t.cross(j,t.UNIT_Z,q),q)),Y=i(o.up,t.cross(q,j,Y))):(n(o.direction)||n(o.up)?(j=o.direction,q=t.normalize(t.cross(j,o.up,q),q)):(j=t.negate(t.UNIT_Z,j),q=t.normalize(t.cross(j,t.UNIT_Y,q),q)),Y=i(o.up,t.cross(q,j,Y))),t.clone(e,h.camera.position),t.clone(j,h.camera.direction),t.clone(Y,h.camera.up),t.clone(q,h.camera.right),h.mode===p.SCENE2D){var r=h.camera.position.z,s=y.top/y.right,l=.5*(r-(y.right-y.left));y.right+=l,y.left-=l,y.top=s*y.right,y.bottom=-y.top}"function"==typeof v&&v()};return{duration:0,onComplete:S,onCancel:g}}var w;return w=h.mode===p.SCENE3D?C(h,a,c,l,u):h.mode===p.SCENE2D?x(h,a,c,l,u):E(h,a,c,l,u),{duration:c,easingFunction:f.Easing.Sinusoidal.InOut,startValue:{time:0},stopValue:{time:c},onUpdate:w,onComplete:v,onCancel:g}},b.createAnimationCartographic=function(e,t){t=i(t,i.EMPTY_OBJECT);var n=t.destination,a=e.frameState,s=a.scene2D.projection;if(a.mode===p.SCENE3D){var l=s.ellipsoid;l.cartographicToCartesian(n,T)}else{if(a.mode!==p.COLUMBUS_VIEW&&a.mode!==p.SCENE2D)throw new o("frameState.mode cannot be SceneMode.MORPHING");s.project(n,T)}var u=r(t);return u.destination=T,this.createAnimation(e,u)},b.createAnimationExtent=function(e,t){t=i(t,i.EMPTY_OBJECT);var n=t.destination,o=e.frameState,a=r(t),s=o.camera;return s.controller.getExtentCameraCoordinates(n,T),a.destination=T,this.createAnimation(e,a) +},b}),r("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,r){"use strict";var i=function(t,i,n,o,a){if(this.imageryLayer=t,this.x=i,this.y=n,this.level=o,0!==o){var s=0|i/2,l=0|n/2,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=r.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.getImageryProvider().ready){var c=t.getImageryProvider().tilingScheme;a=c.tileXYToExtent(i,n,o)}this.extent=a};return i.createPlaceholder=function(e){var t=new i(e,0,0,0);return t.addReference(),t.state=r.PLACEHOLDER,t},i.prototype.addReference=function(){++this.referenceCount},i.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&e(this.texture.destroy)&&this.texture.destroy(),t(this),0):this.referenceCount},i}),r("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";var r=function(e,t){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateExtent=t,this.textureTranslationAndScale=void 0};return r.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},r.prototype.processStateMachine=function(r,i){var n=this.loadingImagery,o=n.imageryLayer;if(n.state===t.UNLOADED&&(n.state=t.TRANSITIONING,o._requestImagery(n)),n.state===t.RECEIVED&&(n.state=t.TRANSITIONING,o._createTexture(i,n)),n.state===t.TEXTURE_LOADED&&(n.state=t.TRANSITIONING,o._reprojectTexture(i,n)),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this),!0;for(var a=n.parent,s=!1;e(a)&&a.state!==t.READY;)s=s||a.state!==t.FAILED&&a.state!==t.INVALID,a=a.parent;return this.readyImagery!==a&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=a,e(a)&&(a.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this))),s||n.state!==t.FAILED&&n.state!==t.INVALID?!1:!0},r}),r("Scene/TexturePool",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/PixelDatatype","../Renderer/PixelFormat","../Renderer/Texture"],function(e,t,r,i,n,o){"use strict";function a(t,r,i){return e(s)||(s=function(e,t,r){this._texture=e,this._textureTypeKey=t,this._pool=r},Object.keys(o.prototype).forEach(function(e){s.prototype[e]=function(){var t=this._texture;return t[e].apply(t,arguments)}}),s.prototype.destroy=function(){var t=this._pool._free[this._textureTypeKey];e(t)||(t=this._pool._free[this._textureTypeKey]=[]),t.length>=8?this._texture.destroy():t.push(this)}),new s(t,r,i)}var s,l=function(){this._free={}};return l.prototype.createTexture2D=function(t,r){var o=r.source,s=e(o)?o.width:r.width,l=e(o)?o.height:r.height,u=r.pixelFormat||n.RGBA,c=r.pixelDatatype||i.UNSIGNED_BYTE,h=+(r.preMultiplyAlpha||u===n.RGB||u===n.LUMINANCE),d=JSON.stringify([s,l,u,c,h]),m=this._free[d];if(e(m)&&m.length>0){var p=m.pop();return e(o)&&p.copyFrom(o),p}return a(t.createTexture2D(r),d,this)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){var e=this._free;return Object.keys(e).forEach(function(t){e[t].forEach(function(e){e._texture.destroy()})}),t(this)},l}),r("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),r("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec2 u_textureDimensions;\nuniform float u_northLatitude;\nuniform float u_southLatitude;\nuniform float u_southMercatorYHigh;\nuniform float u_southMercatorYLow;\nuniform float u_oneOverMercatorHeight;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat currentLatitude = mix(u_southLatitude, u_northLatitude, position.y);\nfloat fraction = czm_latitudeToWebMercatorFraction(currentLatitude, u_southMercatorYLow, u_southMercatorYHigh, u_oneOverMercatorHeight);\nv_textureCoordinates = vec2(position.x, fraction);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),r("Scene/ImageryLayer",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/BoundingRectangle","../Core/ComponentDatatype","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/Extent","../Core/FeatureDetection","../Core/Math","../Core/PrimitiveType","../Core/Geometry","../Core/GeometryAttribute","../Renderer/BufferUsage","../Renderer/MipmapHint","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/ClearCommand","./GeographicTilingScheme","./Imagery","./TileProviderError","./ImageryState","./TileImagery","./TerrainProvider","./TexturePool","../ThirdParty/when","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D){"use strict";function M(e,t,r){return JSON.stringify([e,t,r])}function I(r,o,a,l){var u=o.cache.imageryLayer_reproject;if(!t(u)){u=o.cache.imageryLayer_reproject={framebuffer:void 0,vertexArray:void 0,shaderProgram:void 0,renderState:void 0,sampler:void 0,destroy:function(){t(this.framebuffer)&&this.framebuffer.destroy(),t(this.vertexArray)&&this.vertexArray.destroy(),t(this.shaderProgram)&&this.shaderProgram.release()}};for(var c=new Array(131072),C=0,S=0;256>S;++S)for(var w=S/255,E=0;256>E;++E){var x=E/255;c[C++]=x,c[C++]=w}var T=new d({attributes:{position:new m({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:c})},indices:b.getRegularGridIndices(256,256),primitiveType:h.TRIANGLES}),A={position:0};u.vertexArray=o.createVertexArrayFromGeometry({geometry:T,attributeLocations:A,bufferUsage:p.STATIC_DRAW}),u.shaderProgram=o.getShaderCache().getShaderProgram(D,P,A);var M=o.getMaximumTextureFilterAnisotropy();u.sampler=o.createSampler({wrapS:_.CLAMP_TO_EDGE,wrapT:_.CLAMP_TO_EDGE,minificationFilter:g.LINEAR,magnificationFilter:v.LINEAR,maximumAnisotropy:Math.min(M,e(r._maximumAnisotropy,M))})}a.setSampler(u.sampler);var I=a.getWidth(),O=a.getHeight();L.textureDimensions.x=I,L.textureDimensions.y=O,L.texture=a,L.northLatitude=l.north,L.southLatitude=l.south;var R=Math.sin(l.south),B=.5*Math.log((1+R)/(1-R));N[0]=B,L.southMercatorYHigh=N[0],L.southMercatorYLow=B-N[0],R=Math.sin(l.north);var z=.5*Math.log((1+R)/(1-R));L.oneOverMercatorHeight=1/(z-B);var F=r._texturePool.createTexture2D(o,{width:I,height:O,pixelFormat:a.getPixelFormat(),pixelDatatype:a.getPixelDatatype(),preMultiplyAlpha:a.getPreMultiplyAlpha()});F.generateMipmap(f.NICEST),t(u.framebuffer)&&u.framebuffer.destroy(),u.framebuffer=o.createFramebuffer({colorTextures:[F]}),u.framebuffer.destroyAttachments=!1;var V=new y;return V.color=s.BLACK,V.framebuffer=u.framebuffer,V.execute(o),t(u.renderState)&&u.renderState.viewport.width===I&&u.renderState.viewport.height===O||(u.renderState=o.createRenderState({viewport:new i(0,0,I,O)})),o.draw({framebuffer:u.framebuffer,shaderProgram:u.shaderProgram,renderState:u.renderState,primitiveType:h.TRIANGLES,vertexArray:u.vertexArray,uniformMap:L}),F}function O(e,t,r){var i=e._imageryProvider,n=i.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof C?1:Math.cos(r),s=n.extent,l=o.maximumRadius*(s.east-s.west)*a/(i.tileWidth*n.getNumberOfXTilesAtLevel(0)),u=l/t,c=Math.log(u)/Math.log(2),h=Math.round(c);return 0|h}var R=function B(t,r){this._imageryProvider=t,r=e(r,{}),this.alpha=e(r.alpha,e(t.defaultAlpha,1)),this.brightness=e(r.brightness,e(t.defaultBrightness,B.DEFAULT_BRIGHTNESS)),this.contrast=e(r.contrast,e(t.defaultContrast,B.DEFAULT_CONTRAST)),this.hue=e(r.hue,e(t.defaultHue,B.DEFAULT_HUE)),this.saturation=e(r.saturation,e(t.defaultSaturation,B.DEFAULT_SATURATION)),this.gamma=e(r.gamma,e(t.defaultGamma,B.DEFAULT_GAMMA)),this.show=e(r.show,!0),this._minimumTerrainLevel=r.minimumTerrainLevel,this._maximumTerrainLevel=r.maximumTerrainLevel,this._extent=e(r.extent,l.MAX_VALUE),this._maximumAnisotropy=r.maximumAnisotropy,this._imageryCache={},this._texturePool=new T,this._skeletonPlaceholder=new x(S.createPlaceholder(this)),this._show=!1,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0};R.DEFAULT_BRIGHTNESS=1,R.DEFAULT_CONTRAST=1,R.DEFAULT_HUE=0,R.DEFAULT_SATURATION=1,R.DEFAULT_GAMMA=1,R.prototype.getImageryProvider=function(){return this._imageryProvider},R.prototype.getExtent=function(){return this._extent},R.prototype.isBaseLayer=function(){return this._isBaseLayer},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return this._texturePool=this._texturePool&&this._texturePool.destroy(),r(this)},R.prototype._createTileImagerySkeletons=function(e,r,i){if(t(this._minimumTerrainLevel)&&e.levelthis._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(t(i)||(i=e.imagery.length),!n.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),e.imagery.splice(i,0,this._skeletonPlaceholder),!0;var o=e.extent.intersectWith(n.extent);if(o=o.intersectWith(this._extent),o.east<=o.west||o.north<=o.south){if(!this.isBaseLayer())return!1;var s=n.extent.intersectWith(this._extent),l=e.extent;l.south>=s.north?o.north=o.south=s.north:l.north<=s.south&&(o.north=o.south=s.south),l.west>=s.east?o.west=o.east=s.east:l.east<=s.west&&(o.west=o.east=s.west)}var u=0;o.south>0?u=o.south:o.north<0&&(u=o.north);var c=1,h=c*r.getLevelMaximumGeometricError(e.level),d=O(this,h,u);d=Math.max(0,d);var m=n.maximumLevel;if(d>m&&(d=m),t(n.minimumLevel)){var p=n.minimumLevel;p>d&&(d=p)}var f=n.tilingScheme,v=f.positionToTileXY(o.getNorthwest(),d),g=f.positionToTileXY(o.getSoutheast(),d),_=(e.extent.north-e.extent.south)/512,y=(e.extent.east-e.extent.west)/512,C=f.tileXYToExtent(v.x,v.y,d);Math.abs(C.south-e.extent.north)v.y&&--g.y,Math.abs(S.west-e.extent.east)<_&&g.x>v.x&&--g.x;var w,E,b=e.extent,T=f.tileXYToExtent(v.x,v.y,d),A=0,P=1;!this.isBaseLayer()&&Math.abs(T.west-e.extent.west)>=_&&(A=Math.min(1,(T.west-b.west)/(b.east-b.west))),!this.isBaseLayer()&&Math.abs(T.north-e.extent.north)>=y&&(P=Math.max(0,(T.north-b.south)/(b.north-b.south)));for(var D=P,M=v.x;M<=g.x;M++){w=A,T=f.tileXYToExtent(M,v.y,d),A=Math.min(1,(T.east-b.west)/(b.east-b.west)),M===g.x&&(this.isBaseLayer()||Math.abs(T.east-e.extent.east)<_)&&(A=1),P=D;for(var I=v.y;I<=g.y;I++){E=P,T=f.tileXYToExtent(M,I,d),P=Math.max(0,(T.south-b.south)/(b.north-b.south)),I===g.y&&(this.isBaseLayer()||Math.abs(T.south-e.extent.south)1e-5){var a=I(this,r,n,i.extent);n.destroy(),i.texture=n=a}if(c.isPowerOfTwo(n.getWidth())&&c.isPowerOfTwo(n.getHeight())){var s=r.cache.imageryLayer_mipmapSampler;if(!t(s)){var l=r.getMaximumTextureFilterAnisotropy();s=r.cache.imageryLayer_mipmapSampler=r.createSampler({wrapS:_.CLAMP_TO_EDGE,wrapT:_.CLAMP_TO_EDGE,minificationFilter:g.LINEAR_MIPMAP_LINEAR,magnificationFilter:v.LINEAR,maximumAnisotropy:Math.min(l,e(this._maximumAnisotropy,l))})}n.generateMipmap(f.NICEST),n.setSampler(s)}else{var u=r.cache.imageryLayer_nonMipmapSampler;t(u)||(u=r.cache.imageryLayer_nonMipmapSampler=r.createSampler({wrapS:_.CLAMP_TO_EDGE,wrapT:_.CLAMP_TO_EDGE,minificationFilter:g.LINEAR,magnificationFilter:v.LINEAR})),n.setSampler(u)}i.state=E.READY},R.prototype.getImageryFromCache=function(e,r,i,n){var o=M(e,r,i),a=this._imageryCache[o];return t(a)||(a=new S(this,e,r,i,n),this._imageryCache[o]=a),a.addReference(),a},R.prototype.removeImageryFromCache=function(e){var t=M(e.x,e.y,e.level);delete this._imageryCache[t]};var L={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},u_northLatitude:function(){return this.northLatitude},u_southLatitude:function(){return this.southLatitude},u_southMercatorYLow:function(){return this.southMercatorYLow},u_southMercatorYHigh:function(){return this.southMercatorYHigh},u_oneOverMercatorHeight:function(){return this.oneOverMercatorHeight},textureDimensions:new o,texture:void 0,northLatitude:0,southLatitude:0,southMercatorYHigh:0,southMercatorYLow:0,oneOverMercatorHeight:0},N=u.supportsTypedArrays()?new Float32Array(1):void 0;return R}),r("Scene/TileReplacementQueue",["../Core/defined","./ImageryState","./TerrainState"],function(e,t,r){"use strict";function i(e,t){var r=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:r.replacementNext=i,t===e.tail?e.tail=r:i.replacementPrevious=r,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}var n=function(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0};return n.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},n.prototype.trimTiles=function(n){for(var o=this.tail,a=!0;a&&e(this._lastBeforeStartOfFrame)&&this.count>n&&e(o);){a=o!==this._lastBeforeStartOfFrame;for(var s=o.replacementPrevious,l=o.loadedTerrain,u=e(l)&&(l.state===r.RECEIVING||l.state===r.TRANSFORMING),c=o.upsampledTerrain,h=e(c)&&(c.state===r.RECEIVING||c.state===r.TRANSFORMING),d=!u&&!h,m=o.imagery,p=0,f=m.length;d&&f>p;++p){var v=m[p];d=!e(v.loadingImagery)||v.loadingImagery.state!==t.TRANSITIONING}d&&(o.freeResources(),i(this,o)),o=s}},n.prototype.markTileRendered=function(t){var r=this.head;return r===t?(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext),void 0):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,this.head=t,void 0):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,this.tail=t,void 0))},n}),r("Scene/CentralBodySurface",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidalOccluder","../Core/FeatureDetection","../Core/getTimestamp","../Core/Intersect","../Core/Matrix4","../Core/PrimitiveType","../Core/Queue","../Core/WebMercatorProjection","../Renderer/DrawCommand","../Renderer/Pass","./ImageryLayer","./ImageryState","./SceneMode","./TerrainProvider","./TileReplacementQueue","./TileState","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x){"use strict";function b(e,t){var r=e.loadingImagery;o(r)||(r=e.readyImagery);var i=t.loadingImagery;return o(i)||(i=t.readyImagery),r.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function T(e){if(e._imageryLayerCollection._update(),e._layerOrderChanged){e._layerOrderChanged=!1;for(var t=e._tileReplacementQueue.head;o(t);)t.imagery.sort(b),t=t.replacementNext}}function A(e,t,r){var i=e._debug;if(!i.suspendLodUpdate){var n,a,s=e._tilesToRenderByTextureCount;for(n=0,a=s.length;a>n;++n){var l=s[n];o(l)&&(l.length=0)}var u=e._tileTraversalQueue;if(u.clear(),i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.texturesRendered=0,i.tilesWaitingForChildren=0,e._tileLoadQueue.length=0,e._tileReplacementQueue.markStartOfRenderFrame(),!o(e._levelZeroTiles)){if(!e._terrainProvider.ready)return;var c=e._terrainProvider.tilingScheme;e._levelZeroTiles=c.createLevelZeroTiles()}var h=r.camera.positionWC,d=e._terrainProvider.tilingScheme.ellipsoid,m=d.cartesianToCartographic(h,G);e._ellipsoidalOccluder.cameraPosition=h;var p,f=e._levelZeroTiles;for(n=0,a=f.length;a>n;++n)p=f[n],e._tileReplacementQueue.markTileRendered(p),p.state!==E.READY&&L(e,p),p.isRenderable&&I(e,r,p)?u.enqueue(p):(++i.tilesCulled,p.isRenderable||++i.tilesWaitingForChildren);for(;o(p=u.dequeue());)if(++i.tilesVisited,e._tileReplacementQueue.markTileRendered(p),p.level>i.maxDepth&&(i.maxDepth=p.level),P(e,t,r,h,m,p)n;++n)I(e,r,v[n])?u.enqueue(v[n]):++i.tilesCulled}else++i.tilesWaitingForChildren,M(e,p);i.enableDebugOutput&&(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.texturesRendered!==i.lastTexturesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren)&&(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Textures: "+i.texturesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTexturesRendered=i.texturesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren)}}function P(e,t,r,i,n,o){if(r.mode===C.SCENE2D)return D(e,t,r,i,n,o);var a=e._terrainProvider.getLevelMaximumGeometricError(o.level),s=Math.sqrt(O(r,i,n,o));o.distance=s;var l=t.getDrawingBufferHeight(),u=r.camera,c=u.frustum,h=c.fovy;return a*l/(2*s*Math.tan(.5*h))}function D(e,t,r,i,n,o){var a=r.camera,s=a.frustum,l=t.getDrawingBufferWidth(),u=t.getDrawingBufferHeight(),c=e._terrainProvider.getLevelMaximumGeometricError(o.level),h=Math.max(s.top-s.bottom,s.right-s.left)/Math.max(l,u);return c/h}function M(e,t){for(var r=0,i=t.imagery,n=0,a=i.length;a>n;++n){var s=i[n];o(s.readyImagery)&&0!==s.readyImagery.imageryLayer.alpha&&++r}var l=e._tilesToRenderByTextureCount[r];o(l)||(l=[],e._tilesToRenderByTextureCount[r]=l),l.push(t);var u=e._debug;++u.tilesRendered,u.texturesRendered+=r}function I(t,i,n){var a=i.cullingVolume,s=n.boundingSphere3D;if(i.mode!==C.SCENE3D&&(s=H,e.fromExtentWithHeights2D(n.extent,i.scene2D.projection,n.minimumHeight,n.maximumHeight,s),r.fromElements(s.center.z,s.center.x,s.center.y,s.center),i.mode===C.MORPHING&&(s=e.union(n.boundingSphere3D,s,s))),a.getVisibility(s)===h.OUTSIDE)return!1;if(i.mode===C.SCENE3D){var l=n.occludeePointInScaledSpace;return o(l)?t._ellipsoidalOccluder.isScaledSpacePointVisible(l):!0}return!0}function O(e,t,i,n){var o=n.southwestCornerCartesian,a=n.northeastCornerCartesian,s=n.westNormal,l=n.southNormal,u=n.eastNormal,c=n.northNormal,h=n.maximumHeight;e.mode!==C.SCENE3D&&(o=e.scene2D.projection.project(n.extent.getSouthwest(),j),o.z=o.y,o.y=o.x,o.x=0,a=e.scene2D.projection.project(n.extent.getNortheast(),q),a.z=a.y,a.y=a.x,a.x=0,s=Y,u=r.UNIT_Y,l=X,c=r.UNIT_Z,h=0);var d,m=r.subtract(t,o,Z),p=r.dot(m,s),f=r.dot(m,l),v=r.subtract(t,a,Z),g=r.dot(v,u),_=r.dot(v,c);d=e.mode===C.SCENE3D?i.height:t.x;var y=d-h,S=0;return p>0?S+=p*p:g>0&&(S+=g*g),f>0?S+=f*f:_>0&&(S+=_*_),y>0&&(S+=y*y),S}function R(e,t,r){for(var i=!0,n=r.getChildren(),o=0,a=n.length;a>o;++o){var s=n[o];e._tileReplacementQueue.markTileRendered(s),s.state!==E.READY&&L(e,s),s.isRenderable||(i=!1)}return i}function L(e,t){e._tileLoadQueue.push(t)}function N(e,t){var r=e._tileLoadQueue,i=e._terrainProvider,n=e._imageryLayerCollection;if(0!==r.length){e._tileReplacementQueue.trimTiles(e._tileCacheSize);for(var o=c(),a=e._loadQueueTimeSlice,s=o+a,l=r.length-1,u=l;u>=0;--u){var h=r[u];if(e._tileReplacementQueue.markTileRendered(h),h.processStateMachine(t,i,n),c()>=s)break}}}function B(e,t){return e.distance-t.distance}function z(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function F(e){var n={u_center3D:function(){return this.center3D},u_tileExtent:function(){return this.tileExtent},u_modifiedModelView:function(){return this.modifiedModelView},u_dayTextures:function(){return this.dayTextures},u_dayTextureTranslationAndScale:function(){return this.dayTextureTranslationAndScale},u_dayTextureTexCoordsExtent:function(){return this.dayTextureTexCoordsExtent},u_dayTextureAlpha:function(){return this.dayTextureAlpha},u_dayTextureBrightness:function(){return this.dayTextureBrightness},u_dayTextureContrast:function(){return this.dayTextureContrast},u_dayTextureHue:function(){return this.dayTextureHue},u_dayTextureSaturation:function(){return this.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.dayTextureOneOverGamma},u_dayIntensity:function(){return this.dayIntensity},u_southAndNorthLatitude:function(){return this.southAndNorthLatitude},u_southMercatorYLowAndHighAndOneOverHeight:function(){return this.southMercatorYLowAndHighAndOneOverHeight},u_waterMask:function(){return this.waterMask},u_waterMaskTranslationAndScale:function(){return this.waterMaskTranslationAndScale},center3D:void 0,modifiedModelView:new d,tileExtent:new i,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsExtent:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new t,southMercatorYLowAndHighAndOneOverHeight:new r,waterMask:void 0,waterMaskTranslationAndScale:new i};return z(n,e),n}function V(t,n,a,s,l,u,c,h){U(t,a);for(var p=a.camera.viewMatrix,S=n.getMaximumTextureImageUnits(),w=t._tileCommands,E=t._tileCommandUniformMaps,x=-1,b=t._tilesToRenderByTextureCount,T=0,A=b.length;A>T;++T){var P=b[T];if(o(P)&&0!==P.length){P.sort(B);for(var D=0,M=P.length;M>D;D++){var I=P[D],O=I.center,R=K,L=0,N=0,z=0,V=0,W=0;if(a.mode!==C.SCENE3D){var G=l.project(I.extent.getSouthwest(),tt),H=l.project(I.extent.getNortheast(),rt);if(R.x=G.x,R.y=G.y,R.z=H.x,R.w=H.y,a.mode!==C.MORPHING&&(O=$,O.x=0,O.y=.5*(R.z+R.x),O.z=.5*(R.w+R.y),R.x-=O.y,R.y-=O.z,R.z-=O.y,R.w-=O.z),l instanceof f){L=I.extent.south,N=I.extent.north;var j=f.geodeticLatitudeToMercatorAngle(L),q=f.geodeticLatitudeToMercatorAngle(N);J[0]=j,z=J[0],V=j-J[0],W=1/(q-j)}}var Y=et;Y.x=O.x,Y.y=O.y,Y.z=O.z,Y.w=1,d.multiplyByVector(p,Y,Y),d.setColumn(p,3,Y,Q);var X=I.imagery,Z=0,it=X.length;do{var nt=0;++x;var ot=w[x];o(ot)||(ot=new v,ot.owner=I,ot.cull=!1,ot.boundingVolume=new e,w[x]=ot,E[x]=F(u)),ot.owner=I,ot.debugShowBoundingVolume=I===t._debug.boundingSphereTile;var at=E[x];at.center3D=I.center,i.clone(R,at.tileExtent),at.southAndNorthLatitude.x=L,at.southAndNorthLatitude.y=N,at.southMercatorYLowAndHighAndOneOverHeight.x=V,at.southMercatorYLowAndHighAndOneOverHeight.y=z,at.southMercatorYLowAndHighAndOneOverHeight.z=W,d.clone(Q,at.modifiedModelView);for(var st=!1,lt=!1,ut=!1,ct=!1,ht=!1,dt=!1;S>nt&&it>Z;){var mt=X[Z],pt=mt.readyImagery;if(++Z,o(pt)&&pt.state===y.READY&&0!==pt.imageryLayer.alpha){var ft=pt.imageryLayer;if(o(mt.textureTranslationAndScale)||(mt.textureTranslationAndScale=ft._calculateTextureTranslationAndScale(I,mt)),at.dayTextures[nt]=pt.texture,at.dayTextureTranslationAndScale[nt]=mt.textureTranslationAndScale,at.dayTextureTexCoordsExtent[nt]=mt.textureCoordinateExtent,at.dayTextureAlpha[nt]="function"==typeof ft.alpha?ft.alpha(a,ft,pt.x,pt.y,pt.level):ft.alpha,dt=dt||1!==at.dayTextureAlpha[nt],at.dayTextureBrightness[nt]="function"==typeof ft.brightness?ft.brightness(a,ft,pt.x,pt.y,pt.level):ft.brightness,st=st||at.dayTextureBrightness[nt]!==_.DEFAULT_BRIGHTNESS,at.dayTextureContrast[nt]="function"==typeof ft.contrast?ft.contrast(a,ft,pt.x,pt.y,pt.level):ft.contrast,lt=lt||at.dayTextureContrast[nt]!==_.DEFAULT_CONTRAST,at.dayTextureHue[nt]="function"==typeof ft.hue?ft.hue(a,ft,pt.x,pt.y,pt.level):ft.hue,ut=ut||at.dayTextureHue[nt]!==_.DEFAULT_HUE,at.dayTextureSaturation[nt]="function"==typeof ft.saturation?ft.saturation(a,ft,pt.x,pt.y,pt.level):ft.saturation,ct=ct||at.dayTextureSaturation[nt]!==_.DEFAULT_SATURATION,at.dayTextureOneOverGamma[nt]="function"==typeof ft.gamma?1/ft.gamma(a,ft,pt.x,pt.y,pt.level):1/ft.gamma,ht=ht||at.dayTextureOneOverGamma[nt]!==1/_.DEFAULT_GAMMA,o(pt.credits))for(var vt=a.creditDisplay,gt=pt.credits,_t=0,yt=gt.length;yt>_t;++_t)vt.addCredit(gt[_t]);++nt}}at.dayTextures.length=nt,at.waterMask=I.waterMaskTexture,i.clone(I.waterMaskTranslationAndScale,at.waterMaskTranslationAndScale),c.push(ot),ot.shaderProgram=s.getShaderProgram(n,T,st,lt,ut,ct,ht,dt),ot.renderState=h,ot.primitiveType=m.TRIANGLES,ot.vertexArray=I.vertexArray,ot.uniformMap=at,ot.pass=g.OPAQUE,t._debug.wireframe&&(k(n,t,I),o(I.wireframeVertexArray)&&(ot.vertexArray=I.wireframeVertexArray,ot.primitiveType=m.LINES));var Ct=ot.boundingVolume;a.mode!==C.SCENE3D?(e.fromExtentWithHeights2D(I.extent,a.scene2D.projection,I.minimumHeight,I.maximumHeight,Ct),r.fromElements(Ct.center.z,Ct.center.x,Ct.center.y,Ct.center),a.mode===C.MORPHING&&(Ct=e.union(I.boundingSphere3D,Ct,Ct))):e.clone(I.boundingSphere3D,Ct)}while(it>Z)}}}w.length=Math.max(0,x+1)}function k(e,t,r){if(!o(r.wireframeVertexArray)&&!o(r.meshForWireframePromise)&&(r.meshForWireframePromise=r.terrainData.createMesh(t._terrainProvider.tilingScheme,r.x,r.y,r.level),o(r.meshForWireframePromise))){var i=r.vertexArray;x(r.meshForWireframePromise,function(t){r.vertexArray===i&&(r.wireframeVertexArray=S.createWireframeVertexArray(e,r.vertexArray,t)),r.meshForWireframePromise=void 0})}}function U(e,t){var r,i=t.creditDisplay;e._terrainProvider.ready&&(r=e._terrainProvider.credit,o(r)&&i.addCredit(r));for(var n=e._imageryLayerCollection,a=0,s=n.length;s>a;++a){var l=n.get(a);l.show&&l.getImageryProvider().ready&&(r=l.getImageryProvider().credit,o(r)&&i.addCredit(r))}}var W=function(e){this._terrainProvider=e.terrainProvider,this._imageryLayerCollection=e.imageryLayerCollection,this._imageryLayerCollection.layerAdded.addEventListener(W.prototype._onLayerAdded,this),this._imageryLayerCollection.layerRemoved.addEventListener(W.prototype._onLayerRemoved,this),this._imageryLayerCollection.layerMoved.addEventListener(W.prototype._onLayerMoved,this),this._imageryLayerCollection.layerShownOrHidden.addEventListener(W.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1;var t=this._terrainProvider.tilingScheme;this._levelZeroTiles=void 0,this._tilesToRenderByTextureCount=[],this._tileCommands=[],this._tileCommandUniformMaps=[],this._tileTraversalQueue=new p,this._tileLoadQueue=[],this._tileReplacementQueue=new w,this._maximumScreenSpaceError=2,this._tileCacheSize=100,this._loadQueueTimeSlice=5;var i=t.ellipsoid;this._ellipsoidalOccluder=new l(i,r.ZERO),this._debug={enableDebugOutput:!1,wireframe:!1,boundingSphereTile:void 0,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,texturesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTexturesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1}};W.prototype.update=function(e,t,r,i,n,o,a){T(this),A(this,e,t),N(this,e,t),V(this,e,t,n,a,i,r,o)},W.prototype.getTerrainProvider=function(){return this._terrainProvider},W.prototype.setTerrainProvider=function(e){if(this._terrainProvider!==e){this._terrainProvider=e;var t=this._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0;var r=this._levelZeroTiles;if(o(r))for(var i=0;ia;++a){var l=r[a],u=l.loadingImagery;if(o(u)||(u=l.readyImagery),u.imageryLayer===e)-1===i&&(i=a),l.freeResources(),++n;else if(-1!==i)break}-1!==i&&r.splice(i,n),e.isBaseLayer()&&(t.isRenderable=!1),t=t.replacementNext}},W.prototype._onLayerMoved=function(){o(this._levelZeroTiles)&&(this._layerOrderChanged=!0)},W.prototype._onLayerShownOrHidden=function(e,t,r){o(this._levelZeroTiles)&&(r?this._onLayerAdded(e,t):this._onLayerRemoved(e,t))},W.prototype.isDestroyed=function(){return!1},W.prototype.destroy=function(){var e=this._levelZeroTiles;if(o(e))for(var t=0;tp;++p)m+="color = sampleAndBlend(\n color,\n u_dayTextures["+p+"],\n"+" textureCoordinates,\n"+" u_dayTextureTexCoordsExtent["+p+"],\n"+" u_dayTextureTranslationAndScale["+p+"],\n"+(u?" u_dayTextureAlpha["+p+"],\n":"1.0,\n")+(n?" u_dayTextureBrightness["+p+"],\n":"0.0,\n")+(o?" u_dayTextureContrast["+p+"],\n":"0.0,\n")+(a?" u_dayTextureHue["+p+"],\n":"0.0,\n")+(s?" u_dayTextureSaturation["+p+"],\n":"0.0,\n")+(l?" u_dayTextureOneOverGamma["+p+"]);\n":"0.0);\n");m+=" return color;\n}",h=t.getShaderCache().getShaderProgram(d,m,this._attributeLocations),this._shaders[c]=h +}return h},r.prototype.destroy=function(){return this.invalidateShaders(),t(this)},r}),r("Scene/EllipsoidTerrainProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","./HeightmapTerrainData","./TerrainProvider","./GeographicTilingScheme"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){r=e(r,{}),this._tilingScheme=r.tilingScheme,t(this._tilingScheme)||(this._tilingScheme=new s({ellipsoid:e(r.ellipsoid,i.WGS84)})),this._levelZeroMaximumGeometricError=a.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0));var l=16,u=16;this._terrainData=new o({buffer:new Uint8Array(l*u),width:16,height:16}),this._errorEvent=new n};return r(l.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return void 0}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}}}),l.prototype.requestTileGeometry=function(){return this._terrainData},l.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<i;i++){var o=r[i];this.layerRemoved.raiseEvent(o,i),e&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return-1!==this.indexOf(e)},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=l(this._layers,e);u(this,t,t+1)},c.prototype.lower=function(e){var t=l(this._layers,e);u(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=l(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=l(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),n(this)},c.prototype._update=function(){for(var e,t,i=!0,n=this._layers,o=0,a=n.length;a>o;++o)t=n[o],t._layerIndex=o,t.show?(t._isBaseLayer=i,i=!1):t._isBaseLayer=!1,t.show!==t._show&&(r(t._show)&&(r(e)||(e=[]),e.push(t)),t._show=t.show);if(r(e))for(o=0,a=e.length;a>o;++o)t=e[o],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},c}),r("Shaders/CentralBodyFS",[],function(){"use strict";return"#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsExtent[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_LIGHTING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvec3 sampleAndBlend(\nvec3 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateExtent,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateExtent.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateExtent.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 sample = texture2D(texture, textureCoordinates);\nvec3 color = sample.rgb;\nfloat alpha = sample.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nreturn mix(previousColor, color, alpha * textureAlpha);\n}\nvec3 computeDayColor(vec3 initialColor, vec2 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec3 imageryColor, float specularMapValue);\nvoid main()\n{\nvec3 initialColor = vec3(0.0, 0.0, 0.5);\nvec3 startDayColor = computeDayColor(initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\nstartDayColor = vec3(1.0, 0.0, 0.0);\n}\n#endif\nvec4 color = vec4(startDayColor, 1.0);\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_LIGHTING)\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal3D * normalMC);\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, startDayColor, mask);\n}\n#endif\n#ifdef ENABLE_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\ngl_FragColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\ngl_FragColor = color;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nconst float oceanFrequency = 125000.0;\nconst float oceanAnimationSpeed = 0.006;\nconst float oceanAmplitude = 2.0;\nconst float oceanSpecularIntensity = 0.5;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec3 imageryColor, float specularMapValue)\n{\nfloat time = czm_frameNumber * oceanAnimationSpeed;\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / oceanAmplitude));\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC);\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), specularMapValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor + diffuseHighlight + nonDiffuseHighlight + specular, 1.0);\n}\n#endif\n"}),r("Shaders/CentralBodyFSDepth",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),r("Shaders/CentralBodyFSPole",[],function(){"use strict";return"uniform vec3 u_color;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(czm_windowToEyeCoordinates(gl_FragCoord).xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection.start);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec3 startDayColor = u_color;\ngl_FragColor = vec4(startDayColor, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),r("Shaders/CentralBodyVS",[],function(){"use strict";return"attribute vec4 position3DAndHeight;\nattribute vec2 textureCoordinates;\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileExtent;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec3 u_southMercatorYLowAndHighAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvec4 getPosition(vec3 position3DWC);\nfloat get2DYPositionFraction();\nvec4 getPosition3DMode(vec3 position3DWC)\n{\nreturn czm_projection * (u_modifiedModelView * vec4(position3DAndHeight.xyz, 1.0));\n}\nfloat get2DMercatorYPositionFraction()\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorYLow = u_southMercatorYLowAndHighAndOneOverHeight.x;\nfloat southMercatorYHigh = u_southMercatorYLowAndHighAndOneOverHeight.y;\nfloat oneOverMercatorHeight = u_southMercatorYLowAndHighAndOneOverHeight.z;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorYLow, southMercatorYHigh, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction()\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position3DWC, float height2D)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 rtcPosition2D = vec4(height2D, mix(u_tileExtent.st, u_tileExtent.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn czm_projection * (u_modifiedModelView * rtcPosition2D);\n}\nvec4 getPosition2DMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, 0.0);\n}\nvec4 getPositionColumbusViewMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, position3DAndHeight.w);\n}\nvec4 getPositionMorphingMode(vec3 position3DWC)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 position2DWC = vec4(0.0, mix(u_tileExtent.st, u_tileExtent.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\nvoid main()\n{\nvec3 position3DWC = position3DAndHeight.xyz + u_center3D;\ngl_Position = getPosition(position3DWC);\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_LIGHTING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\nv_textureCoordinates = textureCoordinates;\n}\n"}),r("Shaders/CentralBodyVSDepth",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),r("Shaders/CentralBodyVSPole",[],function(){"use strict";return"attribute vec4 position;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat x = (position.x - czm_viewport.x) / czm_viewport.z;\nfloat y = (position.y - czm_viewport.y) / czm_viewport.w;\nv_textureCoordinates = vec2(x, y);\ngl_Position = czm_viewportOrthographic * position;\n}\n"}),r("Scene/CentralBody",["../Core/buildModuleUrl","../Core/combine","../Core/loadImage","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ComponentDatatype","../Core/Ellipsoid","../Core/Extent","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Occluder","../Core/PrimitiveType","../Core/Transforms","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DepthFunction","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","./CentralBodySurface","./CentralBodySurfaceShaderSet","./EllipsoidTerrainProvider","./ImageryLayerCollection","./SceneMode","./TerrainProvider","../Shaders/CentralBodyFS","../Shaders/CentralBodyFSDepth","../Shaders/CentralBodyFSPole","../Shaders/CentralBodyVS","../Shaders/CentralBodyVSDepth","../Shaders/CentralBodyVSPole","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N,B,z,F,V,k,U,W,G){"use strict";function H(e,t){var r=e._ellipsoid.radii,i=t.camera.positionWC,n=c.multiplyComponents(e._ellipsoid.oneOverRadii,i,Z),o=c.magnitude(n),a=c.normalize(n,J),s=c.normalize(c.cross(c.UNIT_Z,n,Q),Q),l=c.normalize(c.cross(a,s,K),K),u=Math.sqrt(c.magnitudeSquared(n)-1),h=c.multiplyByScalar(a,1/o,Z),d=u/o,m=c.multiplyByScalar(s,d,J),p=c.multiplyByScalar(l,d,Q),f=c.add(h,p,K);c.subtract(f,m,f),c.multiplyComponents(r,f,f),c.pack(f,X,0);var v=c.subtract(h,p,K);c.subtract(v,m,v),c.multiplyComponents(r,v,v),c.pack(v,X,3);var g=c.add(h,p,K);c.add(g,m,g),c.multiplyComponents(r,g,g),c.pack(g,X,6);var _=c.subtract(h,p,K);return c.add(_,m,_),c.multiplyComponents(r,_,_),c.pack(_,X,9),X}function j(e,t,r,i,n,o){var a,l=e._ellipsoid.cartographicToCartesian(new h(0,i)),u=e._ellipsoid.cartographicToCartesian(new h(Math.PI,i)),d=.5*c.magnitude(c.subtract(l,u)),m=e._ellipsoid.cartographicToCartesian(new h(0,r)),p=t.camera.direction;a=1-c.dot(c.negate(c.UNIT_Z),p)-C.PI_OVER_TWO&&(c=new p(-Math.PI,-C.PI_OVER_TWO,Math.PI,a.south),h=l.fromExtent3D(c,e._ellipsoid),m=i.cullingVolume.getVisibility(h)===y.OUTSIDE,f=w.computeOccludeePointFromExtent(c,e._ellipsoid),v=f&&!P.isPointVisible(f)||!P.isBoundingSphereVisible(h),e._drawSouthPole=!m&&!v,e._drawSouthPole&&(x=j(e,i,c.south,c.north+A,s,T),tt[0]=x.x,tt[1]=x.y,tt[2]=x.x+x.width,tt[3]=x.y,tt[4]=x.x+x.width,tt[5]=x.y+x.height,tt[6]=x.x,tt[7]=x.y+x.height,n(e._southPoleCommand.vertexArray)?e._southPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(tt):(e._southPoleCommand.boundingVolume=l.fromExtent3D(c,e._ellipsoid),E=new g({attributes:{position:new _({componentDatatype:d.FLOAT,componentsPerAttribute:2,values:tt})}}),e._southPoleCommand.vertexArray=r.createVertexArrayFromGeometry({geometry:E,attributeLocations:{position:0},bufferUsage:b.STREAM_DRAW}))));var D=0,M=e._imageryLayerCollection.length>0?e._imageryLayerCollection.get(0):void 0;n(M)&&n(M.getImageryProvider())&&n(M.getImageryProvider().getPoleIntensity)&&(D=M.getImageryProvider().getPoleIntensity());var I={u_dayIntensity:function(){return D}},O=e;if(!n(e._northPoleCommand.uniformMap)){var R=t(I,{u_color:function(){return O.northPoleColor}});e._northPoleCommand.uniformMap=t(R,e._drawUniforms)}if(!n(e._southPoleCommand.uniformMap)){var L=t(I,{u_color:function(){return O.southPoleColor}});e._southPoleCommand.uniformMap=t(L,e._drawUniforms)}}}var Y=function(t){t=i(t,m.WGS84);var r=new R({ellipsoid:t}),n=new L;this.terrainProvider=r,this._ellipsoid=t,this._imageryLayerCollection=n,this._surface=new I({terrainProvider:r,imageryLayerCollection:n}),this._occluder=new w(new l(c.ZERO,t.minimumRadius),c.ZERO),this._surfaceShaderSet=new O(B.attributeLocations),this._rsColor=void 0,this._rsColorWithoutDepthTest=void 0;var o=new T;o.depth=1,o.stencil=0,o.owner=this,this._clearDepthCommand=o,this._depthCommand=new P,this._depthCommand.primitiveType=E.TRIANGLES,this._depthCommand.boundingVolume=new l(c.ZERO,t.maximumRadius),this._depthCommand.pass=M.OPAQUE,this._depthCommand.owner=this,this._northPoleCommand=new P,this._northPoleCommand.primitiveType=E.TRIANGLE_FAN,this._northPoleCommand.pass=M.OPAQUE,this._northPoleCommand.owner=this,this._southPoleCommand=new P,this._southPoleCommand.primitiveType=E.TRIANGLE_FAN,this._southPoleCommand.pass=M.OPAQUE,this._southPoleCommand.owner=this,this._drawNorthPole=!1,this._drawSouthPole=!1,this.northPoleColor=new c(2/255,6/255,18/255),this.southPoleColor=new c(1,1,1),this.show=!0,this._mode=N.SCENE3D,this._projection=void 0,this.oceanNormalMapUrl=e("Assets/Textures/waterNormalsSmall.jpg"),this.depthTestAgainstTerrain=!1,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this._enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this._lastOceanNormalMapUrl=void 0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5,this._showingPrettyOcean=!1,this._hasWaterMask=!1,this._lightingFadeDistance=new u(this.lightingFadeOutDistance,this.lightingFadeInDistance);var a=this;this._drawUniforms={u_zoomedOutOceanSpecularIntensity:function(){return a._zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return a._oceanNormalMap},u_lightingFadeDistance:function(){return a._lightingFadeDistance}}};o(Y.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}}});var X=f.supportsTypedArrays()?new Float32Array(12):[],Z=new c,J=new c,Q=new c,K=new c,$=new s,et=new S,tt=f.supportsTypedArrays()?new Float32Array(8):[];return Y.prototype.update=function(e,t,i){if(this.show){var o=e.getDrawingBufferWidth(),a=e.getDrawingBufferHeight();if(0!==o&&0!==a){var s=t.mode,l=t.scene2D.projection,u=!1;this._mode===s&&n(this._rsColor)||(u=!0,s===N.SCENE3D||s===N.COLUMBUS_VIEW?(this._rsColor=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0}}),this._rsColorWithoutDepthTest=e.createRenderState({cull:{enabled:!0}}),this._depthCommand.renderState=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0,func:A.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}})):(this._rsColor=e.createRenderState({cull:{enabled:!0}}),this._rsColorWithoutDepthTest=e.createRenderState({cull:{enabled:!0}}),this._depthCommand.renderState=e.createRenderState({cull:{enabled:!0}}))),this._northPoleCommand.renderState=this._rsColorWithoutDepthTest,this._southPoleCommand.renderState=this._rsColorWithoutDepthTest;var c=H(this,t);if(this._depthCommand.vertexArray)this._depthCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(c);else{var h=new g({attributes:{position:new _({componentDatatype:d.FLOAT,componentsPerAttribute:3,values:c})},indices:[0,1,2,2,1,3],primitiveType:E.TRIANGLES});this._depthCommand.vertexArray=e.createVertexArrayFromGeometry({geometry:h,attributeLocations:{position:0},bufferUsage:b.DYNAMIC_DRAW})}var m=e.getShaderCache();if(n(this._depthCommand.shaderProgram)||(this._depthCommand.shaderProgram=m.getShaderProgram(U,F,{position:0})),this._surface._terrainProvider.ready&&this._surface._terrainProvider.hasWaterMask()&&this.oceanNormalMapUrl!==this._lastOceanNormalMapUrl){this._lastOceanNormalMapUrl=this.oceanNormalMapUrl;var p=this;G(r(this.oceanNormalMapUrl),function(t){p._oceanNormalMap=p._oceanNormalMap&&p._oceanNormalMap.destroy(),p._oceanNormalMap=e.createTexture2D({source:t})})}var f=this._projection!==l,y=this._surface._terrainProvider.ready&&this._surface._terrainProvider.hasWaterMask(),C=this._hasWaterMask!==y,S=this._enableLighting!==this.enableLighting;if(!n(this._surfaceShaderSet)||!n(this._northPoleCommand.shaderProgram)||!n(this._southPoleCommand.shaderProgram)||u||f||C||S||n(this._oceanNormalMap)!==this._showingPrettyOcean){var w,x="vec4 getPosition(vec3 position3DWC) { return getPosition3DMode(position3DWC); }",T="vec4 getPosition(vec3 position3DWC) { return getPosition2DMode(position3DWC); }",P="vec4 getPosition(vec3 position3DWC) { return getPositionColumbusViewMode(position3DWC); }",M="vec4 getPosition(vec3 position3DWC) { return getPositionMorphingMode(position3DWC); }";switch(s){case N.SCENE3D:w=x;break;case N.SCENE2D:w=T;break;case N.COLUMBUS_VIEW:w=P;break;case N.MORPHING:w=M}var I,O="float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }",R="float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }";I=l instanceof v?O:R,this._surfaceShaderSet.baseVertexShaderString=D({defines:[y?"SHOW_REFLECTIVE_OCEAN":"",this.enableLighting?"ENABLE_LIGHTING":""],sources:[k,w,I]});var L=y&&n(this._oceanNormalMap);this._surfaceShaderSet.baseFragmentShaderString=D({defines:[y?"SHOW_REFLECTIVE_OCEAN":"",L?"SHOW_OCEAN_WAVES":"",this.enableLighting?"ENABLE_LIGHTING":""],sources:[z]}),this._surfaceShaderSet.invalidateShaders();var j=m.replaceShaderProgram(this._northPoleCommand.shaderProgram,W,V,B.attributeLocations);this._northPoleCommand.shaderProgram=j,this._southPoleCommand.shaderProgram=j,this._showingPrettyOcean=n(this._oceanNormalMap),this._hasWaterMask=y,this._enableLighting=this.enableLighting}var Y=t.camera.positionWC;this._occluder.setCameraPosition(Y),q(this,e,t),this._mode=s,this._projection=l;var X=t.passes;X.render&&(s===N.SCENE3D&&(this._drawNorthPole&&i.push(this._northPoleCommand),this._drawSouthPole&&i.push(this._southPoleCommand)),this._zoomedOutOceanSpecularIntensity=s===N.SCENE3D?.5:0,this._lightingFadeDistance.x=this.lightingFadeOutDistance,this._lightingFadeDistance.y=this.lightingFadeInDistance,this._surface._maximumScreenSpaceError=this.maximumScreenSpaceError,this._surface._tileCacheSize=this.tileCacheSize,this._surface.setTerrainProvider(this.terrainProvider),this._surface.update(e,t,i,this._drawUniforms,this._surfaceShaderSet,this._rsColor,this._projection),(s===N.SCENE3D||s===N.COLUMBUS_VIEW)&&(this.depthTestAgainstTerrain||(i.push(this._clearDepthCommand),s===N.SCENE3D&&i.push(this._depthCommand)))),X.pick&&i.push(this._depthCommand)}}},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){return this._northPoleCommand.vertexArray=this._northPoleCommand.vertexArray&&this._northPoleCommand.vertexArray.destroy(),this._southPoleCommand.vertexArray=this._southPoleCommand.vertexArray&&this._southPoleCommand.vertexArray.destroy(),this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._northPoleCommand.shaderProgram=this._northPoleCommand.shaderProgram&&this._northPoleCommand.shaderProgram.release(),this._southPoleCommand.shaderProgram=this._northPoleCommand.shaderProgram,this._depthCommand.shaderProgram=this._depthCommand.shaderProgram&&this._depthCommand.shaderProgram.release(),this._depthCommand.vertexArray=this._depthCommand.vertexArray&&this._depthCommand.vertexArray.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),a(this)},Y}),r("Scene/QuantizedMeshTerrainData",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersections2D","../Core/Math","../Core/TaskProcessor","./TerrainMesh","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){d.length=e.length;for(var r=!1,i=0,n=e.length;n>i;++i)d[i]=e[i],r=r||i>0&&t(e[i-1],e[i])>0;return r?(d.sort(t),new Uint16Array(d)):e}var h=function(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var n=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,n),a=this._vValues=this._quantizedVertices.subarray(n,2*n);this._heightValues=this._quantizedVertices.subarray(2*n,3*n),this._westIndices=c(e.westIndices,t),this._southIndices=c(e.southIndices,i),this._eastIndices=c(e.eastIndices,t),this._northIndices=c(e.northIndices,i),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=r(e.childTileMask,15),this._createdByUpsampling=r(e.createdByUpsampling,!1),this._waterMask=e.waterMask},d=[],m=new s("createVerticesFromQuantizedTerrainMesh");h.prototype.createMesh=function(e,t,r,n){var o=e.ellipsoid,a=e.tileXYToExtent(t,r,n),s=m.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,extent:a,relativeToCenter:this._boundingSphere.center,ellipsoid:o});if(!i(s))return void 0;var c=this;return u(s,function(e){return new l(c._boundingSphere.center,new Float32Array(e.vertices),new Uint16Array(e.indices),c._minimumHeight,c._maximumHeight,c._boundingSphere,c._horizonOcclusionPoint)})};var p=new s("upsampleQuantizedTerrainMesh");h.prototype.upsample=function(r,n,o,a,s,l,c){var d=2*n!==s,m=2*o===l,f=r.ellipsoid,v=r.tileXYToExtent(s,l,c),g=p.scheduleTask({vertices:this._quantizedVertices,indices:this._indices,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:d,isNorthChild:m,childExtent:v,ellipsoid:f});if(!i(g))return void 0;var _=Math.min(this._westSkirtHeight,this._eastSkirtHeight);_=Math.min(_,this._southSkirtHeight),_=Math.min(_,this._northSkirtHeight);var y=d?.5*_:this._westSkirtHeight,C=m?.5*_:this._southSkirtHeight,S=d?this._eastSkirtHeight:.5*_,w=m?this._northSkirtHeight:.5*_;return u(g,function(r){return new h({quantizedVertices:new Uint16Array(r.vertices),indices:new Uint16Array(r.indices),minimumHeight:r.minimumHeight,maximumHeight:r.maximumHeight,boundingSphere:e.clone(r.boundingSphere),horizonOcclusionPoint:t.clone(r.horizonOcclusionPoint),westIndices:r.westIndices,southIndices:r.southIndices,eastIndices:r.eastIndices,northIndices:r.northIndices,westSkirtHeight:y,southSkirtHeight:C,eastSkirtHeight:S,northSkirtHeight:w,childTileMask:0,createdByUpsampling:!0})})};var f=32767,v=new t;return h.prototype.interpolateHeight=function(e,t,r){var i=(t-e.west)/(e.east-e.west);i*=f;var n=(r-e.south)/(e.north-e.south);n*=f;for(var s=this._uValues,l=this._vValues,u=this._heightValues,c=this._indices,h=0,d=c.length;d>h;h+=3){var m=c[h],p=c[h+1],g=c[h+2],_=s[m],y=s[p],C=s[g],S=l[m],w=l[p],E=l[g],x=o.computeBarycentricCoordinates(i,n,_,S,y,w,C,E,v);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){var b=x.x*u[m]+x.y*u[p]+x.z*u[g];return a.lerp(this._minimumHeight,this._maximumHeight,b/f)}}return void 0},h.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!==(this._childTileMask&1<>1^-(1&e)}var u=0,h=2,d=4,m=4,f=8,v=3,g=v+1,_=f*v,y=f*g,C=3,S=h*C,E=3,x=h*E,b=new DataView(i),T=new t(b.getFloat64(u,!0),b.getFloat64(u+8,!0),b.getFloat64(u+16,!0));u+=_;var A=b.getFloat32(u,!0);u+=m;var P=b.getFloat32(u,!0);u+=m;var D=new e(new t(b.getFloat64(u,!0),b.getFloat64(u+8,!0),b.getFloat64(u+16,!0)),b.getFloat64(u+_,!0));u+=y;var M=new t(b.getFloat64(u,!0),b.getFloat64(u+8,!0),b.getFloat64(u+16,!0));u+=_;var I=b.getUint32(u,!0);u+=d;var O=new Uint16Array(i,u,3*I);if(u+=I*S,I>65536)throw new c("CesiumTerrainProvider currently does not support tiles with more than 65536 vertices.");var R,L=O.subarray(0,I),N=O.subarray(I,2*I),B=O.subarray(2*I,3*I),z=0,F=0,V=0;for(R=0;I>R;++R)z+=l(L[R]),F+=l(N[R]),V+=l(B[R]),L[R]=z,N[R]=F,B[R]=V;var k=b.getUint32(u,!0);u+=d;var U=new Uint16Array(i,u,k*E);u+=k*x;var W=0;for(R=0;R=n.length)return 0;var a=n[o],s=0;return s|=E(a,2*r,2*i)?1:0,s|=E(a,2*r+1,2*i)?2:0,s|=E(a,2*r,2*i+1)?4:0,s|=E(a,2*r+1,2*i+1)?8:0}function E(e,t,r){for(var i=0,n=e.length;n>i;++i){var o=e[i];if(t>=o.startX&&t<=o.endX&&r>=o.startY&&r<=o.endY)return!0}return!1}var x=function(e){function t(e){var t;if(!e.format)return t="The tile format is not specified in the layer.json file.",l=v.handleError(l,c,c._errorEvent,t,void 0,void 0,void 0,n),void 0;if(!e.tiles||0===e.tiles.length)return t="The layer.json file does not specify any tile URL templates.",l=v.handleError(l,c,c._errorEvent,t,void 0,void 0,void 0,n),void 0;if("heightmap-1.0"===e.format)c._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1},c._hasWaterMask=!0;else{if("quantized-mesh-1.0"!==e.format)return t='The tile format "'+e.format+'" is invalid or not supported.',l=v.handleError(l,c,c._errorEvent,t,void 0,void 0,void 0,n),void 0;c._hasWaterMask=!1}var r=new g(s);c._tileUrlTemplates=e.tiles;for(var o=0;or;++r)e[r].destroy();this._primitives=[]},o.prototype.contains=function(e){return!!(e&&e._external&&e._external._composites&&e._external._composites[this._guid])},o.prototype.raise=function(e){if(t(e)){var r=n(this,e),i=this._primitives;if(r!==i.length-1){var o=i[r];i[r]=i[r+1],i[r+1]=o}}},o.prototype.raiseToTop=function(e){if(t(e)){var r=n(this,e),i=this._primitives;r!==i.length-1&&(i.splice(r,1),i.push(e))}},o.prototype.lower=function(e){if(t(e)){var r=n(this,e),i=this._primitives;if(0!==r){var o=i[r];i[r]=i[r-1],i[r-1]=o}}},o.prototype.lowerToBottom=function(e){if(t(e)){var r=n(this,e),i=this._primitives;0!==r&&(i.splice(r,1),i.unshift(e))}},o.prototype.get=function(e){return this._primitives[e]},o.prototype.update=function(e,t,r){if(this.show){this._centralBody&&this._centralBody.update(e,t,r);for(var i=this._primitives,n=i.length,o=0;n>o;++o)i[o].update(e,t,r)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return this.removeAll(),this._centralBody=this.destroyPrimitives&&this._centralBody&&this._centralBody.destroy(),i(this)},o}),r("Scene/CreditDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./Credit"],function(e,t,r,i,n){"use strict";function o(e,r,i){if(!t(e.element)){var n=e.getText(),o=e.getLink(),a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(r.hasChildNodes()){var l=document.createElement("span");l.textContent=i,l.className="cesium-credit-delimiter",r.appendChild(l)}r.appendChild(e.element)}function a(e,r){if(!t(e.element)){var i=e.getText(),n=e.getLink(),o=document.createElement("span"),a=document.createElement("img");if(a.src=e.getImageUrl(),a.style["vertical-align"]="bottom",t(i)&&(a.alt=i,a.title=i),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}r.appendChild(e.element)}function s(e,t){for(var r=e.length,i=0;r>i;i++){var o=e[i];if(n.equals(o,t))return!0}return!1}function l(e){var r=e.element;if(t(r)){var i=r.parentNode;if(!e.hasImage()){var n=r.previousSibling;null===n&&(n=r.nextSibling),null!==n&&i.removeChild(n)}i.removeChild(r)}}function u(e,t){var r,i,n,a=e._displayedCredits.textCredits;for(r=0;r= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = gl_DepthRange.near;\nfloat f = gl_DepthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),r("Scene/EllipsoidPrimitive",["../Core/defaultValue","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Matrix4","../Core/BoundingSphere","../Core/PrimitiveType","../Renderer/CullFace","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","./Material","./SceneMode","../Shaders/EllipsoidVS","../Shaders/EllipsoidFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";function C(e){var i=e.cache.ellipsoidPrimitive_vertexArray;if(n(i))return i;var o=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2)}));return i=e.createVertexArrayFromGeometry({geometry:o,attributeLocations:S,bufferUsage:d.STATIC_DRAW}),e.cache.ellipsoidPrimitive_vertexArray=i,i}var S={position:0},w=function(t){t=e(t,e.EMPTY_OBJECT),this.center=r.clone(e(t.center,r.ZERO)),this._center=new r,this.radii=r.clone(t.radii),this._radii=new r,this._oneOverEllipsoidRadiiSquared=new r,this._boundingSphere=new l,this.modelMatrix=s.clone(e(t.modelMatrix,s.IDENTITY)),this._modelMatrix=new s,this._computedModelMatrix=new s,this.show=e(t.show,!0),this.material=e(t.material,v.fromType(v.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this.onlySunLighting=e(t.onlySunLighting,!1),this._onlySunLighting=!1,this._owner=t._owner,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new m,this._colorCommand.owner=this,this._pickCommand=new m,this._pickCommand.owner=this;var i=this;this._uniforms={u_radii:function(){return i.radii},u_oneOverEllipsoidRadiiSquared:function(){return i._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return i._pickId.color}}};return w.prototype.update=function(t,o,a){if(this.show&&o.mode===g.SCENE3D&&n(this.center)&&n(this.radii)){var d=this.material.isTranslucent(),m=this._translucent!==d;(!n(this._rs)||m)&&(this._translucent=d,this._rs=t.createRenderState({cull:{enabled:!0,face:c.FRONT},depthTest:{enabled:!0},depthMask:!d&&t.getFragmentDepth(),blending:d?h.ALPHA_BLEND:void 0})),n(this._va)||(this._va=C(t));var v=!1,w=this.radii;if(!r.equals(this._radii,w)){r.clone(w,this._radii);var E=this._oneOverEllipsoidRadiiSquared;E.x=1/(w.x*w.x),E.y=1/(w.y*w.y),E.z=1/(w.z*w.z),v=!0}s.equals(this.modelMatrix,this._modelMatrix)&&r.equals(this.center,this._center)||(s.clone(this.modelMatrix,this._modelMatrix),r.clone(this.center,this._center),s.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),v=!0),v&&(r.clone(r.ZERO,this._boundingSphere.center),this._boundingSphere.radius=r.getMaximumComponent(w),l.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var x=this._material!==this.material;this._material=this.material,this._material.update(t);var b=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var T=this._colorCommand;if(x||b||m){var A=p({defines:[this.onlySunLighting?"ONLY_SUN_LIGHTING":"",!d&&t.getFragmentDepth()?"WRITE_DEPTH":""],sources:[this.material.shaderSource,y]});this._sp=t.getShaderCache().replaceShaderProgram(this._sp,_,A,S),T.primitiveType=u.TRIANGLES,T.vertexArray=this._va,T.renderState=this._rs,T.shaderProgram=this._sp,T.uniformMap=i(this._uniforms,this.material._uniforms),T.executeInClosestFrustum=d,T.owner=e(this._owner,this)}var P=o.passes;if(P.render&&(T.boundingVolume=this._boundingSphere,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.modelMatrix=this._computedModelMatrix,T.pass=d?f.TRANSLUCENT:f.OPAQUE,a.push(T)),P.pick){var D=this._pickCommand;if(n(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),x||b||!n(this._pickSP)){var M=p({defines:[this.onlySunLighting?"ONLY_SUN_LIGHTING":"",!d&&t.getFragmentDepth()?"WRITE_DEPTH":""],sources:[this.material.shaderSource,y],pickColorQualifier:"uniform"});this._pickSP=t.getShaderCache().replaceShaderProgram(this._pickSP,_,M,S),D.primitiveType=u.TRIANGLES,D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=i(i(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=d,D.owner=e(this._owner,this)}D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=d?f.TRANSLUCENT:f.OPAQUE,a.push(D)}}},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this._sp=this._sp&&this._sp.release(),this._pickSP=this._pickSP&&this._pickSP.release(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},w}),r("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC));\n#else\nnormalEC = normalize(normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/VertexFormat","./Material","./Appearance","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS"],function(e,t,r,i,n,o,a){"use strict";var s=function(r){r=e(r,e.EMPTY_OBJECT);var l=e(r.translucent,!0),u=e(r.aboveGround,!1);this.material=t(r.material)?r.material:i.fromType(i.ColorType),this.vertexShaderSource=e(r.vertexShaderSource,o),this.fragmentShaderSource=e(r.fragmentShaderSource,a),this.renderState=e(r.renderState,n.getDefaultRenderState(l,!u)),this.vertexFormat=s.VERTEX_FORMAT,this.flat=e(r.flat,!1),this.faceForward=e(r.faceForward,u),this.translucent=l,this.closed=!1,this.aboveGround=u};return s.VERTEX_FORMAT=r.POSITION_AND_ST,s.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,s.prototype.isTranslucent=n.prototype.isTranslucent,s.prototype.getRenderState=n.prototype.getRenderState,s}),r("Scene/ExtentPrimitive",["../Core/DeveloperError","../Core/defaultValue","../Core/defined","../Core/Color","../Core/destroyObject","../Core/Math","../Core/Extent","../Core/Ellipsoid","../Core/GeometryInstance","../Core/ExtentGeometry","./EllipsoidSurfaceAppearance","./Primitive","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(e){e=t(e,t.EMPTY_OBJECT),this.ellipsoid=t(e.ellipsoid,s.WGS84),this._ellipsoid=void 0,this.extent=a.clone(e.extent),this._extent=void 0,this.granularity=t(e.granularity,o.RADIANS_PER_DEGREE),this._granularity=void 0,this.height=t(e.height,0),this._height=void 0,this.rotation=t(e.rotation,0),this._rotation=void 0,this.textureRotationAngle=t(e.textureRotationAngle,0),this._textureRotationAngle=void 0,this.show=t(e.show,!0);var r=d.fromType(d.ColorType,{color:new i(1,1,0,.5)});this.material=t(e.material,r),this.id=e.id,this._id=void 0,this.asynchronous=t(e.asynchronous,!0),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1),this._primitive=void 0};return m.prototype.update=function(e,t,i){if(this.show&&r(this.extent)){if(!a.equals(this._extent,this.extent)||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._rotation!==this.rotation||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){this._extent=a.clone(this.extent,this._extent),this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._rotation=this.rotation,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id;var n=new l({geometry:new u({extent:this.extent,vertexFormat:c.VERTEX_FORMAT,ellipsoid:this.ellipsoid,granularity:this.granularity,height:this.height,rotation:this.rotation,stRotation:this.textureRotationAngle}),id:this.id,pickPrimitive:this});r(this._primitive)&&this._primitive.destroy(),this._primitive=new h({geometryInstances:n,appearance:new c({aboveGround:this.height>0}),asynchronous:this.asynchronous})}var o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},m}),r("Scene/FrameState",["./SceneMode"],function(e){"use strict";var t=function(t){this.mode=e.SCENE3D,this.morphTime=e.SCENE3D.morphTime,this.frameNumber=0,this.time=void 0,this.scene2D={projection:void 0},this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=t,this.afterRender=[]};return t}),r("Scene/FrustumCommands",["../Core/defaultValue"],function(e){"use strict";var t=function(t,r){this.near=e(t,0),this.far=e(r,0),this.opaqueCommands=[],this.translucentCommands=[]};return t}),r("Scene/GoogleEarthImageryProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/loadText","../Core/DeveloperError","../Core/RuntimeError","../Core/Event","../Core/Extent","./ImageryProvider","./TileProviderError","./WebMercatorTilingScheme","./GeographicTilingScheme","./Credit","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e,r,i,n){var o=e._imageUrlTemplate;o=o.replace("{x}",r),o=o.replace("{y}",i),o=o.replace("{zoom}",n+1);var a=e._proxy;return t(a)&&(o=a.getURL(o)),o}var f=function v(r){function n(e){var r;try{r=JSON.parse(e)}catch(i){r=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,a=0;a4)throw new i("The imagery provider's extent and minimumLevel indicate that there are "+h+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new n,this._ready=!0;var d=e(t.credit,c);"string"==typeof d&&(d=new s(d)),this._credit=d};return r(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},extent:{get:function(){return this._extent}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}}}),h.prototype.getTileCredits=function(){return void 0},h.prototype.requestImage=function(e,t,r){var i=l(this,e,t,r);return o.loadImage(this,i)},h}),r("Scene/OrthographicFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Matrix4","../Scene/CullingVolume"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=a.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}var u=function(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new s,this._orthographicMatrix=void 0};t(u.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var c=new n,h=new n,d=new n,m=new n;return u.prototype.computeCullingVolume=function(t,r,i){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,p=this.left,f=this.near,v=this.far,g=n.cross(r,i,c),_=h;n.multiplyByScalar(r,f,_),n.add(t,_,_);var y=d;n.multiplyByScalar(g,p,y),n.add(_,y,y);var C=a[0];return e(C)||(C=a[0]=new o),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-n.dot(g,y),n.multiplyByScalar(g,u,y),n.add(_,y,y),C=a[1],e(C)||(C=a[1]=new o),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-n.dot(n.negate(g,m),y),n.multiplyByScalar(i,l,y),n.add(_,y,y),C=a[2],e(C)||(C=a[2]=new o),C.x=i.x,C.y=i.y,C.z=i.z,C.w=-n.dot(i,y),n.multiplyByScalar(i,s,y),n.add(_,y,y),C=a[3],e(C)||(C=a[3]=new o),C.x=-i.x,C.y=-i.y,C.z=-i.z,C.w=-n.dot(n.negate(i,m),y),C=a[4],e(C)||(C=a[4]=new o),C.x=r.x,C.y=r.y,C.z=r.z,C.w=-n.dot(r,_),n.multiplyByScalar(r,v,y),n.add(t,y,y),C=a[5],e(C)||(C=a[5]=new o),C.x=-r.x,C.y=-r.y,C.z=-r.z,C.w=-n.dot(n.negate(r,m),y),this._cullingVolume},u.prototype.getPixelSize=function(t,r,n){l(this);var o=this.right-this.left,a=this.top-this.bottom,s=o/t.x,u=a/t.y;return e(n)?(n.x=s,n.y=u,n):new i(s,u)},u.prototype.clone=function(t){return e(t)||(t=new u),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},u.prototype.equals=function(t){return e(t)&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},u}),r("Widgets/getElement",["../Core/DeveloperError"],function(){"use strict";var e=function(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e};return e}),r("Scene/PerformanceDisplay",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,r,i,n,o,a){"use strict";var s=e.fromCssColorString("#e52"),l=e.fromCssColorString("#de3"),u=e.fromCssColorString("rgba(40, 40, 40, 0.7)"),c=function(e){e=t(e,t.EMPTY_OBJECT);var i=a(e.container);if(!r(i))throw new n("container is required");this._container=i,this._fpsColor=t(e.fpsColor,s).toCssColorString(),this._frameTimeColor=t(e.frameTimeColor,l).toCssColorString(),this._backgroundColor=t(e.backgroundColor,u).toCssColorString(),this._font=t(e.font,"bold 12px Helvetica,Arial,sans-serif");var o=document.createElement("div"),c=document.createElement("div");this._fpsText=document.createTextNode(""),c.appendChild(this._fpsText),c.style.color=this._fpsColor;var h=document.createElement("div");this._msText=document.createTextNode(""),h.style.color=this._frameTimeColor,h.appendChild(this._msText),o.appendChild(c),o.appendChild(h),o.style["z-index"]=1,o.style["background-color"]=this._backgroundColor,o.style.font=this._font,o.style.padding="7px",o.style["border-radius"]="5px",o.style.border="1px solid #444",this._container.appendChild(o),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0};return c.prototype.update=function(){if(!r(this._time))return this._lastFpsSampleTime=o(),this._time=o(),void 0;var e=this._time,t=o();this._time=t;var i=t-e;this._frameCount++;var n=this._fps,a=t-this._lastFpsSampleTime;a>1e3&&(n=0|1e3*this._frameCount/a,this._lastFpsSampleTime=t,this._frameCount=0),n!==this._fps&&(this._fpsText.nodeValue=n+" FPS",this._fps=n),i!==this._frameTime&&(this._msText.nodeValue=i.toFixed(2)+" MS",this._frameTime=i)},c.prototype.destroy=function(){return i(this)},c}),r("Scene/Polygon",["../Core/DeveloperError","../Core/defaultValue","../Core/defined","../Core/Color","../Core/destroyObject","../Core/Math","../Core/Ellipsoid","../Core/GeometryInstance","../Core/PolygonGeometry","./EllipsoidSurfaceAppearance","./Primitive","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(e){e=t(e,t.EMPTY_OBJECT),this.ellipsoid=t(e.ellipsoid,a.WGS84),this._ellipsoid=void 0,this.granularity=t(e.granularity,o.RADIANS_PER_DEGREE),this._granularity=void 0,this.height=t(e.height,0),this._height=void 0,this.textureRotationAngle=t(e.textureRotationAngle,0),this._textureRotationAngle=void 0,this.show=t(e.show,!0);var n=h.fromType(h.ColorType,{color:new i(1,1,0,.5)});this.material=t(e.material,n),this.id=e.id,this._id=void 0,this.asynchronous=t(e.asynchronous,!0),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1),this._positions=void 0,this._polygonHierarchy=void 0,this._createPrimitive=!1,this._primitive=void 0,r(e.positions)?this.setPositions(e.positions):r(e.polygonHierarchy)&&this.configureFromPolygonHierarchy(e.polygonHierarchy)};return d.prototype.getPositions=function(){return this._positions},d.prototype.setPositions=function(e){this._positions=e,this._polygonHierarchy=void 0,this._createPrimitive=!0},d.prototype.configureFromPolygonHierarchy=function(e){this._positions=void 0,this._polygonHierarchy=e,this._createPrimitive=!0},d.prototype.update=function(e,t,i){if(this.show&&(this._createPrimitive||r(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){if(this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),!r(this._positions)&&!r(this._polygonHierarchy))return;var n;n=r(this._positions)?new s({geometry:l.fromPositions({positions:this._positions,height:this.height,vertexFormat:u.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}):new s({geometry:new l({polygonHierarchy:this._polygonHierarchy,height:this.height,vertexFormat:u.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}),this._primitive=new c({geometryInstances:n,appearance:new u({aboveGround:this.height>0}),asynchronous:this.asynchronous})}var o=this._primitive;o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.appearance.material=this.material,o.update(e,t,i)}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},d}),r("Scene/RectangularPyramidSensorVolume",["../Core/clone","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Renderer/BufferUsage","./Material","./CustomSensorVolume"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(n){n=r(n,r.EMPTY_OBJECT),this.show=r(n.show,!0),this.showIntersection=r(n.showIntersection,!0),this.showThroughEllipsoid=r(n.showThroughEllipsoid,!1),this.modelMatrix=s.clone(r(n.modelMatrix,s.IDENTITY)),this.bufferUsage=r(n.bufferUsage,l.STATIC_DRAW),this.radius=r(n.radius,Number.POSITIVE_INFINITY),this.xHalfAngle=r(n.xHalfAngle,a.PI_OVER_TWO),this._xHalfAngle=void 0,this.yHalfAngle=r(n.yHalfAngle,a.PI_OVER_TWO),this._yHalfAngle=void 0,this.material=i(n.material)?n.material:u.fromType(u.ColorType),this.intersectionColor=t.clone(r(n.intersectionColor,t.WHITE)),this.intersectionWidth=r(n.intersectionWidth,5),this.id=n.id;var o=e(n);o._pickIdThis=r(n._pickIdThis,this),this._customSensor=new c(o)};return h.prototype.update=function(e,t,r){var i=this._customSensor;if(i.show=this.show,i.showIntersection=this.showIntersection,i.showThroughEllipsoid=this.showThroughEllipsoid,i.modelMatrix=this.modelMatrix,i.bufferUsage=this.bufferUsage,i.radius=this.radius,i.material=this.material,i.intersectionColor=this.intersectionColor,i.intersectionWidth=this.intersectionWidth,i.id=this.id,this._xHalfAngle!==this.xHalfAngle||this._yHalfAngle!==this.yHalfAngle){this._xHalfAngle=this.xHalfAngle,this._yHalfAngle=this.yHalfAngle;var n=Math.tan(Math.min(this.xHalfAngle,a.toRadians(89))),o=Math.tan(Math.min(this.yHalfAngle,a.toRadians(89))),s=Math.atan(n/o),l=Math.atan(Math.sqrt(n*n+o*o));i.setDirections([{clock:s,cone:l},{clock:a.toRadians(180)-s,cone:l},{clock:a.toRadians(180)+s,cone:l},{clock:-s,cone:l}])}i.update(e,t,r)},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this._customSensor=this._customSensor&&this._customSensor.destroy(),n(this)},h}),r("Scene/ScreenSpaceCameraController",["../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/DeveloperError","../Core/Ellipsoid","../Core/KeyboardEventModifier","../Core/FAR","../Core/IntersectionTests","../Core/isArray","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/Transforms","./AnimationCollection","./CameraEventAggregator","./CameraEventType","./CameraColumbusViewMode","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S){"use strict";function w(e,t){if(0>e)return 0;var r=25*(1-t);return Math.exp(-r*e)}function E(e){return i.equalsEpsilon(e.startPosition,e.endPosition,m.EPSILON14)}function x(t,r,o,a,s,l,u){var c=l[u];e(c)||(c=l[u]={startPosition:new i,endPosition:new i,motion:new i,active:!1});var h=t.getButtonPressTime(r,o),d=t.getButtonReleaseTime(r,o),m=h&&d&&(d.getTime()-h.getTime())/1e3,p=new Date,f=d&&(p.getTime()-d.getTime())/1e3;if(h&&d&&H>m){var v=w(f,a);if(c.active)i.clone(c.endPosition,c.startPosition),i.multiplyByScalar(c.motion,v,c.endPosition),i.add(c.startPosition,c.endPosition,c.endPosition),n.clone(i.ZERO,c.motion);else{var g=t.getLastMovement(r,o);if(!e(g)||E(g))return;c.motion.x=.5*(g.endPosition.x-g.startPosition.x),c.motion.y=.5*(g.endPosition.y-g.startPosition.y),i.clone(g.startPosition,c.startPosition),i.multiplyByScalar(c.motion,v,c.endPosition),i.add(c.startPosition,c.endPosition,c.endPosition),c.active=!0}if(isNaN(c.endPosition.x)||isNaN(c.endPosition.y)||E(c))return c.active=!1,void 0;t.isButtonDown(r,o)||s(l,c)}else c.active=!1}function b(t,r,i,n,o,a){if(e(i)){var s=t._aggregator;d(i)||(j[0]=i,i=j);for(var l=i.length,u=0;l>u;++u){var c=i[u],h=e(c.eventType)?c.eventType:c,m=c.modifier,p=s.isMoving(h,m)&&s.getMovement(h,m);t.enableInputs&&r&&(p?n(t,p):1>o&&x(s,h,m,o,n,t,a))}}}function T(t,r,i,n,o){var a=1;e(o)&&(a=m.clamp(Math.abs(o),.25,1));var s=t.minimumZoomDistance*a,l=t.maximumZoomDistance,u=n-s,c=i*u;c=m.clamp(c,t._minimumZoomRate,t._maximumZoomRate);var h=r.endPosition.y-r.startPosition.y,d=h/t._canvas.clientHeight;d=Math.min(d,t.maximumMovementRatio);var p=c*d;p>0&&Math.abs(n-s)<1||0>p&&Math.abs(n-l)<1||(s>n-p?p=n-s-1:n-p>l&&(p=n-l),t._cameraController.zoomIn(p))}function A(e,t){var r=e._cameraController,i=r.getPickRay(t.startPosition,q).origin,o=r.getPickRay(t.endPosition,Y).origin,a=r._camera.position,s=n.subtract(i,a,X),l=n.subtract(o,a,Z),u=n.subtract(s,l,X),c=n.magnitude(u);c>0&&(n.normalize(u,u),r.move(u,c))}function P(t,r){e(r.distance)&&(r=r.distance),T(t,r,t._zoomFactor,t._cameraController.getMagnitude())}function D(t,r){if(e(r.angleAndHeight))return M(t,r.angleAndHeight),void 0;var n=t._canvas.clientWidth,o=t._canvas.clientHeight,a=J;a.x=2/n*r.startPosition.x-1,a.y=2/o*(o-r.startPosition.y)-1,i.normalize(a,a);var s=Q;s.x=2/n*r.endPosition.x-1,s.y=2/o*(o-r.endPosition.y)-1,i.normalize(s,s);var l=Math.acos(a.x);a.y<0&&(l=m.TWO_PI-l);var u=Math.acos(s.x);s.y<0&&(u=m.TWO_PI-u);var c=u-l;t._cameraController.twistRight(c)}function M(e,t){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),rm.EPSILON6&&(n.normalize(d,d),r.move(d,f))}function R(t,r){e(r.angleAndHeight)&&(r=r.angleAndHeight);var i=it;i.x=t._canvas.clientWidth/2,i.y=t._canvas.clientHeight/2;var o=t._cameraController.getPickRay(i,nt),a=n.UNIT_X,s=o.origin,u=o.direction,c=-n.dot(a,s)/n.dot(a,u),h=n.multiplyByScalar(u,c,ot);n.add(s,h,h);var d=p.fromTranslation(h,at),m=t._ellipsoid;t.ellipsoid=l.UNIT_SPHERE,z(t,r,d,n.UNIT_Z),t.ellipsoid=m}function L(t,r){e(r.distance)&&(r=r.distance);var i=st;i.x=t._canvas.clientWidth/2,i.y=t._canvas.clientHeight/2;var o=t._cameraController.getPickRay(i,lt),a=n.UNIT_X,s=o.origin,l=o.direction,u=-n.dot(a,s)/n.dot(a,l);T(t,r,t._zoomFactor,u)}function N(t){if(t.columbusViewMode===C.LOCKED)b(t,t.enableRotate,t.rotateEventTypes,z,t.inertiaSpin,"_lastInertiaSpinMovement"),b(t,t.enableZoom,t.zoomEventTypes,V,t.inertiaZoom,"_lastInertiaZoomMovement");else{if(t._aggregator.anyButtonDown()&&t._animationCollection.removeAll(),b(t,t.enableTilt,t.tiltEventTypes,R,t.inertiaSpin,"_lastInertiaTiltMovement"),b(t,t.enableTranslate,t.translateEventTypes,O,t.inertiaTranslate,"_lastInertiaTranslateMovement"),b(t,t.enableZoom,t.zoomEventTypes,L,t.inertiaZoom,"_lastInertiaZoomMovement"),b(t,t.enableLook,t.lookEventTypes,U),!(t._aggregator.anyButtonDown()||e(t._lastInertiaZoomMovement)&&t._lastInertiaZoomMovement.active||e(t._lastInertiaTranslateMovement)&&t._lastInertiaTranslateMovement.active||t._animationCollection.contains(t._animation))){var r=t._cameraController.createCorrectPositionAnimation(t.bounceAnimationTime);e(r)&&(t._animation=t._animationCollection.add(r))}t._animationCollection.update()}}function B(t,r){e(t._cameraController.pickEllipsoid(r.startPosition,t._ellipsoid,ut))?F(t,r):z(t,r)}function z(t,r,i,o,a){var s=t._cameraController,l=s.constrainedAxis;e(o)&&(s.constrainedAxis=o);var u=n.magnitude(s._camera.position),c=t._rotateFactor*(u-t._rotateRateRangeAdjustment);c>t._maximumRotateRate&&(c=t._maximumRotateRate),c0&&T>0||0>b&&0>T?-1:1;b=Math.abs(b);var P=v;v=x*(v*b-A*f*(1-E)),f=x*(f*E+A*P*(1-b))}}if(s.rotateRight(f,i),s.rotateUp(v,i),e(a)){var D=n.clone(s._camera.directionWC,ct),M=p.inverseTransformation(i,mt);D=p.multiplyByPointAsVector(M,D,D);var I=-n.dot(D,o),O=Math.acos(I);O>a&&(O-=a,s.rotateUp(-O,i))}s.constrainedAxis=l}function F(t,r){var i=t._cameraController,o=i.pickEllipsoid(r.startPosition,t._ellipsoid,pt),a=i.pickEllipsoid(r.endPosition,t._ellipsoid,ft);if(e(o)&&e(a))if(o=i._camera.worldToCameraCoordinates(o,o),a=i._camera.worldToCameraCoordinates(a,a),e(i.constrainedAxis)){var s=i.constrainedAxis,l=n.mostOrthogonalAxis(s,vt);n.cross(l,s,l),n.normalize(l,l);var u=n.cross(s,l,gt),c=n.magnitude(o),h=n.dot(s,o),d=Math.acos(h/c),p=n.multiplyByScalar(s,h,_t);n.subtract(o,p,p),n.normalize(p,p);var f=n.magnitude(a),v=n.dot(s,a),g=Math.acos(v/f),_=n.multiplyByScalar(s,v,yt);n.subtract(a,_,_),n.normalize(_,_);var y=Math.acos(n.dot(p,l));n.dot(p,u)<0&&(y=m.TWO_PI-y);var C=Math.acos(n.dot(_,l));n.dot(_,u)<0&&(C=m.TWO_PI-C);var S,w=y-C;S=n.equalsEpsilon(s,i._camera.position,m.EPSILON2)?i._camera.right:n.cross(s,i._camera.position,vt);var E,x=n.cross(s,S,vt),b=n.dot(x,n.subtract(o,s,gt)),T=n.dot(x,n.subtract(a,s,gt));E=b>0&&T>0?g-d:b>0&&0>=T?n.dot(i._camera.position,s)>0?-d-g:d+g:d-g,i.rotateRight(w),i.rotateUp(E)}else{n.normalize(o,o),n.normalize(a,a);var A=n.dot(o,a),P=n.cross(o,a,vt);if(1>A&&!n.equalsEpsilon(P,n.ZERO,m.EPSILON14)){var D=Math.acos(A);i.rotate(P,D)}}}function V(t,r){e(r.distance)&&(r=r.distance);var i=t._cameraController._camera,o=t._ellipsoid,a=o.cartesianToCartographic(i.position).height,s=n.normalize(i.position,Ct);T(t,r,t._zoomFactor,a,n.dot(s,i.direction))}function k(t,r){e(r.angleAndHeight)&&(r=r.angleAndHeight);var i=t._cameraController,o=t._ellipsoid,a=.25*t.minimumZoomDistance,s=o.cartesianToCartographic(t._cameraController._camera.positionWC).height;if(!(s-a-1c&&(u=Math.acos(c)),u=r.startPosition.x>r.endPosition.x?-u:u;var h=t._horizontalRotationAxis;e(h)?i.look(h,u):i.lookLeft(u),o.x=0,o.y=r.startPosition.y,a.x=0,a.y=r.endPosition.y,s=i.getPickRay(o,Pt).direction,l=i.getPickRay(a,Dt).direction,u=0,c=n.dot(s,l),1>c&&(u=Math.acos(c)),u=r.startPosition.y>r.endPosition.y?-u:u,i.lookUp(u)}function W(e){b(e,e.enableRotate,e.rotateEventTypes,B,e.inertiaSpin,"_lastInertiaSpinMovement"),b(e,e.enableZoom,e.zoomEventTypes,V,e.inertiaZoom,"_lastInertiaZoomMovement"),b(e,e.enableTilt,e.tiltEventTypes,k,e.inertiaSpin,"_lastInertiaTiltMovement"),b(e,e.enableLook,e.lookEventTypes,U)}var G=function(e,t){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.columbusViewMode=C.FREE,this.bounceAnimationTime=3e3,this.minimumZoomDistance=20,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=y.LEFT_DRAG,this.zoomEventTypes=[y.RIGHT_DRAG,y.WHEEL,y.PINCH],this.rotateEventTypes=y.LEFT_DRAG,this.tiltEventTypes=[y.MIDDLE_DRAG,y.PINCH,{eventType:y.LEFT_DRAG,modifier:u.CTRL}],this.lookEventTypes={eventType:y.LEFT_DRAG,modifier:u.SHIFT},this._canvas=e,this._cameraController=t,this._ellipsoid=l.WGS84,this._aggregator=new _(e),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaWheelZoomMovement=void 0,this._lastInertiaTiltMovement=void 0,this._animationCollection=new g,this._animation=void 0,this._horizontalRotationAxis=void 0;var r=this._ellipsoid.maximumRadius;this._zoomFactor=5,this._rotateFactor=1/r,this._rotateRateRangeAdjustment=r,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._translateFactor=1,this._minimumZoomRate=20,this._maximumZoomRate=c};t(G.prototype,{ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=e.maximumRadius;this._ellipsoid=e,this._rotateFactor=1/t,this._rotateRateRangeAdjustment=t}}});var H=.4,j=[],q=new f,Y=new f,X=new n,Z=new n,J=new i,Q=new i,K=new f,$=new f,et=new n,tt=new n,rt=new n,it=new i,nt=new f,ot=new n,at=new p,st=new i,lt=new f,ut=new n,ct=n.clone(n.ZERO),ht=new n,dt=new n,mt=new p,pt=o.clone(o.UNIT_W),ft=o.clone(o.UNIT_W),vt=new n,gt=new n,_t=new n,yt=new n,Ct=new n,St=new i,wt=new f,Et=new a,xt=o.clone(o.UNIT_W),bt=new p,Tt=new i,At=new i,Pt=new f,Dt=new f;return G.prototype.update=function(e){e===S.SCENE2D?I(this):e===S.COLUMBUS_VIEW?(this._horizontalRotationAxis=n.UNIT_Z,N(this)):e===S.SCENE3D&&(this._horizontalRotationAxis=void 0,W(this)),this._aggregator.reset()},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){return this._animationCollection.removeAll(),this._spinHandler=this._spinHandler&&this._spinHandler.destroy(),this._translateHandler=this._translateHandler&&this._translateHandler.destroy(),this._lookHandler=this._lookHandler&&this._lookHandler.destroy(),this._rotateHandler=this._rotateHandler&&this._rotateHandler.destroy(),this._zoomHandler=this._zoomHandler&&this._zoomHandler.destroy(),this._zoomWheelHandler=this._zoomWheelHandler&&this._zoomWheelHandler.destroy(),this._pinchHandler=this._pinchHandler&&this._pinchHandler.destroy(),r(this)},G}),r("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),r("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),r("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),r("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),r("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),r("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Geometry","../Core/GeometryAttribute","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/Transforms","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/PixelFormat","../Renderer/RenderbufferFormat","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough","../Shaders/ViewportQuadVS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b){"use strict";function T(e){var t=e.cache.viewportQuad_vertexArray;if(a(t))return t;var r=new l({attributes:{position:new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},primitiveType:d.TRIANGLES});return t=e.createVertexArrayFromGeometry({geometry:r,attributeLocations:P,bufferUsage:p.STATIC_DRAW}),e.cache.viewportQuad_vertexArray=t,t +}var A=function(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new g,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new g,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t};A.prototype.clear=function(e,t){var r=this._clearFBO1Command;i.clone(o(t,i.BLACK),r.color),r.execute(e),r=this._clearFBO2Command,i.clone(o(t,i.BLACK),r.color),r.execute(e)},A.prototype.execute=function(e){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var P={position:0,textureCoordinates:1},D=new e,M=new e,I=new r,O=new t,R=new t,L=new h;return A.prototype.update=function(e){var r=e.getDrawingBufferWidth(),n=e.getDrawingBufferHeight(),o=this;if(!a(this._downSampleCommand)){this._clearFBO1Command=new f,this._clearFBO1Command.color=new i,this._clearFBO2Command=new f,this._clearFBO2Command.color=new i;var s=d.TRIANGLE_FAN,l=T(e),u=this._downSampleCommand=new v;u.owner=this,u.primitiveType=s,u.vertexArray=l,u.shaderProgram=e.getShaderCache().getShaderProgram(b,x,P),u.uniformMap={};var p=this._brightPassCommand=new v;p.owner=this,p.primitiveType=s,p.vertexArray=l,p.shaderProgram=e.getShaderCache().getShaderProgram(b,w,P),p.uniformMap={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}};var g=1,A=2,N=this._blurXCommand=new v;N.owner=this,N.primitiveType=s,N.vertexArray=l,N.shaderProgram=e.getShaderCache().getShaderProgram(b,E,P),N.uniformMap={delta:function(){return g},sigma:function(){return A},direction:function(){return 0}};var B=this._blurYCommand=new v;B.owner=this,B.primitiveType=s,B.vertexArray=l,B.shaderProgram=e.getShaderCache().getShaderProgram(b,E,P),B.uniformMap={delta:function(){return g},sigma:function(){return A},direction:function(){return 1}};var z=this._blendCommand=new v;z.owner=this,z.primitiveType=s,z.vertexArray=l,z.shaderProgram=e.getShaderCache().getShaderProgram(b,S,P),z.uniformMap={u_center:function(){return o._uCenter},u_radius:function(){return o._uRadius}};var F=this._fullScreenCommand=new v;F.owner=this,F.primitiveType=s,F.vertexArray=l,F.shaderProgram=e.getShaderCache().getShaderProgram(b,x,P),F.uniformMap={}}var V=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))-2),k=Math.pow(2,Math.ceil(Math.log(n)/Math.log(2))-2),U=Math.max(V,k),W=D;W.width=r,W.height=n;var G=M;G.width=U,G.height=U;var H=this._fbo,j=a(H)&&H.getColorTexture(0)||void 0;if(!a(j)||j.getWidth()!==r||j.getHeight()!==n){H=H&&H.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/U;var q=[e.createTexture2D({width:r,height:n})];H=this._fbo=e.getDepthTexture()?e.createFramebuffer({colorTextures:q,depthTexture:e.createTexture2D({width:r,height:n,pixelFormat:y.DEPTH_COMPONENT,pixelDatatype:_.UNSIGNED_SHORT})}):e.createFramebuffer({colorTextures:q,depthRenderbuffer:e.createRenderbuffer({format:C.DEPTH_COMPONENT16})}),this._downSampleFBO1=e.createFramebuffer({colorTextures:[e.createTexture2D({width:U,height:U})]}),this._downSampleFBO2=e.createFramebuffer({colorTextures:[e.createTexture2D({width:U,height:U})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var Y=e.createRenderState({viewport:G}),X=e.createRenderState();this._downSampleCommand.uniformMap.u_texture=function(){return H.getColorTexture(0)},this._downSampleCommand.renderState=Y,this._brightPassCommand.uniformMap.u_texture=function(){return o._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=Y,this._blurXCommand.uniformMap.u_texture=function(){return o._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return o._blurStep},this._blurXCommand.renderState=Y,this._blurYCommand.uniformMap.u_texture=function(){return o._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return o._blurStep},this._blurYCommand.renderState=Y,this._blendCommand.uniformMap.u_texture0=function(){return H.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return o._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=X,this._fullScreenCommand.uniformMap.u_texture=function(){return H.getColorTexture(0)},this._fullScreenCommand.renderState=X}var Z=e.getUniformState(),J=Z.getSunPositionWC(),Q=Z.getView(),K=Z.getViewProjection(),$=Z.getProjection(),et=h.computeViewportTransformation(W,0,1,L),tt=h.multiplyByPoint(Q,J,I),rt=m.pointToWindowCoordinates(K,et,J,O);tt.x+=c.SOLAR_RADIUS;var it=m.pointToWindowCoordinates($,et,tt,tt),nt=2*30*t.magnitude(t.subtract(it,rt,it)),ot=R;ot.x=nt,ot.y=nt;var at=this._upSamplePassState.scissorTest.rectangle;return at.x=Math.max(rt.x-.5*ot.x,0),at.y=Math.max(rt.y-.5*ot.y,0),at.width=Math.min(ot.x,r),at.height=Math.min(ot.y,n),t.clone(rt,this._uCenter),this._uRadius=.5*Math.max(ot.x,ot.y),et=h.computeViewportTransformation(G,0,1,L),rt=m.pointToWindowCoordinates(K,et,J,O),ot.x*=V/r,ot.y*=k/n,at=this._downSamplePassState.scissorTest.rectangle,at.x=Math.max(rt.x-.5*ot.x,0),at.y=Math.max(rt.y-.5*ot.y,0),at.width=Math.min(ot.x,r),at.height=Math.min(ot.y,n),this._downSamplePassState.context=e,this._upSamplePassState.context=e,this._fbo},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.release(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.release(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.release(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.release(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.release(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.release(),s(this)},A}),r("Scene/Scene",["../Core/Math","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicProjection","../Core/Ellipsoid","../Core/Occluder","../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Intersect","../Core/Interval","../Core/Matrix4","../Core/JulianDate","../Core/EllipsoidGeometry","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/ColorGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Renderer/Context","../Renderer/ClearCommand","../Renderer/PassState","../Renderer/Pass","./Camera","./ScreenSpaceCameraController","./CompositePrimitive","./CullingVolume","./AnimationCollection","./SceneMode","./SceneTransforms","./FrameState","./OrthographicFrustum","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./FrustumCommands","./PerformanceDisplay","./Primitive","./PerInstanceColorAppearance","./SunPostProcess","./CreditDisplay"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N,B,z,F,V,k,U,W,G){"use strict";function H(e){var t=e._primitives.centralBody;if(e.mode===O.SCENE3D&&i(t)){var r=t.ellipsoid;return ct.radius=r.minimumRadius,ut=u.fromBoundingSphere(ct,e._camera.positionWC,ut)}return void 0}function j(e){e.render=!1,e.pick=!1}function q(e,t,r){var i=e._camera,n=e._frameState;n.mode=e.mode,n.morphTime=e.morphTime,n.scene2D=e.scene2D,n.frameNumber=t,n.time=g.clone(r,n.time),n.camera=i,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),n.occluder=H(e),n.afterRender.length=0,j(n.passes)}function Y(e,t,r,n,o){o.length=n;for(var a=0;n>a;++a){var s=Math.max(e,Math.pow(r,a)*e),l=Math.min(t,r*s),u=o[a];i(u)?(u.near=s,u.far=l):u=o[a]=new F(s,l)}}function X(e,t,r){e.debugShowFrustums&&(t.debugOverlappingFrustums=0);for(var n=e._frustumCommandsList,o=n.length,a=0;o>a;++a){var s=n[a],l=s.near,u=s.far;if(!(r.start>u)){if(r.stopc;++c)l[c].opaqueIndex=0,l[c].translucentIndex=0;var h,d=Number.MAX_VALUE,m=Number.MIN_VALUE,f=!1;e._frameState.mode===O.SCENE3D&&(h=e._frameState.occluder);for(var v=ht.planes,g=0;5>g;++g)v[g]=n.planes[g];n=ht;for(var _=t.length,y=0;_>y;++y){var C=t[y],S=C.pass;if(S===T.OVERLAY)r.push(C);else{var w=C.boundingVolume;if(i(w)){if(C.cull&&(n.getVisibility(w)===p.OUTSIDE||i(h)&&!h.isBoundingSphereVisible(w)))continue;dt=w.getPlaneDistances(s,a,dt),d=Math.min(d,dt.start),m=Math.max(m,dt.stop)}else dt.start=o.frustum.near,dt.stop=o.frustum.far,f=!(C instanceof x);X(e,C,dt)}}f?(d=o.frustum.near,m=o.frustum.far):(d=Math.min(Math.max(d,o.frustum.near),o.frustum.far),m=Math.max(Math.min(m,o.frustum.far),d));var E=e.farToNearRatio,b=Math.ceil(Math.log(m/d)/Math.log(E));d!==Number.MAX_VALUE&&(b!==u||0!==l.length&&(dl[u-1].far))&&(Y(d,m,E,b,l),Z(e))}function J(e){var t={},r=e.getVertexAttributes();for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i].index);return t}function Q(e,r){var n=e.shaderProgram.fragmentShaderSource,o=n.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_Debug_main()"),a="void main() \n{ \n czm_Debug_main(); \n";if(r.debugShowCommands){i(e._debugColor)||(e._debugColor=t.fromRandom());var s=e._debugColor;a+=" gl_FragColor.rgb *= vec3("+s.red+", "+s.green+", "+s.blue+"); \n"}if(r.debugShowFrustums){var l=1&e.debugOverlappingFrustums?"1.0":"0.0",u=2&e.debugOverlappingFrustums?"1.0":"0.0",c=4&e.debugOverlappingFrustums?"1.0":"0.0";a+=" gl_FragColor.rgb *= vec3("+l+", "+u+", "+c+"); \n"}return a+="}",o+"\n"+a}function K(e,t,r,n){if(i(e.shaderProgram)){var o=e.shaderProgram,a=J(o);e.shaderProgram=r.getShaderCache().getShaderProgram(o.vertexShaderSource,Q(e,t),a),e.execute(r,n),e.shaderProgram.release(),e.shaderProgram=o}}function $(e,t,r,n){if((!i(t.debugCommandFilter)||t.debugCommandFilter(e))&&(t.debugShowCommands||t.debugShowFrustums?K(e,t,r,n):e.execute(r,n),e.debugShowBoundingVolume&&i(e.boundingVolume))){if(!i(t._debugSphere)){var o=_.createGeometry(new _({ellipsoid:l.UNIT_SPHERE,vertexFormat:U.FLAT_VERTEX_FORMAT}));t._debugSphere=new k({geometryInstances:new y({geometry:C.toWireframe(o),attributes:{color:new S(1,0,0,1)}}),appearance:new U({flat:!0,translucent:!1}),asynchronous:!1})}var a=v.multiplyByTranslation(v.IDENTITY,e.boundingVolume.center);t._debugSphere.modelMatrix=v.multiplyByUniformScale(a,e.boundingVolume.radius);var s=[];t._debugSphere.update(r,t._frameState,s),s[0].execute(r,n)}}function et(e,t){if(i(e)){for(var r=t.mode===O.SCENE3D?t.occluder:void 0,n=t.cullingVolume,o=ht.planes,a=0;5>a;++a)o[a]=n.planes[a];n=ht;var s=e.boundingVolume;return i(e)&&(!i(e.boundingVolume)||!e.cull||n.getVisibility(s)!==p.OUTSIDE&&(!i(r)||r.isBoundingSphereVisible(s)))}}function tt(e,r,n){var o,a=e._frameState,s=e._camera,l=e._context,u=l.getUniformState();o=i(s.frustum.fovy)?s.frustum.clone(mt):i(s.frustum.infiniteProjectionMatrix)?s.frustum.clone(pt):s.frustum.clone(ft),i(e.sun)&&e.sunBloom!==e._sunBloom?(e._sunPostProcess=e.sunBloom?new W:e._sunPostProcess.destroy(),e._sunBloom=e.sunBloom):!i(e.sun)&&i(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var c=a.passes.render&&i(e.skyBox)?e.skyBox.update(l,a):void 0,h=a.passes.render&&i(e.skyAtmosphere)?e.skyAtmosphere.update(l,a):void 0,d=a.passes.render&&i(e.sun)?e.sun.update(l,a):void 0,m=et(d,a);m&&e.sunBloom&&(r.framebuffer=e._sunPostProcess.update(l));var p=e._clearColorCommand;t.clone(n,p.color),p.execute(l,r),m&&e.sunBloom&&e._sunPostProcess.clear(l,e.backgroundColor),o.near=s.frustum.near,o.far=s.frustum.far,u.updateFrustum(o),i(c)&&$(c,e,l,r),i(h)&&$(h,e,l,r),i(d)&&m&&(d.execute(l,r),e.sunBloom&&(e._sunPostProcess.execute(l),r.framebuffer=void 0));for(var f=e._clearDepthStencilCommand,v=e._frustumCommandsList,g=v.length,_=0;g>_;++_){f.execute(l,r);var y=g-_-1,C=v[y];o.near=C.near,o.far=C.far,0!==y&&(o.near*=.99),u.updateFrustum(o);var S,w=C.opaqueCommands,E=C.opaqueIndex;for(S=0;E>S;++S)$(w[S],e,l,r);for(o.near=C.near,u.updateFrustum(o),w=C.translucentCommands,E=w.length=C.translucentIndex,S=0;E>S;++S)$(w[S],e,l,r)}}function rt(e,t){for(var r=e._context,i=e._overlayCommandList,n=i.length,o=0;n>o;++o)i[o].execute(r,t)}function it(e){var t=e._context,r=e._frameState,n=e._commandList;e._primitives.update(t,r,n),i(e.moon)&&e.moon.update(t,r,n)}function nt(e){for(var t=e.afterRender,r=0,i=t.length;i>r;++r)t[r]();t.length=0}function ot(e,t){var r=e._context,i=e._camera,n=i.frustum,o=r.getDrawingBufferWidth(),a=r.getDrawingBufferHeight(),s=2/o*t.x-1;s*=.5*(n.right-n.left);var l=2/a*(a-t.y)-1;l*=.5*(n.top-n.bottom);var u=m.clone(i.position,gt);m.multiplyByScalar(i.right,s,_t),m.add(_t,u,u),m.multiplyByScalar(i.up,l,_t),m.add(_t,u,u),m.fromElements(u.z,u.x,u.y,u),yt.x=o,yt.y=a;var c=n.getPixelSize(yt,void 0,Ct),h=vt;return h.right=.5*c.x,h.left=-h.right,h.top=.5*c.y,h.bottom=-h.top,h.near=n.near,h.far=n.far,h.computeCullingVolume(u,i.directionWC,i.upWC)}function at(e,t,r,i){var n=e._context,o=e._camera,a=o.frustum,s=a.near,l=n.getDrawingBufferWidth(),u=n.getDrawingBufferHeight(),c=Math.tan(.5*a.fovy),h=a.aspectRatio*c,d=2/l*t.x-1,m=2/u*(u-t.y)-1,p=d*s*h,f=m*s*c;yt.x=l,yt.y=u;var v=a.getPixelSize(yt,void 0,Ct),g=.5*v.x*r,_=.5*v.y*i,y=St;return y.top=f+_,y.bottom=f-_,y.right=p+g,y.left=p-g,y.near=s,y.far=a.far,y.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function st(e,t,r,i){return e.mode===O.SCENE2D?ot(e,t,r,i):at(e,t,r,i)}var lt=function(e,r,n){var o=new E(e,r);i(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0px 0px 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",e.parentNode.appendChild(n)),this._frameState=new L(new G(n)),this._passState=new b(o),this._canvas=e,this._context=o,this._primitives=new D,this._pickFramebuffer=void 0,this._camera=new A(o),this._screenSpaceCameraController=new P(e,this._camera.controller),this._animations=new I,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._commandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._clearColorCommand=new x,this._clearColorCommand.color=new t,this._clearColorCommand.owner=!0;var a=new x;a.depth=1,a.stencil=1,a.owner=this,this._clearDepthStencilCommand=a,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=t.clone(t.BLACK),this.mode=O.SCENE3D,this.scene2D={projection:new s(l.WGS84)},this.morphTime=1,this.farToNearRatio=1e3,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this._performanceDisplay=void 0,this._debugSphere=void 0;var u=this._camera.frustum.near,c=this._camera.frustum.far,h=Math.ceil(Math.log(c/u)/Math.log(this.farToNearRatio));Y(u,c,this.farToNearRatio,h,this._frustumCommandsList),q(this,0,new g),this.initializeFrame()};n(lt.prototype,{canvas:{get:function(){return this._canvas}},context:{get:function(){return this._context}},primitives:{get:function(){return this._primitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},frameState:{get:function(){return this._frameState}},animations:{get:function(){return this._animations}}});var ut,ct=new h,ht=new M,dt=new f,mt=new B,pt=new z,ft=new N;lt.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.getShaderCache().destroyReleasedShaderPrograms()),this._animations.update(),this._camera.controller.update(this.mode,this.scene2D),this._screenSpaceCameraController.update(this.mode)},lt.prototype.render=function(n){i(n)||(n=new g);var o=this.context.getUniformState(),a=this._frameState,s=e.incrementWrap(a.frameNumber,15e6,1);q(this,s,n),a.passes.render=!0,a.creditDisplay.beginFrame();var l=this._context;o.update(l,a),this._commandList.length=0,this._overlayCommandList.length=0,it(this),Z(this);var u=this._passState;if(tt(this,u,r(this.backgroundColor,t.BLACK)),rt(this,u),a.creditDisplay.endFrame(),this.debugShowFramesPerSecond){if(!i(this._performanceDisplay)){var c=document.createElement("div");c.style.position="absolute",c.style.top="10px",c.style.left="10px";var h=this._canvas.parentNode;h.appendChild(c);var d=new V({container:c});this._performanceDisplay=d,this._performanceContainer=c}this._performanceDisplay.update()}else i(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer));l.endFrame(),nt(a)};var vt=new N,gt=new m,_t=new m,yt=new d,Ct=new d,St=new z,wt=3,Et=3,xt=new c(0,0,wt,Et),bt=new t(0,0,0,0),Tt=new d;return lt.prototype.pick=function(e){var t=this._context,r=this.context.getUniformState(),n=this._frameState,o=R.transformWindowToDrawingBuffer(t,e,Tt);i(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),q(this,n.frameNumber,n.time),n.cullingVolume=st(this,o,wt,Et),n.passes.pick=!0,r.update(t,n),this._commandList.length=0,it(this),Z(this),xt.x=o.x-.5*(wt-1),xt.y=t.getDrawingBufferHeight()-o.y-.5*(Et-1),tt(this,this._pickFramebuffer.begin(xt),bt);var a=this._pickFramebuffer.end(xt);return t.endFrame(),nt(n),a},lt.prototype.drillPick=function(e){for(var t=[],r=this.pick(e);i(r)&&i(r.primitive);){var n=r.primitive;if(t.push(r),i(n.show))n.show=!1;else if("function"==typeof n.setShow)n.setShow(!1);else if("function"==typeof n.getGeometryInstanceAttributes){var o=n.getGeometryInstanceAttributes(r.id);i(o)&&i(o.show)&&(o.show=w.toValue(!1))}r=this.pick(e)}for(var a=0;aE&&(S=0);var x=(E-S)*r;if(xr;++r)e[r].destroy();this._sensors=[]},s.prototype.contains=function(e){return e?-1!==this._sensors.indexOf(e):!1},s.prototype.get=function(e){return this._sensors[e]},s.prototype.update=function(e,t,r){var i=t.mode;if(i===a.SCENE3D)for(var n=this._sensors,o=n.length,s=0;o>s;++s)n[s].update(e,t,r)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(),r(this)},s}),r("Scene/SingleTileImageryProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/loadImage","../Core/DeveloperError","../Core/Event","../Core/Extent","./Credit","./GeographicTilingScheme","./TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(r){function n(e){C._image=e,C._tileWidth=e.width,C._tileHeight=e.height,C._ready=!0,u.handleSuccess(C._errorEvent)}function h(){var e="Failed to load image "+g+".";y=u.handleError(y,C,C._errorEvent,e,0,0,0,d)}function d(){c(i(g),n,h)}r=e(r,{});var m=r.url;this._url=m;var p=r.proxy;this._proxy=p;var f=e(r.extent,a.MAX_VALUE),v=new l({extent:f,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1});this._tilingScheme=v,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1;var g=m;t(p)&&(g=p.getURL(g));var _=r.credit;"string"==typeof _&&(_=new s(_)),this._credit=_;var y,C=this;d()};return r(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},extent:{get:function(){return this._tilingScheme.extent}},tileDiscardPolicy:{get:function(){return void 0}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}}}),h.prototype.getTileCredits=function(){return void 0},h.prototype.requestImage=function(){return this._image},h}),r("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform float fCameraHeight;\nuniform float fCameraHeight2;\nuniform float fOuterRadius;\nuniform float fOuterRadius2;\nuniform float fInnerRadius;\nuniform float fScale;\nuniform float fScaleDepth;\nuniform float fScaleOverScaleDepth;\nconst float Kr = 0.0025;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float fKmESun = Km * ESun;\nconst float fKrESun = Kr * ESun;\nconst vec3 v3InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nvec3 v3Pos = position.xyz;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\nfloat fStartDepth = exp(-1.0 / fScaleDepth);\nfloat fStartOffset = fStartDepth*scale(fStartAngle);\n#else\nvec3 v3Start = czm_viewerPositionWC;\nfloat fHeight = length(v3Start);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\nfloat fStartAngle = dot(v3Ray, v3Start) / fHeight;\nfloat fStartOffset = fDepth*scale(fStartAngle);\n#endif\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\nfor(int i=0; ithis._outerRadius?this._spSkyFromSpace:this._spSkyFromAtmosphere,o},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.release(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.release(),o(this)},g}),r("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),r("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),r("Scene/SkyBox",["../Core/defaultValue","../Core/BoxGeometry","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/GeometryPipeline","../Core/VertexFormat","../Core/PrimitiveType","../Renderer/loadCubeMap","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/BlendingState","../Scene/SceneMode","../Shaders/SkyBoxVS","../Shaders/SkyBoxFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";var g=function(t){this.sources=t.sources,this._sources=void 0,this.show=e(t.show,!0),this._command=new d,this._command.owner=this,this._cubeMap=void 0};return g.prototype.update=function(e,n){if(!this.show)return void 0;if(n.mode!==p.SCENE3D&&n.mode!==p.MORPHING)return void 0;if(!n.passes.render)return void 0;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?c(e,this._sources).then(function(e){g._cubeMap=g._cubeMap&&g._cubeMap.destroy(),g._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=e.createCubeMap({source:o}))}var d=this._command;if(!i(d.vertexArray)){var g=this;d.uniformMap={u_cubeMap:function(){return g._cubeMap}};var _=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:l.POSITION_ONLY})),y=s.createAttributeLocations(_);d.primitiveType=u.TRIANGLES,d.modelMatrix=a.clone(a.IDENTITY),d.vertexArray=e.createVertexArrayFromGeometry({geometry:_,attributeLocations:y,bufferUsage:h.STATIC_DRAW}),d.shaderProgram=e.getShaderCache().getShaderProgram(f,v,y),d.renderState=e.createRenderState({blending:m.ALPHA_BLEND})}return i(this._cubeMap)?d:void 0},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.release(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},g}),r("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),r("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),r("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),r("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Math","../Core/PrimitiveType","../Core/Geometry","../Core/GeometryAttribute","../Core/Color","../Core/BoundingRectangle","../Core/Matrix4","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/PixelFormat","../Renderer/ClearCommand","./SceneTransforms","./SceneMode","../Shaders/SunVS","../Shaders/SunFS","../Shaders/ViewportQuadVS","../Shaders/SunTextureFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b){"use strict";function T(e){var t=e.cache.viewportQuad_vertexArray;if(o(t))return t;var r=new c({attributes:{position:new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},primitiveType:u.TRIANGLES});return t=e.createVertexArrayFromGeometry({geometry:r,attributeLocations:P,bufferUsage:v.STATIC_DRAW}),e.cache.viewportQuad_vertexArray=t,t}var A=function(){this.show=!0,this._command=new g,this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}};a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var P={position:0,textureCoordinates:1},D=new t,M=new t,I=new i,O=new i;return A.prototype.update=function(i,a){if(!this.show)return void 0;var s=a.mode;if(s===S.SCENE2D||s===S.MORPHING)return void 0;if(!a.passes.render)return void 0;var c=i.getDrawingBufferWidth(),h=i.getDrawingBufferHeight();if(!o(this._texture)||c!==this._drawingBufferWidth||h!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=c,this._drawingBufferHeight=h,this._glowFactorDirty=!1;var A=Math.max(c,h);A=Math.pow(2,Math.ceil(Math.log(A)/Math.log(2))-2),this._texture=i.createTexture2D({width:A,height:A,pixelFormat:_.RGBA});var R=i.createFramebuffer({colorTextures:[this._texture]});R.destroyAttachments=!1;var L=new y;L.color=new d(0,0,0,0),L.framebuffer=R;var N=new g;N.owner=this,N.primitiveType=u.TRIANGLE_FAN,N.vertexArray=T(i),N.shaderProgram=i.getShaderCache().getShaderProgram(x,b,P),N.framebuffer=R,N.renderState=i.createRenderState({viewport:new m(0,0,A,A)}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=.5*(1/(1+2*this._glowLengthTS));var B=this;N.uniformMap={u_glowLengthTS:function(){return B._glowLengthTS},u_radiusTS:function(){return B._radiusTS}},L.execute(i),N.execute(i),N.shaderProgram.release(),R.destroy()}var z=this._command;if(!o(z.vertexArray)){var F={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=i.createVertexBuffer(V,v.STATIC_DRAW),U=[{index:F.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}];z.vertexArray=i.createVertexArray(U),z.primitiveType=u.TRIANGLE_FAN,z.shaderProgram=i.getShaderCache().getShaderProgram(w,E,F),z.renderState=i.createRenderState({blending:f.ALPHA_BLEND}),z.uniformMap=this._uniformMap,z.boundingVolume=new e}var W=i.getUniformState().getSunPositionWC(),G=i.getUniformState().getSunPositionColumbusView(),H=this._boundingVolume,j=this._boundingVolume2D;r.clone(W,H.center),j.center.x=G.z,j.center.y=G.x,j.center.z=G.y,H.radius=l.SOLAR_RADIUS+l.SOLAR_RADIUS*this._glowLengthTS,j.radius=H.radius,s===S.SCENE3D?e.clone(H,z.boundingVolume):s===S.COLUMBUS_VIEW&&e.clone(j,z.boundingVolume);var q=C.computeActualWgs84Position(a,W,O),Y=r.magnitude(r.subtract(q,a.camera.position,O)),X=i.getUniformState().getProjection(),Z=I;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var J=p.multiplyByVector(X,Z,O),Q=C.clipToDrawingBufferCoordinates(i,J,D);Z.x=l.SOLAR_RADIUS;var K=p.multiplyByVector(X,Z,O),$=C.clipToDrawingBufferCoordinates(i,K,M);return this._size=Math.ceil(t.magnitude(t.subtract($,Q,O))),this._size=2*this._size*(1+2*this._glowLengthTS),z},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.release(),this._texture=this._texture&&this._texture.destroy(),s(this)},A}),r("Scene/TerrainData",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.interpolateHeight=e.throwInstantiationError,t.prototype.isChildAvailable=e.throwInstantiationError,t.prototype.getWaterMask=e.throwInstantiationError,t.prototype.createMesh=e.throwInstantiationError,t.prototype.upsample=e.throwInstantiationError,t.prototype.wasCreatedByUpsampling=e.throwInstantiationError,t}),r("Scene/TileCoordinatesImageryProvider",["../Core/defaultValue","../Core/defineProperties","../Core/Color","../Core/Event","./GeographicTilingScheme"],function(e,t,r,i,n){"use strict";var o=function(t){t=e(t,{}),this._tilingScheme=e(t.tilingScheme,new n),this._color=e(t.color,r.YELLOW),this._errorEvent=new i,this._tileWidth=e(t.tileWidth,256),this._tileHeight=e(t.tileHeight,256)};return t(o.prototype,{proxy:{get:function(){return void 0}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return void 0}},minimumLevel:{get:function(){return void 0}},tilingScheme:{get:function(){return this._tilingScheme}},extent:{get:function(){return this._tilingScheme.extent}},tileDiscardPolicy:{get:function(){return void 0}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},credit:{get:function(){return void 0}}}),o.prototype.getTileCredits=function(){return void 0},o.prototype.requestImage=function(e,t,r){var i=document.createElement("canvas");i.width=256,i.height=256;var n=i.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+r+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),i},o}),r("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),r("Scene/TileMapServiceImageryProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Cartographic","../Core/DeveloperError","../Core/Event","../Core/loadXML","../Core/Extent","./Credit","./ImageryProvider","./WebMercatorTilingScheme","./GeographicTilingScheme"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,r,i,n){var o=e._tilingScheme.getNumberOfYTilesAtLevel(n),a=e._url+n+"/"+r+"/"+(o-i-1)+"."+e._fileExtension,s=e._proxy;return t(s)&&(a=s.getURL(a)),a}var m=/\/$/,p=function(r){r=e(r,{});var n=r.url;m.test(n)||(n+="/"),this._url=n,this._ready=!1,this._proxy=r.proxy,this._tileDiscardPolicy=r.tileDiscardPolicy,this._errorEvent=new o;var u=r.credit;"string"==typeof u&&(u=new l(u)),this._credit=u;var d=this;a(n+"tilemapresource.xml").then(function(n){for(var o,a,l,u=/tileformat/i,m=/tileset/i,p=/tilesets/i,f=/boundingbox/i,v=[],g=n.childNodes[0].childNodes,_=0;_E.extent.east&&(d._extent.east=E.extent.east),d._extent.southE.extent.north&&(d._extent.north=E.extent.north);var b=E.positionToTileXY(d._extent.getSouthwest(),d._minimumLevel),T=E.positionToTileXY(d._extent.getNortheast(),d._minimumLevel),A=(Math.abs(T.x-b.x)+1)*(Math.abs(T.y-b.y)+1);A>4&&(d._minimumLevel=0),d._tilingScheme=E,d._ready=!0},function(){d._fileExtension=e(r.fileExtension,"png"),d._tileWidth=e(r.tileWidth,256),d._tileHeight=e(r.tileHeight,256),d._minimumLevel=e(r.minimumLevel,0),d._maximumLevel=e(r.maximumLevel,18),d._tilingScheme=e(r.tilingScheme,new c),d._extent=e(r.extent,d._tilingScheme.extent),d._ready=!0})};return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},extent:{get:function(){return this._extent}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}}}),p.prototype.getTileCredits=function(){return void 0},p.prototype.requestImage=function(e,t,r){var i=d(this,e,t,r);return u.loadImage(this,i)},p}),r("Scene/VRTheWorldTerrainProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/loadImage","../Core/loadXML","../Core/getImagePixels","../Core/throttleRequestByServer","../Core/DeveloperError","../Core/Extent","../Core/Math","../Core/Ellipsoid","../Core/Event","./Credit","./TerrainProvider","./TileProviderError","./GeographicTilingScheme","./HeightmapTerrainData","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(e,t){this.extent=e,this.maxLevel=t}function y(e,t,r,i){for(var n=e._tilingScheme,o=e._extents,a=n.tileXYToExtent(t,r,i),s=0,l=0;l0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new h,this._ready=!1,this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var v=r.credit;"string"==typeof v&&(v=new d(v)),this._credit=v,this._tilingScheme=void 0,this._extents=[];var y,C=this,S=e(r.ellipsoid,c.WGS84);a()};r(S.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new s("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}}}),S.prototype.requestTileGeometry=function(r,n,l,u){if(!this.ready)throw new s("requestTileGeometry must not be called before ready returns true.");var c=this._tilingScheme.getNumberOfYTilesAtLevel(l),h=this._url+l+"/"+r+"/"+(c-n-1)+".tif?cesium=true",d=this._proxy;t(d)&&(h=d.getURL(h));var m;if(u=e(u,!0)){if(m=a(h,i),!t(m))return void 0}else m=i(h);var p=this;return g(m,function(e){return new v({buffer:o(e),width:p._heightmapWidth,height:p._heightmapHeight,childTileMask:y(p,r,n,l),structure:p._terrainDataStructure})})},S.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new s("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<=0&&aa&&(o+="?");var s=e._parameters;for(var l in s)s.hasOwnProperty(l)&&(o+=l+"="+s[l]+"&");if(r(s.layers)||(o+="layers="+e._layers+"&"),r(s.srs)||(o+="srs=EPSG:4326&"),!r(s.bbox)){var u=e._tilingScheme.tileXYToNativeExtent(t,i,n),c=u.west+","+u.south+","+u.east+","+u.north;o+="bbox="+c+"&"}r(s.width)||(o+="width=256&"),r(s.height)||(o+="height=256&");var h=e._proxy;return r(h)&&(o=h.getURL(o)),o}var d=function m(i){i=t(i,{}),this._url=i.url,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._layers=i.layers;var n=e(m.DefaultParameters);if(r(i.parameters))for(var o in i.parameters)if(i.parameters.hasOwnProperty(o)){var u=o.toLowerCase();n[u]=i.parameters[o]}this._parameters=n,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=i.maximumLevel;var h=t(i.extent,s.MAX_VALUE);this._tilingScheme=new c({extent:h});var d=i.credit;"string"==typeof d&&(d=new l(d)),this._credit=d,this._errorEvent=new a,this._ready=!0};return i(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},extent:{get:function(){return this._tilingScheme.extent +}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}}}),d.prototype.getTileCredits=function(){return void 0},d.prototype.requestImage=function(e,t,r){var i=h(this,e,t,r);return u.loadImage(this,i)},d.DefaultParameters=n({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),d}),r("Scene/createTangentSpaceDebugPrimitive",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/ColorGeometryInstanceAttribute","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./Primitive","./PerInstanceColorAppearance"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(r){r=e(r,e.EMPTY_OBJECT);var u=[],c=r.geometry;t(c.attributes)&&t(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(e(r.modelMatrix,a.IDENTITY)),m=e(r.length,1e4);return t(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",m),attributes:{color:new i(1,0,0,1)},modelMatrix:d})),t(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",m),attributes:{color:new i(0,1,0,1)},modelMatrix:d})),t(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",m),attributes:{color:new i(0,0,1,1)},modelMatrix:d})),u.length>0?new s({geometryInstances:u,appearance:new l({flat:!0,translucent:!1})}):void 0}return u}),r("Scene/sampleTerrain",["../Core/DeveloperError","../Core/defined","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){var t=e.positions,r=e.tilingScheme.tileXYToExtent(e.x,e.y,e.level);return function(e){for(var i=0;ir;r++)c[t[r]]=e});var h={propertychange:!0},d=n&&function(){for(var t=3,r=n.createElement("div"),i=r.getElementsByTagName("i");r.innerHTML="",i[0];);return t>4?t:e}();return{$a:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],n:function(e,t){for(var r=0,i=e.length;i>r;r++)t(e[r])},l:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var r=0,i=e.length;i>r;r++)if(e[r]===t)return r;return-1},Ua:function(e,t,r){for(var i=0,n=e.length;n>i;i++)if(t.call(r,e[i]))return e[i];return null},ia:function(e,t){var r=u.a.l(e,t);r>=0&&e.splice(r,1)},Va:function(e){e=e||[];for(var t=[],r=0,i=e.length;i>r;r++)0>u.a.l(t,e[r])&&t.push(e[r]);return t},ha:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)r.push(t(e[i]));return r},ga:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)t(e[i])&&r.push(e[i]);return r},X:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var r=0,i=t.length;i>r;r++)e.push(t[r]);return e},V:function(e,t,r){var i=u.a.l(u.a.Ha(e),t);0>i?r&&e.push(t):r||e.splice(i,1)},extend:function(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},K:t,Da:function(e,t){if(!e)return e;var r,i={};for(r in e)e.hasOwnProperty(r)&&(i[r]=t(e[r],r,e));return i},wa:function(e){for(;e.firstChild;)u.removeNode(e.firstChild)},Vb:function(e){e=u.a.Q(e);for(var t=n.createElement("div"),r=0,i=e.length;i>r;r++)t.appendChild(u.L(e[r]));return t},Ya:function(e,t){for(var r=0,i=e.length,n=[];i>r;r++){var o=e[r].cloneNode(!0);n.push(t?u.L(o):o)}return n},S:function(e,t){if(u.a.wa(e),t)for(var r=0,i=t.length;i>r;r++)e.appendChild(t[r])},nb:function(e,t){var r=e.nodeType?[e]:e;if(0o;o++)n.insertBefore(t[o],i);for(o=0,a=r.length;a>o;o++)u.removeNode(r[o])}},$:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);if(1d?e.setAttribute("selected",t):e.selected=t},la:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ec:function(e,t){for(var r=[],i=(e||"").split(t),n=0,o=i.length;o>n;n++){var a=u.a.la(i[n]);""!==a&&r.push(a)}return r},ac:function(e,t){return e=e||"",t.length>e.length?!1:e.substring(0,t.length)===t},Gb:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},va:function(e){return u.a.Gb(e,e.ownerDocument.documentElement)},Ra:function(e){return!!u.a.Ua(e,u.a.va)},v:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},r:function(e,t,i){var n=d&&h[t];if(n||"undefined"==typeof a)if(n||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){i.call(e,t)},s="on"+t;e.attachEvent(s,o),u.a.C.ea(e,function(){e.detachEvent(s,o)})}else e.addEventListener(t,i,!1);else{if(r(e,t)){var l=i;i=function(e,t){var r=this.checked;t&&(this.checked=!0!==t.Ab),l.call(this,e),this.checked=r}}a(e).bind(t,i)}},da:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof a){var o=[];r(e,t)&&o.push({Ab:e.checked}),a(e).trigger(t,o)}else if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=n.createEvent(c[t]||"HTMLEvents"),o.initEvent(t,!0,!0,i,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");r(e,t)&&(e.checked=!0!==e.checked),e.fireEvent("on"+t)}},c:function(e){return u.M(e)?e():e},Ha:function(e){return u.M(e)?e.t():e},ma:function(e,t,r){if(t){var i=/\S+/g,n=e.className.match(i)||[];u.a.n(t.match(i),function(e){u.a.V(n,e,r)}),e.className=n.join(" ")}},Ma:function(t,r){var i=u.a.c(r);(null===i||i===e)&&(i="");var o=u.e.firstChild(t);!o||3!=o.nodeType||u.e.nextSibling(o)?u.e.S(t,[n.createTextNode(i)]):o.data=i,u.a.Jb(t)},pb:function(e,t){if(e.name=t,7>=d)try{e.mergeAttributes(n.createElement(""),!1)}catch(r){}},Jb:function(e){d>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Hb:function(e){if(d){var t=e.style.width;e.style.width=0,e.style.width=t}},Zb:function(e,t){e=u.a.c(e),t=u.a.c(t);for(var r=[],i=e;t>=i;i++)r.push(i);return r},Q:function(e){for(var t=[],r=0,i=e.length;i>r;r++)t.push(e[r]);return t},cc:6===d,dc:7===d,ja:d,ab:function(e,t){for(var r=u.a.Q(e.getElementsByTagName("input")).concat(u.a.Q(e.getElementsByTagName("textarea"))),i="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=r.length-1;o>=0;o--)i(r[o])&&n.push(r[o]);return n},Wb:function(e){return"string"==typeof e&&(e=u.a.la(e))?s&&s.parse?s.parse(e):new Function("return "+e)():null},Na:function(e,t,r){if(!s||!s.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return s.stringify(u.a.c(e),t,r)},Xb:function(e,r,i){i=i||{};var o=i.params||{},a=i.includeFields||this.$a,s=e;if("object"==typeof e&&"form"===u.a.v(e))for(var s=e.action,l=a.length-1;l>=0;l--)for(var c=u.a.ab(e,a[l]),h=c.length-1;h>=0;h--)o[c[h].name]=c[h].value;r=u.a.c(r);var d=n.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var m in r)e=n.createElement("input"),e.name=m,e.value=u.a.Na(u.a.c(r[m])),d.appendChild(e);t(o,function(e,t){var r=n.createElement("input");r.name=e,r.value=t,d.appendChild(r)}),n.body.appendChild(d),i.submitter?i.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),u.b("utils",u.a),u.b("utils.arrayForEach",u.a.n),u.b("utils.arrayFirst",u.a.Ua),u.b("utils.arrayFilter",u.a.ga),u.b("utils.arrayGetDistinctValues",u.a.Va),u.b("utils.arrayIndexOf",u.a.l),u.b("utils.arrayMap",u.a.ha),u.b("utils.arrayPushAll",u.a.X),u.b("utils.arrayRemoveItem",u.a.ia),u.b("utils.extend",u.a.extend),u.b("utils.fieldsIncludedWithJsonPost",u.a.$a),u.b("utils.getFormFields",u.a.ab),u.b("utils.peekObservable",u.a.Ha),u.b("utils.postJson",u.a.Xb),u.b("utils.parseJson",u.a.Wb),u.b("utils.registerEventHandler",u.a.r),u.b("utils.stringifyJson",u.a.Na),u.b("utils.range",u.a.Zb),u.b("utils.toggleDomNodeCssClass",u.a.ma),u.b("utils.triggerEvent",u.a.da),u.b("utils.unwrapObservable",u.a.c),u.b("utils.objectForEach",u.a.K),u.b("utils.addOrRemoveItem",u.a.V),u.b("unwrap",u.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,r=Array.prototype.slice.call(arguments);return e=r.shift(),function(){return t.apply(e,r.concat(Array.prototype.slice.call(arguments)))}}),u.a.f=new function(){function t(t,o){var a=t[i];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[i]="ko"+r++,n[a]={}}return n[a]}var r=0,i="__ko__"+(new Date).getTime(),n={};return{get:function(r,i){var n=t(r,!1);return n===e?e:n[i]},set:function(r,i,n){(n!==e||t(r,!1)!==e)&&(t(r,!0)[i]=n)},clear:function(e){var t=e[i];return t?(delete n[t],e[i]=null,!0):!1},D:function(){return r++ +i}}},u.b("utils.domData",u.a.f),u.b("utils.domData.clear",u.a.f.clear),u.a.C=new function(){function t(t,r){var n=u.a.f.get(t,i);return n===e&&r&&(n=[],u.a.f.set(t,i,n)),n}function r(e){var i=t(e,!1);if(i)for(var i=i.slice(0),n=0;ni;i++)r(t[i])}return e},removeNode:function(e){u.L(e),e.parentNode&&e.parentNode.removeChild(e)}}},u.L=u.a.C.L,u.removeNode=u.a.C.removeNode,u.b("cleanNode",u.L),u.b("removeNode",u.removeNode),u.b("utils.domNodeDisposal",u.a.C),u.b("utils.domNodeDisposal.addDisposeCallback",u.a.C.ea),u.b("utils.domNodeDisposal.removeDisposeCallback",u.a.C.mb),function(){u.a.Fa=function(e){var t;if("undefined"!=typeof a){if(a.parseHTML)t=a.parseHTML(e)||[];else if((t=a.clean([e]))&&t[0]){for(e=t[0];e.parentNode&&11!==e.parentNode.nodeType;)e=e.parentNode;e.parentNode&&e.parentNode.removeChild(e)}}else{var r=u.a.la(e).toLowerCase();for(t=n.createElement("div"),r=r.match(/^<(thead|tbody|tfoot)/)&&[1,"","
"]||!r.indexOf("",""]||(!r.indexOf("",""]||[0,"",""],e="ignored
"+r[1]+e+r[2]+"
","function"==typeof i.innerShiv?t.appendChild(i.innerShiv(e)):t.innerHTML=e;r[0]--;)t=t.lastChild;t=u.a.Q(t.lastChild.childNodes)}return t},u.a.Ka=function(t,r){if(u.a.wa(t),r=u.a.c(r),null!==r&&r!==e)if("string"!=typeof r&&(r=r.toString()),"undefined"!=typeof a)a(t).html(r);else for(var i=u.a.Fa(r),n=0;ni;i++)t(n[i],r)}var r={};return{Ca:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(0|4294967296*(1+Math.random())).toString(16).substring(1)+(0|4294967296*(1+Math.random())).toString(16).substring(1);return r[t]=e,""},ub:function(t,i){var n=r[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,i||[]),!0}finally{delete r[t]}},vb:function(e,r){var i=[];t(e,i);for(var n=0,o=i.length;o>n;n++){var a=i[n].Fb,s=[a];r&&u.a.X(s,r),u.u.ub(i[n].Tb,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},jb:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),u.b("memoization",u.u),u.b("memoization.memoize",u.u.Ca),u.b("memoization.unmemoize",u.u.ub),u.b("memoization.parseMemoText",u.u.jb),u.b("memoization.unmemoizeDomNodeAndDescendants",u.u.vb),u.xa={throttle:function(e,t){e.throttleEvaluation=t;var r=null;return u.h({read:e,write:function(i){clearTimeout(r),r=setTimeout(function(){e(i)},t)}})},notify:function(e,t){e.equalityComparer="always"==t?null:r}};var c={undefined:1,"boolean":1,number:1,string:1};u.b("extenders",u.xa),u.sb=function(e,t,r){this.target=e,this.qa=t,this.Eb=r,u.s(this,"dispose",this.B)},u.sb.prototype.B=function(){this.Qb=!0,this.Eb()},u.ca=function(){this.F={},u.a.extend(this,u.ca.fn),u.s(this,"subscribe",this.T),u.s(this,"extend",this.extend),u.s(this,"getSubscriptionsCount",this.Lb)};var h="change";u.ca.fn={T:function(e,t,r){r=r||h;var i=new u.sb(this,t?e.bind(t):e,function(){u.a.ia(this.F[r],i)}.bind(this));return this.F[r]||(this.F[r]=[]),this.F[r].push(i),i},notifySubscribers:function(e,t){if(t=t||h,this.cb(t))try{u.i.Wa();for(var r,i=this.F[t].slice(0),n=0;r=i[n];++n)r&&!0!==r.Qb&&r.qa(e)}finally{u.i.end()}},cb:function(e){return this.F[e]&&this.F[e].length},Lb:function(){var e=0;return u.a.K(this.F,function(t,r){e+=r.length}),e},extend:function(e){var t=this;return e&&u.a.K(e,function(e,r){var i=u.xa[e];"function"==typeof i&&(t=i(t,r)||t)}),t}},u.fb=function(e){return null!=e&&"function"==typeof e.T&&"function"==typeof e.notifySubscribers},u.b("subscribable",u.ca),u.b("isSubscribable",u.fb),u.i=function(){var e=[];return{Wa:function(t){e.push(t&&{qa:t,Za:[]})},end:function(){e.pop()},lb:function(t){if(!u.fb(t))throw Error("Only subscribable things can act as dependencies");if(0=0;i--)r(t[i])&&(t[i]._destroy=!0);this.N()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=u.a.l(t,e)}):[]},indexOf:function(e){var t=this();return u.a.l(t,e)},replace:function(e,t){var r=this.indexOf(e);r>=0&&(this.O(),this.t()[r]=t,this.N())}},u.a.n("pop push reverse shift sort splice unshift".split(" "),function(e){u.ba.fn[e]=function(){var t=this.t();return this.O(),this.Xa(t,e,arguments),t=t[e].apply(t,arguments),this.N(),t}}),u.a.n(["slice"],function(e){u.ba.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),u.b("observableArray",u.ba);var m="arrayChange";u.xa.trackArrayChanges=function(e){function t(){if(!r){r=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,r){return r&&r!==h||++n,t.apply(this,arguments)};var o=[].concat(e.t()||[]);i=null,e.T(function(t){if(t=[].concat(t||[]),e.cb(m)){var r;(!i||n>1)&&(i=u.a.ra(o,t,{sparse:!0})),r=i,r.length&&e.notifySubscribers(r,m)}o=t,i=null,n=0})}}if(!e.Xa){var r=!1,i=null,n=0,o=e.T;e.T=e.subscribe=function(e,r,i){return i===m&&t(),o.apply(this,arguments)},e.Xa=function(e,t,o){function a(e,t,r){s.push({status:e,value:t,index:r})}if(r&&!n){var s=[],l=e.length,u=o.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;u>t;t++)a("added",o[t],c+t);break;case"pop":c=l-1;case"shift":l&&a("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>o[0]?l+o[0]:o[0]),l);for(var l=1===u?l:Math.min(t+(o[1]||0),l),u=t+u-2,c=Math.max(l,u),h=2;c>t;++t,++h)l>t&&a("deleted",e[t],t),u>t&&a("added",o[h],t);break;default:return}i=s}}}},u.h=function(t,r,i){function n(){u.a.n(C,function(e){e.B()}),C=[]}function o(){var e=s.throttleEvaluation;e&&e>=0?(clearTimeout(S),S=setTimeout(a,e)):a()}function a(){if(!d){if(_&&_()){if(!m)return y(),h=!0,void 0}else m=!1;d=!0;try{var t=u.a.ha(C,function(e){return e.target});u.i.Wa(function(r){var i;0<=(i=u.a.l(t,r))?t[i]=e:C.push(r.T(o))});for(var i=r?p.call(r):p(),n=t.length-1;n>=0;n--)t[n]&&C.splice(n,1)[0].B();h=!0,s.equalityComparer&&s.equalityComparer(c,i)||(s.notifySubscribers(c,"beforeChange"),c=i,s.notifySubscribers(c))}finally{u.i.end(),d=!1}C.length||y()}}function s(){if(0t;t++)e=e();return e})},u.toJSON=function(e,t,r){return e=u.tb(e),u.a.Na(e,t,r)},i.prototype={save:function(e,t){var r=u.a.l(this.keys,e);r>=0?this.Qa[r]=t:(this.keys.push(e),this.Qa.push(t))},get:function(t){return t=u.a.l(this.keys,t),t>=0?this.Qa[t]:e}}}(),u.b("toJS",u.tb),u.b("toJSON",u.toJSON),function(){u.k={o:function(t){switch(u.a.v(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?u.a.f.get(t,u.d.options.Ea):7>=u.a.ja?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?u.k.o(t.options[t.selectedIndex]):e;default:return t.value}},na:function(t,r){switch(u.a.v(t)){case"option":switch(typeof r){case"string":u.a.f.set(t,u.d.options.Ea,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=r;break;default:u.a.f.set(t,u.d.options.Ea,r),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof r?r:""}break;case"select":""===r&&(r=e),(null===r||r===e)&&(t.selectedIndex=-1);for(var i=t.options.length-1;i>=0;i--)if(u.k.o(t.options[i])==r){t.selectedIndex=i;break}1=l){t&&a.push(r?{key:t,value:r.join("")}:{unknown:t}),t=r=l=0;continue}}else if(58===d){if(!r)continue}else if(47===d&&h&&1"===n.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};u.e={P:{},childNodes:function(t){return e(t)?r(t):t.childNodes},Z:function(t){if(e(t)){t=u.e.childNodes(t);for(var r=0,i=t.length;i>r;r++)u.removeNode(t[r])}else u.a.wa(t)},S:function(t,r){if(e(t)){u.e.Z(t);for(var i=t.nextSibling,n=0,o=r.length;o>n;n++)i.parentNode.insertBefore(r[n],i)}else u.a.S(t,r)},kb:function(t,r){e(t)?t.parentNode.insertBefore(r,t.nextSibling):t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},eb:function(t,r,i){i?e(t)?t.parentNode.insertBefore(r,i.nextSibling):i.nextSibling?t.insertBefore(r,i.nextSibling):t.appendChild(r):u.e.kb(t,r)},firstChild:function(r){return e(r)?!r.nextSibling||t(r.nextSibling)?null:r.nextSibling:r.firstChild},nextSibling:function(r){return e(r)&&(r=i(r)),r.nextSibling&&t(r.nextSibling)?null:r.nextSibling},Mb:e,bc:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},ib:function(r){if(l[u.a.v(r)]){var n=r.firstChild;if(n)do if(1===n.nodeType){var o;o=n.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=i(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=n.nextSibling,s=0;s=u.a.ja&&r in p?(r=p[r],n?t.removeAttribute(r):t[r]=i):n||t.setAttribute(r,i.toString()),"name"===r&&u.a.pb(t,n?"":i.toString())})}},function(){u.d.checked={after:["value","attr"],init:function(t,r,i){function n(){return i.has("checkedValue")?u.a.c(i.get("checkedValue")):t.value}function o(){var e=t.checked,o=d?n():e;if(m&&(!l||e)){var a=u.i.p(r);c?h!==o?(e&&(u.a.V(a,o,!0),u.a.V(a,h,!1)),h=o):u.a.V(a,o,e):u.g.oa(a,i,"checked",o,!0)}}function a(){var e=u.a.c(r());t.checked=c?0<=u.a.l(e,n()):s?e:n()===e}var s="checkbox"==t.type,l="radio"==t.type;if(s||l){var c=s&&u.a.c(r())instanceof Array,h=c?n():e,d=l||c,m=!1;l&&!t.name&&u.d.uniqueName.init(t,function(){return!0}),u.h(o,null,{I:t}),u.a.r(t,"click",o),u.h(a,null,{I:t}),m=!0}}},u.g.U.checked=!0,u.d.checkedValue={update:function(e,t){e.value=u.a.c(t())}}}(),u.d.css={update:function(e,t){var r=u.a.c(t());"object"==typeof r?u.a.K(r,function(t,r){r=u.a.c(r),u.a.ma(e,t,r)}):(r=String(r||""),u.a.ma(e,e.__ko__cssValue,!1),e.__ko__cssValue=r,u.a.ma(e,r,!0))}},u.d.enable={update:function(e,t){var r=u.a.c(t());r&&e.disabled?e.removeAttribute("disabled"):r||e.disabled||(e.disabled=!0)}},u.d.disable={update:function(e,t){u.d.enable.update(e,function(){return!u.a.c(t())})}},u.d.event={init:function(e,t,r,i,n){var o=t()||{};u.a.K(o,function(o){"string"==typeof o&&u.a.r(e,o,function(e){var a,s=t()[o];if(s){try{var l=u.a.Q(arguments);i=n.$data,l.unshift(i),a=s.apply(i,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===r.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},u.d.foreach={hb:function(e){return function(){var t=e(),r=u.a.Ha(t);return r&&"number"!=typeof r.length?(u.a.c(t),{foreach:r.data,as:r.as,includeDestroyed:r.includeDestroyed,afterAdd:r.afterAdd,beforeRemove:r.beforeRemove,afterRender:r.afterRender,beforeMove:r.beforeMove,afterMove:r.afterMove,templateEngine:u.J.Aa}):{foreach:t,templateEngine:u.J.Aa}}},init:function(e,t){return u.d.template.init(e,u.d.foreach.hb(t))},update:function(e,t,r,i,n){return u.d.template.update(e,u.d.foreach.hb(t),r,i,n)}},u.g.Y.foreach=!1,u.e.P.foreach=!0,u.d.hasfocus={init:function(e,t,r){function i(i){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(a){o=n.body}i=o===e}n=t(),u.g.oa(n,r,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var n=i.bind(null,!0),o=i.bind(null,!1);u.a.r(e,"focus",n),u.a.r(e,"focusin",n),u.a.r(e,"blur",o),u.a.r(e,"focusout",o)},update:function(e,t){var r=!!u.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===r||(r?e.focus():e.blur(),u.i.p(u.a.da,null,[e,r?"focusin":"focusout"]))}},u.g.U.hasfocus=!0,u.d.hasFocus=u.d.hasfocus,u.g.U.hasFocus=!0,u.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){u.a.Ka(e,t())}};var f=u.a.f.D();l("if"),l("ifnot",!1,!0),l("with",!0,!1,function(e,t){return e.createChildContext(t)}),u.d.options={init:function(e){if("select"!==u.a.v(e))throw Error("options binding applies only to SELECT elements");for(;0","#comment",n)})},yb:function(e,t){return u.u.Ca(function(r,i){var n=r.nextSibling;n&&n.nodeName.toLowerCase()===t&&u.pa(n,e,i)})}}}(),u.b("__tr_ambtns",u.Oa.yb),function(){u.m={},u.m.j=function(e){this.j=e},u.m.j.prototype.text=function(){var e=u.a.v(this.j),e="script"===e?"text":"textarea"===e?"value":"innerHTML";if(0==arguments.length)return this.j[e];var t=arguments[0];"innerHTML"===e?u.a.Ka(this.j,t):this.j[e]=t};var t=u.a.f.D()+"_";u.m.j.prototype.data=function(e){return 1===arguments.length?u.a.f.get(this.j,t+e):(u.a.f.set(this.j,t+e,arguments[1]),void 0)};var r=u.a.f.D();u.m.W=function(e){this.j=e},u.m.W.prototype=new u.m.j,u.m.W.prototype.text=function(){if(0==arguments.length){var t=u.a.f.get(this.j,r)||{};return t.Pa===e&&t.sa&&(t.Pa=t.sa.innerHTML),t.Pa}u.a.f.set(this.j,r,{Pa:arguments[0]})},u.m.j.prototype.nodes=function(){return 0==arguments.length?(u.a.f.get(this.j,r)||{}).sa:(u.a.f.set(this.j,r,{sa:arguments[0]}),void 0)},u.b("templateSources",u.m),u.b("templateSources.domElement",u.m.j),u.b("templateSources.anonymousTemplate",u.m.W)}(),function(){function t(e,t,r){var i;for(t=u.e.nextSibling(t);e&&(i=e)!==t;)e=u.e.nextSibling(i),r(i,e)}function r(e,r){if(e.length){var i=e[0],n=e[e.length-1],o=i.parentNode,a=u.H.instance,s=a.preprocessNode;if(s){if(t(i,n,function(e,t){var r=e.previousSibling,o=s.call(a,e);o&&(e===i&&(i=o[0]||t),e===n&&(n=o[o.length-1]||r))}),e.length=0,!i)return;i===n?e.push(i):(e.push(i,n),u.a.$(e,o))}t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||u.Sa(r,e)}),t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||u.u.vb(e,[r])}),u.a.$(e,o)}}function i(e){return e.nodeType?e:0=o;o++)for(l=s,d.push(s=[]),u=c(p,o+f),a=h(0,o-1);u>=a;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||v,s[a-1]||v)+1:a+1:o+1;for(c=[],h=[],f=[],o=m,a=p;o||a;)p=d[o][a]-1,a&&p===d[o][a-1]?h.push(c[c.length]={status:r,value:t[--a],index:a}):o&&p===d[o-1][a]?f.push(c[c.length]={status:i,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));if(h.length&&f.length){e=10*m;var g;for(t=r=0;(n.dontLimitMoves||e>t)&&(g=h[r]);r++){for(i=0;d=f[i];i++)if(g.value===d.value){g.moved=d.index,d.moved=g.index,f.splice(i,1),t=i=0;break}t+=i}}return c.reverse()}return function(t,r,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},t=t||[],r=r||[],t.length<=r.length?e(t,r,"added","deleted",i):e(r,t,"deleted","added",i)}}(),u.b("utils.compareArrays",u.a.ra),function(){function t(t,r,i,n,o){var a=[],s=u.h(function(){var e=r(i,o,u.a.$(a,t))||[];0r;r++)t[r]&&u.a.n(t[r].R,function(i){e(i,r,t[r].fa)})}n=n||[],a=a||{};var h=u.a.f.get(i,r)===e,d=u.a.f.get(i,r)||[],m=u.a.ha(d,function(e){return e.fa}),p=u.a.ra(m,n,a.dontLimitMoves),f=[],v=0,g=0,_=[],y=[];n=[];for(var C,S,w,E=[],m=[],x=0;S=p[x];x++)switch(w=S.moved,S.status){case"deleted":w===e&&(C=d[v],C.h&&C.h.B(),_.push.apply(_,u.a.$(C.R,i)),a.beforeRemove&&(n[x]=C,y.push(C))),v++;break;case"retained":l(x,v++);break;case"added":w!==e?l(x,w):(C={fa:S.value,za:u.q(g++)},f.push(C),y.push(C),h||(m[x]=C))}c(a.beforeMove,E),u.a.n(_,a.beforeRemove?u.L:u.removeNode);for(var b,x=0,h=u.e.firstChild(i);C=y[x];x++){for(C.R||u.a.extend(C,t(i,o,C.fa,s,C.za)),v=0;p=C.R[v];h=p.nextSibling,b=p,v++)p!==h&&u.e.eb(i,p,b);!C.Ob&&s&&(s(C.fa,C.R,C.za),C.Ob=!0)}c(a.beforeRemove,n),c(a.afterMove,E),c(a.afterAdd,m),u.a.f.set(i,r,f)}}(),u.b("utils.setDomNodeChildrenFromArrayMapping",u.a.Ja),u.J=function(){this.allowTemplateRewriting=!1},u.J.prototype=new u.w,u.J.prototype.renderTemplateSource=function(e){var t=(9>u.a.ja?0:e.nodes)?e.nodes():null;return t?u.a.Q(t.cloneNode(!0).childNodes):(e=e.text(),u.a.Fa(e))},u.J.Aa=new u.J,u.La(u.J.Aa),u.b("nativeTemplateEngine",u.J),function(){u.Ba=function(){var e=this.Rb=function(){if("undefined"==typeof a||!a.tmpl)return 0;try{if(0<=a.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,r,i){if(i=i||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var o=t.data("precompiled");return o||(o=t.text()||"",o=a.template(null,"{{ko_with $item.koBindingContext}}"+o+"{{/ko_with}}"),t.data("precompiled",o)),t=[r.$data],r=a.extend({koBindingContext:r},i.templateOptions),r=a.tmpl(o,t,r),r.appendTo(n.createElement("div")),a.fragments={},r},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){n.write("")},e>0&&(a.tmpl.tag.ko_code={open:"__.push($1 || '');"},a.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},u.Ba.prototype=new u.w;var e=new u.Ba;0i;++i)t.appendChild(l(e.children[i]))}else 0===r.indexOf("xlink:")?t.setAttributeNS(g,r.substring(6),e[r]):"textContent"===r?t.textContent=e[r]:t.setAttribute(r,e[r]);return t}function u(e,t,r){var i=document.createElementNS(v,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=r,i.appendChild(n),i}function c(e,t,r){e.setAttribute("transform","translate(100,100) rotate("+r+")"),t.setAttribute("transform","rotate("+r+")")}function h(e,t){var r=t.alpha,i=1-r;return T.red=e.red*i+t.red*r,T.green=e.green*i+t.green*r,T.blue=e.blue*i+t.blue*r,T.toCssColorString()}function d(e,t,r){var i={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect","class":"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect","class":"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":r},{tagName:"title",textContent:""}]};return l(i)}function m(e,t,r){var i={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use","class":"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":r},{tagName:"title",textContent:""}]};return l(i)}function p(e,t){var r=e._viewModel,i=r.shuttleRingDragging;if(!i||f===e)if("mousedown"===t.type||i&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||i&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!i&&(n>u.right||nu.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,m=180*Math.atan2(d,h)/Math.PI+90;m>180&&(m-=360);var p=r.shuttleRingAngle;i||nc.left&&o>c.top&&om?r.slower():m>p&&r.faster(),t.preventDefault()}else f=void 0,r.shuttleRingDragging=!1}var f,v="http://www.w3.org/2000/svg",g="http://www.w3.org/1999/xlink",_=n.fromCssColorString("rgba(247,250,255,0.384)"),y=n.fromCssColorString("rgba(143,191,255,0.216)"),C=n.fromCssColorString("rgba(153,197,255,0.098)"),S=n.fromCssColorString("rgba(255,255,255,0.086)"),w=n.fromCssColorString("rgba(255,255,255,0.267)"),E=n.fromCssColorString("rgba(255,255,255,0)"),x=n.fromCssColorString("rgba(66,67,68,0.3)"),b=n.fromCssColorString("rgba(0,0,0,0.5)"),T=new n,A=function(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var r=this;this._clickFunction=function(){var e=r._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]};A.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;i>t;t++)e[t].dispose();r(this)},A.prototype.isDestroyed=function(){return!1},A.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return this.svgElement.setAttribute("class","cesium-animation-buttonDisabled"),void 0;if(this._toggled)return this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"),void 0;this.svgElement.setAttribute("class","cesium-animation-rectButton")}},A.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},A.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};var P=function(e,t){e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var i=document.createElement("div");i.className="cesium-animation-theme",i.innerHTML='
',this._theme=i,this._themeNormal=i.childNodes[0],this._themeHover=i.childNodes[1],this._themeSelect=i.childNodes[2],this._themeDisabled=i.childNodes[3],this._themeKnob=i.childNodes[4],this._themePointer=i.childNodes[5],this._themeSwoosh=i.childNodes[6],this._themeSwooshHover=i.childNodes[7];var n=document.createElementNS(v,"svg:svg");this._svgNode=n,n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",g);var s=document.createElementNS(v,"g");this._topG=s,this._realtimeSVG=new A(m(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new A(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new A(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new A(d(84,99,"#animation_pathPause"),t.pauseViewModel);var h=document.createElementNS(v,"g");h.appendChild(this._realtimeSVG.svgElement),h.appendChild(this._playReverseSVG.svgElement),h.appendChild(this._playForwardSVG.svgElement),h.appendChild(this._pauseSVG.svgElement);var f=l({tagName:"circle","class":"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=f;var _=l({tagName:"g","class":"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=_,this._shuttleRingPointer=l({tagName:"use","class":"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var y=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle","class":"cesium-animation-knobOuter",cx:0,cy:0,r:71});var C=61,S=l({tagName:"circle","class":"cesium-animation-knobInner",cx:0,cy:0,r:C});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var w=l({tagName:"circle","class":"cesium-animation-blank",cx:0,cy:0,r:C}),E=document.createElementNS(v,"g");E.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(i),s.appendChild(E),s.appendChild(y),s.appendChild(h),E.appendChild(f),E.appendChild(_),E.appendChild(this._shuttleRingPointer),y.appendChild(this._knobOuter),y.appendChild(S),y.appendChild(this._knobDate),y.appendChild(this._knobTime),y.appendChild(this._knobStatus),y.appendChild(w),n.appendChild(s),e.appendChild(n);var x=this,b=function(e){p(x,e)};this._mouseCallback=b,f.addEventListener("mousedown",b,!0),f.addEventListener("touchstart",b,!0),_.addEventListener("mousedown",b,!0),_.addEventListener("touchstart",b,!0),document.addEventListener("mousemove",b,!0),document.addEventListener("touchmove",b,!0),document.addEventListener("mouseup",b,!0),document.addEventListener("touchend",b,!0),this._shuttleRingPointer.addEventListener("mousedown",b,!0),this._shuttleRingPointer.addEventListener("touchstart",b,!0),this._knobOuter.addEventListener("mousedown",b,!0),this._knobOuter.addEventListener("touchstart",b,!0);var T,P=this._knobTime.childNodes[0],D=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){T!==e&&(T=e,T?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){D.textContent!==e&&(D.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()};return t(P.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;n>i;i++)t[i].dispose();return r(this)},P.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var r=this._svgNode,i=200,n=132,o=e,a=t;0===e&&0===t?(o=i,a=n):0===e?(a=t,o=i*(t/n)):0===t&&(o=e,a=n*(e/i));var s=o/i,l=a/n;r.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",r.setAttribute("width",o),r.setAttribute("height",a),r.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},P.prototype.applyThemeChanges=function(){var t=s(this._themeNormal),r=s(this._themeHover),i=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(t,_)},{tagName:"stop",offset:"12%","stop-color":h(t,y)},{tagName:"stop",offset:"46%","stop-color":h(t,C)},{tagName:"stop",offset:"81%","stop-color":h(t,S)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,_)},{tagName:"stop",offset:"12%","stop-color":h(r,y)},{tagName:"stop",offset:"46%","stop-color":h(r,C)},{tagName:"stop",offset:"81%","stop-color":h(r,S)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,_)},{tagName:"stop",offset:"12%","stop-color":h(i,y)},{tagName:"stop",offset:"46%","stop-color":h(i,C)},{tagName:"stop",offset:"81%","stop-color":h(i,S)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,w)},{tagName:"stop",offset:"75%","stop-color":h(n,E)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,"in":"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,b)},{tagName:"stop",offset:"100%","stop-color":h(a,b)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,_)},{tagName:"stop",offset:"60%","stop-color":h(o,x)},{tagName:"stop",offset:"85%","stop-color":h(o,y)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,x)},{tagName:"stop",offset:"60%","stop-color":h(o,_)},{tagName:"stop",offset:"85%","stop-color":h(o,S)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]}); +e(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},P}),r("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,r,i,n,o){"use strict";var a=function(t,i){function a(){var e,r={args:arguments,cancel:!1};return s.raiseEvent(r),r.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}i=e(i,!0);var s=new n,l=new n;return a.canExecute=i,o.track(a,["canExecute"]),r(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a};return a}),r("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";var o=function(t,r){this._command=t,r=e(r,e.EMPTY_OBJECT),this.toggled=e(r.toggled,!1),this.tooltip=e(r.tooltip,""),n.track(this,["toggled","tooltip"])};return r(o.prototype,{command:{get:function(){return this._command}}}),o}),r("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockStep","../../Core/ClockRange","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../createCommand","../ToggleButtonViewModel","../../ThirdParty/sprintf","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e.clockStep===t.SYSTEM_CLOCK&&(e.clockStep=t.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=1)}function h(e){c(e),e.shouldAnimate=!0}function d(e,t){return e-t}function m(t,r){var i=e(r,t,d);return 0>i?~i:i}function p(e,t){if(Math.abs(e)<=g)return e/g;var r,i,n=g,o=_,a=0;return e>0?(r=Math.log(t[t.length-1]),i=(r-a)/(o-n),Math.exp(a+i*(e-n))):(r=Math.log(-t[0]),i=(r-a)/(o-n),-Math.exp(a+i*(Math.abs(e)-n)))}function f(e,r,i){if(i.clockStep===t.SYSTEM_CLOCK)return g;if(Math.abs(e)<=1)return e*g;var n,o,a=g,s=_,l=0;return e>0?(n=Math.log(r[r.length-1]),o=(n-l)/(s-a),(Math.log(e)-l)/o+a):(n=Math.log(-r[0]),o=(n-l)/(s-a),-((Math.log(Math.abs(e))-l)/o+a))}var v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=15,_=105,y=function(e){var i=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=y.defaultDateFormatter,this._timeFormatter=y.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,u.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(y.defaultTicks),this.timeLabel=void 0,u.defineProperty(this,"timeLabel",function(){return i._timeFormatter(i._clockViewModel.currentTime,i)}),this.dateLabel=void 0,u.defineProperty(this,"dateLabel",function(){return i._dateFormatter(i._clockViewModel.currentTime,i)}),this.multiplierLabel=void 0,u.defineProperty(this,"multiplierLabel",function(){var e=i._clockViewModel;if(e.clockStep===t.SYSTEM_CLOCK)return"Today";var r=e.multiplier;return 0===r%1?r.toFixed(0)+"x":r.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,u.defineProperty(this,"shuttleRingAngle",{get:function(){return f(e.multiplier,i._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,_),-_);var r=i._allShuttleRingTicks,n=i._clockViewModel;if(n.clockStep=t.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===_)return n.multiplier=e>0?r[r.length-1]:r[0],void 0;var o=p(e,r);if(i.snapToTicks)o=r[m(o,r)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=0|Math.round(o/l)*l}else a>g?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,u.defineProperty(this,"_canAnimate",function(){var e=i._clockViewModel,t=e.clockRange;if(i.shuttleRingDragging||t===r.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,a=e.startTime,s=!1;if(t===r.LOOP_STOP)s=o.greaterThan(a)||o.equals(a)&&n>0;else{var l=e.stopTime;s=o.greaterThan(a)&&o.lessThan(l)||o.equals(a)&&n>0||o.equals(l)&&0>n}return s||(e.shouldAnimate=!1),s}),this._isSystemTimeAvailable=void 0,u.defineProperty(this,"_isSystemTimeAvailable",function(){var e=i._clockViewModel,t=e.clockRange;if(t===r.UNBOUNDED)return!0;var n=e.systemTime;return n.greaterThanOrEquals(e.startTime)&&n.lessThanOrEquals(e.stopTime)}),this._isAnimating=void 0,u.defineProperty(this,"_isAnimating",function(){return i._clockViewModel.shouldAnimate&&(i._canAnimate||i.shuttleRingDragging)});var n=a(function(){var e=i._clockViewModel;e.shouldAnimate?(c(e),e.shouldAnimate=!1):i._canAnimate&&h(e)});this._pauseViewModel=new s(n,{toggled:u.computed(function(){return!i._isAnimating}),tooltip:"Pause"});var o=a(function(){var e=i._clockViewModel;c(e);var t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new s(o,{toggled:u.computed(function(){return i._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=a(function(){var e=i._clockViewModel;c(e);var t=e.multiplier;0>t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new s(l,{toggled:u.computed(function(){return i._isAnimating&&e.multiplier>0&&e.clockStep!==t.SYSTEM_CLOCK}),tooltip:"Play Forward"});var d=a(function(){var e=i._clockViewModel;e.clockStep=t.SYSTEM_CLOCK,e.multiplier=1,e.shouldAnimate=!0},u.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new s(d,{toggled:u.computed(function(){return e.shouldAnimate&&e.clockStep===t.SYSTEM_CLOCK}),tooltip:u.computed(function(){return i._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=a(function(){var e=i._clockViewModel;c(e);var t=i._allShuttleRingTicks,r=e.multiplier,n=m(r,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=a(function(){var e=i._clockViewModel;c(e);var t=i._allShuttleRingTicks,r=e.multiplier,n=m(r,t)+1;nt;++t)i=e[t],n.hasOwnProperty(i)||(n[i]=!0,o.push(i));o.sort(d);var a=[];for(r=o.length,t=r-1;t>=0;--t)i=o[t],0!==i&&a.push(-i);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(y.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),y._maxShuttleRingAngle=_,y._realtimeShuttleRingAngle=g,y}),r("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/isArray","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o){"use strict";var a=function(t,a){if(e(a)){if(!i(a))throw new r("imageryProviderViewModels must be an array")}else a=[];var s=this;this._imageryLayers=t,this.imageryProviderViewModels=a.slice(0),this.dropDownVisible=!1,o.track(this,["imageryProviderViewModels","dropDownVisible"]),this.selectedName=void 0,o.defineProperty(this,"selectedName",function(){var t=s.selectedItem;return e(t)?t.name:void 0}),this.selectedIconUrl=void 0,o.defineProperty(this,"selectedIconUrl",function(){var t=s.selectedItem;return e(t)?t.iconUrl:void 0}),this.selectedItem=void 0;var l=o.observable();this._currentProviders=[],o.defineProperty(this,"selectedItem",{get:function(){return l()},set:function(r){var n,o=s._currentProviders,a=o.length;for(n=0;a>n;n++)for(var u=t.length,c=0;u>c;c++){var h=t.get(c);if(h.getImageryProvider()===o[n]){t.remove(h);break}}if(e(r)){var d=r.creationCommand();if(i(d)){var m=d.length;for(n=m-1;n>=0;n--)t.addImageryProvider(d[n],0);s._currentProviders=d.slice(0)}else s._currentProviders=[d],t.addImageryProvider(d,0);l(r)}s.dropDownVisible=!1}}),this._toggleDropDown=n(function(){s.dropDownVisible=!s.dropDownVisible})};return t(a.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},imageryLayers:{get:function(){return this._imageryLayers}}}),a}),r("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./BaseLayerPickerViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,t,r){e=n(e);var i=new o(t,r),s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button",s.setAttribute("data-bind","attr: { title: selectedName },click: toggleDropDown"),e.appendChild(s);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: selectedIconUrl }"),s.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-visible" : dropDownVisible, "cesium-baseLayerPicker-hidden" : !dropDownVisible },foreach: imageryProviderViewModels'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-item",c.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedItem },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedItem = $data; }'),u.appendChild(c);var h=document.createElement("img");h.className="cesium-baseLayerPicker-itemIcon",h.setAttribute("data-bind","attr: { src: iconUrl }"),h.setAttribute("draggable","false"),c.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-itemLabel",d.setAttribute("data-bind","text: name"),c.appendChild(d),a.applyBindings(i,s),a.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=s,this._choices=u,this._closeDropDown=function(e){s.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1)},document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0)};return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0),a.cleanNode(this._element),a.cleanNode(this._choices),this._container.removeChild(this._element),this._container.removeChild(this._choices),r(this)},s}),r("Widgets/BaseLayerPicker/ImageryProviderViewModel",["../../Core/defineProperties","../../Core/defined","../../Core/DeveloperError","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";var o=function(e){var r=e.creationFunction;t(r.canExecute)||(r=i(r)),this._creationCommand=r,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,n.track(this,["name","tooltip","iconUrl"])};return e(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),r("Widgets/BaseLayerPicker/createDefaultBaseLayers",["../BaseLayerPicker/ImageryProviderViewModel","../../Core/buildModuleUrl","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/ArcGisMapServerImageryProvider","../../Scene/OpenStreetMapImageryProvider","../../Scene/TileMapServiceImageryProvider"],function(e,t,r,i,n,o,a){"use strict";function s(){var s=[];return s.push(new e({name:"Bing Maps Aerial",iconUrl:t("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"//dev.virtualearth.net",mapStyle:i.AERIAL})}})),s.push(new e({name:"Bing Maps Aerial with Labels",iconUrl:t("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"//dev.virtualearth.net",mapStyle:i.AERIAL_WITH_LABELS})}})),s.push(new e({name:"Bing Maps Roads",iconUrl:t("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"//dev.virtualearth.net",mapStyle:i.ROAD})}})),s.push(new e({name:"ESRI World Imagery",iconUrl:t("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new n({url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"})}})),s.push(new e({name:"ESRI World Street Map",iconUrl:t("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new n({url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"})}})),s.push(new e({name:"ESRI National Geographic",iconUrl:t("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new n({url:"http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/"})}})),s.push(new e({name:"Open­Street­Map",iconUrl:t("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return new o({url:"http://tile.openstreetmap.org/"})}})),s.push(new e({name:"Stamen Watercolor",iconUrl:t("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return new o({url:"http://tile.stamen.com/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),s.push(new e({name:"Stamen Toner",iconUrl:t("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return new o({url:"http://tile.stamen.com/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),s.push(new e({name:"MapQuest Open­Street­Map",iconUrl:t("Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return new o({url:"http://otile1.mqcdn.com/tiles/1.0.0/osm/"})}})),s.push(new e({name:"The Black Marble",iconUrl:t("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return new a({url:"http://cesiumjs.org/blackmarble",maximumLevel:8,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),s.push(new e({name:"Natural Earth II",iconUrl:t("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return new a({url:t("Assets/Textures/NaturalEarthII")})}})),s}return s}),r("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){var r;if(t(e)){r="Command Statistics";var i=e.commandsInFrustums;for(var n in i)if(i.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}r+="
    "+i[n]+" in frustum "+o}r+="
Total: "+e.totalCommands}return r}var c=new e(.15,.15,.15,.75),h=document.createElement("div");h.className="cesium-cesiumInspector-performanceDisplay";var d=function(e){if(!t(e))throw new i("scene is required");var r=this,u=e.canvas;u.parentNode.appendChild(h),this._scene=e,this._canvas=u,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0;var d=this._scene.primitives.centralBody;d.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText="",this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.generalSwitchText="-",this.primitivesSwitchText="+",this.terrainSwitchText="+",l.track(this,["filterTile","suspendUpdates","dropDownVisible","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText"]),this._toggleDropDown=s(function(){r.dropDownVisible=!r.dropDownVisible}),this._toggleGeneral=s(function(){r.generalVisible=!r.generalVisible,r.generalSwitchText=r.generalVisible?"-":"+"}),this._togglePrimitives=s(function(){r.primitivesVisible=!r.primitivesVisible,r.primitivesSwitchText=r.primitivesVisible?"-":"+"}),this._toggleTerrain=s(function(){r.terrainVisible=!r.terrainVisible,r.terrainSwitchText=r.terrainVisible?"-":"+"}),this._showFrustums=s(function(){return r._scene.debugShowFrustums=r.frustums?!0:!1,!0}),this._showPerformance=s(function(){return r.performance?r._performanceDisplay=new o({container:h,backgroundColor:c,font:"12px arial,sans-serif"}):h.innerHTML="",!0}),this._showPrimitiveBoundingSphere=s(function(){return r._primitive.debugShowBoundingVolume=r.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=s(function(){if(r.primitiveReferenceFrame){var e=r._primitive.modelMatrix;r._modelMatrixPrimitive=new n({modelMatrix:e}),r._scene.primitives.add(r._modelMatrixPrimitive)}else t(r._modelMatrixPrimitive)&&(r._scene.primitives.remove(r._modelMatrixPrimitive),r._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=s(function(){return r._scene.debugCommandFilter=r.filterPrimitive?function(e){return t(r._modelMatrixPrimitive)&&e.owner===r._modelMatrixPrimitive._primitive?!0:t(r._primitive)?e.owner===r._primitive||e.owner===r._primitive._billboardCollection:!1}:void 0,!0}),this._showWireframe=s(function(){return d._surface._debug.wireframe=r.wireframe,!0}),this._doSuspendUpdates=s(function(){return d._surface._debug.suspendLodUpdate=r.suspendUpdates,r.suspendUpdates||(r.filterTile=!1),!0});var m;this._showTileCoordinates=s(function(){return r.tileCoordinates&&!t(m)?m=d.imageryLayers.addImageryProvider(new a({tilingScheme:d.terrainProvider.tilingScheme})):!r.tileCoordinates&&t(m)&&(d.imageryLayers.remove(m),m=void 0),!0}),this._showTileBoundingSphere=s(function(){return d._surface._debug.boundingSphereTile=r.tileBoundingSphere?r._tile:void 0,!0}),this._doFilterTile=s(function(){if(r.filterTile){if(r.suspendUpdates=!0,r.doSuspendUpdates(),d._surface._tilesToRenderByTextureCount=[],t(r._tile)){for(var e=0,i=r._tile.imagery,n=0,o=i.length;o>n;++n){var a=i[n];t(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++e}d._surface._tilesToRenderByTextureCount[e]=[r._tile],d._surface._tileLoadQueue.push(r._tile)}}else r.suspendUpdates=!1,r.doSuspendUpdates();return!0});var p=function(e){r._canvas.removeEventListener("mousedown",p,!1),r.pickPrimitiveActive=!1;var i=r._scene.pick({x:e.clientX,y:e.clientY});t(i)&&(r.primitive=t(i.collection)?i.collection:i.primitive)};this._pickPrimitive=s(function(){r.pickPrimitiveActive=!r.pickPrimitiveActive,r.pickPrimitiveActive?r._canvas.addEventListener("mousedown",p,!1):r._canvas.removeEventListener("mousedown",p,!1)});var f=function(e){var i,n=d.ellipsoid,o=r._scene.camera.controller.pickEllipsoid({x:e.clientX,y:e.clientY},n);if(t(o))for(var a=n.cartesianToCartographic(o),s=d._surface._tilesToRenderByTextureCount,l=0;!i&&l0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(r.key),this._scene=r.scene,this._ellipsoid=t(r.ellipsoid,o.WGS84),this._flightDuration=t(r.flightDuration,1500),this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0;var i=this;this._searchCommand=d(function(){i.isSearchInProgress?v(i):f(i)}),m.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,m.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,m.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,m.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})};i(g.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},search:{get:function(){return this._searchCommand}}});var _=new l(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return g}),r("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./GeocoderViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",l="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z",u=function(e){var t=n(e.container),r=new o(e);r._startSearchPath=s,r._stopSearchPath=l;var i=document.createElement("form");i.setAttribute("data-bind","submit: search");var u=document.createElement("input");u.type="search",u.className="cesium-geocoder-input",u.setAttribute("placeholder","Enter an address or landmark..."),u.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",css: { "cesium-geocoder-input-wide" : searchText.length > 0 }'),i.appendChild(u);var c=document.createElement("span");c.className="cesium-geocoder-searchButton",c.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(c),t.appendChild(i),a.applyBindings(r,i),this._container=t,this._viewModel=r,this._form=i,this._onInputBegin=function(e){t.contains(e.target)||u.blur()},this._onInputEnd=function(e){t.contains(e.target)&&u.focus()},document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0)};return t(u.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0),a.cleanNode(this._form),this._container.removeChild(this._form),r(this)},u}),r("Widgets/HomeButton/HomeButtonViewModel",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/Extent","../../Core/Matrix4","../../Scene/Camera","../../Scene/CameraColumbusViewMode","../../Scene/CameraFlightPath","../../Scene/SceneMode","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(t,i,n,o){var d=t.mode,m=t.screenSpaceCameraController;m.ellipsoid=i,m.columbusViewMode=u.FREE;var p=t.context;r(n)&&d===h.MORPHING&&n.completeMorph();var f,v;if(d===h.SCENE2D)v={destination:a.MAX_VALUE,duration:o,endReferenceFrame:new s(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1)},f=c.createAnimationExtent(t,v),t.animations.add(f);else if(d===h.SCENE3D){var g=new l(p);v={destination:g.position,duration:o,up:g.up,direction:g.direction,endReferenceFrame:s.IDENTITY},f=c.createAnimation(t,v),t.animations.add(f)}else if(d===h.COLUMBUS_VIEW){var _=i.maximumRadius,y=e.multiplyByScalar(e.normalize(new e(0,-1,1)),5*_),C=e.normalize(e.subtract(e.ZERO,y)),S=e.cross(C,e.UNIT_Z),w=e.cross(S,C);v={destination:y,duration:o,up:w,direction:C,endReferenceFrame:new s(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1)},f=c.createAnimation(t,v),t.animations.add(f)}}var f=function(e,r,i,n){i=t(i,o.WGS84),n=t(n,1500),this._scene=e,this._ellipsoid=i,this._transitioner=r,this._flightDuration=n;var a=this;this._command=d(function(){p(a._scene,a._ellipsoid,a._transitioner,a._flightDuration)}),this.tooltip="View Home",m.track(this,["tooltip"])};return i(f.prototype,{sceneTransitioner:{get:function(){return this._transitioner}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},command:{get:function(){return this._command}},flightDuration:{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}}}),f}),r("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./HomeButtonViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,t,r,i,s){e=n(e);var l=new o(t,r,i,s);l._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var u=document.createElement("button");u.type="button",u.className="cesium-button cesium-toolbar-button cesium-home-button",u.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(u),a.applyBindings(l,u),this._container=e,this._viewModel=l,this._element=u};return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return a.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),r("Widgets/InfoBox/InfoBoxViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/Event","../../Core/formatError","../../Core/TaskProcessor","../../ThirdParty/knockout","../../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){return r(c)||(c=new a("sanitizeHtml",1/0)),c.scheduleTask(e)}new e;var c,h="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",d="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z",m=function(){this._sanitizer=void 0,this._descriptionRawHtml="",this._descriptionSanitizedHtml="",this._cameraClicked=new n,this._closeClicked=new n,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",s.track(this,["showInfo","titleText","_descriptionRawHtml","_descriptionSanitizedHtml","maxHeight","enableCamera","isCameraTracking"]),this.descriptionRawHtml=void 0,s.defineProperty(this,"descriptionRawHtml",{get:function(){return this._descriptionRawHtml},set:function(e){if(this._descriptionRawHtml!==e){this._descriptionRawHtml=e,this._descriptionSanitizedHtml="";var t=this;l(this.sanitizer(e),function(r){t._descriptionRawHtml===e&&(t._descriptionSanitizedHtml=r)}).otherwise(function(e){console.log("An error occurred while sanitizing HTML: "+o(e))})}}}),this.descriptionSanitizedHtml=void 0,s.defineProperty(this,"descriptionSanitizedHtml",{get:function(){return this._descriptionSanitizedHtml +}}),this.cameraIconPath=void 0,s.defineProperty(this,"cameraIconPath",{get:function(){return this.enableCamera||this.isCameraTracking?h:d}}),m.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},s.defineProperty(this,"_bodyless",{get:function(){return!this._descriptionSanitizedHtml}})};return m.defaultSanitizer=u,i(m.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}},sanitizer:{get:function(){return t(this._sanitizer,m.defaultSanitizer)},set:function(e){this._sanitizer=e;var t=this._descriptionRawHtml;this._descriptionRawHtml="",this.descriptionRawHtml=t}}}),m}),r("Widgets/InfoBox/InfoBox",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/destroyObject","../getElement","./InfoBoxViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){e=n(e),this._container=e;var t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t),this._element=t;var r=document.createElement("div");r.className="cesium-infoBox-title",r.setAttribute("data-bind","text: titleText"),t.appendChild(r);var i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);var s=document.createElement("button");s.type="button",s.className="cesium-infoBox-close",s.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(); }"),s.innerHTML="×",t.appendChild(s);var l=document.createElement("div");l.className="cesium-infoBox-body",t.appendChild(l);var u=document.createElement("div");u.className="cesium-infoBox-description",u.setAttribute("data-bind","html: descriptionSanitizedHtml,style : { maxHeight : maxHeightOffset(40) }"),l.appendChild(u);var c=new o;this._viewModel=c,a.applyBindings(this._viewModel,t)};return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),r("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defineProperties","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e){this._transitioner=e;var t=this,r=function(e,r,i){t.sceneMode=i,t.dropDownVisible=!1};this._eventHelper=new n,this._eventHelper.add(e.transitionStart,r),this.sceneMode=e.scene.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=t.sceneMode;return e===o.SCENE2D?t.tooltip2D:e===o.SCENE3D?t.tooltip3D:t.tooltipColumbusView}),this._toggleDropDown=a(function(){t.dropDownVisible=!t.dropDownVisible}),this._morphTo2D=a(function(){e.morphTo2D()}),this._morphTo3D=a(function(){e.morphTo3D()}),this._morphToColumbusView=a(function(){e.morphToColumbusView()}),this._sceneMode=o};return e(l.prototype,{sceneTransitioner:{get:function(){return this._transitioner}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},l}),r("Widgets/SceneModePicker/SceneModePicker",["../../Core/defineProperties","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./SceneModePickerViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",l="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",u="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z",c=function(e,t){e=n(e);var r=new o(t);r._globePath=s,r._flatMapPath=l,r._columbusViewPath=u;var i=document.createElement("span");i.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(i);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),c.innerHTML='',i.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",h.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),i.appendChild(h);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),i.appendChild(d);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),i.appendChild(m),a.applyBindings(r,i),this._viewModel=r,this._container=e,this._wrapper=i,this._closeDropDown=function(e){i.contains(e.target)||(r.dropDownVisible=!1)},document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0)};return e(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._viewModel.destroy(),document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0),a.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),r(this)},c}),r("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Scene/SceneTransforms","../../ThirdParty/knockout","../../ThirdParty/Tween"],function(e,t,r,i,n,o,a,s){"use strict";var l=new e,u=function(e,i,n){this._scene=e,this._screenPositionX="-1000px",this._screenPositionY="0",this._animationCollection=e.animations,this._container=t(n,document.body),this._selectionIndicatorElement=i,this._computeScreenSpacePosition=function(t,r){return o.wgs84ToWindowCoordinates(e,t,r)},this._scale=1,this.position=void 0,this.showSelection=!1,a.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,a.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&r(this.position)}}),a.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}})};return u.prototype.update=function(){if(this.showSelection&&r(this.position)){var e=this._computeScreenSpacePosition(this.position,l),t=this._container,i=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,0),i)-a,e.y=Math.min(Math.max(e.y,0),n)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}},u.prototype.animateAppear=function(){var e=this;this._animationCollection.add({startValue:{scale:2},stopValue:{scale:1},duration:800,easingFunction:s.Easing.Exponential.Out,onUpdate:function(t){e._scale=t.scale}})},u.prototype.animateDepart=function(){var e=this;this._animationCollection.add({startValue:{scale:e._scale},stopValue:{scale:1.5},duration:800,easingFunction:s.Easing.Exponential.Out,onUpdate:function(t){e._scale=t.scale}})},i(u.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}},computeScreenSpacePosition:{get:function(){return this._computeScreenSpacePosition},set:function(e){this._computeScreenSpacePosition=e}}}),u}),r("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/destroyObject","../getElement","./SelectionIndicatorViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,t){e=n(e),this._container=e;var r=document.createElement("div");r.className="cesium-selection-wrapper",r.setAttribute("data-bind",'style: { "bottom" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(r),this._element=r;var i="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(i,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(i,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(i,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),r.appendChild(l);var h=new o(t,this._element,this._container);this._viewModel=h,a.applyBindings(this._viewModel,this._element)};return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),r("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined"],function(e,t){"use strict";function r(t,r,i,n){this.interval=t,this.height=r,this.color=i||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var i=this.interval.start,n=this.interval.stop,o=r.startJulian,a=r.startJulian.addSeconds(r.duration);if(i.lessThan(o)&&n.greaterThan(a))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(a)&&n.greaterThanOrEquals(o)){var s,l,u;for(s=0;si&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t='')}return e.y+=this._height,t},e}),r("Widgets/Timeline/Timeline",["../../Core/DeveloperError","../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/JulianDate","../getElement","./TimelineTrack","./TimelineHighlightRange"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var r=document.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=_.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='
',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=m(this),this._onTouchStart=p(this),this._onTouchMove=v(this),this._onTouchEnd=f(this);var i=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),i.addEventListener("mousedown",this._onMouseDown,!1),i.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),i.addEventListener("mousewheel",this._onMouseWheel,!1),i.addEventListener("touchstart",this._onTouchStart,!1),i.addEventListener("touchmove",this._onTouchMove,!1),i.addEventListener("touchend",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return 10>e?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==_.touchOnly&&(0===t.button?(e._mouseMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,e._mouseMode=2===t.button?_.zoom:_.slide)),t.preventDefault()}}function h(e){return function(){e._mouseMode=_.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0px 0px"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var r;if(e._mouseMode===_.scrub){t.preventDefault();var i=t.clientX-e._topDiv.getBoundingClientRect().left;0>i?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===_.slide){if(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r){var n=r*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(e._startJulian.addSeconds(n),e._endJulian.addSeconds(n))}}else e._mouseMode===_.zoom&&(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r&&e.zoomFrom(Math.pow(1.01,r)))}}function m(e){return function(t){var r=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(r),g),1),r/=g,e.zoomFrom(Math.pow(1.05,-r))}}function p(e){return function(t){var r,i,n=t.touches.length,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=_.touchOnly,1===n?(r=e._startJulian.getSecondsDifference(e._scrubJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-i)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===n?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):2===n?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function f(e){return function(t){var r=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._handleTouchMove(t)):e._touchMode===y.scrub&&e._handleTouchMove(t),e._mouseMode=_.touchOnly,1!==r?e._touchMode=r>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function v(e){return function(t){var i,n,o,a,s,l,u=1,c=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=_.touchOnly,e._touchMode===y.scrub?(t.preventDefault(),1===t.changedTouches.length&&(n=t.changedTouches[0].clientX-c,n>=0&&n<=e._topDiv.clientWidth&&e._setTimeBarTime(n,n*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(o=t.touches.length,2===o?(a=.5*(t.touches[0].clientX+t.touches[1].clientX)-c,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):1===o&&(a=t.touches[0].clientX-c,s=0),r(a)&&(s>0&&e._touchState.spanX>0?(u=e._touchState.spanX/s,l=e._startJulian.addSeconds((e._touchState.centerX*e._timeBarSecondsSpan-a*e._timeBarSecondsSpan*u)/e._topDiv.clientWidth)):(i=e._touchState.centerX-a,l=e._startJulian.addSeconds(i*e._timeBarSecondsSpan/e._topDiv.clientWidth)),e.zoomTo(l,l.addSeconds(e._timeBarSecondsSpan*u)),e._touchState.centerX=a,e._touchState.spanX=s))}}var g=1e12,_={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,r){this._topDiv.addEventListener(e,t,r)},l.prototype.removeEventListener=function(e,t,r){this._topDiv.removeEventListener(e,t,r)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t){var r=new s(e,t);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,r,i){var n=new a(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(e,r){if(this._timeBarSecondsSpan=e.getSecondsDifference(r),this._startJulian=e,this._endJulian=r,this._clock&&this._clock.clockRange!==t.UNBOUNDED){var i=this._clock.startTime,n=this._clock.stopTime,o=i.getSecondsDifference(n),a=this._startJulian.getSecondsDifference(i),s=this._endJulian.getSecondsDifference(n);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):a>0?(this._endJulian=this._endJulian.addSeconds(a),this._startJulian=i,this._timeBarSecondsSpan=this._startJulian.getSecondsDifference(this._endJulian)):0>s&&(this._startJulian=this._startJulian.addSeconds(s),this._endJulian=n,this._timeBarSecondsSpan=this._startJulian.getSecondsDifference(this._endJulian))}this._makeTics();var l=document.createEvent("Event");l.initEvent("setzoom",!0,!0),l.startJulian=this._startJulian,l.endJulian=this._endJulian,l.epochJulian=this._epochJulian,l.totalSpan=this._timeBarSecondsSpan,l.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(l)},l.prototype.zoomFrom=function(e){var t=this._startJulian.getSecondsDifference(this._scrubJulian);e>1||0>t||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var r=this._timeBarSecondsSpan-t;this.zoomTo(this._startJulian.addSeconds(t-t*e),this._endJulian.addSeconds(r*e-r))},l.prototype.makeLabel=function(e){var t=e.toGregorianDate(),r=t.millisecond,i=" UTC";if(r>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(r).toString();i.length<3;)i="0"+i;i="."+i}return S[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+i},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(w/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-w)/v}function i(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=this._startJulian.getSecondsDifference(this._scrubJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,m=31536e6,p=1e-10,f=0,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=this._startJulian.addSeconds(d)):v>m&&(v=m,this._timeBarSecondsSpan=m,this._endJulian=this._startJulian.addSeconds(m));var g=this._timeBarEle.clientWidth;10>g&&(g=10);var _,y=this._startJulian,S=Math.min(1e-5*(v/g),.4);_=v>31536e4?n.fromIso8601(y.toDate().toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(y.toDate().toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(y.toDate().toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(y.toDate().toISOString().substring(0,10)+"T00:00:00Z");var w=_.addSeconds(S).getSecondsDifference(this._startJulian),E=w+v;this._epochJulian=_,this._rulerEle.innerHTML=this.makeLabel(this._endJulian.addSeconds(-d));var x=this._rulerEle.offsetWidth+20,b=f;f-=p;var T={y:0,startTime:w,startJulian:y,epochJulian:_,duration:v,timeBarWidth:g,getAlpha:r};this._highlightRanges.forEach(function(e){h+=e.render(T)});var A=0,P=0,D=0,M=x/g;M>1&&(M=1),M*=this._timeBarSecondsSpan;var I,O=-1,R=-1,L=C.length;for(I=0;L>I;++I){var N=C[I];if(++O,A=N,N>M&&N>f)break;0>R&&g*(N/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=O)}if(O>0){for(;O>0;)if(--O,Math.abs(i(A,C[O]))<1e-5){C[O]>=f&&(P=C[O]);break}if(R>=0)for(;O>R;){if(Math.abs(i(P,C[R]))<1e-5&&C[R]>=f){D=C[R];break}++R}}f=b,f>p&&1e-5>D&&Math.abs(f-A)>p&&(D=f,A+p>=f&&(P=0)); +var B,z=-999999;if(g*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);E>=o;o=t(o,D))h+='';if(g*(P/this._timeBarSecondsSpan)>=3)for(o=e(P);E>=o;o=t(o,P))h+='';if(g*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,E+=A,o=e(A);for(var F=_.getTaiMinusUtc();E>=o;){var V=y.addSeconds(o-w);if(A>2.1){var k=V.getTaiMinusUtc();Math.abs(k-F)>.1&&(o+=k-F,V=y.addSeconds(o-w))}var U=Math.round(g*r(o)),W=this.makeLabel(V);this._rulerEle.innerHTML=W,B=this._rulerEle.offsetWidth;var G=U-(B/2-1);G>z?(z=G+B+5,h+=''+''+W+""):h+='',o=t(o,A)}}else this._mainTicSpan=-1;h+='',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),T.y=0,this._trackList.forEach(function(e){e.render(c._context,T),T.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(r(this._scrubElement)){var t=this._startJulian.getSecondsDifference(this._scrubJulian),i=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}r(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(this._startJulian.addSeconds(this._timelineDrag),this._endJulian.addSeconds(this._timelineDrag)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=this._startJulian.addSeconds(t),this._scrubElement){var r=e-8;this._scrubElement.style.left=r.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var r=1;this._trackList.forEach(function(e){r+=e.height}),this._trackListEle.style.height=r.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=r,this._makeTics(),this._lastWidth=e,this._lastHeight=t}},l}),r("Widgets/Viewer/Viewer",["../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/destroyObject","../../Core/Event","../../Core/EventHelper","../../Core/formatError","../../Core/requestAnimationFrame","../../DynamicScene/DataSourceCollection","../../DynamicScene/DataSourceDisplay","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultBaseLayers","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T){"use strict";function A(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function P(e){function t(){if(!e.isDestroyed())try{e._useDefaultRenderLoop?(e.resize(),e.render(),l(t)):e._renderLoopRunning=!1}catch(r){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._renderLoopError.raiseEvent(e,r),e._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.",n=s(r);e.cesiumWidget.showErrorPanel(i,n),console.error(i+" "+n)}}}e._renderLoopRunning=!0,l(t)}var D=function(r,i){function n(e){if(t(e)){var r=e.getClock();t(r)&&(r.getValue(O),t(Z)&&(Z.updateFromClock(),Z.zoomTo(r.startTime,r.stopTime)))}}r=y(r),i=e(i,e.EMPTY_OBJECT);var s=!t(i.baseLayerPicker)||i.baseLayerPicker!==!1,l=document.createElement("div");l.className="cesium-viewer",r.appendChild(l);var P=document.createElement("div");P.className="cesium-viewer-cesiumWidgetContainer",l.appendChild(P);var D=new f(P,{terrainProvider:i.terrainProvider,imageryProvider:s?!1:i.imageryProvider,skyBox:i.skyBox,sceneMode:i.sceneMode,contextOptions:i.contextOptions,useDefaultRenderLoop:!1}),M=new u,I=new c(D.scene,M),O=D.clock,R=new v(O),L=new a;L.add(O.onTick,function(e){I.update(e.currentTime)});var N;if(!t(i.selectionIndicator)||i.selectionIndicator!==!1){var B=document.createElement("div");B.className="cesium-viewer-selectionIndicatorContainer",l.appendChild(B),N=new E(B,D.scene)}var z;if(!t(i.infoBox)||i.infoBox!==!1){var F=document.createElement("div");F.className="cesium-viewer-infoBoxContainer",l.appendChild(F),z=new S(F)}var V=document.createElement("div");V.className="cesium-viewer-toolbar",l.appendChild(V);var k;if(!t(i.geocoder)||i.geocoder!==!1){var U=document.createElement("div");U.className="cesium-viewer-geocoderContainer",V.appendChild(U),k=new _({container:U,scene:D.scene,ellipsoid:D.centralBody.ellipsoid})}var W;t(i.homeButton)&&i.homeButton===!1||(W=new C(V,D.scene,D.sceneTransitioner,D.centralBody.ellipsoid),t(k)&&L.add(W.viewModel.command.afterExecute,function(){var e=k.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}));var G;t(i.sceneModePicker)&&i.sceneModePicker===!1||(G=new w(V,D.sceneTransitioner));var H;if(s){var j=e(i.imageryProviderViewModels,p());H=new m(V,D.centralBody.imageryLayers,j),H.viewModel.selectedItem=e(i.selectedImageryProviderViewModel,j[0]);var q=V.getElementsByClassName("cesium-baseLayerPicker-dropDown");this._baseLayerPickerDropDown=q[0]}var Y;if(!t(i.animation)||i.animation!==!1){var X=document.createElement("div");X.className="cesium-viewer-animationContainer",l.appendChild(X),Y=new h(X,new d(R))}var Z;if(!t(i.timeline)||i.timeline!==!1){var J=document.createElement("div");J.className="cesium-viewer-timelineContainer",l.appendChild(J),Z=new b(J,O),Z.addEventListener("settime",A,!1),Z.zoomTo(O.startTime,O.stopTime)}var Q;if(t(i.fullscreenButton)&&i.fullscreenButton===!1)t(Z)&&(Z.container.style.right=0);else{var K=document.createElement("div");K.className="cesium-viewer-fullscreenContainer",l.appendChild(K),Q=new g(K,i.fullscreenElement),this._fullscreenSubscription=x(Q.viewModel,"isFullscreenEnabled",function(e){K.style.display=e?"block":"none",t(Z)&&(Z.container.style.right=K.clientWidth+"px",Z.resize())})}this.clockTrackedDataSource=void 0,T.track(this,["clockTrackedDataSource"]),this._dataSourceChangedListeners={},this._knockoutSubscriptions=[];var $=e(i.automaticallyTrackDataSourceClocks,!0),et=this;this._knockoutSubscriptions.push(x(this,"clockTrackedDataSource",function(e){n(e)}));var tt=function(e){et.clockTrackedDataSource===e&&n(e)},rt=function(e,t){$&&(et.clockTrackedDataSource=t);var r=t.getDynamicObjectCollection().id,i=L.add(t.getChangedEvent(),tt);et._dataSourceChangedListeners[r]=i},it=function(e,t){var r=et.clockTrackedDataSource===t,i=t.getDynamicObjectCollection().id;if(et._dataSourceChangedListeners[i](),et._dataSourceChangedListeners[i]=void 0,r){var n=e.length;et.clockTrackedDataSource=$&&n>0?e.get(n-1):void 0}};L.add(M.dataSourceAdded,rt),L.add(M.dataSourceRemoved,it),this._container=r,this._element=l,this._cesiumWidget=D,this._selectionIndicator=N,this._infoBox=z,this._dataSourceCollection=M,this._dataSourceDisplay=I,this._clockViewModel=R,this._toolbar=V,this._homeButton=W,this._sceneModePicker=G,this._baseLayerPicker=H,this._animation=Y,this._timeline=Z,this._fullscreenButton=Q,this._geocoder=k,this._eventHelper=L,this._lastWidth=0,this._lastHeight=0,this._useDefaultRenderLoop=void 0,this._renderLoopRunning=!1,this._showRenderLoopErrors=e(i.showRenderLoopErrors,!0),this._renderLoopError=new o,this.useDefaultRenderLoop=e(i.useDefaultRenderLoop,!0)};return i(D.prototype,{container:{get:function(){return this._container}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},centralBody:{get:function(){return this._cesiumWidget.centralBody}},clock:{get:function(){return this._cesiumWidget.clock}},sceneTransitioner:{get:function(){return this._cesiumWidget.sceneTransitioner}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},renderLoopError:{get:function(){return this._renderLoopError}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&P(this))}}}),D.prototype.extend=function(e,t){e(this,t)},D.prototype.resize=function(){var e=this._cesiumWidget;e.resize();var r=this._container,i=r.clientWidth,n=r.clientHeight;if(i!==this._lastWidth||n!==this._lastHeight){var o=n-125,a=this._baseLayerPickerDropDown;t(a)&&(a.style.maxHeight=o+"px"),t(this._infoBox)&&(this._infoBox.viewModel.maxHeight=o);var s,l=t(this._timeline),u=t(this._animation),c=!u,h=0;if(u){var d=this._lastWidth;s=this._animation.container,i>900?900>=d&&(h=169,s.style.width="169px",s.style.height="112px",c=!0,this._animation.resize()):i>=600?(600>d||d>900)&&(h=136,s.style.width="136px",s.style.height="90px",c=!0,this._animation.resize()):(d>600||0===d)&&(h=106,s.style.width="106px",s.style.height="70px",c=!0,this._animation.resize())}if(c){var m=0,p=h+5;if(l&&(m=this._timeline.container.clientHeight+3,this._timeline.container.style.left=h+"px"),l||u){var f=e.creditContainer;f.style.bottom=m+"px",f.style.left=p+"px"}}l&&this._timeline.resize(),this._lastWidth=i,this._lastHeight=n}},D.prototype.render=function(){this._cesiumWidget.render()},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e,r=this._knockoutSubscriptions.length;for(e=0;r>e;e++)this._knockoutSubscriptions[e].dispose();return this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),t(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),t(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),t(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),t(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),t(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),t(this._timeline)&&(this._timeline.removeEventListener("settime",A,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),t(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),t(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),t(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._dataSourceCollection=this._dataSourceCollection.destroy(),n(this)},D}),r("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/requestAnimationFrame","../CesiumInspector/CesiumInspector"],function(e,t,r,i,n){"use strict";function o(e){function t(){if(!e.isDestroyed())try{e.resize(),e.render(),e.cesiumInspector.viewModel.update(),i(t)}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._renderLoopError.raiseEvent(e,r),e._showRenderLoopErrors&&(e.cesiumWidget.showErrorPanel("An error occurred while rendering. Rendering has stopped.",r),console.error(r))}}e._renderLoopRunning=!0,i(t)}var a=function(i){if(!e(i))throw new r("viewer is required.");var a=document.createElement("div");a.className="cesium-viewer-cesiumInspectorContainer",i.container.appendChild(a);var s=new n(a,i.cesiumWidget.scene);i.useDefaultRenderLoop=!1,t(i,{cesiumInspector:{get:function(){return s}}}),o(i)};return a}),r("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/Event","../../Core/wrapFunction","../../DynamicScene/CzmlDataSource","../../DynamicScene/GeoJsonDataSource","../../ThirdParty/when","../getElement"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e.stopPropagation(),e.preventDefault()}function h(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",c,!1),i.removeEventListener("dragover",c,!1),i.removeEventListener("dragexit",c,!1))}function d(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",c,!1),e.addEventListener("dragover",c,!1),e.addEventListener("dragexit",c,!1)}function m(e,t){var r=e.length,i=t.length;return r>i&&-1!==e.indexOf(t,r-i)}function p(e,t){var r,i=t.toUpperCase();if(m(i,".CZML"))r=a;else{if(!(m(i,".GEOJSON")||m(i,".JSON")||m(i,".TOPOJSON")))return e.dropError.raiseEvent(e,t,"Unrecognized file extension: "+t),void 0;r=s}return function(i){var n=new r;try{l(n.load(JSON.parse(i.target.result),t),function(){e.dataSources.add(n)},function(r){e.dropError.raiseEvent(e,t,r)})}catch(o){e.dropError.raiseEvent(e,t,o)}}}function f(e,t){return function(r){e.dropError.raiseEvent(e,t,r.target.error)}}var v=function(t,r){function a(e){c(e),m&&t.dataSources.removeAll();for(var r=e.dataTransfer.files,i=r.length,n=0;i>n;n++){var o=r[n],a=new FileReader;a.onload=p(t,o.name),a.onerror=f(t,o.name),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=new n,m=e(r.clearOnDrop,!0),v=e(r.dropTarget,t.container);v=u(v),i(t,{dropTarget:{get:function(){return v},set:function(e){h(v,a),v=e,d(v,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?d(v,a):h(v,a),s=e)}},dropError:{get:function(){return l}},clearOnDrop:{get:function(){return m},set:function(e){m=e}}}),d(v,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a};return v}),r("Widgets/Viewer/viewerDynamicObjectMixin",["../../Core/BoundingSphere","../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/EventHelper","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../DynamicScene/DynamicObject","../../Scene/SceneMode","../subscribeAndEvaluate","../../DynamicScene/DynamicObjectView","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(i){function d(){i.trackedObject=i.selectedObject}function m(){i.trackedObject=void 0}function p(){i.selectedObject=void 0}function f(){i.trackedObject=void 0,i.selectedObject=void 0}function v(n){var o=n.currentTime;r(x)&&x.update(o);var a=i.selectedObject,s=r(a)&&D;if(s){var l,u=r(P)?P.position:void 0,c=!1;a.isAvailable(o)&&(r(a.position)?(l=a.position.getValue(o,u),c=r(l)&&i.trackedObject!==i.selectedObject):r(a.vertexPositions)&&(I=a.vertexPositions.getValue(o,I),O=e.fromPoints(I,O),l=O.center)),r(P)&&(P.position=l),r(T)&&(T.enableCamera=c,T.isCameraTracking=i.trackedObject===i.selectedObject,T.descriptionRawHtml=r(a.description)?t(a.description.getValue(o),""):"")}r(P)&&(P.showSelection=s,P.update()),r(T)&&(T.showInfo=s)}function g(e){var n=i.scene.pick(e.position);if(r(n)){var o=t(n.id,n.primitive.id);if(o instanceof s)return o}}function _(e){r(e)&&r(e.position)&&(i.trackedObject=e)}function y(e){var t=g(e);r(t)&&_(t)}function C(e){i.selectedObject=g(e)}function S(e,t,r){for(var n=r.length,o=0;n>o;o++){var a=r[o];i.trackedObject===a&&i.homeButton.viewModel.command(),i.selectedObject===a&&(i.selectedObject=void 0)}}function w(e,t){var r=t.getDynamicObjectCollection();r.collectionChanged.addEventListener(S)}function E(e,t){var n=t.getDynamicObjectCollection();n.collectionChanged.removeEventListener(S),r(i.trackedObject)&&n.getById(i.trackedObject.id)===i.trackedObject&&i.homeButton.viewModel.command(),r(i.selectedObject)&&n.getById(i.selectedObject.id)===i.selectedObject&&(i.selectedObject=void 0)}var x,b=i.infoBox,T=r(b)?b.viewModel:void 0,A=i.selectionIndicator,P=r(A)?A.viewModel:void 0,D=r(b)||r(A),M=new n;r(T)&&(M.add(T.cameraClicked,d),M.add(T.closeClicked,p));var I,O;M.add(i.clock.onTick,v),r(i.homeButton)&&M.add(i.homeButton.viewModel.command.beforeExecute,m),r(i.geocoder)&&M.add(i.geocoder.viewModel.search.beforeExecute,f);for(var R=i.dataSources,L=R.length,N=0;L>N;N++)w(R,R.get(N));M.add(i.dataSources.dataSourceAdded,w),M.add(i.dataSources.dataSourceRemoved,E),i.screenSpaceEventHandler.setInputAction(C,o.LEFT_CLICK),i.screenSpaceEventHandler.setInputAction(y,o.LEFT_DOUBLE_CLICK),i.trackedObject=void 0,i.selectedObject=void 0,h.track(i,["trackedObject","selectedObject"]);var B=[];B.push(u(i,"trackedObject",function(e){var t=i.scene,n=t.frameState.mode,o=r(e);(n===l.COLUMBUS_VIEW||n===l.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!o),(n===l.COLUMBUS_VIEW||n===l.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!o),x=o&&r(e.position)?new c(e,t,i.centralBody.ellipsoid):void 0})),B.push(u(i,"selectedObject",function(e){r(e)?(r(T)&&(T.titleText=r(e.name)?e.name:e.id),r(P)&&P.animateAppear()):r(P)&&P.animateDepart()})),i.destroy=a(i,i.destroy,function(){M.removeAll();var e;for(e=0;ee;e++)E(t,t.get(e))})};return d}),r("Widgets/checkForChromeFrame",["../Core/FeatureDetection","./getElement","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){e=t(e);var r=document.createElement("div");r.className="cesium-chromeFrameOverlay";var i=document.createElement("div");r.appendChild(i),i.innerHTML='Cesium requires WebGL, an open standard for displaying 3D content in a web browser. To enable WebGL in Internet Explorer, we recommend installing Google Chrome Frame, a free, unobtrusive plug-in offered by Google. To learn more about WebGL, visit http://www.khronos.org/webgl/.

Would you like to install Chrome Frame now?

';var n=document.createElement("p");i.appendChild(n);var o=document.createElement("a");o.href="#",o.innerHTML="Yes, install Google Chrome Frame",o.onclick=function(){window.CFInstall.check({mode:"overlay",destination:document.URL}),e.removeChild(r)},n.appendChild(o),n=document.createElement("p"),i.appendChild(n);var a=document.createElement("a");a.href="#",a.innerHTML="No, not at this time",a.onclick=function(){e.removeChild(r)},n.appendChild(a),e.appendChild(r)}var n=function(t){var n=r.defer();if(e.isInternetExplorer()){var o=document.createElement("script");o.type="text/javascript",o.src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js";var a=document.getElementsByTagName("head")[0];a.appendChild(o);var s=setInterval(function(){if(window.CFInstall){clearInterval(s);var e=!1;window.CFInstall.check({mode:"overlay",preventPrompt:!0,onmissing:function(){e=!0}}),e&&i(t),n.resolve(e)}},50)}else n.resolve(!1);return n.promise};return n}),r("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";var r=function(r){var i,n=[],o={id:void 0,result:void 0,error:void 0};return function(a){var s=a.data;n.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,n)}catch(l){o.error=l}t(i)||(i=e(self.webkitPostMessage,self.postMessage));try{i(o,n)}catch(l){o.result=void 0,o.error="postMessage failed with error: "+l+"\n with responseMessage: "+JSON.stringify(o),i(o)}}};return r}),r("Cesium",["./Core/AssociativeArray","./Core/AxisAlignedBoundingBox","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/DeveloperError","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidalOccluder","./Core/EncodedCartesian3","./Core/Enumeration","./Core/Event","./Core/EventHelper","./Core/Extent","./Core/ExtentGeometry","./Core/ExtentOutlineGeometry","./Core/FAR","./Core/FeatureDetection","./Core/Fullscreen","./Core/GeographicProjection","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/IntersectionTests","./Core/Intersections2D","./Core/Interval","./Core/Iso8601","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/NearFarScalar","./Core/ObjectOrientedBoundingBox","./Core/Occluder","./Core/Packable","./Core/PackableForInterpolation","./Core/Plane","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/Queue","./Core/Ray","./Core/ReferenceFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/Shapes","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/TaskProcessor","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TridiagonalSystemSolver","./Core/VertexFormat","./Core/Visibility","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebMercatorProjection","./Core/WindingOrder","./Core/barycentricCoordinates","./Core/binarySearch","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/clone","./Core/combine","./Core/createGuid","./Core/defaultValue","./Core/defineProperties","./Core/defined","./Core/destroyObject","./Core/formatError","./Core/freezeObject","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getTimestamp","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/jsonp","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/parseResponseHeaders","./Core/pointInsideTriangle","./Core/requestAnimationFrame","./Core/throttleRequestByServer","./Core/wrapFunction","./Core/writeTextToCanvas","./DynamicScene/ColorMaterialProperty","./DynamicScene/CompositeDynamicObjectCollection","./DynamicScene/CompositeMaterialProperty","./DynamicScene/CompositePositionProperty","./DynamicScene/CompositeProperty","./DynamicScene/ConstantPositionProperty","./DynamicScene/ConstantProperty","./DynamicScene/CzmlDataSource","./DynamicScene/DataSource","./DynamicScene/DataSourceCollection","./DynamicScene/DataSourceDisplay","./DynamicScene/DynamicBillboard","./DynamicScene/DynamicBillboardVisualizer","./DynamicScene/DynamicClock","./DynamicScene/DynamicCone","./DynamicScene/DynamicConeVisualizerUsingCustomSensor","./DynamicScene/DynamicEllipse","./DynamicScene/DynamicEllipsoid","./DynamicScene/DynamicGeometryUpdater","./DynamicScene/DynamicLabel","./DynamicScene/DynamicLabelVisualizer","./DynamicScene/DynamicModel","./DynamicScene/DynamicModelVisualizer","./DynamicScene/DynamicObject","./DynamicScene/DynamicObjectCollection","./DynamicScene/DynamicObjectView","./DynamicScene/DynamicPath","./DynamicScene/DynamicPathVisualizer","./DynamicScene/DynamicPoint","./DynamicScene/DynamicPointVisualizer","./DynamicScene/DynamicPolygon","./DynamicScene/DynamicPolyline","./DynamicScene/DynamicPyramid","./DynamicScene/DynamicPyramidVisualizer","./DynamicScene/DynamicVector","./DynamicScene/DynamicVectorVisualizer","./DynamicScene/EllipseGeometryUpdater","./DynamicScene/EllipsoidGeometryUpdater","./DynamicScene/GeoJsonDataSource","./DynamicScene/GeometryUpdater","./DynamicScene/GeometryVisualizer","./DynamicScene/GridMaterialProperty","./DynamicScene/ImageMaterialProperty","./DynamicScene/MaterialProperty","./DynamicScene/PolygonGeometryUpdater","./DynamicScene/PolylineGeometryUpdater","./DynamicScene/PolylineOutlineMaterialProperty","./DynamicScene/PositionProperty","./DynamicScene/PositionPropertyArray","./DynamicScene/Property","./DynamicScene/PropertyArray","./DynamicScene/ReferenceProperty","./DynamicScene/SampledPositionProperty","./DynamicScene/SampledProperty","./DynamicScene/StaticGeometryColorBatch","./DynamicScene/StaticGeometryPerMaterialBatch","./DynamicScene/StaticOutlineGeometryBatch","./DynamicScene/TimeIntervalCollectionPositionProperty","./DynamicScene/TimeIntervalCollectionProperty","./DynamicScene/createDynamicPropertyDescriptor","./Renderer/AutomaticUniforms","./Renderer/BlendEquation","./Renderer/BlendFunction","./Renderer/BlendingState","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/Context","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/CullFace","./Renderer/DepthFunction","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/PixelFormat","./Renderer/RenderState","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/StencilFunction","./Renderer/StencilOperation","./Renderer/Texture","./Renderer/TextureAtlas","./Renderer/TextureAtlasBuilder","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformDatatype","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/VertexLayout","./Renderer/createShaderSource","./Renderer/loadCubeMap","./Scene/AnimationCollection","./Scene/Appearance","./Scene/ArcGisImageServerTerrainProvider","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/Camera","./Scene/CameraColumbusViewMode","./Scene/CameraController","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/CentralBody","./Scene/CentralBodySurface","./Scene/CentralBodySurfaceShaderSet","./Scene/CesiumTerrainProvider","./Scene/CompositePrimitive","./Scene/Credit","./Scene/CreditDisplay","./Scene/CullingVolume","./Scene/CustomSensorVolume","./Scene/DebugAppearance","./Scene/DebugModelMatrixPrimitive","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/EllipsoidTerrainProvider","./Scene/ExtentPrimitive","./Scene/FrameState","./Scene/FrustumCommands","./Scene/GeographicTilingScheme","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/HeightmapTerrainData","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMesh","./Scene/ModelNode","./Scene/ModelTypes","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/PerInstanceColorAppearance","./Scene/PerformanceDisplay","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/Polygon","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuantizedMeshTerrainData","./Scene/RectangularPyramidSensorVolume","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/SensorVolumeCollection","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainData","./Scene/TerrainMesh","./Scene/TerrainProvider","./Scene/TerrainState","./Scene/TexturePool","./Scene/Tile","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileMapServiceImageryProvider","./Scene/TileProviderError","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TilingScheme","./Scene/VRTheWorldTerrainProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMercatorTilingScheme","./Scene/createTangentSpaceDebugPrimitive","./Scene/sampleTerrain","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/CentralBodyFS","./Shaders/CentralBodyFSDepth","./Shaders/CentralBodyFSPole","./Shaders/CentralBodyVS","./Shaders/CentralBodyVSDepth","./Shaders/CentralBodyVSPole","./Shaders/CustomSensorVolumeFS","./Shaders/CustomSensorVolumeVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/FresnelMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/ReflectionMaterial","./Shaders/Materials/RefractionMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/SensorVolume","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/gltfDefaults","./ThirdParty/knockout-3.0.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/when","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/ImageryProviderViewModel","./Widgets/BaseLayerPicker/createDefaultBaseLayers","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerDynamicObjectMixin","./Widgets/checkForChromeFrame","./Widgets/createCommand","./Widgets/getElement","./Widgets/subscribeAndEvaluate","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N,B,z,F,V,k,U,W,G,H,j,q,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,mt,pt,ft,vt,gt,_t,yt,Ct,St,wt,Et,xt,bt,Tt,At,Pt,Dt,Mt,It,Ot,Rt,Lt,Nt,Bt,zt,Ft,Vt,kt,Ut,Wt,Gt,Ht,jt,qt,Yt,Xt,Zt,Jt,Qt,Kt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,hr,dr,mr,pr,fr,vr,gr,_r,yr,Cr,Sr,wr,Er,xr,br,Tr,Ar,Pr,Dr,Mr,Ir,Or,Rr,Lr,Nr,Br,zr,Fr,Vr,kr,Ur,Wr,Gr,Hr,jr,qr,Yr,Xr,Zr,Jr,Qr,Kr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,hi,di,mi,pi,fi,vi,gi,_i,yi,Ci,Si,wi,Ei,xi,bi,Ti,Ai,Pi,Di,Mi,Ii,Oi,Ri,Li,Ni,Bi,zi,Fi,Vi,ki,Ui,Wi,Gi,Hi,ji,qi,Yi,Xi,Zi,Ji,Qi,Ki,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,mn,pn,fn,vn,gn,_n,yn,Cn,Sn,wn,En,xn,bn,Tn,An,Pn,Dn,Mn,In,On,Rn,Ln,Nn,Bn,zn,Fn,Vn,kn,Un,Wn,Gn,Hn,jn,qn,Yn,Xn,Zn,Jn,Qn,Kn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,mo,po,fo,vo,go,_o,yo,Co,So,wo,Eo,xo,bo,To,Ao,Po,Do,Mo,Io,Oo,Ro,Lo,No,Bo,zo,Fo,Vo,ko,Uo,Wo,Go,Ho,jo,qo,Yo,Xo,Zo,Jo,Qo,Ko,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,ha,da,ma,pa,fa,va,ga,_a,ya,Ca,Sa,wa,Ea,xa,ba,Ta,Aa,Pa,Da,Ma,Ia,Oa,Ra,La,Na,Ba,za,Fa,Va,ka,Ua,Wa,Ga,Ha,ja,qa,Ya,Xa,Za,Ja,Qa,Ka,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,hs,ds,ms,ps,fs,vs,gs,_s,ys,Cs,Ss,ws,Es,xs,bs,Ts,As,Ps,Ds,Ms,Is,Os,Rs,Ls,Ns,Bs,zs,Fs,Vs,ks,Us,Ws,Gs,Hs,js,qs,Ys,Xs,Zs,Js,Qs,Ks,$s,el,tl,rl,il,nl,ol,al,sl,ll,ul,cl,hl,dl,ml,pl,fl,vl,gl,_l,yl,Cl,Sl,wl,El,xl,bl,Tl,Al,Pl,Dl,Ml,Il,Ol,Rl,Ll,Nl,Bl,zl,Fl,Vl,kl,Ul,Wl,Gl,Hl,jl,ql,Yl,Xl,Zl,Jl,Ql,Kl,$l,eu,tu,ru,iu,nu,ou,au,su,lu,uu,cu,hu,du,mu,pu,fu,vu,gu,_u,yu,Cu,Su,wu,Eu,xu,bu,Tu,Au,Pu,Du,Mu,Iu,Ou,Ru,Lu,Nu,Bu,zu,Fu,Vu,ku,Uu,Wu,Gu,Hu,ju,qu,Yu,Xu,Zu,Ju,Qu,Ku,$u,ec,tc,rc,ic,nc,oc,ac,sc){"use strict"; +var lc={_shaders:{}};return lc.AssociativeArray=e,lc.AxisAlignedBoundingBox=t,lc.BingMapsApi=r,lc.BoundingRectangle=i,lc.BoundingSphere=n,lc.BoxGeometry=o,lc.BoxOutlineGeometry=a,lc.Cartesian2=s,lc.Cartesian3=l,lc.Cartesian4=u,lc.Cartographic=c,lc.CatmullRomSpline=h,lc.CircleGeometry=d,lc.CircleOutlineGeometry=m,lc.Clock=p,lc.ClockRange=f,lc.ClockStep=v,lc.Color=g,lc.ColorGeometryInstanceAttribute=_,lc.ComponentDatatype=y,lc.CornerType=C,lc.CorridorGeometry=S,lc.CorridorGeometryLibrary=w,lc.CorridorOutlineGeometry=E,lc.CubicRealPolynomial=x,lc.CylinderGeometry=b,lc.CylinderGeometryLibrary=T,lc.CylinderOutlineGeometry=A,lc.DefaultProxy=P,lc.DeveloperError=D,lc.EarthOrientationParameters=M,lc.EarthOrientationParametersSample=I,lc.EllipseGeometry=O,lc.EllipseGeometryLibrary=R,lc.EllipseOutlineGeometry=L,lc.Ellipsoid=N,lc.EllipsoidGeodesic=B,lc.EllipsoidGeometry=z,lc.EllipsoidOutlineGeometry=F,lc.EllipsoidTangentPlane=V,lc.EllipsoidalOccluder=k,lc.EncodedCartesian3=U,lc.Enumeration=W,lc.Event=G,lc.EventHelper=H,lc.Extent=j,lc.ExtentGeometry=q,lc.ExtentOutlineGeometry=Y,lc.FAR=X,lc.FeatureDetection=Z,lc.Fullscreen=J,lc.GeographicProjection=Q,lc.Geometry=K,lc.GeometryAttribute=$,lc.GeometryAttributes=et,lc.GeometryInstance=tt,lc.GeometryInstanceAttribute=rt,lc.GeometryPipeline=it,lc.HeightmapTessellator=nt,lc.HermitePolynomialApproximation=ot,lc.HermiteSpline=at,lc.Iau2000Orientation=st,lc.Iau2006XysData=lt,lc.Iau2006XysSample=ut,lc.IauOrientationAxes=ct,lc.IauOrientationParameters=ht,lc.IndexDatatype=dt,lc.InterpolationAlgorithm=mt,lc.Intersect=pt,lc.IntersectionTests=ft,lc.Intersections2D=vt,lc.Interval=gt,lc.Iso8601=_t,lc.JulianDate=yt,lc.KeyboardEventModifier=Ct,lc.LagrangePolynomialApproximation=St,lc.LeapSecond=wt,lc.LinearApproximation=Et,lc.LinearSpline=xt,lc.Math=bt,lc.Matrix2=Tt,lc.Matrix3=At,lc.Matrix4=Pt,lc.NearFarScalar=Dt,lc.ObjectOrientedBoundingBox=Mt,lc.Occluder=It,lc.Packable=Ot,lc.PackableForInterpolation=Rt,lc.Plane=Lt,lc.PolygonGeometry=Nt,lc.PolygonGeometryLibrary=Bt,lc.PolygonOutlineGeometry=zt,lc.PolygonPipeline=Ft,lc.PolylineGeometry=Vt,lc.PolylinePipeline=kt,lc.PolylineVolumeGeometry=Ut,lc.PolylineVolumeGeometryLibrary=Wt,lc.PolylineVolumeOutlineGeometry=Gt,lc.PrimitiveType=Ht,lc.QuadraticRealPolynomial=jt,lc.QuarticRealPolynomial=qt,lc.Quaternion=Yt,lc.QuaternionSpline=Xt,lc.Queue=Zt,lc.Ray=Jt,lc.ReferenceFrame=Qt,lc.RequestErrorEvent=Kt,lc.RuntimeError=$t,lc.ScreenSpaceEventHandler=er,lc.ScreenSpaceEventType=tr,lc.Shapes=rr,lc.ShowGeometryInstanceAttribute=ir,lc.Simon1994PlanetaryPositions=nr,lc.SimplePolylineGeometry=or,lc.SphereGeometry=ar,lc.SphereOutlineGeometry=sr,lc.Spherical=lr,lc.Spline=ur,lc.TaskProcessor=cr,lc.TimeConstants=hr,lc.TimeInterval=dr,lc.TimeIntervalCollection=mr,lc.TimeStandard=pr,lc.Tipsify=fr,lc.Transforms=vr,lc.TridiagonalSystemSolver=gr,lc.VertexFormat=_r,lc.Visibility=yr,lc.WallGeometry=Cr,lc.WallGeometryLibrary=Sr,lc.WallOutlineGeometry=wr,lc.WebMercatorProjection=Er,lc.WindingOrder=xr,lc.barycentricCoordinates=br,lc.binarySearch=Tr,lc.buildModuleUrl=Ar,lc.cancelAnimationFrame=Pr,lc.clone=Dr,lc.combine=Mr,lc.createGuid=Ir,lc.defaultValue=Or,lc.defineProperties=Rr,lc.defined=Lr,lc.destroyObject=Nr,lc.formatError=Br,lc.freezeObject=zr,lc.getFilenameFromUri=Fr,lc.getImagePixels=Vr,lc.getTimestamp=kr,lc.isArray=Ur,lc.isCrossOriginUrl=Wr,lc.isLeapYear=Gr,lc.jsonp=Hr,lc.loadArrayBuffer=jr,lc.loadBlob=qr,lc.loadImage=Yr,lc.loadImageViaBlob=Xr,lc.loadJson=Zr,lc.loadText=Jr,lc.loadWithXhr=Qr,lc.loadXML=Kr,lc.parseResponseHeaders=$r,lc.pointInsideTriangle=ei,lc.requestAnimationFrame=ti,lc.throttleRequestByServer=ri,lc.wrapFunction=ii,lc.writeTextToCanvas=ni,lc.ColorMaterialProperty=oi,lc.CompositeDynamicObjectCollection=ai,lc.CompositeMaterialProperty=si,lc.CompositePositionProperty=li,lc.CompositeProperty=ui,lc.ConstantPositionProperty=ci,lc.ConstantProperty=hi,lc.CzmlDataSource=di,lc.DataSource=mi,lc.DataSourceCollection=pi,lc.DataSourceDisplay=fi,lc.DynamicBillboard=vi,lc.DynamicBillboardVisualizer=gi,lc.DynamicClock=_i,lc.DynamicCone=yi,lc.DynamicConeVisualizerUsingCustomSensor=Ci,lc.DynamicEllipse=Si,lc.DynamicEllipsoid=wi,lc.DynamicGeometryUpdater=Ei,lc.DynamicLabel=xi,lc.DynamicLabelVisualizer=bi,lc.DynamicModel=Ti,lc.DynamicModelVisualizer=Ai,lc.DynamicObject=Pi,lc.DynamicObjectCollection=Di,lc.DynamicObjectView=Mi,lc.DynamicPath=Ii,lc.DynamicPathVisualizer=Oi,lc.DynamicPoint=Ri,lc.DynamicPointVisualizer=Li,lc.DynamicPolygon=Ni,lc.DynamicPolyline=Bi,lc.DynamicPyramid=zi,lc.DynamicPyramidVisualizer=Fi,lc.DynamicVector=Vi,lc.DynamicVectorVisualizer=ki,lc.EllipseGeometryUpdater=Ui,lc.EllipsoidGeometryUpdater=Wi,lc.GeoJsonDataSource=Gi,lc.GeometryUpdater=Hi,lc.GeometryVisualizer=ji,lc.GridMaterialProperty=qi,lc.ImageMaterialProperty=Yi,lc.MaterialProperty=Xi,lc.PolygonGeometryUpdater=Zi,lc.PolylineGeometryUpdater=Ji,lc.PolylineOutlineMaterialProperty=Qi,lc.PositionProperty=Ki,lc.PositionPropertyArray=$i,lc.Property=en,lc.PropertyArray=tn,lc.ReferenceProperty=rn,lc.SampledPositionProperty=nn,lc.SampledProperty=on,lc.StaticGeometryColorBatch=an,lc.StaticGeometryPerMaterialBatch=sn,lc.StaticOutlineGeometryBatch=ln,lc.TimeIntervalCollectionPositionProperty=un,lc.TimeIntervalCollectionProperty=cn,lc.createDynamicPropertyDescriptor=hn,lc.AutomaticUniforms=dn,lc.BlendEquation=mn,lc.BlendFunction=pn,lc.BlendingState=fn,lc.Buffer=vn,lc.BufferUsage=gn,lc.ClearCommand=_n,lc.Context=yn,lc.CubeMap=Cn,lc.CubeMapFace=Sn,lc.CullFace=wn,lc.DepthFunction=En,lc.DrawCommand=xn,lc.Framebuffer=bn,lc.MipmapHint=Tn,lc.Pass=An,lc.PassState=Pn,lc.PickFramebuffer=Dn,lc.PixelDatatype=Mn,lc.PixelFormat=In,lc.RenderState=On,lc.Renderbuffer=Rn,lc.RenderbufferFormat=Ln,lc.ShaderCache=Nn,lc.ShaderProgram=Bn,lc.StencilFunction=zn,lc.StencilOperation=Fn,lc.Texture=Vn,lc.TextureAtlas=kn,lc.TextureAtlasBuilder=Un,lc.TextureMagnificationFilter=Wn,lc.TextureMinificationFilter=Gn,lc.TextureWrap=Hn,lc.UniformDatatype=jn,lc.UniformState=qn,lc.VertexArray=Yn,lc.VertexArrayFacade=Xn,lc.VertexLayout=Zn,lc.createShaderSource=Jn,lc.loadCubeMap=Qn,lc.AnimationCollection=Kn,lc.Appearance=$n,lc.ArcGisImageServerTerrainProvider=eo,lc.ArcGisMapServerImageryProvider=to,lc.Billboard=ro,lc.BillboardCollection=io,lc.BingMapsImageryProvider=no,lc.BingMapsStyle=oo,lc.Camera=ao,lc.CameraColumbusViewMode=so,lc.CameraController=lo,lc.CameraEventAggregator=uo,lc.CameraEventType=co,lc.CameraFlightPath=ho,lc.CentralBody=mo,lc.CentralBodySurface=po,lc.CentralBodySurfaceShaderSet=fo,lc.CesiumTerrainProvider=vo,lc.CompositePrimitive=go,lc.Credit=_o,lc.CreditDisplay=yo,lc.CullingVolume=Co,lc.CustomSensorVolume=So,lc.DebugAppearance=wo,lc.DebugModelMatrixPrimitive=Eo,lc.DiscardMissingTileImagePolicy=xo,lc.EllipsoidPrimitive=bo,lc.EllipsoidSurfaceAppearance=To,lc.EllipsoidTerrainProvider=Ao,lc.ExtentPrimitive=Po,lc.FrameState=Do,lc.FrustumCommands=Mo,lc.GeographicTilingScheme=Io,lc.GoogleEarthImageryProvider=Oo,lc.GridImageryProvider=Ro,lc.HeightmapTerrainData=Lo,lc.HorizontalOrigin=No,lc.Imagery=Bo,lc.ImageryLayer=zo,lc.ImageryLayerCollection=Fo,lc.ImageryProvider=Vo,lc.ImageryState=ko,lc.Label=Uo,lc.LabelCollection=Wo,lc.LabelStyle=Go,lc.Material=Ho,lc.MaterialAppearance=jo,lc.Model=qo,lc.ModelAnimation=Yo,lc.ModelAnimationCache=Xo,lc.ModelAnimationCollection=Zo,lc.ModelAnimationLoop=Jo,lc.ModelAnimationState=Qo,lc.ModelMesh=Ko,lc.ModelNode=$o,lc.ModelTypes=ea,lc.Moon=ta,lc.NeverTileDiscardPolicy=ra,lc.OpenStreetMapImageryProvider=ia,lc.OrthographicFrustum=na,lc.PerInstanceColorAppearance=oa,lc.PerformanceDisplay=aa,lc.PerspectiveFrustum=sa,lc.PerspectiveOffCenterFrustum=la,lc.Polygon=ua,lc.Polyline=ca,lc.PolylineCollection=ha,lc.PolylineColorAppearance=da,lc.PolylineMaterialAppearance=ma,lc.Primitive=pa,lc.PrimitivePipeline=fa,lc.PrimitiveState=va,lc.QuantizedMeshTerrainData=ga,lc.RectangularPyramidSensorVolume=_a,lc.Scene=ya,lc.SceneMode=Ca,lc.SceneTransforms=Sa,lc.SceneTransitioner=wa,lc.ScreenSpaceCameraController=Ea,lc.SensorVolumeCollection=xa,lc.SingleTileImageryProvider=ba,lc.SkyAtmosphere=Ta,lc.SkyBox=Aa,lc.Sun=Pa,lc.SunPostProcess=Da,lc.TerrainData=Ma,lc.TerrainMesh=Ia,lc.TerrainProvider=Oa,lc.TerrainState=Ra,lc.TexturePool=La,lc.Tile=Na,lc.TileCoordinatesImageryProvider=Ba,lc.TileDiscardPolicy=za,lc.TileImagery=Fa,lc.TileMapServiceImageryProvider=Va,lc.TileProviderError=ka,lc.TileReplacementQueue=Ua,lc.TileState=Wa,lc.TileTerrain=Ga,lc.TilingScheme=Ha,lc.VRTheWorldTerrainProvider=ja,lc.VerticalOrigin=qa,lc.ViewportQuad=Ya,lc.WebMapServiceImageryProvider=Xa,lc.WebMercatorTilingScheme=Za,lc.createTangentSpaceDebugPrimitive=Ja,lc.sampleTerrain=Qa,lc._shaders.AllMaterialAppearanceFS=Ka,lc._shaders.AllMaterialAppearanceVS=$a,lc._shaders.BasicMaterialAppearanceFS=es,lc._shaders.BasicMaterialAppearanceVS=ts,lc._shaders.EllipsoidSurfaceAppearanceFS=rs,lc._shaders.EllipsoidSurfaceAppearanceVS=is,lc._shaders.PerInstanceColorAppearanceFS=ns,lc._shaders.PerInstanceColorAppearanceVS=os,lc._shaders.PerInstanceFlatColorAppearanceFS=as,lc._shaders.PerInstanceFlatColorAppearanceVS=ss,lc._shaders.PolylineColorAppearanceVS=ls,lc._shaders.PolylineMaterialAppearanceVS=us,lc._shaders.TexturedMaterialAppearanceFS=cs,lc._shaders.TexturedMaterialAppearanceVS=hs,lc._shaders.BillboardCollectionFS=ds,lc._shaders.BillboardCollectionVS=ms,lc._shaders.degreesPerRadian=ps,lc._shaders.epsilon1=fs,lc._shaders.epsilon2=vs,lc._shaders.epsilon3=gs,lc._shaders.epsilon4=_s,lc._shaders.epsilon5=ys,lc._shaders.epsilon6=Cs,lc._shaders.epsilon7=Ss,lc._shaders.infinity=ws,lc._shaders.oneOverPi=Es,lc._shaders.oneOverTwoPi=xs,lc._shaders.pi=bs,lc._shaders.piOverFour=Ts,lc._shaders.piOverSix=As,lc._shaders.piOverThree=Ps,lc._shaders.piOverTwo=Ds,lc._shaders.radiansPerDegree=Ms,lc._shaders.sceneMode2D=Is,lc._shaders.sceneMode3D=Os,lc._shaders.sceneModeColumbusView=Rs,lc._shaders.sceneModeMorphing=Ls,lc._shaders.solarRadius=Ns,lc._shaders.threePiOver2=Bs,lc._shaders.twoPi=zs,lc._shaders.webMercatorMaxLatitude=Fs,lc._shaders.CzmBuiltins=Vs,lc._shaders.RGBToXYZ=ks,lc._shaders.XYZToRGB=Us,lc._shaders.antialias=Ws,lc._shaders.columbusViewMorph=Gs,lc._shaders.computePosition=Hs,lc._shaders.eastNorthUpToEyeCoordinates=js,lc._shaders.ellipsoidContainsPoint=qs,lc._shaders.ellipsoidNew=Ys,lc._shaders.ellipsoidWgs84TextureCoordinates=Xs,lc._shaders.equalsEpsilon=Zs,lc._shaders.eyeOffset=Js,lc._shaders.eyeToWindowCoordinates=Qs,lc._shaders.geodeticSurfaceNormal=Ks,lc._shaders.getDefaultMaterial=$s,lc._shaders.getLambertDiffuse=el,lc._shaders.getSpecular=tl,lc._shaders.getWaterNoise=rl,lc._shaders.getWgs84EllipsoidEC=il,lc._shaders.hue=nl,lc._shaders.isEmpty=ol,lc._shaders.isFull=al,lc._shaders.latitudeToWebMercatorFraction=sl,lc._shaders.luminance=ll,lc._shaders.modelToWindowCoordinates=ul,lc._shaders.multiplyWithColorBalance=cl,lc._shaders.phong=hl,lc._shaders.pointAlongRay=dl,lc._shaders.rayEllipsoidIntersectionInterval=ml,lc._shaders.saturation=pl,lc._shaders.tangentToEyeSpaceMatrix=fl,lc._shaders.translateRelativeToEye=vl,lc._shaders.transpose=gl,lc._shaders.windowToEyeCoordinates=_l,lc._shaders.ellipsoid=yl,lc._shaders.material=Cl,lc._shaders.materialInput=Sl,lc._shaders.ray=wl,lc._shaders.raySegment=El,lc._shaders.CentralBodyFS=xl,lc._shaders.CentralBodyFSDepth=bl,lc._shaders.CentralBodyFSPole=Tl,lc._shaders.CentralBodyVS=Al,lc._shaders.CentralBodyVSDepth=Pl,lc._shaders.CentralBodyVSPole=Dl,lc._shaders.CustomSensorVolumeFS=Ml,lc._shaders.CustomSensorVolumeVS=Il,lc._shaders.EllipsoidFS=Ol,lc._shaders.EllipsoidVS=Rl,lc._shaders.BumpMapMaterial=Ll,lc._shaders.CheckerboardMaterial=Nl,lc._shaders.DotMaterial=Bl,lc._shaders.FadeMaterial=zl,lc._shaders.FresnelMaterial=Fl,lc._shaders.GridMaterial=Vl,lc._shaders.NormalMapMaterial=kl,lc._shaders.PolylineArrowMaterial=Ul,lc._shaders.PolylineGlowMaterial=Wl,lc._shaders.PolylineOutlineMaterial=Gl,lc._shaders.ReflectionMaterial=Hl,lc._shaders.RefractionMaterial=jl,lc._shaders.RimLightingMaterial=ql,lc._shaders.StripeMaterial=Yl,lc._shaders.Water=Xl,lc._shaders.PolylineCommon=Zl,lc._shaders.PolylineFS=Jl,lc._shaders.PolylineVS=Ql,lc._shaders.AdditiveBlend=Kl,lc._shaders.BrightPass=$l,lc._shaders.GaussianBlur1D=eu,lc._shaders.PassThrough=tu,lc._shaders.ReprojectWebMercatorFS=ru,lc._shaders.ReprojectWebMercatorVS=iu,lc._shaders.SensorVolume=nu,lc._shaders.SkyAtmosphereFS=ou,lc._shaders.SkyAtmosphereVS=au,lc._shaders.SkyBoxFS=su,lc._shaders.SkyBoxVS=lu,lc._shaders.SunFS=uu,lc._shaders.SunTextureFS=cu,lc._shaders.SunVS=hu,lc._shaders.ViewportQuadFS=du,lc._shaders.ViewportQuadVS=mu,lc.Tween=pu,lc.Uri=fu,lc.gltfDefaults=vu,lc["knockout-3.0.0"]=gu,lc["knockout-es5"]=_u,lc.knockout=yu,lc.measureText=Cu,lc["mersenne-twister"]=Su,lc.sprintf=wu,lc.topojson=Eu,lc.when=xu,lc.Animation=bu,lc.AnimationViewModel=Tu,lc.BaseLayerPicker=Au,lc.BaseLayerPickerViewModel=Pu,lc.ImageryProviderViewModel=Du,lc.createDefaultBaseLayers=Mu,lc.CesiumInspector=Iu,lc.CesiumInspectorViewModel=Ou,lc.CesiumWidget=Ru,lc.ClockViewModel=Lu,lc.Command=Nu,lc.FullscreenButton=Bu,lc.FullscreenButtonViewModel=zu,lc.Geocoder=Fu,lc.GeocoderViewModel=Vu,lc.HomeButton=ku,lc.HomeButtonViewModel=Uu,lc.InfoBox=Wu,lc.InfoBoxViewModel=Gu,lc.SceneModePicker=Hu,lc.SceneModePickerViewModel=ju,lc.SelectionIndicator=qu,lc.SelectionIndicatorViewModel=Yu,lc.SvgPathBindingHandler=Xu,lc.Timeline=Zu,lc.TimelineHighlightRange=Ju,lc.TimelineTrack=Qu,lc.ToggleButtonViewModel=Ku,lc.Viewer=$u,lc.viewerCesiumInspectorMixin=ec,lc.viewerDragDropMixin=tc,lc.viewerDynamicObjectMixin=rc,lc.checkForChromeFrame=ic,lc.createCommand=nc,lc.getElement=oc,lc.subscribeAndEvaluate=ac,lc.createTaskProcessorWorker=sc,lc}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file diff --git a/DrawHelper.js b/DrawHelper.js index 9c99803..8cdc24a 100644 --- a/DrawHelper.js +++ b/DrawHelper.js @@ -29,7 +29,7 @@ var DrawHelper = (function() { var scene = this._scene; var _self = this; // scene events - var handler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); function callPrimitiveCallback(name, position) { if(_self._handlersMuted == true) return; var pickedObject = scene.pick(position); @@ -514,9 +514,9 @@ var DrawHelper = (function() { // create one common billboard collection for all billboards var b = new Cesium.BillboardCollection(); - var a = this._scene.getContext().createTextureAtlas(); - b.setTextureAtlas(a); - this._scene.getPrimitives().add(b); + var a = this._scene.context.createTextureAtlas(); + b.textureAtlas = a; + this._scene.primitives.add(b); this._billboards = b; this._textureAtlas = a; // keep an ordered list of billboards @@ -548,7 +548,7 @@ var DrawHelper = (function() { // if editable if(callbacks) { var _self = this; - var screenSpaceCameraController = this._scene.getScreenSpaceCameraController(); + var screenSpaceCameraController = this._scene.screenSpaceCameraController; function enableRotation(enable) { screenSpaceCameraController.enableRotate = enable; } @@ -574,10 +574,10 @@ var DrawHelper = (function() { callbacks.dragHandlers.onDragEnd && callbacks.dragHandlers.onDragEnd(getIndex(), position); } - var handler = new Cesium.ScreenSpaceEventHandler(_self._scene.getCanvas()); + var handler = new Cesium.ScreenSpaceEventHandler(_self._scene.canvas); handler.setInputAction(function(movement) { - var cartesian = _self._scene.getCamera().controller.pickEllipsoid(movement.endPosition, ellipsoid); + var cartesian = _self._scene.camera.controller.pickEllipsoid(movement.endPosition, ellipsoid); if (cartesian) { onDrag(cartesian); } else { @@ -586,12 +586,12 @@ var DrawHelper = (function() { }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); handler.setInputAction(function(movement) { - onDragEnd(_self._scene.getCamera().controller.pickEllipsoid(movement.position, ellipsoid)); + onDragEnd(_self._scene.camera.controller.pickEllipsoid(movement.position, ellipsoid)); }, Cesium.ScreenSpaceEventType.LEFT_UP); enableRotation(false); - callbacks.dragHandlers.onDragStart && callbacks.dragHandlers.onDragStart(getIndex(), _self._scene.getCamera().controller.pickEllipsoid(position, ellipsoid)); + callbacks.dragHandlers.onDragStart && callbacks.dragHandlers.onDragStart(getIndex(), _self._scene.camera.controller.pickEllipsoid(position, ellipsoid)); }); } if(callbacks.onDoubleClick) { @@ -657,7 +657,7 @@ var DrawHelper = (function() { } _.BillboardGroup.prototype.setOnTop = function() { - this._scene.getPrimitives().raiseToTop(this._billboards); + this._scene.primitives.raiseToTop(this._billboards); } _.prototype.startDrawingMarker = function(options) { @@ -674,17 +674,17 @@ var DrawHelper = (function() { var _self = this; var scene = this._scene; - var primitives = scene.getPrimitives(); + var primitives = scene.primitives; var tooltip = this._tooltip; var markers = new _.BillboardGroup(this, options); - var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); // Now wait for start mouseHandler.setInputAction(function(movement) { if(movement.position != null) { - var cartesian = scene.getCamera().controller.pickEllipsoid(movement.position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(movement.position, ellipsoid); if (cartesian) { markers.addBillboard(cartesian); _self.stopDrawing(); @@ -696,7 +696,7 @@ var DrawHelper = (function() { mouseHandler.setInputAction(function(movement) { var position = movement.endPosition; if(position != null) { - var cartesian = scene.getCamera().controller.pickEllipsoid(position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(position, ellipsoid); if (cartesian) { tooltip.showAt(position, "

Click to add your marker. Position is:

" + getDisplayLatLngString(ellipsoid.cartesianToCartographic(cartesian))); } else { @@ -730,7 +730,7 @@ var DrawHelper = (function() { var _self = this; var scene = this._scene; - var primitives = scene.getPrimitives(); + var primitives = scene.primitives; var tooltip = this._tooltip; var minPoints = isPolygon ? 3 : 2; @@ -746,12 +746,12 @@ var DrawHelper = (function() { var positions = []; var markers = new _.BillboardGroup(this, defaultBillboard); - var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); // Now wait for start mouseHandler.setInputAction(function(movement) { if(movement.position != null) { - var cartesian = scene.getCamera().controller.pickEllipsoid(movement.position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(movement.position, ellipsoid); if (cartesian) { // first click if(positions.length == 0) { @@ -776,7 +776,7 @@ var DrawHelper = (function() { if(positions.length == 0) { tooltip.showAt(position, "

Click to add first point

"); } else { - var cartesian = scene.getCamera().controller.pickEllipsoid(position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(position, ellipsoid); if (cartesian) { positions.pop(); // make sure it is slightly different @@ -800,7 +800,7 @@ var DrawHelper = (function() { if(positions.length < minPoints + 2) { return; } else { - var cartesian = scene.getCamera().controller.pickEllipsoid(position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(position, ellipsoid); if (cartesian) { _self.stopDrawing(); if(typeof options.callback == 'function') { @@ -835,14 +835,14 @@ var DrawHelper = (function() { var _self = this; var scene = this._scene; - var primitives = this._scene.getPrimitives(); + var primitives = this._scene.primitives; var tooltip = this._tooltip; var firstPoint = null; var extent = null; var markers = null; - var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); function updateExtent(value) { if(extent == null) { @@ -865,7 +865,7 @@ var DrawHelper = (function() { // Now wait for start mouseHandler.setInputAction(function(movement) { if(movement.position != null) { - var cartesian = scene.getCamera().controller.pickEllipsoid(movement.position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(movement.position, ellipsoid); if (cartesian) { if(extent == null) { // create the rectangle @@ -888,7 +888,7 @@ var DrawHelper = (function() { if(extent == null) { tooltip.showAt(position, "

Click to start drawing rectangle

"); } else { - var cartesian = scene.getCamera().controller.pickEllipsoid(position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(position, ellipsoid); if (cartesian) { var value = getExtent(firstPoint, ellipsoid.cartesianToCartographic(cartesian)); updateExtent(value); @@ -917,18 +917,18 @@ var DrawHelper = (function() { var _self = this; var scene = this._scene; - var primitives = this._scene.getPrimitives(); + var primitives = this._scene.primitives; var tooltip = this._tooltip; var circle = null; var markers = null; - var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); // Now wait for start mouseHandler.setInputAction(function(movement) { if(movement.position != null) { - var cartesian = scene.getCamera().controller.pickEllipsoid(movement.position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(movement.position, ellipsoid); if (cartesian) { if(circle == null) { // create the circle @@ -959,7 +959,7 @@ var DrawHelper = (function() { if(circle == null) { tooltip.showAt(position, "

Click to start drawing the circle

"); } else { - var cartesian = scene.getCamera().controller.pickEllipsoid(position, ellipsoid); + var cartesian = scene.camera.controller.pickEllipsoid(position, ellipsoid); if (cartesian) { circle.setRadius(Cesium.Cartesian3.distance(circle.getCenter(), cartesian)); markers.updateBillboardsPositions(cartesian); @@ -988,7 +988,7 @@ var DrawHelper = (function() { var _self = this; function enableRotation(enable) { - drawHelper._scene.getScreenSpaceCameraController().enableRotate = enable; + drawHelper._scene.screenSpaceCameraController.enableRotate = enable; } setListener(billboard, 'leftDown', function(position) { @@ -1004,10 +1004,10 @@ var DrawHelper = (function() { _self.executeListeners({name: 'dragEnd', positions: position}); } - var handler = new Cesium.ScreenSpaceEventHandler(drawHelper._scene.getCanvas()); + var handler = new Cesium.ScreenSpaceEventHandler(drawHelper._scene.canvas); handler.setInputAction(function(movement) { - var cartesian = drawHelper._scene.getCamera().controller.pickEllipsoid(movement.endPosition, ellipsoid); + var cartesian = drawHelper._scene.camera.controller.pickEllipsoid(movement.endPosition, ellipsoid); if (cartesian) { onDrag(cartesian); } else { @@ -1016,7 +1016,7 @@ var DrawHelper = (function() { }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); handler.setInputAction(function(movement) { - onDragEnd(drawHelper._scene.getCamera().controller.pickEllipsoid(movement.position, ellipsoid)); + onDragEnd(drawHelper._scene.camera.controller.pickEllipsoid(movement.position, ellipsoid)); }, Cesium.ScreenSpaceEventType.LEFT_UP); enableRotation(false); @@ -1040,7 +1040,7 @@ var DrawHelper = (function() { if(this._editMode === true) { return; } - var primitives = scene.getPrimitives(); + var primitives = scene.primitives; // highlight by creating an outline polygon matching the polygon points if(highlighted) { // make sure all other shapes are not highlighted @@ -1059,7 +1059,7 @@ var DrawHelper = (function() { depthTest : { enabled : true }, - lineWidth : Math.min(4.0, scene.getContext().getMaximumAliasedLineWidth()) + lineWidth : Math.min(4.0, scene.context.getMaximumAliasedLineWidth()) } }) })); @@ -1174,7 +1174,7 @@ var DrawHelper = (function() { editMarkers.addBillboards(halfPositions, handleEditMarkerChanges); this._editMarkers = editMarkers; // add a handler for clicking in the globe - this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); this._globeClickhandler.setInputAction( function (movement) { var pickedObject = scene.pick(movement.position); @@ -1339,7 +1339,7 @@ var DrawHelper = (function() { markers.addBillboards(getCorners(extent.extent), handleMarkerChanges); this._markers = markers; // add a handler for clicking in the globe - this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); this._globeClickhandler.setInputAction( function (movement) { var pickedObject = scene.pick(movement.position); @@ -1431,7 +1431,7 @@ var DrawHelper = (function() { markers.addBillboards(getMarkerPositions(), handleMarkerChanges); this._markers = markers; // add a handler for clicking in the globe - this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); this._globeClickhandler.setInputAction( function (movement) { var pickedObject = scene.pick(movement.position); @@ -1520,7 +1520,7 @@ var DrawHelper = (function() { markers.addBillboards(getMarkerPositions(), handleMarkerChanges); this._markers = markers; // add a handler for clicking in the globe - this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.getCanvas()); + this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); this._globeClickhandler.setInputAction( function (movement) { var pickedObject = scene.pick(movement.position); @@ -1617,7 +1617,7 @@ var DrawHelper = (function() { div.className = 'divider'; toolbar.appendChild(div); addIcon('clear', options.clearIcon, 'Remove all primitives', function() { - scene.getPrimitives().removeAll(); + scene.primitives.removeAll(); }); function addButton(button) { diff --git a/README.md b/README.md index 08f1dd4..430a25b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ cesium-drawhelper DrawHelper: A very early stage shape editor for Cesium. Currently limited to 2D and simple shapes. -Cesium version: Tested against b24. +Cesium version: Tested against b26. License: Apache 2.0. Free for commercial and non-commercial use. See LICENSE.md. diff --git a/index.html b/index.html index 1958d39..ab8b966 100644 --- a/index.html +++ b/index.html @@ -69,9 +69,9 @@ loggingMessage('Marker created at ' + event.position.toString()); // create one common billboard collection for all billboards var b = new Cesium.BillboardCollection(); - var a = scene.getContext().createTextureAtlas(); - b.setTextureAtlas(a); - scene.getPrimitives().add(b); + var a = scene.context.createTextureAtlas(); + b.textureAtlas = a; + scene.primitives.add(b); var image = new Image(); image.onload = function() { a.addImage(image); @@ -97,7 +97,7 @@ width: 5, geodesic: true }); - scene.getPrimitives().add(polyline); + scene.primitives.add(polyline); polyline.setEditable(); polyline.addListener('onEdited', function(event) { loggingMessage('Polyline edited, ' + event.positions.length + ' points'); @@ -110,7 +110,7 @@ positions: event.positions, material : Cesium.Material.fromType('Checkerboard') }); - scene.getPrimitives().add(polygon); + scene.primitives.add(polygon); polygon.setEditable(); polygon.addListener('onEdited', function(event) { loggingMessage('Polygon edited, ' + event.positions.length + ' points'); @@ -124,7 +124,7 @@ radius: event.radius, material: Cesium.Material.fromType(Cesium.Material.RimLightingType) }); - scene.getPrimitives().add(circle); + scene.primitives.add(circle); circle.setEditable(); circle.addListener('onEdited', function(event) { loggingMessage('Circle edited: radius is ' + event.radius.toFixed(1) + ' meters'); @@ -137,7 +137,7 @@ extent: extent, material: Cesium.Material.fromType(Cesium.Material.StripeType) }); - scene.getPrimitives().add(extentPrimitive); + scene.primitives.add(extentPrimitive); extentPrimitive.setEditable(); extentPrimitive.addListener('onEdited', function(event) { loggingMessage('Extent edited: extent is (N: ' + event.extent.north.toFixed(3) + ', E: ' + event.extent.east.toFixed(3) + ', S: ' + event.extent.south.toFixed(3) + ', W: ' + event.extent.west.toFixed(3) + ')');