/** * WebGL Earth 2.0 * =============== * Copyright (C) 2014 - Klokan Technologies GmbH * http://www.webglearth.org/ * Powered by Cesium ( http://www.webglearth.org/cesium ). Apache 2.0 license. */ CESIUM_BASE_URL = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//www.webglearth.com/v2/'; !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=_.map,f=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||f)&&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&&f&&f[i]&&(s=f[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(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,f,p,v={},g={},_={},y={},w=Object.prototype.hasOwnProperty,C=[].slice;f=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}},p={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,_,w=[];if(o=o||e,"function"==typeof r){for(t=!t.length&&r.length?["require","exports","module"]:t,m=0;m>>0,u=Math.max(0,Math.min(r,_)),h=[],c=_-u+1,d=[],m=a(),u)for(v=m.progress,p=function(e){d.push(e),--c||(f=p=g,m.reject(d))},f=function(e){h.push(e),--u||(f=p=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=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)})})},y.apply(t,i)})}function f(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 p(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,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=f,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,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/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),r("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),r("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",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.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),r("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";var i=function(t,i,n){var o=e(n),a=e(i),s=e(t);if(!s&&!a&&!o)throw new r("text, imageUrl or link is required");s||a||(t=n),this._text=t,this._imageUrl=i,this._link=n,this._hasLink=o,this._hasImage=a};return t(i.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}}}),i.prototype.hasImage=function(){return this._hasImage},i.prototype.hasLink=function(){return this._hasLink},i.equals=function(t,r){var i=!e(t),n=!e(r);return t===r||(i&&n||!i&&!n)&&t._text===r._text&&t._imageUrl===r._imageUrl&&t._link===r._link},i.prototype.equals=function(e){return i.equals(this,e)},i}),r("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),r("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),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",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],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){if(!r(e))throw new i("degrees is required.");return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){if(!r(e))throw new i("radians is required.");return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){if(!r(e))throw new i("angle is required.");var t=n.TWO_PI,o=e-Math.floor(e/t)*t;return o<-Math.PI?o+t:o>=Math.PI?o-t:o},n.negativePiToPi=function(e){if(!r(e))throw new i("x is required.");for(var t=n.EPSILON10,o=n.PI,a=n.TWO_PI;-(o+t)>e;)e+=a;if(-o>e)return-o;for(;e>o+t;)e-=a;return e>o?o:e},n.zeroToTwoPi=function(e){if(!r(e))throw new i("x is required.");var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,o){if(!r(e))throw new i("left is required.");if(!r(n))throw new i("right is required.");return o=t(o,0),Math.abs(e-n)<=o};var o=[1];n.factorial=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");var t=o.length;if(e>=t)for(var r=o[t-1],n=t;e>=n;n++)o.push(r*n);return o[e]},n.incrementWrap=function(e,n,o){if(o=t(o,0),!r(e))throw new i("n is required.");if(o>=n)throw new i("maximumValue must be greater than minimumValue.");return++e,e>n&&(e=o),e},n.isPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,n){if(!r(e))throw new i("value is required");if(!r(t))throw new i("min is required.");if(!r(n))throw new i("max is required.");return t>e?t:e>n?n:e};var a=new e;return n.setRandomNumberSeed=function(t){if(!r(t))throw new i("seed is required.");a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n}),r("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.x=e(t,0),this.y=e(r,0),this.z=e(i,0)};o.fromSpherical=function(i,n){if(!t(i))throw new r("spherical is required");t(n)||(n=new o);var a=i.clock,s=i.cone,l=e(i.magnitude,1),u=l*Math.sin(s);return n.x=u*Math.cos(a),n.y=u*Math.sin(a),n.z=l*Math.cos(s),n},o.fromElements=function(e,r,i,n){return t(n)?(n.x=e,n.y=r,n.z=i,n):new o(e,r,i)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.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.x,n[o++]=i.y,n[o]=i.z},o.unpack=function(i,n,a){if(!t(i))throw new r("array is required");return n=e(n,0),t(a)||(a=new o),a.x=i[n++],a.y=i[n++],a.z=i[n],a},o.fromArray=o.unpack,o.getMaximumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.max(e.x,e.y,e.z)},o.getMinimumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.min(e.x,e.y,e.z)},o.getMinimumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.min(e.x,i.x),n.y=Math.min(e.y,i.y),n.z=Math.min(e.z,i.z),n},o.getMaximumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.max(e.x,i.x),n.y=Math.max(e.y,i.y),n.z=Math.max(e.z,i.z),n},o.magnitudeSquared=function(e){if(!t(e))throw new r("cartesian is required");return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,i){if(!t(e)||!t(i))throw new r("left and right are required.");return o.subtract(e,i,a),o.magnitude(a)},o.normalize=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");var n=o.magnitude(e);return i.x=e.x/n,i.y=e.y/n,i.z=e.z/n,i},o.dot=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");return e.x*i.x+e.y*i.y+e.z*i.z},o.multiplyComponents=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x*i.x,n.y=e.y*i.y,n.z=e.z*i.z,n},o.add=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x+i.x,n.y=e.y+i.y,n.z=e.z+i.z,n},o.subtract=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x-i.x,n.y=e.y-i.y,n.z=e.z-i.z,n},o.multiplyByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x*i,n.y=e.y*i,n.z=e.z*i,n},o.divideByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x/i,n.y=e.y/i,n.z=e.z/i,n},o.negate=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=-e.x,i.y=-e.y,i.z=-e.z,i},o.abs=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=Math.abs(e.x),i.y=Math.abs(e.y),i.z=Math.abs(e.z),i};var s=new o;o.lerp=function(e,i,n,a){if(!t(e))throw new r("start is required.");if(!t(i))throw new r("end is required.");if("number"!=typeof n)throw new r("t is required and must be a number.");if(!t(a))throw new r("result is required.");return o.multiplyByScalar(i,n,s),a=o.multiplyByScalar(e,1-n,a),o.add(s,a,a)};var l=new o,u=new o;o.angleBetween=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");o.normalize(e,l),o.normalize(i,u);var n=o.dot(l,u),a=o.magnitude(o.cross(l,u,l));return Math.atan2(a,n)};var c=new o;o.mostOrthogonalAxis=function(e,i){if(!t(e))throw new r("cartesian is required.");if(!t(i))throw new r("result is required.");var n=o.normalize(e,c);return o.abs(n,n),i=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,i):o.clone(o.UNIT_Z,i):n.y<=n.z?o.clone(o.UNIT_Y,i):o.clone(o.UNIT_Z,i)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},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.x-i.x)<=n&&Math.abs(e.y-i.y)<=n&&Math.abs(e.z-i.z)<=n},o.cross=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");var o=e.x,a=e.y,s=e.z,l=i.x,u=i.y,c=i.z,h=a*c-s*u,d=s*l-o*c,m=o*u-a*l;return n.x=h,n.y=d,n.z=m,n},o.fromDegrees=function(e,i,a,s,l){if(!t(e))throw new r("longitude is required");if(!t(i))throw new r("latitude is required");var u=n.toRadians(e),c=n.toRadians(i);return o.fromRadians(u,c,a,s,l)};var h=new o,d=new o,m=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(i,n,a,s,l){if(!t(i))throw new r("longitude is required");if(!t(n))throw new r("latitude is required");a=e(a,0);var u=t(s)?s.radiiSquared:m,c=Math.cos(n);h.x=c*Math.cos(i),h.y=c*Math.sin(i),h.z=Math.sin(n),h=o.normalize(h,h),o.multiplyComponents(u,h,d);var f=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,f,d),h=o.multiplyByScalar(h,a,h),t(l)||(l=new o),o.add(d,h,l)},o.fromDegreesArray=function(e,i,a){if(!t(e))throw new r("positions is required.");for(var s=new Array(e.length),l=0;ls;s+=2){var l=e[s],u=e[s+1];n[s/2]=o.fromRadians(l,u,0,i,n[s/2])}return n},o.fromDegreesArrayHeights=function(e,i,a){if(!t(e))throw new r("positions is required.");if(e.length<3)throw new r("positions length cannot be less than 3.");if(0!==e.length%3)throw new r("positions length must be a multiple of 3.");for(var s=new Array(e.length),l=0;ls;s+=3){var l=e[s],u=e[s+1],c=e[s+2];n[s/3]=o.fromRadians(l,u,c,i,n[s/3])}return n},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),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.x+", "+this.y+", "+this.z+")"},o}),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.fromRadians=function(i,n,a,s){if(!t(i))throw new r("longitude is required.");if(!t(n))throw new r("latitude is required.");return a=e(a,0),t(s)?(s.longitude=i,s.latitude=n,s.height=a,s):new o(i,n,a)},o.fromDegrees=function(e,i,a,s){if(!t(e))throw new r("longitude is required.");if(!t(i))throw new r("latitude is required.");return e=n.toRadians(e),i=n.toRadians(i),o.fromRadians(e,i,a,s)},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",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t,i,n){if(t=r(t,0),i=r(i,0),n=r(n,0),0>t||0>i||0>n)throw new o("All radii components must be greater than or equal to zero.");this._radii=new e(t,i,n),this._radiiSquared=new e(t*t,i*i,n*n),this._radiiToTheFourth=new e(t*t*t*t,i*i*i*i,n*n*n*n),this._oneOverRadii=new e(0===t?0:1/t,0===i?0:1/i,0===n?0:1/n),this._oneOverRadiiSquared=new e(0===t?0:1/(t*t),0===i?0:1/(i*i),0===n?0:1/(n*n)),this._minimumRadius=Math.min(t,i,n),this._maximumRadius=Math.max(t,i,n),this._centerToleranceSquared=s.EPSILON1};n(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(t,r){if(!i(t))return void 0;var n=t._radii;return i(r)?(e.clone(n,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(n.x,n.y,n.z)},l.fromCartesian3=function(e){return i(e)?new l(e.x,e.y,e.z):new l},l.WGS84=a(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=a(new l(1,1,1)),l.MOON=a(new l(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){if(!i(t))throw new o("cartographic is required.");var n=t.longitude,a=t.latitude,s=Math.cos(a),l=s*Math.cos(n),u=s*Math.sin(n),c=Math.sin(a);return i(r)||(r=new e),r.x=l,r.y=u,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return i(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var u=new e,c=new e;l.prototype.cartographicToCartesian=function(t,r){var n=u,o=c;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),i(r)||(r=new e),e.add(o,n,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){if(!i(e))throw new o("cartographics is required.");var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;r>n;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var h=new e,d=new e,m=new e;l.prototype.cartesianToCartographic=function(r,n){var o=this.scaleToGeodeticSurface(r,d);if(!i(o))return void 0;var a=this.geodeticSurfaceNormal(o,h),l=e.subtract(r,o,m),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),f=s.sign(e.dot(l,r))*e.magnitude(l);return i(n)?(n.longitude=u,n.latitude=c,n.height=f,n):new t(u,c,f)},l.prototype.cartesianArrayToCartographicArray=function(e,t){if(!i(e))throw new o("cartesians is required.");var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;r>n;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t};var f=new e,p=new e;return l.prototype.scaleToGeodeticSurface=function(t,r){if(!i(t))throw new o("cartesian is required.");var n=t.x,a=t.y,l=t.z,u=this._oneOverRadii,c=u.x,h=u.y,d=u.z,m=n*n*c*c,v=a*a*h*h,g=l*l*d*d,_=m+v+g,y=Math.sqrt(1/_),w=e.multiplyByScalar(t,y,f);if(_s.EPSILON12);return i(r)?(r.x=n*A,r.y=a*M,r.z=l*D,r):new e(n*A,a*M,l*D)},l.prototype.scaleToGeocentricSurface=function(t,r){if(!i(t))throw new o("cartesian is required.");i(r)||(r=new e);var n=t.x,a=t.y,s=t.z,l=this._oneOverRadiiSquared,u=1/Math.sqrt(n*n*l.x+a*a*l.y+s*s*l.z);return e.multiplyByScalar(t,u,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||i(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l}),r("Core/Event",["./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){this._listeners=[],this._scopes=[]};return e(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length}}}),r.prototype.addEventListener=function(e,r){if("function"!=typeof e)throw new t("listener is required and must be a function.");this._listeners.push(e),this._scopes.push(r);var i=this;return function(){i.removeEventListener(e,r)}},r.prototype.removeEventListener=function(e,r){if("function"!=typeof e)throw new t("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)},r}),r("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r){this.x=e(t,0),this.y=e(r,0)};o.fromElements=function(e,r,i){return t(i)?(i.x=e,i.y=r,i):new o(e,r)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new o(e.x,e.y):void 0},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.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.x,n[o]=i.y},o.unpack=function(i,n,a){if(!t(i))throw new r("array is required");return n=e(n,0),t(a)||(a=new o),a.x=i[n++],a.y=i[n],a},o.fromArray=o.unpack,o.getMaximumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.max(e.x,e.y)},o.getMinimumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.min(e.x,e.y)},o.getMinimumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.min(e.x,i.x),n.y=Math.min(e.y,i.y),n},o.getMaximumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.max(e.x,i.x),n.y=Math.max(e.y,i.y),n},o.magnitudeSquared=function(e){if(!t(e))throw new r("cartesian is required");return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,i){if(!t(e)||!t(i))throw new r("left and right are required.");return o.subtract(e,i,a),o.magnitude(a)},o.normalize=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");var n=o.magnitude(e);return i.x=e.x/n,i.y=e.y/n,i},o.dot=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");return e.x*i.x+e.y*i.y},o.multiplyComponents=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x*i.x,n.y=e.y*i.y,n},o.add=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x+i.x,n.y=e.y+i.y,n},o.subtract=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x-i.x,n.y=e.y-i.y,n},o.multiplyByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x*i,n.y=e.y*i,n},o.divideByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x/i,n.y=e.y/i,n},o.negate=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=-e.x,i.y=-e.y,i},o.abs=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=Math.abs(e.x),i.y=Math.abs(e.y),i};var s=new o;o.lerp=function(e,i,n,a){if(!t(e))throw new r("start is required.");if(!t(i))throw new r("end is required.");if("number"!=typeof n)throw new r("t is required and must be a number.");if(!t(a))throw new r("result is required.");return o.multiplyByScalar(i,n,s),a=o.multiplyByScalar(e,1-n,a),o.add(s,a,a)};var l=new o,u=new o;o.angleBetween=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");return o.normalize(e,l),o.normalize(i,u),n.acosClamped(o.dot(l,u))};var c=new o;return o.mostOrthogonalAxis=function(e,i){if(!t(e))throw new r("cartesian is required.");if(!t(i))throw new r("result is required.");var n=o.normalize(e,c);return o.abs(n,n),i=n.x<=n.y?o.clone(o.UNIT_X,i):o.clone(o.UNIT_Y,i)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},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.x-i.x)<=n&&Math.abs(e.y-i.y)<=n},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),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.x+", "+this.y+")"},o}),r("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},s.prototype.unproject=function(e,r){if(!i(e))throw new o("cartesian is required");var n=this._oneOverSemimajorAxis,a=e.x*n,s=e.y*n,l=e.z;return i(r)?(r.longitude=a,r.latitude=s,r.height=l,r):new t(a,s,l)},s}),r("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./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 i("cartographics is required.");for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=0,c=e.length;c>u;u++){var h=e[u];n=Math.min(n,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),l=Math.max(l,h.latitude)}return r(t)?(t.west=n,t.south=a,t.east=o,t.north=l,t):new s(n,a,o,l)},s.packedLength=4,s.pack=function(e,n,o){if(!r(e))throw new i("value is required");if(!r(n))throw new i("array is required");o=t(o,0),n[o++]=e.west,n[o++]=e.south,n[o++]=e.east,n[o]=e.north},s.unpack=function(e,n,o){if(!r(e))throw new i("array is required");return n=t(n,0),r(o)||(o=new s),o.west=e[n++],o.south=e[n++],o.east=e[n++],o.north=e[n],o},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 i("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.validate=function(e){if(!r(e))throw new i("rectangle is required");var t=e.north;if("number"!=typeof t)throw new i("north is required to be a number.");if(t<-a.PI_OVER_TWO||t>a.PI_OVER_TWO)throw new i("north must be in the interval [-Pi/2, Pi/2].");var n=e.south;if("number"!=typeof n)throw new i("south is required to be a number.");if(n<-a.PI_OVER_TWO||n>a.PI_OVER_TWO)throw new i("south must be in the interval [-Pi/2, Pi/2].");var o=e.west;if("number"!=typeof o)throw new i("west is required to be a number.");if(o<-Math.PI||o>Math.PI)throw new i("west must be in the interval [-Pi, Pi].");var s=e.east;if("number"!=typeof s)throw new i("east is required to be a number.");if(s<-Math.PI||s>Math.PI)throw new i("east must be in the interval [-Pi, Pi].")},s.getSouthwest=function(t,n){if(!r(t))throw new i("rectangle is required");return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.getNorthwest=function(t,n){if(!r(t))throw new i("rectangle is required");return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.getNortheast=function(t,n){if(!r(t))throw new i("rectangle is required");return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.getSoutheast=function(t,n){if(!r(t))throw new i("rectangle is required");return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.getCenter=function(t,n){if(!r(t))throw new i("rectangle is required");return r(n)?(n.longitude=.5*(t.west+t.east),n.latitude=.5*(t.south+t.north),n.height=0,n):new e(.5*(t.west+t.east),.5*(t.south+t.north))},s.intersectWith=function(e,t,n){if(!r(e))throw new i("rectangle is required");if(!r(t))throw new i("otherRectangle is required.");var o=Math.max(e.west,t.west),a=Math.max(e.south,t.south),l=Math.min(e.east,t.east),u=Math.min(e.north,t.north);return r(n)?(n.west=o,n.south=a,n.east=l,n.north=u,n):new s(o,a,l,u)},s.contains=function(e,t){if(!r(e))throw new i("rectangle is required");if(!r(t))throw new i("cartographic is required.");return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},s.isEmpty=function(e){if(!r(e))throw new i("rectangle is required");return e.west>=e.east||e.south>=e.north};var l=new e;return s.subsample=function(e,o,s,u){if(!r(e))throw new i("rectangle is required");o=t(o,n.WGS84),s=t(s,0),r(u)||(u=[]);var c=0,h=e.north,d=e.south,m=e.east,f=e.west,p=l;p.height=s,p.longitude=f,p.latitude=h,u[c]=o.cartographicToCartesian(p,u[c]),c++,p.longitude=m,u[c]=o.cartographicToCartesian(p,u[c]),c++,p.latitude=d,u[c]=o.cartographicToCartesian(p,u[c]),c++,p.longitude=f,u[c]=o.cartographicToCartesian(p,u[c]),c++,p.latitude=0>h?h:d>0?d:0;for(var v=1;8>v;++v){var g=-Math.PI+v*a.PI_OVER_TWO;g>f&&m>g&&(p.longitude=g,u[c]=o.cartographicToCartesian(p,u[c]),c++)}return 0===p.latitude&&(p.longitude=f,u[c]=o.cartographicToCartesian(p,u[c]),c++,p.longitude=m,u[c]=o.cartographicToCartesian(p,u[c]),c++),u.length=c,u},s.MAX_VALUE=o(new s(-Math.PI,-a.PI_OVER_TWO,Math.PI,a.PI_OVER_TWO)),s}),r("Core/TilingScheme",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";var i=function(){throw new r("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")};return t(i.prototype,{ellipsoid:{get:r.throwInstantiationError},rectangle:{get:r.throwInstantiationError},projection:{get:r.throwInstantiationError}}),i.prototype.getNumberOfXTilesAtLevel=r.throwInstantiationError,i.prototype.getNumberOfYTilesAtLevel=r.throwInstantiationError,i.prototype.rectangleToNativeRectangle=r.throwInstantiationError,i.prototype.tileXYToNativeRectangle=r.throwInstantiationError,i.prototype.tileXYToRectangle=r.throwInstantiationError,i.prototype.positionToTileXY=r.throwInstantiationError,i}),r("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle","./TilingScheme"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)};return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<o.north||t.latitudeo.east)return void 0;var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=(o.east-o.west)/a,u=(o.north-o.south)/s,c=0|(t.longitude-o.west)/l;c>=a&&(c=a-1);var h=0|(o.north-t.latitude)/u;return h>=s&&(h=s-1),r(n)?(n.x=c,n.y=h,n):new e(c,h)},u}),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/HeightmapTessellator",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a){"use strict";var s={};return s.DEFAULT_STRUCTURE=o({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1}),s.computeVertices=function(o){if(!r(o)||!r(o.heightmap))throw new i("options.heightmap is required.");if(!r(o.width)||!r(o.height))throw new i("options.width and options.height are required.");if(!r(o.vertices))throw new i("options.vertices is required.");if(!r(o.nativeRectangle))throw new i("options.nativeRectangle is required.");if(!r(o.skirtHeight))throw new i("options.skirtHeight is required.");var l,u,c,h,d=Math.cos,m=Math.sin,f=Math.sqrt,p=Math.atan,v=Math.exp,g=a.PI_OVER_TWO,_=a.toRadians,y=o.vertices,w=o.heightmap,C=o.width,b=o.height,S=o.skirtHeight,x=t(o.isGeographic,!0),E=t(o.ellipsoid,n.WGS84),T=1/E.maximumRadius,P=o.nativeRectangle,A=o.rectangle;r(A)?(l=A.west,u=A.south,c=A.east,h=A.north):x?(l=_(P.west),u=_(P.south),c=_(P.east),h=_(P.north)):(l=P.west*T,u=g-2*p(v(-P.south*T)),c=P.east*T,h=g-2*p(v(-P.north*T)));var M=t(o.relativeToCenter,e.ZERO),D=t(o.structure,s.DEFAULT_STRUCTURE),I=t(D.heightScale,s.DEFAULT_STRUCTURE.heightScale),O=t(D.heightOffset,s.DEFAULT_STRUCTURE.heightOffset),R=t(D.elementsPerHeight,s.DEFAULT_STRUCTURE.elementsPerHeight),L=t(D.stride,s.DEFAULT_STRUCTURE.stride),N=t(D.elementMultiplier,s.DEFAULT_STRUCTURE.elementMultiplier),B=t(D.isBigEndian,s.DEFAULT_STRUCTURE.isBigEndian),F=(P.east-P.west)/(C-1),z=(P.north-P.south)/(b-1),V=E.radiiSquared,q=V.x,k=V.y,U=V.z,W=0,G=65536,H=-65536,j=0,Y=b,X=0,Z=C;S>0&&(--j,++Y,--X,++Z);for(var J=j;Y>J;++J){var Q=J;0>Q&&(Q=0),Q>=b&&(Q=b-1);var K=P.north-z*Q;K=x?_(K):g-2*p(v(-K*T));for(var $=d(K),et=m(K),tt=U*et,rt=(K-u)/(h-u),it=X;Z>it;++it){var nt=it;0>nt&&(nt=0),nt>=C&&(nt=C-1);var ot=P.west+F*nt;x?ot=_(ot):ot*=T;var at,st=Q*C*L+nt*L;if(1===R)at=w[st];else{at=0;var lt;if(B)for(lt=0;R>lt;++lt)at=at*N+w[st+lt];else for(lt=R-1;lt>=0;--lt)at=at*N+w[st+lt]}at=at*I+O,H=Math.max(H,at),G=Math.min(G,at),(it!==nt||J!==Q)&&(at-=S);var ut=$*d(ot),ct=$*m(ot),ht=q*ut,dt=k*ct,mt=f(ht*ut+dt*ct+tt*et),ft=1/mt,pt=ht*ft,vt=dt*ft,gt=tt*ft;y[W++]=pt+ut*at-M.x,y[W++]=vt+ct*at-M.y,y[W++]=gt+et*at-M.z,y[W++]=at;var _t=(ot-l)/(c-l);y[W++]=_t,y[W++]=rt}}return{maximumHeight:H,minimumHeight:G}},s}),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",["../ThirdParty/Uri","./defined","./DeveloperError","require"],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 i;if(i="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:n(),!t(i))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(i).resolve(new e(document.location.href))}function a(e){return i.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}var l,u,c,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(e){t(u)||(u=t(i.toUrl)?a:s),t(c)||(c=document.createElement("a"));var r=u(e);return c.href=r,c.href=c.href,c.href};return d._cesiumScriptRegex=h,d}),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/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",["../ThirdParty/Uri","../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./isCrossOriginUrl","require"],function(e,t,r,i,n,o,a,s){"use strict";function l(){if(!n(f._canTransferArrayBuffer)){var e=new Worker(c("Workers/transferTypedArrayTest.js"));e.postMessage=i(e.webkitPostMessage,e.postMessage);var r=99,o=new Int8Array([r]);try{e.postMessage({array:o},[o.buffer])}catch(a){return f._canTransferArrayBuffer=!1,f._canTransferArrayBuffer}var s=t.defer();e.onmessage=function(t){var i=t.data.array,o=n(i)&&i[0]===r;s.resolve(o),e.terminate(),f._canTransferArrayBuffer=o},f._canTransferArrayBuffer=s.promise}return f._canTransferArrayBuffer}function u(e,t){--e._activeTasks;var r=t.id;if(n(r)){var i=e._deferreds,o=i[r];n(t.error)?o.reject(t.error):o.resolve(t.result),delete i[r]}}function c(e){var t=r(e);if(a(t)){var i,n='importScripts("'+t+'");';try{i=new Blob([n],{type:"application/javascript"})}catch(o){var s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,l=new s;l.append(n),i=l.getBlob("application/javascript")}var u=window.URL||window.webkitURL;t=u.createObjectURL(i)}return t}function h(){return n(m)||(m=c("Workers/cesiumWorkerBootstrapper.js")),m}function d(t){var o=new Worker(h());o.postMessage=i(o.webkitPostMessage,o.postMessage);var a={loaderConfig:{},workerModule:f._workerModulePrefix+t._workerName};if(n(f._loaderConfig))a.loaderConfig=f._loaderConfig;else if(n(s.toUrl)){var l=new e("..").resolve(new e(r("Workers/cesiumWorkerBootstrapper.js"))).toString();a.loaderConfig.baseUrl=l}else a.loaderConfig.paths={Workers:r("Workers")};return o.postMessage(a),o.onmessage=function(e){u(t,e.data)},o}var m,f=function(e,t){this._workerName=e,this._maximumActiveTasks=i(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0},p=[];return f.prototype.scheduleTask=function(e,r){if(n(this._worker)||(this._worker=d(this)),this._activeTasks>=this._maximumActiveTasks)return void 0;++this._activeTasks;var i=this;return t(l(),function(o){n(r)?o||(r.length=0):r=p;var a=i._nextID++,s=t.defer();return i._deferreds[a]=s,i._worker.postMessage({id:a,parameters:e,canTransferArrayBuffer:o},r),s.promise})},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return n(this._worker)&&this._worker.terminate(),o(this)},f._defaultWorkerModulePrefix="Workers/",f._workerModulePrefix=f._defaultWorkerModulePrefix,f._loaderConfig=void 0,f._canTransferArrayBuffer=void 0,f}),r("Core/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("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";var i=function(){r.throwInstantiationError()};t(i.prototype,{errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},ready:{get:r.throwInstantiationError}});var n=[];return i.getRegularGridIndices=function(t,i){if(t*i>65536)throw new r("The total number of vertices (width * height) must be less than or equal to 65536.");var o=n[t];e(o)||(n[t]=o=[]);var a=o[i];if(!e(a)){a=o[i]=new Uint16Array(6*(t-1)*(i-1));for(var s=0,l=0,u=0;i-1>u;++u){for(var c=0;t-1>c;++c){var h=s,d=h+t,m=d+1,f=h+1;a[l++]=h,a[l++]=d,a[l++]=f,a[l++]=f,a[l++]=d,a[l++]=m,++s}++s}}return a},i.heightmapTerrainQuality=.25,i.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*i.heightmapTerrainQuality/(t*r)},i.prototype.requestTileGeometry=r.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=r.throwInstantiationError,i.prototype.hasWaterMask=r.throwInstantiationError,i}),r("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainMesh","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(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,f=1<1)for(_=b;S>=_;++_)for(g=w;C>=g;++g)for(var R=(_*l+g)*O,L=0;O>L;++L)D[I++]=T[R+L];else for(_=b;S>=_;++_)for(g=w;C>=g;++g)D[I++]=T[_*l+g];return new y({buffer:D,width:x,height:E,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function m(e,t,r,i,n,o,a,l){var u,c,h,d,m=e._width,v=e._height,g=e._structure,w=g.stride,C=e._buffer,b=new C.constructor(m*v*w),S=t.tileXYToRectangle(r,i,n),x=t.tileXYToRectangle(o,a,l);if(w>1){var E=g.elementsPerHeight,T=g.elementMultiplier,P=g.isBigEndian,A=Math.pow(T,E-1);for(c=0;v>c;++c)for(h=s.lerp(x.north,x.south,c/(v-1)),u=0;m>u;++u){d=s.lerp(x.west,x.east,u/(m-1));var M=p(C,E,T,w,P,S,m,v,d,h);_(b,E,T,A,w,P,c*m+u,M)}}else for(c=0;v>c;++c)for(h=s.lerp(x.north,x.south,c/(v-1)),u=0;m>u;++u)d=s.lerp(x.west,x.east,u/(m-1)),b[c*m+u]=f(C,S,m,v,d,h);return new y({buffer:b,width:m,height:v,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function f(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],p=e[c*r+u],g=e[h*r+l],_=e[h*r+u];return v(d,m,f,p,g,_)}function p(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 f=0|h,p=f+1;p>=s&&(p=s-1,f=s-2);var _=c-d,y=h-f;f=s-1-f,p=s-1-p;var w=g(e,t,r,i,n,f*a+d),C=g(e,t,r,i,n,f*a+m),b=g(e,t,r,i,n,p*a+d),S=g(e,t,r,i,n,p*a+m);return v(_,y,w,C,b,S)}function v(e,t,r,i,n,o){return e>t?r+e*(i-r)+t*(o-i):r+e*(o-n)+t*(n-r)}function g(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 _(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(e){if(!r(e)||!r(e.buffer))throw new n("options.buffer is required.");if(!r(e.width))throw new n("options.width is required.");if(!r(e.height))throw new n("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var i=a.DEFAULT_STRUCTURE,o=e.structure;r(o)?o!==i&&(o.heightScale=t(o.heightScale,i.heightScale),o.heightOffset=t(o.heightOffset,i.heightOffset),o.elementsPerHeight=t(o.elementsPerHeight,i.elementsPerHeight),o.stride=t(o.stride,i.stride),o.elementMultiplier=t(o.elementMultiplier,i.elementMultiplier),o.isBigEndian=t(o.isBigEndian,i.isBigEndian)):o=i,this._structure=o,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask};i(y.prototype,{waterMask:{get:function(){return this._waterMask}}});var w=new u("createVerticesFromHeightmap");return y.prototype.createMesh=function(t,i,a,s){if(!r(t))throw new n("tilingScheme is required.");if(!r(i))throw new n("x is required.");if(!r(a))throw new n("y is required.");if(!r(s))throw new n("level is required.");var u=t.ellipsoid,d=t.tileXYToNativeRectangle(i,a,s),m=t.tileXYToRectangle(i,a,s),f=u.cartographicToCartesian(l.getCenter(m)),p=this._structure,v=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(u,this._width,t.getNumberOfXTilesAtLevel(0)),g=v/(1<1){var l=a.elementsPerHeight,u=a.elementMultiplier,c=a.isBigEndian;i=p(this._buffer,l,u,s,c,e,n,o,t,r)}else i=f(this._buffer,e,n,o,t,r);return i*a.heightScale+a.heightOffset},y.prototype.upsample=function(e,t,i,o,a,s,l){if(!r(e))throw new n("tilingScheme is required.");if(!r(t))throw new n("thisX is required.");if(!r(i))throw new n("thisY is required.");if(!r(o))throw new n("thisLevel is required.");if(!r(a))throw new n("descendantX is required.");if(!r(s))throw new n("descendantY is required.");if(!r(l))throw new n("descendantLevel is required.");var u=l-o;if(u>1)throw new n("Upsampling through more than one level at a time is not currently supported.");var c;return c=1===this._width%2&&1===this._height%2?d(this,e,t,i,o,a,s,l):m(this,e,t,i,o,a,s,l)},y.prototype.isChildAvailable=function(e,t,i,o){if(!r(e))throw new n("thisX is required.");if(!r(t))throw new n("thisY is required.");if(!r(i))throw new n("childX is required.");if(!r(o))throw new n("childY is required.");var a=2;return i!==2*e&&++a,o!==2*t&&(a-=2),0!==(this._childTileMask&1<a?void 0:(s[o]=l+1,e(n(r),function(e){return s[o]--,e},function(t){return s[o]--,e.reject(t)}))}var o,a=6,s={};return n}),r("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f){"use strict";var p=function(e){if(!i(e)||!i(e.url))throw new o("options.url is required.");this._url=e.url,this._token=e.token,this._tilingScheme=e.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:r(e.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=e.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0},this._errorEvent=new s;var n=e.credit;"string"==typeof n&&(n=new t(n)),this._credit=n};return n(p.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}}}),p.prototype.requestTileGeometry=function(t,r,n){var o=this._tilingScheme.tileXYToRectangle(t,r,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=d.toDegrees(o.west)+"%2C"+d.toDegrees(o.south)+"%2C"+d.toDegrees(o.east)+"%2C"+d.toDegrees(o.north),m=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(m+="&token="+this._token);var p=this._proxy;i(p)&&(m=p.getURL(m));var v=f(m,h);if(!i(v))return void 0;var g=this;return e(v,function(e){return new c({buffer:u(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})},p.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<d;d++){var m=t[d],f=m.x,p=m.y,v=m.z;n=Math.min(f,n),l=Math.max(f,l),a=Math.min(p,a),u=Math.max(p,u),s=Math.min(v,s),c=Math.max(v,c)}var g=i.minimum;g.x=n,g.y=a,g.z=s;var _=i.maximum;_.x=l,_.y=u,_.z=c;var y=e.add(g,_,i.center);return e.multiplyByScalar(y,.5,y),i},o.clone=function(t,i){return r(t)?r(i)?(i.minimum=e.clone(t.minimum,i.minimum),i.maximum=e.clone(t.maximum,i.maximum),i.center=e.clone(t.center,i.center),i):new o(t.minimum,t.maximum):void 0},o.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.center,i.center)&&e.equals(t.minimum,i.minimum)&&e.equals(t.maximum,i.maximum)};var a=new e;return o.intersect=function(t,o){if(!r(t))throw new i("box is required.");if(!r(o))throw new i("plane is required.");a=e.subtract(t.maximum,t.minimum,a);var s=e.multiplyByScalar(a,.5,a),l=s.x*Math.abs(o.x)+s.y*Math.abs(o.y)+s.z*Math.abs(o.z),u=e.dot(t.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/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,t,i,n){this.x=r(e,0),this.y=r(t,0),this.width=r(i,0),this.height=r(n,0)};l.fromPoints=function(e,t){if(i(t)||(t=new l),!i(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var r=e.length,n=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;r>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),s=Math.max(d,s)}return t.x=n,t.y=o,t.width=a-n,t.height=s-o,t};var u=new o,c=new t,h=new t;return l.fromRectangle=function(t,n,o){if(i(o)||(o=new l),!i(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=r(n,u);var a=n.project(s.getSouthwest(t,c)),d=n.project(s.getNortheast(t,h));return e.subtract(d,a,d),o.x=a.x,o.y=a.y,o.width=d.x,o.height=d.y,o},l.clone=function(e,t){return i(e)?i(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height):void 0},l.union=function(e,t,r){if(!i(e))throw new n("left is required.");if(!i(t))throw new n("right is required.");i(r)||(r=new l);var o=Math.min(e.x,t.x),a=Math.min(e.y,t.y),s=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return r.x=o,r.y=a,r.width=s-o,r.height=u-a,r},l.expand=function(e,t,r){if(!i(e))throw new n("rectangle is required.");if(!i(t))throw new n("point is required.");r=l.clone(e,r);var o=t.x-r.x,a=t.y-r.y;return o>r.width?r.width=o:0>o&&(r.width-=o,r.x=t.x),a>r.height?r.height=a:0>a&&(r.height-=a,r.y=t.y),r},l.intersect=function(e,t){if(!i(e))throw new n("left is required.");if(!i(t))throw new n("right is required.");var r=e.x,o=e.y,s=t.x,l=t.y;return r>s+t.width||r+e.widthl+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e) },l.prototype.equals=function(e){return l.equals(this,e)},l}),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.fromColor=function(e,i){if(!t(e))throw new r("color is required");return t(i)?(i.x=e.red,i.y=e.green,i.z=e.blue,i.w=e.alpha,i):new n(e.red,e.green,e.blue,e.alpha)},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(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.x,n[o++]=i.y,n[o++]=i.z,n[o]=i.w},n.unpack=function(i,o,a){if(!t(i))throw new r("array is required");return o=e(o,0),t(a)||(a=new n),a.x=i[o++],a.y=i[o++],a.z=i[o++],a.w=i[o],a},n.fromArray=n.unpack,n.getMaximumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.max(e.x,e.y,e.z,e.w)},n.getMinimumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.min(e.x,e.y,e.z,e.w)},n.getMinimumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.min(e.x,i.x),n.y=Math.min(e.y,i.y),n.z=Math.min(e.z,i.z),n.w=Math.min(e.w,i.w),n},n.getMaximumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.max(e.x,i.x),n.y=Math.max(e.y,i.y),n.z=Math.max(e.z,i.z),n.w=Math.max(e.w,i.w),n},n.magnitudeSquared=function(e){if(!t(e))throw new r("cartesian is required");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,i){if(!t(e)||!t(i))throw new r("left and right are required.");return n.subtract(e,i,o),n.magnitude(o)},n.normalize=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");var o=n.magnitude(e);return i.x=e.x/o,i.y=e.y/o,i.z=e.z/o,i.w=e.w/o,i},n.dot=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");return e.x*i.x+e.y*i.y+e.z*i.z+e.w*i.w},n.multiplyComponents=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x*i.x,n.y=e.y*i.y,n.z=e.z*i.z,n.w=e.w*i.w,n},n.add=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x+i.x,n.y=e.y+i.y,n.z=e.z+i.z,n.w=e.w+i.w,n},n.subtract=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x-i.x,n.y=e.y-i.y,n.z=e.z-i.z,n.w=e.w-i.w,n},n.multiplyByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x*i,n.y=e.y*i,n.z=e.z*i,n.w=e.w*i,n},n.divideByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x/i,n.y=e.y/i,n.z=e.z/i,n.w=e.w/i,n},n.negate=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=-e.x,i.y=-e.y,i.z=-e.z,i.w=-e.w,i},n.abs=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=Math.abs(e.x),i.y=Math.abs(e.y),i.z=Math.abs(e.z),i.w=Math.abs(e.w),i};var a=new n;n.lerp=function(e,i,o,s){if(!t(e))throw new r("start is required.");if(!t(i))throw new r("end is required.");if("number"!=typeof o)throw new r("t is required and must be a number.");if(!t(s))throw new r("result is required.");return n.multiplyByScalar(i,o,a),s=n.multiplyByScalar(e,1-o,s),n.add(a,s,s)};var s=new n;return n.mostOrthogonalAxis=function(e,i){if(!t(e))throw new r("cartesian is required.");if(!t(i))throw new r("result is required.");var o=n.normalize(e,s);return n.abs(o,o),i=o.x<=o.y?o.x<=o.z?o.x<=o.w?n.clone(n.UNIT_X,i):n.clone(n.UNIT_W,i):o.z<=o.w?n.clone(n.UNIT_Z,i):n.clone(n.UNIT_W,i):o.y<=o.z?o.y<=o.w?n.clone(n.UNIT_Y,i):n.clone(n.UNIT_W,i):o.z<=o.w?n.clone(n.UNIT_Z,i):n.clone(n.UNIT_W,i)},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,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.x-i.x)<=n&&Math.abs(e.y-i.y)<=n&&Math.abs(e.z-i.z)<=n&&Math.abs(e.w-i.w)<=n},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(m[r],d[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(m[a],d[a])]);s>i&&(n=a,i=s)}var l=1,c=0,h=d[n],f=m[n];if(Math.abs(e[u.getElementIndex(f,h)])>r){var p,v=e[u.getElementIndex(f,f)],g=e[u.getElementIndex(h,h)],_=e[u.getElementIndex(f,h)],y=(v-g)/2/_;p=0>y?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),l=1/Math.sqrt(1+p*p),c=p*l}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(h,h)]=t[u.getElementIndex(f,f)]=l,t[u.getElementIndex(f,h)]=c,t[u.getElementIndex(h,f)]=-c,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,n,o){if(!r(e))throw new i("array is required");return n=t(n,0),r(o)||(o=new u),o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],o[3]=e[n+3],o[4]=e[n+4],o[5]=e[n+5],o[6]=e[n+6],o[7]=e[n+7],o[8]=e[n+8],o[9]=e[n+9],o},u.fromColumnMajorArray=function(e,t){if(!r(e))throw new i("values parameter is required");return u.clone(e,t)},u.fromRowMajorArray=function(e,t){if(!r(e))throw new i("values is required.");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){if(!r(e))throw new i("quaternion is required");var n=e.x*e.x,o=e.x*e.y,a=e.x*e.z,s=e.x*e.w,l=e.y*e.y,c=e.y*e.z,h=e.y*e.w,d=e.z*e.z,m=e.z*e.w,f=e.w*e.w,p=n-l-d+f,v=2*(o-m),g=2*(a+h),_=2*(o+m),y=-n+l-d+f,w=2*(c-s),C=2*(a-h),b=2*(c+s),S=-n-l+d+f;return r(t)?(t[0]=p,t[1]=_,t[2]=C,t[3]=v,t[4]=y,t[5]=b,t[6]=g,t[7]=w,t[8]=S,t):new u(p,v,g,_,y,w,C,b,S)},u.fromScale=function(e,t){if(!r(e))throw new i("scale is required.");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){if("number"!=typeof e)throw new i("scale is required.");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){if(!r(e))throw new i("angle is required.");var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new u(1,0,0,0,n,-o,0,o,n)},u.fromRotationY=function(e,t){if(!r(e))throw new i("angle is required.");var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new u(n,0,o,0,1,0,-o,0,n)},u.fromRotationZ=function(e,t){if(!r(e))throw new i("angle is required.");var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-o,0,o,n,0,0,0,1)},u.toArray=function(e,t){if(!r(e))throw new i("matrix is required");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){if("number"!=typeof t||0>t||t>2)throw new i("row must be 0, 1, or 2.");if("number"!=typeof e||0>e||e>2)throw new i("column must be 0, 1, or 2.");return 3*e+t},u.getColumn=function(t,n,o){if(!r(t))throw new i("matrix is required.");if("number"!=typeof n||0>n||n>2)throw new i("index must be 0, 1, or 2.");var a=3*n,s=t[a],l=t[a+1],u=t[a+2];return r(o)?(o.x=s,o.y=l,o.z=u,o):new e(s,l,u)},u.setColumn=function(e,t,n,o){if(!r(e))throw new i("matrix is required");if(!r(n))throw new i("cartesian is required");if("number"!=typeof t||0>t||t>2)throw new i("index must be 0, 1, or 2.");o=u.clone(e,o);var a=3*t;return o[a]=n.x,o[a+1]=n.y,o[a+2]=n.z,o},u.getRow=function(t,n,o){if(!r(t))throw new i("matrix is required.");if("number"!=typeof n||0>n||n>2)throw new i("index must be 0, 1, or 2.");var a=t[n],s=t[n+3],l=t[n+6];return r(o)?(o.x=a,o.y=s,o.z=l,o):new e(a,s,l)},u.setRow=function(e,t,n,o){if(!r(e))throw new i("matrix is required");if(!r(n))throw new i("cartesian is required");if("number"!=typeof t||0>t||t>2)throw new i("index must be 0, 1, or 2.");return o=u.clone(e,o),o[t]=n.x,o[t+3]=n.y,o[t+6]=n.z,o};var c=new e;u.getScale=function(t,n){if(!r(t))throw new i("matrix is required.");return r(n)||(n=new e),n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),n};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.getMaximumComponent(h)},u.multiply=function(e,t,n){if(!r(e))throw new i("left is required");if(!r(t))throw new i("right is required");var o=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],s=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],l=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],c=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],h=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],d=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],m=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r(n)?(n[0]=o,n[1]=a,n[2]=s,n[3]=l,n[4]=c,n[5]=h,n[6]=d,n[7]=m,n[8]=f,n):new u(o,l,d,a,c,m,s,h,f)},u.multiplyByVector=function(t,n,o){if(!r(t))throw new i("matrix is required");if(!r(n))throw new i("cartesian is required");var a=n.x,s=n.y,l=n.z,u=t[0]*a+t[3]*s+t[6]*l,c=t[1]*a+t[4]*s+t[7]*l,h=t[2]*a+t[5]*s+t[8]*l;return r(o)?(o.x=u,o.y=c,o.z=h,o):new e(u,c,h)},u.multiplyByScalar=function(e,t,n){if(!r(e))throw new i("matrix is required");if("number"!=typeof t)throw new i("scalar must be a number");return r(n)?(n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n):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){if(!r(e))throw new i("matrix is required");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){if(!r(e))throw new i("matrix is required");var n=e[0],o=e[3],a=e[6],s=e[1],l=e[4],c=e[7],h=e[2],d=e[5],m=e[8];return r(t)?(t[0]=n,t[1]=o,t[2]=a,t[3]=s,t[4]=l,t[5]=c,t[6]=h,t[7]=d,t[8]=m,t):new u(n,s,h,o,l,d,a,c,m)};var d=[1,0,0],m=[2,2,1],f=new u,p=new u;return u.getEigenDecomposition=function(e,t){if(!r(e))throw new i("matrix is required.");var n=o.EPSILON20,c=10,h=0,d=0;r(t)||(t={});for(var m=t.unitary=u.clone(u.IDENTITY,t.unitary),v=t.diagonal=u.clone(e,t.diagonal),g=n*a(v);c>d&&s(v)>g;)l(v,f),u.transpose(f,p),u.multiply(v,f,v),u.multiply(p,v,v),u.multiply(m,f,m),++h>2&&(++d,h=0);return t},u.abs=function(e,t){if(!r(e))throw new i("matrix is required");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],f=e[8],p=u.determinant(e);if(Math.abs(p)<=o.EPSILON15)throw new i("matrix is not invertible");r(t)||(t=new u),t[0]=c*f-m*h,t[1]=m*s-a*f,t[2]=a*h-c*s,t[3]=d*h-l*f,t[4]=n*f-d*s,t[5]=l*s-n*h,t[6]=l*m-d*c,t[7]=d*a-n*m,t[8]=n*c-l*a;var v=1/p;return u.multiplyByScalar(t,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,n){if("number"!=typeof n)throw new i("epsilon must be a number");return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},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,f,p,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(f,0),this[8]=r(i,0),this[9]=r(s,0),this[10]=r(h,0),this[11]=r(p,0),this[12]=r(n,0),this[13]=r(l,0),this[14]=r(d,0),this[15]=r(v,0)};u.packedLength=16,u.pack=function(e,t,o){if(!i(e))throw new n("value is required");if(!i(t))throw new n("array is required");o=r(o,0),t[o++]=e[0],t[o++]=e[1],t[o++]=e[2],t[o++]=e[3],t[o++]=e[4],t[o++]=e[5],t[o++]=e[6],t[o++]=e[7],t[o++]=e[8],t[o++]=e[9],t[o++]=e[10],t[o++]=e[11],t[o++]=e[12],t[o++]=e[13],t[o++]=e[14],t[o]=e[15]},u.unpack=function(e,t,o){if(!i(e))throw new n("array is required");return t=r(t,0),i(o)||(o=new u),o[0]=e[t++],o[1]=e[t++],o[2]=e[t++],o[3]=e[t++],o[4]=e[t++],o[5]=e[t++],o[6]=e[t++],o[7]=e[t++],o[8]=e[t++],o[9]=e[t++],o[10]=e[t++],o[11]=e[t++],o[12]=e[t++],o[13]=e[t++],o[14]=e[t++],o[15]=e[t],o},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=u.unpack,u.fromColumnMajorArray=function(e,t){if(!i(e))throw new n("values is required");return u.clone(e,t)},u.fromRowMajorArray=function(e,t){if(!i(e))throw new n("values is required.");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){if(!i(e))throw new n("rotation is required.");if(!i(t))throw new n("translation is required.");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,o){if(!i(e))throw new n("translation is required.");if(!i(t))throw new n("rotation is required.");if(!i(r))throw new n("scale is required.");i(o)||(o=new u);var a=r.x,s=r.y,l=r.z,c=t.x*t.x,h=t.x*t.y,d=t.x*t.z,m=t.x*t.w,f=t.y*t.y,p=t.y*t.z,v=t.y*t.w,g=t.z*t.z,_=t.z*t.w,y=t.w*t.w,w=c-f-g+y,C=2*(h-_),b=2*(d+v),S=2*(h+_),x=-c+f-g+y,E=2*(p-m),T=2*(d-v),P=2*(p+m),A=-c-f+g+y;return o[0]=w*a,o[1]=S*a,o[2]=T*a,o[3]=0,o[4]=C*s,o[5]=x*s,o[6]=P*s,o[7]=0,o[8]=b*l,o[9]=E*l,o[10]=A*l,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.fromScale=function(e,t){if(!i(e))throw new n("scale is required.");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){if("number"!=typeof e)throw new n("scale is required.");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){if(!i(t))throw new n("camera is required.");var o=t.eye,a=t.target,s=t.up;if(!i(o))throw new n("camera.eye is required.");if(!i(a))throw new n("camera.target is required.");if(!i(s))throw new n("camera.up is required.");e.normalize(e.subtract(a,o,c),c),e.normalize(e.cross(c,s,h),h),e.normalize(e.cross(h,c,d),d);var l=h.x,m=h.y,f=h.z,p=c.x,v=c.y,g=c.z,_=d.x,y=d.y,w=d.z,C=o.x,b=o.y,S=o.z,x=l*-C+m*-b+f*-S,E=_*-C+y*-b+w*-S,T=p*C+v*b+g*S;return i(r)?(r[0]=l,r[1]=_,r[2]=-p,r[3]=0,r[4]=m,r[5]=y,r[6]=-v,r[7]=0,r[8]=f,r[9]=w,r[10]=-g,r[11]=0,r[12]=x,r[13]=E,r[14]=T,r[15]=1,r):new u(l,m,f,x,_,y,w,E,-p,-v,-g,T,0,0,0,1)},u.computePerspectiveFieldOfView=function(e,t,r,o,a){if(0>=e||e>Math.PI)throw new n("fovY must be in [0, PI).");if(0>=t)throw new n("aspectRatio must be greater than zero.");if(0>=r)throw new n("near must be greater than zero.");if(0>=o)throw new n("far must be greater than zero.");var s=Math.tan(.5*e),l=1/s,c=l/t,h=(o+r)/(r-o),d=2*o*r/(r-o);return i(a)?(a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=h,a[11]=-1,a[12]=0,a[13]=0,a[14]=d,a[15]=0,a):new u(c,0,0,0,0,l,0,0,0,0,h,d,0,0,-1,0)},u.computeOrthographicOffCenter=function(e,t,r,o,a,s,l){if(!i(e))throw new n("left is required.");if(!i(t))throw new n("right is required.");if(!i(r))throw new n("bottom is required.");if(!i(o))throw new n("top is required.");if(!i(a))throw new n("near is required.");if(!i(s))throw new n("far is required.");var c=1/(t-e),h=1/(o-r),d=1/(s-a),m=-(t+e)*c,f=-(o+r)*h,p=-(s+a)*d;return c*=2,h*=2,d*=-2,i(l)?(l[0]=c,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=h,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=d,l[11]=0,l[12]=m,l[13]=f,l[14]=p,l[15]=1,l):new u(c,0,0,m,0,h,0,f,0,0,d,p,0,0,0,1)},u.computePerspectiveOffCenter=function(e,t,r,o,a,s,l){if(!i(e))throw new n("left is required.");if(!i(t))throw new n("right is required.");if(!i(r))throw new n("bottom is required.");if(!i(o))throw new n("top is required.");if(!i(a))throw new n("near is required.");if(!i(s))throw new n("far is required.");var c=2*a/(t-e),h=2*a/(o-r),d=(t+e)/(t-e),m=(o+r)/(o-r),f=-(s+a)/(s-a),p=-1,v=-2*s*a/(s-a);return i(l)?(l[0]=c,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=h,l[6]=0,l[7]=0,l[8]=d,l[9]=m,l[10]=f,l[11]=p,l[12]=0,l[13]=0,l[14]=v,l[15]=0,l):new u(c,0,d,0,0,h,m,0,0,0,f,v,0,0,p,0)},u.computeInfinitePerspectiveOffCenter=function(e,t,r,o,a,s){if(!i(e))throw new n("left is required.");if(!i(t))throw new n("right is required.");if(!i(r))throw new n("bottom is required.");if(!i(o))throw new n("top is required.");if(!i(a))throw new n("near is required.");var l=2*a/(t-e),c=2*a/(o-r),h=(t+e)/(t-e),d=(o+r)/(o-r),m=-1,f=-1,p=-2*a;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]=f,s[12]=0,s[13]=0,s[14]=p,s[15]=0,s):new u(l,0,h,0,0,c,d,0,0,0,m,p,0,0,f,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),f=h,p=d,v=m,g=a+h,_=s+d,y=t+m,w=1;return i(o)?(o[0]=f,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=p,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]=w,o):new u(f,0,0,g,0,p,0,_,0,0,v,y,0,0,0,w)},u.toArray=function(e,t){if(!i(e))throw new n("matrix is required");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){if("number"!=typeof t||0>t||t>3)throw new n("row must be 0, 1, 2, or 3.");if("number"!=typeof e||0>e||e>3)throw new n("column must be 0, 1, 2, or 3.");return 4*e+t},u.getColumn=function(e,r,o){if(!i(e))throw new n("matrix is required.");if("number"!=typeof r||0>r||r>3)throw new n("index must be 0, 1, 2, or 3.");var a=4*r,s=e[a],l=e[a+1],u=e[a+2],c=e[a+3];return i(o)?(o.x=s,o.y=l,o.z=u,o.w=c,o):new t(s,l,u,c)},u.setColumn=function(e,t,r,o){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");if("number"!=typeof t||0>t||t>3)throw new n("index must be 0, 1, 2, or 3.");o=u.clone(e,o);var a=4*t;return o[a]=r.x,o[a+1]=r.y,o[a+2]=r.z,o[a+3]=r.w,o},u.getRow=function(e,r,o){if(!i(e))throw new n("matrix is required.");if("number"!=typeof r||0>r||r>3)throw new n("index must be 0, 1, 2, or 3.");var a=e[r],s=e[r+4],l=e[r+8],u=e[r+12];return i(o)?(o.x=a,o.y=s,o.z=l,o.w=u,o):new t(a,s,l,u)},u.setRow=function(e,t,r,o){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");if("number"!=typeof t||0>t||t>3)throw new n("index must be 0, 1, 2, or 3.");return o=u.clone(e,o),o[t]=r.x,o[t+4]=r.y,o[t+8]=r.z,o[t+12]=r.w,o};var m=new e;u.getScale=function(t,r){if(!i(t))throw new n("matrix is required.");return i(r)||(r=new e),r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),r};var f=new e;u.getMaximumScale=function(t){return u.getScale(t,f),e.getMaximumComponent(f)},u.multiply=function(e,t,r){if(!i(e))throw new n("left is required");if(!i(t))throw new n("right is required");var o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],h=e[5],d=e[6],m=e[7],f=e[8],p=e[9],v=e[10],g=e[11],_=e[12],y=e[13],w=e[14],C=e[15],b=t[0],S=t[1],x=t[2],E=t[3],T=t[4],P=t[5],A=t[6],M=t[7],D=t[8],I=t[9],O=t[10],R=t[11],L=t[12],N=t[13],B=t[14],F=t[15],z=o*b+c*S+f*x+_*E,V=a*b+h*S+p*x+y*E,q=s*b+d*S+v*x+w*E,k=l*b+m*S+g*x+C*E,U=o*T+c*P+f*A+_*M,W=a*T+h*P+p*A+y*M,G=s*T+d*P+v*A+w*M,H=l*T+m*P+g*A+C*M,j=o*D+c*I+f*O+_*R,Y=a*D+h*I+p*O+y*R,X=s*D+d*I+v*O+w*R,Z=l*D+m*I+g*O+C*R,J=o*L+c*N+f*B+_*F,Q=a*L+h*N+p*B+y*F,K=s*L+d*N+v*B+w*F,$=l*L+m*N+g*B+C*F;return i(r)?(r[0]=z,r[1]=V,r[2]=q,r[3]=k,r[4]=U,r[5]=W,r[6]=G,r[7]=H,r[8]=j,r[9]=Y,r[10]=X,r[11]=Z,r[12]=J,r[13]=Q,r[14]=K,r[15]=$,r):new u(z,U,j,J,V,W,Y,Q,q,G,X,K,k,H,Z,$)},u.multiplyTransformation=function(e,t,r){if(!i(e))throw new n("left is required");if(!i(t))throw new n("right is required");var o=e[0],a=e[1],s=e[2],l=e[4],c=e[5],h=e[6],d=e[8],m=e[9],f=e[10],p=e[12],v=e[13],g=e[14],_=t[0],y=t[1],w=t[2],C=t[4],b=t[5],S=t[6],x=t[8],E=t[9],T=t[10],P=t[12],A=t[13],M=t[14],D=o*_+l*y+d*w,I=a*_+c*y+m*w,O=s*_+h*y+f*w,R=o*C+l*b+d*S,L=a*C+c*b+m*S,N=s*C+h*b+f*S,B=o*x+l*E+d*T,F=a*x+c*E+m*T,z=s*x+h*E+f*T,V=o*P+l*A+d*M+p,q=a*P+c*A+m*M+v,k=s*P+h*A+f*M+g;return i(r)?(r[0]=D,r[1]=I,r[2]=O,r[3]=0,r[4]=R,r[5]=L,r[6]=N,r[7]=0,r[8]=B,r[9]=F,r[10]=z,r[11]=0,r[12]=V,r[13]=q,r[14]=k,r[15]=1,r):new u(D,R,B,V,I,L,F,q,O,N,z,k,0,0,0,1)},u.multiplyByTranslation=function(e,t,r){if(!i(e))throw new n("matrix is required");if(!i(t))throw new n("translation is required");var o=t.x,a=t.y,s=t.z,l=o*e[0]+a*e[4]+s*e[8]+e[12],c=o*e[1]+a*e[5]+s*e[9]+e[13],h=o*e[2]+a*e[6]+s*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]=l,r[13]=c,r[14]=h,r[15]=e[15],r):new u(e[0],e[4],e[8],l,e[1],e[5],e[9],c,e[2],e[6],e[10],h,e[3],e[7],e[11],e[15])};var p=new e;return u.multiplyByUniformScale=function(e,t,r){if("number"!=typeof t)throw new n("scale is required");return p.x=t,p.y=t,p.z=t,u.multiplyByScale(e,p,r)},u.multiplyByScale=function(e,t,r){if(!i(e))throw new n("matrix is required");if(!i(t))throw new n("scale is required");var o=t.x,a=t.y,s=t.z;return 1===o&&1===a&&1===s?u.clone(e,r):i(r)?(r[0]=o*e[0],r[1]=o*e[1],r[2]=o*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=s*e[8],r[9]=s*e[9],r[10]=s*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r):new u(o*e[0],a*e[4],s*e[8],e[12],o*e[1],a*e[5],s*e[9],e[13],o*e[2],a*e[6],s*e[10],e[14],0,0,0,1)},u.multiplyByVector=function(e,r,o){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");var a=r.x,s=r.y,l=r.z,u=r.w,c=e[0]*a+e[4]*s+e[8]*l+e[12]*u,h=e[1]*a+e[5]*s+e[9]*l+e[13]*u,d=e[2]*a+e[6]*s+e[10]*l+e[14]*u,m=e[3]*a+e[7]*s+e[11]*l+e[15]*u;return i(o)?(o.x=c,o.y=h,o.z=d,o.w=m,o):new t(c,h,d,m)},u.multiplyByPointAsVector=function(t,r,o){if(!i(t))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");var a=r.x,s=r.y,l=r.z,u=t[0]*a+t[4]*s+t[8]*l,c=t[1]*a+t[5]*s+t[9]*l,h=t[2]*a+t[6]*s+t[10]*l;return i(o)?(o.x=u,o.y=c,o.z=h,o):new e(u,c,h)},u.multiplyByPoint=function(t,r,o){if(!i(t))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");var a=r.x,s=r.y,l=r.z,u=t[0]*a+t[4]*s+t[8]*l+t[12],c=t[1]*a+t[5]*s+t[9]*l+t[13],h=t[2]*a+t[6]*s+t[10]*l+t[14];return i(o)?(o.x=u,o.y=c,o.z=h,o):new e(u,c,h)},u.multiplyByScalar=function(e,t,r){if(!i(e))throw new n("matrix is required");if("number"!=typeof t)throw new n("scalar must be a number");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){if(!i(e))throw new n("matrix is required");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(e))throw new n("matrix is required");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],o=e[2],a=e[3],s=e[6],l=e[7],c=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]=o,t[9]=s,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=l,t[14]=c,t[15]=e[15],t},u.abs=function(e,t){if(!i(e))throw new n("matrix is required");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){if("number"!=typeof r)throw new n("epsilon must be a number");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){if(!i(t))throw new n("matrix is required");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){if(!i(e))throw new n("matrix is required");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){if(!i(e))throw new n("matrix is required");var r=e[0],o=e[4],s=e[8],c=e[12],h=e[1],d=e[5],m=e[9],f=e[13],p=e[2],v=e[6],g=e[10],_=e[14],y=e[3],w=e[7],C=e[11],b=e[15],S=g*b,x=_*C,E=v*b,T=_*w,P=v*C,A=g*w,M=p*b,D=_*y,I=p*C,O=g*y,R=p*w,L=v*y,N=S*d+T*m+P*f-(x*d+E*m+A*f),B=x*h+M*m+O*f-(S*h+D*m+I*f),F=E*h+D*d+R*f-(T*h+M*d+L*f),z=A*h+I*d+L*m-(P*h+O*d+R*m),V=x*o+E*s+A*c-(S*o+T*s+P*c),q=S*r+D*s+I*c-(x*r+M*s+O*c),k=T*r+M*o+L*c-(E*r+D*o+R*c),U=P*r+O*o+R*s-(A*r+I*o+L*s);S=s*f,x=c*m,E=o*f,T=c*d,P=o*m,A=s*d,M=r*f,D=c*h,I=r*m,O=s*h,R=r*d,L=o*h;var W=S*w+T*C+P*b-(x*w+E*C+A*b),G=x*y+M*C+O*b-(S*y+D*C+I*b),H=E*y+D*w+R*b-(T*y+M*w+L*b),j=A*y+I*w+L*C-(P*y+O*w+R*C),Y=E*g+A*_+x*v-(P*_+S*v+T*g),X=I*_+S*p+D*g-(M*g+O*_+x*p),Z=M*v+L*_+T*p-(R*_+E*p+D*v),J=R*g+P*p+O*v-(I*v+L*g+A*p),Q=r*N+o*B+s*F+c*z;if(Math.abs(Q)E;E++){e.clone(t[E],n);var T=n.x,P=n.y,A=n.z;Tl.x&&e.clone(n,l),Pu.y&&e.clone(n,u),Ac.z&&e.clone(n,c)}var M=e.magnitudeSquared(e.subtract(l,o,y)),D=e.magnitudeSquared(e.subtract(u,a,y)),I=e.magnitudeSquared(e.subtract(c,s,y)),O=o,R=l,L=M;D>L&&(L=D,O=a,R=u),I>L&&(L=I,O=s,R=c);var N=w;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,y)),F=Math.sqrt(B),z=C;z.x=o.x,z.y=a.y,z.z=s.z;var V=b;V.x=l.x,V.y=u.y,V.z=c.z;var q=e.multiplyByScalar(e.add(z,V,y),.5,S),k=0;for(E=0;x>E;E++){e.clone(t[E],n);var U=e.magnitude(e.subtract(n,q,y));U>k&&(k=U);var W=e.magnitudeSquared(e.subtract(n,N,y));if(W>B){var G=Math.sqrt(W);F=.5*(F+G),B=F*F;var H=G-F;N.x=(F*N.x+H*n.x)/G,N.y=(F*N.y+H*n.y)/G,N.z=(F*N.z+H*n.z)/G}}return k>F?(e.clone(N,r.center),r.radius=F):(e.clone(q,r.center),r.radius=k),r};var x=new a,E=new e,T=new e,P=new t,A=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,n,o,a,s){if(i(s)||(s=new h),!i(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=r(n,x),c.getSouthwest(t,P),P.height=o,c.getNortheast(t,A),A.height=a;var l=n.project(P,E),u=n.project(A,T),d=u.x-l.x,m=u.y-l.y,f=u.z-l.z;s.radius=.5*Math.sqrt(d*d+m*m+f*f);var p=s.center;return p.x=l.x+.5*d,p.y=l.y+.5*m,p.z=l.z+.5*f,s};var M=[];h.fromRectangle3D=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0);var s;return i(e)&&(s=c.subsample(e,t,n,M)),h.fromPoints(s,a)},h.fromVertices=function(t,o,a,s){if(i(s)||(s=new h),!i(t)||0===t.length)return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;if(o=r(o,e.ZERO),a=r(a,3),3>a)throw new n("stride must be 3 or greater.");var l=_;l.x=t[0]+o.x,l.y=t[1]+o.y,l.z=t[2]+o.z;for(var u=e.clone(l,d),c=e.clone(l,m),x=e.clone(l,f),E=e.clone(l,p),T=e.clone(l,v),P=e.clone(l,g),A=t.length,M=0;A>M;M+=a){var D=t[M]+o.x,I=t[M+1]+o.y,O=t[M+2]+o.z;l.x=D,l.y=I,l.z=O,DE.x&&e.clone(l,E),IT.y&&e.clone(l,T),OP.z&&e.clone(l,P)}var R=e.magnitudeSquared(e.subtract(E,u,y)),L=e.magnitudeSquared(e.subtract(T,c,y)),N=e.magnitudeSquared(e.subtract(P,x,y)),B=u,F=E,z=R;L>z&&(z=L,B=c,F=T),N>z&&(z=N,B=x,F=P);var V=w;V.x=.5*(B.x+F.x),V.y=.5*(B.y+F.y),V.z=.5*(B.z+F.z);var q=e.magnitudeSquared(e.subtract(F,V,y)),k=Math.sqrt(q),U=C;U.x=u.x,U.y=c.y,U.z=x.z;var W=b;W.x=E.x,W.y=T.y,W.z=P.z;var G=e.multiplyByScalar(e.add(U,W,y),.5,S),H=0;for(M=0;A>M;M+=a){l.x=t[M]+o.x,l.y=t[M+1]+o.y,l.z=t[M+2]+o.z;var j=e.magnitude(e.subtract(l,G,y));j>H&&(H=j);var Y=e.magnitudeSquared(e.subtract(l,V,y));if(Y>q){var X=Math.sqrt(Y);k=.5*(k+X),q=k*k;var Z=X-k;V.x=(k*V.x+Z*l.x)/X,V.y=(k*V.y+Z*l.y)/X,V.z=(k*V.z+Z*l.z)/X}}return H>k?(e.clone(V,s.center),s.radius=k):(e.clone(G,s.center),s.radius=H),s},h.fromCornerPoints=function(t,r,o){if(!i(t)||!i(r))throw new n("corner and oppositeCorner are required.");i(o)||(o=new h);var a=o.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),o.radius=e.distance(a,r),o},h.fromEllipsoid=function(t,r){if(!i(t))throw new n("ellipsoid is required.");return i(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},h.clone=function(t,r){return i(t)?i(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,o){if(!i(e))throw new n("value is required");if(!i(t))throw new n("array is required");o=r(o,0);var a=e.center;t[o++]=a.x,t[o++]=a.y,t[o++]=a.z,t[o]=e.radius},h.unpack=function(e,t,o){if(!i(e))throw new n("array is required");t=r(t,0),i(o)||(o=new h);var a=o.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],o.radius=e[t],o};var D=new e,I=new e;h.union=function(t,r,o){if(!i(t))throw new n("left is required.");if(!i(r))throw new n("right is required.");i(o)||(o=new h);var a=t.center,s=r.center;e.add(a,s,I);var l=e.multiplyByScalar(I,.5,I),u=e.magnitude(e.subtract(a,l,D))+t.radius,c=e.magnitude(e.subtract(s,l,D))+r.radius;return o.radius=Math.max(u,c),e.clone(l,o.center),o};var O=new e;h.expand=function(t,r,o){if(!i(t))throw new n("sphere is required.");if(!i(r))throw new n("point is required.");o=h.clone(t,o);var a=e.magnitude(e.subtract(r,o.center,O));return a>o.radius&&(o.radius=a),o},h.intersect=function(t,r){if(!i(t))throw new n("sphere is required.");if(!i(r))throw new n("plane is required.");var o=t.center,a=t.radius,l=e.dot(r,o)+r.w;return-a>l?s.OUTSIDE:a>l?s.INTERSECTING:s.INSIDE},h.transform=function(e,t,r){if(!i(e))throw new n("sphere is required.");if(!i(t))throw new n("transform is required.");return i(r)||(r=new h),r.center=u.multiplyByPoint(t,e.center,r.center),r.radius=u.getMaximumScale(t)*e.radius,r};var R=new e;h.distanceSquaredTo=function(t,r){if(!i(t))throw new n("sphere is required.");if(!i(r))throw new n("cartesian is required.");var o=e.subtract(t.center,r,R);return e.magnitudeSquared(o)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){if(!i(e))throw new n("sphere is required.");if(!i(t))throw new n("transform is required.");return i(r)||(r=new h),r.center=u.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var L=new e;h.getPlaneDistances=function(t,r,o,a){if(!i(t))throw new n("sphere is required.");if(!i(r))throw new n("position is required.");if(!i(o))throw new n("direction is required.");i(a)||(a=new l);var s=e.subtract(t.center,r,L),u=e.multiplyByScalar(o,e.dot(o,s),L),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var N=new e,B=new e,F=new e,z=new e,V=new e,q=new t,k=new Array(8),U=0;8>U;++U)k[U]=new e;var W=new a;return h.projectTo2D=function(t,o,a){if(!i(t))throw new n("sphere is required.");o=r(o,W);var s=o.ellipsoid,l=t.center,u=t.radius,c=s.geodeticSurfaceNormal(l,N),d=e.cross(e.UNIT_Z,c,B);e.normalize(d,d);var m=e.cross(c,d,F);e.normalize(m,m),e.multiplyByScalar(c,u,c),e.multiplyByScalar(m,u,m),e.multiplyByScalar(d,u,d);var f=e.negate(m,V),p=e.negate(d,z),v=k,g=v[0];e.add(c,m,g),e.add(g,d,g),g=v[1],e.add(c,m,g),e.add(g,p,g),g=v[2],e.add(c,f,g),e.add(g,p,g),g=v[3],e.add(c,f,g),e.add(g,d,g),e.negate(c,c),g=v[4],e.add(c,m,g),e.add(g,d,g),g=v[5],e.add(c,m,g),e.add(g,p,g),g=v[6],e.add(c,f,g),e.add(g,p,g),g=v[7],e.add(c,f,g),e.add(g,d,g);for(var _=v.length,y=0;_>y;++y){var w=v[y];e.add(l,w,w);var C=s.cartesianToCartographic(w,q);o.project(C,w)}a=h.fromPoints(v,a),l=a.center;var b=l.x,S=l.y,x=l.z;return l.x=x,l.y=b,l.z=S,a},h.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersect=function(e){return h.intersect(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),r("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,i={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){return n.supportsFullscreen()?document[i.fullscreenElement]:void 0}},changeEventName:{get:function(){return n.supportsFullscreen()?i.fullscreenchange:void 0}},errorEventName:{get:function(){return n.supportsFullscreen()?i.fullscreenerror:void 0}},enabled:{get:function(){return n.supportsFullscreen()?document[i.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return n.supportsFullscreen()?null!==n.element:void 0}}}),n.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return i.requestFullscreen="requestFullscreen",i.exitFullscreen="exitFullscreen",i.fullscreenEnabled="fullscreenEnabled",i.fullscreenElement="fullscreenElement",i.fullscreenchange="fullscreenchange",i.fullscreenerror="fullscreenerror",r=!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 t[n]?(i.requestFullscreen=n,r=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(i.requestFullscreen=n,r=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?i.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(i.exitFullscreen=n)),n=l+"FullscreenEnabled",e(document[n])?i.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(i.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?i.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(i.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),i.fullscreenchange=n),n=l+"fullscreenerror",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenError"),i.fullscreenerror=n)}return r},n.requestFullscreen=function(e){n.supportsFullscreen()&&e[i.requestFullscreen]()},n.exitFullscreen=function(){n.supportsFullscreen()&&document[i.exitFullscreen]()},n}),r("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function i(e){for(var t=e.split("."),r=0,i=t.length;i>r;++r)t[r]=parseInt(t[r],10);return t}function n(){if(!t(d)){var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null===e?d=!1:(d=!0,m=i(e[1]))}return d}function o(){return n()&&m}function a(){if(!t(f))if(n()||!/ Safari\/[\.0-9]+/.test(navigator.userAgent))f=!1;else{var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null===e?f=!1:(f=!0,p=i(e[1]))}return f}function s(){return a()&&p}function l(){if(!t(v)){var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null===e?v=!1:(v=!0,g=i(e[1]),g.isNightly=!!e[2])}return v}function u(){return l()&&g}function c(){if(!t(_)){var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(_=!0,y=i(e[1]))):"Netscape"===navigator.appName?(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(_=!0,y=i(e[1]))):_=!1}return _}function h(){return c()&&y}var d,m,f,p,v,g,_,y,w={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return w.supportsFullscreen=function(){return r.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w}),r("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection"],function(e,t,r,i){"use strict";if(!i.supportsTypedArrays())return{};var n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return n.getSizeInBytes=function(e){if(!t(e))throw new r("value is required.");switch(e){case n.BYTE:return Int8Array.BYTES_PER_ELEMENT;case n.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case n.SHORT:return Int16Array.BYTES_PER_ELEMENT;case n.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case n.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case n.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},n.fromTypedArray=function(e){return e instanceof Int8Array?n.BYTE:e instanceof Uint8Array?n.UNSIGNED_BYTE:e instanceof Int16Array?n.SHORT:e instanceof Uint16Array?n.UNSIGNED_SHORT:e instanceof Float32Array?n.FLOAT:e instanceof Float64Array?n.DOUBLE:void 0},n.validate=function(e){return t(e)&&(e===n.BYTE||e===n.UNSIGNED_BYTE||e===n.SHORT||e===n.UNSIGNED_SHORT||e===n.FLOAT||e===n.DOUBLE)},n.createTypedArray=function(e,i){if(!t(e))throw new r("componentDatatype is required.");if(!t(i))throw new r("valuesOrLength is required.");switch(e){case n.BYTE:return new Int8Array(i);case n.UNSIGNED_BYTE:return new Uint8Array(i);case n.SHORT:return new Int16Array(i);case n.UNSIGNED_SHORT:return new Uint16Array(i);case n.FLOAT:return new Float32Array(i);case n.DOUBLE:return new Float64Array(i);default:throw new r("componentDatatype is not a valid value.")}},n.createArrayBufferView=function(i,o,a,s){if(!t(i))throw new r("componentDatatype is required.");if(!t(o))throw new r("buffer is required.");switch(a=e(a,0),s=e(s,(o.byteLength-a)/n.getSizeInBytes(i)),i){case n.BYTE:return new Int8Array(o,a,s);case n.UNSIGNED_BYTE:return new Uint8Array(o,a,s);case n.SHORT:return new Int16Array(o,a,s);case n.UNSIGNED_SHORT:return new Uint16Array(o,a,s);case n.FLOAT:return new Float32Array(o,a,s);case n.DOUBLE:return new Float64Array(o,a,s);default:throw new r("componentDatatype is not a valid value.")}},n}),r("Core/Geometry",["./defaultValue","./defined","./DeveloperError"],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/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/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/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/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=new t,d=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.minimumCorner,a=e.maximumCorner;if(!n(r))throw new o("options.minimumCorner is required.");if(!n(a))throw new o("options.maximumCorner is required");var s=i(e.vertexFormat,c.DEFAULT);this._minimumCorner=t.clone(r),this._maximumCorner=t.clone(a),this._vertexFormat=s,this._workerName="createBoxGeometry"};return d.fromDimensions=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.dimensions;if(!n(r))throw new o("options.dimensions is required.");if(r.x<0||r.y<0||r.z<0)throw new o("All dimensions components must be greater than or equal to zero.");var a=t.multiplyByScalar(r,.5,new t),s=t.negate(a,new t),l=a,u={minimumCorner:s,maximumCorner:l,vertexFormat:e.vertexFormat};return new d(u)},d.createGeometry=function(i){var n,o,c=i._minimumCorner,d=i._maximumCorner,m=i._vertexFormat,f=new l;if(m.position&&(m.st||m.normal||m.binormal||m.tangent)){if(m.position&&(o=new Float64Array(72),o[0]=c.x,o[1]=c.y,o[2]=d.z,o[3]=d.x,o[4]=c.y,o[5]=d.z,o[6]=d.x,o[7]=d.y,o[8]=d.z,o[9]=c.x,o[10]=d.y,o[11]=d.z,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=d.x,o[16]=c.y,o[17]=c.z,o[18]=d.x,o[19]=d.y,o[20]=c.z,o[21]=c.x,o[22]=d.y,o[23]=c.z,o[24]=d.x,o[25]=c.y,o[26]=c.z,o[27]=d.x,o[28]=d.y,o[29]=c.z,o[30]=d.x,o[31]=d.y,o[32]=d.z,o[33]=d.x,o[34]=c.y,o[35]=d.z,o[36]=c.x,o[37]=c.y,o[38]=c.z,o[39]=c.x,o[40]=d.y,o[41]=c.z,o[42]=c.x,o[43]=d.y,o[44]=d.z,o[45]=c.x,o[46]=c.y,o[47]=d.z,o[48]=c.x,o[49]=d.y,o[50]=c.z,o[51]=d.x,o[52]=d.y,o[53]=c.z,o[54]=d.x,o[55]=d.y,o[56]=d.z,o[57]=c.x,o[58]=d.y,o[59]=d.z,o[60]=c.x,o[61]=c.y,o[62]=c.z,o[63]=d.x,o[64]=c.y,o[65]=c.z,o[66]=d.x,o[67]=c.y,o[68]=d.z,o[69]=c.x,o[70]=c.y,o[71]=d.z,f.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o})),m.normal){var p=new Float32Array(72);p[0]=0,p[1]=0,p[2]=1,p[3]=0,p[4]=0,p[5]=1,p[6]=0,p[7]=0,p[8]=1,p[9]=0,p[10]=0,p[11]=1,p[12]=0,p[13]=0,p[14]=-1,p[15]=0,p[16]=0,p[17]=-1,p[18]=0,p[19]=0,p[20]=-1,p[21]=0,p[22]=0,p[23]=-1,p[24]=1,p[25]=0,p[26]=0,p[27]=1,p[28]=0,p[29]=0,p[30]=1,p[31]=0,p[32]=0,p[33]=1,p[34]=0,p[35]=0,p[36]=-1,p[37]=0,p[38]=0,p[39]=-1,p[40]=0,p[41]=0,p[42]=-1,p[43]=0,p[44]=0,p[45]=-1,p[46]=0,p[47]=0,p[48]=0,p[49]=1,p[50]=0,p[51]=0,p[52]=1,p[53]=0,p[54]=0,p[55]=1,p[56]=0,p[57]=0,p[58]=1,p[59]=0,p[60]=0,p[61]=-1,p[62]=0,p[63]=0,p[64]=-1,p[65]=0,p[66]=0,p[67]=-1,p[68]=0,p[69]=0,p[70]=-1,p[71]=0,f.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:p})}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,f.st=new s({componentDatatype:r.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,f.tangent=new s({componentDatatype:r.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,f.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:_})}n=new Uint16Array(36),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else o=new Float64Array(24),o[0]=c.x,o[1]=c.y,o[2]=c.z,o[3]=d.x,o[4]=c.y,o[5]=c.z,o[6]=d.x,o[7]=d.y,o[8]=c.z,o[9]=c.x,o[10]=d.y,o[11]=c.z,o[12]=c.x,o[13]=c.y,o[14]=d.z,o[15]=d.x,o[16]=c.y,o[17]=d.z,o[18]=d.x,o[19]=d.y,o[20]=d.z,o[21]=c.x,o[22]=d.y,o[23]=d.z,f.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),n=new Uint16Array(36),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;var y=t.subtract(d,c,h),w=.5*t.magnitude(y);return new a({attributes:f,indices:n,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,w)})},d}),r("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=new t,h=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.minimumCorner,a=e.maximumCorner;if(!n(r))throw new o("options.minimumCorner is required.");if(!n(a))throw new o("options.maximumCorner is required");this._min=t.clone(r),this._max=t.clone(a),this._workerName="createBoxOutlineGeometry"};return h.fromDimensions=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.dimensions;if(!n(r))throw new o("options.dimensions is required.");if(r.x<0||r.y<0||r.z<0)throw new o("All dimensions components must be greater than or equal to zero.");var a=t.multiplyByScalar(r,.5,new t),s=t.negate(a,new t),l=a,u={minimumCorner:s,maximumCorner:l};return new h(u)},h.createGeometry=function(i){var n=i._min,o=i._max,h=new l,d=new Uint16Array(24),m=new Float64Array(24);m[0]=n.x,m[1]=n.y,m[2]=n.z,m[3]=o.x,m[4]=n.y,m[5]=n.z,m[6]=o.x,m[7]=o.y,m[8]=n.z,m[9]=n.x,m[10]=o.y,m[11]=n.z,m[12]=n.x,m[13]=n.y,m[14]=o.z,m[15]=o.x,m[16]=n.y,m[17]=o.z,m[18]=o.x,m[19]=o.y,m[20]=o.z,m[21]=n.x,m[22]=o.y,m[23]=o.z,h.position=new s({componentDatatype:r.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 f=t.subtract(o,n,c),p=.5*t.magnitude(f);return new a({attributes:h,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,p)})},h}),r("Core/Spline",["./defaultValue","./defined","./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(i,n){var o=this.times,a=o.length;if(!t(i))throw new r("time is required.");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;--s)c[s]=e.subtract(u[s],e.multiplyByScalar(c[s+1],l[s],c[s]),c[s]);return c},i}),r("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,n){var o=d,a=f,s=m,l=p;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var h=l[0];for(i(h)||(h=l[0]=new e),e.clone(r,h),c=1;c2&&(i(s)||(s=m,e.multiplyByScalar(n[1],2,s),e.subtract(s,n[2],s),e.subtract(s,n[0],s),e.multiplyByScalar(s,.5,s)),!i(l))){var c=n.length-1;l=f,e.multiplyByScalar(n[c-1],2,l),e.subtract(n[c],l,l),e.add(l,n[c-2],l),e.multiplyByScalar(l,.5,l)}this._times=a,this._points=n,this._firstTangent=e.clone(s),this._lastTangent=e.clone(l),this._evaluateFunction=u(this),this._lastTimeIndex=0};return n(p.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),p.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),p.prototype.findTimeInterval=l.prototype.findTimeInterval,p.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t) },p}),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}),r("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent"],function(e,t,r,i,n){"use strict";function o(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function a(e,t){for(var r=o(e,t),i=new ArrayBuffer(r.length),n=new Uint8Array(i),a=0;an,u=e>o,c=e>a):(l=n>e,u=o>e,c=a>e);var h,d,m,f,p,v,g=l+u+c;return 1===g?l?(h=(e-n)/(o-n),d=(e-n)/(a-n),s.push(1),s.push(2),1!==d&&(s.push(-1),s.push(0),s.push(2),s.push(d)),1!==h&&(s.push(-1),s.push(0),s.push(1),s.push(h))):u?(m=(e-o)/(a-o),f=(e-o)/(n-o),s.push(2),s.push(0),1!==f&&(s.push(-1),s.push(1),s.push(0),s.push(f)),1!==m&&(s.push(-1),s.push(1),s.push(2),s.push(m))):c&&(p=(e-a)/(n-a),v=(e-a)/(o-a),s.push(0),s.push(1),1!==v&&(s.push(-1),s.push(2),s.push(1),s.push(v)),1!==p&&(s.push(-1),s.push(2),s.push(0),s.push(p))):2===g?l||n===e?u||o===e?c||a===e||(d=(e-n)/(a-n),m=(e-o)/(a-o),s.push(2),s.push(-1),s.push(0),s.push(2),s.push(d),s.push(-1),s.push(1),s.push(2),s.push(m)):(v=(e-a)/(o-a),h=(e-n)/(o-n),s.push(1),s.push(-1),s.push(2),s.push(1),s.push(v),s.push(-1),s.push(0),s.push(1),s.push(h)):(f=(e-o)/(n-o),p=(e-a)/(n-a),s.push(0),s.push(-1),s.push(1),s.push(0),s.push(f),s.push(-1),s.push(2),s.push(0),s.push(p)):3===g||(s.push(0),s.push(1),s.push(2)),s},i.computeBarycentricCoordinates=function(i,n,o,a,s,l,u,c,h){if(!t(i))throw new r("x is required.");if(!t(n))throw new r("y is required.");if(!t(o))throw new r("x1 is required.");if(!t(a))throw new r("y1 is required.");if(!t(s))throw new r("x2 is required.");if(!t(l))throw new r("y2 is required.");if(!t(u))throw new r("x3 is required.");if(!t(c))throw new r("y3 is required.");var d=o-u,m=u-s,f=l-c,p=a-c,v=1/(f*d+m*p),g=n-c,_=i-u,y=(f*_+m*g)*v,w=(-p*_+d*g)*v,C=1-y-w;return t(h)?(h.x=y,h.y=w,h.z=C,h):new e(y,w,C)},i}),r("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Intersections2D","./Math","./TaskProcessor","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t){m.length=e.length;for(var r=!1,i=0,n=e.length;n>i;++i)m[i]=e[i],r=r||i>0&&t(e[i-1],e[i])>0;return r?(m.sort(t),new Uint16Array(m)):e}var d=function(e){function t(e,t){return l[e]-l[t]}function r(e,t){return s[e]-s[t]}if(!n(e)||!n(e.quantizedVertices))throw new a("options.quantizedVertices is required.");if(!n(e.indices))throw new a("options.indices is required.");if(!n(e.minimumHeight))throw new a("options.minimumHeight is required.");if(!n(e.maximumHeight))throw new a("options.maximumHeight is required.");if(!n(e.maximumHeight))throw new a("options.maximumHeight is required.");if(!n(e.boundingSphere))throw new a("options.boundingSphere is required.");if(!n(e.horizonOcclusionPoint))throw new a("options.horizonOcclusionPoint is required.");if(!n(e.westIndices))throw new a("options.westIndices is required.");if(!n(e.southIndices))throw new a("options.southIndices is required.");if(!n(e.eastIndices))throw new a("options.eastIndices is required.");if(!n(e.northIndices))throw new a("options.northIndices is required.");if(!n(e.westSkirtHeight))throw new a("options.westSkirtHeight is required.");if(!n(e.southSkirtHeight))throw new a("options.southSkirtHeight is required.");if(!n(e.eastSkirtHeight))throw new a("options.eastSkirtHeight is required.");if(!n(e.northSkirtHeight))throw new a("options.northSkirtHeight is required.");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 o=this._quantizedVertices.length/3,s=this._uValues=this._quantizedVertices.subarray(0,o),l=this._vValues=this._quantizedVertices.subarray(o,2*o);this._heightValues=this._quantizedVertices.subarray(2*o,3*o),this._westIndices=h(e.westIndices,t),this._southIndices=h(e.southIndices,r),this._eastIndices=h(e.eastIndices,t),this._northIndices=h(e.northIndices,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=i(e.childTileMask,15),this._createdByUpsampling=i(e.createdByUpsampling,!1),this._waterMask=e.waterMask};o(d.prototype,{waterMask:{get:function(){return this._waterMask}}});var m=[],f=new u("createVerticesFromQuantizedTerrainMesh");d.prototype.createMesh=function(t,r,i,o){if(!n(t))throw new a("tilingScheme is required.");if(!n(r))throw new a("x is required.");if(!n(i))throw new a("y is required.");if(!n(o))throw new a("level is required.");var s=t.ellipsoid,l=t.tileXYToRectangle(r,i,o),u=f.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,rectangle:l,relativeToCenter:this._boundingSphere.center,ellipsoid:s});if(!n(u))return void 0;var h=this;return e(u,function(e){return new c(h._boundingSphere.center,new Float32Array(e.vertices),new Uint16Array(e.indices),h._minimumHeight,h._maximumHeight,h._boundingSphere,h._horizonOcclusionPoint)})};var p=new u("upsampleQuantizedTerrainMesh");d.prototype.upsample=function(i,o,s,l,u,c,h){if(!n(i))throw new a("tilingScheme is required.");if(!n(o))throw new a("thisX is required.");if(!n(s))throw new a("thisY is required.");if(!n(l))throw new a("thisLevel is required.");if(!n(u))throw new a("descendantX is required.");if(!n(c))throw new a("descendantY is required.");if(!n(h))throw new a("descendantLevel is required.");var m=h-l;if(m>1)throw new a("Upsampling through more than one level at a time is not currently supported.");var f=2*o!==u,v=2*s===c,g=i.ellipsoid,_=i.tileXYToRectangle(u,c,h),y=p.scheduleTask({vertices:this._quantizedVertices,indices:this._indices,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:v,childRectangle:_,ellipsoid:g});if(!n(y))return void 0;var w=Math.min(this._westSkirtHeight,this._eastSkirtHeight);w=Math.min(w,this._southSkirtHeight),w=Math.min(w,this._northSkirtHeight);var C=f?.5*w:this._westSkirtHeight,b=v?.5*w:this._southSkirtHeight,S=f?this._eastSkirtHeight:.5*w,x=v?this._northSkirtHeight:.5*w;return e(y,function(e){return new d({quantizedVertices:new Uint16Array(e.vertices),indices:new Uint16Array(e.indices),minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:C,southSkirtHeight:b,eastSkirtHeight:S,northSkirtHeight:x,childTileMask:0,createdByUpsampling:!0})})};var v=32767,g=new r;return d.prototype.interpolateHeight=function(e,t,r){var i=(t-e.west)/(e.east-e.west);i*=v;var n=(r-e.south)/(e.north-e.south);n*=v;for(var o=this._uValues,a=this._vValues,u=this._heightValues,c=this._indices,h=0,d=c.length;d>h;h+=3){var m=c[h],f=c[h+1],p=c[h+2],_=o[m],y=o[f],w=o[p],C=a[m],b=a[f],S=a[p],x=s.computeBarycentricCoordinates(i,n,_,C,y,b,w,S,g);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){var E=x.x*u[m]+x.y*u[f]+x.z*u[p];return l.lerp(this._minimumHeight,this._maximumHeight,E/v)}}return void 0},d.prototype.isChildAvailable=function(e,t,r,i){if(!n(e))throw new a("thisX is required.");if(!n(t))throw new a("thisY is required.");if(!n(r))throw new a("childX is required.");if(!n(i))throw new a("childY is required.");var o=2;return r!==2*e&&++o,i!==2*t&&(o-=2),0!==(this._childTileMask&1<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("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./loadArrayBuffer","./loadJson","./QuantizedMeshTerrainData","./RuntimeError","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_){"use strict";function y(e){return d(e,E)}function w(e,t){var r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new h({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function C(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=2,h=4,d=4,m=8,v=3,g=v+1,_=m*v,y=m*g,w=3,C=c*w,S=3,x=c*S,E=new DataView(t),T=new i(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=_;var P=E.getFloat32(u,!0);u+=d;var A=E.getFloat32(u,!0);u+=d;var M=new r(new i(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0)),E.getFloat64(u+_,!0));u+=y;var D=new i(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=_;var I=E.getUint32(u,!0);u+=h;var O=new Uint16Array(t,u,3*I);if(u+=I*C,I>65536)throw new p("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),F=0,z=0,V=0;for(R=0;I>R;++R)F+=l(L[R]),z+=l(N[R]),V+=l(B[R]),L[R]=F,N[R]=z,B[R]=V;var q=E.getUint32(u,!0);u+=h;var k=new Uint16Array(t,u,q*S);u+=q*x;var U=0;for(R=0;R=n.length)return 0;var a=n[o],s=0;return s|=S(a,2*r,2*i)?1:0,s|=S(a,2*r+1,2*i)?2:0,s|=S(a,2*r,2*i+1)?4:0,s|=S(a,2*r+1,2*i+1)?8:0}function S(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(r){function i(t){var r;if(!t.format)return r="The tile format is not specified in the layer.json file.",f=_.handleError(f,p,p._errorEvent,r,void 0,void 0,void 0,s),void 0;if(!t.tiles||0===t.tiles.length)return r="The layer.json file does not specify any tile URL templates.",f=_.handleError(f,p,p._errorEvent,r,void 0,void 0,void 0,s),void 0;if("heightmap-1.0"===t.format)p._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1},p._hasWaterMask=!0;else{if(0!==t.format.indexOf("quantized-mesh-1."))return r='The tile format "'+t.format+'" is invalid or not supported.',f=_.handleError(f,p,p._errorEvent,r,void 0,void 0,void 0,s),void 0;p._hasWaterMask=!1}var i=new e(d);p._tileUrlTemplates=t.tiles;for(var o=0;o0)n=Math.sqrt(v+1),d=.5*n,n=.5/n,o=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,a=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,u=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var g=c,_=0;f>m&&(_=1),p>m&&p>f&&(_=2);var y=g[_],w=g[y];n=Math.sqrt(e[s.getElementIndex(_,_)]-e[s.getElementIndex(y,y)]-e[s.getElementIndex(w,w)]+1);var C=h;C[_]=.5*n,n=.5/n,d=(e[s.getElementIndex(w,y)]-e[s.getElementIndex(y,w)])*n,C[y]=(e[s.getElementIndex(y,_)]+e[s.getElementIndex(_,y)])*n,C[w]=(e[s.getElementIndex(w,_)]+e[s.getElementIndex(_,w)])*n,o=-C[0],a=-C[1],u=-C[2]}return r(t)?(t.x=o,t.y=a,t.z=u,t.w=d,t):new l(o,a,u,d)};var d=new e,m=new e,f=new l,p=new l,v=new l;l.packedLength=4,l.pack=function(e,n,o){if(!r(e))throw new i("value is required");if(!r(n))throw new i("array is required");o=t(o,0),n[o++]=e.x,n[o++]=e.y,n[o++]=e.z,n[o]=e.w},l.unpack=function(e,n,o){if(!r(e))throw new i("array is required");return n=t(n,0),r(o)||(o=new l),o.x=e[n],o.y=e[n+1],o.z=e[n+2],o.w=e[n+3],o},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,i){l.unpack(e,4*r,v),l.conjugate(v,v);for(var n=0,o=r-t+1;o>n;n++){var a=3*n;l.unpack(e,4*(t+n),f),l.multiply(f,v,f),f.w<0&&l.negate(f,f),l.getAxis(f,d);var s=l.getAngle(f);i[a]=d.x*s,i[a+1]=d.y*s,i[a+2]=d.z*s}},l.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new l),e.fromArray(t,0,m);var s=e.magnitude(m);return l.unpack(i,4*o,p),0===s?l.clone(l.IDENTITY,f):l.fromAxisAngle(m,s,f),l.multiply(f,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){if(!r(e))throw new i("quaternion is required");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){if(!r(e))throw new i("quaternion is required");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,n){if(!r(e))throw new i("left is required");if(!r(t))throw new i("right is required");return r(n)?(n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n):new l(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w)},l.subtract=function(e,t,n){if(!r(e))throw new i("left is required");if(!r(t))throw new i("right is required");return r(n)?(n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n):new l(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w)},l.negate=function(e,t){if(!r(e))throw new i("quaternion is required");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){if(!r(e))throw new i("left is required");if(!r(t))throw new i("right is required");return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){if(!r(e))throw new i("left is required");if(!r(t))throw new i("right is required");var o=e.x,a=e.y,s=e.z,u=e.w,c=t.x,h=t.y,d=t.z,m=t.w,f=u*c+o*m+a*d-s*h,p=u*h-o*d+a*m+s*c,v=u*d+o*h-a*c+s*m,g=u*m-o*c-a*h-s*d;return r(n)?(n.x=f,n.y=p,n.z=v,n.w=g,n):new l(f,p,v,g)},l.multiplyByScalar=function(e,t,n){if(!r(e))throw new i("quaternion is required");if("number"!=typeof t)throw new i("scalar is required and must be a number.");return r(n)?(n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n):new l(e.x*t,e.y*t,e.z*t,e.w*t)},l.divideByScalar=function(e,t,n){if(!r(e))throw new i("quaternion is required");if("number"!=typeof t)throw new i("scalar is required and must be a number.");return r(n)?(n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n):new l(e.x/t,e.y/t,e.z/t,e.w/t)},l.getAxis=function(t,n){if(!r(t))throw new i("quaternion is required");var o=t.w;if(Math.abs(o-1)s&&(s=-s,u=_=l.negate(t,_)),1-sI;++I){var O=I+1,R=2*O+1;P[I]=1/(O*R),A[I]=O/R}return P[7]=T/136,A[7]=8*T/17,l.fastSlerp=function(e,t,n,o){if(!r(e))throw new i("start is required.");if(!r(t))throw new i("end is required.");if("number"!=typeof n)throw new i("t is required and must be a number.");r(o)||(o=new l);var a,s=l.dot(e,t);s>=0?a=1:(a=-1,s=-s);for(var u=s-1,c=1-n,h=n*n,d=c*c,m=7;m>=0;--m)M[m]=(P[m]*h-A[m])*u,D[m]=(P[m]*d-A[m])*u;var f=a*n*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),p=c*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),v=l.multiplyByScalar(e,p,E);return l.multiplyByScalar(t,f,o),l.add(v,o,o)},l.fastSquad=function(e,t,n,o,a,s){if(!(r(e)&&r(t)&&r(n)&&r(o)))throw new i("q0, q1, s0, and s1 are required.");if("number"!=typeof a)throw new i("t is required and must be a number.");var u=l.fastSlerp(e,t,a,S),c=l.fastSlerp(n,o,a,x);return l.fastSlerp(u,c,2*a*(1-a),s)},l.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},l.equalsEpsilon=function(e,t,n){if("number"!=typeof n)throw new i("epsilon is required and must be a number.");return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),r("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,i){"use strict";function n(t,n,o,c,h,d,m,f,p,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 w=d/Math.sqrt(m*_+h*y),C=w/f;return i.fromAxisAngle(a,C,l),r.fromQuaternion(l,u),r.multiplyByVector(u,p,v),e.normalize(v,v),e.multiplyByScalar(v,f,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,f=t.length,p=i?f:0,v=0;f>v;v+=3){var g,_=v+1,y=v+2,w=e.fromArray(t,v,c);w=n.scaleToGeodeticSurface(w,w),g=e.clone(w,h),u=n.geodeticSurfaceNormal(w,u);var C=e.multiplyByScalar(u,o,d);w=e.add(w,C,w),i&&(C=e.multiplyByScalar(u,a,C),g=e.add(g,C,g),l[v+p]=g.x,l[_+p]=g.y,l[y+p]=g.z),l[v]=w.x,l[_]=w.y,l[y]=w.z}return l};var f=new e,p=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,w=s*a,C=e.magnitude(u),b=e.normalize(u,f),S=e.cross(e.UNIT_Z,u,p);S=e.normalize(S,S);var x,E,T,P,A,M=e.cross(b,S,v),D=1+Math.ceil(t.PI_OVER_TWO/m),I=g/(D-1),O=2*D*(D+1),R=i?new Array(3*O):void 0,L=0,N=c,B=h,F=o?[]:void 0,z=o?[]:void 0,V=t.PI_OVER_TWO;for(x=0;D>x&&V>0;++x){if(N=n(V,l,M,S,_,w,y,C,b,N),B=n(Math.PI-V,l,M,S,_,w,y,C,b,B),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,T=2*x+2,E=1;T-1>E;++E)P=E/(T-1),A=e.lerp(N,B,P,d),R[L++]=A.x,R[L++]=A.y,R[L++]=A.z;R[L++]=B.x,R[L++]=B.y,R[L++]=B.z}o&&(z.unshift(N.x,N.y,N.z),0!==x&&F.push(B.x,B.y,B.z)),V=t.PI_OVER_TWO-(x+1)*I}for(D=x,x=D;x>0;--x){if(V=t.PI_OVER_TWO-(x-1)*I,N=n(-V,l,M,S,_,w,y,C,b,N),B=n(V+Math.PI,l,M,S,_,w,y,C,b,B),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,T=2*(x-1)+2,E=1;T-1>E;++E)P=E/(T-1),A=e.lerp(N,B,P,d),R[L++]=A.x,R[L++]=A.y,R[L++]=A.z;R[L++]=B.x,R[L++]=B.y,R[L++]=B.z}o&&(z.unshift(N.x,N.y,N.z),1!==x&&F.push(B.x,B.y,B.z))}var q={};return i&&(R.length!==L&&(O=L/3,R.length=L),q.positions=R,q.numPts=D),o&&(q.outerPositions=z.concat(F)),q},o}),r("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],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/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,f,p,v,g,_,y;r(l.z)?(d=t.subtract(u,l,n),m=t.subtract(c,l,o),f=t.subtract(s,l,a),p=t.dot(d,d),v=t.dot(d,m),g=t.dot(d,f),_=t.dot(m,m),y=t.dot(m,f)):(d=e.subtract(u,l,n),m=e.subtract(c,l,o),f=e.subtract(s,l,a),p=e.dot(d,d),v=e.dot(d,m),g=e.dot(d,f),_=e.dot(m,m),y=e.dot(m,f));var w=1/(p*_-v*v);return h.y=(_*g-v*y)*w,h.z=(p*y-v*g)*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/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/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,f=a*l-d,p=a*u-s*l,v=s*u-m,g=4*f*v-p*p;if(0>g){var _,y,w;d*h>=c*m?(_=a,y=f,w=-2*s*f+a*p):(_=u,y=v,w=-u*p+2*l*v);var C=0>w?-1:1,b=-C*Math.abs(_)*Math.sqrt(-g);o=-w+b;var S=o/2,x=0>S?-Math.pow(-S,1/3):Math.pow(S,1/3),E=o===b?-x:-y/x;return n=0>=y?x+E:-w/(x*x+E*E+y),d*h>=c*m?[(n-s)/a]:[-u/(n+l)]}var T=f,P=-2*s*f+a*p,A=v,M=-u*p+2*l*v,D=Math.sqrt(g),I=Math.sqrt(3)/2,O=Math.abs(Math.atan2(a*D,-P)/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,F=N/B;O=Math.abs(Math.atan2(u*D,-M)/3),n=2*Math.sqrt(-A),R=Math.cos(O),o=n*R,L=n*(-R/2-I*Math.sin(O));var z=-u,V=2*l>o+L?o+l:L+l,q=z/V,k=B*V,U=-N*V-B*z,W=N*z,G=(l*U-s*W)/(-s*U+l*k);return G>=F?q>=F?q>=G?[F,G,q]:[F,q,G]:[q,F,G]:q>=F?[G,F,q]:q>=G?[G,q,F]:[q,G,F]}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",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,i){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,h=e.realRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-t/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 p=Math.sqrt(v),[d-p,d+p];if(0>v&&g>=0)return p=Math.sqrt(g),[d-p,d+p]}return[]}if(m>0){var w=Math.sqrt(m),C=(l+m-u/w)/2,b=(l+m+u/w)/2,S=i.realRoots(1,w,C),x=i.realRoots(1,-w,b);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==x.length?(x[0]+=d,x[1]+=d,S[1]<=x[0]?[S[0],S[1],x[0],x[1]]:x[1]<=S[0]?[x[0],x[1],S[0],S[1]]:S[0]>=x[0]&&S[1]<=x[1]?[x[0],S[0],S[1],x[1]]:x[0]>=S[0]&&x[1]<=S[1]?[S[0],x[0],x[1],S[1]]:S[0]>x[0]&&S[0]0){var f,p,v=m[0],g=n-v,_=g*g,y=t/2,w=g/2,C=_-4*a,b=_+4*Math.abs(a),S=u-4*v,x=u+4*Math.abs(v);if(0>v||S*b>C*x){var E=Math.sqrt(S);f=E/2,p=0===E?0:(t*w-o)/E}else{var T=Math.sqrt(C);f=0===T?0:(t*w-o)/T,p=T/2}var P,A;0===y&&0===f?(P=0,A=0):r.sign(y)===r.sign(f)?(P=y+f,A=v/P):(A=y-f,P=v/A);var M,D;0===w&&0===p?(M=0,D=0):r.sign(w)===r.sign(p)?(M=w+p,D=a/M):(D=w-p,M=a/D);var I=i.realRoots(1,P,M),O=i.realRoots(1,A,D);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(f+=0>h?f+1:f,f+=0>d?f+1:f,f+=0>m?f+1:f){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",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=e+t;return n.sign(e)!==n.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))L;++L){var N,B=h[L],F=B*B,z=Math.max(1-F,0),V=Math.sqrt(z);N=n.sign(f)===n.sign(v)?l(f*F+v,p*B,n.EPSILON12):n.sign(v)===n.sign(p*B)?l(f*F,p*B+v,n.EPSILON12):l(f*F+p*B,v,n.EPSILON12);var q=l(g*B,_,n.EPSILON15),k=N*q;0>k?y.push(new e(u,c*B,c*V)):k>0?y.push(new e(u,c*B,c*-V)):0!==V?(y.push(new e(u,c*B,c*-V)),y.push(new e(u,c*B,c*V)),++L):y.push(new e(u,c*B,c*V))}return y}var c={};c.rayPlane=function(t,o,a){if(!r(t))throw new i("ray is required.");if(!r(o))throw new i("plane is required.");r(a)||(a=new e);var s=t.origin,l=t.direction,u=o.normal,c=e.dot(u,l);if(Math.abs(c)h?void 0:(a=e.multiplyByScalar(l,h,a),e.add(s,a,a))};var h=new e,d=new e;c.rayEllipsoid=function(t,n){if(!r(t))throw new i("ray is required.");if(!r(n))throw new i("ellipsoid is required.");var o,a,s,l,u,c=n.oneOverRadii,m=e.multiplyComponents(c,t.origin,h),f=e.multiplyComponents(c,t.direction,d),p=e.magnitudeSquared(m),v=e.dot(m,f);if(p>1){if(v>=0)return void 0;var g=v*v;if(o=p-1,a=e.magnitudeSquared(f),s=a*o,s>g)return void 0;if(g>s){l=v*v-s,u=-v+Math.sqrt(l);var _=u/a,y=o/u;return y>_?{start:_,stop:y}:{start:y,stop:_}}var w=Math.sqrt(o/a);return{start:w,stop:w}}return 1>p?(o=p-1,a=e.magnitudeSquared(f),s=a*o,l=v*v-s,u=-v+Math.sqrt(l),{start:0,stop:u/a}):0>v?(a=e.magnitudeSquared(f),{start:0,stop:-v/a}):void 0};var m=new e,f=new e,p=new e,v=new e;c.grazingAltitudeLocation=function(a,s){if(!r(a))throw new i("ray is required.");if(!r(s))throw new i("ellipsoid is required.");var l=a.origin,c=a.direction,h=s.geodeticSurfaceNormal(l);if(e.dot(c,h)>=0)return l;var d,g,_=r(this.rayEllipsoid(a,s)),y=s.transformPositionToScaledSpace(c),w=e.normalize(y,m),C=e.mostOrthogonalAxis(y,v),b=e.normalize(e.cross(C,w,f),f),S=e.normalize(e.cross(w,b,p),p),x=new o(w.x,b.x,S.x,w.y,b.y,S.y,w.z,b.z,S.z),E=o.transpose(x),T=o.fromScale(s.radii),P=o.fromScale(s.oneOverRadii),A=new o(0,c.z,-c.y,-c.z,0,c.x,c.y,-c.x,0),M=o.multiply(o.multiply(E,P),A),D=o.multiply(o.multiply(M,T),x),I=o.multiplyByVector(M,l),O=u(D,e.negate(I,m),0,0,1),R=O.length;if(R>0){for(var L=e.ZERO,N=Number.NEGATIVE_INFINITY,B=0;R>B;++B){d=o.multiplyByVector(T,o.multiplyByVector(x,O[B]));var F=e.normalize(e.subtract(d,l,v),v),z=e.dot(F,c);z>N&&(N=z,L=d)}var V=s.cartesianToCartographic(L);return N=n.clamp(N,0,1),g=e.magnitude(e.subtract(L,l,v))*Math.sqrt(1-N*N),g=_?-g:g,s.cartographicToCartesian(new t(V.longitude,V.latitude,g))}return void 0};var g=new e;return c.lineSegmentPlane=function(t,o,a,s){if(!r(t))throw new i("endPoint0 is required.");if(!r(o))throw new i("endPoint1 is required.");if(!r(a))throw new i("plane is required.");r(s)||(s=new e);var l=e.subtract(o,t,g),u=a.normal,c=e.dot(u,l);if(Math.abs(c)d||d>1?void 0:(e.multiplyByScalar(l,d,s),e.add(t,s,s),s)},c.trianglePlaneIntersection=function(t,n,o,a){if(!(r(t)&&r(n)&&r(o)&&r(a)))throw new i("p0, p1, p2, and plane are required.");var s=a.normal,l=a.distance,u=e.dot(s,t)+l<0,h=e.dot(s,n)+l<0,d=e.dot(s,o)+l<0,m=0;m+=u?1:0,m+=h?1:0,m+=d?1:0;var f,p;if((1===m||2===m)&&(f=new e,p=new e),1===m){if(u)return c.lineSegmentPlane(t,n,a,f),c.lineSegmentPlane(t,o,a,p),{positions:[t,n,o,f,p],indices:[0,3,4,1,2,4,1,4,3]};if(h)return c.lineSegmentPlane(n,o,a,f),c.lineSegmentPlane(n,t,a,p),{positions:[t,n,o,f,p],indices:[1,3,4,2,0,4,2,4,3]};if(d)return c.lineSegmentPlane(o,t,a,f),c.lineSegmentPlane(o,n,a,p),{positions:[t,n,o,f,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===m){if(!u)return c.lineSegmentPlane(n,t,a,f),c.lineSegmentPlane(o,t,a,p),{positions:[t,n,o,f,p],indices:[1,2,4,1,4,3,0,3,4]};if(!h)return c.lineSegmentPlane(o,n,a,f),c.lineSegmentPlane(t,n,a,p),{positions:[t,n,o,f,p],indices:[2,0,4,2,4,3,1,3,4]};if(!d)return c.lineSegmentPlane(t,o,a,f),c.lineSegmentPlane(n,o,a,p),{positions:[t,n,o,f,p],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}),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],f=c;if(t(l))h=l+1;else{for(;f>d;)m>h&&(h=m),++d,m=s[d];if(-1===h)return 0;++h}for(var p=[],v=0;h>v;v++)p[v]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;for(var g=0;f>d;)p[s[d]].vertexTriangles.push(g),++p[s[d]].numLiveTriangles,p[s[d+1]].vertexTriangles.push(g),++p[s[d+1]].numLiveTriangles,p[s[d+2]].vertexTriangles.push(g),++p[s[d+2]].numLiveTriangles,++g,d+=3;var _=0,y=u+1;a=1;var w,C,b=[],S=[],x=0,E=[],T=c/3,P=[];for(v=0;T>v;v++)P[v]=!1;for(var A,M;-1!==_;){b=[],C=p[_],M=C.vertexTriangles.length;for(var D=0;M>D;++D)if(g=C.vertexTriangles[D],!P[g]){P[g]=!0,d=g+g+g;for(var I=0;3>I;++I)A=s[d],b.push(A),S.push(A),E[x]=A,++x,w=p[A],--w.numLiveTriangles,y-w.timeStamp>u&&(w.timeStamp=y,++y),++d}_=o(s,u,b,p,y,S,h)}return E},i}),r("Core/GeometryPipeline",["./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b){"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 x(e){for(var t=e.length,r=6*(t/3),i=f.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 E(e){var t=e.length;if(t>=3){var r=6*(t-2),i=f.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=f.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 P(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&l(e[r])&&l(e[r].values)){var i=e[r];t[r]=new m({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function A(e,t,r){for(var i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values))for(var n=t[i],o=0;oo;o+=3)i.unpack(r,o,Z),y.multiplyByPoint(e,Z,Z),i.pack(Z,r,o)}function D(e,t){if(l(t))for(var r=t.values,n=r.length,o=0;n>o;o+=3)i.unpack(r,o,Z),_.multiplyByVector(e,Z,Z),Z=i.normalize(Z,Z),i.pack(Z,r,o)}function I(e){var t,r=e.length,i={},n=e[0].geometry.attributes;for(t in n)if(n.hasOwnProperty(t)&&l(n[t])&&l(n[t].values)){for(var o=n[t],s=o.values.length,u=!0,c=1;r>c;++c){var h=e[c].geometry.attributes[t];if(!l(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){u=!1;break}s+=h.values.length}u&&(i[t]=new m({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:a.createTypedArray(o.componentDatatype,s)}))}return i}function O(e){if(l(e.indices))return e;var t=d.computeNumberOfVertices(e);if(3>t)throw new u("The number of vertices must be at least three.");if(0!==t%3)throw new u("The number of vertices must be a multiple of three.");for(var r=f.createTypedArray(t,t),i=0;t>i;++i)r[i]=i;return e.indices=r,e}function R(e){var t=d.computeNumberOfVertices(e);if(3>t)throw new u("The number of vertices must be at least three.");var r=f.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=C.TRIANGLES,e}function L(e){var t=d.computeNumberOfVertices(e);if(3>t)throw new u("The number of vertices must be at least 3.");var r=f.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=C.TRIANGLES,e}function N(e){if(l(e.indices))return e;var t=d.computeNumberOfVertices(e);if(2>t)throw new u("The number of vertices must be at least two.");if(0!==t%2)throw new u("The number of vertices must be a multiple of 2.");for(var r=f.createTypedArray(t,t),i=0;t>i;++i)r[i]=i;return e.indices=r,e}function B(e){var t=d.computeNumberOfVertices(e);if(2>t)throw new u("The number of vertices must be at least two.");var r=f.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=C.LINES,e}function F(e){var t=d.computeNumberOfVertices(e);if(2>t)throw new u("The number of vertices must be at least two.");var r=f.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=C.LINES,e}function z(e){switch(e.primitiveType){case C.TRIANGLE_FAN:return R(e);case C.TRIANGLE_STRIP:return L(e);case C.TRIANGLES:return O(e);case C.LINE_STRIP:return B(e);case C.LINE_LOOP:return F(e);case C.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=ht.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(q(e,t,st,ut),q(e,r,lt,ct),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(q(t,r,st,ut),q(t,e,lt,ct),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(q(r,e,st,ut),q(r,t,lt,ct),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||(q(r,e,st,ut),q(r,t,lt,ct),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(q(t,r,st,ut),q(t,e,lt,ct),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(q(e,t,st,ut),q(e,r,lt,ct),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=ht.positions;return l[0]=e,l[1]=t,l[2]=r,ht.length=3,(1===a||2===a)&&(l[3]=st,l[4]=lt,l[5]=ut,l[6]=ct,ht.length=7),ht}function U(t,n,o,a,s,u,c,h){if(l(s)||l(u)||l(c)||l(h)){var d,m,f,p,v,g,_,y,w,C,b,S,x=a.positions,E=x[0],T=x[1],P=x[2],A=pt,M=vt,D=gt,I=dt,O=mt,R=ft;l(s)&&(d=i.fromArray(s,3*t),m=i.fromArray(s,3*n),f=i.fromArray(s,3*o)),l(u)&&(p=i.fromArray(u,3*t),v=i.fromArray(u,3*n),g=i.fromArray(u,3*o)),l(c)&&(_=i.fromArray(c,3*t),y=i.fromArray(c,3*n),w=i.fromArray(c,3*o)),l(h)&&(C=r.fromArray(h,2*t),b=r.fromArray(h,2*n),S=r.fromArray(h,2*o));for(var L=3;Lw;w+=3){var C=c[w],b=c[w+1],S=c[w+2],x=i.fromArray(r,3*C),E=i.fromArray(r,3*b),T=i.fromArray(r,3*S),P=k(x,E,T);if(l(P))if(h[3*C+1]=P.positions[0].y,h[3*b+1]=P.positions[1].y,h[3*S+1]=P.positions[2].y,P.length>3){for(var A=h.length/3,M=0;MD?_.push(c[w+D]):_.push(D-3+A)}for(var I=3;Ic;c+=2){var h=n[c],m=n[c+1],p=i.fromArray(r,3*h),_=i.fromArray(r,3*m);if(Math.abs(p.y)p;p+=3)h[f++]=n[p],h[f++]=n[p+1],h[f++]=n[p+2],h[f++]=n[p]+o[p]*i,h[f++]=n[p+1]+o[p+1]*i,h[f++]=n[p+2]+o[p+2]*i;var v,g=e.boundingSphere;return l(g)&&(v=new t(g.center,g.radius+i)),new d({attributes:{position:new m({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:h})},primitiveType:C.LINES,boundingSphere:v})},H.createAttributeLocations=function(e){if(!l(e))throw new u("geometry is required.");var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent"],i=e.attributes,n={},o=0,a=r.length;for(t=0;a>t;++t){var s=r[t];l(i[s])&&(n[s]=o++)}for(var c in i)i.hasOwnProperty(c)&&!l(n[c])&&(n[c]=o++);return n},H.reorderForPreVertexCache=function(e){if(!l(e))throw new u("geometry is required.");var t=d.computeNumberOfVertices(e),r=e.indices;if(l(r)){for(var i=new Int32Array(t),n=0;t>n;n++)i[n]=-1;for(var o,s=r,c=s.length,h=f.createTypedArray(t,c),m=0,p=0,v=0;c>m;)o=i[s[m]],-1!==o?h[p]=o:(o=s[m],i[o]=v,h[p]=v,++v),++m,++p;e.indices=h;var g=e.attributes;for(var _ in g)if(g.hasOwnProperty(_)&&l(g[_])&&l(g[_].values)){for(var y=g[_],w=y.values,C=0,b=y.componentsPerAttribute,S=a.createTypedArray(y.componentDatatype,v*b);t>C;){var x=i[C];if(-1!==x)for(n=0;b>n;n++)S[b*x+n]=w[b*C+n];++C}y.values=S}}return e},H.reorderForPostVertexCache=function(e,t){if(!l(e))throw new u("geometry is required.");var r=e.indices;if(e.primitiveType===C.TRIANGLES&&l(r)){for(var i=r.length,n=0,o=0;i>o;o++)r[o]>n&&(n=r[o]);e.indices=b.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},H.fitToUnsignedShortIndices=function(e){if(!l(e))throw new u("geometry is required.");if(l(e.indices)&&e.primitiveType!==C.TRIANGLES&&e.primitiveType!==C.LINES&&e.primitiveType!==C.POINTS)throw new u("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");var t=[],r=d.computeNumberOfVertices(e);if(l(e.indices)&&r>g.SIXTY_FOUR_KILOBYTES){var i,n=[],o=[],a=0,s=P(e.attributes),c=e.indices,h=c.length;e.primitiveType===C.TRIANGLES?i=3:e.primitiveType===C.LINES?i=2:e.primitiveType===C.POINTS&&(i=1);for(var m=0;h>m;m+=i){for(var f=0;i>f;++f){var p=c[m+f],v=n[p];l(v)||(v=a++,n[p]=v,A(s,e.attributes,p)),o.push(v)}a+i>g.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),n=[],o=[],a=0,s=P(e.attributes))}0!==o.length&&t.push(new d({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var j=new i,Y=new o;H.projectTo2D=function(e,t,r,n,o){if(!l(e))throw new u("geometry is required.");if(!l(t))throw new u("attributeName is required.");if(!l(r))throw new u("attributeName3D is required.");if(!l(n))throw new u("attributeName2D is required.");if(!l(e.attributes[t]))throw new u("geometry must have attribute matching the attributeName argument: "+t+".");if(e.attributes[t].componentDatatype!==a.DOUBLE)throw new u("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");var s=e.attributes[t];o=l(o)?o:new h;for(var c=o.ellipsoid,d=s.values,f=new Float64Array(d.length),p=0,v=0;vf;++f)c.encode(o[f],X),h[f]=X.high,d[f]=X.low;var p=n.componentsPerAttribute;return e.attributes[r]=new m({componentDatatype:a.FLOAT,componentsPerAttribute:p,values:h}),e.attributes[i]=new m({componentDatatype:a.FLOAT,componentsPerAttribute:p,values:d}),delete e.attributes[t],e};var Z=new i,J=new y,Q=new _;H.transformToWorldCoordinates=function(e){if(!l(e))throw new u("instance is required.");var r=e.modelMatrix;if(y.equals(r,y.IDENTITY))return e;var i=e.geometry.attributes;M(r,i.position),M(r,i.prevPosition),M(r,i.nextPosition),(l(i.normal)||l(i.binormal)||l(i.tangent))&&(y.inverse(r,J),y.transpose(J,J),y.getRotation(J,Q),D(Q,i.normal),D(Q,i.binormal),D(Q,i.tangent));var n=e.geometry.boundingSphere;return l(n)&&(e.geometry.boundingSphere=t.transform(n,r,n)),e.modelMatrix=y.clone(y.IDENTITY),e};var K=new i;H.combine=function(e){if(!l(e)||e.length<1)throw new u("instances is required and must have length greater than zero.");var r,n,o,a,s=e.length,c=e[0].modelMatrix,h=l(e[0].geometry.indices),m=e[0].geometry.primitiveType;for(n=1;s>n;++n){if(!y.equals(e[n].modelMatrix,c))throw new u("All instances must have the same modelMatrix.");if(l(e[n].geometry.indices)!==h)throw new u("All instance geometries must have an indices or not have one.");if(e[n].geometry.primitiveType!==m)throw new u("All instance geometries must have the same primitiveType.")}var p,v,g,_=I(e);for(r in _)if(_.hasOwnProperty(r))for(p=_[r].values,a=0,n=0;s>n;++n)for(v=e[n].geometry.attributes[r].values,g=v.length,o=0;g>o;++o)p[a++]=v[o];var w;if(h){var b=0;for(n=0;s>n;++n)b+=e[n].geometry.indices.length;var S=d.computeNumberOfVertices(new d({attributes:_,primitiveType:C.POINTS})),x=f.createTypedArray(S,b),E=0,T=0;for(n=0;s>n;++n){var P=e[n].geometry.indices,A=P.length;for(a=0;A>a;++a)x[E++]=T+P[a];T+=d.computeNumberOfVertices(e[n].geometry)}w=x}var M,D=new i,O=0;for(n=0;s>n;++n){if(M=e[n].geometry.boundingSphere,!l(M)){D=void 0;break}i.add(M.center,D,D)}if(l(D))for(i.divideByScalar(D,s,D),n=0;s>n;++n){M=e[n].geometry.boundingSphere;var R=i.magnitude(i.subtract(M.center,D,K))+M.radius;R>O&&(O=R)}return new d({attributes:_,indices:w,primitiveType:m,boundingSphere:l(D)?new t(D,O):void 0})};var $=new i,et=new i,tt=new i,rt=new i;H.computeNormal=function(e){if(!l(e))throw new u("geometry is required.");if(!l(e.attributes.position)||!l(e.attributes.position.values))throw new u("geometry.attributes.position.values is required.");if(!l(e.indices))throw new u("geometry.indices is required.");if(e.indices.length<2||0!==e.indices.length%3)throw new u("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==C.TRIANGLES)throw new u("geometry.primitiveType must be PrimitiveType.TRIANGLES.");for(var t=e.indices,r=e.attributes,n=r.position.values,o=r.position.values.length/3,s=t.length,c=new Array(o),h=new Array(s/3),d=new Array(s),f=0;o>f;f++)c[f]={indexOffset:0,count:0,currentCount:0};var p=0;for(f=0;s>f;f+=3){var v=t[f],g=t[f+1],_=t[f+2],y=3*v,w=3*g,b=3*_;et.x=n[y],et.y=n[y+1],et.z=n[y+2],tt.x=n[w],tt.y=n[w+1],tt.z=n[w+2],rt.x=n[b],rt.y=n[b+1],rt.z=n[b+2],c[v].count++,c[g].count++,c[_].count++,i.subtract(tt,et,tt),i.subtract(rt,et,rt),h[p]=i.cross(tt,rt,new i),p++}var S=0;for(f=0;o>f;f++)c[f].indexOffset+=S,S+=c[f].count;p=0;var x;for(f=0;s>f;f+=3){x=c[t[f]];var E=x.indexOffset+x.currentCount;d[E]=p,x.currentCount++,x=c[t[f+1]],E=x.indexOffset+x.currentCount,d[E]=p,x.currentCount++,x=c[t[f+2]],E=x.indexOffset+x.currentCount,d[E]=p,x.currentCount++,p++}var T=new Float32Array(3*o);for(f=0;o>f;f++){var P=3*f;if(x=c[f],x.count>0){for(i.clone(i.ZERO,$),p=0;pf;f+=3){var _=r[f],y=r[f+1],w=r[f+2];p=3*_,v=3*y,g=3*w;var b=2*_,S=2*y,x=2*w,E=n[p],T=n[p+1],P=n[p+2],A=s[b],M=s[b+1],D=s[S+1]-M,I=s[x+1]-M,O=1/((s[S]-A)*I-(s[x]-A)*D),R=(I*(n[v]-E)-D*(n[g]-E))*O,L=(I*(n[v+1]-T)-D*(n[g+1]-T))*O,N=(I*(n[v+2]-P)-D*(n[g+2]-P))*O;d[p]+=R,d[p+1]+=L,d[p+2]+=N,d[v]+=R,d[v+1]+=L,d[v+2]+=N,d[g]+=R,d[g+1]+=L,d[g+2]+=N}var B=new Float32Array(3*c),F=new Float32Array(3*c);for(f=0;c>f;f++){p=3*f,v=p+1,g=p+2;var z=i.fromArray(o,p,it),V=i.fromArray(d,p,ot),q=i.dot(z,V);i.multiplyByScalar(z,q,nt),i.normalize(i.subtract(V,nt,V),V),F[p]=V.x,F[v]=V.y,F[g]=V.z,i.normalize(i.cross(z,V,V),V),B[p]=V.x,B[v]=V.y,B[g]=V.z}return e.attributes.tangent=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:F}),e.attributes.binormal=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:B}),e};var at=new i,st=new i,lt=new i,ut=new i,ct=new i,ht={positions:new Array(7),indices:new Array(9)},dt=new r,mt=new r,ft=new r,pt=new i,vt=new i,gt=new i,_t=new i,yt=new i,wt=new i; return H.wrapLongitude=function(e){if(!l(e))throw new u("geometry is required.");var r=e.boundingSphere;if(l(r)){var i=r.center.x-r.radius;if(i>0||t.intersect(r,n.UNIT_Y)!==p.INTERSECTING)return e}return z(e),e.primitiveType===C.TRIANGLES?W(e):e.primitiveType===C.LINES&&G(e),e},H}),r("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C){"use strict";function b(e,t,i){var o=t.vertexFormat,a=t.center,s=t.semiMajorAxis,u=t.ellipsoid,h=t.stRotation,f=i?2*(e.length/3):e.length/3,p=o.st?new Float32Array(2*f):void 0,v=o.normal?new Float32Array(3*f):void 0,g=o.tangent?new Float32Array(3*f):void 0,y=o.binormal?new Float32Array(3*f):void 0,C=0,b=N,S=B,x=F,E=new c(u),T=E.project(u.cartesianToCartographic(a,z),V),P=u.scaleToGeodeticSurface(a,A);u.geodeticSurfaceNormal(P,P);for(var I=w.fromAxisAngle(P,h,L),q=_.fromQuaternion(I,R),k=e.length,U=i?k:0,W=2*(U/3),G=0;k>G;G+=3){var H=G+1,j=G+2,Y=r.fromArray(e,G,A);if(o.st){var X=_.multiplyByVector(q,Y,M),Z=E.project(u.cartesianToCartographic(X,z),D);r.subtract(Z,T,Z),O.x=(Z.x+s)/(2*s),O.y=(Z.y+s)/(2*s),i&&(p[C+W]=O.x,p[C+1+W]=O.y),p[C++]=O.x,p[C++]=O.y}b=u.geodeticSurfaceNormal(Y,b),(o.normal||o.tangent||o.binormal)&&((o.tangent||o.binormal)&&(S=r.cross(r.UNIT_Z,b,S),_.multiplyByVector(q,S,S)),o.normal&&(v[G]=b.x,v[H]=b.y,v[j]=b.z,i&&(v[G+U]=-b.x,v[H+U]=-b.y,v[j+U]=-b.z)),o.tangent&&(g[G]=S.x,g[H]=S.y,g[j]=S.z,i&&(g[G+U]=-S.x,g[H+U]=-S.y,g[j+U]=-S.z)),o.binormal&&(x=r.cross(b,S,x),y[G]=x.x,y[H]=x.y,y[j]=x.z,i&&(y[G+U]=x.x,y[H+U]=x.y,y[j+U]=x.z)))}var J=new m;if(o.position){var Q=l.raisePositionsToHeight(e,t,i);J.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Q})}return o.st&&(J.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:p})),o.normal&&(J.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:v})),o.tangent&&(J.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:g})),o.binormal&&(J.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),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 x(t){var i=t.center;q=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,q),t.height,q),q=r.add(i,q,q);var n=new e(q,t.semiMajorAxis),o=l.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,u=b(a,t,!1),c=S(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:u,indices:c}}function E(e,t){var i=t.vertexFormat,o=t.center,a=t.semiMajorAxis,s=t.ellipsoid,l=t.height,u=t.extrudedHeight,h=t.stRotation,f=2*(e.length/3),p=new Float64Array(3*f),v=i.st?new Float32Array(2*f):void 0,g=i.normal?new Float32Array(3*f):void 0,y=i.tangent?new Float32Array(3*f):void 0,C=i.binormal?new Float32Array(3*f):void 0,b=0,S=N,x=B,E=F,T=new c(s),P=T.project(s.cartesianToCartographic(o,z),V),q=s.scaleToGeodeticSurface(o,A);s.geodeticSurfaceNormal(q,q);for(var k=w.fromAxisAngle(q,h,L),U=_.fromQuaternion(k,R),W=e.length,G=2*(W/3),H=0;W>H;H+=3){var j,Y=H+1,X=H+2,Z=r.fromArray(e,H,A);if(i.st){var J=_.multiplyByVector(U,Z,M),Q=T.project(s.cartesianToCartographic(J,z),D);r.subtract(Q,P,Q),O.x=(Q.x+a)/(2*a),O.y=(Q.y+a)/(2*a),v[b+G]=O.x,v[b+1+G]=O.y,v[b++]=O.x,v[b++]=O.y}Z=s.scaleToGeodeticSurface(Z,Z),j=r.clone(Z,M),S=s.geodeticSurfaceNormal(Z,S);var K=r.multiplyByScalar(S,l,I);if(Z=r.add(Z,K,Z),K=r.multiplyByScalar(S,u,K),j=r.add(j,K,j),i.position&&(p[H+W]=j.x,p[Y+W]=j.y,p[X+W]=j.z,p[H]=Z.x,p[Y]=Z.y,p[X]=Z.z),i.normal||i.tangent||i.binormal){E=r.clone(S,E);var $=r.fromArray(e,(H+3)%W,I);r.subtract($,Z,$);var et=r.subtract(j,Z,D);S=r.normalize(r.cross(et,$,S),S),i.normal&&(g[H]=S.x,g[Y]=S.y,g[X]=S.z,g[H+W]=S.x,g[Y+W]=S.y,g[X+W]=S.z),i.tangent&&(x=r.normalize(r.cross(E,S,x),x),y[H]=x.x,y[Y]=x.y,y[X]=x.z,y[H+W]=x.x,y[H+1+W]=x.y,y[H+2+W]=x.z),i.binormal&&(C[H]=E.x,C[Y]=E.y,C[X]=E.z,C[H+W]=E.x,C[Y+W]=E.y,C[X+W]=E.z)}}var tt=new m;return i.position&&(tt.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})),i.st&&(tt.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),i.normal&&(tt.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:g})),i.tangent&&(tt.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),i.binormal&&(tt.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),tt}function T(e){for(var t,r,i,n,o=e.length/3,a=v.createTypedArray(o,6*o),s=0,l=0;o-1>l;l++)t=l,i=l+o,r=t+1,n=r+o,a[s++]=t,a[s++]=i,a[s++]=r,a[s++]=r,a[s++]=i,a[s++]=n;return t=o-1,i=l+o,r=0,n=r+o,a[s++]=t,a[s++]=i,a[s++]=r,a[s++]=r,a[s++]=i,a[s++]=n,a}function P(t){var i=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,A),t.height,A);k.center=r.add(i,a,k.center),k.radius=o,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,a),t.extrudedHeight,a),U.center=r.add(i,a,U.center),U.radius=o;var s=l.computeEllipsePositions(t,!0,!0),u=s.positions,c=s.numPts,d=s.outerPositions,m=e.union(k,U),g=b(u,t,!0),_=S(c),w=_.length;_.length=2*w;for(var C=u.length/3,x=0;w>x;x+=3)_[x+w]=_[x+2]+C,_[x+1+w]=_[x+1]+C,_[x+2+w]=_[x]+C;var P=v.createTypedArray(2*C/3,_),M=new h({attributes:g,indices:P,primitiveType:y.TRIANGLES}),D=E(d,t);_=T(d);var I=v.createTypedArray(2*d.length/3,_),O=new h({attributes:D,indices:I,primitiveType:y.TRIANGLES}),R=p.combine([new f({geometry:M}),new f({geometry:O})]);return{boundingSphere:m,attributes:R.attributes,indices:R.indices}}var A=new r,M=new r,D=new r,I=new r,O=new t,R=new _,L=new w,N=new r,B=new r,F=new r,z=new i,V=new r,q=new r,k=new e,U=new e,W=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,i=e.semiMajorAxis,n=e.semiMinorAxis,l=o(e.granularity,g.RADIANS_PER_DEGREE),c=o(e.height,0),h=e.extrudedHeight,d=a(h)&&!g.equalsEpsilon(c,h,1);if(!a(t))throw new s("center is required.");if(!a(i))throw new s("semiMajorAxis is required.");if(!a(n))throw new s("semiMinorAxis is required.");if(0>=i||0>=n)throw new s("Semi-major and semi-minor axes must be greater than zero.");if(n>i)throw new s("semiMajorAxis must be larger than the semiMajorAxis.");if(0>=l)throw new s("granularity must be greater than zero.");this._center=r.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=n,this._ellipsoid=o(e.ellipsoid,u.WGS84),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=c,this._granularity=l,this._vertexFormat=o(e.vertexFormat,C.DEFAULT),this._extrudedHeight=h,this._extrude=d,this._workerName="createEllipseGeometry"};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,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=P(r)):t=x(r),new h({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},W}),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",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function f(i){var n=i.center;g=t.multiplyByScalar(i.ellipsoid.geodeticSurfaceNormal(n,g),i.height,g),g=t.add(n,g,g);for(var o=new e(g,i.semiMajorAxis),s=a.computeEllipsePositions(i,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,i,!1)})}),d=s.length/3,m=h.createTypedArray(d,2*d),f=0,p=0;d-1>p;p++)m[f++]=p,m[f++]=p+1;return m[f++]=d-1,m[f++]=0,{boundingSphere:o,attributes:l,indices:m}}function p(n){var o=i(n.numberOfVerticalLines,16);o=Math.max(o,0);var s=n.center,l=n.ellipsoid,d=n.semiMajorAxis,m=t.multiplyByScalar(l.geodeticSurfaceNormal(s,v),n.height,v);_.center=t.add(s,m,_.center),_.radius=d,m=t.multiplyByScalar(l.geodeticSurfaceNormal(s,m),n.extrudedHeight,m),y.center=t.add(s,m,y.center),y.radius=d;var f=a.computeEllipsePositions(n,!1,!0).outerPositions,p=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(f,n,!0)})});f=p.position.values;var g=e.union(_,y),w=f.length/3,C=h.createTypedArray(w,2*w+2*o);w/=2;for(var b=0,S=0;w-1>S;S++)C[b++]=S,C[b++]=S+1,C[b++]=S+w,C[b++]=S+w+1;C[b++]=w-1,C[b++]=0,C[b++]=w+w-1,C[b++]=w;var x;if(o>0){var E=Math.min(o,w);x=Math.round(w/E)}var T=Math.min(x*o,w);if(o>0)for(S=0;T>S;S+=x)C[b++]=S,C[b++]=S+w;return{boundingSphere:g,attributes:p,indices:C}}var v=new t,g=new t,_=new e,y=new e,w=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.center,a=e.semiMajorAxis,l=e.semiMinorAxis,u=i(e.granularity,d.RADIANS_PER_DEGREE),c=i(e.height,0),h=e.extrudedHeight,m=n(h)&&!d.equalsEpsilon(c,h,1);if(!n(r))throw new o("center is required.");if(!n(a))throw new o("semiMajorAxis is required.");if(!n(l))throw new o("semiMinorAxis is required.");if(0>=a||0>=l)throw new o("Semi-major and semi-minor axes must be greater than zero.");if(l>a)throw new o("semiMajorAxis must be larger than the semiMajorAxis.");if(0>=u)throw new o("granularity must be greater than zero.");this._center=t.clone(r),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=i(e.ellipsoid,s.WGS84),this._rotation=i(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=m,this._numberOfVerticalLines=Math.max(i(e.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=p(r)):t=f(r),new l({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/ClockRange",[],function(){"use strict";var e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e}),r("Core/ClockStep",[],function(){"use strict";var e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return 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("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,f,p,v,g;if("%%"==e)return"%";for(var _=!1,y="",w=!1,C=!1,b=" ",S=l.length,x=0;l&&S>x;x++)switch(l.charAt(x)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":b=l.charAt(x+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,_=!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,w,b);case"c":return s(String.fromCharCode(+g),_,u,h,w);case"b":return a(g,2,C,_,u,h,w);case"o":return a(g,8,C,_,u,h,w);case"x":return a(g,16,C,_,u,h,w);case"X":return a(g,16,C,_,u,h,w).toUpperCase();case"u":return a(g,10,C,_,u,h,w);case"i":case"d":return m=+g||0,m=Math.round(m-m%1),f=0>m?"-":y,g=f+n(String(Math.abs(m)),h,"0",!1),o(g,f,_,u,w);case"e":case"E":case"f":case"F":case"g":case"G":return m=+g,f=0>m?"-":y,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=f+Math.abs(m)[p](h),o(g,f,_,u,w)[v]();default:return e}};return i.replace(e,l)}return e}),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/GregorianDate",[],function(){"use strict";var e=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};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/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("Core/LeapSecond",[],function(){"use strict";var e=function(e,t){this.julianDate=e,this.offset=t};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/TimeStandard",[],function(){"use strict";var e={UTC:0,TAI:1};return e}),r("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./GregorianDate","./isArray","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){return I.compare(e.julianDate,t.julianDate)}function m(e){w.julianDate=e;var r=I.leapSeconds,i=t(r,w,d);0>i&&(i=~i),i>=r.length&&(i=r.length-1);var n=r[i].offset;if(i>0){var o=I.getSecondsDifference(r[i].julianDate,e);o>n&&(i--,n=r[i].offset)}I.addSeconds(e,n,e)}function f(e,r){w.julianDate=e;var i=I.leapSeconds,n=t(i,w,d);if(0>n&&(n=~n),0===n)return I.addSeconds(e,-i[0].offset,r);if(n>=i.length)return I.addSeconds(e,-i[n-1].offset,r);var o=I.getSecondsDifference(i[n].julianDate,e);return 0===o?I.addSeconds(e,-i[n].offset,r):1>=o?void 0:I.addSeconds(e,-i[--n].offset,r)}function p(e,t,r){var i=0|t/c.SECONDS_PER_DAY;return e+=i,t-=c.SECONDS_PER_DAY*i,0>t&&(e--,t+=c.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function v(e,t,r,i,n,o,a){var s=0|(t-14)/12,l=e+4800+s,u=(0|1461*l/4)+(0|367*(t-2-12*s)/12)-(0|3*((l+100)/100)/4)+r-32075;i-=12,0>i&&(i+=24);var h=o+(i*c.SECONDS_PER_HOUR+n*c.SECONDS_PER_MINUTE+a*c.SECONDS_PER_MILLISECOND);return h>=43200&&(u-=1),[u,h]}var g=new a,_=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,w=new u,C=/^(\d{4})$/,b=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,x=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,E=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,P=/^(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,D="Invalid ISO 8601 date.",I=function(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),i=r(i,h.UTC);var n=0|e;t+=(e-n)*c.SECONDS_PER_DAY,p(n,t,this),i===h.UTC&&m(this)};I.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new o("date must be a valid JavaScript Date.");var r=v(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return i(t)?(p(r[0],r[1],t),m(t),t):new I(r[0],r[1],h.UTC)},I.fromIso8601=function(e,t){if("string"!=typeof e)throw new o(D);e=e.replace(",",".");var r,n,a,s=e.split("T"),u=1,c=1,d=0,f=0,g=0,w=0,T=s[0],O=s[1];if(!i(T))throw new o(D);var R;if(s=T.match(E),null!==s){if(R=T.split("-").length-1,R>0&&2!==R)throw new o(D);r=+s[1],u=+s[2],c=+s[3]}else if(s=T.match(b),null!==s)r=+s[1],u=+s[2];else if(s=T.match(C),null!==s)r=+s[1];else{var L;if(s=T.match(S),null!==s){if(r=+s[1],L=+s[2],a=l(r),1>L||a&&L>366||!a&&L>365)throw new o(D)}else{if(s=T.match(x),null===s)throw new o(D);r=+s[1];var N=+s[2],B=+s[3]||0;if(R=T.split("-").length-1,R>0&&(!i(s[3])&&1!==R||i(s[3])&&2!==R))throw new o(D);var F=new Date(Date.UTC(r,0,4));L=7*N+B-F.getUTCDay()-3}n=new Date(Date.UTC(r,0,1)),n.setUTCDate(L),u=n.getUTCMonth()+1,c=n.getUTCDate()}if(a=l(r),1>u||u>12||1>c||(2!==u||!a)&&c>_[u-1]||a&&2===u&&c>y)throw new o(D);var z;if(i(O)){if(s=O.match(M),null!==s){if(R=O.split(":").length-1,R>0&&2!==R&&3!==R)throw new o(D);d=+s[1],f=+s[2],g=+s[3],w=1e3*+(s[4]||0),z=5}else if(s=O.match(A),null!==s){if(R=O.split(":").length-1,R>0&&1!==R)throw new o(D);d=+s[1],f=+s[2],g=60*+(s[3]||0),z=4}else{if(s=O.match(P),null===s)throw new o(D);d=+s[1],f=60*+(s[2]||0),z=3}if(f>=60||g>=61||d>24||24===d&&(f>0||g>0||w>0))throw new o(D);var V=s[z],q=+s[z+1],k=+(s[z+2]||0);switch(V){case"+":d-=q,f-=k;break;case"-":d+=q,f+=k;break;case"Z":break;default:f+=new Date(Date.UTC(r,u-1,c,d,f)).getTimezoneOffset()}}else f+=new Date(Date.UTC(r,u-1,c)).getTimezoneOffset();var U=60===g;for(U&&g--;f>=60;)f-=60,d++;for(;d>=24;)d-=24,c++;for(n=a&&2===u?y:_[u-1];c>n;)c-=n,u++,u>12&&(u-=12,r++),n=a&&2===u?y:_[u-1];for(;0>f;)f+=60,d--;for(;0>d;)d+=24,c--;for(;1>c;)u--,1>u&&(u+=12,r--),n=a&&2===u?y:_[u-1],c+=n;var W=v(r,u,c,d,f,g,w);return i(t)?(p(W[0],W[1],t),m(t)):t=new I(W[0],W[1],h.UTC),U&&I.addSeconds(t,1,t),t},I.now=function(e){return I.fromDate(new Date,e)};var O=new I(0,0,h.TAI);return I.toGregorianDate=function(e,t){if(!i(e))throw new o("julianDate is required.");var r=!1,n=f(e,O);i(n)||(I.addSeconds(e,-1,O),n=f(O,O),r=!0);var s=n.dayNumber,l=n.secondsOfDay;l>=43200&&(s+=1);var u=0|s+68569,h=0|4*u/146097;u=0|u-(0|(146097*h+3)/4);var d=0|4e3*(u+1)/1461001;u=0|u-(0|1461*d/4)+31;var m=0|80*u/2447,p=0|u-(0|2447*m/80);u=0|m/11;var v=0|m+2-12*u,g=0|100*(h-49)+d+u,_=0|l/c.SECONDS_PER_HOUR,y=l-_*c.SECONDS_PER_HOUR,w=0|y/c.SECONDS_PER_MINUTE;y-=w*c.SECONDS_PER_MINUTE;var C=0|y,b=(y-C)/c.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(C+=1),i(t)?(t.year=g,t.month=v,t.day=p,t.hour=_,t.minute=w,t.second=C,t.millisecond=b,t.isLeapSecond=r,t):new a(g,v,p,_,w,C,b,r)},I.toDate=function(e){if(!i(e))throw new o("julianDate is required.");var t=I.toGregorianDate(e,g),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},I.toIso8601=function(t,r){if(!i(t))throw new o("julianDate is required.");var n,a=I.toGregorianDate(t,a);return i(r)||0===a.millisecond?i(r)&&0!==r?(n=(.01*a.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(n=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,n))},I.clone=function(e,t){return i(e)?i(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new I(e.dayNumber,e.secondsOfDay,h.TAI):void 0},I.compare=function(e,t){if(!i(e))throw new o("left is required.");if(!i(t))throw new o("right is required.");var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},I.equals=function(e,t){return e===t||i(e)&&i(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},I.equalsEpsilon=function(e,t,r){if(!i(r))throw new o("epsilon is required.");return e===t||i(e)&&i(t)&&Math.abs(I.getSecondsDifference(e,t))<=r},I.getTotalDays=function(e){if(!i(e))throw new o("julianDate is required.");return e.dayNumber+e.secondsOfDay/c.SECONDS_PER_DAY},I.getSecondsDifference=function(e,t){if(!i(e))throw new o("left is required.");if(!i(t))throw new o("right is required.");var r=(e.dayNumber-t.dayNumber)*c.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},I.getDaysDifference=function(e,t){if(!i(e))throw new o("left is required.");if(!i(t))throw new o("right is required.");var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/c.SECONDS_PER_DAY;return r+n},I.getTaiMinusUtc=function(e){w.julianDate=e;var r=I.leapSeconds,i=t(r,w,d);return 0>i&&(i=~i,--i,0>i&&(i=0)),r[i].offset},I.addSeconds=function(e,t,r){if(!i(e))throw new o("julianDate is required.");if(!i(t))throw new o("seconds is required.");if(!i(r))throw new o("result is required.");return p(e.dayNumber,e.secondsOfDay+t,r)},I.addMinutes=function(e,t,r){if(!i(e))throw new o("julianDate is required.");if(!i(t))throw new o("minutes is required.");if(!i(r))throw new o("result is required.");var n=e.secondsOfDay+t*c.SECONDS_PER_MINUTE;return p(e.dayNumber,n,r)},I.addHours=function(e,t,r){if(!i(e))throw new o("julianDate is required.");if(!i(t))throw new o("hours is required.");if(!i(r))throw new o("result is required.");var n=e.secondsOfDay+t*c.SECONDS_PER_HOUR;return p(e.dayNumber,n,r)},I.addDays=function(e,t,r){if(!i(e))throw new o("julianDate is required.");if(!i(t))throw new o("days is required.");if(!i(r))throw new o("result is required.");var n=e.dayNumber+t;return p(n,e.secondsOfDay,r)},I.lessThan=function(e,t){return I.compare(e,t)<0},I.lessThanOrEquals=function(e,t){return I.compare(e,t)<=0},I.greaterThan=function(e,t){return I.compare(e,t)>0},I.greaterThanOrEquals=function(e,t){return I.compare(e,t)>=0},I.prototype.clone=function(e){return I.clone(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.leapSeconds=[new u(new I(2441317,43210,h.TAI),10),new u(new I(2441499,43211,h.TAI),11),new u(new I(2441683,43212,h.TAI),12),new u(new I(2442048,43213,h.TAI),13),new u(new I(2442413,43214,h.TAI),14),new u(new I(2442778,43215,h.TAI),15),new u(new I(2443144,43216,h.TAI),16),new u(new I(2443509,43217,h.TAI),17),new u(new I(2443874,43218,h.TAI),18),new u(new I(2444239,43219,h.TAI),19),new u(new I(2444786,43220,h.TAI),20),new u(new I(2445151,43221,h.TAI),21),new u(new I(2445516,43222,h.TAI),22),new u(new I(2446247,43223,h.TAI),23),new u(new I(2447161,43224,h.TAI),24),new u(new I(2447892,43225,h.TAI),25),new u(new I(2448257,43226,h.TAI),26),new u(new I(2448804,43227,h.TAI),27),new u(new I(2449169,43228,h.TAI),28),new u(new I(2449534,43229,h.TAI),29),new u(new I(2450083,43230,h.TAI),30),new u(new I(2450630,43231,h.TAI),31),new u(new I(2451179,43232,h.TAI),32),new u(new I(2453736,43233,h.TAI),33),new u(new I(2454832,43234,h.TAI),34),new u(new I(2456109,43235,h.TAI),35)],I}),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(l){l=r(l,r.EMPTY_OBJECT);var u=l.startTime,c=!i(u),h=l.stopTime,d=!i(h),m=l.currentTime,f=!i(m);if(c&&d&&f?(m=s.now(),u=s.clone(m),h=s.addDays(m,1,new s)):c&&d?(u=s.clone(m),h=s.addDays(m,1,new s)):c&&f?(u=s.addDays(h,-1,new s),m=s.clone(u)):f&&d?(m=s.clone(u),h=s.addDays(u,1,new s)):f?m=s.clone(u):d?h=s.addDays(m,1,new s):c&&(u=s.clone(m)),s.greaterThan(u,h))throw new n("startTime must come before stopTime.");this.startTime=u,this.stopTime=h,this.currentTime=m,this.multiplier=r(l.multiplier,1),this.clockStep=r(l.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=r(l.clockRange,e.UNBOUNDED),this.canAnimate=r(l.canAnimate,!0),this.shouldAnimate=r(l.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=a()};return l.prototype.tick=function(){var r=a(),i=s.clone(this.currentTime),n=this.startTime,o=this.stopTime,l=this.multiplier;if(this.canAnimate&&this.shouldAnimate)if(this.clockStep===t.SYSTEM_CLOCK)i=s.now(i);else{if(this.clockStep===t.TICK_DEPENDENT)i=s.addSeconds(i,l,i);else{var u=r-this._lastSystemTime;i=s.addSeconds(i,l*(u/1e3),i)}if(this.clockRange===e.CLAMPED)s.lessThan(i,n)?i=s.clone(n,i):s.greaterThan(i,o)&&(i=s.clone(o,i));else if(this.clockRange===e.LOOP_STOP)for(s.lessThan(i,n)&&(i=s.clone(n,i));s.greaterThan(i,o);)i=s.addSeconds(n,s.getSecondsDifference(i,o),i)}return this.currentTime=i,this._lastSystemTime=r,this.onTick.raiseEvent(this),i},l}),r("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./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.fromCartesian4=function(e,i){if(!t(e))throw new r("cartesian is required");return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},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;i.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(i,n){i=e(i,e.EMPTY_OBJECT);var a=i.red;if(!t(a)){var l=e(i.minimumRed,0),u=e(i.maximumRed,1);if(l>u)throw new r("minimumRed must be less than or equal to maximumRed");a=l+o.nextRandomNumber()*(u-l)}var c=i.green;if(!t(c)){var h=e(i.minimumGreen,0),d=e(i.maximumGreen,1);if(h>d)throw new r("minimumGreen must be less than or equal to maximumGreen");c=h+o.nextRandomNumber()*(d-h)}var m=i.blue;if(!t(m)){var f=e(i.minimumBlue,0),p=e(i.maximumBlue,1);if(f>p)throw new r("minimumBlue must be less than or equal to maximumBlue");m=f+o.nextRandomNumber()*(p-f)}var v=i.alpha;if(!t(v)){var g=e(i.minimumAlpha,0),_=e(i.maximumAlpha,1);if(g>_)throw new r("minimumAlpha must be less than or equal to maximumAlpha");v=g+o.nextRandomNumber()*(_-g)}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,f=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i){if(!t(i))throw new r("color is required");var n=s[i.toUpperCase()];if(t(n))return s.clone(n);var o=h.exec(i);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=d.exec(i),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=m.exec(i),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=f.exec(i),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(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.red,n[o++]=i.green,n[o++]=i.blue,n[o]=i.alpha},s.unpack=function(i,n,o){if(!t(i))throw new r("array is required");return n=e(n,0),t(o)||(o=new s),o.red=i[n++],o.green=i[n++],o.blue=i[n++],o.alpha=i[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=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUSCHIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s }),r("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n,o){"use strict";var a=function(t,i,n,o){t=r(t,1),i=r(i,1),n=r(n,1),o=r(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(i),e.floatToByte(n),e.floatToByte(o)])};return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){if(!i(e))throw new o("color is required.");return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){if(!i(e))throw new o("color is required.");return i(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a}),r("Core/CornerType",[],function(){"use strict";var e={ROUNDED:0,MITERED:1,BEVELED:2};return e}),r("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(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,f=Math.sqrt(m),p=t/4,v=p*p,g=v*p,_=v*v,y=1+p-3*v/4+5*g/4-175*_/64,w=1-p+15*v/8-35*g/8,C=1-3*p+35*v/4,b=1-5*p,S=y*c-w*Math.sin(2*c)*p/2-C*Math.sin(4*c)*v/16-b*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=f,x.u2Over4=p,x.u4Over16=v,x.u6Over64=g,x.u8Over256=_,x.a0=y,x.a1=w,x.a2=C,x.a3=b,x.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,o,a){var l,u,h,d,m,f=(t-r)/t,p=o-i,v=Math.atan((1-f)*Math.tan(n)),g=Math.atan((1-f)*Math.tan(a)),_=Math.cos(v),y=Math.sin(v),w=Math.cos(g),C=Math.sin(g),b=_*w,S=_*C,x=y*C,E=y*w,T=p,P=s.TWO_PI,A=Math.cos(T),M=Math.sin(T);do{A=Math.cos(T),M=Math.sin(T);var D=S-E*A;h=Math.sqrt(w*w*M*M+D*D),u=x+b*A,l=Math.atan2(h,u);var I;0===h?(I=0,d=1):(I=b*M/h,d=1-I*I),P=T,m=u-2*x/d,isNaN(m)&&(m=0),T=p+c(f,I,d,l,h,u,m)}while(Math.abs(T-P)>s.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*(u*(2*N-1)-L*m*(4*h*h-3)*(4*N-3)/6)/4),F=r*R*(l-B),z=Math.atan2(w*M,S-E*A),V=Math.atan2(_*M,S*A-E);e._distance=F,e._startHeading=z,e._endHeading=V,e._uSquared=O}function d(r,i,n,a){var s=e.normalize(a.cartographicToCartesian(i,f),m),u=e.normalize(a.cartographicToCartesian(n,f),f);if(Math.abs(Math.abs(e.angleBetween(s,u))-Math.PI)<.0125)throw new o("geodesic position is not unique");h(r,a.maximumRadius,a.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),l(r)}var m=new e,f=new e,p=function(e,n,o){var s=r(o,a.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)&&d(this,e,n,s)};return n(p.prototype,{surfaceDistance:{get:function(){if(!i(this._distance))throw new o("set end positions before getting surfaceDistance");return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){if(!i(this._distance))throw new o("set end positions before getting startHeading");return this._startHeading}},endHeading:{get:function(){if(!i(this._distance))throw new o("set end positions before getting endHeading");return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){if(!i(e))throw new o("start cartographic position is required");if(!i(t))throw new o("end cartgraphic position is required");d(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,r){if(!i(this._distance))throw new o("start and end must be set before calling funciton interpolateUsingSurfaceDistance");var n=this._constants,a=n.distanceRatio+e/n.b,s=Math.cos(2*a),l=Math.cos(4*a),u=Math.cos(6*a),h=Math.sin(2*a),d=Math.sin(4*a),m=Math.sin(6*a),f=Math.sin(8*a),p=a*a,v=a*p,g=n.u8Over256,_=n.u2Over4,y=n.u6Over64,w=n.u4Over16,C=2*v*g*s/3+a*(1-_+7*w/4-15*y/4+579*g/64-(w-15*y/4+187*g/16)*s-(5*y/4-115*g/16)*l-29*g*u/16)+(_/2-w+71*y/32-85*g/16)*h+(5*w/16-5*y/4+383*g/96)*d-p*((y-11*g/2)*h+5*g*d/2)+(29*y/96-29*g/16)*m+539*g*f/1536,b=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(b));C-=n.sigma;var x=Math.cos(2*n.sigma+C),E=Math.sin(C),T=Math.cos(C),P=n.cosineU*T,A=n.sineU*E,M=Math.atan2(E*n.sineHeading,P-A*n.cosineHeading),D=M-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,E,T,x);return i(r)?(r.longitude=this._start.longitude+D,r.latitude=S,r.height=0,r):new t(this._start.longitude+D,S,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,P),s=e.angleBetween(o,a),l=Math.ceil(s/i),u=new Array(3*l),c=n.cartesianToCartographic(o,S),h=n.cartesianToCartographic(a,x);A.setEndPoints(c,h);var d=A.surfaceDistance/l,m=0;c.height=0;var f=n.cartographicToCartesian(c,E);u[m++]=f.x,u[m++]=f.y,u[m++]=f.z;for(var p=1;l>p;p++){var v=A.interpolateUsingSurfaceDistance(p*d,x);f=n.cartographicToCartesian(v,E),u[m++]=f.x,u[m++]=f.y,u[m++]=f.z}return u}function m(t,r,i){var n=M;return i.geodeticSurfaceNormal(t,n),e.multiplyByScalar(n,r,n),e.add(t,n,t),t}var f={},p=new c,v=new e,g=new e,_=new h(e.ZERO,0),y=new e,w=new h(e.ZERO,0),C=new e,b=new e,S=new t,x=new t,E=new e,T=new e,P=new e,A=new a,M=new e,D=new e;return f.wrapLongitude=function(t,n){var o=[],a=[];if(i(t)&&t.length>0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,p),u=c.multiplyByPoint(l,e.ZERO,v),d=c.multiplyByPointAsVector(l,e.UNIT_Y,g),m=h.fromPointNormal(u,d,_),f=c.multiplyByPointAsVector(l,e.UNIT_X,y),S=h.fromPointNormal(u,f,w),x=1;o.push(e.clone(t[0]));for(var E=o[0],T=t.length,P=1;T>P;++P){var A=t[P];if(h.getPointDistance(S,E)<0||h.getPointDistance(S,A)<0){var M=s.lineSegmentPlane(E,A,m,C);if(i(M)){var D=e.multiplyByScalar(d,5e-9,b);h.getPointDistance(m,E)<0&&e.negate(D,D),o.push(e.add(M,D,new e)),a.push(x+1),e.negate(D,D),o.push(e.add(M,D,new e)),x=1}}o.push(e.clone(t[P])),x++,E=A}a.push(x)}return{positions:o,lengths:a}},f.removeDuplicates=function(t){if(!i(t))throw new n("positions is required.");var r=t.length;if(2>r)return t.slice(0);var o=[];o.push(t[0]);for(var a=1;r>a;++a){var s=t[a-1],l=t[a];e.equals(s,l)||o.push(l)}return o},f.scaleToSurface=function(e,t,a){if(!i(e))throw new n("positions is required");t=r(t,u.RADIANS_PER_DEGREE),a=r(a,o.WGS84);for(var s=e.length,l=[],c=0;s-1>c;c++){var h=e[c],m=e[c+1];l=l.concat(d(h,m,t,a))}var f=e[s-1],p=a.cartesianToCartographic(f,S);p.height=0;var v=a.cartographicToCartesian(p,E);return l.push(v.x,v.y,v.z),l},f.scaleToGeodeticHeight=function(t,a,s,u){if(!i(t))throw new n("positions must be defined.");if(!i(a))throw new n("height must be defined");s=r(s,o.WGS84);var c,h,d=t.length,f=D;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)f=s.scaleToGeodeticSurface(e.fromArray(t,c,f),f),h[c]=f.x,h[c+1]=f.y,h[c+2]=f.z;return h}var p;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)p=a[c/3],f=e.fromArray(t,c,f),f=m(f,p,s),h[c]=f.x,h[c+1]=f.y,h[c+2]=f.z}else for(p=a,c=0;d>c;c+=3)f=e.fromArray(t,c,f),f=m(f,p,s),h[c]=f.x,h[c+1]=f.y,h[c+2]=f.z;return h},f}),r("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";var n=function(r,i){i=e.clone(t(i,e.ZERO)),e.equals(i,e.ZERO)||e.normalize(i,i),this.origin=e.clone(t(r,e.ZERO)),this.direction=i};return n.getPoint=function(t,n,o){if(!r(t))throw new i("ray is requred");if("number"!=typeof n)throw new i("t is a required number");return r(o)||(o=new e),o=e.multiplyByScalar(t.direction,n,o),e.add(t.origin,o,o)},n}),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",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],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(e,r){if(!i(r.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!i(r.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var n=r.columnNames.indexOf("modifiedJulianDateUtc"),o=r.columnNames.indexOf("xPoleWanderRadians"),l=r.columnNames.indexOf("yPoleWanderRadians"),u=r.columnNames.indexOf("ut1MinusUtcSeconds"),m=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>u||0>m||0>f||0>p)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var v=e._samples=r.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=m,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=p,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,y=e._addNewLeapSeconds,w=0,C=v.length;C>w;w+=e._columnCount){var b=v[w+n],S=v[w+p],x=b+c.MODIFIED_JULIAN_DATE_DIFFERENCE,E=new a(x,S,h.TAI);if(g.push(E),y){if(S!==_&&i(_)){var T=a.leapSeconds,P=t(T,E,d);if(0>P){var A=new s(E,S);T.splice(~P,0,A)}}_=S}}}function f(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 p(e,t,r){return t+e*(r-t)}function v(e,t,r,i,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||i.equals(u))return f(e,r,n,l,s),s;if(i.equals(c))return f(e,r,o,l,s),s;var h=a.getSecondsDifference(i,u)/a.getSecondsDifference(c,u),d=n*l,m=o*l,v=r[d+e._ut1MinusUtcSecondsColumn],g=r[m+e._ut1MinusUtcSecondsColumn],_=g-v;if(_>.5||-.5>_){var y=r[d+e._taiMinusUtcSecondsColumn],w=r[m+e._taiMinusUtcSecondsColumn];y!==w&&(c.equals(i)?v=g:g-=w-y)}return s.xPoleWander=p(h,r[d+e._xPoleWanderRadiansColumn],r[m+e._xPoleWanderRadiansColumn]),s.yPoleWander=p(h,r[d+e._yPoleWanderRadiansColumn],r[m+e._yPoleWanderRadiansColumn]),s.xPoleOffset=p(h,r[d+e._xCelestialPoleOffsetRadiansColumn],r[m+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=p(h,r[d+e._yCelestialPoleOffsetRadiansColumn],r[m+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=p(h,v,g),s}var g=function(t){if(t=r(t,r.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=r(t.addNewLeapSeconds,!0),i(t.data))m(this,t.data);else if(i(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){m(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return g.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return i(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),g.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},g.prototype.compute=function(e,r){if(!i(this._samples)){if(i(this._dataError))throw new u(this._dataError);return void 0}if(i(r)||(r=new n(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var o=this._dates,s=this._lastIndex,l=0,c=0;if(i(s)){var h=o[s],d=o[s+1],m=a.lessThanOrEquals(h,e),f=!i(d),p=f||a.greaterThanOrEquals(d,e);if(m&&p)return l=s,!f&&d.equals(e)&&++l,c=l+1,v(this,o,this._samples,e,l,c,r),r}var g=t(o,e,a.compare,this._dateColumn);return g>=0?(gl&&(l=0)),this._lastIndex=l,v(this,o,this._samples,e,l,c,r),r},g}),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/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=h;return i.dayNumber=t,i.secondsOfDay=r,o.getDaysDifference(i,e._sampleZeroDateTT)}function u(r,n){if(r._chunkDownloadsInProgress[n])return r._chunkDownloadsInProgress[n];var o=e.defer();r._chunkDownloadsInProgress[n]=o;var s,l=r._xysFileUrlTemplate;return s=i(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){r._chunkDownloadsInProgress[n]=!1;for(var t=r._samples,i=e.samples,a=3*n*r._samplesPerXysFile,s=0,l=i.length;l>s;++s)t[a+s]=i[s];o.resolve()}),o.promise}var c=function(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,i=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;t>=l;++l){i[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;t>=u;++u)u!==l&&(i[l]*=l-u);i[l]=1/i[l]}this._work=new Array(t+1),this._coef=new Array(t+1)},h=new o(0,0,s.TAI);return c.prototype.preload=function(t,r,i,n){var o=l(this,t,r),a=l(this,i,n),s=0|o/this._stepSizeDays-this._interpolationOrder/2;0>s&&(s=0);var c=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);for(var h=0|s/this._samplesPerXysFile,d=0|c/this._samplesPerXysFile,m=[],f=h;d>=f;++f)m.push(u(this,f));return e.all(m)},c.prototype.computeXysRadians=function(e,t,r){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(i(m[3*c])||(u(this,0|c/this._samplesPerXysFile),d=!0),i(m[3*h])||(u(this,0|h/this._samplesPerXysFile),d=!0),d)return void 0;i(r)?(r.x=0,r.y=0,r.s=0):r=new n(0,0,0);var f,p,v=o-c*this._stepSizeDays,g=this._work,_=this._denominators,y=this._coef,w=this._xTable;for(f=0;s>=f;++f)g[f]=v-w[f];for(f=0;s>=f;++f){for(y[f]=1,p=0;s>=p;++p)p!==f&&(y[f]*=g[p]);y[f]*=_[f];var C=3*(c+f);r.x+=y[f]*m[C++],r.y+=y[f]*m[C++],r.s+=y[f]*m[C]}return r},c}),r("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v){"use strict";var g={},_=new r,y=new r,w=new r;g.eastNorthUpToFixedFrame=function(e,t,i){if(!o(e))throw new a("origin is required.");if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var s=m.sign(e.z);return o(i)?(i[0]=0,i[1]=1,i[2]=0,i[3]=0,i[4]=-s,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new p(0,-s,0,e.x,1,0,0,e.y,0,0,s,e.z,0,0,0,1)}var l=_,c=y,h=w;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,l),c.x=-e.y,c.y=e.x,c.z=0,r.normalize(c,c),r.cross(l,c,h),o(i)?(i[0]=c.x,i[1]=c.y,i[2]=c.z,i[3]=0,i[4]=h.x,i[5]=h.y,i[6]=h.z,i[7]=0,i[8]=l.x,i[9]=l.y,i[10]=l.z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new p(c.x,h.x,l.x,e.x,c.y,h.y,l.y,e.y,c.z,h.z,l.z,e.z,0,0,0,1)};var C=new r,b=new r,S=new r;g.northEastDownToFixedFrame=function(e,t,i){if(!o(e))throw new a("origin is required.");if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var s=m.sign(e.z);return o(i)?(i[0]=-s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=-s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new p(-s,0,0,e.x,0,1,0,e.y,0,0,-s,e.z,0,0,0,1)}var l=C,c=b,h=S;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,l),c.x=-e.y,c.y=e.x,c.z=0,r.normalize(c,c),r.cross(l,c,h),o(i)?(i[0]=h.x,i[1]=h.y,i[2]=h.z,i[3]=0,i[4]=c.x,i[5]=c.y,i[6]=c.z,i[7]=0,i[8]=-l.x,i[9]=-l.y,i[10]=-l.z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new p(h.x,c.x,-l.x,e.x,h.y,c.y,-l.y,e.y,h.z,c.z,-l.z,e.z,0,0,0,1)};var x=24110.54841,E=8640184.812866,T=.093104,P=-62e-7,A=1.1772758384668e-19,M=72921158553e-15,D=m.TWO_PI/86400,I=new d;g.computeTemeToPseudoFixedMatrix=function(e,t){if(!o(e))throw new a("date is required.");I=d.addSeconds(e,-d.getTaiMinusUtc(e),I);var r,i=I.dayNumber,n=I.secondsOfDay,s=i-2451545;r=n>=43200?(s+.5)/v.DAYS_PER_JULIAN_CENTURY:(s-.5)/v.DAYS_PER_JULIAN_CENTURY;var l=x+r*(E+r*(T+r*P)),u=l*D%m.TWO_PI,c=M+A*(i-2451545.5),h=(n+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,p=u+c*h,g=Math.cos(p),_=Math.sin(p);return o(t)?(t[0]=g,t[1]=-_,t[2]=0,t[3]=_,t[4]=g,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new f(g,_,0,-_,g,0,0,0,1)},g.iau2006XysData=new c,g.earthOrientationParameters=s.NONE;var O=32.184,R=2451545;g.preloadIcrfFixed=function(t){var r=t.start.dayNumber,i=t.start.secondsOfDay+O,n=t.stop.dayNumber,o=t.stop.secondsOfDay+O,a=g.iau2006XysData.preload(r,i,n,o),s=g.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},g.computeIcrfToFixedMatrix=function(e,t){if(!o(e))throw new a("date is required.");var r=g.computeFixedToIcrfMatrix(e,t);return o(r)?f.transpose(r,t):void 0};var L=new h(0,0,0),N=new l(0,0,0,0,0,0),B=new f,F=new f;g.computeFixedToIcrfMatrix=function(e,t){if(!o(e))throw new a("date is required.");var r=g.earthOrientationParameters.compute(e,N);if(!o(r))return void 0;var i=e.dayNumber,n=e.secondsOfDay+O,s=g.iau2006XysData.computeXysRadians(i,n,L);if(!o(s))return void 0;var l=s.x+r.xPoleOffset,u=s.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-l*l-u*u)),h=B;h[0]=1-c*l*l,h[3]=-c*l*u,h[6]=l,h[1]=-c*l*u,h[4]=1-c*u*u,h[7]=u,h[2]=-l,h[5]=-u,h[8]=1-c*(l*l+u*u);var p=f.fromRotationZ(-s.s,F),_=f.multiply(h,p,B),y=e.dayNumber,w=e.secondsOfDay-d.getTaiMinusUtc(e)+r.ut1MinusUtc,C=y-2451545,b=w/v.SECONDS_PER_DAY,S=.779057273264+b+.00273781191135448*(C+b);S=S%1*m.TWO_PI;var x=f.fromRotationZ(S,F),E=f.multiply(_,x,B),T=Math.cos(r.xPoleWander),P=Math.cos(r.yPoleWander),A=Math.sin(r.xPoleWander),M=Math.sin(r.yPoleWander),D=i-R+n/v.SECONDS_PER_DAY;D/=36525;var I=-47e-6*D*m.RADIANS_PER_DEGREE/3600,z=Math.cos(I),V=Math.sin(I),q=F;return q[0]=T*z,q[1]=T*V,q[2]=A,q[3]=-P*V+M*A*z,q[4]=P*z+M*A*V,q[5]=-M*T,q[6]=-M*V-P*A*z,q[7]=M*z-P*A*V,q[8]=P*T,f.multiply(E,q,t)};var z=new i;return g.pointToWindowCoordinates=function(e,r,n,s){if(!o(e))throw new a("modelViewProjectionMatrix is required.");if(!o(r))throw new a("viewportTransformation is required.");if(!o(n))throw new a("point is required.");o(s)||(s=new t);var l=z;return p.multiplyByVector(e,i.fromElements(n.x,n.y,n.z,1,l),l),i.multiplyByScalar(l,1/l.w,l),p.multiplyByVector(r,l,l),t.fromCartesian4(l,s)},g}),r("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(e,t){if(!n(e))throw new a("origin is required.");if(t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e),!n(e))throw new a("origin must not be at the center of the ellipsoid.");var o=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(u.getColumn(o,0)),this._yAxis=r.fromCartesian4(u.getColumn(o,1));var l=r.fromCartesian4(u.getColumn(o,2));this._plane=c.fromPointNormal(e,l)};o(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var f=new e;m.fromPoints=function(t,r){if(!n(t))throw new a("cartesians is required.");var i=e.fromPoints(t,f);return new m(i.center,r)};var p=new h,v=new r;m.prototype.projectPointOntoPlane=function(e,i){if(!n(e))throw new a("cartesian is required.");var o=p;o.origin=e,r.normalize(e,o.direction);var s=l.rayPlane(o,this._plane,v);if(n(s)||(r.negate(o.direction,o.direction),s=l.rayPlane(o,this._plane,v)),n(s)){var u=r.subtract(s,this._origin,s),c=r.dot(this._xAxis,u),h=r.dot(this._yAxis,u);return n(i)?(i.x=c,i.y=h,i):new t(c,h)}return void 0},m.prototype.projectPointsOntoPlane=function(e,t){if(!n(e))throw new a("cartesians is required.");n(t)||(t=[]);for(var r=0,i=e.length,o=0;i>o;o++){var s=this.projectPointOntoPlane(e[o],t[r]);n(s)&&(t[r]=s,r++)}return t.length=r,t};var g=new r;return m.prototype.projectPointsOntoEllipsoid=function(e,t){if(!n(e))throw new a("cartesians is required.");var i=e.length;n(t)?t.length=i:t=new Array(i);for(var o=this._ellipsoid,s=this._origin,l=this._xAxis,u=this._yAxis,c=g,h=0;i>h;++h){var d=e[h];r.multiplyByScalar(l,d.x,c),n(t[h])||(t[h]=new r);var m=r.add(s,c,t[h]);r.multiplyByScalar(u,d.y,c),r.add(m,c,m),o.scaleToGeocentricSurface(m,m)}return t},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 f(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 p(e,r,i,n,o,a,u,c){var d=q,m=k;B=h.eastNorthUpToFixedFrame(e,o,B),d=l.multiplyByPointAsVector(B,N,d),d=t.normalize(d,d);var p=f(d,r,e,o);z=s.fromRotationZ(p,z),U.z=a,B=l.multiplyTransformation(B,l.fromRotationTranslation(z,U,F),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,f){var v,g=t.angleBetween(t.subtract(r,e,I),t.subtract(i,e,O)),_=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,I),g/(_+1),G),j):s.fromQuaternion(c.fromAxisAngle(e,g/(_+1),G),j);var y,w;if(r=t.clone(r,H),_>0)for(var C=f?2:1,b=0;_>b;b++)r=s.multiplyByVector(v,r,r),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),w=u.scaleToGeodeticSurface(r,O),h=p(w,y,d,h,u,m,1,C);else y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),w=u.scaleToGeodeticSurface(r,O),h=p(w,y,d,h,u,m,1,1),i=t.clone(i,H),y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),w=u.scaleToGeodeticSurface(i,O),h=p(w,y,d,h,u,m,1,1);return h}function w(e,t){return a.equalsEpsilon(e.latitude,t.latitude,a.EPSILON6)&&a.equalsEpsilon(e.longitude,t.longitude,a.EPSILON6)}var C=[new t,new t],b=new t,S=new t,x=new t,E=new t,T=new t,P=new t,A=new t,M=new t,D=new t,I=new t,O=new t,R={},L=new i,N=new t(-1,0,0),B=new l,F=new l,z=new s,V=s.IDENTITY.clone(),q=new t,k=new r,U=new t,W=new t,G=new c,H=new t,j=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);w(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,f=o._cornerType,w=s?g(r,i):_(r,i),O=s?_(r,i):void 0,L=i.height/2,N=i.width/2,B=e.length,F=[],z=s?[]:void 0,V=b,q=S,k=x,U=E,W=T,G=P,H=A,j=M,Y=D,X=e[0],Z=e[1];U=l.geodeticSurfaceNormal(X,U),V=t.subtract(Z,X,V),V=t.normalize(V,V),j=t.cross(U,V,j),j=t.normalize(j,j);var J=c[0],Q=c[1];s&&(z=p(X,j,O,z,l,J+L,1,1)),Y=t.clone(X,Y),X=Z,q=t.negate(V,q);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),k=t.add(V,q,k),k=t.normalize(k,k),U=l.geodeticSurfaceNormal(X,U);var rt=!t.equalsEpsilon(t.negate(k,I),U,a.EPSILON2);if(rt){k=t.cross(k,U,k),k=t.cross(U,k,k),k=t.normalize(k,k);var it=1/Math.max(.25,t.magnitude(t.cross(k,q,I))),nt=R.angleIsGreaterThanPi(V,q,X,l);nt?(W=t.add(X,t.multiplyByScalar(k,it*N,k),W),G=t.add(W,t.multiplyByScalar(j,N,G),G),C[0]=t.clone(Y,C[0]),C[1]=t.clone(G,C[1]),K=m(C,J+L,Q+L,h),$=u.scaleToSurface(C),F=v($,j,w,F,l,K,1),j=t.cross(U,V,j),j=t.normalize(j,j),H=t.add(W,t.multiplyByScalar(j,N,H),H),f===n.ROUNDED||f===n.BEVELED?y(W,G,H,f,nt,l,F,w,Q+L,s):(k=t.negate(k,k),F=p(X,k,w,F,l,Q+L,it,tt)),Y=t.clone(H,Y)):(W=t.add(X,t.multiplyByScalar(k,it*N,k),W),G=t.add(W,t.multiplyByScalar(j,-N,G),G),C[0]=t.clone(Y,C[0]),C[1]=t.clone(G,C[1]),K=m(C,J+L,Q+L,h),$=u.scaleToSurface(C,h,l),F=v($,j,w,F,l,K,1),j=t.cross(U,V,j),j=t.normalize(j,j),H=t.add(W,t.multiplyByScalar(j,-N,H),H),f===n.ROUNDED||f===n.BEVELED?y(W,G,H,f,nt,l,F,w,Q+L,s):F=p(X,k,w,F,l,Q+L,it,tt),Y=t.clone(H,Y)),q=t.negate(V,q)}else F=p(Y,j,w,F,l,J+L,1,1),Y=X;J=Q,Q=c[et+1],X=Z}C[0]=t.clone(Y,C[0]),C[1]=t.clone(X,C[1]),K=m(C,J+L,Q+L,h),$=u.scaleToSurface(C,h,l),F=v($,j,w,F,l,K,1),s&&(z=p(X,j,O,z,l,Q+L,1,1)),B=F.length;var ot=s?B+z.length:B,at=new Float64Array(ot);return at.set(F),s&&at.set(z,B),at},R}),r("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,o,a,l,u){var c=e.angleBetween(e.subtract(o,r,f),e.subtract(a,r,p)),h=l===t.BEVELED?1:Math.ceil(c/i.toRadians(5))+1,d=3*h,m=new Array(d);m[d-3]=a.x,m[d-2]=a.y,m[d-1]=a.z;var v;v=u?n.fromQuaternion(s.fromAxisAngle(e.negate(r,f),c/h,M),D):n.fromQuaternion(s.fromAxisAngle(r,c/h,M),D);var g=0;o=e.clone(o,f);for(var _=0;h>_;_++)o=n.multiplyByVector(v,o,o),m[g++]=o.x,m[g++]=o.y,m[g++]=o.z;return m}function u(r){var i=y,n=w,o=C,a=r[1];n=e.fromArray(r[1],a.length-3,n),o=e.fromArray(r[0],0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var s=l(i,n,o,t.ROUNDED,!1),u=r.length-1,c=r[u-1];a=r[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var h=l(i,n,o,t.ROUNDED,!1);return[s,h]}function c(t,r,i,n){var o=f;return n?o=e.add(t,r,o):(r=e.negate(r,r),o=e.add(t,r,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function h(t,r,i,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(r,i,f),l=e.negate(s,p),u=0,c=t.length-1,h=0;hH;H++){M=m.geodeticSurfaceNormal(U,M),W=s[H+1],D=e.normalize(e.subtract(W,U,D),D),R=e.normalize(e.add(D,I,R),R);var X=!e.equalsEpsilon(e.negate(R,f),M,i.EPSILON2);if(X){R=e.cross(R,M,R),R=e.cross(M,R,R);var Z=p/Math.max(.25,e.magnitude(e.cross(R,I,f))),J=a.angleIsGreaterThanPi(D,I,U,m);R=e.multiplyByScalar(R,Z,R),J?(B=e.add(U,R,B),z=e.add(B,e.multiplyByScalar(O,p,z),z),F=e.add(B,e.multiplyByScalar(O,2*p,F),F),_[0]=e.clone(N,_[0]),_[1]=e.clone(z,_[1]),G=o.scaleToSurface(_,n,m),V=h(G,O,p,V),g&&(q.push(O.x,O.y,O.z),k.push(M.x,M.y,M.z)),L=e.clone(F,L),O=e.normalize(e.cross(M,D,O),O),F=e.add(B,e.multiplyByScalar(O,2*p,F),F),N=e.add(B,e.multiplyByScalar(O,p,N),N),v===t.ROUNDED||v===t.BEVELED?j.push({leftPositions:l(B,L,F,v,J)}):j.push({leftPositions:c(U,e.negate(R,R),F,J)})):(F=e.add(U,R,F),z=e.add(F,e.negate(e.multiplyByScalar(O,p,z),z),z),B=e.add(F,e.negate(e.multiplyByScalar(O,2*p,B),B),B),_[0]=e.clone(N,_[0]),_[1]=e.clone(z,_[1]),G=o.scaleToSurface(_,n,m),V=h(G,O,p,V),g&&(q.push(O.x,O.y,O.z),k.push(M.x,M.y,M.z)),L=e.clone(B,L),O=e.normalize(e.cross(M,D,O),O),B=e.add(F,e.negate(e.multiplyByScalar(O,2*p,B),B),B),N=e.add(F,e.negate(e.multiplyByScalar(O,p,N),N),N),v===t.ROUNDED||v===t.BEVELED?j.push({rightPositions:l(F,L,B,v,J)}):j.push({rightPositions:c(U,R,B,J)})),I=e.negate(D,I)}U=W}M=m.geodeticSurfaceNormal(U,M),_[0]=e.clone(N,_[0]),_[1]=e.clone(U,_[1]),G=o.scaleToSurface(_,n,m),V=h(G,O,p,V),g&&(q.push(O.x,O.y,O.z),k.push(M.x,M.y,M.z));var Q;return v===t.ROUNDED&&(Q=u(V)),{positions:V,corners:j,lefts:q,normals:k,endPositions:Q}},m}),r("Core/CorridorGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v){"use strict"; function g(e,r,i,o,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=t.normalize(t.cross(i,r,A),A);s.normal&&n.addAttribute(l,r,o,a),s.binormal&&n.addAttribute(c,i,o,a),s.tangent&&n.addAttribute(u,h,o,a)}function _(e,i,o){var s,l,u,f=e.positions,p=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,w=new h,C=0,T=0,D=0;for(l=0;ll;l++)V=t.fromArray($,3*(J-1-l),V),z=t.fromArray($,3*(J+l),z),n.addAttribute(k,z,j),n.addAttribute(k,V,void 0,Y),g(H,X,Z,j,Y,i),N=j/3,F=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++]=F,j+=3,Y-=3}var et=0,tt=0,rt=f[et++],it=f[et++];k.set(rt,j),k.set(it,Y-it.length+1),Z=t.fromArray(_,tt,Z);var nt,ot;for(u=it.length-3,l=0;u>l;l+=3)nt=o.geodeticSurfaceNormal(t.fromArray(rt,l,A),A),ot=o.geodeticSurfaceNormal(t.fromArray(it,u-l,M),M),X=t.normalize(t.add(nt,ot,X),X),g(H,X,Z,j,Y,i),N=j/3,F=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++]=F,j+=3,Y-=3;for(nt=o.geodeticSurfaceNormal(t.fromArray(rt,u,A),A),ot=o.geodeticSurfaceNormal(t.fromArray(it,u,M),M),X=t.normalize(t.add(nt,ot,X),X),tt+=3,l=0;ll;l++)V=t.fromArray(ft,3*(O-l-1),V),z=t.fromArray(ft,3*l,z),n.addAttribute(k,V,void 0,Y),n.addAttribute(k,z,j),g(H,X,Z,j,Y,i),F=j/3,N=F-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++]=F,j+=3,Y-=3}if(w.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:k}),i.st){var pt,vt,gt=new Float32Array(2*(q/3)),_t=0;if(R){C/=3,T/=3;var yt=Math.PI/(O+1);vt=1/(C-O+1),pt=1/(T-O+1);var wt,Ct=O/2;for(l=Ct+1;O+1>l;l++)wt=m.PI_OVER_TWO+yt*l,gt[_t++]=pt*(1+Math.cos(wt)),gt[_t++]=.5*(1+Math.sin(wt));for(l=1;T-O+1>l;l++)gt[_t++]=l*pt,gt[_t++]=0;for(l=O;l>Ct;l--)wt=m.PI_OVER_TWO-l*yt,gt[_t++]=1-pt*(1+Math.cos(wt)),gt[_t++]=.5*(1+Math.sin(wt));for(l=Ct;l>0;l--)wt=m.PI_OVER_TWO-yt*l,gt[_t++]=1-vt*(1+Math.cos(wt)),gt[_t++]=.5*(1+Math.sin(wt));for(l=C-O;l>0;l--)gt[_t++]=l*vt,gt[_t++]=1;for(l=1;Ct+1>l;l++)wt=m.PI_OVER_TWO+yt*l,gt[_t++]=vt*(1+Math.cos(wt)),gt[_t++]=.5*(1+Math.sin(wt))}else{for(C/=3,T/=3,vt=1/(C-1),pt=1/(T-1),l=0;T>l;l++)gt[_t++]=l*pt,gt[_t++]=0;for(l=C;l>0;l--)gt[_t++]=(l-1)*vt,gt[_t++]=1}w.st=new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:gt})}return i.normal&&(w.normal=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:H.normals})),i.tangent&&(w.tangent=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:H.tangents})),i.binormal&&(w.binormal=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:H.binormals})),{attributes:w,indices:Q}}function y(e,r){if(!(r.normal||r.binormal||r.tangent||r.st))return e;var i,o,a=e.position.values;(r.normal||r.binormal)&&(i=e.normal.values,o=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(r.normal||r.binormal||r.tangent){var d=r.normal?new Float32Array(6*u):void 0,m=r.binormal?new Float32Array(6*u):void 0,f=r.tangent?new Float32Array(6*u):void 0,p=b,v=S,g=x,_=E,y=T,w=P,C=h;for(s=0;u>s;s+=3){var A=C+h;p=t.fromArray(a,s,p),v=t.fromArray(a,s+u,v),g=t.fromArray(a,(s+3)%u,g),v=t.subtract(v,p,v),g=t.subtract(g,p,g),_=t.normalize(t.cross(v,g,_),_),r.normal&&(n.addAttribute(d,_,A),n.addAttribute(d,_,A+3),n.addAttribute(d,_,C),n.addAttribute(d,_,C+3)),(r.tangent||r.binormal)&&(w=t.fromArray(i,s,w),r.binormal&&(n.addAttribute(m,w,A),n.addAttribute(m,w,A+3),n.addAttribute(m,w,C),n.addAttribute(m,w,C+3)),r.tangent&&(y=t.normalize(t.cross(w,_,y),y),n.addAttribute(f,y,A),n.addAttribute(f,y,A+3),n.addAttribute(f,y,C),n.addAttribute(f,y,C+3))),C+=6}if(r.normal){for(d.set(i),s=0;u>s;s+=3)d[s+u]=-i[s],d[s+u+1]=-i[s+1],d[s+u+2]=-i[s+2];e.normal.values=d}else e.normal=void 0;if(r.binormal?(m.set(o),m.set(o,u),e.binormal.values=m):e.binormal=void 0,r.tangent){var M=e.tangent.values;f.set(M),f.set(M,u),e.tangent.values=f}}if(r.st){var D=e.st.values,I=new Float32Array(6*c);I.set(D),I.set(D,c);for(var O=2*c,R=0;2>R;R++){for(I[O++]=D[0],I[O++]=D[1],s=2;c>s;s+=2){var L=D[s],N=D[s+1];I[O++]=L,I[O++]=N,I[O++]=L,I[O++]=N}I[O++]=D[0],I[O++]=D[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;ib;b+=3){var P=c[b],A=c[b+1],M=c[b+2];E[T++]=M+m,E[T++]=A+m,E[T++]=P+m}u=y(u,t);var D,I,O,R;for(b=0;x>b;b+=2)D=b+x,I=D+x,O=D+1,R=I+1,E[T++]=D,E[T++]=I,E[T++]=O,E[T++]=O,E[T++]=I,E[T++]=R;return{attributes:u,indices:E}}var b=new t,S=new t,x=new t,E=new t,T=new t,P=new t,A=new t,M=new t,D=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.width;if(!a(t))throw new s("options.positions is required.");if(!a(r))throw new s("options.width is required.");this._positions=t,this._width=r,this._ellipsoid=o(e.ellipsoid,l.WGS84),this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,i.ROUNDED),this._vertexFormat=o(e.vertexFormat,v.DEFAULT),this._granularity=o(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry"};return D.createGeometry=function(t){var r=t._positions,i=t._height,o=t._extrudedHeight,a=i!==o,l=f.removeDuplicates(r);if(l.length<2)throw new s("Count of unique positions must be greater than 1.");var c,h=t._ellipsoid,d=t._vertexFormat,m={ellipsoid:h,positions:l,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};if(a){var v=Math.max(i,o);o=Math.min(i,o),i=v,m.height=i,m.extrudedHeight=o,c=C(m,d)}else{var g=n.computePositions(m);c=_(g,d,h),c.attributes.position.values=f.scaleToGeodeticHeight(c.attributes.position.values,i,h,c.attributes.position.values)}var y=c.attributes,w=e.fromVertices(y.position.values,void 0,3);return d.position||(c.attributes.position.values=void 0),new u({attributes:y,indices:c.indices,primitiveType:p.TRIANGLES,boundingSphere:w})},D}),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,f,p){"use strict";function v(e,o){var s,l,u,m=[],f=e.positions,p=e.corners,v=e.endPositions,g=new h,C=0,b=0,S=0;for(l=0;ll;l++)O=t.fromArray(q,3*(F-1-l),O),I=t.fromArray(q,3*(F+l),I),n.addAttribute(L,I,N),n.addAttribute(L,O,void 0,B),A=N/3,D=A+1,P=(B-2)/3,M=P-1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=D,N+=3,B-=3}var k=0,U=f[k++],W=f[k++];for(L.set(U,N),L.set(W,B-W.length+1),u=W.length-3,m.push(N/3,(B-2)/3),l=0;u>l;l+=3)A=N/3,D=A+1,P=(B-2)/3,M=P-1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=D,N+=3,B-=3;for(l=0;ll;l++)O=t.fromArray(Z,3*(E-l-1),O),I=t.fromArray(Z,3*l,I),n.addAttribute(L,O,void 0,B),n.addAttribute(L,I,N),D=N/3,A=D-1,M=(B-2)/3,P=M+1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=D,N+=3,B-=3;m.push(N/3)}else m.push(N/3,(B-2)/3);return z[V++]=N/3,z[V++]=(B-2)/3,g.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:L}),{attributes:g,indices:z,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 p=new Float64Array(2*h);c=f.scaleToGeodeticHeight(c,a,t,c),m=f.scaleToGeodeticHeight(m,s,t,m),p.set(c),p.set(m,h),l.position.values=p,h/=3;var g,_=u.length,y=d.createTypedArray(p.length/3,2*(_+o.length));y.set(u);var w=_;for(g=0;_>g;g+=2){var C=u[g],b=u[g+1];y[w++]=C+h,y[w++]=b+h}var S,x;for(g=0;ga;a++){var v=a/n*e.TWO_PI,g=Math.cos(v),_=Math.sin(v),y=g*i,w=_*i,C=g*r,b=_*r;h[m+f]=y,h[m+f+1]=w,h[m+f+2]=l,h[m+p]=C,h[m+p+1]=b,h[m+p+2]=s,m+=3,o&&(h[d++]=y,h[d++]=w,h[d++]=l,h[d++]=C,h[d++]=b,h[d++]=s)}return h},t}),r("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f){"use strict";var p=new t,v=new r,g=new r,_=new r,y=new r,w=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.vertexFormat,f.DEFAULT),l=o(e.slices,128);if(!a(t)||0>=t)throw new s("options.length must be greater than 0.");if(!a(r)||0>r)throw new s("options.topRadius must be greater than 0.");if(!a(i)||0>i)throw new s("options.bottomRadius must be greater than 0.");if(0===i&&0===r)throw new s("bottomRadius and topRadius cannot both equal 0.");if(3>l)throw new s("options.slices must be greater that 3.");this._length=t,this._topRadius=r,this._bottomRadius=i,this._vertexFormat=n,this._slices=l,this._workerName="createCylinderGeometry"};return w.createGeometry=function(o){var a,s=o._length,f=o._topRadius,w=o._bottomRadius,C=o._vertexFormat,b=o._slices,S=b+b,x=b+S,E=S+S,T=n.computePositions(s,f,w,b,!0),P=C.st?new Float32Array(2*E):void 0,A=C.normal?new Float32Array(3*E):void 0,M=C.tangent?new Float32Array(3*E):void 0,D=C.binormal?new Float32Array(3*E):void 0,I=C.normal||C.tangent||C.binormal;if(I){var O=C.tangent||C.binormal,R=0,L=0,N=0,B=v;B.z=0;var F=_,z=g;for(a=0;b>a;a++){var V=a/b*d.TWO_PI,q=Math.cos(V),k=Math.sin(V);I&&(B.x=q,B.y=k,O&&(F=r.normalize(r.cross(r.UNIT_Z,B,F),F)),C.normal&&(A[R++]=q,A[R++]=k,A[R++]=0,A[R++]=q,A[R++]=k,A[R++]=0),C.tangent&&(M[L++]=F.x,M[L++]=F.y,M[L++]=F.z,M[L++]=F.x,M[L++]=F.y,M[L++]=F.z),C.binormal&&(z=r.normalize(r.cross(B,F,z),z),D[N++]=z.x,D[N++]=z.y,D[N++]=z.z,D[N++]=z.x,D[N++]=z.y,D[N++]=z.z))}for(a=0;b>a;a++)C.normal&&(A[R++]=0,A[R++]=0,A[R++]=-1),C.tangent&&(M[L++]=1,M[L++]=0,M[L++]=0),C.binormal&&(D[N++]=0,D[N++]=-1,D[N++]=0);for(a=0;b>a;a++)C.normal&&(A[R++]=0,A[R++]=0,A[R++]=1),C.tangent&&(M[L++]=1,M[L++]=0,M[L++]=0),C.binormal&&(D[N++]=0,D[N++]=1,D[N++]=0)}var U=12*b-12,W=h.createTypedArray(E,U),G=0,H=0;for(a=0;b-1>a;a++)W[G++]=H,W[G++]=H+2,W[G++]=H+3,W[G++]=H,W[G++]=H+3,W[G++]=H+1,H+=2;for(W[G++]=S-2,W[G++]=0,W[G++]=1,W[G++]=S-2,W[G++]=1,W[G++]=S-1,a=1;b-1>a;a++)W[G++]=S+a+1,W[G++]=S+a,W[G++]=S;for(a=1;b-1>a;a++)W[G++]=x,W[G++]=x+a,W[G++]=x+a+1;var j=0;if(C.st){var Y=Math.max(f,w);for(a=0;E>a;a++){var X=r.fromArray(T,3*a,y);P[j++]=(X.x+Y)/(2*Y),P[j++]=(X.y+Y)/(2*Y)}}var Z=new c;C.position&&(Z.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})),C.normal&&(Z.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:A})),C.tangent&&(Z.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:M})),C.binormal&&(Z.binormal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),C.st&&(Z.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:P})),p.x=.5*s,p.y=Math.max(w,f);var J=new e(r.ZERO,t.magnitude(p));return new l({attributes:Z,indices:W,primitiveType:m.TRIANGLES,boundingSphere:J})},w}),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,f=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.slices,128),l=Math.max(o(e.numberOfVerticalLines,16),0);if(!a(t)||0>=t)throw new s("options.length must be greater than 0.");if(!a(r)||0>r)throw new s("options.topRadius must be greater than 0.");if(!a(i)||0>i)throw new s("options.bottomRadius must be greater than 0.");if(0===i&&0===r)throw new s("bottomRadius and topRadius cannot both equal 0.");if(3>n)throw new s("options.slices must be greater that 3.");this._length=t,this._topRadius=r,this._bottomRadius=i,this._slices=n,this._numberOfVerticalLines=l,this._workerName="createCylinderOutlineGeometry"};return f.createGeometry=function(o){var a,s=o._length,f=o._topRadius,p=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,f,p,v,!1),w=2*v;if(g>0){var C=Math.min(g,v);a=Math.round(v/C),w+=C}for(var b=h.createTypedArray(_,2*w),S=0,x=0;v-1>x;x++)b[S++]=x,b[S++]=x+1,b[S++]=x+v,b[S++]=x+1+v;if(b[S++]=v-1,b[S++]=0,b[S++]=v+v-1,b[S++]=v,g>0)for(x=0;v>x;x+=a)b[S++]=x,b[S++]=x+v;var E=new c;E.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*s,m.y=Math.max(p,f);var T=new e(r.ZERO,t.magnitude(m));return new l({attributes:E,indices:b,primitiveType:d.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",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var f=new r,p=new r,v=new r,g=new r,_=new r,y=new r(1,1,1),w=Math.cos,C=Math.sin,b=function(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,y),i=n(e.stackPartitions,64),a=n(e.slicePartitions,64),s=n(e.vertexFormat,m.DEFAULT);if(3>a)throw new o("options.slicePartitions cannot be less than three.");if(3>i)throw new o("options.stackPartitions cannot be less than three.");this._radii=r.clone(t),this._stackPartitions=i,this._slicePartitions=a,this._vertexFormat=s,this._workerName="createEllipsoidGeometry"};return b.createGeometry=function(n){var o,m,y=n._radii,b=a.fromCartesian3(y),S=n._vertexFormat,x=n._slicePartitions+1,E=n._stackPartitions+1,T=E*x,P=new Float64Array(3*T),A=6*(x-1)*(E-1),M=c.createTypedArray(T,A),D=S.normal?new Float32Array(3*T):void 0,I=S.tangent?new Float32Array(3*T):void 0,O=S.binormal?new Float32Array(3*T):void 0,R=S.st?new Float32Array(2*T):void 0,L=new Array(x),N=new Array(x),B=0;for(o=0;x>o;o++){var F=h.TWO_PI*o/(x-1);L[o]=w(F),N[o]=C(F),P[B++]=0,P[B++]=0,P[B++]=y.z}for(o=1;E-1>o;o++){var z=Math.PI*o/(E-1),V=C(z),q=y.x*V,k=y.y*V,U=y.z*w(z);for(m=0;x>m;m++)P[B++]=L[m]*q,P[B++]=N[m]*k,P[B++]=U}for(o=0;x>o;o++)P[B++]=0,P[B++]=0,P[B++]=-y.z;var W=new u;S.position&&(W.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:P}));var G=0,H=0,j=0,Y=0;if(S.st||S.normal||S.tangent||S.binormal){for(o=0;T>o;o++){var X=r.fromArray(P,3*o,f),Z=b.geodeticSurfaceNormal(X,p);if(S.st){var J=t.negate(Z,_);t.magnitude(J)P.length&&(B=3*(o-x*Math.floor(.5*E))),r.fromArray(P,B,J),b.geodeticSurfaceNormal(J,J),t.negate(J,J)),R[G++]=Math.atan2(J.y,J.x)/h.TWO_PI+.5,R[G++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(D[H++]=Z.x,D[H++]=Z.y,D[H++]=Z.z),S.tangent||S.binormal){var Q=v;if(x>o||o>T-x-1?(r.cross(r.UNIT_X,Z,Q),r.normalize(Q,Q)):(r.cross(r.UNIT_Z,Z,Q),r.normalize(Q,Q)),S.tangent&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),S.binormal){var K=r.cross(Z,Q,g);r.normalize(K,K),O[Y++]=K.x,O[Y++]=K.y,O[Y++]=K.z}}}S.st&&(W.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:R})),S.normal&&(W.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),S.tangent&&(W.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),S.binormal&&(W.binormal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O}))}for(B=0,o=0;E>o;o++){var $=o*x,et=(o+1)*x;for(m=0;x-1>m;m++)M[B++]=et+m,M[B++]=et+m+1,M[B++]=$+m+1,M[B++]=et+m,M[B++]=$+m+1,M[B++]=$+m}return new s({attributes:W,indices:M,primitiveType:d.TRIANGLES,boundingSphere:e.fromEllipsoid(b)})},b}),r("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=new t(1,1,1),m=Math.cos,f=Math.sin,p=function(e){e=i(e,i.EMPTY_OBJECT);var r=i(e.radii,d),o=i(e.stackPartitions,10),a=i(e.slicePartitions,8),s=i(e.subdivisions,128);if(1>o)throw new n("options.stackPartitions cannot be less than 1");if(0>a)throw new n("options.slicePartitions cannot be less than 0");if(0>s)throw new n("options.subdivisions must be greater than or equal to zero.");this._radii=t.clone(r),this._stackPartitions=o,this._slicePartitions=a,this._subdivisions=s,this._workerName="createEllipsoidOutlineGeometry"};return p.createGeometry=function(t){var i,n,d,p,v,g,_=t._radii,y=o.fromCartesian3(_),w=t._stackPartitions,C=t._slicePartitions,b=t._subdivisions,S=b*(w+C-1),x=S-C+2,E=new Float64Array(3*x),T=u.createTypedArray(x,2*S),P=0,A=new Array(b),M=new Array(b);for(i=0;b>i;i++)d=c.TWO_PI*i/b,A[i]=m(d),M[i]=f(d);for(i=1;w>i;i++)for(p=Math.PI*i/w,v=m(p),g=f(p),n=0;b>n;n++)E[P++]=_.x*A[n]*g,E[P++]=_.y*M[n]*g,E[P++]=_.z*v;for(A.length=C,M.length=C,i=0;C>i;i++)d=c.TWO_PI*i/C,A[i]=m(d),M[i]=f(d);for(E[P++]=0,E[P++]=0,E[P++]=_.z,i=1;b>i;i++)for(p=Math.PI*i/b,v=m(p),g=f(p),n=0;C>n;n++)E[P++]=_.x*A[n]*g,E[P++]=_.y*M[n]*g,E[P++]=_.z*v;for(E[P++]=0,E[P++]=0,E[P++]=-_.z,P=0,i=0;w-1>i;++i){var D=i*b;for(n=0;b-1>n;++n)T[P++]=D+n,T[P++]=D+n+1;T[P++]=D+b-1,T[P++]=D}var I=b*(w-1);for(n=1;C+1>n;++n)T[P++]=I,T[P++]=I+n;for(i=0;b-2>i;++i){var O=i*C+1+I,R=(i+1)*C+1+I;for(n=0;C-1>n;++n)T[P++]=R+n,T[P++]=O+n;T[P++]=R+C-1,T[P++]=O+C-1}var L=E.length/3-1;for(n=L-1;n>L-C-1;--n)T[P++]=L,T[P++]=n;var N=new l({position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})});return new a({attributes:N,indices:T,primitiveType:h.LINES,boundingSphere:e.fromEllipsoid(y)})},p}),r("Core/EllipsoidTerrainProvider",["./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],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 o({ellipsoid:e(r.ellipsoid,i.WGS84)})),this._levelZeroMaximumGeometricError=s.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0));var l=16,u=16;this._terrainData=new a({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<=r||r===1/0||r!==r?void 0:t.multiplyByScalar(e,r,i)}function u(e,r){return e.transformPositionToScaledSpace(r,v),t.normalize(v,v)}var c=function(e,r){if(!i(e))throw new o("ellipsoid is required.");this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,i(r)&&(this.cameraPosition=r)};n(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var r=this._ellipsoid,i=r.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(i)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=i,this._distanceToLimbInScaledSpaceSquared=n}}});var h=new t;c.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(r)},c.prototype.isScaledSpacePointVisible=function(e){var r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,r,h),o=-t.dot(n,r),a=o>i&&o*o/t.magnitudeSquared(n)>i;return!a},c.prototype.computeHorizonCullingPoint=function(e,r,n){if(!i(e))throw new o("directionToPoint is required");if(!i(r))throw new o("positions is required");i(n)||(n=new t);for(var a=this._ellipsoid,c=u(a,e),h=0,d=0,m=r.length;m>d;++d){var f=r[d],p=s(a,f,c);h=Math.max(h,p)}return l(c,h,n)};var d=new t;c.prototype.computeHorizonCullingPointFromVertices=function(e,n,a,c,h){if(!i(e))throw new o("directionToPoint is required");if(!i(n))throw new o("vertices is required");if(!i(a))throw new o("stride is required");i(h)||(h=new t),c=r(c,t.ZERO);for(var m=this._ellipsoid,f=u(m,e),p=0,v=0,g=n.length;g>v;v+=a){d.x=n[v]+c.x,d.y=n[v+1]+c.y,d.z=n[v+2]+c.z;var _=s(m,d,f);p=Math.max(p,_)}return l(f,p,h)};var m=[];c.prototype.computeHorizonCullingPointFromRectangle=function(r,n,s){if(!i(r))throw new o("rectangle is required.");var l=a.subsample(r,n,0,m),u=e.fromPoints(l);return t.magnitude(u.center)<.1*n.minimumRadius?void 0:this.computeHorizonCullingPoint(u.center,l,s)};var f=new t,p=new t,v=new t;return c}),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");var o=r.addEventListener(i,n);this._removalFunctions.push(o);var a=this;return function(){o();var e=a._removalFunctions;e.splice(e.indexOf(o),1)}},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/FAR",[],function(){"use strict";var e=5906376272e3;return e}),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/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(e,t,r,i,o,a){var s,l,u,c=0;if(i>0){for(l=0;o>l;l++){for(s=!1,u=0;ul;l++){for(s=!1,u=0;ud;d++){var m=Math.floor(d*h);for(s=0;c>s;s++)l=t[s]*o*(a+1)+d,e[m+s]=n[l];for(var f=1;c>f;f++){var p=0,v=Math.floor(f*(1-f)/2)+c*f,g=!1;for(s=0;c-f>s;s++){var _,y,w=r[t[s]],C=r[t[s+f]];if(0>=C-w)l=t[s]*o*(a+1)+o*f+d,_=n[l],y=_/i.factorial(f),e[m+v+p]=y,p++;else{var b=Math.floor((f-1)*(2-f)/2)+c*(f-1);_=e[m+b+s+1]-e[m+b+s],y=_/(C-w),e[m+v+p]=y,p++}g=g||0!==_}g&&(u=Math.max(u,f))}}return u}var a=i.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(i,n){if(n=e(n,0),!t(i))throw new r("degree is required.");if(0>i)throw new r("degree must be 0 or greater.");if(0>n)throw new r("inputOrder must be 0 or greater.");return Math.max(Math.floor((i+1)/(n+1)),2)},s.interpolateOrderZero=function(e,r,i,o,s){t(s)||(s=new Array(o));var l,u,c,h,d,m,f=r.length,p=new Array(o);for(l=0;o>l;l++){s[l]=0;var v=new Array(f);for(p[l]=v,u=0;f>u;u++)v[u]=[]}var g=f,_=new Array(g);for(l=0;g>l;l++)_[l]=l;var y=f-1;for(h=0;o>h;h++){for(u=0;g>u;u++)m=_[u]*o+h,p[h][0].push(i[m]);for(l=1;g>l;l++){var w=!1;for(u=0;g-l>u;u++){var C,b=r[_[u]],S=r[_[u+l]];0>=S-b?(m=_[u]*o+o*l+h,C=i[m],p[h][l].push(C/a(l))):(C=p[h][l-1][u+1]-p[h][l-1][u],p[h][l].push(C/(S-b))),w=w||0!==C}w||(y=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;y>=l;l++){var x=n(e,_,r,c,l,[]);for(h=0;o>h;h++){var E=p[h][l][0];s[h+c*o]+=E*x}}return s};var l=[];return s.interpolate=function(e,r,i,a,s,u,c){var h=a*(u+1);t(c)||(c=new Array(h));for(var d=0;h>d;d++)c[d]=0;for(var m=r.length,f=new Array(m*(s+1)),p=0;m>p;p++)for(var v=0;s+1>v;v++)f[p*(s+1)+v]=p;for(var g=f.length,_=l,y=o(_,f,r,i,a,s),w=[],C=g*(g+1)/2,b=Math.min(y,u),S=0;b>=S;S++)for(p=S;y>=p;p++){w.length=0;for(var x=n(e,f,r,S,p,w),E=Math.floor(p*(1-p)/2)+g*p,T=0;a>T;T++){var P=Math.floor(T*C),A=_[P+E];c[T+S*a]+=A*x}}return c},s}),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,f=13.064993,p=.3287146,v=1.7484877,g=-.1589763,_=.0036096,y=.1643573,w=12.9590088,C=new r;return o.ComputeMoon=function(o,b){e(o)||(o=r.now()),C=r.addSeconds(o,a,C);var S=r.getTotalDays(C)-s,x=S/n.DAYS_PER_JULIAN_CENTURY,E=(125.045+l*S)*i.RADIANS_PER_DEGREE,T=(250.089+u*S)*i.RADIANS_PER_DEGREE,P=(260.008+c*S)*i.RADIANS_PER_DEGREE,A=(176.625+h*S)*i.RADIANS_PER_DEGREE,M=(357.529+d*S)*i.RADIANS_PER_DEGREE,D=(311.589+m*S)*i.RADIANS_PER_DEGREE,I=(134.963+f*S)*i.RADIANS_PER_DEGREE,O=(276.617+p*S)*i.RADIANS_PER_DEGREE,R=(34.226+v*S)*i.RADIANS_PER_DEGREE,L=(15.134+g*S)*i.RADIANS_PER_DEGREE,N=(119.743+_*S)*i.RADIANS_PER_DEGREE,B=(239.961+y*S)*i.RADIANS_PER_DEGREE,F=(25.053+w*S)*i.RADIANS_PER_DEGREE,z=Math.sin(E),V=Math.sin(T),q=Math.sin(P),k=Math.sin(A),U=Math.sin(M),W=Math.sin(D),G=Math.sin(I),H=Math.sin(O),j=Math.sin(R),Y=Math.sin(L),X=Math.sin(N),Z=Math.sin(B),J=Math.sin(F),Q=Math.cos(E),K=Math.cos(T),$=Math.cos(P),et=Math.cos(A),tt=Math.cos(M),rt=Math.cos(D),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(F),ct=(269.9949+.0031*x-3.8787*z-.1204*V+.07*q-.0172*k+.0072*W-.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*S-1.4e-12*S*S+3.561*z+.1208*V-.0642*q+.0158*k+.0252*U-.0066*W-.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*Q*l+.1208*K*u-.0642*$*c+.0158*et*h+.0252*tt*d-.0066*rt*m-.0047*it*f-.0046*nt*p+.0028*ot*v+.0052*at*g+.004*st*_+.0019*lt*y-.0044*ut*w)/86400*i.RADIANS_PER_DEGREE; return e(b)||(b=new t),b.rightAscension=ct,b.declination=ht,b.rotation=dt,b.rotationRate=mt,b},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=i.now());var u=this._computeFunction(r),c=s(u.rightAscension,u.declination,l),h=n.zeroToTwoPi(u.rotation),f=a.fromAxisAngle(e.UNIT_Z,h,m),p=o.fromQuaternion(a.conjugate(f,f),d),v=o.multiply(p,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.interpolate=e.throwInstantiationError,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,f=this.isStartIncluded,p=this.isStopIncluded;return i.greaterThanOrEquals(l,d)&&i.greaterThanOrEquals(m,l)?(a=!i.equals(l,d)&&c||f&&c,s=p&&h,n=e(r)?r(this.data,t.data):this.data,i.greaterThanOrEquals(m,u)?(s=s||!i.equals(u,m)&&h,new o(l,u,a,s,n)):(s=s||p,new o(l,m,a,s,n))):i.lessThanOrEquals(l,d)&&i.lessThanOrEquals(d,u)?(a=i.equals(l,d)===!1&&f||f&&c,s=p&&h,n=e(r)?r(this.data,t.data):this.data,i.greaterThanOrEquals(m,u)?(s=s||i.equals(u,m)===!1&&h,new o(d,u,a,s,n)):(s=s||p,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",[],function(){"use strict";var e={SHIFT:0,CTRL:1,ALT:2};return e}),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(){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/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError}}),r.prototype.project=t.throwInstantiationError,r.prototype.unproject=t.throwInstantiationError,r}),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)};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,n,a){if(!r(e))throw new i("array is required");return n=t(n,0),r(a)||(a=new o),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a},o.fromColumnMajorArray=function(e,t){if(!r(e))throw new i("values parameter is required");return o.clone(e,t)},o.fromRowMajorArray=function(e,t){if(!r(e))throw new i("values is required.");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){if(!r(e))throw new i("scale is required.");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){if("number"!=typeof e)throw new i("scale is required.");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){if(!r(e))throw new i("angle is required.");var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=-a,t[3]=n,t):new o(n,-a,a,n)},o.toArray=function(e,t){if(!r(e))throw new i("matrix is required");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){if("number"!=typeof t||0>t||t>1)throw new i("row must be 0 or 1.");if("number"!=typeof e||0>e||e>1)throw new i("column must be 0 or 1.");return 2*e+t},o.getColumn=function(t,n,o){if(!r(t))throw new i("matrix is required.");if("number"!=typeof n||0>n||n>1)throw new i("index must be 0 or 1.");var a=2*n,s=t[a],l=t[a+1];return r(o)?(o.x=s,o.y=l,o):new e(s,l)},o.setColumn=function(e,t,n,a){if(!r(e))throw new i("matrix is required");if(!r(n))throw new i("cartesian is required");if("number"!=typeof t||0>t||t>1)throw new i("index must be 0 or 1.");a=o.clone(e,a);var s=2*t;return a[s]=n.x,a[s+1]=n.y,a},o.getRow=function(t,n,o){if(!r(t))throw new i("matrix is required.");if("number"!=typeof n||0>n||n>1)throw new i("index must be 0 or 1.");var a=t[n],s=t[n+2];return r(o)?(o.x=a,o.y=s,o):new e(a,s)},o.setRow=function(e,t,n,a){if(!r(e))throw new i("matrix is required");if(!r(n))throw new i("cartesian is required");if("number"!=typeof t||0>t||t>1)throw new i("index must be 0 or 1.");return a=o.clone(e,a),a[t]=n.x,a[t+2]=n.y,a};var a=new e;o.getScale=function(t,n){if(!r(t))throw new i("matrix is required.");return r(n)||(n=new e),n.x=e.magnitude(e.fromElements(t[0],t[1],a)),n.y=e.magnitude(e.fromElements(t[2],t[3],a)),n};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.getMaximumComponent(s)},o.multiply=function(e,t,n){if(!r(e))throw new i("left is required");if(!r(t))throw new i("right is required");var a=e[0]*t[0]+e[2]*t[1],s=e[0]*t[2]+e[2]*t[3],l=e[1]*t[0]+e[3]*t[1],u=e[1]*t[2]+e[3]*t[3];return r(n)?(n[0]=a,n[1]=l,n[2]=s,n[3]=u,n):new o(a,s,l,u)},o.multiplyByVector=function(t,n,o){if(!r(t))throw new i("matrix is required");if(!r(n))throw new i("cartesian is required");var a=t[0]*n.x+t[2]*n.y,s=t[1]*n.x+t[3]*n.y;return r(o)?(o.x=a,o.y=s,o):new e(a,s)},o.multiplyByScalar=function(e,t,n){if(!r(e))throw new i("matrix is required");if("number"!=typeof t)throw new i("scalar is required and must be a number");return r(n)?(n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n):new o(e[0]*t,e[2]*t,e[1]*t,e[3]*t)},o.negate=function(e,t){if(!r(e))throw new i("matrix is required");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){if(!r(e))throw new i("matrix is required");var n=e[0],a=e[2],s=e[1],l=e[3];return r(t)?(t[0]=n,t[1]=a,t[2]=s,t[3]=l,t):new o(n,s,a,l)},o.abs=function(e,t){if(!r(e))throw new i("matrix is required");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,n){if("number"!=typeof n)throw new i("epsilon must be a number");return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},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/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",["./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,f=new n,p={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,w=0,C=0,b=0,S=0;for(o=0;a>o;o++)g=e.subtract(t[o],s,c),_+=g.x*g.x,y+=g.x*g.y,w+=g.x*g.z,C+=g.y*g.y,b+=g.y*g.z,S+=g.z*g.z;_*=v,y*=v,w*=v,C*=v,b*=v,S*=v;var x=f;x[0]=_,x[1]=y,x[2]=w,x[3]=y,x[4]=C,x[5]=b,x[6]=w,x[7]=b,x[8]=S;var E=n.getEigenDecomposition(x,p),T=n.transpose(E.unitary,i.rotation);g=e.subtract(t[0],s,c);var P=n.multiplyByVector(T,g,h),A=e.clone(P,d),M=e.clone(P,m);for(o=1;a>o;o++)g=e.subtract(t[o],s,g),n.multiplyByVector(T,g,P),e.getMinimumByComponent(M,P,M),e.getMaximumByComponent(A,P,A);var D=e.add(M,A,h);e.multiplyByScalar(D,.5,D),n.multiplyByVector(T,D,D),e.add(s,D,i.translation);var I=e.subtract(A,M,h);return e.multiplyByScalar(I,.5,i.scale),i},l.fromBoundingRectangle=function(e,t,o){if(!r(e))throw new i("boundingRectangle is required");r(o)||(o=new l),r(t)?n.fromRotationZ(t,o.rotation):n.clone(n.IDENTITY,o.rotation);var a=o.scale;a.x=.5*e.width,a.y=.5*e.height,a.z=0;var s=n.multiplyByVector(o.rotation,a,o.translation);return s.x+=e.x,s.y+=e.y,o},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),w=new Array(3),C=new Array(3);return l.intersect=function(t,l){if(!r(t))throw new i("left is required");if(!r(l))throw new i("right is required");var u=n.transpose(t.rotation,v),c=n.multiply(u,l.rotation,g);n.abs(c,c);var h=y,d=w,m=C;return e.subtract(t.translation,l.translation,_),n.multiplyByVector(u,_,_),e.pack(_,h),e.pack(t.scale,d),e.pack(l.scale,m),o(0,d,m,c,h)?!1:o(1,d,m,c,h)?!1:o(2,d,m,c,h)?!1:a(0,d,m,c,h)?!1:a(1,d,m,c,h)?!1:a(2,d,m,c,h)?!1:s(0,0,d,m,c,h)?!1:s(1,0,d,m,c,h)?!1:s(2,0,d,m,c,h)?!1:s(0,1,d,m,c,h)?!1:s(1,1,d,m,c,h)?!1:s(2,1,d,m,c,h)?!1:s(0,2,d,m,c,h)?!1:s(1,2,d,m,c,h)?!1:s(2,2,d,m,c,h)?!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.rectangle,i.rectangle)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),r("Core/Visibility",[],function(){"use strict";var e={NONE:-1,PARTIAL:0,FULL:1};return e}),r("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(e,r){if(!i(e))throw new o("occluderBoundingSphere is required.");if(!i(r))throw new o("camera position is required.");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.cameraPosition=r},h=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!i(e))throw new o("cameraPosition is required.");e=t.clone(e,this._cameraPosition);var r,n,a,s=t.subtract(this._occluderPosition,e,h),l=t.magnitudeSquared(s),u=this._occluderRadius*this._occluderRadius;if(l>u){r=Math.sqrt(l-u),l=1/Math.sqrt(l),n=t.multiplyByScalar(s,l,h);var c=r*r*l;a=t.add(e,t.multiplyByScalar(n,c,h),h)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=n,this._horizonPlanePosition=a,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,r,n){if(!i(e))throw new o("occluderBoundingSphere is required.");if(!i(r))throw new o("camera position is required.");return i(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=r,n):new c(e,r)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var r=t.subtract(e,this._occluderPosition,d),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 m=new t;c.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,m),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,d),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};var f=new t;c.prototype.getVisibility=function(e){if(!i(e))throw new o("occludeeBS is required.");var r=t.clone(e.center),n=e.radius;if(n>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var a=t.subtract(r,this._occluderPosition,f),s=this._occluderRadius-n,l=t.magnitudeSquared(a);if(s=l-s*s,s>0){s=Math.sqrt(s)+this._horizonDistance,a=t.subtract(r,this._cameraPosition,a);var c=t.magnitudeSquared(a);return c>s*s+n*n?u.NONE:(s=this._occluderRadius+n,s=l-s*s,s>0?(s=Math.sqrt(s)+this._horizonDistance,s*s+n*n>c?u.FULL:u.PARTIAL):(a=t.subtract(r,this._horizonPlanePosition,a),t.dot(a,this._horizonPlaneNormal)>-n?u.PARTIAL:u.FULL))}}return u.NONE};var p=new t;c.getOccludeePoint=function(e,r,n){if(!i(e))throw new o("occluderBoundingSphere is required.");if(!i(n))throw new o("positions is required.");if(0===n.length)throw new o("positions must contain at least one element");var a=t.clone(r),s=t.clone(e.center),l=e.radius,u=n.length;if(t.equals(s,r))throw new o("occludeePosition must be different than occluderBoundingSphere.center");var h=t.normalize(t.subtract(a,s,p),p),d=-t.dot(h,s),m=c._anyRotationVector(s,h,d),f=c._horizonToPlaneNormalDotProduct(e,h,d,m,n[0]);if(!f)return void 0;for(var v,g=1;u>g;++g){if(v=c._horizonToPlaneNormalDotProduct(e,h,d,m,n[g]),!v)return void 0;f>v&&(f=v)}if(.0017453283658983088>f)return void 0;var _=l/f;return t.add(s,t.multiplyByScalar(h,_,p),p)};var v=[];c.computeOccludeePointFromRectangle=function(n,s){if(!i(n))throw new o("rectangle is required.");s=r(s,a.WGS84);var u=l.subsample(n,s,0,v),h=e.fromPoints(u),d=t.ZERO;return t.equals(d,h.center)?void 0:c.getOccludeePoint(new e(d,s.minimumRadius),h.center,u)};var g=new t;c._anyRotationVector=function(e,r,i){var n=t.abs(r,g),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=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 l=(t.dot(r,n)+i)/-t.dot(r,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var _=new t;c._rotationVector=function(e,r,i,n,o){var a=t.subtract(n,e,_);if(a=t.normalize(a,a),t.dot(r,a)<.9999999847691291){var l=t.cross(r,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,w=new t,C=new t,b=new t;return c._horizonToPlaneNormalDotProduct=function(e,r,i,n,o){var a=t.clone(o,y),s=t.clone(e.center,w),l=e.radius,u=t.subtract(s,a,C),c=t.magnitudeSquared(u),h=l*l;if(h>c)return!1;var d=c-h,m=Math.sqrt(d),f=Math.sqrt(c),p=1/f,v=m*p,g=v*m;u=t.normalize(u,u);var _=t.add(a,t.multiplyByScalar(u,g,b),b),S=Math.sqrt(d-g*g),x=this._rotationVector(s,r,i,a,n),E=t.fromElements(x.x*x.x*u.x+(x.x*x.y-x.z)*u.y+(x.x*x.z+x.y)*u.z,(x.x*x.y+x.z)*u.x+x.y*x.y*u.y+(x.y*x.z-x.x)*u.z,(x.x*x.z-x.y)*u.x+(x.y*x.z+x.x)*u.y+x.z*x.z*u.z,y);E=t.normalize(E,E);var T=t.multiplyByScalar(E,S,y);x=t.normalize(t.subtract(t.add(_,T,C),s,C),C);var P=t.dot(r,x);x=t.normalize(t.subtract(t.subtract(_,T,x),s,x),x);var A=t.dot(r,x);return A>P?P:A},c}),r("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),r("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),r("Core/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("Core/PolygonGeometryLibrary",["./Cartesian3","./defaultValue","./defined","./Ellipsoid"],function(e,t,r,i){"use strict";function n(t,r,i,n){return e.subtract(r,t,a),e.multiplyByScalar(a,i/n,a),e.add(t,a,a),[a.x,a.y,a.z]}var o={},a=new e;o.subdivideLine=function(t,r,i){var o=e.distance(t,r),a=e.angleBetween(t,r),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++]=t.x,h[d++]=t.y,h[d++]=t.z;for(var m=1;u>m;m++){var f=n(t,r,m*c,o);h[d++]=f[0],h[d++]=f[1],h[d++]=f[2]}return h};var s=new e,l=new e,u=new e,c=new e;return o.scaleToGeodeticHeightExtruded=function(n,o,a,h,d){h=t(h,i.WGS84);var m=s,f=l,p=u,v=c;if(r(n)&&r(n.attributes)&&r(n.attributes.position))for(var g=n.attributes.position.values,_=g.length/2,y=0;_>y;y+=3)e.fromArray(g,y,p),h.geodeticSurfaceNormal(p,m),v=h.scaleToGeodeticSurface(p,v),f=e.multiplyByScalar(m,a,f),f=e.add(v,f,f),g[y+_]=f.x,g[y+1+_]=f.y,g[y+2+_]=f.z,d&&(v=e.clone(p,v)),f=e.multiplyByScalar(m,o,f),f=e.add(v,f,f),g[y]=f.x,g[y+1]=f.y,g[y+2]=f.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",[],function(){"use strict";var e={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(t){return t===e.CLOCKWISE||t===e.COUNTER_CLOCKWISE}};return e}),r("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f){"use strict";function p(t,r,i){var n=e.subtract(r,t,z),o=e.subtract(i,r,V);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=n[h].x);c+=c-u;var d=new t(c,r.y,0);for(h=0;h=r.x||f.x>=r.x)&&(m.y>=r.y&&f.y<=r.y||m.y<=r.y&&f.y>=r.y)){var p=(f.y-m.y)*(d.x-r.x)-(f.x-m.x)*(d.y-r.y);if(0!==p){p=1/p;var g=((f.x-m.x)*(r.y-m.y)-(f.y-m.y)*(r.x-m.x))*p,_=((d.x-r.x)*(r.y-m.y)-(d.y-r.y)*(r.x-m.x))*p;if(g>=0&&1>=g&&_>=0&&1>=_){var y=new e(r.x+g*(d.x-r.x),r.y+g*(d.y-r.y)),w=e.subtract(y,r,q);p=e.magnitudeSquared(w),a>p&&(l=y,a=p,o[0]=h,o[1]=(h+1)%n.length)}}}}return l}function C(t,r){var i=g(r),n=r[i],o=v(n),a=n[o],s=[],l=w(a,t,s),u=y(t,l);if(-1!==u)return u;var d=e.magnitudeSquared(e.subtract(t[s[0]],a,k)),m=e.magnitudeSquared(e.subtract(t[s[1]],a,k)),f=m>d?t[s[0]]:t[s[1]],p=_(t),C=p.indexOf(f);-1!==C&&p.splice(C,1);for(var b=[],S=0;S0){var T=e.fromElements(1,0,k);for(S=0;SM&&(E=M,f=b[S])}}}return t.indexOf(f)}function b(e,r,i){for(var n=st.computeWindingOrder2D(e),o=0;oi&&(i=t.length-1),i===t.length&&(i=0),A(i,t),i}function A(t,r){var i=t-1,n=t+1;0>i&&(i=r.length-1),n===r.length&&(n=0);var a=e.subtract(r[i].position,r[t].position,Z),s=e.subtract(r[n].position,r[t].position,J);if(M(a,s)){var l=new o("Superfluous vertex found.");throw l.vertexIndex=t,l}}function M(e,r){return 0===t.cross(e,r,Q).z}function D(e,r){return t.cross(e,r,K).z<0}function I(e,r){return t.cross(e,r,$).z>0}function O(e,r,i){return t.cross(e,i,et).z>0&&t.cross(i,r,et).z>0}function R(e,r,i){return t.cross(e,i,tt).z<0&&t.cross(i,r,tt).z<0}function L(t,r,i){for(var n=0;nt||e>r)&&(t>e||r>e)||t===r&&t===e}function F(e){var t=e.length;if(3===t)return N(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new o("Invalid polygon: must have at least three vertices.");for(var r=!1,i=0;!r;){var n=10*e.length;if(i>n)return[];i++;for(var a=S(e.length),s=a+1;Math.abs(a-s)<2||Math.abs(a-s)>e.length-2;)s=S(e.length);if(a>s){var l=a;a=s,s=l}try{if(x(a,s,e)){var u=e.splice(a,s-a+1,e[a],e[s]);return F(e).concat(F(u))}}catch(c){if(c.hasOwnProperty("vertexIndex"))return e.splice(c.vertexIndex,1),F(e);throw c}}}var z=new e,V=new e,q=new e,k=new e(1,0),U=new e,W=0,G=-1,H=1,j=new t,Y=new t,X=new t,Z=new t,J=new t,Q=new t,K=new t,$=new t,et=new t,tt=new t,rt=new e,it=new t,nt=new t,ot=new t,at=new t,st={};return st.removeDuplicates=function(e){if(!n(e))throw new o("positions is required.");if(e.length<3)throw new o("At least three positions are required.");for(var r=e.length,i=[],a=r-1,s=0;r>s;a=s++){var l=e[a],u=e[s];t.equals(l,u)||i.push(u)}return i},st.computeArea2D=function(e){if(!n(e))throw new o("positions is required.");if(e.length<3)throw new o("At least three positions are required.");for(var t=e.length,r=0,i=t-1,a=0;t>a;i=a++){var s=e[i],l=e[a];r+=s.x*l.y-l.x*s.y}return.5*r},st.computeWindingOrder2D=function(e){var t=st.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},st.triangulate=function(e){if(!n(e))throw new o("positions is required.");if(e.length<3)throw new o("At least three positions are required.");for(var t=e.length,r=[],i=0;t>i;++i)r[i]={position:e[i],index:i};return F(r)},st.resetSeed=function(e){W=i(e,0)},st.computeSubdivision=function(e,a,s){if(s=i(s,c.RADIANS_PER_DEGREE),!n(e))throw new o("positions is required.");if(!n(a))throw new o("indices is required.");if(a.length<3)throw new o("At least three indices are required.");if(0!==a.length%3)throw new o("The number of indices must be divisable by three.");if(0>=s)throw new o("granularity must be greater than zero.");for(var h=new m,f=a.length,p=0;f>p;p+=3)h.enqueue({i0:a[p],i1:a[p+1],i2:a[p+2]});for(var v,g=e.slice(0),_=[],y={};h.length>0;){var w,C,b=h.dequeue(),S=g[b.i0],x=g[b.i1],E=g[b.i2],T=t.angleBetween(S,x),P=t.angleBetween(x,E),A=t.angleBetween(E,S),M=Math.max(T,Math.max(P,A));M>s?T===M?(w=Math.min(b.i0,b.i1).toString()+" "+Math.max(b.i0,b.i1).toString(),v=y[w],v||(C=t.add(S,x,new t),t.multiplyByScalar(C,.5,C),g.push(C),v=g.length-1,y[w]=v),h.enqueue({i0:b.i0,i1:v,i2:b.i2}),h.enqueue({i0:v,i1:b.i1,i2:b.i2})):P===M?(w=Math.min(b.i1,b.i2).toString()+" "+Math.max(b.i1,b.i2).toString(),v=y[w],v||(C=t.add(x,E,new t),t.multiplyByScalar(C,.5,C),g.push(C),v=g.length-1,y[w]=v),h.enqueue({i0:b.i1,i1:v,i2:b.i0}),h.enqueue({i0:v,i1:b.i2,i2:b.i0})):A===M&&(w=Math.min(b.i2,b.i0).toString()+" "+Math.max(b.i2,b.i0).toString(),v=y[w],v||(C=t.add(E,S,new t),t.multiplyByScalar(C,.5,C),g.push(C),v=g.length-1,y[w]=v),h.enqueue({i0:b.i2,i1:v,i2:b.i1}),h.enqueue({i0:v,i1:b.i0,i2:b.i1})):(_.push(b.i0),_.push(b.i1),_.push(b.i2))}var D=g.length,I=new Array(3*D),O=0;for(v=0;D>v;v++){var R=g[v];I[O++]=R.x,I[O++]=R.y,I[O++]=R.z}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:I})},indices:_,primitiveType:d.TRIANGLES})},st.scaleToGeodeticHeight=function(e,r,o,s){o=i(o,a.WGS84);var l=ot,u=at;if(r=i(r,0),s=i(s,!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)t.fromArray(c,d,u),s&&(u=o.scaleToGeodeticSurface(u,u)),l=o.geodeticSurfaceNormal(u,l),t.multiplyByScalar(l,r,l),t.add(u,l,u),c[d]=u.x,c[d+1]=u.y,c[d+2]=u.z;return e},st.eliminateHoles=function(e,r,s){if(!n(e))throw new o("outerRing is required.");if(0===e.length)throw new o("outerRing must not be empty.");if(!n(r))throw new o("innerRings is required.");s=i(s,a.WGS84);for(var l=[],u=0;u0;)d=b(d,l,s);return d},st}),r("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./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,f,p,v,g,_,y,w,C,b,S,x){"use strict";function E(e,t,r,n){for(var o=C.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 f=i.clone(t[m],I); g.multiplyByVector(s,f,f);var p=e.projectPointOntoPlane(f,D);a(p)&&(l=Math.min(l,p.x),u=Math.max(u,p.x),c=Math.min(c,p.y),h=Math.max(h,p.y))}return n.x=l,n.y=c,n.width=u-l,n.height=h-c,n}function T(e,t,r,i){var o=u.fromPoints(t,e),a=o.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 f=t.length,p=new Array(3*f),v=0,g=0;f>g;g++){var _=t[g];p[v++]=_.x,p[v++]=_.y,p[v++]=_.z}d=new c({attributes:{position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:l,primitiveType:w.TRIANGLES})}else d=y.computeSubdivision(t,l,r);return new m({geometry:d})}function P(e,t,o,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(o,a),m=E(d,o,s,N),f=U;f.x=m.x,f.y=m.y;var p=t.attributes.position.values,_=p.length,y=e.st?new Float32Array(2*(_/3)):void 0,w=e.normal?new Float32Array(_):void 0,b=e.tangent?new Float32Array(_):void 0,S=e.binormal?new Float32Array(_):void 0,x=0,T=0,P=F,A=z,M=V,D=!0,I=C.fromAxisAngle(d._plane.normal,s,H),O=g.fromQuaternion(I,j),R=_/2,L=_/3;l&&(_/=2);for(var Y=0;_>Y;Y+=3){var X=i.fromArray(p,Y,G);if(e.st){var Z=g.multiplyByVector(O,X,B),J=d.projectPointOntoPlane(Z,W);r.subtract(J,f,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(_>Y+3){var $=i.fromArray(p,Y+3,q);if(D){var et=i.fromArray(p,Y+_,k);i.subtract($,X,$),i.subtract(et,X,et),P=i.normalize(i.cross(et,$,P),P),D=!1}i.equalsEpsilon($,X,v.EPSILON10)&&(D=!0)}(e.tangent||e.binormal)&&(M=a.geodeticSurfaceNormal(X,M),e.tangent&&(A=i.normalize(i.cross(M,P,A),A)))}else P=a.geodeticSurfaceNormal(X,P),(e.tangent||e.binormal)&&(A=i.cross(i.UNIT_Z,P,A),A=i.normalize(g.multiplyByVector(O,A,A),A),e.binormal&&(M=i.normalize(i.cross(P,A,M),M)));e.normal&&(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.tangent&&(l&&!c?(b[T+R]=-A.x,b[Q+R]=-A.y,b[K+R]=-A.z):(b[T+R]=A.x,b[Q+R]=A.y,b[K+R]=A.z),b[T]=A.x,b[Q]=A.y,b[K]=A.z),e.binormal&&(l&&(S[T+R]=M.x,S[Q+R]=M.y,S[K+R]=M.z),S[T]=M.x,S[Q]=M.y,S[K]=M.z),T+=3}}e.st&&(t.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),e.normal&&(t.attributes.normal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S}))}return t}function A(e,t,r){var o,a,s,l,u,m,f,g,y,C=[],b=e.length;if(r)for(f=0;b>f;f++)g=e[f],y=e[(f+1)%b],C.push(g.x,g.y,g.z,y.x,y.y,y.z);else for(f=0;b>f;f++)g=e[f],y=e[(f+1)%b],o=_.subdivideLine(g,y,t),o.push(y.x,y.y,y.z),C=C.concat(o);C=C.concat(C),b=C.length;var S=p.createTypedArray(b/3,b-6*e.length);for(a=0,b/=6,f=0;b>f;f++)s=f,l=s+1,g=i.fromArray(C,3*s,q),y=i.fromArray(C,3*l,k),i.equalsEpsilon(g,y,v.EPSILON6)||(u=s+b,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:n.DOUBLE,componentsPerAttribute:3,values:C})}),indices:S,primitiveType:w.TRIANGLES})}function M(e,t,r,i,o){var a=T(e,t,r,o).geometry,s=a.attributes.position.values,l=a.indices,f=s.concat(s),v=f.length/3,g=p.createTypedArray(v,2*l.length);g.set(l);var _,w=l.length,C=v/2;for(_=0;w>_;_+=3){var b=g[_]+C,S=g[_+1]+C,E=g[_+2]+C;g[_+w]=E,g[_+1+w]=S,g[_+2+w]=b}var P=new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:f})}),indices:g,primitiveType:a.primitiveType}),M={topAndBottom:new m({geometry:P})};M.walls=[];var D=i.outerRing,I=u.fromPoints(D,e),O=I.projectPointsOntoPlane(D,Y),R=y.computeWindingOrder2D(O);R===x.CLOCKWISE&&D.reverse();var L=A(D,r,o);M.walls.push(new m({geometry:L}));var N=i.holes;for(_=0;_x;x++){var R=D[x];if(R.positions=y.removeDuplicates(R.positions),R.positions.length<3)throw new s("At least three positions are required.");O.push(R.positions);var L=0;a(R.holes)&&(L=R.holes.length);for(var N=0;L>N;N++)S.enqueue(R.holes[N])}g.push({outerRing:A,holes:O});var B=y.eliminateHoles(A,O);C.push(B)}}n=C[0];var F,z=[];if(v){for(x=0;xw;w++){var x=a[w],E=a[(w+1)%S];C.push(x.x,x.y,x.z,E.x,E.y,E.z)}else for(w=0;S>w;w++)C=C.concat(p.subdivideLine(a[w],a[(w+1)%S],i));S=C.length/3;var T=2*S,P=m.createTypedArray(C.length/3,T),A=0;for(w=0;S-1>w;w++)P[A++]=w,P[A++]=w+1;return P[A++]=S-1,P[A++]=0,new h({geometry:new l({attributes:new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:new Float64Array(C)})}),indices:P,primitiveType:g.LINES})})}function C(e,t,i,n){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),f=d.projectPointsOntoPlane(a,b),_=v.computeWindingOrder2D(f);_===y.CLOCKWISE&&(f.reverse(),a.reverse());var w,C=[],S=a.length,x=new Array(S);if(x[0]=0,n){var E,T;for(w=0;S-1>w;w++)E=a[w],T=a[(w+1)%S],C.push(E.x,E.y,E.z,T.x,T.y,T.z),x[w+1]=C.length/3;E=a[S-1],T=a[0],C.push(E.x,E.y,E.z,T.x,T.y,T.z)}else{for(w=0;S-1>w;w++)C=C.concat(p.subdivideLine(a[w],a[w+1],i)),x[w+1]=C.length/3;C=C.concat(p.subdivideLine(a[S-1],a[0],i))}S=C.length/3;var P=2*(2*S+x.length),A=m.createTypedArray(C.length/3,P),M=0;for(w=0;S-1>w;w++)A[M++]=w,A[M++]=w+1,A[M++]=w+S,A[M++]=w+1+S;for(A[M++]=S-1,A[M++]=0,A[M++]=S+S-1,A[M++]=S,w=0;wg;g++){var x=y.holes[g];m.push(x.positions);var E=0;n(x.holes)&&(E=x.holes.length);for(var T=0;E>T;T++)f.enqueue(x.holes[T])}m.push(b)}var P,A=[];if(u)for(g=0;gi)throw new a("width must be greater than or equal to one.");if(o(r)&&(s&&r.lengtha;++a)T+=4*E[a]-4;var A,M,D=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,N=o(C)?new Uint8Array(4*T):void 0,B=0,F=0,z=0,V=0,q=0,k=0,U=x.length;for(m=0;U>m;++m){0===m?(M=p,t.subtract(x[0],x[1],M),t.add(x[0],M,M)):M=x[m-1],t.clone(M,g),t.clone(x[m],v),m===U-1?(M=p,t.subtract(x[U-1],x[U-2],M),t.add(x[U-1],M,M)):M=x[m+1],t.clone(M,_),A=E[q],m===k+A&&(k+=A,++q);var W,G,H=0===m-k,j=m===k+E[q]-1,Y=H?2:0,X=j?2:4;if(o(N)){var Z=m-q;W=H||b?C[Z]:C[Z-1],j||(G=C[Z])}for(f=Y;X>f;++f){t.pack(v,D,B),t.pack(g,I,B),t.pack(_,O,B),B+=3;var J=0>f-2?-1:1;if(R[F++]=2*(f%2)-1,R[F++]=J*y,w.st&&(L[z++]=m/(U-1),L[z++]=Math.max(R[F-2],0)),o(N)){var Q=2>f?W:G;N[V++]=r.floatToByte(Q.red),N[V++]=r.floatToByte(Q.green),N[V++]=r.floatToByte(Q.blue),N[V++]=r.floatToByte(Q.alpha)}}}var K=new u;K.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:D}),K.prevPosition=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:I}),K.nextPosition=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:O}),K.expandAndWidth=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:R}),w.st&&(K.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:L})),o(N)&&(K.color=new l({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:N,normalize:!0})),P=E.length;var $=c.createTypedArray(T,6*x.length-6*P),et=0,tt=0;for(a=0;P>a;++a)for(A=E[a]-1,m=0;A>m;++m)$[tt++]=et,$[tt++]=et+2,$[tt++]=et+1,$[tt++]=et+1,$[tt++]=et+2,$[tt++]=et+3,et+=4;return new s({attributes:K,indices:$,primitiveType:d.TRIANGLES,boundingSphere:e.fromPoints(x)})},f}),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,f,p,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,p,g,_,y,w=i.length,C=e.length/3,b=(C-2*w)/(2*w),S=f.triangulate(i),x=6*(b-1)*w+2*S.length,E=d.createTypedArray(C,x),T=2*w,P=0;for(s=0;b-1>s;s++){for(m=0;w-1>m;m++)p=2*m+2*s*w,y=p+T,g=p+1,_=g+T,E[P++]=g,E[P++]=p,E[P++]=_,E[P++]=_,E[P++]=p,E[P++]=y;p=2*w-2+2*s*w,g=p+1,_=g+T,y=p+T,E[P++]=g,E[P++]=p,E[P++]=_,E[P++]=_,E[P++]=p,E[P++]=y}if(o.st||o.tangent||o.binormal){var A,M,D=new Float32Array(2*C),I=1/(b-1),O=1/n.height,R=n.height/2,L=0;for(s=0;b>s;s++){for(A=s*I,M=O*(i[0].y+R),D[L++]=A,D[L++]=M,m=1;w>m;m++)M=O*(i[m].y+R),D[L++]=A,D[L++]=M,D[L++]=A,D[L++]=M;M=O*(i[0].y+R),D[L++]=A,D[L++]=M}for(m=0;w>m;m++)A=0,M=O*(i[m].y+R),D[L++]=A,D[L++]=M;for(m=0;w>m;m++)A=(b-1)*I,M=O*(i[m].y+R),D[L++]=A,D[L++]=M;a.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:new Float32Array(D)})}var N=C-2*w;for(s=0;sa;a++)v[g++]=a+_,v[g++]=a+_+1;for(v[g++]=s-1+_,v[g++]=_,o=f-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;f-1>o;o++){var y=s*o,w=y+s;for(a=0;s>a;a++)v[g++]=a+y,v[g++]=a+w}var C=new l({attributes:n,indices:h.createTypedArray(d,v),boundingSphere:t.fromVertices(e),primitiveType:p.LINES});return C}var _=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;if(!o(t))throw new a("options.polylinePositions is required.");if(!o(r))throw new a("options.shapePositions is required.");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=f.removeDuplicatesFromPositions(r,t._ellipsoid),n=t._shape;if(n=f.removeDuplicatesFromShape(n),i.length<2)throw new a("Count of unique polyline positions must be greater than 1.");if(n.length<3)throw new a("Count of unique shape positions must be at least 3.");m.computeWindingOrder2D(n)===v.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,y),s=f.computePositions(i,n,o,t,!1);return g(s,n)},_}),r("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,r,i,n,o){"use strict";function a(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 s(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 l=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.points,o=r.times,l=r.firstInnerQuadrangle,u=r.lastInnerQuadrangle;if(!t(n)||!t(o))throw new i("points and times are required.");if(n.length<2)throw new i("points.length must be greater than or equal to 2.");if(o.length!==n.length)throw new i("times.length must be equal to points.length.");var c=a(n,l,u);this._times=o,this._points=n,this._innerQuadrangles=c,this._evaluateFunction=s(this),this._lastTimeIndex=0};return r(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l}),r("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PrimitiveType","./Quaternion","./Rectangle","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b){"use strict";function S(e,t){return e<-v.PI_OVER_TWO||e>v.PI_OVER_TWO?!1:t>v.PI||t<-v.PI?!1:!0}function x(e,t,r,i,n){var o=e.radiiSquared;O=N.latitude-e.granYCos*t+r*e.granXSin;var s=et(O),l=tt(O),u=o.z*l;R=N.longitude+t*e.granYSin+r*e.granXCos;var c=s*et(R),h=s*tt(R),d=o.x*c,m=o.y*h,f=rt(d*c+m*h+u*l),p=d/f,v=m/f,g=u/f;a(i)&&(W.x=p+c*i,W.y=v+h*i,W.z=g+l*i),a(n)&&(Y.x=p+c*n,Y.y=v+h*n,Y.z=g+l*n)}function E(e,t){var r=new c({attributes:new d,primitiveType:y.TRIANGLES});return e.position&&(r.attributes.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:t.positions})),e.normal&&(r.attributes.normal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(r.attributes.binormal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.binormals})),r}function T(e,t,i,n,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=n?a/2:0;a=n&&o?a/2:a;for(var d=0;a>d;d+=3){var m=r.fromArray(e,d,W),f=c+1,p=c+2;(t.normal||t.tangent||t.binormal)&&(G=i.geodeticSurfaceNormal(m,G),(t.tangent||t.binormal)&&(r.cross(r.UNIT_Z,G,H),_.multiplyByVector(k,H,H),r.normalize(H,H),t.binormal&&r.normalize(r.cross(G,H,j),j)),n&&(t.normal&&(s[c]=G.x,s[f]=G.y,s[p]=G.z),t.tangent&&(l[c]=H.x,l[f]=H.y,l[p]=H.z),t.binormal&&(u[c]=j.x,u[f]=j.y,u[p]=j.z)),o&&(t.normal&&(s[c+h]=-G.x,s[f+h]=-G.y,s[p+h]=-G.z),t.tangent&&(l[c+h]=-H.x,l[f+h]=-H.y,l[p+h]=-H.z),t.binormal&&(u[c+h]=j.x,u[f+h]=j.y,u[p+h]=j.z))),c+=3}return E(t,{positions:e,normals:s,tangents:l,binormals:u})}function P(e,t,i){for(var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.binormal?new Float32Array(n):void 0,l=0,u=!0,c=n/2,h=0;c>h;h+=3){var d=r.fromArray(e,h,W),m=l+1,f=l+2;if(t.normal||t.tangent||t.binormal){var p=r.fromArray(e,h+3,J);if(u){var g=r.fromArray(e,h+c,Q);r.subtract(p,d,p),r.subtract(g,d,g),G=r.normalize(r.cross(g,p,G),G),u=!1}r.equalsEpsilon(p,d,v.EPSILON10)&&(u=!0),(t.tangent||t.binormal)&&(j=i.geodeticSurfaceNormal(d,j),t.tangent&&(H=r.normalize(r.cross(j,G,H),H))),t.normal&&(o[l]=G.x,o[m]=G.y,o[f]=G.z,o[l+c]=G.x,o[m+c]=G.y,o[f+c]=G.z),t.tangent&&(a[l]=H.x,a[m]=H.y,a[f]=H.z,a[l+c]=H.x,a[m+c]=H.y,a[f+c]=H.z),t.binormal&&(s[l]=j.x,s[m]=j.y,s[f]=j.z,s[l+c]=j.x,s[m+c]=j.y,s[f+c]=j.z)}l+=3}return E(t,{positions:e,normals:o,tangents:a,binormals:s})}function A(e,t,r,i,n){return K.x=(R-z.west)*i.lonScalar-.5,K.y=(O-z.south)*i.latScalar-.5,g.multiplyByVector(V,K,K),K.x+=.5,K.y+=.5,a(n)&&(r[t+n]=K.x,r[t+1+n]=K.y),r[t++]=K.x,r[t++]=K.y,t}function M(e,t,r){return e[t+r]=Y.x,e[t++]=W.x,e[t+r]=Y.y,e[t++]=W.y,e[t+r]=Y.z,e[t++]=W.z,e}function D(t,r){for(var i=r.ellipsoid,o=r.size,a=r.height,s=r.width,l=r.surfaceHeight,u=0,c=t.position?new Float64Array(3*o):void 0,d=t.st?new Float32Array(2*o):void 0,m=0,f=0;a>f;++f)for(var v=0;s>v;++v)x(r,f,v,l),c[m++]=W.x,c[m++]=W.y,c[m++]=W.z,t.st&&(K.x=(R-z.west)*r.lonScalar-.5,K.y=(O-z.south)*r.latScalar-.5,g.multiplyByVector(V,K,K),K.x+=.5,K.y+=.5,d[u++]=K.x,d[u++]=K.y);for(var _=T(c,t,i,!0,!1),y=6*(s-1)*(a-1),w=p.createTypedArray(o,y),C=0,b=0,S=0;a-1>S;++S){for(var E=0;s-1>E;++E){var P=C,A=P+s,M=A+1,D=P+1;w[b++]=P,w[b++]=A,w[b++]=D,w[b++]=D,w[b++]=A,w[b++]=M,++C}++C}return _.indices=w,t.st&&(_.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:d})),{boundingSphere:e.fromRectangle3D(r.rectangle,i,l),geometry:_}}function I(t,i){var a=i.surfaceHeight,s=i.extrudedHeight,l=Math.min(s,a),u=Math.max(s,a);if(v.equalsEpsilon(l,u,.1))return D(t,i);var c,d=i.height,g=i.width,_=i.size,y=i.ellipsoid,w=o(i.closeTop,!0),C=o(i.closeBottom,!0),b=2*g+2*d-4,S=2*(b+4),E=new Float64Array(3*S),I=t.st?new Float32Array(2*S):void 0,O=0,R=0,L=0,N=3*(S/2);for(c=0;d>c;c++)x(i,c,O,u,l),E=M(E,R,N),R+=3,t.st&&(L=A(t,L,I,i,S));for(c=d-1,O=0;g>O;O++)x(i,c,O,u,l),E=M(E,R,N),R+=3,t.st&&(L=A(t,L,I,i,S));for(O=g-1,c=d-1;c>=0;c--)x(i,c,O,u,l),E=M(E,R,N),R+=3,t.st&&(L=A(t,L,I,i,S));for(c=0,O=g-1;O>=0;O--)x(i,c,O,u,l),E=M(E,R,N),R+=3,t.st&&(L=A(t,L,I,i,S));var B=P(E,t,y);t.st&&(B.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:I}));var F,z,V,q,k,U=p.createTypedArray(S,6*b),G=E.length/6,H=0;for(k=0;G-1>k;k++){F=k,q=F+1;var j=r.fromArray(E,3*F,J),K=r.fromArray(E,3*q,Q);r.equalsEpsilon(j,K,v.EPSILON10)||(z=F+G,V=z+1,U[H++]=F,U[H++]=z,U[H++]=q,U[H++]=q,U[H++]=z,U[H++]=V)}if(B.indices=U,C||w){var $,et,tt=0,rt=0;w&&(tt+=_,rt+=6*(g-1)*(d-1),$=u),C&&(tt+=_,rt+=6*(g-1)*(d-1),et=l);var it=new Float64Array(3*tt),nt=t.st?new Float32Array(2*tt):void 0,ot=p.createTypedArray(tt,rt);for(R=0,L=0,N=C&&w?3*_:0,c=0;d>c;++c)for(O=0;g>O;++O)x(i,c,O,$,et),C&&(it[R+N]=Y.x,it[R+1+N]=Y.y,it[R+2+N]=Y.z),w&&(it[R]=W.x,it[R+1]=W.y,it[R+2]=W.z),t.st&&(L=A(t,L,nt,i,2*_)),R+=3;var at=T(it,t,y,w,C);t.st&&(at.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:nt}));var st=0;for(H=0,N/=3,k=0;d-1>k;++k){for(var lt=0;g-1>lt;++lt)F=H,z=F+g,V=z+1,q=F+1,C&&(ot[st++]=q+N,ot[st++]=z+N,ot[st++]=F+N,ot[st++]=V+N,ot[st++]=z+N,ot[st++]=q+N),w&&(ot[st++]=F,ot[st++]=z,ot[st++]=q,ot[st++]=q,ot[st++]=z,ot[st++]=V),++H;++H}at.indices=ot,B=f.combine([new m({geometry:at}),new m({geometry:B})])}var ut=e.fromRectangle3D(i.rectangle,y,u,Z),ct=e.fromRectangle3D(i.rectangle,y,l,X),ht=e.union(ut,ct);return{boundingSphere:ht,geometry:B}}var O,R,L=new r,N=new i,B=new i,F=new r,z=new C,V=new g,q=new g,k=new _,U=new u,W=new r,G=new r,H=new r,j=new r,Y=new r,X=new e,Z=new e,J=new r,Q=new r,K=new t,$=new w,et=Math.cos,tt=Math.sin,rt=Math.sqrt,it=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,r=o(e.granularity,v.RADIANS_PER_DEGREE),i=o(e.ellipsoid,l.WGS84),n=o(e.height,0),u=e.rotation,c=e.stRotation,h=o(e.vertexFormat,b.DEFAULT);if(!a(t))throw new s("rectangle is required.");if(C.validate(t),t.eastm.PI_OVER_TWO?!1:t>m.PI||t<-m.PI?!1:!0}function _(e,t,r,i,n){var a=e.radiiSquared;C=x.latitude-e.granYCos*t+r*e.granXSin;var s=R(C),l=L(C),u=a.z*l;b=x.longitude+t*e.granYSin+r*e.granXCos;var c=s*R(b),h=s*L(b),d=a.x*c,m=a.y*h,f=N(d*c+m*h+u*l),p=d/f,v=m/f,g=u/f;o(i)&&(M.x=p+c*i,M.y=v+h*i,M.z=g+l*i),o(n)&&(D.x=p+c*n,D.y=v+h*n,D.z=g+l*n)}function y(t){var r,i=t.rectangle,n=t.ellipsoid,o=t.size,a=t.height,s=t.width,l=t.surfaceHeight,u=new Float64Array(3*o),c=0,h=0;for(r=0;s>r;r++)_(t,h,r,l),u[c++]=M.x,u[c++]=M.y,u[c++]=M.z;for(r=s-1,h=1;a>h;h++)_(t,h,r,l),u[c++]=M.x,u[c++]=M.y,u[c++]=M.z;for(h=a-1,r=s-2;r>=0;r--)_(t,h,r,l),u[c++]=M.x,u[c++]=M.y,u[c++]=M.z;for(r=0,h=a-2;h>0;h--)_(t,h,r,l),u[c++]=M.x,u[c++]=M.y,u[c++]=M.z;for(var m=2*(u.length/3),f=d.createTypedArray(u.length/3,m),p=0,v=0;va;a++)_(t,p,a,o,n),v[f+c]=D.x,v[f+c+1]=D.y,v[f+c+2]=D.z,v[f++]=M.x,v[f++]=M.y,v[f++]=M.z;for(a=u-1,p=1;l>p;p++)_(t,p,a,o,n),v[f+c]=D.x,v[f+c+1]=D.y,v[f+c+2]=D.z,v[f++]=M.x,v[f++]=M.y,v[f++]=M.z;for(p=l-1,a=u-2;a>=0;a--)_(t,p,a,o,n),v[f+c]=D.x,v[f+c+1]=D.y,v[f+c+2]=D.z,v[f++]=M.x,v[f++]=M.y,v[f++]=M.z;for(a=0,p=l-2;p>0;p--)_(t,p,a,o,n),v[f+c]=D.x,v[f+c+1]=D.y,v[f+c+2]=D.z,v[f++]=M.x,v[f++]=M.y,v[f++]=M.z;for(var g=2*(v.length/3)+8,w=d.createTypedArray(v.length/3,g),C=v.length/6,b=0,S=0;C-1>S;S++)w[b++]=S,w[b++]=S+1,w[b++]=S+C,w[b++]=S+C+1;w[b++]=C-1,w[b++]=0,w[b++]=C+C-1,w[b++]=C,w[b++]=0,w[b++]=C,w[b++]=u-1,w[b++]=C+u-1,w[b++]=u+l-2,w[b++]=u+l-2+C,w[b++]=2*u+l-3,w[b++]=2*u+l-3+C;var x=e.fromRectangle3D(s,h,o,O),E=e.fromRectangle3D(s,h,n,I),T=e.union(x,E);return{boundingSphere:T,positions:v,indices:w}}var C,b,S=new t,x=new r,E=new r,T=new t,P=new f,A=new l,M=new t,D=new t,I=new e,O=new e,R=Math.cos,L=Math.sin,N=Math.sqrt,B=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,r=n(e.granularity,m.RADIANS_PER_DEGREE),i=n(e.ellipsoid,s.WGS84),l=n(e.height,0),u=e.rotation;if(!o(t))throw new a("rectangle is required.");if(v.validate(t),t.east0)){var h=s(e,t.changedTouches[0],E.position),d=e._lastMousePosition.x-h.x,f=e._lastMousePosition.y-h.y;e._totalPixels+=Math.sqrt(d*d+f*f),r(i)&&i(E),r(n)&&e._totalPixelss&&(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),w=h(a,0);if("Hyperbolic"===w&&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.");p(g,s,_,M);var C=v*(1+a),b=Math.cos(y),S=Math.sin(y),x=1+a*b;if(x<=n.Epsilon10)throw new r("elements cannot be converted to cartesian");var E=C/x;return t(f)?(f.x=E*b,f.y=E*S,f.z=0):f=new e(E*b,E*S,0),o.multiplyByVector(M,f,f)}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 f(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;D>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>=D)throw new r("Kepler equation did not converge");return s=a+i*n.TWO_PI}function f(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 p(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,Mt);var r=Mt.dayNumber-b.dayNumber+(Mt.secondsOfDay-b.secondsOfDay)/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=O+W*Math.cos(N*n)+Q*Math.sin(N*n)+G*Math.cos(B*n)+K*Math.sin(B*n)+H*Math.cos(F*n)+$*Math.sin(F*n)+j*Math.cos(z*n)+et*Math.sin(z*n)+Y*Math.cos(V*n)+tt*Math.sin(V*n)+X*Math.cos(q*n)+rt*Math.sin(q*n)+Z*Math.cos(k*n)+it*Math.sin(k*n)+J*Math.cos(U*n)+nt*Math.sin(U*n),s=R+L*i+mt*Math.cos(ot*n)+Ct*Math.sin(ot*n)+ft*Math.cos(at*n)+bt*Math.sin(at*n)+pt*Math.cos(st*n)+St*Math.sin(st*n)+vt*Math.cos(lt*n)+xt*Math.sin(lt*n)+gt*Math.cos(ut*n)+Et*Math.sin(ut*n)+_t*Math.cos(ct*n)+Tt*Math.sin(ct*n)+yt*Math.cos(ht*n)+Pt*Math.sin(ht*n)+wt*Math.cos(dt*n)+At*Math.sin(dt*n),l=.0167086342-.0004203654*i,h=102.93734808*T+11612.3529*P*i,d=469.97289*P*i,m=174.87317577*T-8679.27034*P*i;return c(o,l,d,h,m,s,x,t)}function g(e,t){u(e,Mt);var r=Mt.dayNumber-b.dayNumber+(Mt.secondsOfDay-b.secondsOfDay)/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,f=83.35324312*T,p=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,w=297.85019547*T+P*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),C=93.27209062*T+P*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),x=134.96340251*T+P*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*T+P*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),M=310.17137918*T-P*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),D=2*w,I=4*w,O=6*w,R=2*x,L=3*x,N=4*x,B=2*C;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-A)+181*Math.cos(D+x),h+=.014216*Math.cos(D-x)+.008551*Math.cos(D-R)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-R)+869e-6*Math.cos(D-A-x)-627e-6*Math.cos(D)-394e-6*Math.cos(I-N)+282e-6*Math.cos(D-A-R)-279e-6*Math.cos(w-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(D-B)-40.13*Math.cos(D)+37.51*Math.cos(B)+25.73*Math.cos(R-B)+19.97*Math.cos(D-A-B),p+=-55609*Math.sin(D-x)-34711*Math.sin(D-R)-9792*Math.sin(x)+9385*Math.sin(I-L)+7505*Math.sin(I-R)+5318*Math.sin(D+x)+3484*Math.sin(I-N)-3417*Math.sin(D-A-x)-2530*Math.sin(O-N)-2376*Math.sin(D)-2075*Math.sin(D-L)-1883*Math.sin(R)-1736*Math.sin(O-5*x)+1626*Math.sin(A)-1370*Math.sin(O-L),g+=-5392*Math.sin(D-B)-540*Math.sin(A)-441*Math.sin(D)+423*Math.sin(B)-288*Math.sin(R-B),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(A)+396.3*Math.sin(x)-218*Math.sin(D-A);var F=2*M,z=3*M;m+=46.997*Math.cos(M)*i-.614*Math.cos(D-B+M)*i+.614*Math.cos(D-B-M)*i-.0297*Math.cos(F)*n-.0335*Math.cos(M)*n+.0012*Math.cos(D-B+F)*n-16e-5*Math.cos(M)*o+4e-5*Math.cos(z)*o+4e-5*Math.cos(F)*o;var V=2.116*Math.sin(M)*i-.111*Math.sin(D-B-M)*i-.0015*Math.sin(M)*n;p+=V,y+=V,g+=-520.77*Math.sin(M)*i+13.66*Math.sin(D-B+M)*i+1.12*Math.sin(D-M)*i-1.06*Math.sin(B-M)*i+.66*Math.sin(F)*n+.371*Math.sin(M)*n-.035*Math.sin(D-B+F)*n-.015*Math.sin(D-B+M)*n+.0014*Math.sin(M)*o-.0011*Math.sin(z)*o-9e-4*Math.sin(F)*o,l*=E;var q=d+m*P,k=f+p*P,U=_+y*P,W=v+g*P;return c(l,h,q,k,W,U,S,t)}function _(t,r){return r=g(t,r),e.multiplyByScalar(r,It,r)}var y={},w=32.184,C=2451545,b=new i(2451545,0,s.TAI),S=398600435e6,x=328900.56*1.012300034*S,E=1e3,T=n.RADIANS_PER_DEGREE,P=n.RADIANS_PER_ARCSECOND,A=14959787e4,M=new o,D=50,I=n.EPSILON8,O=1.0000010178*A,R=100.46645683*T,L=1295977422.83429*P,N=16002,B=21863,F=32004,z=10931,V=14529,q=16368,k=15318,U=32794,W=64e-7*A,G=-152*1e-7*A,H=62e-7*A,j=-8e-7*A,Y=32e-7*A,X=-41*1e-7*A,Z=19e-7*A,J=-11*1e-7*A,Q=-150*1e-7*A,K=-46*1e-7*A,$=68*1e-7*A,et=54e-7*A,tt=14e-7*A,rt=24e-7*A,it=-28*1e-7*A,nt=22e-7*A,ot=10,at=16002,st=21863,lt=10931,ut=1473,ct=32004,ht=4387,dt=73,mt=-325*1e-7,ft=-322*1e-7,pt=-79*1e-7,vt=232*1e-7,gt=-52*1e-7,_t=97e-7,yt=55e-7,wt=-41*1e-7,Ct=-105*1e-7,bt=-137*1e-7,St=258e-7,xt=35e-7,Et=-116*1e-7,Tt=-88*1e-7,Pt=-112*1e-7,At=-80*1e-7,Mt=new i(0,0,s.TAI),Dt=.012300034,It=-1*(Dt/(Dt+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=i.now()),t(n)||(n=new e),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=i.now()),r=g(e,r),o.multiplyByVector(Ot,r,r),r},y}),r("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.positions,r=e.colors,i=n(e.colorsPerVertex,!1);if(!o(t)||t.length<2)throw new a("At least two positions are required.");if(o(r)&&(i&&r.lengtha;++a){var b,S=d[a];if(p&&a>0&&(t.pack(S,w,v),v+=3,b=m[a-1],C[g++]=r.floatToByte(b.red),C[g++]=r.floatToByte(b.green),C[g++]=r.floatToByte(b.blue),C[g++]=r.floatToByte(b.alpha)),p&&a===_-1)break;t.pack(S,w,v),v+=3,o(m)&&(b=m[a],C[g++]=r.floatToByte(b.red),C[g++]=r.floatToByte(b.green),C[g++]=r.floatToByte(b.blue),C[g++]=r.floatToByte(b.alpha))}var x=new u;x.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:w}),o(m)&&(x.color=new l({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0}));var E=p?y:2*(y-1),T=c.createTypedArray(y,E),P=p?2:1;for(v=0,a=0;y-1>a;a+=P)T[v++]=a,T[v++]=a+1;return new s({attributes:x,indices:T,primitiveType:h.LINES,boundingSphere:e.fromPoints(d)})},d}),r("Core/SphereGeometry",["./Cartesian3","./defaultValue","./EllipsoidGeometry"],function(e,t,r){"use strict";var i=function(i){var n=t(i.radius,1),o=new e(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",["./Cartesian3","./defaultValue","./EllipsoidOutlineGeometry"],function(e,t,r){"use strict";var i=function(i){var n=t(i.radius,1),o=new e(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",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(t,r,i){this.clock=e(t,0),this.cone=e(r,0),this.magnitude=e(i,1)};return i.fromCartesian3=function(e,n){if(!t(e))throw new r("cartesian3 is required");var o=e.x,a=e.y,s=e.z,l=o*o+a*a;return t(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,r){return t(e)?t(r)?(r.clock=e.clock,r.cone=e.cone,r.magnitude=e.magnitude,r):new i(e.clock,e.cone,e.magnitude):void 0},i.normalize=function(e,n){if(!t(e))throw new r("spherical is required");return t(n)?(n.clock=e.clock,n.cone=e.cone,n.magnitude=1,n):new i(e.clock,e.cone,1)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.clock===r.clock&&e.cone===r.cone&&e.magnitude===r.magnitude},i.equalsEpsilon=function(r,i,n){return n=e(n,0),r===i||t(r)&&t(i)&&Math.abs(r.clock-i.clock)<=n&&Math.abs(r.cone-i.cone)<=n&&Math.abs(r.magnitude-i.magnitude)<=n},i.toString=function(e){return"("+e.clock+", "+e.cone+", "+e.magnitude+")"},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.clone=function(e){return i.clone(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/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return e(r.prototype,{waterMask:{get:t.throwInstantiationError}}),r.prototype.interpolateHeight=t.throwInstantiationError,r.prototype.isChildAvailable=t.throwInstantiationError,r.prototype.createMesh=t.throwInstantiationError,r.prototype.upsample=t.throwInstantiationError,r.prototype.wasCreatedByUpsampling=t.throwInstantiationError,r}),r("Core/TimeIntervalCollection",["./binarySearch","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){return o.compare(e.start,t.start)}function l(e,r,i,n){for(var a=0,s=0,l=new u,c=e._intervals,h=r._intervals;ao;o++)if(!a.equals(r[o],i[o],t))return!1;return!0},u.prototype.get=function(e){if(isNaN(e))throw new i("index must be a number.");return this._intervals[e]},u.prototype.removeAll=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(r){if(!t(r))throw new i("date required");var n=this._intervals,o=e(n,new a(r,r,!0,!0),s);return o>=0?n[o].isStartIncluded?o:o>0&&n[o-1].stop.equals(r)&&n[o-1].isStopIncluded?o-1:~o:(o=~o,o>0&&o-1s;s++)if(o=a[s],!(t(e)&&!o.start.equals(e)||t(r)&&!o.stop.equals(r)||t(i)&&o.isStartIncluded!==i||t(n)&&o.isStopIncluded!==n))return a[s];return void 0},u.prototype.addInterval=function(r,n){if(!t(r))throw new i("interval is required");if(!r.isEmpty){var l,u,c=this._intervals;if(0===c.length||o.greaterThan(r.start,c[c.length-1].stop))return c.push(r),this._intervalsChanged.raiseEvent(this),void 0;for(u=e(c,r,s),0>u?u=~u:u>0&&r.isStartIncluded&&c[u-1].isStartIncluded&&c[u-1].start.equals(r.start)?--u:u0&&(l=o.compare(c[u-1].stop,r.start),(l>0||0===l&&(c[u-1].isStopIncluded||r.isStartIncluded))&&((t(n)?n(c[u-1].data,r.data):c[u-1].data===r.data)?(r=o.greaterThan(r.stop,c[u-1].stop)?new a(c[u-1].start,r.stop,c[u-1].isStartIncluded,r.isStopIncluded,r.data):new a(c[u-1].start,c[u-1].stop,c[u-1].isStartIncluded,c[u-1].isStopIncluded||r.stop.equals(c[u-1].stop)&&r.isStopIncluded,r.data),c.splice(u-1,1),--u):(l=o.compare(c[u-1].stop,r.stop),l>0||0===l&&c[u-1].isStopIncluded&&!r.isStopIncluded?c.splice(u-1,1,new a(c[u-1].start,r.start,c[u-1].isStartIncluded,!r.isStartIncluded,c[u-1].data),new a(r.stop,c[u-1].stop,!r.isStopIncluded,c[u-1].isStopIncluded,c[u-1].data)):c[u-1]=new a(c[u-1].start,r.start,c[u-1].isStartIncluded,!r.isStartIncluded,c[u-1].data))));u0||0===l&&(r.isStopIncluded||c[u].isStartIncluded));)if(t(n)?n(c[u].data,r.data):c[u].data===r.data)r=new a(r.start,o.greaterThan(c[u].stop,r.stop)?c[u].stop:r.stop,r.isStartIncluded,o.greaterThan(c[u].stop,r.stop)?c[u].isStopIncluded:r.isStopIncluded,r.data),c.splice(u,1);else{if(c[u]=new a(r.stop,c[u].stop,!r.isStopIncluded,c[u].isStopIncluded,c[u].data),!c[u].isEmpty)break;c.splice(u,1)}c.splice(u,0,r),this._intervalsChanged.raiseEvent(this)}},u.prototype.removeInterval=function(r){if(!t(r))throw new i("interval is required");if(r.isEmpty)return!1;var n=!1,l=this._intervals,u=e(l,r,s);0>u&&(u=~u);var c=r.start,h=r.stop,d=r.isStartIncluded,m=r.isStopIncluded;if(u>0){var f=l[u-1],p=f.stop;(o.greaterThan(p,c)||p.equals(c)&&f.isStopIncluded&&d)&&(n=!0,(o.greaterThan(p,h)||f.isStopIncluded&&!m&&p.equals(h))&&l.splice(u,0,new a(h,p,!m,f.isStopIncluded,f.data)),l[u-1]=new a(f.start,c,f.isStartIncluded,!d,f.data))}var v=l[u];for(u0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var v=n.credit;"string"==typeof v&&(v=new t(v)),this._credit=v,this._tilingScheme=void 0,this._rectangles=[];var y,w=this,C=r(n.ellipsoid,a.WGS84);h()};n(C.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}}}),C.prototype.requestTileGeometry=function(t,n,a,s){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");var l=this._tilingScheme.getNumberOfYTilesAtLevel(a),d=this._url+a+"/"+t+"/"+(l-n-1)+".tif?cesium=true",m=this._proxy;i(m)&&(d=m.getURL(d));var f;if(s=r(s,!0)){if(f=v(d,h),!i(f))return void 0}else f=h(d);var p=this;return e(f,function(e){return new c({buffer:u(e),width:p._heightmapWidth,height:p._heightmapHeight,childTileMask:y(p,t,n,a),structure:p._terrainDataStructure})})},C.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<a;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 o.equalsEpsilon(e.latitude,t.latitude,o.EPSILON14)&&o.equalsEpsilon(e.longitude,t.longitude,o.EPSILON14)}function h(e,i,n,o){var a=r(o),s=r(n),l=[],u=[],h=a?[]:void 0,d=i.length;if(2>d)return{positions:i};var p=i[0];l.push(p);var v=e.cartesianToCartographic(p,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=e.cartesianToCartographic(_,f);s&&(y.height=n[g]),c(v,y)?v.height=3){var v=n.fromPoints(t,e),g=v.projectPointsOntoPlane(t);a.computeWindingOrder2D(g)===l.CLOCKWISE&&(t.reverse(),o.reverse(),p&&c.reverse())}var _,y=t.length,w=[],C=p?[]:void 0,b=[];for(_=0;y-1>_;_++){var S=t[_],x=t[_+1],E=o[_],T=o[_+1];w=w.concat(u(S,x,E,T,d)),m&&w.push(T),p&&(S=t[_],x=t[_+1],E=c[_],T=c[_+1],C=C.concat(u(S,x,E,T,d)),m&&C.push(T)),m&&(b=b.concat(s.scaleToSurface([S,x],d,e)))}m||(b=s.scaleToSurface(t,d,e),w.push(o[y-1]),p&&C.push(c[y-1]));var P=p?s.scaleToGeodeticHeight(b,C,e):b.slice(0),A=s.scaleToGeodeticHeight(b,w,e);return{newWallPositions:b,bottomPositions:P,topPositions:A}},d}),r("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f){"use strict";var p=new t,v=new t,g=new t,_=new t,y=new t,w=new t,C=new t,b=new t,S=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,r=e.maximumHeights,s=e.minimumHeights;if(!n(t))throw new o("options.positions is required.");if(n(r)&&r.length!==t.length)throw new o("options.positions and options.maximumHeights must have the same length.");if(n(s)&&s.length!==t.length)throw new o("options.positions and options.minimumHeights must have the same length.");var l=i(e.vertexFormat,m.DEFAULT),u=i(e.granularity,h.RADIANS_PER_DEGREE),c=i(e.ellipsoid,a.WGS84);this._positions=t,this._minimumHeights=s,this._maximumHeights=r,this._vertexFormat=l,this._granularity=u,this._ellipsoid=c,this._workerName="createWallGeometry"};return S.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions;if(!n(t))throw new o("options.positions is required.");var r,a,s=e.minimumHeight,l=e.maximumHeight,u=n(s),c=n(l);if(u||c){var h=t.length;r=u?new Array(h):void 0,a=c?new Array(h):void 0;for(var d=0;h>d;++d)u&&(r[d]=s),c&&(a[d]=l)}var m={positions:t,maximumHeights:a,minimumHeights:r,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new S(m)},S.createGeometry=function(i){var n=i._positions,o=i._minimumHeights,a=i._maximumHeights,m=i._vertexFormat,S=i._granularity,x=i._ellipsoid,E=f.computePositions(x,n,a,o,S,!0),T=E.newWallPositions,P=E.bottomPositions,A=E.topPositions,M=T.length,D=2*M,I=m.position?new Float64Array(D):void 0,O=m.normal?new Float32Array(D):void 0,R=m.tangent?new Float32Array(D):void 0,L=m.binormal?new Float32Array(D):void 0,N=m.st?new Float32Array(2*(D/3)):void 0,B=0,F=0,z=0,V=0,q=0,k=b,U=C,W=w,G=!0; M/=3;var H;for(H=0;M>H;++H){var j=3*H,Y=t.fromArray(A,j,p),X=t.fromArray(P,j,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 t,Q=t.fromArray(T,j,v);if(M>H+1&&(Z=t.fromArray(T,j+3,g),J=t.fromArray(A,j+3,y)),G){var K=t.subtract(J,Y,_),$=t.subtract(Q,Y,p);k=t.normalize(t.cross($,K,k),k),G=!1}t.equalsEpsilon(Z,Q,h.EPSILON6)?G=!0:(m.tangent&&(U=t.normalize(t.subtract(Z,Q,U),U)),m.binormal&&(W=t.normalize(t.cross(k,U,W),W))),m.normal&&(O[F++]=k.x,O[F++]=k.y,O[F++]=k.z,O[F++]=k.x,O[F++]=k.y,O[F++]=k.z),m.tangent&&(R[V++]=U.x,R[V++]=U.y,R[V++]=U.z,R[V++]=U.x,R[V++]=U.y,R[V++]=U.z),m.binormal&&(L[z++]=W.x,L[z++]=W.y,L[z++]=W.z,L[z++]=W.x,L[z++]=W.y,L[z++]=W.z)}if(m.st){var et=H/(M-1);N[q++]=et,N[q++]=0,N[q++]=et,N[q++]=1}}var tt=new u;m.position&&(tt.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:I})),m.normal&&(tt.normal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:O})),m.tangent&&(tt.tangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),m.binormal&&(tt.binormal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(tt.st=new l({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:N}));var rt=D/3;D-=6;var it=c.createTypedArray(rt,D),nt=0;for(H=0;rt-2>H;H+=2){var ot=H,at=H+2,st=t.fromArray(I,3*ot,p),lt=t.fromArray(I,3*at,v);if(!t.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 s({attributes:tt,indices:it,primitiveType:d.TRIANGLES,boundingSphere:new e.fromVertices(I)})},S}),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 f=new t,p=new t,v=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,r=e.maximumHeights,s=e.minimumHeights;if(!n(t))throw new o("options.positions is required.");if(n(r)&&r.length!==t.length)throw new o("options.positions and options.maximumHeights must have the same length.");if(n(s)&&s.length!==t.length)throw new o("options.positions and options.minimumHeights must have the same length.");var l=i(e.granularity,h.RADIANS_PER_DEGREE),u=i(e.ellipsoid,a.WGS84);this._positions=t,this._minimumHeights=s,this._maximumHeights=r,this._granularity=l,this._ellipsoid=u,this._workerName="createWallOutlineGeometry"};return v.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions;if(!n(t))throw new o("options.positions is required.");var r,a,s=e.minimumHeight,l=e.maximumHeight,u=n(s),c=n(l);if(u||c){var h=t.length;r=u?new Array(h):void 0,a=c?new Array(h):void 0;for(var d=0;h>d;++d)u&&(r[d]=s),c&&(a[d]=l)}var m={positions:t,maximumHeights:a,minimumHeights:r,ellipsoid:e.ellipsoid};return new v(m)},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,w=_.bottomPositions,C=_.topPositions,b=y.length,S=2*b,x=new Float64Array(S),E=0;b/=3;var T;for(T=0;b>T;++T){var P=3*T,A=t.fromArray(C,P,f),M=t.fromArray(w,P,p);x[E++]=M.x,x[E++]=M.y,x[E++]=M.z,x[E++]=A.x,x[E++]=A.y,x[E++]=A.z}var D=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x})}),I=S/3;S=2*I-4+I;var O=c.createTypedArray(I,S),R=0;for(T=0;I-2>T;T+=2){var L=T,N=T+2,B=t.fromArray(x,3*L,f),F=t.fromArray(x,3*N,p);if(!t.equalsEpsilon(B,F,h.EPSILON6)){var z=T+1,V=T+3;O[R++]=z,O[R++]=L,O[R++]=z,O[R++]=V,O[R++]=L,O[R++]=N}}return O[R++]=I-2,O[R++]=I-1,new s({attributes:D,indices:O,primitiveType:d.LINES,boundingSphere:new e.fromVertices(x)})},v}),r("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},l.prototype.unproject=function(e,r){if(!i(e))throw new o("cartesian is required");var n=this._oneOverSemimajorAxis,a=e.x*n,s=l.mercatorAngleToGeodeticLatitude(e.y*n),u=e.z;return i(r)?(r.longitude=a,r.latitude=s,r.height=u,r):new t(a,s,u)},l}),r("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./TilingScheme","./WebMercatorProjection"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(i){if(i=t(i,{}),this._ellipsoid=t(i.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(i.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(i.numberOfLevelZeroTilesY,1),this._projection=new s(this._ellipsoid),r(i.rectangleSouthwestInMeters)&&r(i.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=i.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=i.rectangleNortheastInMeters;else{var a=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-a,-a),this._rectangleNortheastInMeters=new e(a,a)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)};return i(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),l.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<o.north||t.latitudeo.east)return void 0;var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,u=l/a,c=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,h=c/s,d=this._projection,m=d.project(t),f=m.x-this._rectangleSouthwestInMeters.x,p=this._rectangleNortheastInMeters.y-m.y,v=0|f/u;v>=a&&(v=a-1);var g=0|p/h;return g>=s&&(g=s-1),r(n)?(n.x=v,n.y=g,n):new e(v,g)},l}),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/deprecationWarning",["./defined","./DeveloperError"],function(e,t){"use strict";var r={},i=function(i,n){if(!e(i)||!e(n))throw new t("identifier and message are required.");e(r[i])||(r[i]=!0,console.log(n))};return i}),r("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(i){if(!t(i))throw new r("uri is required.");var n=new e(i);n.normalize();var o=n.path,a=o.lastIndexOf("/");return-1!==a&&(o=o.substr(a+1)),o};return i}),r("Core/jsonp",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(e,t,r){e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}var o=function(a,s){if(!r(a))throw new i("url is required.");s=t(s,t.EMPTY_OBJECT);var l,u=e.defer();do l="jsonp"+Math.random().toString().substring(2,8);while(r(window[l]));window[l]=function(e){u.resolve(e);try{delete window[l]}catch(t){window[l]=void 0}};var c=t(s.callbackParameterName,"callback"),h=[];n(h,c,l);var d=t(s.parameters,t.EMPTY_OBJECT);for(var m in d)d.hasOwnProperty(m)&&n(h,m,d[m]);h.length>0&&(a+=-1===a.indexOf("?")?"?":"&",a+=h.join("&"));var f=s.proxy;return r(f)&&(a=f.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/loadBlob",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"blob",headers:r})};return t}),r("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,r){"use strict";var i=/^data:/,n=function(n){return i.test(n)?r(n):t(n).then(function(t){var i=window.URL.createObjectURL(t);return r(i,!1).then(function(e){return e.blob=t,window.URL.revokeObjectURL(i),e},function(t){return window.URL.revokeObjectURL(i),e.reject(t)})})},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:r}),r("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r,i,a,s){var l,u,c=a-i+1,h=s-a,d=n,m=o;for(l=0;c>l;++l)d[l]=e[i+l];for(u=0;h>u;++u)m[u]=e[a+u+1];l=0,u=0;for(var f=i;s>=f;++f){var p=d[l],v=m[u];c>l&&(u>=h||t(p,v,r)<=0)?(e[f]=p,++l):h>u&&(e[f]=v,++u)}}function i(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));i(e,t,n,o,s),i(e,t,n,s+1,a),r(e,t,n,o,s,a)}}var n=[],o=[],a=function(r,a,s){if(!e(r))throw new t("array is required.");if(!e(a))throw new t("comparator is required.");var l=r.length,u=Math.ceil(.5*l);n.length=u,o.length=u,i(r,a,s,0,l-1),n.length=0,o.length=0};return a}),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/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i){var a,s=t.tilingScheme,l=[],u={};for(a=0;ai)throw new t("numberOfArrays must be greater than 0.");for(var n=[],o=r.length,a=0;o>a;){var s=Math.ceil((o-a)/i--);n.push(r.slice(a,a+s)),a+=s}return n};return r}),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 f=h.width,p=h.height,v=p/2;m.fillStyle="white",m.fillRect(-1,-1,f+2,p+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,f,p).data,_=0,y=4*f,w=g.length;++_0&&255===g[_];);var b=0|_/y;for(_=0;w>_&&255===g[_];)_+=y,_>=w&&(_=_-w+4);var S=0|_%y/4,x=1;for(_=w-3;_>=0&&255===g[_];)_-=y,0>_&&(_=w-3-4*x++);var E=0|_%y/4+1;o.ascent=v-C,o.descent=b-v,o.bounds={minx:S-d/2,maxx:E-d/2,miny:0,maxy:b-C},o.height=1+(b-C)}return o};return t}),r("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i,n){"use strict";var o=function(o,a){if(!i(o))throw new n("text is required.");if(""===o)return void 0;a=r(a,r.EMPTY_OBJECT);var s=r(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=r(a.textBaseline,"bottom"),l.style.visibility="hidden",document.body.appendChild(l);var c=r(a.stroke,!1),h=r(a.fill,!0),d=2*r(a.strokeWidth,1);u.lineWidth=d;var m=e(u,o,c,h);l.dimensions=m,document.body.removeChild(l),l.style.visibility="";var f=m.height-m.ascent;l.width=m.width,l.height=m.height;var p=l.height-f;if(u.font=s,c){var v=r(a.strokeColor,t.BLACK);u.strokeStyle=v.toCssColorString(),u.lineWidth=d,u.strokeText(o,0,p)}if(h){var g=r(a.fillColor,t.WHITE);u.fillStyle=g.toCssColorString(),u.fillText(o,0,p)}return l};return o}),r("DynamicScene/ConstantProperty",["../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/isArray"],function(e,t,r,i){"use strict";var n=function(e){this._value=void 0,this._simple=!0,this._definitionChanged=new r,this.setValue(e)};return e(n.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._simple?this._value:this._value.clone(t)},n.prototype.setValue=function(e){var r=this._value,n=this._simple;if(n&&r!==e||!n&&!r.equals(e)){if(n="object"!=typeof e||i(e),!n){if("function"!=typeof e.clone)throw new t("clone is a required function.");if("function"!=typeof e.equals)throw new t("equals is a required function.")}this._value=n?e:e.clone(),this._simple=n,this._definitionChanged.raiseEvent(this)}},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/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/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","./ConstantProperty","./createDynamicPropertyDescriptor","./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 a(e.WHITE))};return u.fromColor=function(e){if(!r(e))throw new n("color is required");return new u(new a(e))},i(u.prototype,{isConstant:{get:function(){return l.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:s("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){r(t)||(t=e()),this._availability=void 0,this._id=t,this._definitionChanged=new o,this._name=void 0,this._parent=void 0,this._propertyNames=["billboard","cone","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","position","pyramid","rectangle","vector","vertexPositions","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._cone=void 0,this._coneSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._orientationSubscription=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._position=void 0,this._positionSubscription=void 0,this._pyramid=void 0,this._pyramidSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._vector=void 0,this._vectorSubscription=void 0,this._vertexPositions=void 0,this._vertexPositionsSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0};return i(s.prototype,{availability:a("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},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))}},parent:a("parent"),propertyNames:{get:function(){return this._propertyNames}},billboard:a("billboard"),cone:a("cone"),description:a("description"),ellipse:a("ellipse"),ellipsoid:a("ellipsoid"),label:a("label"),model:a("model"),orientation:a("orientation"),path:a("path"),point:a("point"),polygon:a("polygon"),polyline:a("polyline"),position:a("position"),pyramid:a("pyramid"),rectangle:a("rectangle"),vector:a("vector"),vertexPositions:a("vertexPositions"),viewFrom:a("viewFrom"),wall:a("wall")}),s.prototype.isAvailable=function(e){if(!r(e))throw new n("time is required.");var t=this._availability;return!r(t)||t.contains(e)},s.prototype.addProperty=function(e){var t=this._propertyNames;if(!r(e))throw new n("propertyName is required.");if(-1!==t.indexOf(e))throw new n(e+" is already a registered property.");if(e in this)throw new n(e+" is a reserved property name.");t.push(e),Object.defineProperty(this,e,a(e,!0))},s.prototype.removeProperty=function(e){var t=this._propertyNames;if(!r(e))throw new n("propertyName is required.");if(-1===t.indexOf(e))throw new n(e+" is not a registered property.");this._propertyNames.push(e),delete this[e]},s.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)}},s}),r("DynamicScene/DynamicObjectCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./DynamicObject"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(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 d=function(){this._objects=new e,this._addedObjects=new e,this._removedObjects=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t()};return d.prototype.suspendEvents=function(){this._suspendCount++},d.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new n("resumeEvents can not be called before suspendEvents.");this._suspendCount--,h(this)},d.collectionChangedEventCallback=void 0,i(d.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}}}),d.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,i=this._objects.values,n=0,o=i.length;o>n;n++){var l=i[n],c=l.availability;if(r(c)){var h=c.start,d=c.stop;s.lessThan(h,e)&&!h.equals(a.MINIMUM_VALUE)&&(e=h),s.greaterThan(d,t)&&!d.equals(a.MAXIMUM_VALUE)&&(t=d)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new u(e,t,!0,!0)},d.prototype.add=function(e){if(!r(e))throw new n("dynamicObject is required.");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),h(this)},d.prototype.remove=function(e){if(!r(e))throw new n("dynamicObject is required");return this.removeById(e.id)},d.prototype.removeById=function(e){if(!r(e))throw new n("id is required.");var t=this._objects,i=t.get(e);return this._objects.remove(e)?(this._addedObjects.remove(e)||this._removedObjects.set(e,i),h(this),!0):!1},d.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(),h(this)},d.prototype.getById=function(e){if(!r(e))throw new n("id is required.");return this._objects.get(e)},d.prototype.getObjects=function(){return this._objects.values},d.prototype.getOrCreateObject=function(e){if(!r(e))throw new n("id is required.");var t=this._objects.get(e);return r(t)||(t=new c(e),this.add(t)),t},d}),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,t,r,i){m[0]=r,m[1]=i.id,t[JSON.stringify(m)]=i.definitionChanged.addEventListener(f.prototype._onDefinitionChanged,e)}function u(e,t,r,i){m[0]=r,m[1]=i.id;var n=JSON.stringify(m);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var r,i,n,c,h,d,m=e._collections,p=m.length,v=e._collectionsCopy,g=v.length,_=e._composite,y=new a,w=e._eventHash;for(r=0;g>r;r++)for(h=v[r],h.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,e),n=h.getObjects(),d=h.id,c=n.length-1;c>-1;c--)i=n[c],u(e,w,d,i);for(r=p-1;r>=0;r--)for(h=m[r],h.collectionChanged.addEventListener(f.prototype._onCollectionChanged,e),n=h.getObjects(),d=h.id,c=n.length-1;c>-1;c--){i=n[c],l(e,w,d,i);var C=y.getById(i.id);t(C)||(C=_.getById(i.id),t(C)?s(C):C=new o(i.id),y.add(C)),C.merge(i)}e._collectionsCopy=m.slice(0),_.suspendEvents(),_.removeAll();var b=y.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.")}n?this._collections.splice(r,0,e):(r=this._collections.length,this._collections.push(e)),c(this)},f.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t?(this._collections.splice(t,1),c(this),!0):!1},f.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},f.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},f.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},f.prototype.getCollection=function(e){if(!t(e))throw new i("index is required.","index");return this._collections[e]},f.prototype.getCollectionsLength=function(){return this._collections.length},f.prototype.raiseCollection=function(e){var t=h(this._collections,e);d(this,t,t+1)},f.prototype.lowerCollection=function(e){var t=h(this._collections,e);d(this,t,t-1)},f.prototype.raiseCollectionToTop=function(e){var t=h(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},f.prototype.lowerCollectionToBottom=function(e){var t=h(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},f.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},f.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new i("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},f.prototype.computeAvailability=function(){return this._composite.computeAvailability()},f.prototype.getById=function(e){return this._composite.getById(e)},f.prototype.getObjects=function(){return this._composite.getObjects()},f.prototype._onCollectionChanged=function(e,r,i){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var h,d,m,f,p=i.length,v=this._eventHash,g=e.id;for(h=0;p>h;h++){var _=i[h];u(this,v,g,_);var y=_.id;for(d=a-1;d>=0;d--)m=n[d].getById(y),t(m)&&(t(f)||(f=c.getById(y),s(f)),f.merge(m));t(f)||c.removeById(y)}var w=r.length;for(h=0;w>h;h++){var C=r[h];l(this,v,g,C);var b=C.id;for(d=a-1;d>=0;d--)m=n[d].getById(b),t(m)&&(t(f)||(f=c.getById(b),t(f)?s(f):(f=new o(b),c.add(f))),f.merge(m))}c.resumeEvents()},f.prototype._onDefinitionChanged=function(e,r){for(var i=this._collections,n=this._composite,o=i.length,a=e.id,s=n.getById(a),l=s[r],u=!0,c=o-1;c>=0;c--){var h=i[c].getById(e.id);if(t(h)){var d=h[r];if(t(d)){if(u){if(u=!1,!t(d.merge)||!t(d.clone)){l=d;break}l=d.clone(l)}l.merge(d)}}}s[r]=l},f}),r("DynamicScene/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(t,r,i,n){var o=function(){i.raiseEvent(t)},a=[];r.removeAll();for(var s=n.length,l=0;s>l;l++){var u=n.get(l);e(u.data)&&-1===a.indexOf(u.data)&&r.add(u.data.definitionChanged,o)}}var l=function(){this._eventHelper=new n,this._definitionChanged=new i,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)};return t(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(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},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.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){if(!e(t))throw new r("time is required");var i=this._composite._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getType(t):void 0},a.prototype.getValue=function(t,i){if(!e(t))throw new r("time is required");var n=this._composite._intervals.findDataForIntervalContainingDate(t);return e(n)?n.getValue(t,i):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,n){if(!t(e))throw new i("time is required.");if(!t(r))throw new i("referenceFrame is required.");var o=this._composite._intervals.findDataForIntervalContainingDate(e);return t(o)?o.getValueInReferenceFrame(e,r,n):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",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r,i){this._definitionChanged=new o,this._value=e.clone(r),this._referenceFrame=t(i,a.FIXED)};return i(l.prototype,{isConstant:{get:function(){return!r(this._value)||this._referenceFrame===a.FIXED}},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.setValue=function(t,i){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),r(i)&&this._referenceFrame!==i&&(n=!0,this._referenceFrame=i),n&&this._definitionChanged.raiseEvent(this)},l.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 s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),r("Scene/HorizontalOrigin",[],function(){"use strict";var e={CENTER:0,LEFT:1,RIGHT:-1};return e}),r("Scene/LabelStyle",[],function(){"use strict";var e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e}),r("Scene/VerticalOrigin",[],function(){"use strict";var e={CENTER:0,BOTTOM:1,TOP:-1};return e}),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(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","../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){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)},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/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(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/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(r){if(!t(r))throw new i("source is required.");this.rotation=e(this.rotation,r.rotation),this.semiMajorAxis=e(this.semiMajorAxis,r.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,r.semiMinorAxis),this.show=e(this.show,r.show),this.material=e(this.material,r.material),this.height=e(this.height,r.height),this.extrudedHeight=e(this.extrudedHeight,r.extrudedHeight),this.granularity=e(this.granularity,r.granularity),this.stRotation=e(this.stRotation,r.stRotation),this.fill=e(this.fill,r.fill),this.outline=e(this.outline,r.outline),this.outlineColor=e(this.outlineColor,r.outlineColor),this.numberOfVerticalLines=e(this.numberOfVerticalLines,r.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(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),this.fill=e(this.fill,r.fill),this.outline=e(this.outline,r.outline),this.outlineColor=e(this.outlineColor,r.outlineColor),this.stackPartitions=e(this.stackPartitions,r.stackPartitions),this.slicePartitions=e(this.slicePartitions,r.slicePartitions),this.subdivisions=e(this.subdivisions,r.subdivisions)},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(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/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._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=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"),minimumPixelSize:o("minimumPixelSize"),uri:o("uri")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.uri=this.uri,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.show=e(this.show,r.show),this.scale=e(this.scale,r.scale),this.minimumPixelSize=e(this.minimumPixelSize,r.minimumPixelSize),this.uri=e(this.uri,r.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._material=void 0,this._materialSubscription=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}},material:o("material"),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.material=this.material,e.width=this.width,e.resolution=this.resolution,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.material=e(this.material,r.material),this.width=e(this.width,r.width),this.resolution=e(this.resolution,r.resolution),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._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(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/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(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.height=e(this.height,r.height),this.extrudedHeight=e(this.extrudedHeight,r.extrudedHeight),this.granularity=e(this.granularity,r.granularity),this.stRotation=e(this.stRotation,r.stRotation),this.fill=e(this.fill,r.fill),this.outline=e(this.outline,r.outline),this.outlineColor=e(this.outlineColor,r.outlineColor),this.perPositionHeight=e(this.perPositionHeight,r.perPositionHeight)},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(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/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(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/DynamicRectangle",["../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._coordinates=void 0,this._coordinatesSubscription=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._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),coordinates:o("coordinates"),material:o("material"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),rotation:o("rotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),closeTop:o("closeTop"),closeBottom:o("closeBottom")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e},a.prototype.merge=function(r){if(!t(r))throw new i("source is required.");this.show=e(this.show,r.show),this.coordinates=e(this.coordinates,r.coordinates),this.material=e(this.material,r.material),this.height=e(this.height,r.height),this.extrudedHeight=e(this.extrudedHeight,r.extrudedHeight),this.granularity=e(this.granularity,r.granularity),this.stRotation=e(this.stRotation,r.stRotation),this.rotation=e(this.rotation,r.rotation),this.fill=e(this.fill,r.fill),this.outline=e(this.outline,r.outline),this.outlineColor=e(this.outlineColor,r.outlineColor),this.closeTop=e(this.closeTop,r.closeTop),this.closeBottom=e(this.closeBottom,r.closeBottom)},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(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/DynamicWall",["../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._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),minimumHeights:o("minimumHeights"),maximumHeights:o("maximumHeights"),granularity:o("granularity"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.material=this.material,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,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.minimumHeights=e(this.minimumHeights,r.minimumHeights),this.maximumHeights=e(this.maximumHeights,r.maximumHeights),this.granularity=e(this.granularity,r.granularity),this.fill=e(this.fill,r.fill),this.outline=e(this.outline,r.outline),this.outlineColor=e(this.outlineColor,r.outlineColor)},a}),r("DynamicScene/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./ConstantProperty","./createDynamicPropertyDescriptor","./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._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=new o(t.WHITE),this.cellAlpha=new o(.1),this.lineCount=new o(new e(8,8)),this.lineThickness=new o(new e(1,1)),this.lineOffset=new o(new e(0,0))};return i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),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.lineOffset=r(this._lineOffset)?this._lineOffset.getValue(e,t.lineOffset):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)&&s.equals(this._lineOffset,e._lineOffset)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/ImageMaterialProperty",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/Event","./ConstantProperty","./createDynamicPropertyDescriptor","./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 n(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:o("image"),repeat:o("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/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./ConstantProperty","./createDynamicPropertyDescriptor","./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 n(e.WHITE),this.outlineColor=new n(e.BLACK),this.outlineWidth=new n(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:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("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/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,n){if(!t(e))throw new i("time is required.");if(!t(r))throw new i("referenceFrame is required.");var o=this._value;if(!t(o))return void 0;var a=o.length;t(n)||(n=new Array(a));for(var s=0,l=0;a>s;){var u=o[s],c=u.getValueInReferenceFrame(e,r,n[s]);t(c)&&(n[l]=c,l++),s++}return n.length=l,n},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/RuntimeError","../Core/Event","./Property"],function(e,t,r,i,n,o){"use strict";function a(t){var r=t._targetProperty;if(!e(r)){var n=t._targetObject;if(!e(n)){var o=t._targetCollection;if(n=o.getById(t._targetId),!e(n))throw new i("target object could not be resolved.");n.definitionChanged.addEventListener(s.prototype._onTargetObjectDefinitionChanged,t),t._targetObject=n}var a=t._targetPropertyNames;r=n;for(var l=a.length,u=0;l>u;u++)if(r=r[a[u]],!e(r))throw new i("targetProperty could not be resolved.");t._targetProperty=r}return r}var s=function(t,i,o){if(!e(t))throw new r("targetCollection is required.");if(!e(i)||""===i)throw new r("targetId is required.");if(!e(o)||0===o.length)throw new r("targetPropertyNames is required.");for(var a=0;an;n++)if(t[n]!==r[n])return!1;return!0},s.prototype._onTargetObjectDefinitionChanged=function(e,t){this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))},s.prototype._onCollectionChanged=function(t,r,i){var n=this._targetObject;e(n)&&-1===i.indexOf(n)&&(n.definitionChanged.removeEventListener(s.prototype._onTargetObjectDefinitionChanged,this),this._targetProperty=void 0,this._targetObject=void 0,this._definitionChanged.raiseEvent(this))},s}),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):a.addSeconds(t,e,new a)}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,f,p,v,g,_=0;_f){for(f=~f,p=f*s,m=void 0,g=i[f];_=0||r(g)&&a.compare(v,g)>=0));){for(h[y++]=v,_+=1,c=0;s>c;c++)d[w++]=o[_],_+=1;m=v}y>0&&(d.length=w,l(n,p,d),h.length=y,l(i,f,h))}else{for(c=0;s>c;c++)_++,n[f*s+c]=o[_];_++}}},f=function(e,i){if(!r(e))throw new n("type is required.");var a=e;a===Number&&(a=c);var l,u=a.packedLength,h=t(a.packedInterpolationLength,u),d=0;if(r(i)){var m=i.length;l=new Array(m);for(var f=0;m>f;f++){var p=i[f];p===Number&&(p=c);var v=p.packedLength;u+=v,h+=t(p.packedInterpolationLength,v),l[f]=p}d=m}this._type=e,this._innerType=a,this._interpolationDegree=1,this._interpolationAlgorithm=s,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=h,this._updateTableLength=!0,this._interpolationResult=new Array(h),this._definitionChanged=new o,this._derivativeTypes=i,this._innerDerivativeTypes=l,this._inputOrder=d};return i(f.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}}}),f.prototype.getValue=function(t,i){if(!r(t))throw new n("time is required.");var o=this._innerType,s=this._times,l=this._values,u=e(s,t,a.compare);if(0>u){var c=this._xTable,h=this._yTable,d=this._interpolationAlgorithm,m=this._packedInterpolationLength,f=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var p=Math.min(d.getRequiredDataPoints(this._interpolationDegree,f),s.length);p!==this._numberOfPoints&&(this._numberOfPoints=p,c.length=p,h.length=p*m)}var v=this._numberOfPoints-1;if(1>v)return void 0;u=~u,u>=s.length&&(u=s.length-1);var g=0,_=s.length-1,y=_-g+1;if(v+1>y);else{var w=u-(0|v/2)-1;g>w&&(w=g);var C=w+v;C>_&&(C=_,w=C-v,g>w&&(w=g)),g=w,_=C}for(var b=_-g+1,S=0;b>S;++S)c[S]=a.getSecondsDifference(s[g+S],s[_]);if(r(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(l,g,_,h);else for(var x=0,E=this._packedLength,T=g*E,P=(_+1)*E;P>T;)h[x]=l[T],T++,x++;var A,M=a.getSecondsDifference(t,s[_]);if(0!==f&&r(d.interpolate)){var D=Math.floor(m/(f+1));A=d.interpolate(M,c,h,D,f,f,this._interpolationResult)}else A=d.interpolateOrderZero(M,c,h,m,this._interpolationResult);return r(o.unpackInterpolationResult)?o.unpackInterpolationResult(A,l,g,_,i):o.unpack(A,0,i)}return o.unpack(this._values,u*this._packedLength,i)},f.prototype.setInterpolationOptions=function(e){if(!r(e))throw new n("options is required.");var t=!1,i=e.interpolationAlgorithm,o=e.interpolationDegree;this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),this._interpolationDegree!==o&&(this._interpolationDegree=o,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},f.prototype.addSample=function(e,t,i){var o=this._innerDerivativeTypes,a=r(o);if(!r(e))throw new n("time is required.");if(!r(t))throw new n("value is required.");if(a&&!r(i))throw new n("derivatives is required.");var s=this._innerType,l=[];if(l.push(e),s.pack(t,l,l.length),a)for(var u=o.length,c=0;u>c;c++)o[c].pack(i[c],l,l.length);m(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},f.prototype.addSamples=function(e,t,i){var o=this._innerDerivativeTypes,a=r(o);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.");if(a&&(!r(i)||i.length!==e.length))throw new n("times and derivativeValues must be the same length.");for(var s=this._innerType,l=e.length,u=[],c=0;l>c;c++)if(u.push(e[c]),s.pack(t[c],u,u.length),a)for(var h=i[c],d=o.length,f=0;d>f;f++)o[f].pack(h[f],u,u.length);m(void 0,this._times,this._values,u,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},f.prototype.addSamplesPackedArray=function(e,t){if(!r(e))throw new n("packedSamples is required.");m(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},f.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,i=r(t),n=e._derivativeTypes,o=r(n);if(i!==o)return!1;var s,l;if(i){if(l=t.length,l!==n.length)return!1;for(s=0;l>s;s++)if(t[s]!==n[s])return!1}var u=this._times,c=e._times;if(l=u.length,l!==c.length)return!1;for(s=0;l>s;s++)if(!a.equals(u[s],c[s]))return!1;var h=this._values,d=e._values;for(s=0;l>s;s++)if(h[s]!==d[s])return!1;return!0},f._mergeNewSamples=m,f}),r("DynamicScene/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(r,i){i=t(i,0);var n;if(i>0){n=new Array(i);for(var s=0;i>s;s++)n[s]=e}this._numberOfDerivatives=i,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(r,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)};return i(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}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.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)?s.convertToReferenceFrame(e,i,this._referenceFrame,t,i):void 0},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,i){var o=this._numberOfDerivatives;if(o>0&&(!r(i)||i.length!==o))throw new n("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,i)},c.prototype.addSamples=function(e,t,r){this._property.addSamples(e,t,r)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),r("DynamicScene/StripeOrientation",[],function(){"use strict";var e={HORIZONTAL:0,VERTICAL:1};return e}),r("DynamicScene/StripeMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./ConstantProperty","./createDynamicPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){this._definitionChanged=new i,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=new n(s.HORIZONTAL),this.evenColor=new n(e.WHITE),this.oddColor=new n(e.BLACK),this.offset=new n(0),this.repeat=new n(1)};return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(){return"Stripe"},l.prototype.getValue=function(e,r){t(r)||(r={});var i=t(this._orientation)?this._orientation.getValue(e):void 0;return r.horizontal=t(i)?i===s.HORIZONTAL:void 0,r.evenColor=t(this._evenColor)?this._evenColor.getValue(e,r.evenColor):void 0,r.oddColor=t(this._oddColor)?this._oddColor.getValue(e,r.oddColor):void 0,r.offset=t(this._offset)?this._offset.getValue(e):void 0,r.repeat=t(this._repeat)?this._repeat.getValue(e):void 0,r},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)};return r(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,o.FIXED,t)},u.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)?s.convertToReferenceFrame(e,o,this._referenceFrame,r,n):void 0},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),r("DynamicScene/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/isArray","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._definitionChanged=new i,this._intervals=new o,this._intervals.changedEvent.addEventListener(s.prototype._intervalsChanged,this)};return t(s.prototype,{isConstant:{get:function(){return this._intervals.empty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),s.prototype.getValue=function(t,i){if(!e(t))throw new r("time is required");var o=this._intervals.findDataForIntervalContainingDate(t);return e(o)&&"object"==typeof o&&!n(o)?o.clone(i):o},s.prototype.equals=function(e){return this===e||e instanceof s&&this._intervals.equals(e._intervals,a.equals)},s.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},s}),r("DynamicScene/CzmlDataSource",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../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/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./createDynamicPropertyDescriptor","./DynamicBillboard","./DynamicClock","./DynamicCone","./DynamicEllipse","./DynamicEllipsoid","./DynamicLabel","./DynamicModel","./DynamicObject","./DynamicObjectCollection","./DynamicPath","./DynamicPoint","./DynamicPolygon","./DynamicPolyline","./DynamicPyramid","./DynamicRectangle","./DynamicVector","./DynamicWall","./GridMaterialProperty","./ImageMaterialProperty","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./ReferenceProperty","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I,O,R,L,N,B,F,z,V,q,k,U,W,G,H,j,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,mt,ft){"use strict";function pt(e,t){return"#"===t[0]&&(t=ir+t),lt.fromString(e,t)}function vt(e,t,r){return l(t)||l(r)?(e instanceof nr||(e=new nr),Et(Number,e,"x",t),Et(Number,e,"y",r),e):e}function gt(e){var t=e.rgbaf;if(l(t))return t;var r=e.rgba;if(!l(r))return void 0;if(r.length===o.length)return[o.byteToFloat(r[0]),o.byteToFloat(r[1]),o.byteToFloat(r[2]),o.byteToFloat(r[3])];var i=r.length;t=new Array(i);for(var n=0;i>n;n+=5)t[n]=r[n],t[n+1]=o.byteToFloat(r[n+1]),t[n+2]=o.byteToFloat(r[n+2]),t[n+3]=o.byteToFloat(r[n+3]),t[n+4]=o.byteToFloat(r[n+4]);return t}function _t(e,t){var r=s(e.image,e);if(l(t)){var i=new O(document.location.href);t=new O(t),r=new O(r).resolve(t.resolve(i)).toString()}return r}function yt(e,t){var r=s(e.uri,e);if(l(t)){var i=new O(document.location.href);t=new O(t),r=new O(r).resolve(t.resolve(i)).toString()}return r}function wt(e){var t=e.wsenDegrees;if(l(t)){for(var r=t.length,i=0;r>i;i++)t[i]=C.toRadians(t[i]);return t}return e.wsen}function Ct(e){if(l(e.cartesian))return e.cartesian;if(l(e.cartesianVelocity))return e.cartesianVelocity;if(l(e.unitCartesian))return e.unitCartesian;var r,i,n,o=e.unitSpherical;if(l(o)){if(i=o.length,2===i)ar.clock=o[0],ar.cone=o[1],t.fromSpherical(ar,or),n=[or.x,or.y,or.z];else{var a=0;for(n=new Array(4*(i/3)),r=0;i>r;r+=4)n[r]=o[a++],ar.clock=o[a++],ar.cone=o[a++],t.fromSpherical(ar,or),n[r+1]=or.x,n[r+2]=or.y,n[r+3]=or.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)sr.longitude=s[0],sr.latitude=s[1],sr.height=s[2],h.WGS84.cartographicToCartesian(sr,or),n=[or.x,or.y,or.z];else for(i=s.length,n=new Array(i),r=0;i>r;r+=4)sr.longitude=s[r+1],sr.latitude=s[r+2],sr.height=s[r+3],h.WGS84.cartographicToCartesian(sr,or),n[r]=s[r],n[r+1]=or.x,n[r+2]=or.y,n[r+3]=or.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new E(JSON.stringify(e)+" is not a valid CZML interval.");if(3===u.length)sr.longitude=C.toRadians(u[0]),sr.latitude=C.toRadians(u[1]),sr.height=u[2],h.WGS84.cartographicToCartesian(sr,or),n=[or.x,or.y,or.z];else for(i=u.length,n=new Array(i),r=0;i>r;r+=4)sr.longitude=C.toRadians(u[r+1]),sr.latitude=C.toRadians(u[r+2]),sr.height=u[r+3],h.WGS84.cartographicToCartesian(sr,or),n[r]=u[r],n[r+1]=or.x,n[r+2]=or.y,n[r+3]=or.z;return n}function bt(r,i,n){switch(r){case Boolean:return s(i["boolean"],i);case e:return i.cartesian2;case t:return Ct(i);case o:return gt(i);case dt:return dt[s(i.stripeOrientation,i)];case M:return M[s(i.horizontalOrigin,i)];case Image:return l(i.image)?_t(i,n):yt(i,n);case g:return g.fromIso8601(s(i.date,i));case D:return D[s(i.labelStyle,i)];case Number:return s(i.number,i);case String:return s(i.string,i);case Array:return i.array;case b:var a=i.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;uh),!d&&!_)return t[r]=p?pt(a,i.reference):l(e.unpack)?new V(e.unpack(m,0)):new V(m),void 0;var y,w=t[r],C=i.epoch;if(l(C)&&(y=g.fromIso8601(C)),d&&!_)return w instanceof ct||(w=new ct(e),t[r]=w),w.addSamplesPackedArray(m,y),St(i,w),void 0;var b;if(!d&&_)return u=u.clone(),u.data=p?pt(a,i.reference):l(e.unpack)?e.unpack(m,0):m,l(w)||(w=p?new F:new ft,t[r]=w),!p&&w instanceof ft?w.intervals.addInterval(u):w instanceof F?(u.data=p?u.data:new V(u.data),w.intervals.addInterval(u)):(b=v.MAXIMUM_INTERVAL.clone(),b.data=w,w=new F,t[r]=w,w.intervals.addInterval(b),u.data=p?u.data:new V(u.data),w.intervals.addInterval(u)),void 0;l(w)||(w=new F,t[r]=w),w instanceof F||(b=v.MAXIMUM_INTERVAL.clone(),b.data=w,w=new F,t[r]=w,w.intervals.addInterval(b));var S=w.intervals;b=S.findInterval(u.start,u.stop,u.isStartIncluded,u.isStopIncluded),l(b)&&b.data instanceof ct||(b=u.clone(),b.data=new ct(e),S.addInterval(b)),b.data.addSamplesPackedArray(m,y),St(i,b.data)}function Et(e,t,r,i,n,o,a){if(l(i))if(p(i))for(var s=0,u=i.length;u>s;s++)xt(e,t,r,i[s],n,o,a);else xt(e,t,r,i,n,o,a)}function Tt(e,r,i,n,o,a){var u,c=i.interval;l(c)?(u=P.fromIso8601(c),l(n)&&(u=u.intersect(n))):l(n)&&(u=n);var h,d,m,f=!1,p=l(i.cartesianVelocity)?1:0,_=t.packedLength*(p+1),y=l(i.reference),w=l(u)&&!u.equals(v.MAXIMUM_INTERVAL);if(y||(h=s(x[i.referenceFrame],void 0),d=Ct(i),m=s(d.length,1),f=m>_),!f&&!w)return e[r]=y?pt(a,i.reference):new z(t.unpack(d),h),void 0;var C,b=e[r],S=i.epoch;if(l(S)&&(C=g.fromIso8601(S)),f&&!w)return(!(b instanceof ut)||l(h)&&b.referenceFrame!==h)&&(b=new ut(h,p),e[r]=b),b.addSamplesPackedArray(d,C),St(i,b),void 0;var E;if(!f&&w)return u=u.clone(),u.data=y?pt(a,i.reference):t.unpack(d),l(b)||(b=y?new B(h):new mt(h),e[r]=b),!y&&b instanceof mt&&l(h)&&b.referenceFrame===h?b.intervals.addInterval(u):b instanceof B?(u.data=y?u.data:new z(u.data,h),b.intervals.addInterval(u)):(E=v.MAXIMUM_INTERVAL.clone(),E.data=b,b=new B(b.referenceFrame),e[r]=b,b.intervals.addInterval(E),u.data=y?u.data:new z(u.data,h),b.intervals.addInterval(u)),void 0;l(b)?b instanceof B||(E=v.MAXIMUM_INTERVAL.clone(),E.data=b,b=new B(b.referenceFrame),e[r]=b,b.intervals.addInterval(E)):(b=new B(h),e[r]=b);var T=b.intervals;E=T.findInterval(u.start,u.stop,u.isStartIncluded,u.isStopIncluded),l(E)&&E.data instanceof ut&&(!l(h)||E.data.referenceFrame===h)||(E=u.clone(),E.data=new ut(h,p),T.addInterval(E)),E.data.addSamplesPackedArray(d,C),St(i,E.data)}function Pt(e,t,r,i,n,o){if(l(r))if(p(r))for(var a=0,s=r.length;s>a;a++)Tt(e,t,r[a],i,n,o);else Tt(e,t,r,i,n,o)}function At(e,t,r,i,n,a){var s,u=r.interval;l(u)?(s=P.fromIso8601(u),l(i)&&(s=s.intersect(i))):l(i)&&(s=i);var c,h,d=e[t];if(l(s)){d instanceof N||(d=new N,e[t]=d);var m=d.intervals;h=m.findInterval(s.start,s.stop),l(h)?c=h.data:(h=s.clone(),m.addInterval(h))}else c=d;var f;l(r.solidColor)?(c instanceof L||(c=new L),f=r.solidColor,Et(o,c,"color",f.color,void 0,void 0,a)):l(r.grid)?(c instanceof nt||(c=new nt),f=r.grid,Et(o,c,"color",f.color,void 0,n,a),Et(Number,c,"cellAlpha",f.cellAlpha,void 0,n,a),c.lineThickness=vt(c.lineThickness,f.rowThickness,f.columnThickness,void 0,void 0,a),c.lineOffset=vt(c.lineOffset,f.rowOffset,f.columnOffset,void 0,void 0,a),c.lineCount=vt(c.lineCount,f.rowCount,f.columnCount,void 0,void 0,a)):l(r.image)?(c instanceof ot||(c=new ot),f=r.image,Et(Image,c,"image",f.image,void 0,n,a),c.repeat=vt(c.repeat,f.horizontalRepeat,f.verticalRepeat)):l(r.stripe)&&(c instanceof ht||(c=new ht),f=r.stripe,Et(dt,c,"orientation",f.orientation,void 0,n,a),Et(o,c,"evenColor",f.evenColor,void 0,n,a),Et(o,c,"oddColor",f.oddColor,void 0,n,a),Et(Number,c,"offset",f.offset,void 0,n,a),Et(Number,c,"repeat",f.repeat,void 0,n,a)),l(h)?h.data=c:e[t]=c}function Mt(e,t,r,i,n,o){if(l(r))if(p(r))for(var a=0,s=r.length;s>a;a++)At(e,t,r[a],i,n,o);else At(e,t,r,i,n,o)}function Dt(e,t){e.name=s(t.name,e.name)}function It(e,t,r,i){var n=t.description;l(n)&&Et(String,e,"description",n,void 0,i,r)}function Ot(e,t,r,i){var n=t.position;l(n)&&Pt(e,"position",n,void 0,i,r)}function Rt(e,r,i,n){var o=r.viewFrom;l(o)&&Et(t,e,"viewFrom",o,void 0,n,i)}function Lt(e,t,r,i){var n=t.orientation;l(n)&&Et(b,e,"orientation",n,void 0,i,r)}function Nt(e,r,i){var n,o,a=r.references;if(l(a)){var s=[];for(n=0,o=a.length;o>n;n++)s.push(pt(i,a[n]));var u=r.interval;l(u)?(u=P.fromIso8601(u),e.vertexPositions instanceof B||(e.vertexPositions=new B,u.data=new st(s),e.vertexPositions.intervals.addInterval(u))):e.vertexPositions=new st(s)}else{var c=[],d=r.cartesian;if(l(d)){for(n=0,o=d.length;o>n;n+=3)c.push(new t(d[n],d[n+1],d[n+2]));r.array=c}else if(d=r.cartographicRadians,l(d)){for(n=0,o=d.length;o>n;n+=3)sr.longitude=d[n],sr.latitude=d[n+1],sr.height=d[n+2],c.push(h.WGS84.cartographicToCartesian(sr));r.array=c}else if(d=r.cartographicDegrees,l(d)){for(n=0,o=d.length;o>n;n+=3)c.push(t.fromDegrees(d[n],d[n+1],d[n+2]));r.array=c}l(r.array)&&Et(Array,e,"vertexPositions",r,void 0,void 0,i)}}function Bt(e,t,r){var i=t.vertexPositions;if(l(i))if(p(i))for(var n=i.length,o=0;n>o;o++)Nt(e,i[o],r);else Nt(e,i,r)}function Ft(e,t){var r,i=t.availability;if(l(i)){var n;if(p(i))for(var o=i.length,a=0;o>a;a++)l(n)||(n=new A),r=P.fromIso8601(i[a]),n.addInterval(r); else r=P.fromIso8601(i),n=new A,n.addInterval(r);e.availability=n}}function zt(r,i,n,a){var s=i.billboard;if(l(s)){var u=s.interval;l(u)&&(u=P.fromIso8601(u));var c=r.billboard;l(c)||(r.billboard=c=new k),Et(o,c,"color",s.color,u,a,n),Et(t,c,"eyeOffset",s.eyeOffset,u,a,n),Et(M,c,"horizontalOrigin",s.horizontalOrigin,u,a,n),Et(Image,c,"image",s.image,u,a,n),Et(e,c,"pixelOffset",s.pixelOffset,u,a,n),Et(Number,c,"scale",s.scale,u,a,n),Et(Number,c,"rotation",s.rotation,u,a,n),Et(t,c,"alignedAxis",s.alignedAxis,u,a,n),Et(Boolean,c,"show",s.show,u,a,n),Et(I,c,"verticalOrigin",s.verticalOrigin,u,a,n)}}function Vt(e,t){var r=t.clock;if(l(r)&&"document"===e.id){var o=e.clock;if(l(o)||(o=new U,o.startTime=v.MAXIMUM_INTERVAL.start,o.stopTime=v.MAXIMUM_INTERVAL.stop,o.clockRange=i.LOOP_STOP,o.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=1,e.clock=o),l(r.interval)){var a=P.fromIso8601(r.interval);o.startTime=a.start,o.stopTime=a.stop}l(r.currentTime)&&(o.currentTime=g.fromIso8601(r.currentTime)),l(r.range)&&(o.clockRange=i[r.range]),l(r.step)&&(o.clockStep=n[r.step]),l(r.multiplier)&&(o.multiplier=r.multiplier)}}function qt(e,t,r,i){var n=t.cone;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.cone;l(s)||(e.cone=s=new W),Et(Boolean,s,"show",n.show,a,i,r),Et(Number,s,"radius",n.radius,a,i,r),Et(Boolean,s,"showIntersection",n.showIntersection,a,i,r),Et(o,s,"intersectionColor",n.intersectionColor,a,i,r),Et(Number,s,"intersectionWidth",n.intersectionWidth,a,i,r),Et(Number,s,"innerHalfAngle",n.innerHalfAngle,a,i,r),Et(Number,s,"outerHalfAngle",n.outerHalfAngle,a,i,r),Et(Number,s,"minimumClockAngle",n.minimumClockAngle,a,i,r),Et(Number,s,"maximumClockAngle",n.maximumClockAngle,a,i,r),Mt(s,"capMaterial",n.capMaterial,a,i,r),Mt(s,"innerMaterial",n.innerMaterial,a,i,r),Mt(s,"outerMaterial",n.outerMaterial,a,i,r),Mt(s,"silhouetteMaterial",n.silhouetteMaterial,a,i,r)}}function kt(e,t,r,i){var n=t.ellipse;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.ellipse;l(s)||(e.ellipse=s=new G),Et(Boolean,s,"show",n.show,a,i,r),Et(Number,s,"rotation",n.rotation,a,i,r),Et(Number,s,"semiMajorAxis",n.semiMajorAxis,a,i,r),Et(Number,s,"semiMinorAxis",n.semiMinorAxis,a,i,r),Et(Number,s,"height",n.height,a,i,r),Et(Number,s,"extrudedHeight",n.extrudedHeight,a,i,r),Et(Number,s,"granularity",n.granularity,a,i,r),Et(Number,s,"stRotation",n.stRotation,a,i,r),Mt(s,"material",n.material,a,i,r),Et(Boolean,s,"fill",n.fill,a,i,r),Et(Boolean,s,"outline",n.outline,a,i,r),Et(o,s,"outlineColor",n.outlineColor,a,i,r),Et(Number,s,"numberOfVerticalLines",n.numberOfVerticalLines,a,i,r)}}function Ut(e,r,i,n){var a=r.ellipsoid;if(l(a)){var s=a.interval;l(s)&&(s=P.fromIso8601(s));var u=e.ellipsoid;l(u)||(e.ellipsoid=u=new H),Et(Boolean,u,"show",a.show,s,n,i),Et(t,u,"radii",a.radii,s,n,i),Mt(u,"material",a.material,s,n,i),Et(Boolean,u,"fill",a.fill,s,n,i),Et(Boolean,u,"outline",a.outline,s,n,i),Et(o,u,"outlineColor",a.outlineColor,s,n,i)}}function Wt(r,i,n,a){var s=i.label;if(l(s)){var u=s.interval;l(u)&&(u=P.fromIso8601(u));var c=r.label;l(c)||(r.label=c=new j),Et(o,c,"fillColor",s.fillColor,u,a,n),Et(o,c,"outlineColor",s.outlineColor,u,a,n),Et(Number,c,"outlineWidth",s.outlineWidth,u,a,n),Et(t,c,"eyeOffset",s.eyeOffset,u,a,n),Et(M,c,"horizontalOrigin",s.horizontalOrigin,u,a,n),Et(String,c,"text",s.text,u,a,n),Et(e,c,"pixelOffset",s.pixelOffset,u,a,n),Et(Number,c,"scale",s.scale,u,a,n),Et(Boolean,c,"show",s.show,u,a,n),Et(I,c,"verticalOrigin",s.verticalOrigin,u,a,n),Et(String,c,"font",s.font,u,a,n),Et(D,c,"style",s.style,u,a,n)}}function Gt(e,t,r,i){var n=t.model;if("undefined"!=typeof n){var o=n.interval;l(o)&&(o=P.fromIso8601(o));var a=e.model;l(a)||(e.model=a=new Y),Et(Boolean,a,"show",n.show,o,i,r),Et(Number,a,"scale",n.scale,o,i,r),Et(Number,a,"minimumPixelSize",n.minimumPixelSize,o,i,r),Et(O,a,"uri",n.gltf,o,i,r)}}function Ht(e,t,r,i){var n=t.path;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.path;l(s)||(e.path=s=new J);var u=s.material;if(l(a)){var c,h=u;h instanceof N||(h=new N,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 at,c=a.clone(),c.data=u,h.intervals.addInterval(c))}else u instanceof at||(u=new at,s.material=u);Et(Boolean,s,"show",n.show,a,i,r),Et(Number,s,"width",n.width,a,i,r),Et(Number,s,"resolution",n.resolution,a,i,r),Et(Number,s,"leadTime",n.leadTime,a,i,r),Et(Number,s,"trailTime",n.trailTime,a,i,r),Et(o,u,"color",n.color,a,i,r),Et(o,u,"outlineColor",n.outlineColor,a,i,r),Et(Number,u,"outlineWidth",n.outlineWidth,a,i,r)}}function jt(e,t,r,i){var n=t.point;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.point;l(s)||(e.point=s=new Q),Et(o,s,"color",n.color,a,i,r),Et(Number,s,"pixelSize",n.pixelSize,a,i,r),Et(o,s,"outlineColor",n.outlineColor,a,i,r),Et(Number,s,"outlineWidth",n.outlineWidth,a,i,r),Et(Boolean,s,"show",n.show,a,i,r)}}function Yt(e,t,r,i){var n=t.polygon;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.polygon;l(s)||(e.polygon=s=new K),Et(Boolean,s,"show",n.show,a,i,r),Mt(s,"material",n.material,a,i,r),Et(Number,s,"height",n.height,a,i,r),Et(Number,s,"extrudedHeight",n.extrudedHeight,a,i,r),Et(Number,s,"granularity",n.granularity,a,i,r),Et(Number,s,"stRotation",n.stRotation,a,i,r),Et(Boolean,s,"fill",n.fill,a,i,r),Et(Boolean,s,"outline",n.outline,a,i,r),Et(o,s,"outlineColor",n.outlineColor,a,i,r),Et(Boolean,s,"perPositionHeight",n.perPositionHeight,a,i,r)}}function Xt(e,t,r,i){var n=t.rectangle;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.rectangle;l(s)||(e.rectangle=s=new tt),Et(Boolean,s,"show",n.show,a,i,r),Et(S,s,"coordinates",n.coordinates,a,i,r),Mt(s,"material",n.material,a,i,r),Et(Number,s,"height",n.height,a,i,r),Et(Number,s,"extrudedHeight",n.extrudedHeight,a,i,r),Et(Number,s,"granularity",n.granularity,a,i,r),Et(Number,s,"rotation",n.rotation,a,i,r),Et(Number,s,"stRotation",n.stRotation,a,i,r),Et(Boolean,s,"fill",n.fill,a,i,r),Et(Boolean,s,"outline",n.outline,a,i,r),Et(o,s,"outlineColor",n.outlineColor,a,i,r),Et(Boolean,s,"closeBottom",n.closeBottom,a,i,r),Et(Boolean,s,"closeTop",n.closeTop,a,i,r)}}function Zt(e,t,r,i){var n=t.wall;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.wall;l(s)||(e.wall=s=new it),Et(Boolean,s,"show",n.show,a,i,r),Mt(s,"material",n.material,a,i,r),Et(Array,s,"minimumHeights",n.minimumHeights,a,i,r),Et(Array,s,"maximumHeights",n.maximumHeights,a,i,r),Et(Number,s,"granularity",n.granularity,a,i,r),Et(Boolean,s,"fill",n.fill,a,i,r),Et(Boolean,s,"outline",n.outline,a,i,r),Et(o,s,"outlineColor",n.outlineColor,a,i,r)}}function Jt(e,t,r,i){var n=t.polyline;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.polyline;l(s)||(e.polyline=s=new $);var u=s.material;if(l(a)){var c,h=u;h instanceof N||(h=new N,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 at,c=a.clone(),c.data=u,h.intervals.addInterval(c))}else u instanceof at||(u=new at,s.material=u);Et(Boolean,s,"show",n.show,a,i,r),Et(Number,s,"width",n.width,a,i,r),Et(o,u,"color",n.color,a,i,r),Et(o,u,"outlineColor",n.outlineColor,a,i,r),Et(Number,u,"outlineWidth",n.outlineWidth,a,i,r)}}function Qt(e,r,i,n,o){var a,s,u=[],c=r.unitSpherical;if(l(c)){for(a=0,s=c.length;s>a;a+=2)u.push(new T(c[a],c[a+1]));r.array=u}if(c=r.unitCartesian,l(c)){for(a=0,s=c.length;s>a;a+=3)u.push(T.fromCartesian3(new t(c[a],c[a+1],c[a+2])));r.array=u}Et(Array,e,"directions",r,i,n,o)}function Kt(e,t,r,i){var n=t.pyramid;if(l(n)){var a=n.interval;l(a)&&(a=P.fromIso8601(a));var s=e.pyramid;l(s)||(e.pyramid=s=new et),Et(Boolean,s,"show",n.show,a,i,r),Et(Number,s,"radius",n.radius,a,i,r),Et(Boolean,s,"showIntersection",n.showIntersection,a,i,r),Et(o,s,"intersectionColor",n.intersectionColor,a,i,r),Et(Number,s,"intersectionWidth",n.intersectionWidth,a,i,r),Mt(s,"material",n.material,a,i,r);var u=n.directions;if(l(u))if(p(u))for(var c=u.length,h=0;c>h;h++)Qt(s,u[h],a,i,r);else Qt(s,u,a,i,r)}}function $t(e,r,i,n){var a=r.vector;if(l(a)){var s=a.interval;l(s)&&(s=P.fromIso8601(s));var u=e.vector;l(u)||(e.vector=u=new rt),Et(o,u,"color",a.color,s,n,i),Et(Boolean,u,"show",a.show,s,n,i),Et(Number,u,"width",a.width,s,n,i),Et(t,u,"direction",a.direction,s,n,i),Et(Number,u,"length",a.length,s,n,i)}}function er(e,t,r,i,n){var o=e.id;if(l(o)||(o=a()),ir=o,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)}ir=void 0}function tr(e,t,r){var o=e._dynamicObjectCollection;o.suspendEvents(),ur._processCzml(t,o,r,void 0,e);var a,s=e._document,u=!1;if(l(s.clock))a=s.clock;else{var c=o.computeAvailability();if(!c.start.equals(v.MINIMUM_VALUE)){var h=c.start,d=c.stop,f=g.getSecondsDifference(d,h),p=Math.round(f/120);a=new U,a.startTime=h,a.stopTime=d,a.clockRange=i.LOOP_STOP,a.multiplier=p,a.currentTime=h,a.clockStep=n.SYSTEM_CLOCK_MULTIPLIER}}l(a)&&(l(e._clock)||(e._clock=new U,u=!0),a.equals(e._clock)||(a.clone(e._clock),u=!0));var _;l(s.name)?_=s.name:l(r)&&(_=m(r)),e._name!==_&&(e._name=_,u=!0),o.resumeEvents(),u&&e._changed.raiseEvent(e)}function rr(e,t){e._isLoading!==t&&(e._isLoading=t,e._loading.raiseEvent(e,t))}var ir,nr=function(){this._definitionChanged=new d,this._x=void 0,this._xSubscription=void 0,this._y=void 0,this._ySubscription=void 0,this.x=new V(0),this.y=new V(.1)};u(nr.prototype,{isConstant:{get:function(){return this._x.isConstant&&this._y.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},x:q("x"),y:q("y")}),nr.prototype.getValue=function(t,r){return l(r)||(r=new e),r.x=this._x.getValue(t),r.y=this._y.getValue(t),r},nr.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var or=new t,ar=new T,sr=new r,lr={HERMITE:f,LAGRANGE:_,LINEAR:y},ur=function(e){this._name=e,this._changed=new d,this._error=new d,this._isLoading=!1,this._loading=new d,this._clock=void 0,this._dynamicObjectCollection=new Z,this._document=new X};return u(ur.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},dynamicObjects:{get:function(){return this._dynamicObjectCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),ur.updaters=[Vt,zt,kt,Ut,qt,Wt,Gt,Dt,It,Ht,jt,Yt,Jt,Kt,Xt,$t,Ot,Rt,Zt,Lt,Bt,Ft],ur.prototype.process=function(e,t){if(!l(e))throw new c("czml is required.");tr(this,e,t)},ur.prototype.load=function(e,t){if(!l(e))throw new c("czml is required.");this._document=new X("document"),this._dynamicObjectCollection.removeAll(),tr(this,e,t)},ur.prototype.processUrl=function(e){if(!l(e))throw new c("url is required.");rr(this,!0);var t=this;return R(w(e),function(r){t.process(r,e),rr(t,!1)},function(e){return rr(t,!1),t._error.raiseEvent(t,e),R.reject(e)})},ur.prototype.loadUrl=function(e){if(!l(e))throw new c("url is required.");rr(this,!0);var t=this;return R(w(e),function(r){t.load(r,e),rr(t,!1)},function(e){return rr(t,!1),t._error.raiseEvent(t,e),R.reject(e)})},ur.processPacketData=Et,ur.processPositionPacketData=Pt,ur.processMaterialPacketData=Mt,ur._processCzml=function(e,t,r,i,n){if(i=l(i)?i:ur.updaters,p(e))for(var o=0,a=e.length;a>o;o++)er(e[o],t,i,r,n);else er(e,t,i,r,n)},ur}),r("DynamicScene/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return e(r.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},dynamicObjects:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError}}),r.prototype.update=t.throwInstantiationError,r}),r("DynamicScene/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event"],function(e,t,r,i,n,o){"use strict";var a=function(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o};return r(a.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),a.prototype.add=function(e){if(!t(e))throw new n("dataSource is required.");this._dataSources.push(e),this._dataSourceAdded.raiseEvent(this,e)},a.prototype.remove=function(t,r){r=e(r,!1);var i=this._dataSources.indexOf(t);return-1!==i?(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,t),r&&"function"==typeof t.destroy&&t.destroy(),!0):!1},a.prototype.removeAll=function(t){t=e(t,!1);for(var r=this._dataSources,i=0,n=r.length;n>i;++i){var o=r[i];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}r.length=0},a.prototype.contains=function(e){return-1!==this.indexOf(e)},a.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},a.prototype.get=function(e){if(!t(e))throw new n("index is required.");return this._dataSources[e]},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(!0),i(this)},a}),r("Renderer/BufferUsage",[],function(){"use strict";var e={STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,validate:function(t){return t===e.STREAM_DRAW||t===e.STATIC_DRAW||t===e.DYNAMIC_DRAW}};return e}),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("Renderer/DrawCommand",["../Core/defaultValue","../Core/PrimitiveType"],function(e,t){"use strict";var r=function(r){r=e(r,e.EMPTY_OBJECT),this.boundingVolume=r.boundingVolume,this.cull=e(r.cull,!0),this.modelMatrix=r.modelMatrix,this.primitiveType=e(r.primitiveType,t.TRIANGLES),this.vertexArray=r.vertexArray,this.count=r.count,this.offset=e(r.offset,0),this.shaderProgram=r.shaderProgram,this.uniformMap=r.uniformMap,this.renderState=r.renderState,this.framebuffer=r.framebuffer,this.pass=r.pass,this.executeInClosestFrustum=e(r.executeInClosestFrustum,!1),this.owner=r.owner,this.debugShowBoundingVolume=e(r.debugShowBoundingVolume,!1),this.debugOverlappingFrustums=0,this.oit=void 0};return r.prototype.execute=function(e,t,r,i){e.draw(this,t,r,i)},r}),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.sizeInBytes0){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(t,i,o){function s(t,r){return e.getSizeInBytes(r.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}if(!t)throw new n("context is required.");if(!i||0===i.length)throw new n("At least one attribute is required.");var l=c._verifyAttributes(i);o=o||0;for(var u,h,d,m,f={},p=[],v=l.length,g=0;v>g;++g){var _=l[g];_.vertexBuffer?p.push(_):(d=_.purpose,u=f[d],r(u)||(u=f[d]={}),m=_.usage,h=u[m],r(h)||(h=u[m]=[]),h.push(_))}this._buffersByPurposeAndUsage={},this._allBuffers=[];for(d in f)if(f.hasOwnProperty(d)){u=f[d];var y=this._buffersByPurposeAndUsage[d];r(y)||(y=this._buffersByPurposeAndUsage[d]={});for(m in u)if(u.hasOwnProperty(m)){h=u[m],h.sort(s);var w,C=c._vertexSizeInBytes(h);switch(Number(m)){case a.STATIC_DRAW:w=a.STATIC_DRAW;break;case a.STREAM_DRAW:w=a.STREAM_DRAW;break;case a.DYNAMIC_DRAW:w=a.DYNAMIC_DRAW}var b={purpose:d,vertexSizeInBytes:C,vertexBuffer:void 0,usage:w,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(h,C)};y[m]=b,this._allBuffers.push(b)}}this._size=0,this._precreated=p,this._context=t,this.writers=void 0,this.vaByPurpose=void 0,this.resize(o)};c._verifyAttributes=function(i){for(var o=[],s=0;sn;++n){var o=t[n];r+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=i>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?r%a:0,l=0===s?0:a-s;return r+=l},c._createArrayViews=function(t,r){for(var i=[],n=0,o=t.length,a=0;o>a;++a){var s=t[a],l=s.componentDatatype;i.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:r/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return i},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,i){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(i*t.vertexSizeInBytes);if(r(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;s>l;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,h=0;c>h;++h){var d=u[h];d.view=e.createArrayBufferView(d.componentDatatype,n,d.offsetInBytes)}t.arrayBuffer=n}};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],f=[],p=Math.ceil(this._size/o.SIXTY_FOUR_KILOBYTES),v=0;p>v;++v){var g=[],_=h.all;if(_!==m)for(var y in _)if(_.hasOwnProperty(y)){var w=_[y];c._appendAttributes(g,w,v*w.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES)}for(var C in m)m.hasOwnProperty(C)&&(t=m[C],c._appendAttributes(g,t,v*t.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES));g=g.concat(this._precreated),f.push({va:this._context.createVertexArray(g,e),indicesCount:1.5*(v!==p-1?o.SIXTY_FOUR_KILOBYTES:this._size%o.SIXTY_FOUR_KILOBYTES)})}this.vaByPurpose[d]=f}}},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("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("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\nuniform bool u_sizeReal;\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);\nif (u_sizeReal) {\nscale /= length(positionEC.zw);\n}\nvec2 halfSize = imageSize * scale * czm_resolutionScale;\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_resolutionScale);\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("Scene/SceneMode",[],function(){"use strict";var e={SCENE2D:0,COLUMBUS_VIEW:1,SCENE3D:2,MORPHING:3};return e.getMorphTime=function(t){return t===e.SCENE3D?1:t===e.MORPHING?void 0:0},e}),r("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c,h={},d=new i(0,0,0,1),m=new i;h.wgs84ToWindowCoordinates=function(e,t,r){if(!o(e))throw new a("scene is required.");if(!o(t))throw new a("position is required.");if(h.computeActualWgs84Position(e.frameState,t,d),!o(d))return r=void 0,void 0;var i=e.camera;return c=l.multiply(i.frustum.projectionMatrix,i.viewMatrix,c),l.multiplyByVector(c,d,m),h.clipToWindowCoordinates(e,m,r)},h.wgs84ToDrawingBufferCoordinates=function(e,t,r){if(!o(e))throw new a("scene is required.");if(!o(t))throw new a("position is required.");if(h.computeActualWgs84Position(e.frameState,t,d),!o(d))return void 0;var n=e.context.uniformState.viewProjection;return l.multiplyByVector(n,i.fromElements(d.x,d.y,d.z,1,m),m),h.clipToDrawingBufferCoordinates(e,m,r)};var f=new r,p=new n;h.computeActualWgs84Position=function(e,t,i){var n=e.mode;if(n===u.SCENE3D)return r.clone(t,i);var a=e.mapProjection;if(a.ellipsoid.cartesianToCartographic(t,p),!o(p))return i=void 0;if(a.project(p,f),n===u.COLUMBUS_VIEW)return r.fromElements(f.z,f.x,f.y,i);if(n===u.SCENE2D)return r.fromElements(0,f.x,f.y,i);var l=e.morphTime;return r.fromElements(s.lerp(f.z,t.x,l),s.lerp(f.x,t.y,l),s.lerp(f.y,t.z,l),i)};var v=new r,g=new r,_=new e,y=new l;return h.clipToWindowCoordinates=function(e,i,n){var o=e.canvas;return r.divideByScalar(i,i.w,v),_.width=o.clientWidth,_.height=o.clientHeight,l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,n)},h.clipToDrawingBufferCoordinates=function(e,i,n){return r.divideByScalar(i,i.w,v),_.width=e.drawingBufferWidth,_.height=e.drawingBufferHeight,l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,n)},h.transformWindowToDrawingBuffer=function(e,r,i){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(r.x*o,r.y*a,i)},h}),r("Scene/Billboard",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/NearFarScalar","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function f(e,t){var r=e._billboardCollection;o(r)&&(r._updateBillboard(e,t),e._dirty=!0)}var p=function(r,a){if(r=n(r,n.EMPTY_OBJECT),o(r.scaleByDistance)&&r.scaleByDistance.far<=r.scaleByDistance.near)throw new s("scaleByDistance.far must be greater than scaleByDistance.near.");if(o(r.translucencyByDistance)&&r.translucencyByDistance.far<=r.translucencyByDistance.near)throw new s("translucencyByDistance.far must be greater than translucencyByDistance.near.");if(o(r.pixelOffsetScaleByDistance)&&r.pixelOffsetScaleByDistance.far<=r.pixelOffsetScaleByDistance.near)throw new s("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");this._show=n(r.show,!0),this._position=t.clone(n(r.position,t.ZERO)),this._actualPosition=t.clone(this._position),this._pixelOffset=e.clone(n(r.pixelOffset,e.ZERO),new e),this._translate=new e(0,0),this._eyeOffset=t.clone(n(r.eyeOffset,t.ZERO)),this._verticalOrigin=n(r.verticalOrigin,m.CENTER),this._horizontalOrigin=n(r.horizontalOrigin,c.CENTER),this._scale=n(r.scale,1),this._imageIndex=n(r.imageIndex,-1),this._color=i.clone(n(r.color,i.WHITE)),this._rotation=n(r.rotation,0),this._alignedAxis=t.clone(n(r.alignedAxis,t.ZERO)),this._width=r.width,this._height=r.height,this._scaleByDistance=r.scaleByDistance,this._translucencyByDistance=r.translucencyByDistance,this._pixelOffsetScaleByDistance=r.pixelOffsetScaleByDistance,this._id=r.id,this._collection=n(r.collection,a),this._pickId=void 0,this._pickPrimitive=n(r._pickPrimitive,this),this._billboardCollection=a,this._dirty=!1,this._index=-1},v=p.SHOW_INDEX=0,g=p.POSITION_INDEX=1,_=p.PIXEL_OFFSET_INDEX=2,y=p.EYE_OFFSET_INDEX=3,w=p.HORIZONTAL_ORIGIN_INDEX=4,C=p.VERTICAL_ORIGIN_INDEX=5,b=p.SCALE_INDEX=6,S=p.IMAGE_INDEX_INDEX=7,x=p.COLOR_INDEX=8,E=p.ROTATION_INDEX=9,T=p.ALIGNED_AXIS_INDEX=10,P=p.SCALE_BY_DISTANCE_INDEX=11,A=p.TRANSLUCENCY_BY_DISTANCE_INDEX=12,M=p.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;p.NUMBER_OF_PROPERTIES=14,a(p.prototype,{show:{get:function(){return this._show},set:function(e){if(!o(e))throw new s("value is required.");e!==this._show&&(this._show=e,f(this,v))}},position:{get:function(){return this._position},set:function(e){if(!o(e))throw new s("value is required.");var r=this._position;t.equals(r,e)||(t.clone(e,r),t.clone(e,this._actualPosition),f(this,g))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(t){if(!o(t))throw new s("value is required.");var r=this._pixelOffset;e.equals(r,t)||(e.clone(t,r),f(this,_))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(!u.equals(this._scaleByDistance,e)){if(e.far<=e.near)throw new s("far distance must be greater than near distance.");f(this,P),this._scaleByDistance=u.clone(e,this._scaleByDistance)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(!u.equals(this._translucencyByDistance,e)){if(e.far<=e.near)throw new s("far distance must be greater than near distance."); f(this,A),this._translucencyByDistance=u.clone(e,this._translucencyByDistance)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(!u.equals(this._pixelOffsetScaleByDistance,e)){if(e.far<=e.near)throw new s("far distance must be greater than near distance.");f(this,M),this._pixelOffsetScaleByDistance=u.clone(e,this._pixelOffsetScaleByDistance)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!o(e))throw new s("value is required.");var r=this._eyeOffset;t.equals(r,e)||(t.clone(e,r),f(this,y))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!o(e))throw new s("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,f(this,w))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!o(e))throw new s("value is required.");this._verticalOrigin!==e&&(this._verticalOrigin=e,f(this,C))}},scale:{get:function(){return this._scale},set:function(e){if(!o(e))throw new s("value is required.");this._scale!==e&&(this._scale=e,f(this,b))}},imageIndex:{get:function(){return this._imageIndex},set:function(e){if("number"!=typeof e)throw new s("value is required and must be a number.");this._imageIndex!==e&&(this._imageIndex=e,f(this,S))}},color:{get:function(){return this._color},set:function(e){if(!o(e))throw new s("value is required.");var t=this._color;i.equals(t,e)||(i.clone(e,t),f(this,x))}},rotation:{get:function(){return this._rotation},set:function(e){if(!o(e))throw new s("value is required.");this._rotation!==e&&(this._rotation=e,f(this,E))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){if(!o(e))throw new s("value is required.");var r=this._alignedAxis;t.equals(r,e)||(t.clone(e,r),f(this,T))}},width:{get:function(){return this._width},set:function(e){this._width!==e&&(this._width=e,f(this,S))}},height:{get:function(){return this._height},set:function(e){this._height!==e&&(this._height=e,f(this,S))}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,o(this._pickId)&&(this._pickId.object.primitive=e)}}}),p.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},p.prototype._setTranslate=function(t){if(!o(t))throw new s("value is required.");var r=this._translate;e.equals(r,t)||(e.clone(t,r),f(this,_))},p.prototype._getActualPosition=function(){return this._actualPosition},p.prototype._setActualPosition=function(e){t.clone(e,this._actualPosition),f(this,g)};var D=new r;p._computeActualPosition=function(e,t,r){return t.mode===h.SCENE3D?e:(l.multiplyByPoint(r,e,D),d.computeActualWgs84Position(t,D))};var I=new l,O=new r,R=new t,L=new e;p._computeScreenSpacePosition=function(i,n,o,a,s){var u=s.frameState.camera,c=u.viewMatrix,h=u.frustum.projectionMatrix,m=l.multiplyTransformation(c,i,I),f=l.multiplyByVector(m,r.fromElements(n.x,n.y,n.z,1,O),O),p=t.multiplyComponents(o,t.normalize(f,R),R);f.x+=o.x+p.x,f.y+=o.y+p.y,f.z+=p.z;var v=l.multiplyByVector(h,f,O),g=d.clipToWindowCoordinates(s,v,new e),_=e.multiplyByScalar(a,s.context.uniformState.resolutionScale,L);return g.x+=_.x,g.y+=_.y,g};var N=new e(0,0);return p.prototype.computeScreenSpacePosition=function(t){var r=this._billboardCollection;if(!o(r))throw new s("Billboard must be in a collection. Was it removed?");if(!o(t))throw new s("scene is required.");e.clone(this._pixelOffset,N),e.add(N,this._translate,N);var i=r.modelMatrix;return p._computeScreenSpacePosition(i,this._actualPosition,this._eyeOffset,N,t)},p.prototype.equals=function(r){return this===r||o(r)&&this._show===r._show&&this._imageIndex===r._imageIndex&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&t.equals(this._position,r._position)&&i.equals(this._color,r._color)&&e.equals(this._pixelOffset,r._pixelOffset)&&e.equals(this._translate,r._translate)&&t.equals(this._eyeOffset,r._eyeOffset)&&u.equals(this._scaleByDistance,r._scaleByDistance)&&u.equals(this._translucencyByDistance,r._translucencyByDistance)&&u.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&this._id===r._id},p.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},p}),r("Scene/BlendEquation",[],function(){"use strict";var e={ADD:32774,SUBTRACT:32778,REVERSE_SUBTRACT:32779};return e}),r("Scene/BlendFunction",[],function(){"use strict";var e={ZERO:0,ONE:1,SOURCE_COLOR:768,ONE_MINUS_SOURCE_COLOR:769,DESTINATION_COLOR:774,ONE_MINUS_DESTINATION_COLOR:775,SOURCE_ALPHA:770,ONE_MINUS_SOURCE_ALPHA:771,DESTINATION_ALPHA:772,ONE_MINUS_DESTINATION_ALPHA:773,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,SOURCE_ALPHA_SATURATE:776};return e}),r("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,r){"use strict";var i={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.ONE,functionSourceAlpha:r.ONE,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE,functionDestinationAlpha:r.ONE})};return i}),r("Scene/Pass",[],function(){"use strict";var e={OPAQUE:0,TRANSLUCENT:1,OVERLAY:2};return e}),r("Scene/BillboardCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Matrix4","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./HorizontalOrigin","./Pass","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S){"use strict";function x(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 E(e){var t=16384,r=e.cache.billboardCollection_directionsVertexBuffer;if(a(r))return r;for(var i=new Uint8Array(2*4*t),n=0,o=0;t>n;++n)i[o++]=0,i[o++]=0,i[o++]=255,i[o++]=0,i[o++]=255,i[o++]=255,i[o++]=0,i[o++]=255;return r=e.createVertexBuffer(i,m.STATIC_DRAW),r.vertexArrayDestroyable=!1,e.cache.billboardCollection_directionsVertexBuffer=r,r}function T(e){var t=16384,r=e.cache.billboardCollection_indexBuffer;if(a(r))return r;for(var i=6*t,n=new Uint16Array(i),o=0,s=0;i>o;o+=6,s+=4)n[o]=s,n[o+1]=s+1,n[o+2]=s+2,n[o+3]=s+0,n[o+4]=s+2,n[o+5]=s+3;return r=e.createIndexBuffer(n,m.STATIC_DRAW,h.UNSIGNED_SHORT),r.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBuffer=r,r}function P(e,t,r){var i=E(e);return new v(e,[{index:nt.positionHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,usage:r[G]},{index:nt.positionLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,usage:r[G]},{index:nt.pixelOffsetAndTranslate,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:r[H]},{index:nt.eyeOffsetAndScale,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:r[Z]},{index:nt.textureCoordinatesAndImageSize,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:r[J]},{index:nt.pickColor,componentsPerAttribute:4,normalize:!0,componentDatatype:n.UNSIGNED_BYTE,usage:m.STATIC_DRAW,purpose:st},{index:nt.color,componentsPerAttribute:4,normalize:!0,componentDatatype:n.UNSIGNED_BYTE,usage:r[Q],purpose:at},{index:nt.originAndShow,componentsPerAttribute:3,componentDatatype:n.BYTE,usage:r[W]},{index:nt.direction,vertexBuffer:i,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE},{index:nt.rotationAndAlignedAxis,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:r[K]},{index:nt.scaleByDistance,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:r[et]},{index:nt.translucencyByDistance,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:r[tt]},{index:nt.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:r[rt]}],4*t)}function A(t,r,i,n,o){var a=4*o._index,s=o._getActualPosition();t._mode===S.SCENE3D&&(e.expand(t._baseVolume,s,t._baseVolume),t._boundingVolumeDirty=!0),c.fromCartesian(s,ut);var l=n[ot],u=l[nt.positionHigh],h=ut.high;u(a+0,h.x,h.y,h.z),u(a+1,h.x,h.y,h.z),u(a+2,h.x,h.y,h.z),u(a+3,h.x,h.y,h.z);var d=l[nt.positionLow],m=ut.low;d(a+0,m.x,m.y,m.z),d(a+1,m.x,m.y,m.z),d(a+2,m.x,m.y,m.z),d(a+3,m.x,m.y,m.z)}function M(e,t,r,i,n){var o=4*n._index,a=n.pixelOffset,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 D(e,t,r,i,n){var o=4*n._index,a=n.eyeOffset,s=n.scale;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,r,n,o){var a=4*o._index,s=n[st],l=s[nt.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 O(e,t,r,n,o){var a=4*o._index,s=n[at],l=s[nt.color],u=o.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,i,n){var o=4*n._index,a=n.horizontalOrigin,s=n.verticalOrigin,l=n.show;0===n.color.alpha&&(l=!1),e._allHorizontalCenter=e._allHorizontalCenter&&a===C.CENTER;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(e,t,r,i,n){var s=4*n._index,l=0,c=0,h=0,d=0,m=n.imageIndex;if(-1!==m){var f=r[m];if(!a(f))throw new u("Invalid billboard image index: "+m);l=f.x,c=f.y,h=f.width,d=f.height}var p=l+h,v=c+d,g=e._textureAtlas.texture.dimensions,_=.5*o(n.width,g.x*h),y=.5*o(n.height,g.y*d);e._maxSize=Math.max(e._maxSize,_,y);var w=i[ot],C=w[nt.textureCoordinatesAndImageSize];C(s+0,l,c,_,y),C(s+1,p,c,_,y),C(s+2,p,v,_,y),C(s+3,l,v,_,y)}function N(e,t,i,n,o){var a=4*o._index,s=o.rotation,l=o.alignedAxis;0===s&&r.equals(l,r.ZERO)||(e._shaderRotation=!0);var u=l.x,c=l.y,h=l.z,d=n[ot],m=d[nt.rotationAndAlignedAxis];m(a+0,s,u,c,h),m(a+1,s,u,c,h),m(a+2,s,u,c,h),m(a+3,s,u,c,h)}function B(e,t,r,i,n){var o=4*n._index,s=i[ot],l=s[nt.scaleByDistance],u=0,c=1,h=1,d=1,m=n.scaleByDistance;a(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(e._shaderScaleByDistance=!0)),l(o+0,u,c,h,d),l(o+1,u,c,h,d),l(o+2,u,c,h,d),l(o+3,u,c,h,d)}function F(e,t,r,i,n){var o=4*n._index,s=i[ot],l=s[nt.translucencyByDistance],u=0,c=1,h=1,d=1,m=n.translucencyByDistance;a(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(e._shaderTranslucencyByDistance=!0)),l(o+0,u,c,h,d),l(o+1,u,c,h,d),l(o+2,u,c,h,d),l(o+3,u,c,h,d)}function z(e,t,r,i,n){var o=4*n._index,s=i[ot],l=s[nt.pixelOffsetScaleByDistance],u=0,c=1,h=1,d=1,m=n.pixelOffsetScaleByDistance;a(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(e._shaderPixelOffsetScaleByDistance=!0)),l(o+0,u,c,h,d),l(o+1,u,c,h,d),l(o+2,u,c,h,d),l(o+3,u,c,h,d)}function V(e,t,r,i,n){A(e,t,r,i,n),M(e,t,r,i,n),D(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),F(e,t,r,i,n),z(e,t,r,i,n)}function q(t,r,i,n,o,s){var l;n.mode===S.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;i>c;++c){var h=r[c],d=h.position,m=y._computeActualPosition(d,n,o);a(m)&&(h._setActualPosition(m),s?u.push(m):e.expand(l,m,l))}s&&e.fromPoints(u,l)}function k(e,t){var r=t.mode,i=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==S.SCENE3D&&!d.equals(o,e.modelMatrix)?(e._mode=r,d.clone(e.modelMatrix,o),e._createVertexArray=!0,(r===S.SCENE3D||r===S.SCENE2D||r===S.COLUMBUS_VIEW)&&q(e,i,i.length,t,o,!0)):r===S.MORPHING?q(e,i,i.length,t,o,!0):(r===S.SCENE2D||r===S.COLUMBUS_VIEW)&&q(e,n,e._billboardsToUpdateIndex,t,o,!1)}function U(e,t,i,n){var o=i.camera,a=o.frustum,s=r.subtract(o.positionWC,n.center,ht),l=r.multiplyByScalar(o.directionWC,r.dot(s,o.directionWC),dt),u=Math.max(0,r.magnitude(l)-n.radius);ct.x=t.drawingBufferWidth,ct.y=t.drawingBufferHeight;var c=a.getPixelSize(ct,u),h=Math.max(c.x,c.y),d=2*h*e._maxScale*e._maxSize;e._allHorizontalCenter&&(d*=.5);var m=h*e._maxPixelOffset+e._maxEyeOffset;n.radius+=d+m}var W=y.SHOW_INDEX,G=y.POSITION_INDEX,H=y.PIXEL_OFFSET_INDEX,j=y.EYE_OFFSET_INDEX,Y=y.HORIZONTAL_ORIGIN_INDEX,X=y.VERTICAL_ORIGIN_INDEX,Z=y.SCALE_INDEX,J=y.IMAGE_INDEX_INDEX,Q=y.COLOR_INDEX,K=y.ROTATION_INDEX,$=y.ALIGNED_AXIS_INDEX,et=y.SCALE_BY_DISTANCE_INDEX,tt=y.TRANSLUCENCY_BY_DISTANCE_INDEX,rt=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,it=y.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(t){t=o(t,o.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 e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=d.clone(o(t.modelMatrix,d.IDENTITY)),this._modelMatrix=d.clone(d.IDENTITY),this.debugShowBoundingVolume=o(t.debugShowBoundingVolume,!1),this._mode=S.SCENE3D,this.sizeReal=!1,this._buffersUsage=[m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW];var r=this;this._uniforms={u_atlas:function(){return r._textureAtlas.texture},u_sizeReal:function(){return r.sizeReal}}};s(lt.prototype,{length:{get:function(){return x(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}}}),lt.prototype.add=function(e){var t=new y(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(e){return a(e)&&e._billboardCollection===this},lt.prototype.get=function(e){if(!a(e))throw new u("index is required.");return x(this),this._billboards[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]?m.STATIC_DRAW:m.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var ut=new c,ct=new t,ht=new r,dt=new r;return lt.prototype.update=function(t,r,i){var n=this._textureAtlas;if(a(n)){var o=n.textureCoordinates;if(0!==o.length){x(this),k(this,r);var s=this._billboards,l=s.length,u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,m=n.guid,v=this._createVertexArray||this._textureAtlasGUID!==m;this._textureAtlasGUID=m;var y,C=r.passes,E=C.pick;if(v||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var I=0;it>I;++I)h[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),l>0){this._vaf=P(t,l,this._buffersUsage),y=this._vaf.writers;for(var q=0;l>q;++q){var ot=this._billboards[q];ot._dirty=!1,V(this,t,o,y,ot)}this._vaf.commit(T(t))}this._billboardsToUpdateIndex=0}else if(c>0){var lt=[];if(h[G]&<.push(A),h[H]&<.push(M),(h[j]||h[Z])&<.push(D),h[J]&<.push(L),h[Q]&<.push(O),(h[Y]||h[X]||h[W])&<.push(R),(h[K]||h[$])&<.push(N),h[et]&<.push(B),h[tt]&<.push(F),h[rt]&<.push(z),y=this._vaf.writers,c/l>.1){for(var ut=0;c>ut;++ut){var ct=u[ut];ct._dirty=!1;for(var ht=0;htdt;++dt){var mt=u[dt];mt._dirty=!1;for(var ft=0;ft1.5*l&&(u.length=l),a(this._vaf)&&a(this._vaf.vaByPurpose)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var pt,vt=d.IDENTITY;r.mode===S.SCENE3D?(vt=this.modelMatrix,pt=e.clone(this._baseVolumeWC,this._boundingVolume)):pt=e.clone(this._baseVolume2D,this._boundingVolume),U(this,t,r,pt);var gt,_t,yt,wt;if(C.render){var Ct=this._colorCommands;for(a(this._rs)||(this._rs=t.createRenderState({depthTest:{enabled:!0},blending:w.ALPHA_BLEND})),(!a(this._sp)||this._shaderRotation&&!this._compiledShaderRotation||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistance)&&(this._sp=t.replaceShaderProgram(this._sp,f({defines:[this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[_]}),g,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,Ct.length=_t,wt=0;_t>wt;++wt)yt=Ct[wt],a(yt)||(yt=Ct[wt]=new p({pass:b.OPAQUE,owner:this})),yt.boundingVolume=pt,yt.modelMatrix=vt,yt.count=gt[wt].indicesCount,yt.shaderProgram=this._sp,yt.uniformMap=this._uniforms,yt.vertexArray=gt[wt].va,yt.renderState=this._rs,yt.debugShowBoundingVolume=this.debugShowBoundingVolume,i.push(yt)}if(E){var bt=this._pickCommands;for((!a(this._spPick)||this._shaderRotation&&!this._compiledShaderRotationPick||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistancePick)&&(this._spPick=t.replaceShaderProgram(this._spPick,f({defines:["RENDER_FOR_PICK",this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[_]}),f({defines:["RENDER_FOR_PICK"],sources:[g]}),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,bt.length=_t,wt=0;_t>wt;++wt)yt=bt[wt],a(yt)||(yt=bt[wt]=new p({pass:b.OPAQUE,owner:this})),yt.boundingVolume=pt,yt.modelMatrix=vt,yt.count=gt[wt].indicesCount,yt.shaderProgram=this._spPick,yt.uniformMap=this._uniforms,yt.vertexArray=gt[wt].va,yt.renderState=this._rs,i.push(yt)}}}}},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.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),this._destroyBillboards(),l(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("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(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 c(e,r){var i=e.numberOfImages,o=2;if(i>0){var a=e._texture.width,s=e._texture.height,l=o*(a+r.width+e._borderWidthInPixels),c=o*(s+r.height+e._borderWidthInPixels),h=a/l,d=s/c,m=new u(new t(a+e._borderWidthInPixels,0),new t(l,s)),f=new u(new t,new t(l,s),e._root,m),p=new u(new t(0,s+e._borderWidthInPixels),new t(l,c)),v=new u(new t,new t(l,c),f,p);e._root=v;for(var g=0;gs||0>l)return void 0;if(0===s&&0===l)return r;if(s>l){r.childNode1=new u(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var c=r.bottomLeft.x+i.width+e._borderWidthInPixels;co)throw new s("borderWidthInPixels must be greater than or equal to zero.");if(a.x<1||a.y<1)throw new s("initialSize must be greater than zero.");var c=e.scene.context;this._context=c,this._pixelFormat=i(e.pixelFormat,l.RGBA),this._borderWidthInPixels=o,this._textureCoordinates=[],this._guid=r(),this._texture=this._context.createTexture2D({width:a.x,height:a.y,pixelFormat:this._pixelFormat}),this._root=new u(new t,new t(a.x,a.y));var h=e.images;n(h)&&h.length>0&&this.addImages(h);var d=e.image;n(d)&&this.addImage(d)};return o(f.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),f.prototype.addImage=function(e){var t=this.numberOfImages;return d(this,e,t),this._guid=r(),t},f.prototype.addImages=function(e){if(!n(e)||e.length<1)throw new s("images is required and must have length greater than zero.");var t,i=[],o=e.length,a=this.numberOfImages;for(t=0;o>t;++t)i.push({image:e[t],index:t+a});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];d(this,l.image,l.index)}return this._guid=r(),a},f.prototype.addSubRegions=function(t,i){for(var n=this.addImage(t),o=this._texture.width,a=this._texture.height,s=this.numberOfImages,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},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},f}),r("Scene/TextureAtlasBuilder",["../Core/defined","../Core/DeveloperError","../Core/Event","../Core/loadImage"],function(e,t,r,i){"use strict";function n(){this.imageLoaded=new r,this.index=-1,this.loaded=!1}var o=function(r){if(!e(r))throw new t("textureAtlas is required.");this.textureAtlas=r,this._idHash={}};return o.prototype.addTextureFromUrl=function(r,n){if(!e(r))throw new t("url is required.");if(!e(n))throw new t("textureAvailableCallback is required.");this.addTextureFromFunction(r,function(e,t){i(e).then(t)},n)},o.prototype.addTextureFromFunction=function(r,i,o){if(!e(r))throw new t("id is required.");if(!e(i))throw new t("getImageCallback is required.");if(!e(o))throw new t("textureAvailableCallback is required.");var a=this._idHash[r];if(e(a))return a.loaded?o(a.index):a.imageLoaded.addEventListener(o),void 0;this._idHash[r]=a=new n,a.imageLoaded.addEventListener(o);var s=this;i(r,function(e){if(!s.textureAtlas.isDestroyed()){var t=a.index=s.textureAtlas.addImage(e);a.loaded=!0,a.imageLoaded.raiseEvent(t,r),a.imageLoaded=void 0}})},o}),r("DynamicScene/DynamicBillboardVisualizer",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/TextureAtlas","../Scene/TextureAtlasBuilder","../Scene/VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t,r){return function(n){var o=e._billboardVisualizerIndex;if(i(o)){var a=t.get(o);a._visualizerUrl===r&&(a._visualizerTextureAvailable=!0,a.imageIndex=n)}}}function d(n,o,a){var l=a._billboard;if(i(l)){var u=a._position;if(i(u)){var d=l._image;if(i(d)){var m,_=l._show,y=a._billboardVisualizerIndex,w=a.isAvailable(o)&&(!i(_)||_.getValue(o));if(!w)return i(y)&&(m=n._billboardCollection.get(y),m.show=!1,m.imageIndex=-1,m._visualizerUrl=void 0,m._visualizerTextureAvailable=!1,a._billboardVisualizerIndex=void 0,n._unusedIndexes.push(y)),void 0;if(i(y))m=n._billboardCollection.get(y);else{var C=n._unusedIndexes,b=C.length;b>0?(y=C.pop(),m=n._billboardCollection.get(y)):(y=n._billboardCollection.length,m=n._billboardCollection.add()),a._billboardVisualizerIndex=y,m.id=a,m._visualizerUrl=void 0,m._visualizerTextureAvailable=!1,m.color=r.WHITE,m.eyeOffset=t.ZERO,m.pixelOffset=e.ZERO,m.scale=1,m.horizontalOrigin=s.CENTER,m.verticalOrigin=c.CENTER}var S=d.getValue(o);if(S!==m._visualizerUrl&&(m._visualizerUrl=S,m._visualizerTextureAvailable=!1,n._textureAtlasBuilder.addTextureFromUrl(S,h(a,n._billboardCollection,S))),m.show=m._visualizerTextureAvailable,m._visualizerTextureAvailable){f=u.getValue(o,f),i(f)&&(m.position=f);var x=l._color;if(i(x)&&(p=x.getValue(o,p),i(p)&&(m.color=p)),x=l._eyeOffset,i(x)&&(v=x.getValue(o,v),i(v)&&(m.eyeOffset=v)),x=l._pixelOffset,i(x)&&(g=x.getValue(o,g),i(g)&&(m.pixelOffset=g)),x=l._scale,i(x)){var E=x.getValue(o);i(E)&&(m.scale=E)}if(x=l._rotation,i(x)){var T=x.getValue(o);i(T)&&(m.rotation=T)}if(x=l._alignedAxis,i(x)){var P=x.getValue(o);i(P)&&(m.alignedAxis=P)}if(x=l._horizontalOrigin,i(x)){var A=x.getValue(o);i(A)&&(m.horizontalOrigin=A)}if(x=l._verticalOrigin,i(x)){var M=x.getValue(o);i(M)&&(m.verticalOrigin=M)}x=l._width,i(x)&&(m.width=x.getValue(o)),x=l._height,i(x)&&(m.height=x.getValue(o)),x=l._scaleByDistance,i(x)&&(m.scaleByDistance=x.getValue(o)),x=l._translucencyByDistance,i(x)&&(m.translucencyByDistance=x.getValue(o)),x=l._pixelOffsetScaleByDistance,i(x)&&(m.pixelOffsetScaleByDistance=x.getValue(o))}}}}}var m=function(e,t){if(!i(e))throw new o("scene is required.");if(!i(t))throw new o("dynamicObjectCollection is required.");var r=new a,n=new l({scene:e});r.textureAtlas=n,e.primitives.add(r),t.collectionChanged.addEventListener(m.prototype._onObjectsRemoved,this),this._scene=e,this._unusedIndexes=[],this._textureAtlas=n,this._billboardCollection=r,this._textureAtlasBuilder=new u(n),this._dynamicObjectCollection=t};m.prototype.update=function(e){if(!i(e))throw new o("time is required.");for(var t=this._dynamicObjectCollection.getObjects(),r=0,n=t.length;n>r;r++)d(this,e,t[r]);return!0},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){var e=this._dynamicObjectCollection;e.collectionChanged.removeEventListener(m.prototype._onObjectsRemoved,this);for(var t=e.getObjects(),r=t.length,i=0;r>i;i++)t[i]._billboardVisualizerIndex=void 0;return this._scene.primitives.remove(this._billboardCollection),n(this)};var f,p,v,g;return m.prototype._onObjectsRemoved=function(e,t,r){for(var n=this._billboardCollection,o=this._unusedIndexes,a=r.length-1;a>-1;a--){var s=r[a],l=s._billboardVisualizerIndex;if(i(l)){var u=n.get(l);u.show=!1,u.imageIndex=-1,u._visualizerUrl=void 0,u._visualizerTextureAvailable=!1,s._billboardVisualizerIndex=void 0,o.push(l)}}},m}),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("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/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("Scene/CullFace",[],function(){"use strict";var e={FRONT:1028,BACK:1029,FRONT_AND_BACK:1032};return e}),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/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,r,i){"use strict";var n=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(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,n){if(i=e(i,0),n=e(n,0),!t)throw new r("source is required.");if(0>i)throw new r("xOffset must be greater than or equal to zero.");if(0>n)throw new r("yOffset must be greater than or equal to zero.");if(i+t.width>this._size)throw new r("xOffset + source.width must be less than or equal to width.");if(n+t.height>this._size)throw new r("yOffset + source.height must be less than or equal to height.");var o=this._gl,a=this._textureTarget;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,this._flipY),o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),t.arrayBufferView?o.texSubImage2D(this._targetFace,0,i,n,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):o.texSubImage2D(this._targetFace,0,i,n,this._pixelFormat,this._pixelDatatype,t),o.bindTexture(a,null)},n.prototype.copyFromFramebuffer=function(t,n,o,a,s,l){if(t=e(t,0),n=e(n,0),o=e(o,0),a=e(a,0),s=e(s,this._size),l=e(l,this._size),0>t)throw new r("xOffset must be greater than or equal to zero.");if(0>n)throw new r("yOffset must be greater than or equal to zero.");if(0>o)throw new r("framebufferXOffset must be greater than or equal to zero.");if(0>a)throw new r("framebufferYOffset must be greater than or equal to zero.");if(t+s>this._size)throw new r("xOffset + source.width must be less than or equal to width.");if(n+l>this._size)throw new r("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===i.FLOAT)throw new r("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,t,n,o,a,s,l),u.bindTexture(c,null)},n}),r("Renderer/MipmapHint",[],function(){"use strict";var e={DONT_CARE:4352,FASTEST:4353,NICEST:4354,validate:function(t){return t===e.DONT_CARE||t===e.FASTEST||t===e.NICEST}};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/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./CubeMapFace","./MipmapHint","./PixelDatatype","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(e,t,r,i,n,o,s,l,u){this._gl=e,this._textureFilterAnisotropic=t,this._textureTarget=r,this._texture=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=s,this._preMultiplyAlpha=l,this._flipY=u,this._sampler=void 0,this._positiveX=new a(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_X,n,o,s,l,u),this._negativeX=new a(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_X,n,o,s,l,u),this._positiveY=new a(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Y,n,o,s,l,u),this._negativeY=new a(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,n,o,s,l,u),this._positiveZ=new a(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Z,n,o,s,l,u),this._negativeZ=new a(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Z,n,o,s,l,u),this.sampler=void 0};return r(d.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var r=!0;if(!t(e)){r=!1;var i=c.LINEAR,o=u.LINEAR;this._pixelDatatype===l.FLOAT&&(i=c.NEAREST,o=u.NEAREST),e={wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:o,maximumAnisotropy:1}}if(this._pixelDatatype===l.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 a=this._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.texParameteri(s,a.TEXTURE_MIN_FILTER,e.minificationFilter),a.texParameteri(s,a.TEXTURE_MAG_FILTER,e.magnificationFilter),a.texParameteri(s,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(s,a.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&a.texParameteri(s,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(s,null),this._sampler=r?{wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy}:void 0}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),d.prototype.generateMipmap=function(t){if(t=e(t,s.DONT_CARE),this._size>1&&!o.isPowerOfTwo(this._size))throw new n("width and height must be a power of two to call generateMipmap().");if(!s.validate(t))throw new n("hint is invalid.");var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,t),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=i(this._positiveX),this._negativeX=i(this._negativeX),this._positiveY=i(this._positiveY),this._negativeY=i(this._negativeY),this._positiveZ=i(this._positiveZ),this._negativeZ=i(this._negativeZ),i(this)},d}),r("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Math","../Core/PixelFormat","./MipmapHint","./PixelDatatype","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var f=function(i,n){n=t(n,t.EMPTY_OBJECT);var a=n.source,s=r(a)?a.width:n.width,u=r(a)?a.height:n.height,h=t(n.pixelFormat,l.RGBA),d=t(n.pixelDatatype,c.UNSIGNED_BYTE);if(!r(s)||!r(u))throw new o("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(0>=s)throw new o("Width must be greater than zero.");if(s>i._maximumTextureSize)throw new o("Width must be less than or equal to the maximum texture size ("+i._maximumTextureSize+"). Check maximumTextureSize.");if(0>=u)throw new o("Height must be greater than zero.");if(u>i._maximumTextureSize)throw new o("Height must be less than or equal to the maximum texture size ("+i._maximumTextureSize+"). Check maximumTextureSize.");if(!l.validate(h))throw new o("Invalid options.pixelFormat.");if(!c.validate(d))throw new o("Invalid options.pixelDatatype.");if(h===l.DEPTH_COMPONENT&&d!==c.UNSIGNED_SHORT&&d!==c.UNSIGNED_INT)throw new o("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(h===l.DEPTH_STENCIL&&d!==c.UNSIGNED_INT_24_8_WEBGL)throw new o("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8_WEBGL.");if(d===c.FLOAT&&!i.floatingPointTexture)throw new o("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(l.isDepthFormat(h)){if(r(a))throw new o("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!i.depthTexture)throw new o("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}var m=n.preMultiplyAlpha||h===l.RGB||h===l.LUMINANCE,f=t(n.flipY,!0),p=i._gl,v=p.TEXTURE_2D,g=p.createTexture();p.activeTexture(p.TEXTURE0),p.bindTexture(v,g),r(a)?(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,f),r(a.arrayBufferView)?p.texImage2D(v,0,h,s,u,0,h,d,a.arrayBufferView):r(a.framebuffer)?(a.framebuffer!==i.defaultFramebuffer&&a.framebuffer._bind(),p.copyTexImage2D(v,0,h,a.xOffset,a.yOffset,s,u,0),a.framebuffer!==i.defaultFramebuffer&&a.framebuffer._unBind()):p.texImage2D(v,0,h,h,d,a)):p.texImage2D(v,0,h,s,u,0,h,d,null),p.bindTexture(v,null),this._context=i,this._textureFilterAnisotropic=i._textureFilterAnisotropic,this._textureTarget=v,this._texture=g,this._pixelFormat=h,this._pixelDatatype=d,this._width=s,this._height=u,this._dimensions=new e(s,u),this._preMultiplyAlpha=m,this._flipY=f,this._sampler=void 0,this.sampler=void 0};return i(f.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=!0;if(!r(e)){t=!1;var i=d.LINEAR,n=h.LINEAR;this._pixelDatatype===c.FLOAT&&(i=d.NEAREST,n=h.NEAREST),e={wrapS:m.CLAMP_TO_EDGE,wrapT:m.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:n,maximumAnisotropy:1}}if(this._pixelDatatype===c.FLOAT){if(e.minificationFilter!==d.NEAREST&&e.minificationFilter!==d.NEAREST_MIPMAP_NEAREST)throw new o("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(e.magnificationFilter!==h.NEAREST)throw new o("Only the NEAREST magnification filter is supported for floating point textures.")}var a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.texParameteri(s,a.TEXTURE_MIN_FILTER,e.minificationFilter),a.texParameteri(s,a.TEXTURE_MAG_FILTER,e.magnificationFilter),a.texParameteri(s,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(s,a.TEXTURE_WRAP_T,e.wrapT),r(this._textureFilterAnisotropic)&&a.texParameteri(s,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(s,null),this._sampler=t?{wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy}:void 0}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),f.prototype.copyFrom=function(e,i,n){if(i=t(i,0),n=t(n,0),!r(e))throw new o("source is required.");if(l.isDepthFormat(this._pixelFormat))throw new o("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(0>i)throw new o("xOffset must be greater than or equal to zero.");if(0>n)throw new o("yOffset must be greater than or equal to zero.");if(i+e.width>this._width)throw new o("xOffset + source.width must be less than or equal to width.");if(n+e.height>this._height)throw new o("yOffset + source.height must be less than or equal to height.");if(a.isInternetExplorer()&&0!==n&&this._flipY){var s=new f(this._context,{source:e,flipY:!0,pixelFormat:this._pixelFormat,pixelDatatype:this._pixelDatatype,preMultiplyAlpha:this._preMultiplyAlpha}),u=this._context.createFramebuffer({colorTextures:[s]});return u._bind(),this.copyFromFramebuffer(i,n,0,0,s.width,s.height),u._unBind(),u.destroy(),void 0}var c=this._context._gl,h=this._textureTarget;c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,this._flipY),c.activeTexture(c.TEXTURE0),c.bindTexture(h,this._texture),e.arrayBufferView?c.texSubImage2D(h,0,i,n,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):c.texSubImage2D(h,0,i,n,this._pixelFormat,this._pixelDatatype,e),c.bindTexture(h,null)},f.prototype.copyFromFramebuffer=function(e,r,i,n,a,s){if(e=t(e,0),r=t(r,0),i=t(i,0),n=t(n,0),a=t(a,this._width),s=t(s,this._height),l.isDepthFormat(this._pixelFormat))throw new o("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===c.FLOAT)throw new o("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(0>e)throw new o("xOffset must be greater than or equal to zero.");if(0>r)throw new o("yOffset must be greater than or equal to zero.");if(0>i)throw new o("framebufferXOffset must be greater than or equal to zero.");if(0>n)throw new o("framebufferYOffset must be greater than or equal to zero.");if(e+a>this._width)throw new o("xOffset + width must be less than or equal to width.");if(r+s>this._height)throw new o("yOffset + height must be less than or equal to height.");var u=this._context._gl,h=this._textureTarget;u.activeTexture(u.TEXTURE0),u.bindTexture(h,this._texture),u.copyTexSubImage2D(h,0,e,r,i,n,a,s),u.bindTexture(h,null)},f.prototype.generateMipmap=function(e){if(e=t(e,u.DONT_CARE),l.isDepthFormat(this._pixelFormat))throw new o("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._width>1&&!s.isPowerOfTwo(this._width))throw new o("width must be a power of two to call generateMipmap().");if(this._height>1&&!s.isPowerOfTwo(this._height))throw new o("height must be a power of two to call generateMipmap().");if(!u.validate(e))throw new o("hint is invalid.");var r=this._context._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)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},f}),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/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/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;\nuniform vec2 lineOffset;\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 - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 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/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("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/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/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\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(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, 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("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadImage","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../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","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I,O){"use strict";function R(e,r){e=o(e,o.EMPTY_OBJECT),r._strict=o(e.strict,!1),r._count=o(e.count,0),r._template=t(o(e.fabric,o.EMPTY_OBJECT)),r._template.uniforms=t(o(r._template.uniforms,o.EMPTY_OBJECT)),r._template.materials=t(o(r._template.materials,o.EMPTY_OBJECT)),r.type=a(r._template.type)?r._template.type:n(),r.shaderSource="",r.materials={},r.uniforms={},r._uniforms={},r._translucentFunctions=[];var s,l=Y._materialCache.getMaterial(r.type);if(a(l)){var u=t(l.fabric,!0);r._template=i(r._template,u,!0),s=l.translucent}F(r),a(l)||Y._materialCache.addMaterial(r.type,r),z(r),k(r),G(r);var c=0===r._translucentFunctions.length?!0:void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(r)};r._translucentFunctions.push(h)}else r._translucentFunctions.push(s)}function L(e,t,r,i){if(a(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 r="fabric: property name '"+e+"' is not valid. It should be ",i=0;i0&&(i[s]={type:"ivec3",x:1,y:1},U(e,s))}var l="uniform "+o+" "+t+";\n";-1===e.shaderSource.indexOf(l)&&(e.shaderSource=l+e.shaderSource);var c=t+"_"+e._count++;if(1===H(e,t,c)&&r)throw new u("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=n,"sampler2D"===o)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if("samplerCube"===o)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(q(t));else if(-1!==o.indexOf("mat")){var h=new J[o];e._uniforms[c]=function(){return J[o].fromColumnMajorArray(e.uniforms[t],h)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function W(e){var t=e.type;if(!a(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(c(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 G(e){var t=e._strict,r=e._template.materials;for(var n in r)if(r.hasOwnProperty(n)){var o=new Y({strict:t,fabric:r[n],count:e._count});e._count=o._count,e._uniforms=i(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;H(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";if(0===H(e,n,l)&&t)throw new u("strict: shader source does not use material '"+n+"'.")}}function H(e,t,r,i){i=o(i,!0);var n=0,a="a-zA-Z0-9_",s="(["+a+"])?",l="(["+a+(i?".":"")+"])?",u=new RegExp(l+t+s,"g");return e.shaderSource=e.shaderSource.replace(u,function(e,t,i){return t||i?e:(n+=1,r)}),n}function j(e,t,r){return H(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),s(this,{type:{value:this.type,writable:!1}}),a(Y._uniformList[this.type])||(Y._uniformList[this.type]=Object.keys(this._uniforms))};Y._uniformList={},Y.fromType=function(e,t){if(!a(Y._materialCache.getMaterial(e)))throw new u("material with type '"+e+"' does not exist.");var r=new Y({fabric:{type:e}});if(a(t))for(var i in t)t.hasOwnProperty(i)&&(r.uniforms[i]=t[i]);return r},Y.prototype.isTranslucent=function(){if(a(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 s=o.image,l=Y._textureCache.getTexture(this._texturePaths[r]);a(l)||(l=e.createTexture2D({source:s}),Y._textureCache.addTexture(this._texturePaths[r],l)),this._textures[r]=l;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=l._width,c.y=l._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,f=Y._textureCache.getTexture(this._texturePaths[r]);a(f)||(f=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],f)),this._textures[r]=f}h.length=0;var p=this._updateFunctions;for(n=p.length,t=0;n>t;++t)p[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 l(this)};var X=["type","materials","uniforms","components","source"],Z=["diffuse","specular","shininess","normal","emission","alpha"],J={mat2:d,mat3:m,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 a(t)?(t.count++,t.texture):void 0},releaseTexture:function(e){var t=this._textures[e];a(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 r(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 e(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 e(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 e(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 e(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 e(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 e(1,1)},source:g},translucent:!1}),Y.NormalMapType="NormalMap",Y._materialCache.addMaterial(Y.NormalMapType,{fabric:{type:Y.NormalMapType,uniforms:{image:Y.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:S},translucent:!1}),Y.ReflectionType="Reflection",Y._materialCache.addMaterial(Y.ReflectionType,{fabric:{type:Y.ReflectionType,uniforms:{cubeMap:Y.DefaultCubeMapId,channels:"rgb"},source:P},translucent:!1}),Y.RefractionType="Refraction",Y._materialCache.addMaterial(Y.RefractionType,{fabric:{type:Y.RefractionType,uniforms:{cubeMap:Y.DefaultCubeMapId,channels:"rgb",indexOfRefractionRatio:.9},source:A},translucent:!1}),Y.FresnelType="Fresnel",Y._materialCache.addMaterial(Y.FresnelType,{fabric:{type:Y.FresnelType,materials:{reflection:{type:Y.ReflectionType},refraction:{type:Y.RefractionType}},source:C},translucent:!1}),Y.GridType="Grid",Y._materialCache.addMaterial(Y.GridType,{fabric:{type:Y.GridType,uniforms:{color:new r(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:b},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,evenColor:new r(1,1,1,.5),oddColor:new r(0,0,1,.5),offset:0,repeat:5},source:D},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<0}}),Y.CheckerboardType="Checkerboard",Y._materialCache.addMaterial(Y.CheckerboardType,{fabric:{type:Y.CheckerboardType,uniforms:{lightColor:new r(1,1,1,.5),darkColor:new r(0,0,0,.5),repeat:new e(5,5)},source:_},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 r(1,1,0,.75),darkColor:new r(0,1,1,.75),repeat:new e(5,5)},source:y},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 r(.2,.3,.6,1),blendColor:new r(0,1,.699,1),specularMap:Y.DefaultImageId,normalMap:Y.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:I},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 r(1,0,0,.7),rimColor:new r(1,1,1,.4),width:.3},source:M},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 r(1,0,0,1),fadeOutColor:new r(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:w},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 r(1,1,1,1)},source:x},translucent:!0}),Y.PolylineGlowType="PolylineGlow",Y._materialCache.addMaterial(Y.PolylineGlowType,{fabric:{type:Y.PolylineGlowType,uniforms:{color:new r(0,.5,1,1),glowPower:.1},source:E},translucent:!0}),Y.PolylineOutlineType="PolylineOutline",Y._materialCache.addMaterial(Y.PolylineOutlineType,{fabric:{type:Y.PolylineOutlineType,uniforms:{color:new r(1,1,1,1),outlineColor:new r(1,0,0,1),outlineWidth:1},source:T},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),Y}),r("Scene/CustomSensorVolume",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/FAR","../Core/Matrix4","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../Shaders/CustomSensorVolumeFS","../Shaders/CustomSensorVolumeVS","../Shaders/SensorVolume","./BlendingState","./CullFace","./Material","./Pass","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b){"use strict";function S(r){for(var i=r._directions,n=i.length,o=new Float32Array(3*n),a=isFinite(r.radius)?r.radius:u,s=[t.ZERO],l=n-2,c=n-1,h=0;n>h;l=c++,c=h++){var d=t.fromSpherical(i[l],P),m=t.fromSpherical(i[c],A),f=t.fromSpherical(i[h],M),p=Math.max(t.angleBetween(d,m),t.angleBetween(m,f)),v=a/Math.cos(.5*p),g=t.multiplyByScalar(m,v,new t);o[3*c]=g.x,o[3*c+1]=g.y,o[3*c+2]=g.z,s.push(g)}return e.fromPoints(s,r._boundingSphere),o}function x(e,r){for(var i=S(e),o=e._directions.length,a=new Float32Array(18*o),s=0,l=o-1,u=0;o>u;l=u++){var c=new t(i[3*l],i[3*l+1],i[3*l+2]),h=new t(i[3*u],i[3*u+1],i[3*u+2]),m=t.normalize(t.cross(h,c,D),D);a[s++]=0,a[s++]=0,a[s++]=0,a[s++]=m.x,a[s++]=m.y,a[s++]=m.z,a[s++]=h.x,a[s++]=h.y,a[s++]=h.z,a[s++]=m.x,a[s++]=m.y,a[s++]=m.z,a[s++]=c.x,a[s++]=c.y,a[s++]=c.z,a[s++]=m.x,a[s++]=m.y,a[s++]=m.z}var f=r.createVertexBuffer(new Float32Array(a),d.STATIC_DRAW),p=6*Float32Array.BYTES_PER_ELEMENT,v=[{index:E.position,vertexBuffer:f,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:p},{index:E.normal,vertexBuffer:f,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p}];return r.createVertexArray(v)}var E={position:0,normal:1},T=function(t){t=o(t,o.EMPTY_OBJECT),this._pickId=void 0,this._pickPrimitive=o(t._pickPrimitive,this),this._frontFaceColorCommand=new f,this._backFaceColorCommand=new f,this._pickCommand=new f,this._boundingSphere=new e,this._boundingSphereWC=new e,this._frontFaceColorCommand.primitiveType=h.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=o(t.show,!0),this.showIntersection=o(t.showIntersection,!0),this.showThroughEllipsoid=o(t.showThroughEllipsoid,!1),this._showThroughEllipsoid=this.showThroughEllipsoid,this.modelMatrix=c.clone(o(t.modelMatrix,c.IDENTITY)),this._modelMatrix=new c,this.radius=o(t.radius,Number.POSITIVE_INFINITY),this._directions=void 0,this._directionsDirty=!1,this.setDirections(t.directions),this.material=a(t.material)?t.material:w.fromType(w.ColorType),this._material=void 0,this._translucent=void 0,this.intersectionColor=r.clone(o(t.intersectionColor,r.WHITE)),this.intersectionWidth=o(t.intersectionWidth,5),this.id=t.id,this._id=void 0;var i=this;this._uniforms={u_showThroughEllipsoid:function(){return i.showThroughEllipsoid},u_showIntersection:function(){return i.showIntersection},u_sensorRadius:function(){return isFinite(i.radius)?i.radius:u},u_intersectionColor:function(){return i.intersectionColor},u_intersectionWidth:function(){return i.intersectionWidth},u_normalDirection:function(){return 1}},this._mode=b.SCENE3D};T.prototype.setDirections=function(e){this._directions=e,this._directionsDirty=!0},T.prototype.getDirections=function(){return this._directions};var P=new t,A=new t,M=new t,D=new t;return T.prototype.update=function(t,r,n){if(this._mode=r.mode,this.show&&this._mode===b.SCENE3D){if(this.radius<0)throw new l("this.radius must be greater than or equal to zero.");if(!a(this.material))throw new l("this.material must be defined.");var o=this.material.isTranslucent();if(this._showThroughEllipsoid!==this.showThroughEllipsoid||!a(this._frontFaceColorCommand.renderState)||this._translucent!==o){this._showThroughEllipsoid=this.showThroughEllipsoid,this._translucent=o;var s;o?(s=t.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:_.ALPHA_BLEND,cull:{enabled:!0,face:y.BACK}}),this._frontFaceColorCommand.renderState=s,this._frontFaceColorCommand.pass=C.TRANSLUCENT,s=t.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:_.ALPHA_BLEND,cull:{enabled:!0,face:y.FRONT}}),this._backFaceColorCommand.renderState=s,this._backFaceColorCommand.pass=C.TRANSLUCENT,s=t.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:_.ALPHA_BLEND}),this._pickCommand.renderState=s):(s=t.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._frontFaceColorCommand.renderState=s,this._frontFaceColorCommand.pass=C.OPAQUE,s=t.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._pickCommand.renderState=s)}var u=this._directionsDirty;if(u){this._directionsDirty=!1,this._va=this._va&&this._va.destroy();var h=this._directions;h&&h.length>=3&&(this._frontFaceColorCommand.vertexArray=x(this,t),this._backFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray,this._pickCommand.vertexArray=this._frontFaceColorCommand.vertexArray)}if(a(this._frontFaceColorCommand.vertexArray)){var d=r.passes,f=!c.equals(this.modelMatrix,this._modelMatrix);f&&c.clone(this.modelMatrix,this._modelMatrix),(u||f)&&e.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 w=this._material!==this.material;if(this._material=this.material,this._material.update(t),d.render){var S=this._frontFaceColorCommand,T=this._backFaceColorCommand;if(w||!a(S.shaderProgram)){var P=m({sources:[g,this._material.shaderSource,p]});S.shaderProgram=t.replaceShaderProgram(S.shaderProgram,v,P,E),S.uniformMap=i(this._uniforms,this._material._uniforms),T.shaderProgram=S.shaderProgram,T.uniformMap=i(this._uniforms,this._material._uniforms),T.uniformMap.u_normalDirection=function(){return-1}}o?n.push(this._backFaceColorCommand,this._frontFaceColorCommand):n.push(this._frontFaceColorCommand)}if(d.pick){var A=this._pickCommand;if(a(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this._pickPrimitive,id:this.id})),w||!a(A.shaderProgram)){var M=m({sources:[g,this._material.shaderSource,p],pickColorQualifier:"uniform"});A.shaderProgram=t.replaceShaderProgram(A.shaderProgram,v,M,E);var D=this,I={czm_pickColor:function(){return D._pickId.color}};A.uniformMap=i(i(this._uniforms,this._material._uniforms),I)}A.pass=o?C.TRANSLUCENT:C.OPAQUE,n.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.destroy(),this._pickCommand.shaderProgram=this._pickCommand.shaderProgram&&this._pickCommand.shaderProgram.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),s(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/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../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 f(e,t,r,i,n){var a,s=0,l=o.toRadians(2);if(0===e&&t===o.TWO_PI)for(a=0;aa;a+=l)m(s++,n,a,i);if(m(s++,n,t,i),r){for(a=t;a>e;a-=l)m(s++,n,a,r);m(s++,n,e,r)}else m(s++,n,t,0)}return n.length=s,n}function p(i,n,u){var m=u._cone;if(r(m)){var p=u._position;if(r(p)){var g=u._orientation;if(r(g)){var w,C=m._show,b=u._coneVisualizerIndex,S=u.isAvailable(n)&&(!r(C)||C.getValue(n));if(!S)return r(b)&&(w=i._coneCollection[b],w.show=!1,u._coneVisualizerIndex=void 0,i._unusedIndexes.push(b)),void 0;if(r(b))w=i._coneCollection[b];else{var x=i._unusedIndexes,E=x.length;E>0?(b=x.pop(),w=i._coneCollection[b]):(b=i._coneCollection.length,w=new c,w._directionsScratch=[],i._coneCollection.push(w),i._primitives.add(w)),u._coneVisualizerIndex=b,w.id=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,P=m._minimumClockAngle;r(P)&&(T=P.getValue(n)),r(T)||(T=0);var A;P=m._maximumClockAngle,r(P)&&(A=P.getValue(n)),r(A)||(A=o.TWO_PI);var M;P=m._innerHalfAngle,r(P)&&(M=P.getValue(n)),r(M)||(M=0);var D;if(P=m._outerHalfAngle,r(P)&&(D=P.getValue(n)),r(D)||(D=Math.PI),(T!==w.minimumClockAngle||A!==w.maximumClockAngle||M!==w.innerHalfAngle||D!==w.outerHalfAngle)&&(w.setDirections(f(T,A,M,D,w._directionsScratch)),w.innerHalfAngle=M,w.maximumClockAngle=A,w.outerHalfAngle=D,w.minimumClockAngle=T),P=m._radius,r(P)){var I=P.getValue(n);r(I)&&(w.radius=I)}var O=p.getValue(n,_),R=g.getValue(n,y);if(!r(O)||!r(R)||e.equals(O,w._visualizerPosition)&&l.equals(R,w._visualizerOrientation)||(s.fromRotationTranslation(a.fromQuaternion(R,v),O,w.modelMatrix),w._visualizerPosition=e.clone(O,w._visualizerPosition),w._visualizerOrientation=l.clone(R,w._visualizerOrientation)),w.material=d.getValue(n,m._outerMaterial,w.material),P=m._intersectionColor,r(P)&&P.getValue(n,w.intersectionColor),P=m._intersectionWidth,r(P)){var L=P.getValue(n);r(L)&&(w.intersectionWidth=L)}}}}}var v=new a,g=function(e,t){if(!r(e))throw new n("scene is required.");if(!r(t))throw new n("dynamicObjectCollection is required.");t.collectionChanged.addEventListener(g.prototype._onObjectsRemoved,this),this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives,this._coneCollection=[],this._dynamicObjectCollection=t};g.prototype.update=function(e){if(!r(e))throw new n("time is required.");for(var t=this._dynamicObjectCollection.getObjects(),i=0,o=t.length;o>i;i++)p(this,e,t[i]);return!0},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){var e=this._dynamicObjectCollection;e.collectionChanged.removeEventListener(g.prototype._onObjectsRemoved,this);var t,r=e.getObjects(),n=r.length;for(t=0;n>t;t++)r[t]._coneVisualizerIndex=void 0;for(n=this._coneCollection.length,t=0;n>t;t++)this._primitives.remove(this._coneCollection[t]);return i(this)};var _=new e,y=new l;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/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/NearFarScalar","./Billboard","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function m(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}var f=function(o,s){if(o=i(o,i.EMPTY_OBJECT),n(o.translucencyByDistance)&&o.translucencyByDistance.far<=o.translucencyByDistance.near)throw new a("translucencyByDistance.far must be greater than translucencyByDistance.near.");if(n(o.pixelOffsetScaleByDistance)&&o.pixelOffsetScaleByDistance.far<=o.pixelOffsetScaleByDistance.near)throw new a("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");this._text=i(o.text,""),this._show=i(o.show,!0),this._font=i(o.font,"30px sans-serif"),this._fillColor=r.clone(i(o.fillColor,r.WHITE)),this._outlineColor=r.clone(i(o.outlineColor,r.BLACK)),this._outlineWidth=i(o.outlineWidth,1),this._style=i(o.style,c.FILL),this._verticalOrigin=i(o.verticalOrigin,h.BOTTOM),this._horizontalOrigin=i(o.horizontalOrigin,u.LEFT),this._pixelOffset=e.clone(i(o.pixelOffset,e.ZERO),new e),this._eyeOffset=t.clone(i(o.eyeOffset,t.ZERO)),this._position=t.clone(i(o.position,t.ZERO)),this._scale=i(o.scale,1),this._id=o.id,this._translucencyByDistance=o.translucencyByDistance,this._pixelOffsetScaleByDistance=o.pixelOffsetScaleByDistance,this._labelCollection=s,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0};return o(f.prototype,{show:{get:function(){return this._show},set:function(e){if(!n(e))throw new a("value is required.");if(e!==this._show){this._show=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var o=t[r];n(o.billboard)&&(o.billboard.show=e)}}}},position:{get:function(){return this._position},set:function(e){if(!n(e))throw new a("value is required.");var r=this._position;if(!t.equals(r,e)){t.clone(e,r);for(var i=this._glyphs,o=0,s=i.length;s>o;o++){var l=i[o];n(l.billboard)&&(l.billboard.position=e)}}}},text:{get:function(){return this._text},set:function(e){if(!n(e))throw new a("value is required.");e!==this._text&&(this._text=e,d(this))}},font:{get:function(){return this._font},set:function(e){if(!n(e))throw new a("value is required.");this._font!==e&&(this._font=e,d(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!n(e))throw new a("value is required.");var t=this._fillColor;r.equals(t,e)||(r.clone(e,t),d(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!n(e))throw new a("value is required.");var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),d(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!n(e))throw new a("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,d(this))}},style:{get:function(){return this._style},set:function(e){if(!n(e))throw new a("value is required.");this._style!==e&&(this._style=e,d(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(t){if(!n(t))throw new a("value is required.");var r=this._pixelOffset;e.equals(r,t)||(r=e.clone(t,r),m(this))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(!s.equals(this._translucencyByDistance,e)){if(e.far<=e.near)throw new a("far distance must be greater than near distance.");this._translucencyByDistance=s.clone(e,this._translucencyByDistance),d(this)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(!s.equals(this._pixelOffsetScaleByDistance,e)){if(e.far<=e.near)throw new a("far distance must be greater than near distance.");this._pixelOffsetScaleByDistance=s.clone(e,this._pixelOffsetScaleByDistance),d(this)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!n(e))throw new a("value is required.");var r=this._eyeOffset;if(!t.equals(r,e)){t.clone(e,r);for(var i=this._glyphs,o=0,s=i.length;s>o;o++){var l=i[o];n(l.billboard)&&(l.billboard.eyeOffset=e)}}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!n(e))throw new a("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,m(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!n(e))throw new a("value is required.");this._verticalOrigin!==e&&(this._verticalOrigin=e,m(this))}},scale:{get:function(){return this._scale},set:function(e){if(!n(e))throw new a("value is required.");if(this._scale!==e){this._scale=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var o=t[r];n(o.billboard)&&(o.billboard.scale=e)}m(this)}}},id:{get:function(){return this._id},set:function(e){this._id=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var o=t[r];n(o.billboard)&&(o.billboard.id=e)}}}}),f.prototype.computeScreenSpacePosition=function(e){if(!n(e))throw new a("context is required.");var t=this._labelCollection,r=t.modelMatrix,i=l._computeActualPosition(this._position,e.frameState,r);return l._computeScreenSpacePosition(r,i,this._eyeOffset,this._pixelOffset,e)},f.prototype.equals=function(i){return this===i||n(i)&&this._show===i._show&&this._scale===i._scale&&this._style===i._style&&this._verticalOrigin===i._verticalOrigin&&this._horizontalOrigin===i._horizontalOrigin&&this._text===i._text&&this._font===i._font&&t.equals(this._position,i._position)&&r.equals(this._fillColor,i._fillColor)&&r.equals(this._outlineColor,i._outlineColor)&&e.equals(this._pixelOffset,i._pixelOffset)&&t.equals(this._eyeOffset,i._eyeOffset)&&s.equals(this._translucencyByDistance,i._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,i._pixelOffsetScaleByDistance)&&this._id===i._id},f.prototype.isDestroyed=function(){return!1},f}),r("Scene/LabelCollection",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function f(){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 v(e,t,r,i,n,o,a){return C.font=t,C.fillColor=r,C.strokeColor=i,C.strokeWidth=n,C.textBaseline=a===m.BOTTOM?"bottom":a===m.TOP?"top":"middle",C.fill=o===h.FILL||o===h.FILL_AND_OUTLINE,C.stroke=o===h.OUTLINE||o===h.FILL_AND_OUTLINE,s(e,C)}function g(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;r(i)&&(i.show=!1,i.imageIndex=-1,e._spareBillboards.push(i),t.billboard=void 0)}function _(e,t){var i,n,o,a=t._text,s=a.length,l=t._glyphs,c=l.length;if(c>s)for(n=s;c>n;++n)g(e,l[n]);l.length=s;var h=e._glyphTextureCache,d=e._textureAtlas;for(o=0;s>o;++o){var m=a.charAt(o),_=t._font,y=t._fillColor,w=t._outlineColor,C=t._outlineWidth,b=t._style,S=t._verticalOrigin,x=JSON.stringify([m,_,y.toRgba(),w.toRgba(),C,+b,+S]),E=h[x];if(!r(E)){var T=v(m,_,y,w,C,b,S),P=-1;T.width>0&&T.height>0&&(P=d.addImage(T)),E=new p(e,P,T.dimensions),h[x]=E}if(i=l[o],r(i)?-1===E.index?g(e,i):r(i.textureInfo)&&(i.textureInfo=void 0):(i=new f,l[o]=i),i.textureInfo=E,i.dimensions=E.dimensions,-1!==E.index){var A=i.billboard;r(A)||(A=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add({collection:e}),i.billboard=A),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=u.LEFT,A.verticalOrigin=t._verticalOrigin,A.scale=t._scale,A.pickPrimitive=t,A.id=t._id,A.imageIndex=E.index,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance }}t._repositionAllGlyphs=!0}function y(e,t){var i,n,o=e._glyphs,a=0,s=0,l=0,c=o.length;for(l=0;c>l;++l)i=o[l],n=i.dimensions,a+=n.width,s=Math.max(s,n.height);var h=e._scale,d=e._horizontalOrigin,f=0;d===u.CENTER?f-=a/2*h:d===u.RIGHT&&(f-=a*h),b.x=f*t,b.y=0;var p=e._verticalOrigin;for(l=0;c>l;++l)i=o[l],n=i.dimensions,p===m.BOTTOM||n.height===s?b.y=-n.descent*h:p===m.TOP?b.y=-(s-n.height)*h-n.descent*h:p===m.CENTER&&(b.y=-(s-n.height)/2*h-n.descent*h),b.y*=t,r(i.billboard)&&i.billboard._setTranslate(b),b.x+=n.width*h*t}function w(e,t){for(var r=t._glyphs,i=0,o=r.length;o>i;++i)g(e,r[i]);t._labelCollection=void 0,n(t)}var C={},b=new e,S=function(e){e=t(e,t.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._resolutionScale=void 0,this.modelMatrix=a.clone(t(e.modelMatrix,a.IDENTITY)),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1)};return i(S.prototype,{length:{get:function(){return this._labels.length}}}),S.prototype.add=function(e){var t=new c(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},S.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),w(this,e),!0}return!1},S.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;r>t;++t)w(this,e[t]);e.length=0},S.prototype.contains=function(e){return r(e)&&e._labelCollection===this},S.prototype.get=function(e){if(!r(e))throw new o("index is required.");return this._labels[e]},S.prototype.update=function(e,t,i){var n=this._billboardCollection;n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume,r(this._textureAtlas)||(this._textureAtlas=new d({scene:{context:e}}),n.textureAtlas=this._textureAtlas);var o=e.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=0,c=l.length;c>u;++u){var h=l[u];if(!h.isDestroyed()){var m=h._glyphs.length;h._rebindAllGlyphs&&(_(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(y(h,a),h._repositionAllGlyphs=!1);var f=h._glyphs.length-m;this._totalGlyphCount+=f}}this._labelsToUpdate.length=0,n.update(e,t,i)},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),n(this)},S}),r("DynamicScene/DynamicLabelVisualizer",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/HorizontalOrigin","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(n,o,s){var c=s._label;if(i(c)){var h=c._text;if(i(h)){var g=s._position;if(i(g)){var _,y=c._show,w=s._labelVisualizerIndex,C=s.isAvailable(o)&&(!i(y)||y.getValue(o));if(!C)return i(w)&&(_=n._labelCollection.get(w),_.show=!1,n._unusedIndexes.push(w),s._labelVisualizerIndex=void 0),void 0;if(i(w))_=n._labelCollection.get(w);else{var b=n._unusedIndexes,S=b.length;S>0?(w=b.pop(),_=n._labelCollection.get(w)):(w=n._labelCollection.length,_=n._labelCollection.add()),s._labelVisualizerIndex=w,_.id=s,_.text="",_.scale=1,_.font="30px sans-serif",_.fillColor=r.WHITE,_.outlineColor=r.BLACK,_.outlineWidth=1,_.style=l.FILL,_.pixelOffset=e.ZERO,_.eyeOffset=t.ZERO,_.horizontalOrigin=a.CENTER,_.verticalOrigin=u.CENTER}_.show=C;var x=h.getValue(o);i(x)&&(_.text=x),d=g.getValue(o,d),i(d)&&(_.position=d);var E=c._scale;if(i(E)){var T=E.getValue(o);i(T)&&(_.scale=T)}if(E=c._font,i(E)){var P=E.getValue(o);i(P)&&(_.font=P)}if(E=c._fillColor,i(E)&&(m=E.getValue(o,m),i(m)&&(_.fillColor=m)),E=c._outlineColor,i(E)&&(f=E.getValue(o,f),i(f)&&(_.outlineColor=f)),E=c._outlineWidth,i(E)){var A=E.getValue(o);i(A)&&(_.outlineWidth=A)}if(E=c._style,i(E)){var M=E.getValue(o);i(M)&&(_.style=M)}if(E=c._pixelOffset,i(E)&&(v=E.getValue(o,v),i(v)&&(_.pixelOffset=v)),E=c._eyeOffset,i(E)&&(p=E.getValue(o,p),i(p)&&(_.eyeOffset=p)),E=c._horizontalOrigin,i(E)){var D=E.getValue(o);i(D)&&(_.horizontalOrigin=D)}if(E=c._verticalOrigin,i(E)){var I=E.getValue(o);i(I)&&(_.verticalOrigin=I)}E=c._translucencyByDistance,i(E)&&(_.translucencyByDistance=E.getValue(o)),E=c._pixelOffsetScaleByDistance,i(E)&&(_.pixelOffsetScaleByDistance=E.getValue(o))}}}}var h=function(e,t){if(!i(e))throw new o("scene is required.");if(!i(t))throw new o("dynamicObjectCollection is required.");var r=new s;e.primitives.add(r),t.collectionChanged.addEventListener(h.prototype._onObjectsRemoved,this),this._scene=e,this._unusedIndexes=[],this._labelCollection=r,this._dynamicObjectCollection=t};h.prototype.update=function(e){if(!i(e))throw new o("time is required.");for(var t=this._dynamicObjectCollection.getObjects(),r=0,n=t.length;n>r;r++)c(this,e,t[r]);return!0},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){var e=this._dynamicObjectCollection;e.collectionChanged.removeEventListener(h.prototype._onObjectsRemoved,this);for(var t=e.getObjects(),r=t.length,i=0;r>i;i++)t[i]._labelVisualizerIndex=void 0;return this._scene.primitives.remove(this._labelCollection),n(this)};var d,m,f,p,v;return h.prototype._onObjectsRemoved=function(e,t,r){for(var n=this._labelCollection,o=this._unusedIndexes,a=r.length-1;a>-1;a--){var s=r[a],l=s._labelVisualizerIndex;if(i(l)){var u=n.get(l);u.show=!1,o.push(l),s._labelVisualizerIndex=void 0}}},h}),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/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/Cartesian3","../Core/defined","../Core/LinearSpline","../Core/Quaternion","../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 e;l.getAnimationParameterValues=function(r,n){var s=a(r,n),l=u[s];if(!t(l)){var h,d=r._loadResources.buffers,m=r.gltf,f=m.bufferViews,p=f[n.bufferView],v=n.type,g=n.count,_=o[v].createArrayBufferView(d[p.buffer],p.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]=e.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]=i.fromAxisAngle(e.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(e,i,o,a,l,u){var c=s(e,i,a),m=h[c];if(!t(m)){var f=u[l.input],p=e.gltf.accessors[o.parameters[l.output]],v=u[l.output];1===f.length&&1===v.length?m=new d(v[0]):"LINEAR"===l.interpolation&&(p.type===WebGLRenderingContext.FLOAT_VEC3?m=new r({times:f,points:v}):p.type===WebGLRenderingContext.FLOAT_VEC4&&(m=new n({times:f,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/defineProperties","../Core/Event","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n){"use strict";var o=function(t,o,a){this._name=t.name,this._startTime=t.startTime,this._startOffset=e(t.startOffset,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,i.NONE),this.start=new r,this.update=new r,this.stop=new r,this._state=n.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 t(o.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},startOffset:{get:function(){return this._startOffset}},stopTime:{get:function(){return this._stopTime}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),o}),r("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],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 o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0};i(m.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),m.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var i=this._model,o=i._runtime.animations;if(!r(o))throw new n("Animations are not loaded. Wait for the model's readyToRender event or ready property.");var a=o[e.name];if(!r(a))throw new n("options.name must be a valid animation name.");if(r(e.speedup)&&e.speedup<=0)throw new n("options.speedup must be greater than zero.");var s=new l(e,i,a);return this._scheduledAnimations.push(s),this.animationAdded.raiseEvent(i,s),s},m.prototype.addAll=function(i){if(i=t(i,t.EMPTY_OBJECT),!r(this._model._runtime.animations))throw new n("Animations are not loaded. Wait for the model's readyToRender event or ready property.");if(r(i.speedup)&&i.speedup<=0)throw new n("options.speedup must be greater than zero.");i=e(i);var o=[],a=this._model.gltf.animations;for(var s in a)a.hasOwnProperty(s)&&(i.name=s,o.push(this.add(i)));return o},m.prototype.remove=function(e){if(r(e)){var t=this._scheduledAnimations,i=t.indexOf(e);if(-1!==i)return t.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 r(e)?-1!==this._scheduledAnimations.indexOf(e):!1},m.prototype.get=function(e){if(!r(e))throw new n("index is required.");return this._scheduledAnimations[e]};var f=[];return m.prototype.update=function(e){if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var i=!1,n=e.time,o=this._model,l=this._scheduledAnimations,m=l.length,p=0;m>p;++p){var v=l[p],g=v._runtimeAnimation;r(v._startTime)||(v._startTime=a.addSeconds(t(v.startTime,n),v.startOffset,new a)),r(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._startTime,y=v._duration,w=v.stopTime,C=0!==y?a.getSecondsDifference(n,_)/y:0,b=C>=0,S=b&&(1>=C||v.loop===u.REPEAT||v.loop===u.MIRRORED_REPEAT)&&(!r(w)||a.lessThanOrEquals(n,w));if(S){if(v._state===c.STOPPED&&(v._state=c.ANIMATING,v.start.numberOfListeners>0&&e.afterRender.push(v._raiseStartEvent)),v.loop===u.REPEAT)C-=Math.floor(C);else if(v.loop===u.MIRRORED_REPEAT){var x=Math.floor(C),E=C-x;C=1===x%2?1-E:E}v.reverse&&(C=1-C);var T=C*y*v.speedup;T=s.clamp(T,g.startTime,g.stopTime),h(g,T),v.update.numberOfListeners>0&&(v._updateEventTime=T,e.afterRender.push(v._raiseUpdateEvent)),i=!0}else b&&v._state===c.ANIMATING&&(v._state=c.STOPPED,v.stop.numberOfListeners>0&&e.afterRender.push(v._raiseStopEvent),v.removeOnStop&&f.push(v))}m=f.length;for(var P=0;m>P;++P){var A=f[P];l.splice(l.indexOf(A),1),e.afterRender.push(d(this,o,A))}return f.length=0,i},m}),r("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(e,t,r){this._name=t.name,this._id=r,this._uniformMap=e._rendererResources.uniformMaps[r]};return t(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),i.prototype.setValue=function(t,i){if(!e(t))throw new r("name is required.");var n=this._uniformMap.values[t];if(!e(n))throw new r("name must match a parameter name in the material's technique that is targetable and not optimized out.");n.value=n.clone(i,n.value)},i.prototype.getValue=function(t){if(!e(t))throw new r("name is required.");var i=this._uniformMap.values[t];return e(i)?i.value:void 0},i}),r("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";var t=function(e,t,r){for(var i=[],n=e.primitives,o=n.length,a=0;o>a;++a){var s=n[a];i[a]=t[s.material]}this._name=e.name,this._materials=i,this._id=r};return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),r("Scene/ModelNode",["../Core/defaultValue","../Core/defineProperties","../Core/Matrix4"],function(e,t,r){"use strict";var i=function(t,i,n,o){this._model=t,this._runtimeNode=n,this._name=i.name,this._id=o,this.useMatrix=!1,this._matrix=r.clone(e(i.matrix,r.IDENTITY))};return t(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},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("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../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/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../ThirdParty/gltfDefaults","../ThirdParty/Uri","./BlendingState","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./ModelMesh","./ModelNode","./ModelTypes","./Pass","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I,O,R,L,N,B,F,z){"use strict";function V(){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 q(e,t,r){if(e._state!==kt.LOADED)throw new u("The model is not loaded. Wait for the model's readyToRender event or ready property.");if(!a(r))throw new u("name is required.");return e._runtime[t][r]}function k(e){if(a(e.matrix))return _.fromArray(e.matrix);var t=r.fromArray(e.rotation,0,Wt);return _.fromTranslationQuaternionRotationScale(r.fromArray(e.translation,0,Gt),w.fromAxisAngle(t,e.rotation[3],Ht),r.fromArray(e.scale,0,jt))}function U(t){for(var i=t.nodes,n=t.meshes,s=t.accessors,l=t.scenes[t.scene].nodes,u=l.length,c=[],h=new r(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=new r(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),m=0;u>m;++m){var f=i[l[m]];for(f._transformToRoot=k(f),c.push(f);c.length>0;){f=c.pop();var p=f._transformToRoot,v=o(f.meshes,a(f.instanceSkin)?f.instanceSkin.sources:void 0);if(a(v))for(var g=v.length,y=0;g>y;++y)for(var w=n[v[y]].primitives,C=w.length,b=0;C>b;++b){var S=w[b].attributes.POSITION;if(a(S)){var x=s[S],E=r.fromArray(x.min,0,Yt),T=r.fromArray(x.max,0,Xt);a(h)&&a(d)&&(_.multiplyByPoint(p,E,E),_.multiplyByPoint(p,T,T),r.getMinimumByComponent(h,E,h),r.getMaximumByComponent(d,T,d))}}for(var P=f.children,A=P.length,M=0;A>M;++M){var D=i[P[M]];D._transformToRoot=k(D),_.multiplyTransformation(p,D._transformToRoot,D._transformToRoot),c.push(D)}delete f._transformToRoot}}return e.fromCornerPoints(h,d)}function W(e,t,r){return function(){e._loadError=new b("Failed to load external "+t+": "+r),e._state=kt.FAILED}}function G(e,t){return function(r){var i=e._loadResources;i.buffers[t]=r,--i.pendingBufferLoads}}function H(e){var t=e.gltf.buffers;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingBufferLoads;var i=t[r],n=new M(a(i.uri)?i.uri:i.path),o=n.resolve(e._baseUri).toString();d(o).then(G(e,r),W(e,"buffer",o))}}function j(e){var t=e.gltf.bufferViews;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.buffersToCreate.enqueue(r)}function Y(e,t){return function(r){var i=e._loadResources;i.shaders[t]=r,--i.pendingShaderLoads}}function X(e){var t=e.gltf.shaders;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingShaderLoads;var i=t[r],n=new M(a(i.uri)?i.uri:i.path),o=n.resolve(e._baseUri).toString();f(o).then(Y(e,r),W(e,"shader",o))}}function Z(e){var t=e.gltf.programs;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.programsToCreate.enqueue(r)}function J(e,t){return function(r){var i=e._loadResources;--i.pendingTextureLoads,i.texturesToCreate.enqueue({name:t,image:r})}}function Q(e){var t=e.gltf.images,r=e.gltf.textures;for(var i in r)if(r.hasOwnProperty(i)){++e._loadResources.pendingTextureLoads;var n=r[i],o=new M(a(t[n.source].uri)?t[n.source].uri:t[n.source].path),s=o.resolve(e._baseUri).toString();m(s).then(J(e,i),W(e,"image",s))}}function K(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesNames,o=e.gltf.nodes;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,transformToRoot:new _,computedMatrix:new _,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointId:l.jointId,children:[],parents:[],publicNode:void 0};u.publicNode=new N(e,l,u,s),t[s]=u,r[l.name]=u,a(l.instanceSkin)&&(n.push(s),i.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function $(e){var t={},r={},i=e.gltf.materials,n=e._rendererResources.uniformMaps;for(var o in i)if(i.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=i[o],s=new R(e,a,o);t[a.name]=s,r[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=r}function et(e){var t={},r=e._runtime.materialsById,i=e.gltf.meshes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];t[o.name]=new L(o,r,n)}e._runtime.meshesByName=t}function tt(e){H(e),j(e),X(e),Z(e),Q(e),$(e),et(e),K(e)}function rt(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){for(var i,n,o=e.gltf.bufferViews,s=r.buffers,l=e._rendererResources.buffers;r.buffersToCreate.length>0;){var u=r.buffersToCreate.dequeue();if(n=o[u],n.target===WebGLRenderingContext.ARRAY_BUFFER){i=new Uint8Array(s[n.buffer],n.byteOffset,n.byteLength);var c=t.createVertexBuffer(i,S.STATIC_DRAW);c.vertexArrayDestroyable=!1,l[u]=c}}var h=e.gltf.accessors;for(var d in h)if(h.hasOwnProperty(d)){var m=h[d];if(n=o[m.bufferView],n.target===WebGLRenderingContext.ELEMENT_ARRAY_BUFFER&&!a(l[m.bufferView])){i=new Uint8Array(s[n.buffer],n.byteOffset,n.byteLength);var f=t.createIndexBuffer(i,S.STATIC_DRAW,m.type);f.vertexArrayDestroyable=!1,l[m.bufferView]=f}}}}function it(e){for(var t={},r=e.length,i=0;r>i;++i)t[e[i]]=i;return t}function nt(e,t,r){var i=t.gltf.programs,n=t._loadResources.shaders,o=i[e],a=it(o.attributes),s=n[o.vertexShader],l=n[o.fragmentShader];if(t._rendererResources.programs[e]=r.createShaderProgram(s,l,a),t.allowPicking){var u=x({sources:[l],pickColorQualifier:"uniform"});t._rendererResources.pickPrograms[e]=r.createShaderProgram(s,u,a)}}function ot(e,t){var r,i=e._loadResources;if(0===i.pendingShaderLoads)if(e.asynchronous)i.programsToCreate.length>0&&(r=i.programsToCreate.dequeue(),nt(r,e,t));else for(;i.programsToCreate.length>0;)r=i.programsToCreate.dequeue(),nt(r,e,t)}function at(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 st(e,t,r){var i=t.gltf.textures,n=i[e.name],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===T.NEAREST_MIPMAP_NEAREST||a.minificationFilter===T.NEAREST_MIPMAP_LINEAR||a.minificationFilter===T.LINEAR_MIPMAP_NEAREST||a.minificationFilter===T.LINEAR_MIPMAP_LINEAR,l=s||a.wrapS===P.REPEAT||a.wrapS===P.MIRRORED_REPEAT||a.wrapT===P.REPEAT||a.wrapT===P.MIRRORED_REPEAT,u=e.image,c=!p.isPowerOfTwo(u.width)||!p.isPowerOfTwo(u.height);if(l&&c){var h=document.createElement("canvas");h.width=p.nextPowerOfTwo(u.width),h.height=p.nextPowerOfTwo(u.height);var d=h.getContext("2d");d.drawImage(u,0,0,u.width,u.height,0,0,h.width,h.height),u=h}var m;n.target===WebGLRenderingContext.TEXTURE_2D&&(m=r.createTexture2D({source:u,pixelFormat:n.internalFormat,pixelDatatype:n.type,flipY:!1})),s&&m.generateMipmap(),m.sampler=a,t._rendererResources.textures[e.name]=m}function lt(e,t){var r,i=e._loadResources;if(e.asynchronous)i.texturesToCreate.length>0&&(r=i.texturesToCreate.dequeue(),st(r,e,t));else for(;i.texturesToCreate.length>0;)r=i.texturesToCreate.dequeue(),st(r,e,t)}function ut(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].vertexAttributes;for(var d in c)if(c.hasOwnProperty(d)){var m=s[c[d]];o[m.semantic]=h[d].index}return o}function ct(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 ht(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=[],f=h.skeletons,p=f.length,v=0;p>v;++v)m.push(o[f[v]]);for(var g=i[h.skin].joints,_=g.length,y=0;_>y;++y){var w=g[y];c.joints.push(ct(m,w))}}}function dt(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=B[h].createArrayBufferView(i[c.buffer],c.byteOffset+u.byteOffset,d),f=new Array(d);if(h===WebGLRenderingContext.FLOAT_MAT4)for(var p=0;d>p;++p)f[p]=_.fromArray(m,16*p);var v;_.equals(l.bindShapeMatrix,_.IDENTITY)||(v=_.clone(l.bindShapeMatrix)),a[s]={inverseBindMatrices:f,bindShapeMatrix:v}}ht(e,a)}}function mt(e,t,r,i){return function(n){t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber}}function ft(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]=I.getAnimationParameterValues(e,o[u[r]]));for(var d=Number.MAX_VALUE,m=-Number.MAX_VALUE,f=l.length,p=new Array(f),v=0;f>v;++v){var g=l[v],_=g.target,y=c[g.sampler],w=h[y.input];d=Math.min(d,w[0]),m=Math.max(m,w[w.length-1]);var C=I.getAnimationSpline(e,a,s,g.sampler,y,h);p[v]=mt(e,i[_.id],_.path,C)}e._runtime.animations[a]={startTime:d,stopTime:m,channelEvaluators:p}}}}function pt(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,o=e.gltf,s=o.accessors,l=o.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],f=ut(e,m),p=[],v=m.attributes;for(var g in v)if(v.hasOwnProperty(g)){var _=f[g];if(a(_)){var y=s[v[g]],w=B[y.type];p.push({index:_,vertexBuffer:i[y.bufferView],componentsPerAttribute:w.componentsPerAttribute,componentDatatype:w.componentDatatype,normalize:!1,offsetInBytes:y.byteOffset,strideInBytes:y.byteStride})}}var C=s[m.indices],b=i[C.bufferView];n[u+".primitive."+d]=t.createVertexArray(p,b)}}}function vt(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?D.ALPHA_BLEND:D.DISABLED})}}}function gt(e){var t={value:e,clone:function(e){return e},func:function(){return t.value}};return t}function _t(e){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function yt(e){var t={value:r.fromArray(e),clone:r.clone,func:function(){return t.value}};return t}function wt(e){var t={value:i.fromArray(e),clone:i.clone,func:function(){return t.value}};return t}function Ct(e){var t={value:v.fromColumnMajorArray(e),clone:v.clone,func:function(){return t.value}};return t}function bt(e){var t={value:g.fromColumnMajorArray(e),clone:g.clone,func:function(){return t.value}};return t}function St(e){var t={value:_.fromColumnMajorArray(e),clone:_.clone,func:function(){return t.value}};return t}function xt(e,t){var r={value:t._rendererResources.textures[e],clone:function(e){return e},func:function(){return r.value}};return r}function Et(e,t){var r=t._runtime.nodes[e];return function(){return r.computedMatrix}}function Tt(e,t){var r=e._loadResources;if(r.finishedTextureCreation()&&r.finishedProgramCreation()&&r.createUniformMaps){r.createUniformMaps=!1;var i=e.gltf,n=i.materials,o=i.techniques;i.programs;var s=e._rendererResources.uniformMaps;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l],c=u.instanceTechnique,h=c.values,d=o[c.technique],m=d.parameters,f=d.passes[d.pass],p=f.instanceProgram,v=p.uniforms;e._rendererResources.programs[p.program].allUniforms;var g,_={},y={};for(var w in v)if(v.hasOwnProperty(w)){var C=v[w],b=m[C];if(a(h[C])){var S=Jt[b.type](h[C],e);_[w]=S.func,y[C]=S}else if(a(b.semantic))"JOINT_MATRIX"!==b.semantic?_[w]=Zt[b.semantic](t.uniformState):g=w;else if(a(b.source))_[w]=Et(b.source,e);else if(a(b.value)){var x=Jt[b.type](b.value,e);_[w]=x.func,y[C]=x}}var E=s[l];E.uniformMap=_,E.values=y,E.jointMatrixUniformName=g}}}function Pt(e){return function(){return e}}function At(e){return function(){return e.computedJointMatrices}}function Mt(t,i,s,l){for(var u=t._renderCommands,c=t._pickCommands,d=t._pickIds,m=t.allowPicking,f=t._runtime.meshesByName,p=t.debugShowBoundingVolume,v=t._rendererResources,g=v.vertexArrays,y=v.programs,w=v.pickPrograms,C=v.renderStates,b=v.uniformMaps,S=t.gltf,x=S.accessors,T=S.meshes,P=S.techniques,A=S.materials,M=a(i.meshes)?i.meshes:i.instanceSkin.sources,D=M.length,I=0;D>I;++I)for(var O=M[I],R=T[O],L=R.primitives,N=L.length,B=0;N>B;++B){var z,V=L[B],q=x[V.indices],k=A[V.material].instanceTechnique,U=P[k.technique],W=U.passes[U.pass],G=W.instanceProgram,H=V.attributes.POSITION;if(a(H)){var j=x[H];z=e.fromCornerPoints(r.fromArray(j.min),r.fromArray(j.max))}var Y=g[O+".primitive."+B],X=q.count,Z=q.byteOffset/h.getSizeInBytes(q.type),J=b[V.material],Q=J.uniformMap;if(a(J.jointMatrixUniformName)){var K={};K[J.jointMatrixUniformName]=At(s),Q=n(Q,K)}var $=W.states.blendEnable,et=C[k.technique],tt={primitive:o(t.pickPrimitive,t),id:t.id,node:s.publicNode,mesh:f[R.name]},rt=new E({boundingVolume:new e,modelMatrix:new _,primitiveType:V.primitive,vertexArray:Y,count:X,offset:Z,shaderProgram:y[G.program],uniformMap:Q,renderState:et,owner:tt,debugShowBoundingVolume:p,pass:$?F.TRANSLUCENT:F.OPAQUE});u.push(rt);var it;if(m){var nt=l.createPickId(tt);d.push(nt);var ot=n(Q,{czm_pickColor:Pt(nt.color)});it=new E({boundingVolume:new e,modelMatrix:new _,primitiveType:V.primitive,vertexArray:Y,count:X,offset:Z,shaderProgram:w[G.program],uniformMap:ot,renderState:et,owner:tt,pass:$?F.TRANSLUCENT:F.OPAQUE}),c.push(it)}s.commands.push({command:rt,pickCommand:it,boundingSphere:z})}}function Dt(e,t){var i=e._loadResources;if(i.finishedPendingLoads()&&i.finishedResourceCreation()&&i.createRuntimeNodes){i.createRuntimeNodes=!1;for(var n=[],o=e._runtime.nodes,s=e.gltf,l=s.nodes,u=s.scenes[s.scene],c=u.nodes,h=c.length,d=[],m=new r,f=0;h>f;++f)for(d.push({parentRuntimeNode:void 0,gltfNode:l[c[f]],id:c[f]});d.length>0;){var p=d.pop(),v=p.parentRuntimeNode,g=p.gltfNode,y=o[p.id];0===y.parents.length&&(a(g.matrix)?y.matrix=_.fromColumnMajorArray(g.matrix):(m=r.fromArray(g.rotation,0,m),y.translation=r.fromArray(g.translation),y.rotation=w.fromAxisAngle(m,g.rotation[3]),y.scale=r.fromArray(g.scale))),a(v)?(v.children.push(y),y.parents.push(v)):n.push(y),(a(g.meshes)||a(g.instanceSkin))&&Mt(e,g,y,t);for(var C=g.children,b=C.length,S=0;b>S;++S)d.push({parentRuntimeNode:y,gltfNode:l[C[S]],id:C[S]})}e._runtime.rootNodes=n,e._runtime.nodes=o}}function It(e,t){rt(e,t),ot(e,t),at(e,t),lt(e,t),dt(e),ft(e),pt(e,t),vt(e,t),Tt(e,t),Dt(e,t)}function Ot(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&a(i)?_.clone(i,t):a(e.matrix)?_.clone(e.matrix,t):_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)}function Rt(t,r,i){for(var n=t._maxDirtyNumber,o=t.allowPicking,a=t._runtime.rootNodes,s=a.length,l=Qt,u=t._computedModelMatrix,c=0;s>c;++c){var h=a[c];for(Ot(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 f=m.length; if(f>0)for(var p=0;f>p;++p){var v=m[p],g=v.command;if(_.multiplyTransformation(u,d,g.modelMatrix),e.transform(v.boundingSphere,g.modelMatrix,g.boundingVolume),o){var y=v.pickCommand;_.clone(g.modelMatrix,y.modelMatrix),e.clone(g.boundingVolume,y.boundingVolume)}}else h.computedMatrix=_.multiplyTransformation(u,d,h.computedMatrix)}for(var w=h.children,C=w.length,b=0;C>b;++b){var S=w[b];S.dirtyNumber=Math.max(S.dirtyNumber,h.dirtyNumber),(S.dirtyNumber===n||i)&&(Ot(S,S.transformToRoot),_.multiplyTransformation(d,S.transformToRoot,S.transformToRoot)),l.push(S)}}}++t._maxDirtyNumber}function Lt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;r>i;++i){var n=t[i];Kt=_.inverseTransformation(n.transformToRoot,Kt);for(var o=n.computedJointMatrices,s=n.joints,l=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)o[h]=_.multiplyTransformation(Kt,s[h].transformToRoot,o[h]),o[h]=_.multiplyTransformation(o[h],u[h],o[h]),a(l)&&(o[h]=_.multiplyTransformation(o[h],l,o[h]))}}function Nt(e){var t=e.id;if(e._id!==t){e._id=t;for(var r=e._pickIds,i=r.length,n=0;i>n;++n)r[n].object.id=t}}function Bt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?y.LINES:y.TRIANGLES,r=e._renderCommands,i=r.length,n=0;i>n;++n)r[n].primitiveType=t}}function Ft(e,t,i,n){var o=n.camera,a=o.frustum,s=r.subtract(o.positionWC,e,er),l=r.multiplyByScalar(o.directionWC,r.dot(s,o.directionWC),tr),u=Math.max(a.near,r.magnitude(l)-t);$t.x=i.drawingBufferWidth,$t.y=i.drawingBufferHeight;var c=a.getPixelSize($t,u),h=Math.max(c.x,c.y);return h}function zt(e,t,r){var i=e._scale;if(0!==e.minimumPixelSize){var n=Math.max(t.drawingBufferWidth,t.drawingBufferHeight),o=e.modelMatrix;rr.x=o[12],rr.y=o[13],rr.z=o[14];var a=e.boundingSphere.radius,s=Ft(rr,a,t,r),l=1/s,u=Math.min(l*2*a,n);uh;++h)r.push(m[h]);if(f.pick)for(m=this._pickCommands,d=m.length,h=0;d>h;++h)r.push(m[h])}}},Ut.prototype.isDestroyed=function(){return!1},Ut.prototype.destroy=function(){var e=this._rendererResources;Vt(e.buffers),Vt(e.vertexArrays),qt(e.programs),qt(e.pickPrograms),Vt(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 l(this)},Ut}),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){if(!r(e))throw new n("scene is required.");if(!r(t))throw new n("dynamicObjectCollection is required.");t.collectionChanged.addEventListener(c.prototype._onObjectsRemoved,this),this._scene=e,this._primitives=e.primitives,this._dynamicObjectCollection=void 0,this._dynamicObjectCollection=t};return c.prototype.update=function(e){if(!r(e))throw new n("time is requied.");for(var t=this._dynamicObjectCollection.getObjects(),i=0,o=t.length;o>i;i++)this._updateObject(e,t[i]);return!0},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._dynamicObjectCollection.getObjects(),t=e.length-1;t>-1;t--){var n=e[t],o=n._modelPrimitive;r(o)&&(this._primitives.remove(o),o.isDestroyed()||o.destroy(),n._modelPrimitive=void 0)}return 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 f=n._modelPrimitive,p=h._show,v=n.isAvailable(i)&&(!r(p)||p.getValue(i)),g=d.getValue(i,c);if(!v||!r(g))return r(f)&&(f.show=!1),void 0;r(f)&&g===n._modelPrimitiveUri||(r(f)&&(this._primitives.remove(f),f.isDestroyed()||f.destroy()),f=l.fromGltf({url:g}),n._modelPrimitiveUri=g,f.id=n,f._visualizerOrientation=s.clone(s.IDENTITY),this._primitives.add(f),n._modelPrimitive=f),f.show=!0;var _,y=t(m.getValue(i,y),f._visualizerPosition),w=n._orientation;_=r(w)?t(w.getValue(i,_),f._visualizerOrientation):f._visualizerOrientation,!r(y)||!r(_)||e.equals(y,f._visualizerPosition)&&s.equals(_,f._visualizerOrientation)||(a.fromRotationTranslation(o.fromQuaternion(_,u),y,f.modelMatrix),f._visualizerPosition=e.clone(y,f._visualizerPosition),f._visualizerOrientation=s.clone(_,f._visualizerOrientation));var C=h._scale;if(r(C)){var b=C.getValue(i);r(b)&&(f.scale=b)}var S=h._minimumPixelSize;if(r(S)){var x=S.getValue(i);r(x)&&(f.minimumPixelSize=x)}}}}},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("Shaders/PolylineCommon",[],function(){"use strict";return"void 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_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\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("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("Scene/Polyline",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){++e._propertiesChanged[t];var r=e._polylineCollection;n(r)&&(r._updatePolyline(e,t),e._dirty=!0)}var h=function(o,a){o=i(o,i.EMPTY_OBJECT),this._show=i(o.show,!0),this._width=i(o.width,1),this._loop=i(o.loop,!1),this._material=o.material,n(this._material)||(this._material=u.fromType(u.ColorType,{color:new r(1,1,1,1)}));var c=o.positions;n(c)||(c=[]),this._positions=c,this._loop&&c.length>2&&!t.equals(c[0],c[c.length-1])&&c.push(t.clone(c[0])),this._length=c.length,this._id=o.id;var h;n(a)&&(h=s.clone(a.modelMatrix)),this._modelMatrix=h,this._segments=l.wrapLongitude(c,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(g),this._polylineCollection=a,this._dirty=!1,this._pickId=void 0,this._boundingVolume=e.fromPoints(this._positions),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new e},d=h.SHOW_INDEX=0,m=h.WIDTH_INDEX=1,f=h.POSITION_INDEX=2,p=h.MATERIAL_INDEX=3,v=h.POSITION_SIZE_INDEX=4,g=h.NUMBER_OF_PROPERTIES=5;return o(h.prototype,{show:{get:function(){return this._show},set:function(e){if(!n(e))throw new a("value is required.");e!==this._show&&(this._show=e,c(this,d))}},positions:{get:function(){return this._positions},set:function(r){if(!n(r))throw new a("value is required.");this._loop&&r.length>2&&!t.equals(r[0],r[r.length-1])&&r.push(t.clone(r[0])),(this._positions.length!==r.length||this._positions.length!==this._length)&&c(this,v),this._positions=r,this._length=r.length,this._boundingVolume=e.fromPoints(this._positions,this._boundingVolume),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),c(this,f),this.update()}},material:{get:function(){return this._material},set:function(e){if(!n(e))throw new a("material is required.");this._material!==e&&(this._material=e,c(this,p))}},width:{get:function(){return this._width},set:function(e){if(!n(e))throw new a("value is required.");var t=this._width;e!==t&&(this._width=e,c(this,m))}},loop:{get:function(){return this._loop},set:function(e){if(!n(e))throw new a("value is required.");if(e!==this._loop){var r=this._positions;e?r.length>2&&!t.equals(r[0],r[r.length-1])&&r.push(t.clone(r[0])):r.length>2&&t.equals(r[0],r[r.length-1])&&r.pop(),this._loop=e,c(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,n(this._pickId)&&(this._pickId.object.id=e)}}}),h.prototype.update=function(){var t=s.IDENTITY;n(this._polylineCollection)&&(t=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,i=this._segments.lengths,o=this._propertiesChanged[f]>0||this._propertiesChanged[v]>0;if((!s.equals(t,this._modelMatrix)||o)&&(this._segments=l.wrapLongitude(this._positions,t),this._boundingVolumeWC=e.transform(this._boundingVolume,t,this._boundingVolumeWC)),this._modelMatrix=t,this._segments.positions.length!==r)c(this,v);else for(var a=i.length,u=0;a>u;++u)if(i[u]!==this._segments.lengths[u]){c(this,v);break}},h.prototype.getPickId=function(e){return n(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},h.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;g-1>t;++t)e[t]=0},h.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},h}),r("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BlendingState","./Material","./Pass","./Polyline","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E){"use strict";function T(t,r,i,n,o,s,l){for(var u=n.length,c=0,h=!0,d=t._vertexArrays,m=t.debugShowBoundingVolume,f=d.length,p=0;f>p;++p)for(var v=d[p],_=v.buckets,y=_.length,w=0;y>w;++w){for(var C,b,x,T=_[w],P=T.offset,A=l?T.bucket.shaderProgram:T.bucket.pickShaderProgram,D=T.bucket.polylines,I=D.length,O=0,R=0;I>R;++R){var L=D[R],N=M(L._material);if(N!==C){if(a(C)&&O>0){var B=b.isTranslucent();c>=u?(x=new g({owner:t}),n.push(x)):x=n[c],++c,x.boundingVolume=e.clone(j,x.boundingVolume),x.modelMatrix=s,x.shaderProgram=A,x.vertexArray=v.va,x.renderState=B?t._translucentRS:t._opaqueRS,x.pass=B?S.TRANSLUCENT:S.OPAQUE,x.debugShowBoundingVolume=l?m:!1,x.uniformMap=b._uniforms,x.count=O,x.offset=P,P+=O,O=0,h=!0,o.push(x)}b=L._material,b.update(r),C=N}for(var F=L._locatorBuckets,z=F.length,V=0;z>V;++V){var q=F[V];q.locator===T&&(O+=q.count)}var k;i.mode===E.SCENE3D?k=L._boundingVolumeWC:i.mode===E.COLUMBUS_VIEW?k=L._boundingVolume2D:i.mode===E.SCENE2D?a(L._boundingVolume2D)&&(k=e.clone(L._boundingVolume2D,Y),k.center.x=0):a(L._boundingVolumeWC)&&a(L._boundingVolume2D)&&(k=e.union(L._boundingVolumeWC,L._boundingVolume2D,Y)),h?(h=!1,e.clone(k,j)):e.union(k,j,j)}a(C)&&O>0&&(c>=u?(x=new g({owner:t}),n.push(x)):x=n[c],++c,x.boundingVolume=e.clone(j,x.boundingVolume),x.modelMatrix=s,x.shaderProgram=A,x.vertexArray=v.va,x.renderState=b.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=b.isTranslucent()?S.TRANSLUCENT:S.OPAQUE,x.debugShowBoundingVolume=l?m:!1,x.uniformMap=b._uniforms,x.count=O,x.offset=P,h=!0,o.push(x)),C=void 0}n.length=c}function P(e){for(var t=e._buffersUsage,r=!1,i=e._propertiesChanged,n=0;W-2>n;++n){var o=t[n];i[n]?o.bufferUsage!==p.STREAM_DRAW?(r=!0,o.bufferUsage=p.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==p.STATIC_DRAW&&(0===o.frameCount?(r=!0,o.bufferUsage=p.STATIC_DRAW):o.frameCount--)}return r}function A(e,t,r){e._createVertexArray=!1,R(e),L(e),D(e);var i,o,s=[[]],l=s[0],u=[0],c=0,d=[[]],f=0,v=e._polylineBuckets;for(i in v)v.hasOwnProperty(i)&&(o=v[i],o.updateShader(t),f+=o.lengthOfPositions);if(f>0){var g,_=e._mode,y=new Float32Array(3*6*f),w=new Uint8Array(4*f),C=new Float32Array(4*f),b=0,S=0,x=0;for(i in v)if(v.hasOwnProperty(i)){o=v[i],o.write(y,w,C,b,S,x,t,r),_===E.MORPHING&&(a(g)||(g=new Float32Array(3*6*f)),o.writeForMorph(g,b));var T=o.lengthOfPositions;b+=3*6*T,S+=4*T,x+=4*T,c=o.updateIndices(s,u,d,c)}var P=e._buffersUsage[q].bufferUsage,A=e._buffersUsage[z].bufferUsage,M=e._buffersUsage[V].bufferUsage,I=A===p.STREAM_DRAW||M===p.STREAM_DRAW?p.STREAM_DRAW:p.STATIC_DRAW;e._positionBuffer=t.createVertexBuffer(y,P);var O;a(g)&&(O=t.createVertexBuffer(g,P)),e._pickColorBuffer=t.createVertexBuffer(w,p.STATIC_DRAW),e._texCoordExpandWidthAndShowBuffer=t.createVertexBuffer(C,I);for(var N=4*Uint8Array.BYTES_PER_ELEMENT,B=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,k=0,U=s.length,W=0;U>W;++W)if(l=s[W],l.length>0){var H=new Uint16Array(l),j=t.createIndexBuffer(H,p.STATIC_DRAW,h.UNSIGNED_SHORT);k+=u[W];var Y,Z,J,Q,K=6*(W*B*m.SIXTY_FOUR_KILOBYTES-k*B),$=B+K,et=B+$,tt=B+et,rt=B+tt,it=B+rt,nt=W*N*m.SIXTY_FOUR_KILOBYTES-k*N,ot=W*F*m.SIXTY_FOUR_KILOBYTES-k*F,at=[{index:G.position3DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:K,strideInBytes:6*B},{index:G.position3DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:$,strideInBytes:6*B},{index:G.position2DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:K,strideInBytes:6*B},{index:G.position2DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:$,strideInBytes:6*B},{index:G.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:et,strideInBytes:6*B},{index:G.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:tt,strideInBytes:6*B},{index:G.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:et,strideInBytes:6*B},{index:G.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:tt,strideInBytes:6*B},{index:G.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:rt,strideInBytes:6*B},{index:G.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:it,strideInBytes:6*B},{index:G.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:rt,strideInBytes:6*B},{index:G.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:it,strideInBytes:6*B},{index:G.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:n.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:ot},{index:G.pickColor,componentsPerAttribute:4,componentDatatype:n.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:nt,normalize:!0}];_===E.SCENE3D?(Y=e._positionBuffer,Z="vertexBuffer",J=X,Q="value"):_===E.SCENE2D||_===E.COLUMBUS_VIEW?(Y=X,Z="value",J=e._positionBuffer,Q="vertexBuffer"):(Y=O,Z="vertexBuffer",J=e._positionBuffer,Q="vertexBuffer"),at[0][Z]=Y,at[1][Z]=Y,at[2][Q]=J,at[3][Q]=J,at[4][Z]=Y,at[5][Z]=Y,at[6][Q]=J,at[7][Q]=J,at[8][Z]=Y,at[9][Z]=Y,at[10][Q]=J,at[11][Q]=J;var st=t.createVertexArray(at,j);e._vertexArrays.push({va:st,buckets:d[W]})}}}function M(e){var t=b._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 D(e){for(var t=e._mode,r=e._modelMatrix,i=e._polylineBuckets={},n=e._polylines,o=n.length,s=0;o>s;++s){var l=n[s];if(l.positions.length>1){l.update();var u=l.material,c=i[u.type];a(c)||(c=i[u.type]=new J(u,t,r)),c.addPolyline(l)}}}function I(e,t){var r=t.mode;e._mode===r&&f.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._modelMatrix=f.clone(e.modelMatrix),e._createVertexArray=!0)}function O(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],r=e._polylines.length,i=0,n=0;r>i;++i){var o=e._polylines[i];a(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function R(e){for(var t=e._polylines,r=t.length,i=0;r>i;++i)if(a(t[i])){var n=t[i]._bucket;a(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function L(e){for(var t=e._vertexArrays.length,r=0;t>r;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function N(e){for(var t=e._polylines,r=t.length,i=0;r>i;++i)a(t[i])&&t[i]._destroy()}function B(e,t,r){this.count=e,this.offset=t,this.bucket=r}function F(e){return t.dot(t.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersect(r.UNIT_Y)===d.INTERSECTING}var z=x.SHOW_INDEX,V=x.WIDTH_INDEX,q=x.POSITION_INDEX,k=x.MATERIAL_INDEX,U=x.POSITION_SIZE_INDEX,W=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(e){e=o(e,o.EMPTY_OBJECT),this.modelMatrix=f.clone(o(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=o(e.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(W),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:p.STATIC_DRAW,frameCount:0},{bufferUsage:p.STATIC_DRAW,frameCount:0},{bufferUsage:p.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0};s(H.prototype,{length:{get:function(){return O(this),this._polylines.length}}}),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,a(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},H.prototype.removeAll=function(){R(this),N(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},H.prototype.contains=function(e){return a(e)&&e._polylineCollection===this},H.prototype.get=function(e){if(!a(e))throw new u("index is required.");return O(this),this._polylines[e]},H.prototype.update=function(e,t,r){if(O(this),0!==this._polylines.length){I(this,t);var i,n=t.mapProjection,o=this._propertiesChanged;if(this._createVertexArray||P(this))A(this,e,n);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==E.SCENE3D)for(var l=s.length,u=0;l>u;++u)i=s[u],i.update();if(o[U]||o[k])A(this,e,n);else for(var c=s.length,h=this._polylineBuckets,d=0;c>d;++d){i=s[d],o=i._propertiesChanged;var m=i._bucket,p=0;for(var v in h)if(h.hasOwnProperty(v)){if(h[v]===m){(o[q]||o[z]||o[V])&&m.writeUpdate(p,i,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer,n);break}p+=h[v].lengthOfPositions}i._clean()}s.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var g=0;W>g;++g)o[g]=0;var _=f.IDENTITY;t.mode===E.SCENE3D&&(_=this.modelMatrix);var y=t.passes,w=0!==t.morphTime;if(a(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===w||(this._opaqueRS=e.createRenderState({depthMask:w,depthTest:{enabled:w}})),a(this._translucentRS)&&this._translucentRS.depthTest.enabled===w||(this._translucentRS=e.createRenderState({blending:C.ALPHA_BLEND,depthMask:!w,depthTest:{enabled:w}})),y.render){var b=this._colorCommands;T(this,e,t,b,r,_,!0)}if(y.pick){var S=this._pickCommands;T(this,e,t,S,r,_,!1)}}};var j=new e,Y=new e;H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return L(this),R(this),N(this),l(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){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=r};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(!a(this.shaderProgram)){var t=v({sources:[_,w]}),r=v({sources:[this.material.shaderSource,y]}),i=v({sources:[r],pickColorQualifier:"varying"});this.shaderProgram=e.createShaderProgram(t,r,G),this.pickShaderProgram=e.createShaderProgram(t,i,G)}},J.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===E.SCENE3D||!F(e))return t=e.positions.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 Q=new t,K=new t,$=new t,et=new t;J.prototype.write=function(e,r,n,o,a,s,l,u){for(var h=this.mode,d=this.polylines,m=d.length,f=0;m>f;++f)for(var p,v=d[f],g=v.width,_=v.show&&g>0,y=this.getSegments(v,u),w=y.positions,C=y.lengths,b=w.length,S=v.getPickId(l).color,x=0,T=0,P=0;b>P;++P){0===P?v._loop?p=w[b-2]:(p=et,t.subtract(w[0],w[1],p),t.add(w[0],p,p)):p=w[P-1],K.x=p.x,K.y=p.y,K.z=h!==E.SCENE2D?p.z:0,p=w[P],Q.x=p.x,Q.y=p.y,Q.z=h!==E.SCENE2D?p.z:0,P===b-1?v._loop?p=w[1]:(p=et,t.subtract(w[b-1],w[b-2],p),t.add(w[b-1],p,p)):p=w[P+1],$.x=p.x,$.y=p.y,$.z=h!==E.SCENE2D?p.z:0;var A=C[x]; P===T+A&&(T+=A,++x);for(var M=0===P-T,D=P===T+C[x]-1,I=M?2:0,O=D?2:4,R=I;O>R;++R){c.writeElements(Q,e,o),c.writeElements(K,e,o+6),c.writeElements($,e,o+12),r[a]=i.floatToByte(S.red),r[a+1]=i.floatToByte(S.green),r[a+2]=i.floatToByte(S.blue),r[a+3]=i.floatToByte(S.alpha);var L=0>R-2?-1:1;n[s]=P/(b-1),n[s+1]=2*(R%2)-1,n[s+2]=L*g,n[s+3]=_,o+=18,a+=4,s+=4}}};var tt=new t,rt=new t,it=new t,nt=new t;J.prototype.writeForMorph=function(e,r){for(var i=this.modelMatrix,n=this.polylines,o=n.length,a=0;o>a;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,h=l.length,d=0,m=0,p=0;h>p;++p){var v;0===p?s._loop?v=l[h-2]:(v=nt,t.subtract(l[0],l[1],v),t.add(l[0],v,v)):v=l[p-1],v=f.multiplyByPoint(i,v,rt);var g,_=f.multiplyByPoint(i,l[p],tt);p===h-1?s._loop?g=l[1]:(g=nt,t.subtract(l[h-1],l[h-2],g),t.add(l[h-1],g,g)):g=l[p+1],g=f.multiplyByPoint(i,g,it);var y=u[d];p===m+y&&(m+=y,++d);for(var w=0===p-m,C=p===m+u[d]-1,b=w?2:0,S=C?2:4,x=b;S>x;++x)c.writeElements(_,e,r),c.writeElements(v,e,r+6),c.writeElements(g,e,r+12),r+=18}};var ot=new Array(1);J.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new B(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,c=u.length,h=0;c>h;++h){var d=u[h];d._locatorBuckets=[];var f;if(this.mode===E.SCENE3D){f=ot;var p=d.positions.length;if(!(p>0))continue;f[0]=p}else f=d._segments.lengths;var v=f.length;if(v>0){for(var g=0,_=0;v>_;++_)for(var y=f[_]-1,w=0;y>w;++w)l+4>=m.SIXTY_FOUR_KILOBYTES-1&&(d._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 B(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;d._locatorBuckets.push({locator:o,count:g}),l+4>=m.SIXTY_FOUR_KILOBYTES-1&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new B(0,0,this),r[++n]=[o])}d._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);J.prototype.getSegments=function(r,i){var n=r.positions;if(this.mode===E.SCENE3D)return st[0]=n.length,at.positions=n,at.lengths=st,at;F(r)&&(n=r._segments.positions);for(var o,a,s=i.ellipsoid,l=[],u=this.modelMatrix,c=n.length,h=0;c>h;++h)o=n[h],a=f.multiplyByPoint(u,o),l.push(i.project(s.cartesianToCartographic(a)));if(l.length>0){r._boundingVolume2D=e.fromPoints(l,r._boundingVolume2D);var d=r._boundingVolume2D.center;r._boundingVolume2D.center=new t(d.z,d.x,d.y)}return at.positions=l,at.lengths=r._segments.lengths,at};var lt,ut;return J.prototype.writeUpdate=function(e,r,i,n,o){var s=this.mode,l=r._actualLength;if(l){e+=this.getPolylineStartIndex(r);var u=lt,h=ut,d=3*6*l;!a(u)||u.lengthd&&(u=new Float32Array(u.buffer,0,d),h=new Float32Array(h.buffer,0,4*l));var m,f=0,p=0,v=this.getSegments(r,o),g=v.positions,_=v.lengths,y=0,w=0,C=r.width,b=r.show&&C>0;l=g.length;for(var S=0;l>S;++S){0===S?r._loop?m=g[l-2]:(m=et,t.subtract(g[0],g[1],m),t.add(g[0],m,m)):m=g[S-1],K.x=m.x,K.y=m.y,K.z=s!==E.SCENE2D?m.z:0,m=g[S],Q.x=m.x,Q.y=m.y,Q.z=s!==E.SCENE2D?m.z:0,S===l-1?r._loop?m=g[1]:(m=et,t.subtract(g[l-1],g[l-2],m),t.add(g[l-1],m,m)):m=g[S+1],$.x=m.x,$.y=m.y,$.z=s!==E.SCENE2D?m.z:0;var x=_[y];S===w+x&&(w+=x,++y);for(var T=0===S-w,P=S===w+_[y]-1,A=T?2:0,M=P?2:4,D=A;M>D;++D){c.writeElements(Q,u,f),c.writeElements(K,u,f+6),c.writeElements($,u,f+12);var I=0>D-2?-1:1;h[p]=S/(l-1),h[p+1]=2*(D%2)-1,h[p+2]=I*C,h[p+3]=b,f+=18,p+=4}}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(h,4*Float32Array.BYTES_PER_ELEMENT*e)}},H}),r("DynamicScene/DynamicPathVisualizer",["../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/Material","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./ReferenceProperty","./SampledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";function w(e,t,i,n,a,s,l,u){var c,h=e._property._times,d=l;c=e.getValueInReferenceFrame(t,a,u[d]),r(c)&&(u[d++]=c);for(var m,f,p,v=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i),g=0,_=h.length,y=h[g],w=i,C=!1;_>g;){if(!v&&o.greaterThanOrEquals(y,n)&&(c=e.getValueInReferenceFrame(n,a,u[d]),r(c)&&(u[d++]=c),v=!0),o.greaterThan(y,t)&&o.lessThan(y,w)&&!y.equals(n)&&(c=e.getValueInReferenceFrame(y,a,u[d]),r(c)&&(u[d++]=c)),_-1>g){if(s>0&&!C){var b=h[g+1],S=o.getSecondsDifference(b,y);C=S>s,C&&(m=Math.ceil(S/s),f=0,p=S/Math.max(m,2),m=Math.max(m-1,1))}if(C&&m>f){y=o.addSeconds(y,p,new o),f++;continue}}C=!1,g++,y=h[g]}return c=e.getValueInReferenceFrame(i,a,u[d]),r(c)&&(u[d++]=c),d}function C(e,t,i,n,a,s,l,u){for(var c,h=0,d=l,m=t,f=Math.max(s,60),p=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i);o.lessThan(m,i);)!p&&o.greaterThanOrEquals(m,n)&&(p=!0,c=e.getValueInReferenceFrame(n,a,u[d]),r(c)&&(u[d]=c,d++)),c=e.getValueInReferenceFrame(m,a,u[d]),r(c)&&(u[d]=c,d++),h++,m=o.addSeconds(t,f*h,new o);return c=e.getValueInReferenceFrame(i,a,u[d]),r(c)&&(u[d]=c,d++),d}function b(e,t,i,n,a,s,l,c){for(var h=new u(t,i,!0,!0),d=l,m=e.intervals,f=0;f0?(m=x.pop(),s=this._polylineCollection.get(m)):(m=this._polylineCollection.length,s=this._polylineCollection.add()),i._pathVisualizerIndex=m,s.id=i,s.width=1;var P=s.material;r(P)&&P.type===h.PolylineOutlineType||(P=h.fromType(h.PolylineOutlineType),s.material=P);var A=P.uniforms;t.clone(t.WHITE,A.color),t.clone(t.BLACK,A.outlineColor),A.outlineWidth=0}s.show=!0;var M=60;if(l=n._resolution,r(l)){var D=l.getValue(e);r(D)&&(M=D)}if(s.positions=E(a,u,c,e,this._referenceFrame,M,s.positions),s.material=v.getValue(e,n._material,s.material),l=n._width,r(l)){var I=l.getValue(e);r(I)&&(s.width=I)}}}},P.prototype.removeObject=function(e){var t=e._pathVisualizerIndex;if(r(t)){var i=this._polylineCollection.get(t);i.show=!1,this._unusedIndexes.push(t),e._pathVisualizerIndex=void 0}},P.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),i(this)};var A=function(e,t){if(!r(e))throw new n("scene is required.");if(!r(t))throw new n("dynamicObjectCollection is required.");t.collectionChanged.addEventListener(A.prototype._onObjectsRemoved,this),this._scene=e,this._updaters={},this._dynamicObjectCollection=t};return A.prototype.update=function(e){if(!r(e))throw new n("time is required.");var t=this._updaters;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e);for(var o=this._dynamicObjectCollection.getObjects(),a=0,s=o.length;s>a;a++){var u=o[a];if(r(u._path)){var c=u._position;if(r(c)){var h=u._pathUpdater,d=l.FIXED;this._scene.mode===m.SCENE3D&&(d=c.referenceFrame);var f=this._updaters[d];h===f&&r(f)?f.updateObject(e,u):(r(h)&&h.removeObject(u),r(f)||(f=new P(this._scene,d),f.update(e),this._updaters[d]=f),u._pathUpdater=f,r(f)&&f.updateObject(e,u))}}}return!0},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._dynamicObjectCollection;e.collectionChanged.removeEventListener(A.prototype._onObjectsRemoved,this);var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].destroy();for(var n=e.getObjects(),o=n.length,a=0;o>a;a++)n[a]._pathUpdater=void 0,n[a]._pathVisualizerIndex=void 0;return i(this)},A.prototype._onObjectsRemoved=function(e,t,i){for(var n=i.length-1;n>-1;n--){var o=i[n],a=o._pathUpdater;r(a)&&a.removeObject(o)}},A._subSample=E,A}),r("DynamicScene/DynamicPointVisualizer",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/BillboardCollection","../Scene/TextureAtlas","../Scene/TextureAtlasBuilder"],function(e,t,r,i,n,o,a,s){"use strict";function l(i,n,o){var a=o._point;if(r(a)){var s=o._position;if(r(s)){var l,u=a._show,f=o._pointVisualizerIndex,p=o.isAvailable(n)&&(!r(u)||u.getValue(n));if(!p)return r(f)&&(l=i._billboardCollection.get(f),l.show=!1,l.imageIndex=-1,o._pointVisualizerIndex=void 0,i._unusedIndexes.push(f)),void 0;var v=!1;if(r(f))l=i._billboardCollection.get(f);else{var g=i._unusedIndexes,_=g.length;_>0?(f=g.pop(),l=i._billboardCollection.get(f)):(f=i._billboardCollection.length,l=i._billboardCollection.add()),o._pointVisualizerIndex=f,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.show=!0,h=s.getValue(n,h),r(h)&&(l.position=h);var y=a._color;if(r(y)&&(c=y.getValue(n,c),e.equals(l._visualizerColor,c)||(e.clone(c,l._visualizerColor),v=!0)),y=a._outlineColor,r(y)&&(d=y.getValue(n,d),e.equals(l._visualizerOutlineColor,d)||(e.clone(d,l._visualizerOutlineColor),v=!0)),y=a._outlineWidth,r(y)){var w=y.getValue(n);l._visualizerOutlineWidth!==w&&(l._visualizerOutlineWidth=w,v=!0)}if(y=a._pixelSize,r(y)){var C=y.getValue(n);l._visualizerPixelSize!==C&&(l._visualizerPixelSize=C,v=!0)}if(y=a._scaleByDistance,r(y)&&(m=y.getValue(n,m),r(m)&&(l.scaleByDistance=m)),v){var b=t(l._visualizerColor,e.WHITE),S=b.alpha,x=b.toCssColorString(),E=t(l._visualizerOutlineColor,e.BLACK).toCssColorString(),T=t(l._visualizerPixelSize,3),P=t(l._visualizerOutlineWidth,2),A=JSON.stringify([x,T,E,P]);i._textureAtlasBuilder.addTextureFromFunction(A,function(e,t){var r=document.createElement("canvas"),i=T+2*P;r.height=r.width=i;var n=r.getContext("2d");n.clearRect(0,0,i,i),0!==P&&(n.beginPath(),n.arc(i/2,i/2,i/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=E,n.fill(),1>S&&(n.save(),n.globalCompositeOperation="destination-out",n.beginPath(),n.arc(i/2,i/2,T/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle="black",n.fill(),n.restore())),n.beginPath(),n.arc(i/2,i/2,T/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=x,n.fill(),t(r)},function(e){l.imageIndex=e})}}}}var u=function(e,t){if(!r(e))throw new n("scene is required.");if(!r(t))throw new n("dynamicObjectCollection is required.");t.collectionChanged.addEventListener(u.prototype._onObjectsRemoved,this);var i=new a({scene:e}),l=new o;l.textureAtlas=i,e.primitives.add(l),this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=t,this._textureAtlas=i,this._billboardCollection=l,this._textureAtlasBuilder=new s(i)};u.prototype.update=function(e){if(!r(e))throw new n("time is required.");for(var t=this._dynamicObjectCollection.getObjects(),i=0,o=t.length;o>i;i++)l(this,e,t[i]);return!0},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){for(var e=this._dynamicObjectCollection,t=e.getObjects(),r=t.length-1;r>-1;r--)t[r]._pointVisualizerIndex=void 0;return e.collectionChanged.removeEventListener(u.prototype._onObjectsRemoved,this),this._scene.primitives.remove(this._billboardCollection),i(this)};var c,h,d,m;return u.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.show=!1,u.imageIndex=-1,s._pointVisualizerIndex=void 0,o.push(l)}}},u}),r("DynamicScene/DynamicPyramidVisualizer",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../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(n,o,d){var f=d._pyramid;if(i(f)){var g=f._directions;if(i(g)){var _=d._position;if(i(_)){var y=d._orientation;if(i(y)){var w,C=f._show,b=d._pyramidVisualizerIndex,S=d.isAvailable(o)&&(!i(C)||C.getValue(o));if(!S)return i(b)&&(w=n._pyramidCollection[b],w.show=!1,d._pyramidVisualizerIndex=void 0,n._unusedIndexes.push(b)),void 0;if(i(b))w=n._pyramidCollection[b];else{var x=n._unusedIndexes,E=x.length;E>0?(b=x.pop(),w=n._pyramidCollection[b]):(b=n._pyramidCollection.length,w=new u,n._pyramidCollection.push(w),n._primitives.add(w)),d._pyramidVisualizerIndex=b,w.id=d,w.radius=Number.POSITIVE_INFINITY,w.showIntersection=!0,w.intersectionColor=t.YELLOW,w.intersectionWidth=5,w.material=c.fromType(c.ColorType)}w.show=!0;var T=g.getValue(o);i(T)&&w._visualizerDirections!==T&&(w.setDirections(T),w._visualizerDirections=T),p=r(_.getValue(o,p),w._visualizerPosition),v=r(y.getValue(o,v),w._visualizerOrientation),!i(p)||!i(v)||e.equals(p,w._visualizerPosition)&&l.equals(v,w._visualizerOrientation)||(s.fromRotationTranslation(a.fromQuaternion(v,m),p,w.modelMatrix),e.clone(p,w._visualizerPosition),l.clone(v,w._visualizerOrientation)),w.material=h.getValue(o,f._material,w.material);var P=f._intersectionColor;if(i(P)){var A=P.getValue(o,A);i(A)&&(w.intersectionColor=A)}if(P=f._intersectionWidth,i(P)){var M=P.getValue(o,M);i(M)&&(w.intersectionWidth=M)}if(P=f._radius,i(P)){var D=P.getValue(o,D);i(D)&&(w.radius=D)}}}}}}var m=new a,f=function(e,t){if(!i(e))throw new o("scene is required.");if(!i(t))throw new o("dynamicObjectCollection is required.");t.collectionChanged.addEventListener(f.prototype._onObjectsRemoved,this),this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives,this._pyramidCollection=[],this._dynamicObjectCollection=t};f.prototype.update=function(e){if(!i(e))throw new o("time is required.");for(var t=this._dynamicObjectCollection.getObjects(),r=0,n=t.length;n>r;r++)d(this,e,t[r]);return!0},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){var e,t=this._pyramidCollection.length,r=this._primitives;for(e=0;t>e;e++)r.remove(this._pyramidCollection[e]);var i=this._dynamicObjectCollection.getObjects();for(t=i.length,e=0;t>e;e++)i[e]._pyramidVisualizerIndex=void 0;return n(this)};var p,v;return f.prototype._onObjectsRemoved=function(e,t,r){for(var n=this._pyramidCollection,o=this._unusedIndexes,a=r.length-1;a>-1;a--){var s=r[a],l=s._pyramidVisualizerIndex;if(i(l)){var u=n[l];u.show=!1,o.push(l),s._pyramidVisualizerIndex=void 0}}},f}),r("DynamicScene/DynamicVectorVisualizer",["../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/Material","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a){"use strict";function s(i,n,a){var s=a._vector;if(r(s)){var l,u=s._show,c=a._position,h=s._direction,d=s._length,m=a._vectorVisualizerIndex,f=a.isAvailable(n)&&(!r(u)||u.getValue(n));if(!(f&&r(h)&&r(c)&&r(d)))return r(m)&&(l=i._polylineCollection.get(m),l.show=!1,a._vectorVisualizerIndex=void 0,i._unusedIndexes.push(m)),void 0;var p;if(r(m))l=i._polylineCollection.get(m),p=l.material.uniforms;else{var v=i._unusedIndexes;v.length>0?(m=v.pop(),l=i._polylineCollection.get(m)):(m=i._polylineCollection.length,l=i._polylineCollection.add(),l._visualizerPositions=[new e,new e]),a._vectorVisualizerIndex=m,l.id=a,l.width=1;var g=l.material;r(g)&&g.type===o.PolylineArrowType||(g=o.fromType(o.PolylineArrowType),l.material=g),p=g.uniforms,t.clone(t.WHITE,p.color)}l.show=!0;var _=l._visualizerPositions,y=c.getValue(n,_[0]),w=h.getValue(n,_[1]),C=d.getValue(n);r(y)&&r(w)&&r(C)&&(e.add(y,e.multiplyByScalar(e.normalize(w,w),C,w),w),l.positions=_);var b=s._color;if(r(b)&&(p.color=b.getValue(n,p.color)),b=s._width,r(b)){var S=b.getValue(n);r(S)&&(l.width=S)}}}var l=function(e,t){if(!r(e))throw new n("scene is required.");if(!r(t))throw new n("dynamicObjectCollection is required.");t.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this);var i=new a;e.primitives.add(i),this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives,this._polylineCollection=i,this._dynamicObjectCollection=t};return l.prototype.update=function(e){if(!r(e))throw new n("time is required.");for(var t=this._dynamicObjectCollection.getObjects(),i=0,o=t.length;o>i;i++)s(this,e,t[i]);return!0},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){var e=this._dynamicObjectCollection;e.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this);for(var t=this._dynamicObjectCollection.getObjects(),r=t.length-1;r>-1;r--)t[r]._vectorVisualizerIndex=void 0;return this._scene.primitives.remove(this._polylineCollection),i(this)},l.prototype._onObjectsRemoved=function(e,t,i){for(var n=this._polylineCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._vectorVisualizerIndex;if(r(l)){var u=n.get(l);u.show=!1,o.push(l),s._vectorVisualizerIndex=void 0}}},l}),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("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/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/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/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/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("Scene/Appearance",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Renderer/createShaderSource","./BlendingState","./CullFace"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){e=t(e,t.EMPTY_OBJECT),this.material=e.material,this.translucent=t(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=t(e.closed,!1)};return i(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){return n({defines:[this.flat?"FLAT":"",this.faceForward?"FACE_FORWARD":""],sources:[r(this.material)?this.material.shaderSource:"",this.fragmentShaderSource]})},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=o.ALPHA_BLEND):r.depthMask=!0,r},s.getDefaultRenderState=function(e,t){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=o.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:a.BACK}),r},s}),r("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=e(r.closed,!1),o=e(r.materialSupport,m.MaterialSupport.TEXTURED);this.material=t(r.material)?r.material:d.fromType(d.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(r.fragmentShaderSource,o.fragmentShaderSource),this._renderState=e(r.renderState,h.getDefaultRenderState(i,n)),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,!n)};return r(m.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),m.prototype.getFragmentShaderSource=h.prototype.getFragmentShaderSource,m.prototype.isTranslucent=h.prototype.isTranslucent,m.prototype.getRenderState=h.prototype.getRenderState,m.MaterialSupport={BASIC:i({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:i({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:i({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},m}),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/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/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\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/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?a:n,d=c?o:i,m=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,h),this._fragmentShaderSource=e(t.fragmentShaderSource,d),this._renderState=e(t.renderState,s.getDefaultRenderState(r,u)),this._closed=u,this._vertexFormat=m,this._flat=c,this._faceForward=e(t.faceForward,!u)};return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),l.VERTEX_FORMAT=r.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=r.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),r("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f){"use strict";function p(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(!m.equals(a,e[i].modelMatrix)){n=!0;break}}if(n)for(i=0;o>i;++i)h.transformToWorldCoordinates(e[i]);else m.clone(e[0].modelMatrix,t)}function v(e,i){for(var n=e.length,o=0;n>o;++o){var a=e[o],s=a.geometry,l=s.attributes,u=l.position,h=4*(u.values.length/u.componentsPerAttribute);l.pickColor=new c({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(h)});for(var d=i[o],m=t.floatToByte(d.red),f=t.floatToByte(d.green),p=t.floatToByte(d.blue),v=t.floatToByte(d.alpha),g=l.pickColor.values,_=0;h>_;_+=4)g[_]=m,g[_+1]=f,g[_+2]=p,g[_+3]=v}}function g(e){var t,r=e.length,i=[],o=e[0].attributes;for(t in o)if(o.hasOwnProperty(t)){for(var a=o[t],s=!0,l=1;r>l;++l){var u=e[l].attributes[t];if(!n(u)||a.componentDatatype!==u.componentDatatype||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&i.push(t)}return i}function _(e,t){for(var i=e.length,n=0;i>n;++n)for(var o=e[n],a=o.attributes,s=o.geometry,l=u.computeNumberOfVertices(s),h=t.length,d=0;h>d;++d){for(var m=t[d],f=a[m],p=f.componentDatatype,v=f.value,g=v.length,_=r.createTypedArray(p,l*g),y=0;l>y;++y)_.set(v,y*g);s.attributes[m]=new c({componentDatatype:p,componentsPerAttribute:g,normalize:f.normalize,values:_})}}function y(e){var t,i=e.instances,n=e.pickIds,a=e.projection,s=e.elementIndexUintSupported,l=e.allow3DOnly,u=e.allowPicking,c=e.vertexCacheOptimize,d=e.modelMatrix,m=i.length,f=i[0].geometry.primitiveType;for(t=1;m>t;++t)if(i[t].geometry.primitiveType!==f)throw new o("All instance geometries must have the same primitiveType.");if(p(i,d,l),!l)for(t=0;m>t;++t)h.wrapLongitude(i[t].geometry);u&&v(i,n);var y=g(i);if(_(i,y),c)for(t=0;m>t;++t)h.reorderForPostVertexCache(i[t].geometry),h.reorderForPreVertexCache(i[t].geometry);var w,C=h.combine(i),b=C.attributes;if(l)for(w in b)b.hasOwnProperty(w)&&b[w].componentDatatype===r.DOUBLE&&h.encodeAttribute(C,w,w+"3DHigh",w+"3DLow");else for(w in b)if(b.hasOwnProperty(w)&&b[w].componentDatatype===r.DOUBLE){var S=w+"3D",x=w+"2D";h.projectTo2D(C,w,S,x,a),h.encodeAttribute(C,S,S+"High",S+"Low"),h.encodeAttribute(C,x,x+"High",x+"Low") }return s?[C]:h.fitToUnsignedShortIndices(C)}function w(e,t,i){for(var n=[],o=e.attributes,a=i.length,s=0;a>s;++s){var l=i[s],u=o[l],c=u.componentDatatype;c===r.DOUBLE&&(c=r.FLOAT);var h=r.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 C(e,t,r){for(var o=[],a=g(e),s=e.length,l={},c={},h=0;s>h;++h)for(var d=e[h],m=u.computeNumberOfVertices(d.geometry),f=a.length,p=0;f>p;++p)for(var v=a[p],_=r[v],y=m;y>0;){for(var w,C=i(c[v],0),b=t[C],S=b.length,x=0;S>x&&(w=b[x],w.index!==_);++x);n(o[h])||(o[h]={}),n(o[h][v])||(o[h][v]={dirty:!1,value:d.attributes[v].value,indices:[]});var E,T=w.values.length/w.componentsPerAttribute,P=i(l[v],0);T>P+y?(E=y,o[h][v].indices.push({attribute:w,offset:P,count:E}),l[v]=P+y):(E=T-P,o[h][v].indices.push({attribute:w,offset:P,count:E}),l[v]=0,c[v]=C+1),y-=E}return o}function b(e,t){var r=e.attributes;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n(o)&&n(o.values)&&t.push(o.values.buffer)}n(e.indices)&&t.push(e.indices.buffer)}function S(e,t){for(var r=e.length,i=0;r>i;++i)b(e[i],t)}function x(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)t.push(n[a].values.buffer)}function E(t){for(var r=1,i=t.length,o=0;i>o;o++){var a=t[o],s=a.attributes;r+=3+e.packedLength+(n(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&n(s[l])){var u=s[l];r+=5+u.values.length}}return r}function T(e,t){for(var r=e.length,i=new Uint32Array(e.length),n=0;r>n;++n)i[n]=e[n].toRgba();return t.push(i.buffer),i}function P(e){for(var r=e.length,i=new Array(r),n=0;r>n;n++)i[n]=t.fromRgba(e[n]);return i}function A(e){for(var t=e.length,r=1+17*t,i=0;t>i;i++){var o=e[i].attributes;for(var a in o)if(o.hasOwnProperty(a)&&n(o[a])){var s=o[a];r+=5+s.value.length}}return r}function M(e,t){var r=new Float64Array(A(e)),i={},o=[],a=e.length,s=0;r[s++]=a;for(var l=0;a>l;l++){var u=e[l];m.pack(u.modelMatrix,r,s),s+=m.packedLength;var c=u.attributes,h=[];for(var d in c)c.hasOwnProperty(d)&&n(c[d])&&(h.push(d),n(i[d])||(i[d]=o.length,o.push(d)));r[s++]=h.length;for(var f=0;fc;c++){for(var h=i[t[a++]],d=t[a++],f=t[a++],p=0!==t[a++],v=t[a++],g=r.createTypedArray(d,v),_=0;v>_;_++)g[_]=t[a++];l[h]={componentDatatype:d,componentsPerAttribute:f,normalize:p,value:g}}n[o++]={attributes:l,modelMatrix:s}}return n}function I(e){for(var t=e.length,r=1+t,i=0;t>i;i++){var o=e[i];for(var a in o)if(o.hasOwnProperty(a)&&n(o[a])){var s=o[a];r+=3+3*s.indices.length+s.value.length}}return r}function O(e,t){var r=new Float64Array(I(e)),i=[],o=[],a={},s=e.length,l=0;r[l++]=s;for(var u=0;s>u;u++){var c=e[u],h=[];for(var d in c)c.hasOwnProperty(d)&&n(c[d])&&(h.push(d),n(a[d])||(a[d]=i.length,i.push(d)));r[l++]=h.length;for(var m=0;m_;_++){var y=v[_];r[l++]=y.count,r[l++]=y.offset;var w=o.indexOf(y.attribute);-1===w&&(w=o.length,o.push(y.attribute)),r[l++]=w}r[l++]=p.value.length,r.set(p.value,l),l+=p.value.length}}return t.push(r.buffer),{stringTable:i,packedData:r,attributeTable:o}}function R(e){for(var t=e.stringTable,i=e.attributeTable,n=e.packedData,o=new Array(n[0]),a=0,s=1,l=n.length;l>s;){for(var u={},c=n[s++],h=0;c>h;h++){for(var d=t[n[s++]],m=new Array(n[s++]),f=0;f_;_++)g[_]=n[s++];u[d]={dirty:!1,indices:m,value:g}}o[a++]=u}return o}if(!s.supportsTypedArrays())return{};var L={};return L.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:m.clone(e.modelMatrix)},r=y(t),i=h.createAttributeLocations(r[0]),n=t.instances,o=g(n),a=[],s=r.length,l=0;s>l;++l){var u=r[l];a.push(w(u,i,o))}var c=C(n,a,i);return{geometries:r,modelMatrix:t.modelMatrix,attributeLocations:i,vaAttributes:a,vaAttributeLocations:c}},L.packCreateGeometryResults=function(t,r){var i=new Float64Array(E(t)),o=[],a={},s=t.length,l=0;i[l++]=s;for(var u=0;s>u;u++){var c=t[u];i[l++]=c.primitiveType,e.pack(c.boundingSphere,i,l),l+=e.packedLength;var h=c.attributes,d=[];for(var m in h)h.hasOwnProperty(m)&&n(h[m])&&(d.push(m),n(a[m])||(a[m]=o.length,o.push(m)));i[l++]=d.length;for(var f=0;f0&&(i.set(c.indices,l),l+=g)}return r.push(i.buffer),{stringTable:o,packedData:i}},L.unpackCreateGeometryResults=function(t){for(var i,n=t.stringTable,o=t.packedData,a=new Array(o[0]),s=0,l=1;li;i++){var y=n[o[l++]],w=o[l++];v=o[l++];var C=0!==o[l++];f=o[l++],p=r.createTypedArray(w,f);for(var b=0;f>b;b++)p[b]=o[l++];g[y]=new c({componentDatatype:w,componentsPerAttribute:v,normalize:C,values:p})}var S;if(f=o[l++],f>0){var x=p.length/v;for(S=d.createTypedArray(x,f),i=0;f>i;i++)S[i]=o[l++]}a[s++]=new u({primitiveType:h,boundingSphere:m,indices:S,attributes:g})}return a},L.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,i=r.length,n=0;i>n;n++)t.push(r[n].packedData.buffer);var o;return e.allowPicking&&(o=T(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:M(e.instances,t),packedPickIds:o,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof l,elementIndexUintSupported:e.elementIndexUintSupported,allow3DOnly:e.allow3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:e.modelMatrix}},L.unpackCombineGeometryParameters=function(e){for(var t=D(e.packedInstances),r=e.allowPicking?P(e.packedPickIds):void 0,i=e.createGeometryResults,n=i.length,o=0,s=0;n>s;s++)for(var u=L.unpackCreateGeometryResults(i[s]),c=u.length,h=0;c>h;h++)t[o++].geometry=u[h];var d=a.clone(e.ellipsoid),p=e.isGeographic?new l(d):new f(d);return m.clone(e.modelMatrix),{instances:t,pickIds:r,ellipsoid:d,projection:p,elementIndexUintSupported:e.elementIndexUintSupported,allow3DOnly:e.allow3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:e.modelMatrix}},L.packCombineGeometryResults=function(e,t){return S(e.geometries,t),x(e.vaAttributes,t),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:O(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix}},L.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:R(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix}},L}),r("Scene/PrimitiveState",[],function(){"use strict";var e={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};return e}),r("Scene/Primitive",["../Core/BoundingSphere","../Core/clone","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/isArray","../Core/Matrix4","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../ThirdParty/when","./CullFace","./Pass","./PrimitivePipeline","./PrimitiveState","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T){"use strict";function P(e){return new c({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function A(t){var r=t.attributes,i=new h;for(var o in r)r.hasOwnProperty(o)&&n(r[o])&&(i[o]=P(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 M(e){return new m({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function D(e,t){var r=e.attributes,i={};for(var n in r)r.hasOwnProperty(n)&&(i[n]=M(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=q.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 y({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,t){var r=e.vertexAttributes;for(var i in r)if(r.hasOwnProperty(i)&&!n(t[i]))throw new s("Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '"+i+"', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.")}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 F(e,t,r){return function(i){if(!n(i)||!n(i.length)||i.length<1||i.length>4)throw new s("value must be and array with length between 1 and 4.");var o=t[e];o.value=i,o.dirty||(r.push(o),o.dirty=!0)}}var z=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._interleave=i(e.interleave,!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=E.READY,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=[],this._createGeometryResults=void 0};o(z.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allow3DOnly:{get:function(){return this._allow3DOnly}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}}});var V,q=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g,k=Math.max(l.hardwareConcurrency-1,1),U=new g("combineGeometry",Number.POSITIVE_INFINITY);return z.prototype.update=function(i,o,a){if(!(!this.show||!n(this.geometryInstances)&&0===this._va.length||n(this.geometryInstances)&&f(this.geometryInstances)&&0===this.geometryInstances.length||!n(this.appearance)||o.mode!==T.SCENE3D&&this.allow3DOnly||!o.passes.render&&!o.passes.pick)){var s,l,u,c,h,d,m,P,M,B,F,z,q,W=o.mapProjection,G=this.allowPicking,H=this._instanceIds,j=this;if(this._state!==E.COMPLETE&&this._state!==E.COMBINED)if(this.asynchronous){if(this._state===E.FAILED)throw this._error;if(this._state===E.READY){F=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=F.length;var Y=[],X=[];for(m=0;d>m;++m)u=F[m].geometry,H.push(F[m].id),X.push({moduleName:u._workerName,geometry:u});if(!n(V))for(V=new Array(k),m=0;k>m;m++)V[m]=new g("createGeometry",Number.POSITIVE_INFINITY);for(X=v(X,k),m=0;mm;m++){var J=F[m];u=J.geometry,H.push(J.id);var Q;Q=n(u.attributes)&&n(u.primitiveType)?A(u):u.constructor.createGeometry(u),q[m]=Q,z[m]=D(J,Q)}var K=x.combineGeometry({instances:z,pickIds:G?N(i,this,F):void 0,ellipsoid:W.ellipsoid,projection:W,elementIndexUintSupported:i.elementIndexUint,allow3DOnly:this.allow3DOnly,allowPicking:G,vertexCacheOptimize:this.vertexCacheOptimize,modelMatrix:this.modelMatrix});this._geometries=K.geometries,this._attributeLocations=K.attributeLocations,this._vaAttributes=K.vaAttributes,this._perInstanceAttributeLocations=K.vaAttributeLocations,this.modelMatrix=p.clone(K.modelMatrix,this.modelMatrix),this._state=E.COMBINED}var $=this._attributeLocations;if(this._state===E.COMBINED){q=this._geometries;var et=this._vaAttributes;this._boundingSphere=e.clone(q[0].boundingSphere);var tt=[];for(d=q.length,m=0;d>m;++m){u=q[m],c=et[m];var rt=c.length;for(P=0;rt>P;++P)h=c[P],h.vertexBuffer=i.createVertexBuffer(h.values,_.DYNAMIC_DRAW),delete h.values;tt.push(i.createVertexArrayFromGeometry({geometry:u,attributeLocations:$,bufferUsage:_.STATIC_DRAW,interleave:this._interleave,vertexArrayAttributes:c}))}this._va=tt,this._primitiveType=q[0].primitiveType,this.releaseGeometryInstances&&(this.geometryInstances=void 0),this._geometries=void 0,this._state=E.COMPLETE}if(this._state===E.COMPLETE){var it=this.appearance,nt=it.material,ot=!1,at=!1;this._appearance!==it?(this._appearance=it,this._material=nt,ot=!0,at=!0):this._material!==nt&&(this._material=nt,at=!0);var st=this._appearance.isTranslucent();this._translucent!==st&&(this._translucent=st,ot=!0),n(this._material)&&this._material.update(i);var lt=it.closed&&st;if(ot){var ut,ct=it.getRenderState();lt?(ut=t(ct,!1),ut.cull={enabled:!0,face:b.BACK},this._frontFaceRS=i.createRenderState(ut),ut.cull.face=b.FRONT,this._backFaceRS=i.createRenderState(ut)):(this._frontFaceRS=i.createRenderState(ct),this._backFaceRS=this._frontFaceRS),G?lt?(ut=t(ct,!1),ut.cull={enabled:!1},this._pickRS=i.createRenderState(ut)):this._pickRS=this._frontFaceRS:(ut=t(ct,!1),ut.colorMask={red:!1,green:!1,blue:!1,alpha:!1},lt?(ut.cull={enabled:!1},this._pickRS=i.createRenderState(ut)):this._pickRS=i.createRenderState(ut))}if(at){var ht=I(this,it.vertexShaderSource);ht=R(this,ht);var dt=it.getFragmentShaderSource();if(this._sp=i.replaceShaderProgram(this._sp,ht,dt,$),L(this._sp,$),G){var mt=y({sources:[dt],pickColorQualifier:"varying"});this._pickSP=i.replaceShaderProgram(this._pickSP,O(ht),mt,$)}else this._pickSP=i.createShaderProgram(ht,dt,$);L(this._pickSP,$)}var ft=this._colorCommands,pt=this._pickCommands;if(ot||at){var vt=n(nt)?nt._uniforms:void 0,gt=st?S.TRANSLUCENT:S.OPAQUE;ft.length=this._va.length*(lt?2:1),pt.length=this._va.length,d=ft.length;var _t=0,yt=0;for(m=0;d>m;++m)lt&&(s=ft[m],n(s)||(s=ft[m]=new w({owner:this,primitiveType:this._primitiveType})),s.vertexArray=this._va[yt],s.renderState=this._backFaceRS,s.shaderProgram=this._sp,s.uniformMap=vt,s.pass=gt,++m),s=ft[m],n(s)||(s=ft[m]=new w({owner:this,primitiveType:this._primitiveType})),s.vertexArray=this._va[yt],s.renderState=this._frontFaceRS,s.shaderProgram=this._sp,s.uniformMap=vt,s.pass=gt,l=pt[_t],n(l)||(l=pt[_t]=new w({owner:this,primitiveType:this._primitiveType})),l.vertexArray=this._va[yt],l.renderState=this._pickRS,l.shaderProgram=this._pickSP,l.uniformMap=vt,l.pass=gt,++_t,++yt}if(this._dirtyAttributes.length>0){for(c=this._dirtyAttributes,d=c.length,m=0;d>m;++m){h=c[m];var wt=h.value,Ct=h.indices,bt=Ct.length;for(P=0;bt>P;++P){M=Ct[P];for(var St=M.offset,xt=M.count,Et=M.attribute,Tt=Et.componentDatatype,Pt=Et.componentsPerAttribute,At=r.createTypedArray(Tt,xt*Pt),Mt=0;xt>Mt;++Mt)At.set(wt,Mt*Pt);var Dt=St*Pt*r.getSizeInBytes(Tt);Et.vertexBuffer.copyFromArrayView(At,Dt)}h.dirty=!1}c.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,W,this._boundingSphereCV),this._boundingSphere2D=e.clone(this._boundingSphereCV,this._boundingSphere2D),this._boundingSphere2D.center.x=0));var It;o.mode===T.SCENE3D?It=this._boundingSphereWC:o.mode===T.COLUMBUS_VIEW?It=this._boundingSphereCV:o.mode===T.SCENE2D&&n(this._boundingSphere2D)?It=this._boundingSphere2D:n(this._boundingSphereWC)&&n(this._boundingSphereCV)&&(It=e.union(this._boundingSphereWC,this._boundingSphereCV));var Ot=o.passes;if(Ot.render)for(d=ft.length,m=0;d>m;++m)ft[m].modelMatrix=this.modelMatrix,ft[m].boundingVolume=It,ft[m].debugShowBoundingVolume=this.debugShowBoundingVolume,a.push(ft[m]);if(Ot.pick)for(d=pt.length,m=0;d>m;++m)pt[m].modelMatrix=this.modelMatrix,pt[m].boundingVolume=It,a.push(pt[m])}}},z.prototype.getGeometryInstanceAttributes=function(e){if(!n(e))throw new s("id is required");if(!n(this._perInstanceAttributeLocations))throw new s("must call update before calling getGeometryInstanceAttributes");for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,a=i.length,l=0;a>l;++l){var u=(r+l)%a;if(e===i[u]){t=u;break}}if(-1===t)return void 0;var c=this._perInstanceAttributeLocations[t],h={},d={},m=!1;for(var f in c)c.hasOwnProperty(f)&&(m=!0,d[f]={get:B(f,c),set:F(f,c,this._dirtyAttributes)});return m&&o(h,d),this._lastPerInstanceAttributeIndex=t,h},z.prototype.isDestroyed=function(){return!1},z.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();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)},z}),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","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";var w=v.fromColor(e.WHITE),C=new g(!0),b=new g(!0),S=new g(!1),x=new g(e.BLACK),E=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){if(!i(e))throw new a("dynamicObject is required");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 E(e),this._onDynamicObjectPropertyChanged(e,"ellipse",e.ellipse,void 0)};n(T,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:m}}),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)&&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||!i(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.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){if(!i(r))throw new a("time is required.");if(!this._fillEnabled)throw new a("This instance does not represent a filled geometry.");var n,o,l=this._dynamicObject,u=l.isAvailable(r),h=new d(u&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||u)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:h,color:o}}else n={show:h};return new c({id:l,geometry:new s(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){if(!i(r))throw new a("time is required.");if(!this._outlineEnabled)throw new a("This instance does not represent an outlined geometry.");var n=this._dynamicObject,o=n.isAvailable(r);return new c({id:n,geometry:new l(this._options),attributes:{show:new d(o&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o?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 g=r(n.material,w),_=g instanceof v;this._materialProperty=g,this._fillProperty=r(o,b),this._showProperty=r(p,C),this._showOutlineProperty=r(n.outline,S),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var E=n.rotation,T=n.height,P=n.extrudedHeight,A=n.granularity,M=n.stRotation,D=n.numberOfVerticalLines;if(this._isClosed=i(P),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&c.isConstant&&d.isConstant&&y.isConstant(E)&&y.isConstant(T)&&y.isConstant(P)&&y.isConstant(A)&&y.isConstant(M)&&y.isConstant(D)){var I=this._options;I.vertexFormat=_?f.VERTEX_FORMAT:m.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(E)?E.getValue(h.MINIMUM_VALUE):void 0,I.height=i(T)?T.getValue(h.MINIMUM_VALUE):void 0,I.extrudedHeight=i(P)?P.getValue(h.MINIMUM_VALUE):void 0,I.granularity=i(A)?A.getValue(h.MINIMUM_VALUE):void 0,I.stRotation=i(M)?M.getValue(h.MINIMUM_VALUE):void 0,I.numberOfVerticalLines=i(D)?D.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){if(!this._dynamic)throw new a("This instance does not represent dynamic geometry.");if(!i(e))throw new a("primitives is required.");return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._dynamicObject)};return P.prototype.update=function(r){if(!i(r))throw new a("time is required.");var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,u=o.ellipse,h=u.show;if(o.isAvailable(r)&&(!i(h)||h.getValue(r))){var d=this._options,v=o.position,g=u.semiMajorAxis,y=u.semiMinorAxis,w=u.rotation,C=u.height,b=u.extrudedHeight,S=u.granularity,x=u.stRotation,E=u.numberOfVerticalLines;if(d.center=v.getValue(r,d.center),d.semiMajorAxis=g.getValue(r,d.semiMajorAxis),d.semiMinorAxis=y.getValue(r,d.semiMinorAxis),d.rotation=i(w)?w.getValue(r,d):void 0,d.height=i(C)?C.getValue(r,d):void 0,d.extrudedHeight=i(b)?b.getValue(r,d):void 0,d.granularity=i(S)?S.getValue(r):void 0,d.stRotation=i(x)?x.getValue(r):void 0,!i(u.fill)||u.fill.getValue(r)){this._material=_.getValue(r,n.fillMaterialProperty,this._material);var T=this._material,P=new m({material:T,translucent:T.isTranslucent(),closed:i(d.extrudedHeight)});d.vertexFormat=P.vertexFormat,this._primitive=new p({geometryInstances:new c({id:o,geometry:new s(d)}),appearance:P,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(u.outline)&&u.outline.getValue(r)){d.vertexFormat=f.VERTEX_FORMAT,d.numberOfVerticalLines=i(E)?E.getValue(r):void 0;var A=i(u.outlineColor)?u.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new p({geometryInstances:new c({id:o,geometry:new l(d),attributes:{color:t.fromColor(A)}}),appearance:new f({flat:!0,translucent:1!==A.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.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","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/PrimitiveState","../Scene/SceneMode","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x){"use strict";var E,T,P,A,M=C.fromColor(t.WHITE),D=new b(!0),I=new b(!0),O=new b(!1),R=new b(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){if(!n(e))throw new s("dynamicObject is required");if(!n(t))throw new s("scene is required");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:g},materialAppearanceType:{value:v}}),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)&&x.isConstant(this._showProperty)&&x.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)&&x.isConstant(this._showProperty)&&x.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){if(!n(e))throw new s("time is required."); if(!this._fillEnabled)throw new s("This instance does not represent a filled geometry.");var i,o,a=this._dynamicObject,u=a.isAvailable(e),c=new p(u&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof C){var v=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||u)&&(v=this._materialProperty.color.getValue(e)),o=r.fromColor(v),i={show:c,color:o}}else i={show:c};return E=a.position.getValue(d.MINIMUM_VALUE,E),T=a.orientation.getValue(d.MINIMUM_VALUE,T),A=m.fromQuaternion(T,A),new h({id:a,geometry:new l(this._options),modelMatrix:f.fromRotationTranslation(A,E),attributes:i})},B.prototype.createOutlineGeometryInstance=function(e){if(!n(e))throw new s("time is required.");if(!this._outlineEnabled)throw new s("This instance does not represent an outlined geometry.");var i=this._dynamicObject,o=i.isAvailable(e);return E=i.position.getValue(d.MINIMUM_VALUE,E),T=i.orientation.getValue(d.MINIMUM_VALUE,T),A=m.fromQuaternion(T,A),new h({id:i,geometry:new u(this._options),modelMatrix:f.fromRotationTranslation(A,E),attributes:{show:new p(o&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(o?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 f=i(r.material,M),p=f instanceof C;this._materialProperty=f,this._fillProperty=i(o,I),this._showProperty=i(m,D),this._showOutlineProperty=i(r.outline,O),this._outlineColorProperty=l?i(r.outlineColor,R):void 0,this._fillEnabled=a,this._outlineEnabled=l;var _=r.stackPartitions,y=r.slicePartitions,w=r.subdivisions;if(u.isConstant&&c.isConstant&&h.isConstant&&x.isConstant(_)&&x.isConstant(y)&&x.isConstant(w)){var b=this._options;b.vertexFormat=p?g.VERTEX_FORMAT:v.VERTEX_FORMAT,b.radii=h.getValue(d.MINIMUM_VALUE,b.radii),b.stackPartitions=n(_)?_.getValue(d.MINIMUM_VALUE):void 0,b.slicePartitions=n(y)?y.getValue(d.MINIMUM_VALUE):void 0,b.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){if(!this._dynamic)throw new s("This instance does not represent dynamic geometry.");if(!n(e))throw new s("primitives is required.");return new F(e,this)};var F=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 f,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0};return F.prototype.update=function(e){if(!n(e))throw new s("time is required.");var o=this._dynamicObject,a=o.ellipsoid,c=a.show;if(!o.isAvailable(e)||n(c)&&!c.getValue(e))return n(this._primitive)&&(this._primitive.show=!1),n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1),void 0;var d,C=!n(a.fill)||a.fill.getValue(e),b=n(a.outline)&&a.outline.getValue(e),x=n(a.outlineColor)?a.outlineColor.getValue(e):t.BLACK,D=S.getValue(e,i(a.material,M),this._material);this._material=D;var I=a.stackPartitions,O=a.slicePartitions,R=a.subdivisions,N=n(I)?I.getValue(e):void 0,B=n(O)?O.getValue(e):void 0,F=n(R)?R.getValue(e):void 0,z=this._options,V=this._scene.mode,q=V===w.SCENE3D,k=this._modelMatrix,U=o.position,W=o.orientation,G=a.radii;E=U.getValue(e,E),T=W.getValue(e,T),A=m.fromQuaternion(T,A),P=G.getValue(e,P),k=f.fromRotationTranslation(A,E,k);var H=!q||this._lastSceneMode!==V||!n(this._primitive)||z.stackPartitions!==N||z.slicePartitions!==B||z.subdivisions!==F;if(H)this._removePrimitives(),this._lastSceneMode=V,z.stackPartitions=N,z.slicePartitions=B,z.subdivisions=F,z.radii=q?L:P,this._material=D,D=this._material,d=new v({material:D,translucent:D.isTranslucent(),closed:!0}),z.vertexFormat=d.vertexFormat,this._primitive=new _({geometryInstances:new h({id:o,geometry:new l(z),modelMatrix:q?void 0:k,attributes:{show:new p(C)}}),appearance:d,asynchronous:!1}),this._primitives.add(this._primitive),z.vertexFormat=g.VERTEX_FORMAT,this._outlinePrimitive=new _({geometryInstances:new h({id:o,geometry:new u(z),modelMatrix:q?void 0:k,attributes:{show:new p(b),color:r.fromColor(x)}}),appearance:new g({flat:!0,translucent:1!==x.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive);else if(this._primitive._state===y.COMPLETE){var j=this._primitive;d=j.appearance,d.material=D;var Y=this._attributes;n(Y)||(Y=j.getGeometryInstanceAttributes(o),this._attributes=Y),Y.show=p.toValue(C,Y.show);var X=this._outlinePrimitive,Z=this._outlineAttributes;n(Z)||(Z=X.getGeometryInstanceAttributes(o),this._outlineAttributes=Z),Z.show=p.toValue(b,Z.show),Z.color=r.toValue(x,Z.color)}q&&(P.x=Math.max(P.x,.001),P.y=Math.max(P.y,.001),P.z=Math.max(P.z,.001),k=f.multiplyByScale(k,P,k),this._primitive.modelMatrix=k,this._outlinePrimitive.modelMatrix=k)},F.prototype.isDestroyed=function(){return!1},F.prototype._removePrimitives=function(){n(this._primitive)&&this._primitives.remove(this._primitive),n(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive)},F.prototype.destroy=function(){this._removePrimitives(),a(this)},B}),r("DynamicScene/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","../Scene/PrimitiveState"],function(e,t,r,i,n,o,a){"use strict";var s=new t,l=function(t,r,i,n){this.translucent=r,this.appearanceType=i,this.closed=n,this.primitives=t,this.createPrimitive=!1,this.primitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,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 l=!0,u=0,c=this.primitive,h=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),i(c)&&h.remove(c);var d=this.geometry.values;d.length>0&&(c=new o({asynchronous:!0,geometryInstances:d,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),h.add(c),l=!1),this.primitive=c,this.createPrimitive=!1}else if(i(c)&&c._state===a.COMPLETE)for(var m=this.updatersWithAttributes.values,f=m.length,p=0;f>p;p++){var v=m[p],g=this.geometry.get(v.dynamicObject.id),_=this.attributes.get(g.id.id);if(i(_)||(_=c.getGeometryInstanceAttributes(g.id),this.attributes.set(g.id.id,_)),!v.fillMaterialProperty.isConstant){var y=v.fillMaterialProperty.color;y.getValue(e,s),t.equals(_._lastColor,s)||(_._lastColor=t.clone(s,_._lastColor),_.color=r.toValue(s,_.color),(this.translucent&&255===_.color[3]||!this.translucent&&255!==_.color[3])&&(this.itemsToRemove[u++]=v))}if(!v.hasConstantFill){var w=v.isFilled(e);w!==_._lastShow&&(_._lastShow=w,_.show=n.toValue(w,_.show))}}else i(c)&&c._state!==a.COMPLETE&&(l=!1);return this.itemsToRemove.length=u,l},l.prototype.removeAllPrimitives=function(){var e=this.primitive;i(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,i=this._solidBatch.update(e);i=this._translucentBatch.update(e)&&i;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;o>t;t++)r=n[t],this._solidBatch.remove(r),this._translucentBatch.add(r,r.createFillGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;a>t;t++)r=n[t],this._translucentBatch.remove(r),this._solidBatch.add(r,r.createFillGeometryInstance(e));return(o>0||a>0)&&(i=this._solidBatch.update(e)&&i,i=this._translucentBatch.update(e)&&i),i},u.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},u}),r("DynamicScene/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","../Scene/PrimitiveState","./MaterialProperty"],function(e,t,r,i,n,o){"use strict";var a=function(t,r,i,n){this.primitives=t,this.appearanceType=r,this.materialProperty=i,this.closed=n,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(a.prototype.onMaterialChanged,this)};a.prototype.onMaterialChanged=function(){this.invalidated=!0},a.prototype.isMaterial=function(e){var r=this.materialProperty,i=e.fillMaterialProperty;return i===r?!0:t(r)?r.equals(i):!1},a.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},a.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},a.prototype.update=function(e){var a=!0,s=this.primitive,l=this.primitives,u=this.geometry.values;if(this.createPrimitive)t(s)&&l.remove(s),u.length>0&&(this.material=o.getValue(e,this.materialProperty,this.material),s=new i({asynchronous:!0,geometryInstances:u,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed})}),l.add(s),a=!1),this.primitive=s,this.createPrimitive=!1;else if(t(s)&&s._state===n.COMPLETE){this.material=o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;for(var c=this.updatersWithAttributes.values,h=c.length,d=0;h>d;d++){var m=c[d],f=this.geometry.get(m.dynamicObject.id),p=this.attributes.get(f.id.id);if(t(p)||(p=s.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,p)),!m.hasConstantFill){var v=m.isFilled(e);v!==p._lastShow&&(p._lastShow=v,p.show=r.toValue(v,p.show))}}}else t(s)&&s._state!==n.COMPLETE&&(a=!1);return a},a.prototype.destroy=function(){var e=this.primitive,r=this.primitives;t(e)&&r.remove(e),this.removeMaterialSubscription()};var s=function(e,t,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=r};return s.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 s=new a(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);s.add(e,t),r.push(s)},s.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}}},s.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()}}var l=!0;for(t=0;i>t;t++)l=r[t].update(e)&&l;return l},s.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,r=0;t>r;r++)e[r].destroy();this._items.length=0},s}),r("DynamicScene/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/PrimitiveState"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t,r,i){this.translucent=r,this.appearanceType=i,this.primitives=t,this.createPrimitive=!1,this.primitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,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 t;l.prototype.update=function(e){var l=!0,c=0,h=this.primitive,d=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),i(h)&&d.remove(h);var m=this.geometry.values;m.length>0&&(h=new a({asynchronous:!0,geometryInstances:m,appearance:new o({flat:!0,translucent:this.translucent})}),d.add(h),l=!1),this.primitive=h,this.createPrimitive=!1}else if(i(h)&&h._state===s.COMPLETE)for(var f=this.updatersWithAttributes.values,p=f.length,v=0;p>v;v++){var g=f[v],_=this.geometry.get(g.dynamicObject.id),y=this.attributes.get(_.id.id);if(i(y)||(y=h.getGeometryInstanceAttributes(_.id),this.attributes.set(_.id.id,y)),!g.outlineColorProperty.isConstant){var w=g.outlineColorProperty;w.getValue(e,u),t.equals(y._lastColor,u)||(y._lastColor=t.clone(u,y._lastColor),y.color=r.toValue(u,y.color),(this.translucent&&255===y.color[3]||!this.translucent&&255!==y.color[3])&&(this.itemsToRemove[c++]=g))}if(!g.hasConstantOutline){var C=g.isOutlineVisible(e);C!==y._lastShow&&(y._lastShow=C,y.show=n.toValue(C,y.show))}}else i(h)&&h._state!==s.COMPLETE&&(l=!1);return this.itemsToRemove.length=c,l},l.prototype.removeAllPrimitives=function(){var e=this.primitive;i(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,i=this._solidBatch.update(e);i=this._translucentBatch.update(e)&&i;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;o>t;t++)r=n[t],this._solidBatch.remove(r),this._translucentBatch.add(r,r.createOutlineGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;a>t;t++)r=n[t],this._translucentBatch.remove(r),this._solidBatch.add(r,r.createOutlineGeometryInstance(e));return(o>0||a>0)&&(i=this._solidBatch.update(e)&&i,i=this._translucentBatch.update(e)&&i),i},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);return!0},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(r,n,l){if(!t(r))throw new i("type is required.");if(!t(n))throw new i("scene is required.");if(!t(l))throw new i("dynamicObjectCollection is required.");this._type=r;var u=n.primitives;this._scene=n,this._primitives=u,this._dynamicObjectCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new s(u),this._closedColorBatch=new o(u,r.perInstanceColorAppearanceType,!0),this._closedMaterialBatch=new a(u,r.materialAppearanceType,!0),this._openColorBatch=new o(u,r.perInstanceColorAppearanceType,!1),this._openMaterialBatch=new a(u,r.materialAppearanceType,!1),this._dynamicBatch=new h(u),this._subscriptions=new e,this._updaters=new e,this._dynamicObjectCollection=l,l.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._onCollectionChanged(l,l.getObjects(),c)};return d.prototype.update=function(e){if(!t(e))throw new i("time is required.");var r,n,o,a,s=this._addedObjects,c=s.values,h=this._removedObjects,m=h.values,f=this._changedObjects,p=f.values;for(r=m.length-1;r>-1;r--)n=m[r],o=n.id,a=this._updaters.get(o),l(this,a),a.destroy(),this._updaters.remove(o),this._subscriptions.get(o)(),this._subscriptions.remove(o);for(r=c.length-1;r>-1;r--)n=c[r],o=n.id,a=new this._type(n,this._scene),this._updaters.set(o,a),u(this,e,a),this._subscriptions.set(o,a.geometryChanged.addEventListener(d._onGeometryChanged,this));for(r=p.length-1;r>-1;r--)n=p[r],o=n.id,a=this._updaters.get(o),l(this,a),u(this,e,a);s.removeAll(),h.removeAll(),f.removeAll();var v=this._outlineBatch.update(e);return v=this._closedColorBatch.update(e)&&v,v=this._closedMaterialBatch.update(e)&&v,v=this._openColorBatch.update(e)&&v,v=this._openMaterialBatch.update(e)&&v,v=this._dynamicBatch.update(e)&&v},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=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,i=0;t>i;i++)e[i]();return this._subscriptions.removeAll(),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/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolygonGeometry","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";var w=v.fromColor(e.WHITE),C=new g(!0),b=new g(!0),S=new g(!1),x=new g(e.BLACK),E=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){if(!i(e))throw new a("dynamicObject is required");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 s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new E(e),this._onDynamicObjectPropertyChanged(e,"polygon",e.polygon,void 0)};n(T,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:m}}),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)&&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||!i(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.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){if(!i(r))throw new a("time is required.");if(!this._fillEnabled)throw new a("This instance does not represent a filled geometry.");var n,o,s=this._dynamicObject,u=s.isAvailable(r),h=new d(u&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||u)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:h,color:o}}else n={show:h};return new l({id:s,geometry:new c(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){if(!i(r))throw new a("time is required.");if(!this._outlineEnabled)throw new a("This instance does not represent an outlined geometry.");var n=this._dynamicObject,o=n.isAvailable(r);return new l({id:n,geometry:new h(this._options),attributes:{show:new d(o&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o?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(u.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(u.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var c=this._dynamicObject.vertexPositions,h=n.show;if(i(h)&&h.isConstant&&!h.getValue(u.MINIMUM_VALUE)||!i(c))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,w),p=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,b),this._showProperty=r(h,C),this._showOutlineProperty=r(n.outline,S),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var g=n.height,_=n.extrudedHeight,E=n.granularity,T=n.stRotation,P=n.perPositionHeight;if(this._isClosed=i(_),this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(E)&&y.isConstant(T)&&y.isConstant(P)){var A=this._options;A.vertexFormat=p?f.VERTEX_FORMAT:m.VERTEX_FORMAT,A.polygonHierarchy.positions=c.getValue(u.MINIMUM_VALUE,A.polygonHierarchy.positions),A.height=i(g)?g.getValue(u.MINIMUM_VALUE):void 0,A.extrudedHeight=i(_)?_.getValue(u.MINIMUM_VALUE):void 0,A.granularity=i(E)?E.getValue(u.MINIMUM_VALUE):void 0,A.stRotation=i(T)?T.getValue(u.MINIMUM_VALUE):void 0,A.perPositionHeight=i(P)?P.getValue(u.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){if(!this._dynamic)throw new a("This instance does not represent dynamic geometry.");if(!i(e))throw new a("primitives is required.");return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._dynamicObject)};return P.prototype.update=function(r){if(!i(r))throw new a("time is required.");var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,s=o.polygon,u=s.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var d=this._options,v=o.vertexPositions,g=s.perPositionHeight,y=s.height,w=s.extrudedHeight,C=s.granularity,b=s.stRotation;if(d.polygonHierarchy.positions=v.getValue(r,d.polygonHierarchy.positions),d.height=i(y)?y.getValue(r,d):void 0,d.extrudedHeight=i(w)?w.getValue(r,d):void 0,d.granularity=i(C)?C.getValue(r):void 0,d.stRotation=i(b)?b.getValue(r):void 0,!i(s.fill)||s.fill.getValue(r)){d.perPositionHeight=i(g)?g.getValue(r):void 0,this._material=_.getValue(r,n.fillMaterialProperty,this._material);var S=this._material,x=new m({material:S,translucent:S.isTranslucent(),closed:i(d.extrudedHeight)});d.vertexFormat=x.vertexFormat,this._primitive=new p({geometryInstances:new l({id:o,geometry:new c(d)}),appearance:x,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(s.outline)&&s.outline.getValue(r)){d.vertexFormat=f.VERTEX_FORMAT;var E=i(s.outlineColor)?s.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new p({geometryInstances:new l({id:o,geometry:new h(d),attributes:{color:t.fromColor(E)}}),appearance:new f({flat:!0,translucent:1!==E.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.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/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/defineProperties","../Core/VertexFormat","../Renderer/createShaderSource","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),u=!1,c=i({sources:[a,o]}),h=n,d=l.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,c),this._fragmentShaderSource=e(t.fragmentShaderSource,h),this._renderState=e(t.renderState,s.getDefaultRenderState(r,u)),this._closed=u,this._vertexFormat=d};return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),l.VERTEX_FORMAT=r.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),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/defineProperties","../Core/VertexFormat","../Renderer/createShaderSource","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),h=!1,d=n({sources:[a,o]}),m=s,f=c.VERTEX_FORMAT;this.material=t(r.material)?r.material:u.fromType(u.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,d),this._fragmentShaderSource=e(r.fragmentShaderSource,m),this._renderState=e(r.renderState,l.getDefaultRenderState(i,h)),this._closed=h,this._vertexFormat=f};return r(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),c.VERTEX_FORMAT=i.POSITION_AND_ST,c.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,c.prototype.isTranslucent=l.prototype.isTranslucent,c.prototype.getRenderState=l.prototype.getRenderState,c }),r("DynamicScene/PolylineGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_){"use strict";var y=p.fromColor(e.WHITE),w=new v(!0),C=function(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0},b=function(e){if(!i(e))throw new a("dynamicObject is required");this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(b.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._options=new C(e),this._onDynamicObjectPropertyChanged(e,"polyline",e.polyline,void 0)};n(b,{perInstanceColorAppearanceType:{value:d},materialAppearanceType:{value:m}}),n(b.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._dynamicObject.availability)&&_.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}}}),b.prototype.isOutlineVisible=function(){return!1},b.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},b.prototype.createFillGeometryInstance=function(r){if(!i(r))throw new a("time is required.");if(!this._fillEnabled)throw new a("This instance does not represent a filled geometry.");var n,o,s=this._dynamicObject,u=s.isAvailable(r),d=new h(u&&this._showProperty.getValue(r));if(this._materialProperty instanceof p){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||u)&&(m=this._materialProperty.color.getValue(r)),n=t.fromColor(m),o={show:d,color:n}}else o={show:d};return new l({id:s,geometry:new c(this._options),attributes:o})},b.prototype.createOutlineGeometryInstance=function(){throw new a("This instance does not represent an outlined geometry.")},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){this._dynamicObjectSubscription(),o(this)},b.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(u.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 p;this._materialProperty=s,this._showProperty=r(a,w),this._fillEnabled=!0;var c=n.width;if(o.isConstant&&_.isConstant(c)){var h=this._options,f=o.getValue(u.MINIMUM_VALUE,h.positions);if(!i(f)||f.length<2)return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;h.vertexFormat=l?d.VERTEX_FORMAT:m.VERTEX_FORMAT,h.positions=f,h.width=i(c)?c.getValue(u.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){if(!this._dynamic)throw new a("This instance does not represent dynamic geometry.");if(!i(e))throw new a("primitives is required.");return new S(e,this)};var S=function(e,t){this._primitives=e,this._primitive=void 0,this._geometryUpdater=t,this._options=new C(t._dynamicObject)};return S.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,s=r.vertexPositions,u=s.getValue(e,a.positions);if(i(u)&&!(u.length<2)){a.positions=u;var h=n.width;a.width=i(h)?h.getValue(e):void 0,this._material=g.getValue(e,t.fillMaterialProperty,this._material);var d=this._material,p=new m({material:d,translucent:d.isTranslucent(),closed:!1});a.vertexFormat=p.vertexFormat,this._primitive=new f({geometryInstances:new l({id:r,geometry:new c(a)}),appearance:p,asynchronous:!1}),this._primitives.add(this._primitive)}}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),o(this)},b}),r("DynamicScene/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";var w=v.fromColor(e.WHITE),C=new g(!0),b=new g(!0),S=new g(!1),x=new g(e.BLACK),E=function(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0},T=function(e){if(!i(e))throw new a("dynamicObject is required");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 s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new E(e),this._onDynamicObjectPropertyChanged(e,"rectangle",e.rectangle,void 0)};n(T,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:m}}),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)&&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||!i(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.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){if(!i(r))throw new a("time is required.");if(!this._fillEnabled)throw new a("This instance does not represent a filled geometry.");var n,o,s=this._dynamicObject,u=s.isAvailable(r),h=new d(u&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||u)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:h,color:o}}else n={show:h};return new l({id:s,geometry:new c(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){if(!i(r))throw new a("time is required.");if(!this._outlineEnabled)throw new a("This instance does not represent an outlined geometry.");var n=this._dynamicObject,o=n.isAvailable(r);return new l({id:n,geometry:new h(this._options),attributes:{show:new d(o&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o?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||"rectangle"===t){var n=this._dynamicObject.rectangle;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(u.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(u.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var c=n.coordinates,h=n.show;if(i(h)&&h.isConstant&&!h.getValue(u.MINIMUM_VALUE)||!i(c))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,w),p=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,b),this._showProperty=r(h,C),this._showOutlineProperty=r(n.outline,S),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var g=n.height,_=n.extrudedHeight,E=n.granularity,T=n.stRotation,P=n.rotation,A=n.closeBottom,M=n.closeTop;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(E)&&y.isConstant(T)&&y.isConstant(P)&&y.isConstant(A)&&y.isConstant(M)){var D=this._options;D.vertexFormat=p?f.VERTEX_FORMAT:m.VERTEX_FORMAT,D.rectangle=c.getValue(u.MINIMUM_VALUE,D.rectangle),D.height=i(g)?g.getValue(u.MINIMUM_VALUE):void 0,D.extrudedHeight=i(_)?_.getValue(u.MINIMUM_VALUE):void 0,D.granularity=i(E)?E.getValue(u.MINIMUM_VALUE):void 0,D.stRotation=i(T)?T.getValue(u.MINIMUM_VALUE):void 0,D.rotation=i(P)?P.getValue(u.MINIMUM_VALUE):void 0,D.closeBottom=i(A)?A.getValue(u.MINIMUM_VALUE):void 0,D.closeTop=i(M)?M.getValue(u.MINIMUM_VALUE):void 0,this._isClosed=i(_)&&i(D.closeTop)&&i(D.closeBottom)&&D.closeTop&&D.closeBottom,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){if(!this._dynamic)throw new a("This instance does not represent dynamic geometry.");if(!i(e))throw new a("primitives is required.");return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._dynamicObject)};return P.prototype.update=function(r){if(!i(r))throw new a("time is required.");var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,s=o.rectangle,u=s.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var d=this._options,v=s.coordinates,g=s.closeBottom,y=s.closeTop,w=s.height,C=s.extrudedHeight,b=s.granularity,S=s.stRotation,x=s.rotation;if(d.rectangle=v.getValue(r,d.rectangle),d.height=i(w)?w.getValue(r,d):void 0,d.extrudedHeight=i(C)?C.getValue(r,d):void 0,d.granularity=i(b)?b.getValue(r):void 0,d.stRotation=i(S)?S.getValue(r):void 0,d.rotation=i(x)?x.getValue(r):void 0,!i(s.fill)||s.fill.getValue(r)){d.closeBottom=i(g)?g.getValue(r):void 0,d.closeTop=i(y)?y.getValue(r):void 0,this._material=_.getValue(r,n.fillMaterialProperty,this._material);var E=this._material,T=new m({material:E,translucent:E.isTranslucent(),closed:d.closeTop&&d.closeBottom});d.vertexFormat=T.vertexFormat,this._primitive=new p({geometryInstances:new l({id:o,geometry:new c(d)}),appearance:T,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(s.outline)&&s.outline.getValue(r)){d.vertexFormat=f.VERTEX_FORMAT;var P=i(s.outlineColor)?s.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new p({geometryInstances:new l({id:o,geometry:new h(d),attributes:{color:t.fromColor(P)}}),appearance:new f({flat:!0,translucent:1!==P.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},T}),r("DynamicScene/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";var w=v.fromColor(e.WHITE),C=new g(!0),b=new g(!0),S=new g(!1),x=new g(e.BLACK),E=function(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0},T=function(e){if(!i(e))throw new a("dynamicObject is required");this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(T.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new E(e),this._onDynamicObjectPropertyChanged(e,"wall",e.wall,void 0)};n(T,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:m}}),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)&&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||!i(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},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){if(!i(r))throw new a("time is required.");if(!this._fillEnabled)throw new a("This instance does not represent a filled geometry.");var n,o,s=this._dynamicObject,u=s.isAvailable(r),d=new c(u&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||u)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:d,color:o}}else n={show:d};return new l({id:s,geometry:new h(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){if(!i(r))throw new a("time is required.");if(!this._outlineEnabled)throw new a("This instance does not represent an outlined geometry.");var n=this._dynamicObject,o=n.isAvailable(r);return new l({id:n,geometry:new d(this._options),attributes:{show:new c(o&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o?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||"wall"===t){var n=this._dynamicObject.wall;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(u.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(u.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var c=this._dynamicObject.vertexPositions,h=n.show;if(i(h)&&h.isConstant&&!h.getValue(u.MINIMUM_VALUE)||!i(c))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,w),p=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,b),this._showProperty=r(h,C),this._showOutlineProperty=r(n.outline,S),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var g=n.minimumHeights,_=n.maximumHeights,E=n.granularity;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(E)){var T=this._options;T.vertexFormat=p?f.VERTEX_FORMAT:m.VERTEX_FORMAT,T.positions=c.getValue(u.MINIMUM_VALUE,T.positions),T.minimumHeights=i(g)?g.getValue(u.MINIMUM_VALUE,T.minimumHeights):void 0,T.maximumHeights=i(_)?_.getValue(u.MINIMUM_VALUE,T.maximumHeights):void 0,T.granularity=i(E)?E.getValue(u.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){if(!this._dynamic)throw new a("This instance does not represent dynamic geometry.");if(!i(e))throw new a("primitives is required.");return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._dynamicObject)};return P.prototype.update=function(r){if(!i(r))throw new a("time is required.");var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,s=o.wall,u=s.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var c=this._options,v=o.vertexPositions,g=s.minimumHeights,y=s.maximumHeights,w=s.granularity;if(c.positions=v.getValue(r,c.positions),c.minimumHeights=i(g)?g.getValue(r,c.minimumHeights):void 0,c.maximumHeights=i(y)?y.getValue(r,c.maximumHeights):void 0,c.granularity=i(w)?w.getValue(r):void 0,!i(s.fill)||s.fill.getValue(r)){this._material=_.getValue(r,n.fillMaterialProperty,this._material);var C=this._material,b=new m({material:C,translucent:C.isTranslucent(),closed:!1});c.vertexFormat=b.vertexFormat,this._primitive=new p({geometryInstances:new l({id:o,geometry:new h(c)}),appearance:b,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(s.outline)&&s.outline.getValue(r)){c.vertexFormat=f.VERTEX_FORMAT;var S=i(s.outlineColor)?s.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new p({geometryInstances:new l({id:o,geometry:new d(c),attributes:{color:t.fromColor(S)}}),appearance:new f({flat:!0,translucent:1!==S.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},T}),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","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";var w=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._visualizersCallback=e(a,w.defaultVisualizersCallback);for(var s=0,l=o.length;l>s;s++)this._onDataSourceAdded(o,o.get(s))};return w.defaultVisualizersCallback=function(e,t){var r=t.dynamicObjects;return[new o(e,r),new p(m,e,r),new p(f,e,r),new p(v,e,r),new p(g,e,r),new p(_,e,r),new p(y,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)]},w.prototype.getScene=function(){return this._scene},w.prototype.getDataSources=function(){return this._dataSourceCollection},w.prototype.isDestroyed=function(){return!1},w.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)},w.prototype.update=function(e){if(!t(e))throw new i("time is required.");var r,n,o,a,s=!0,l=this._dataSourceCollection,u=l.length;for(r=0;u>r;r++){var c=l.get(r);for(t(c.update)&&(s=c.update(e)&&s),o=c._visualizers,a=o.length,n=0;a>n;n++)s=o[n].update(e)&&s}return s},w.prototype._onDataSourceAdded=function(e,t){var r=this._visualizersCallback(this._scene,t);t._visualizers=r},w.prototype._onDataSourceRemoved=function(e,t){for(var r=t._visualizers,i=r.length,n=0;i>n;n++)r[n].destroy(),t._visualizers=void 0},w}),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("DynamicScene/DynamicObjectView",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Transforms","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,i,u,c,S,x){var E=c.getValue(S,t._lastCartesian);if(r(E)){var T,P,A,M=!1;C=o.addSeconds(S,.001,C);var D=c.getValue(C,p);if(r(D)){var I,O=l.computeFixedToIcrfMatrix(S,d),R=l.computeFixedToIcrfMatrix(C,m);r(O)&&r(R)?I=s.transpose(O,f):(I=l.computeTemeToPseudoFixedMatrix(S,f),O=s.transpose(I,d),R=l.computeTemeToPseudoFixedMatrix(C,m),s.transpose(R,R));var L=s.multiplyByVector(O,E,y),N=s.multiplyByVector(R,D,w);e.subtract(L,N,_);var B=1e3*e.magnitude(_),F=3986004418e5,z=-F/(B*B-2*F/e.magnitude(L));0>z||z>b*x.maximumRadius?(T=v,e.normalize(E,T),e.negate(T,T),A=e.clone(e.UNIT_Z,g),P=e.cross(A,T,p),e.magnitude(P)>a.EPSILON7&&(e.normalize(T,T),e.normalize(P,P),A=e.cross(T,P,g),e.normalize(A,A),M=!0)):e.equalsEpsilon(E,D,a.EPSILON7)||(A=v,e.normalize(L,A),e.normalize(N,N),P=e.cross(A,N,g),e.equalsEpsilon(P,e.ZERO,a.EPSILON7)||(T=e.cross(P,A,p),s.multiplyByVector(I,T,T),s.multiplyByVector(I,P,P),s.multiplyByVector(I,A,A),e.normalize(T,T),e.normalize(P,P),e.normalize(A,A),M=!0))}if(M){var V=i.transform;V[0]=T.x,V[1]=T.y,V[2]=T.z,V[3]=0,V[4]=P.x,V[5]=P.y,V[6]=P.z,V[7]=0,V[8]=A.x,V[9]=A.y,V[10]=A.z,V[11]=0,V[12]=E.x,V[13]=E.y,V[14]=E.z,V[15]=0}else l.eastNorthUpToFixedFrame(E,x,i.transform);t._screenSpaceCameraController.ellipsoid=n.UNIT_SPHERE}h(t,i,u)}function h(t,r,i){var n=t.scene;(i||n.mode!==t._mode)&&(t._mode=n.mode,n.mode===u.SCENE2D?r.lookAt(t._offset2D,e.ZERO,t._up2D):r.lookAt(t._offset3D,e.ZERO,t._up3D)),n.mode===u.SCENE2D?(e.fromElements(0,0,r.getMagnitude(),t._offset2D),e.clone(r.up,t._up2D)):(e.clone(r.position,t._offset3D),e.clone(r.up,t._up3D))}var d=new s,m=new s,f=new s,p=new e,v=new e,g=new e,_=new e,y=new e,w=new e,C=new o,b=1.25,S=new e,x=function(r,i,o){this.dynamicObject=r,this.scene=i,this._lastScene=void 0,this.ellipsoid=t(o,n.WGS84),this._lastDynamicObject=void 0,this._mode=void 0,this._lastCartesian=new e,this._offset3D=new e(-1e4,2500,2500),this._up3D=e.cross(this._offset3D,e.cross(e.UNIT_Z,this._offset3D,S),new e),e.normalize(this._up3D,this._up3D),this._offset2D=new e(0,0,e.magnitude(this._offset3D)),this._up2D=e.clone(e.UNIT_Y)};return x.prototype.update=function(e){var t=this.scene,n=this.dynamicObject,o=this.ellipsoid;if(!r(e))throw new i("time is required.");if(!r(t))throw new i("DynamicObjectView.scene is required.");if(!r(n))throw new i("DynamicObjectView.dynamicObject is required.");if(!r(o))throw new i("DynamicObjectView.ellipsoid is required.");if(!r(n.position))throw new i("dynamicObject.position is required.");t!==this._lastScene&&(this._lastScene=t,this._screenSpaceCameraController=t.screenSpaceCameraController);var a=n.position,s=n!==this._lastDynamicObject;this._lastDynamicObject=n,t.mode!==u.MORPHING&&c(this,t.camera,s,a,e,o)},x}),!function(){function e(e,t){function r(t){var r,i=e.arcs[0>t?~t:t],n=i[0];return e.transform?(r=[0,0],i.forEach(function(e){r[0]+=e[0],r[1]+=e[1]})):r=i[i.length-1],0>t?[r,n]:[n,r]}function i(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[0>e?~e:e]=1}),s.push(i)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(r,i){var n,o=e.arcs[0>r?~r:r];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=r,t[i]=n)}),t.forEach(function(e){var t,i,n=r(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,i=o[l]){delete o[i.start];var u=i===t?t:t.concat(i);o[u.start=t.start]=a[u.end=i.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,i=a[s]){delete a[i.end];var c=i===t?t:i.concat(t);o[c.start=i.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),i(a,o),i(o,a),t.forEach(function(e){n[0>e?~e:e]||s.push([e])}),s}function t(t,r,i){function n(e){var t=0>e?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in h&&(u=e,h[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(r),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){i(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,m=t.arcs.length;m>d;++d)l.push(d);return{type:"MultiLineString",arcs:e(t,l)}}function i(t,r){function i(e){e.forEach(function(t){t.forEach(function(t){(a[t=0>t?~t:t]||(a[t]=[])).push(e)})}),l.push(e)}function o(e){return d(s(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var a={},l=[],u=[];return r.forEach(function(e){"Polygon"===e.type?i(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(i)}),l.forEach(function(e){if(!e._){var t=[],r=[e];for(e._=1,u.push(t);e=r.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].forEach(function(e){e._||(e._=1,r.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].length<2&&i.push(e)})})}),i=e(t,i),(n=i.length)>1)for(var s,l=o(r[0][0]),u=0;n>u;++u)if(l===o(i[u])){s=i[0],i[0]=i[u],i[u]=s;break}return i})}}function o(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return a(e,t)})}:a(e,t)}function a(e,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:s(e,t)};return null==t.id&&delete r.id,r}function s(e,t){function r(e,t){t.length&&t.pop();for(var r,i=c[0>e?~e:e],n=0,o=i.length;o>n;++n)t.push(r=i[n].slice()),u(r,n);0>e&&l(t,o)}function i(e){return e=e.slice(),u(e,0),e}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].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function s(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(s)}:t in h?{type:t,coordinates:h[t](e)}:null}var u=v(e.transform),c=e.arcs,h={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 a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return s(t)}function l(e,t){for(var r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function u(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 a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var s in n)for(var l=n[s],c=l.length,h=0;c>h;++h)for(var d=h+1;c>d;++d){var m,f=l[h],p=l[d];(m=o[f])[s=u(m,p)]!==p&&m.splice(s,0,p),(m=o[p])[s=u(m,f)]!==f&&m.splice(s,0,f)}return o}function h(e,t){function r(e){a.remove(e),e[1][2]=t(e),a.push(e)}var i,n=v(e.transform),o=g(e.transform),a=p(),s=0;for(t||(t=m),e.arcs.forEach(function(e){var r=[];e.forEach(n);for(var o=1,s=e.length-1;s>o;++o)i=e.slice(o-1,o+2),i[1][2]=t(i),r.push(i),a.push(i);e[0][2]=e[s][2]=1/0;for(var o=0,s=r.length;s>o;++o)i=r[o],i.previous=r[o-1],i.next=r[o+1]});i=a.pop();){var l=i.previous,u=i.next;i[1][2]0;){var r=(t+1>>1)-1,n=i[r];if(f(e,n)>=0)break;i[n._=t]=n,i[e._=t=r]=e}}function t(e,t){for(;;){var r=t+1<<1,o=r-1,a=t,s=i[a];if(n>o&&f(i[o],s)<0&&(s=i[a=o]),n>r&&f(i[r],s)<0&&(s=i[a=r]),a===t)break;i[s._=t]=s,i[e._=t=a]=e}}var r={},i=[],n=0;return r.push=function(t){return e(i[t._=n]=t,n++),n},r.pop=function(){if(!(0>=n)){var e,r=i[0];return--n>0&&(e=i[n],t(i[e._=0]=e,0)),r}},r.remove=function(r){var o,a=r._;if(i[a]===r)return a!==--n&&(o=i[n],(f(o,r)<0?e:t)(i[o._=a]=o,a)),a},r}function v(e){if(!e)return _;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0),e[0]=(t+=e[0])*i+o,e[1]=(r+=e[1])*n+a}}function g(e){if(!e)return _;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0);var l=0|(e[0]-o)/i,u=0|(e[1]-a)/n;e[0]=l-t,e[1]=u-r,t=l,r=u}}function _(){}var y={version:"1.6.8",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,i.apply(this,arguments))},mergeArcs:i,feature:o,neighbors:c,presimplify:h}; "function"==typeof r&&r.amd?r("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),r("DynamicScene/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/RuntimeError","../ThirdParty/topojson","../ThirdParty/when","./ColorMaterialProperty","./ConstantProperty","./DynamicObject","./DynamicObjectCollection","./DynamicPoint","./DynamicPolygon","./DynamicPolyline"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,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 w(e,t){var n=e.id;if(i(n)&&"Feature"===e.type){for(var o=2,a=n;i(t.getById(a));)a=n+"_"+o,o++;n=a}else n=r();var s=t.getOrCreateObject(n);s.geoJson=e;var l=e.properties;if(i(l)){var u,c;for(u in l)if(l.hasOwnProperty(u)&&l[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)&&l[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 C(e,t){for(var r=new Array(e.length),i=0;ia;a++)b(e,o[a],void 0,i,n)}function x(e,t,r,n,o){for(var a=r.geometries,s=0,l=a.length;l>s;s++){var c=a[s],h=c.type,d=N[h];if(!i(d))throw new u("Unknown geometry type: "+h);d(e,t,c,n,o)}}function E(e,t,r,i){var n=w(t,e._dynamicObjectCollection);n.merge(e.defaultPoint),n.position=new m(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,i){if(!e(t))throw new r("time is required.");var n=this._value;if(!e(n))return void 0;var o=n.length;e(i)||(i=new Array(o));for(var a=0,s=0;o>a;){var l=this._value[a],u=l.getValue(t,i[a]);e(u)&&(i[s]=u,s++),a++}return i.length=s,i},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("DynamicScene/Visualizer",["../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("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/defineProperties","../Core/Matrix4"],function(e,t,r){"use strict";var i=new e,n=function(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue};if(t(n.prototype,{size:{get:function(){return this._size}},datatype:{get:function(){return this._datatype}}}),"undefined"==typeof WebGLRenderingContext)return{};var o={};o[WebGLRenderingContext.FLOAT]="float",o[WebGLRenderingContext.FLOAT_VEC2]="vec2",o[WebGLRenderingContext.FLOAT_VEC3]="vec3",o[WebGLRenderingContext.FLOAT_VEC4]="vec4",o[WebGLRenderingContext.INT]="int",o[WebGLRenderingContext.INT_VEC2]="ivec2",o[WebGLRenderingContext.INT_VEC3]="ivec3",o[WebGLRenderingContext.INT_VEC4]="ivec4",o[WebGLRenderingContext.BOOL]="bool",o[WebGLRenderingContext.BOOL_VEC2]="bvec2",o[WebGLRenderingContext.BOOL_VEC3]="bvec3",o[WebGLRenderingContext.BOOL_VEC4]="bvec4",o[WebGLRenderingContext.FLOAT_MAT2]="mat2",o[WebGLRenderingContext.FLOAT_MAT3]="mat3",o[WebGLRenderingContext.FLOAT_MAT4]="mat4",o[WebGLRenderingContext.SAMPLER_2D]="sampler2D",o[WebGLRenderingContext.SAMPLER_CUBE]="samplerCube",n.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,r=this._size;return t+=1===r?";":"["+r.toString()+"];"};var a={czm_viewport:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_model:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_inverseProjectionOIT:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseProjectionOIT}}),czm_infiniteProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_sunPositionWC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return r.getTranslation(e.inverseView,i)}}),czm_frameNumber:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_temeToPseudoFixed:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.resolutionScale}})};return a}),r("Renderer/Buffer",["../Core/defaultValue","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i){"use strict";var n=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 t(n.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),n.prototype._getBuffer=function(){return this._buffer},n.prototype.copyFromArrayView=function(t,r){if(r=e(r,0),!t)throw new i("arrayView is required.");if(r+t.byteLength>this._sizeInBytes)throw new i("This buffer is not large enough.");var n=this._gl,o=this._bufferTarget;n.bindBuffer(o,this._buffer),n.bufferSubData(o,r,t),n.bindBuffer(o,null)},n.prototype.isDestroyed=function(){return!1},n.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},n}),r("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,r){"use strict";var i=function(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner};return i.ALL=r(new i({color:new e(0,0,0,0),depth:1,stencil:0})),i.prototype.execute=function(e,t){e.clear(this,t)},i}),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("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){var i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,r._target,r._texture,0)}function s(e,t,r){var i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,r._getRenderbuffer())}var l=function(r,i,l){if(l=e(l,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=e(l.destroyAttachments,!0),t(l.colorTextures)&&t(l.colorRenderbuffers))throw new n("Cannot have both color texture and color renderbuffer attachments.");if(t(l.depthTexture)&&t(l.depthRenderbuffer))throw new n("Cannot have both a depth texture and depth renderbuffer attachment.");if(t(l.depthStencilTexture)&&t(l.depthStencilRenderbuffer))throw new n("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");var u=t(l.depthTexture)||t(l.depthRenderbuffer),c=t(l.depthStencilTexture)||t(l.depthStencilRenderbuffer);if(u&&c)throw new n("Cannot have both a depth and depth-stencil attachment.");if(t(l.stencilRenderbuffer)&&c)throw new n("Cannot have both a stencil and depth-stencil attachment.");if(u&&t(l.stencilRenderbuffer))throw new n("Cannot have both a depth and stencil attachment.");this._bind();var h,d,m,f,p;if(t(l.colorTextures)){var v=l.colorTextures;if(f=this._colorTextures.length=this._activeColorAttachments.length=v.length,f>i)throw new n("The number of color attachments exceeds the number supported.");for(m=0;f>m;++m){if(h=v[m],!o.isColorFormat(h.pixelFormat))throw new n("The color-texture pixel-format must be a color format.");p=this._gl.COLOR_ATTACHMENT0+m,a(this,p,h),this._activeColorAttachments[m]=p,this._colorTextures[m]=h}}if(t(l.colorRenderbuffers)){var g=l.colorRenderbuffers;if(f=this._colorRenderbuffers.length=this._activeColorAttachments.length=g.length,f>i)throw new n("The number of color attachments exceeds the number supported.");for(m=0;f>m;++m)d=g[m],p=this._gl.COLOR_ATTACHMENT0+m,s(this,p,d),this._activeColorAttachments[m]=p,this._colorRenderbuffers[m]=d}if(t(l.depthTexture)){if(h=l.depthTexture,h.pixelFormat!==o.DEPTH_COMPONENT)throw new n("The depth-texture pixel-format must be DEPTH_COMPONENT.");a(this,this._gl.DEPTH_ATTACHMENT,h),this._depthTexture=h}if(t(l.depthRenderbuffer)&&(d=l.depthRenderbuffer,s(this,this._gl.DEPTH_ATTACHMENT,d),this._depthRenderbuffer=d),t(l.stencilRenderbuffer)&&(d=l.stencilRenderbuffer,s(this,this._gl.STENCIL_ATTACHMENT,d),this._stencilRenderbuffer=d),t(l.depthStencilTexture)){if(h=l.depthStencilTexture,h.pixelFormat!==o.DEPTH_STENCIL)throw new n("The depth-stencil pixel-format must be DEPTH_STENCIL.");a(this,this._gl.DEPTH_STENCIL_ATTACHMENT,h),this._depthStencilTexture=h}t(l.depthStencilRenderbuffer)&&(d=l.depthStencilRenderbuffer,s(this,this._gl.DEPTH_STENCIL_ATTACHMENT,d),this._depthStencilRenderbuffer=d),this._unBind()};return r(l.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),l.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},l.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},l.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},l.prototype.getColorTexture=function(e){if(!t(e)||0>e||e>=this._colorTextures.length)throw new n("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]},l.prototype.getColorRenderbuffer=function(e){if(!t(e)||0>e||e>=this._colorRenderbuffers.length)throw new n("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]},l.prototype.isDestroyed=function(){return!1},l.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)},l}),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",[],function(){"use strict";var e={RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,validate:function(t){return t===e.RGBA4||t===e.RGB5_A1||t===e.RGB565||t===e.DEPTH_COMPONENT16||t===e.STENCIL_INDEX8||t===e.DEPTH_STENCIL}};return e}),r("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./PassState","./RenderbufferFormat"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){var r=new o(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new e},this._context=t,this._fb=void 0,this._passState=r,this._width=0,this._height=0};s.prototype.begin=function(t){var r=this._context,n=r.drawingBufferWidth,o=r.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),i(this._fb)&&this._width===n&&this._height===o||(this._width=n,this._height=o,this._fb=this._fb&&this._fb.destroy(),this._fb=r.createFramebuffer({colorTextures:[r.createTexture2D({width:n,height:o})],depthRenderbuffer:r.createRenderbuffer({format:a.DEPTH_COMPONENT16})}),this._passState.framebuffer=this._fb),this._passState};var l=new t;return s.prototype.end=function(e){for(var n=r(e.width,1),o=r(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.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,f=0,p=0,v=-1,g=0;c>g;++g){if(m>=-h&&h>=m&&f>=-d&&d>=f){var _=4*((d-f)*n+m+h);l.red=t.byteToFloat(s[_]),l.green=t.byteToFloat(s[_+1]),l.blue=t.byteToFloat(s[_+2]),l.alpha=t.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(l);if(i(y))return y}if(m===f||0>m&&-m===f||m>0&&m===1-f){var w=p;p=-v,v=w}m+=p,f+=v}return void 0},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},s}),r("Renderer/Renderbuffer",["../Core/defineProperties","../Core/destroyObject"],function(e,t){"use strict";function r(e,t,r,i){this._gl=e,this._format=t,this._width=r,this._height=i,this._renderbuffer=this._gl.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this._renderbuffer),e.renderbufferStorage(e.RENDERBUFFER,t,r,i),e.bindRenderbuffer(e.RENDERBUFFER,null)}return e(r.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),r.prototype._getRenderbuffer=function(){return this._renderbuffer},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),t(this)},r}),r("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/FeatureDetection","../Core/RuntimeError","../Core/WindingOrder"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return e===WebGLRenderingContext.FUNC_ADD||e===WebGLRenderingContext.FUNC_SUBTRACT||e===WebGLRenderingContext.FUNC_REVERSE_SUBTRACT}function u(e){return e===WebGLRenderingContext.ZERO||e===WebGLRenderingContext.ONE||e===WebGLRenderingContext.SRC_COLOR||e===WebGLRenderingContext.ONE_MINUS_SRC_COLOR||e===WebGLRenderingContext.DST_COLOR||e===WebGLRenderingContext.ONE_MINUS_DST_COLOR||e===WebGLRenderingContext.SRC_ALPHA||e===WebGLRenderingContext.ONE_MINUS_SRC_ALPHA||e===WebGLRenderingContext.DST_ALPHA||e===WebGLRenderingContext.ONE_MINUS_DST_ALPHA||e===WebGLRenderingContext.CONSTANT_COLOR||e===WebGLRenderingContext.ONE_MINUS_CONSTANT_COLOR||e===WebGLRenderingContext.CONSTANT_ALPHA||e===WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA||e===WebGLRenderingContext.SRC_ALPHA_SATURATE}function c(e){return e===WebGLRenderingContext.FRONT||e===WebGLRenderingContext.BACK||e===WebGLRenderingContext.FRONT_AND_BACK}function h(e){return e===WebGLRenderingContext.NEVER||e===WebGLRenderingContext.LESS||e===WebGLRenderingContext.EQUAL||e===WebGLRenderingContext.LEQUAL||e===WebGLRenderingContext.GREATER||e===WebGLRenderingContext.NOTEQUAL||e===WebGLRenderingContext.GEQUAL||e===WebGLRenderingContext.ALWAYS}function d(e){return e===WebGLRenderingContext.NEVER||e===WebGLRenderingContext.LESS||e===WebGLRenderingContext.EQUAL||e===WebGLRenderingContext.LEQUAL||e===WebGLRenderingContext.GREATER||e===WebGLRenderingContext.NOTEQUAL||e===WebGLRenderingContext.GEQUAL||e===WebGLRenderingContext.ALWAYS}function m(e){return e===WebGLRenderingContext.ZERO||e===WebGLRenderingContext.KEEP||e===WebGLRenderingContext.REPLACE||e===WebGLRenderingContext.INCR||e===WebGLRenderingContext.DECR||e===WebGLRenderingContext.INVERT||e===WebGLRenderingContext.INCREMENT_WRAP||e===WebGLRenderingContext.DECR_WRAP}function f(e,t,r){r?e.enable(t):e.disable(t)}function p(e,t){e.frontFace(t.frontFace)}function v(e,t){var r=t.cull,i=r.enabled;f(e,e.CULL_FACE,i),i&&e.cullFace(r.face)}function g(e,t){e.lineWidth(t.lineWidth)}function _(e,t){var r=t.polygonOffset,i=r.enabled;f(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(r.factor,r.units)}function y(e,t,r){var n=t.scissorTest,o=i(r.scissorTest)?r.scissorTest.enabled:n.enabled;if(f(e,e.SCISSOR_TEST,o),o){var a=i(r.scissorTest)?r.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function w(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function C(e,t){var r=t.depthTest,i=r.enabled;f(e,e.DEPTH_TEST,i),i&&e.depthFunc(r.func)}function b(e,t){var r=t.colorMask;e.colorMask(r.red,r.green,r.blue,r.alpha)}function S(e,t){e.depthMask(t.depthMask)}function x(e,t){e.stencilMask(t.stencilMask)}function E(e,t,r){var n=t.blending,o=i(r.blendingEnabled)?r.blendingEnabled:n.enabled;f(e,e.BLEND,o),o&&(M(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function T(e,t){var r=t.stencilTest,i=r.enabled;if(f(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,m=d.fail,p=d.zFail,v=d.zPass;e.stencilOpSeparate(e.BACK,m,p,v)}}function P(e,t,r){var n=t.viewport;i(n)||(n=O,n.width=r.context.drawingBufferWidth,n.height=r.context.drawingBufferHeight),r.context.uniformState.viewport=n,e.viewport(n.x,n.y,n.width,n.height)}function A(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(v),e.lineWidth!==t.lineWidth&&r.push(g),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&r.push(_),r.push(y),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&r.push(w),(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(b),e.depthMask!==t.depthMask&&r.push(S),r.push(E),e.stencilMask!==t.stencilMask&&r.push(x),(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(T),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&r.push(I),r.push(P),r }var M,D=function(o,f){var p=r(f,{}),v=r(p.cull,{}),g=r(p.polygonOffset,{}),_=r(p.scissorTest,{}),y=r(_.rectangle,{}),w=r(p.depthRange,{}),C=r(p.depthTest,{}),b=r(p.colorMask,{}),S=r(p.blending,{}),x=r(S.color,{}),E=r(p.stencilTest,{}),T=r(E.frontOperation,{}),P=r(E.backOperation,{}),A=r(p.sampleCoverage,{}),M=p.viewport;if(this.frontFace=r(p.frontFace,s.COUNTER_CLOCKWISE),this.cull={enabled:r(v.enabled,!1),face:r(v.face,WebGLRenderingContext.BACK)},this.lineWidth=r(p.lineWidth,1),this.polygonOffset={enabled:r(g.enabled,!1),factor:r(g.factor,0),units:r(g.units,0)},this.scissorTest={enabled:r(_.enabled,!1),rectangle:e.clone(y)},this.depthRange={near:r(w.near,0),far:r(w.far,1)},this.depthTest={enabled:r(C.enabled,!1),func:r(C.func,WebGLRenderingContext.LESS)},this.colorMask={red:r(b.red,!0),green:r(b.green,!0),blue:r(b.blue,!0),alpha:r(b.alpha,!0)},this.depthMask=r(p.depthMask,!0),this.stencilMask=r(p.stencilMask,-1),this.blending={enabled:r(S.enabled,!1),color:new t(r(x.red,0),r(x.green,0),r(x.blue,0),r(x.alpha,0)),equationRgb:r(S.equationRgb,WebGLRenderingContext.FUNC_ADD),equationAlpha:r(S.equationAlpha,WebGLRenderingContext.FUNC_ADD),functionSourceRgb:r(S.functionSourceRgb,WebGLRenderingContext.ONE),functionSourceAlpha:r(S.functionSourceAlpha,WebGLRenderingContext.ONE),functionDestinationRgb:r(S.functionDestinationRgb,WebGLRenderingContext.ZERO),functionDestinationAlpha:r(S.functionDestinationAlpha,WebGLRenderingContext.ZERO)},this.stencilTest={enabled:r(E.enabled,!1),frontFunction:r(E.frontFunction,WebGLRenderingContext.ALWAYS),backFunction:r(E.backFunction,WebGLRenderingContext.ALWAYS),reference:r(E.reference,0),mask:r(E.mask,-1),frontOperation:{fail:r(T.fail,WebGLRenderingContext.KEEP),zFail:r(T.zFail,WebGLRenderingContext.KEEP),zPass:r(T.zPass,WebGLRenderingContext.KEEP)},backOperation:{fail:r(P.fail,WebGLRenderingContext.KEEP),zFail:r(P.zFail,WebGLRenderingContext.KEEP),zPass:r(P.zPass,WebGLRenderingContext.KEEP)}},this.sampleCoverage={enabled:r(A.enabled,!1),value:r(A.value,1),invert:r(A.invert,!1)},this.viewport=i(M)?new e(M.x,M.y,i(M.width)?M.width:o.drawingBufferWidth,i(M.height)?M.height:o.drawingBufferHeight):void 0,this.lineWidtho.maximumAliasedLineWidth)throw new a("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!s.validate(this.frontFace))throw new n("Invalid renderState.frontFace.");if(!c(this.cull.face))throw new n("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new n("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 n("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new n("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new n("renderState.depthRange.far must be less than or equal to one.");if(!h(this.depthTest.func))throw new n("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 n("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!l(this.blending.equationRgb))throw new n("Invalid renderState.blending.equationRgb.");if(!l(this.blending.equationAlpha))throw new n("Invalid renderState.blending.equationAlpha.");if(!u(this.blending.functionSourceRgb))throw new n("Invalid renderState.blending.functionSourceRgb.");if(!u(this.blending.functionSourceAlpha))throw new n("Invalid renderState.blending.functionSourceAlpha.");if(!u(this.blending.functionDestinationRgb))throw new n("Invalid renderState.blending.functionDestinationRgb.");if(!u(this.blending.functionDestinationAlpha))throw new n("Invalid renderState.blending.functionDestinationAlpha.");if(!d(this.stencilTest.frontFunction))throw new n("Invalid renderState.stencilTest.frontFunction.");if(!d(this.stencilTest.backFunction))throw new n("Invalid renderState.stencilTest.backFunction.");if(!m(this.stencilTest.frontOperation.fail))throw new n("Invalid renderState.stencilTest.frontOperation.fail.");if(!m(this.stencilTest.frontOperation.zFail))throw new n("Invalid renderState.stencilTest.frontOperation.zFail.");if(!m(this.stencilTest.frontOperation.zPass))throw new n("Invalid renderState.stencilTest.frontOperation.zPass.");if(!m(this.stencilTest.backOperation.fail))throw new n("Invalid renderState.stencilTest.backOperation.fail.");if(!m(this.stencilTest.backOperation.zFail))throw new n("Invalid renderState.stencilTest.backOperation.zFail.");if(!m(this.stencilTest.backOperation.zPass))throw new n("Invalid renderState.stencilTest.backOperation.zPass.");if(i(this.viewport)){if(this.viewport.width<0)throw new n("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new n("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>o.maximumViewportWidth)throw new a("renderState.viewport.width must be less than or equal to the maximum viewport width ("+this.maximumViewportWidth.toString()+"). Check maximumViewportWidth.");if(this.viewport.height>o.maximumViewportHeight)throw new a("renderState.viewport.height must be less than or equal to the maximum viewport height ("+this.maximumViewportHeight.toString()+"). Check maximumViewportHeight.")}this.id=0,this._applyFunctions=[]};M=o.isInternetExplorer()?function(){}:function(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)};var I;I=o.isInternetExplorer()?function(){}:function(e,t){var r=t.sampleCoverage,i=r.enabled;f(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(r.value,r.invert)};var O=new e;return D.apply=function(e,t,r){p(e,t),v(e,t),g(e,t),_(e,t),y(e,t,r),w(e,t),C(e,t),b(e,t),S(e,t),x(e,t),E(e,t,r),T(e,t),I(e,t),P(e,t,r)},D.partialApply=function(e,t,r,n){var o=r._applyFunctions[t.id];i(o)||(o=A(t,r),r._applyFunctions[t.id]=o);for(var a=o.length,s=0;a>s;++s)o[s](e,r,n)},D.clone=function(r){if(!i(r))throw new n("renderState is required.");return{frontFace:r.frontFace,cull:{enabled:r.cull.enabled,face:r.cull.face},lineWidth:r.lineWidth,polygonOffset:{enabled:r.polygonOffset.enabled,factor:r.polygonOffset.factor,units:r.polygonOffset.units},scissorTest:{enabled:r.scissorTest.enabled,rectangle:e.clone(r.scissorTest.rectangle)},depthRange:{near:r.depthRange.near,far:r.depthRange.far},depthTest:{enabled:r.depthTest.enabled,func:r.depthTest.func},colorMask:{red:r.colorMask.red,green:r.colorMask.green,blue:r.colorMask.blue,alpha:r.colorMask.alpha},depthMask:r.depthMask,stencilMask:r.stencilMask,blending:{enabled:r.blending.enabled,color:t.clone(r.blending.color),equationRgb:r.blending.equationRgb,equationAlpha:r.blending.equationAlpha,functionSourceRgb:r.blending.functionSourceRgb,functionSourceAlpha:r.blending.functionSourceAlpha,functionDestinationRgb:r.blending.functionDestinationRgb,functionDestinationAlpha:r.blending.functionDestinationAlpha},stencilTest:{enabled:r.stencilTest.enabled,frontFunction:r.stencilTest.frontFunction,backFunction:r.stencilTest.backFunction,reference:r.stencilTest.reference,mask:r.stencilTest.mask,frontOperation:{fail:r.stencilTest.frontOperation.fail,zFail:r.stencilTest.frontOperation.zFail,zPass:r.stencilTest.frontOperation.zPass},backOperation:{fail:r.stencilTest.backOperation.fail,zFail:r.stencilTest.backOperation.zFail,zPass:r.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:r.sampleCoverage.enabled,value:r.sampleCoverage.value,invert:r.sampleCoverage.invert},viewport:i(r.viewport)?e.clone(r.viewport):void 0}},D}),r("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),r("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\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/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\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/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat z;\nif (czm_sceneMode != czm_sceneMode2D)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= gl_FragCoord.w;\nz = (czm_inverseProjectionOIT * q).z;\n}\nelse\n{\nz = gl_FragCoord.z * (czm_currentFrustum.y - czm_currentFrustum.x) + czm_currentFrustum.x;\n}\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 100.0 / (1e-5 + pow(abs(z) / 10.0, 3.0) + pow(abs(z) / 200.0, 6.0))));\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 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * 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/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\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/depthRange","./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/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Functions/RGBToXYZ","./Functions/XYZToRGB","./Functions/alphaWeight","./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/translucentPhong","./Functions/transpose","./Functions/windowToEyeCoordinates"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I,O,R,L,N,B,F,z,V,q,k,U,W,G,H,j,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:r,czm_epsilon2:i,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:h,czm_pi:d,czm_piOverFour:m,czm_piOverSix:f,czm_piOverThree:p,czm_piOverTwo:v,czm_radiansPerDegree:g,czm_sceneMode2D:_,czm_sceneMode3D:y,czm_sceneModeColumbusView:w,czm_sceneModeMorphing:C,czm_solarRadius:b,czm_threePiOver2:S,czm_twoPi:x,czm_webMercatorMaxLatitude:E,czm_depthRangeStruct:T,czm_ellipsoid:P,czm_material:A,czm_materialInput:M,czm_ray:D,czm_raySegment:I,czm_RGBToXYZ:O,czm_XYZToRGB:R,czm_alphaWeight:L,czm_antialias:N,czm_columbusViewMorph:B,czm_computePosition:F,czm_eastNorthUpToEyeCoordinates:z,czm_ellipsoidContainsPoint:V,czm_ellipsoidNew:q,czm_ellipsoidWgs84TextureCoordinates:k,czm_equalsEpsilon:U,czm_eyeOffset:W,czm_eyeToWindowCoordinates:G,czm_geodeticSurfaceNormal:H,czm_getDefaultMaterial:j,czm_getLambertDiffuse:Y,czm_getSpecular:X,czm_getWaterNoise:Z,czm_getWgs84EllipsoidEC:J,czm_hue:Q,czm_isEmpty:K,czm_isFull:$,czm_latitudeToWebMercatorFraction:et,czm_luminance:tt,czm_modelToWindowCoordinates:rt,czm_multiplyWithColorBalance:it,czm_phong:nt,czm_pointAlongRay:ot,czm_rayEllipsoidIntersectionInterval:at,czm_saturation:st,czm_tangentToEyeSpaceMatrix:lt,czm_translateRelativeToEye:ut,czm_translucentPhong:ct,czm_transpose:ht,czm_windowToEyeCoordinates:dt} }),r("Renderer/ShaderProgram",["../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(t){var r=t._gl,n=t._location;switch(t._activeUniform.type){case r.FLOAT:return function(){r.uniform1f(n,t.value)};case r.FLOAT_VEC2:return function(){var e=t.value;r.uniform2f(n,e.x,e.y)};case r.FLOAT_VEC3:return function(){var e=t.value;r.uniform3f(n,e.x,e.y,e.z)};case r.FLOAT_VEC4:return function(){var o=t.value;if(e(o.red))r.uniform4f(n,o.red,o.green,o.blue,o.alpha);else{if(!e(o.x))throw new i('Invalid vec4 value for uniform "'+t._activeUniform.name+'".');r.uniform4f(n,o.x,o.y,o.z,o.w)}};case r.SAMPLER_2D:case r.SAMPLER_CUBE:return function(){r.activeTexture(r.TEXTURE0+t.textureUnitIndex),r.bindTexture(t.value._target,t.value._texture)};case r.INT:case r.BOOL:return function(){r.uniform1i(n,t.value)};case r.INT_VEC2:case r.BOOL_VEC2:return function(){var e=t.value;r.uniform2i(n,e.x,e.y)};case r.INT_VEC3:case r.BOOL_VEC3:return function(){var e=t.value;r.uniform3i(n,e.x,e.y,e.z)};case r.INT_VEC4:case r.BOOL_VEC4:return function(){var e=t.value;r.uniform4i(n,e.x,e.y,e.z,e.w)};case r.FLOAT_MAT2:return function(){r.uniformMatrix2fv(n,!1,o.toArray(t.value,E))};case r.FLOAT_MAT3:return function(){r.uniformMatrix3fv(n,!1,a.toArray(t.value,T))};case r.FLOAT_MAT4:return function(){r.uniformMatrix4fv(n,!1,s.toArray(t.value,P))};default:throw new l("Unrecognized uniform type: "+t._activeUniform.type+' for uniform "'+t._activeUniform.name+'".')}}function d(t){var r=t._gl,n=t._locations;switch(t._activeUniform.type){case r.FLOAT:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniform1f(n[o],e[o])};case r.FLOAT_VEC2:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform2f(n[o],a.x,a.y)}};case r.FLOAT_VEC3:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform3f(n[o],a.x,a.y,a.z)}};case r.FLOAT_VEC4:return function(){for(var o=t.value,a=o.length,s=0;a>s;++s){var l=o[s];if(e(l.red))r.uniform4f(n[s],l.red,l.green,l.blue,l.alpha);else{if(!e(l.x))throw new i("Invalid vec4 value.");r.uniform4f(n[s],l.x,l.y,l.z,l.w)}}};case r.SAMPLER_2D:case r.SAMPLER_CUBE:return function(){for(var e=t.value,i=e.length,n=0;i>n;++n){var o=e[n],a=t.textureUnitIndex+n;r.activeTexture(r.TEXTURE0+a),r.bindTexture(o._target,o._texture)}};case r.INT:case r.BOOL:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniform1i(n[o],e[o])};case r.INT_VEC2:case r.BOOL_VEC2:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform2i(n[o],a.x,a.y)}};case r.INT_VEC3:case r.BOOL_VEC3:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform3i(n[o],a.x,a.y,a.z)}};case r.INT_VEC4:case r.BOOL_VEC4:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform4i(n[o],a.x,a.y,a.z,a.w)}};case r.FLOAT_MAT2:return function(){for(var e=t.value,i=e.length,a=0;i>a;++a)r.uniformMatrix2fv(n[a],!1,o.toArray(e[a],E))};case r.FLOAT_MAT3:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniformMatrix3fv(n[o],!1,a.toArray(e[o],T))};case r.FLOAT_MAT4:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniformMatrix4fv(n[o],!1,s.toArray(e[o],P))};default:throw new l("Unrecognized uniform type: "+t._activeUniform.type)}}function m(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 f(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 v(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&&I._czmBuiltinsAndUniforms.hasOwnProperty(e)){var i=p(e,I._czmBuiltinsAndUniforms[e],r);t.dependsOn.push(i),i.requiredBy.push(t),v(i,r)}}))}}function g(e){for(var t=[],r=[];e.length>0;){var n=e.pop();r.push(n),0===n.requiredBy.length&&t.push(n)}for(;t.length>0;){var o=t.shift();e.push(o);for(var a=0;a=0;--n)i=i+t[n].glslSource+"\n";return i.replace(r.glslSource,"")}function y(){return"#ifdef GL_FRAGMENT_PRECISION_HIGH \n precision highp float; \n#else \n precision mediump float; \n#endif \n\n"}function w(t,r,i,n,o){var a,s=f(i),u=f(n),c=s.version+_(s.source)+"\n#line 0\n"+s.source,h=u.version+y()+_(u.source)+"\n#line 0\n"+u.source,d=t.createShader(t.VERTEX_SHADER);t.shaderSource(d,c),t.compileShader(d);var m=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(m,h),t.compileShader(m);var p=t.createProgram();if(t.attachShader(p,d),t.attachShader(p,m),t.deleteShader(d),t.deleteShader(m),e(o))for(var v in o)o.hasOwnProperty(v)&&t.bindAttribLocation(p,o[v],v);if(t.linkProgram(p),!t.getProgramParameter(p,t.LINK_STATUS)){if(!t.getShaderParameter(m,t.COMPILE_STATUS))throw a=t.getShaderInfoLog(m),t.deleteProgram(p),console.error("[GL] Fragment shader compile log: "+a),new l("Fragment shader failed to compile. Compile log: "+a);if(!t.getShaderParameter(d,t.COMPILE_STATUS))throw a=t.getShaderInfoLog(d),t.deleteProgram(p),console.error("[GL] Vertex shader compile log: "+a),new l("Vertex shader failed to compile. Compile log: "+a);throw a=t.getProgramInfoLog(p),t.deleteProgram(p),console.error("[GL] Shader program link log: "+a),new l("Program failed to link. Link log: "+a)}return r&&(a=t.getShaderInfoLog(d),e(a)&&a.length>0&&console.log("[GL] Vertex shader compile log: "+a)),r&&(a=t.getShaderInfoLog(m),e(a)&&a.length>0&&console.log("[GL] Fragment shader compile log: "+a)),r&&(a=t.getProgramInfoLog(p),e(a)&&a.length>0&&console.log("[GL] Shader program link log: "+a)),p}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 b(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);if(null!==c){var h=e.getUniform(t,c),d=new A(e,s,u,c,h);r[u]=d,i.push(d),d._setSampler&&n.push(d)}}else{var m,f,p,v,g=u.indexOf("[");if(g>=0){if(m=r[u.slice(0,g)],"undefined"==typeof m)continue;f=m._locations,f.length<=1&&(p=m.value,v=e.getUniformLocation(t,u),null!==v&&(f.push(v),p.push(e.getUniform(t,v))))}else{f=[],p=[];for(var _=0;_n;++n){var o=t+n;e.uniform1i(i[n],o)}return t+r})};t(M.prototype,{name:{get:function(){return this._uniformName}},datatype:{get:function(){return this._activeUniform.type}}});var D=0,I=function(e,t,r,i,n){this._gl=e,this._logShaderCompilation=t,this._attributeLocations=n,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=r,this._fragmentShaderSource=i,this.id=D++};t(I.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return x(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return x(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return x(this),this._uniformsByName}},manualUniforms:{get:function(){return x(this),this._manualUniforms}}}),I._czmBuiltinsAndUniforms={};for(var O in u)u.hasOwnProperty(O)&&(I._czmBuiltinsAndUniforms[O]=u[O]);for(var R in c)if(c.hasOwnProperty(R)){var L=c[R];"function"==typeof L.getDeclaration&&(I._czmBuiltinsAndUniforms[R]=L.getDeclaration(R))}return I.prototype._bind=function(){x(this),this._gl.useProgram(this._program)},I.prototype._setUniforms=function(e,t,r){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(t);for(n=a.length,o=0;n>o;++o)a[o]._set();if(r){var c=this._gl,h=this._program;if(c.validateProgram(h),!c.getProgramParameter(h,c.VALIDATE_STATUS))throw new i("Program validation failed. Link log: "+c.getProgramInfoLog(h))}},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){return this._cachedShader.cache.releaseShaderProgram(this),void 0},I.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),r(this)},I}),r("Renderer/ShaderCache",["../Core/defined","../Core/destroyObject","./ShaderProgram"],function(e,t,r){"use strict";var i=function(e){this._context=e,this._shaders={},this._shadersToRelease={}};return i.prototype.replaceShaderProgram=function(t,r,i,n){return e(t)&&t.destroy(),this.getShaderProgram(r,i,n)},i.prototype.getShaderProgram=function(e,t,i){var n,o=e+t+JSON.stringify(i);if(this._shaders[o])n=this._shaders[o],delete this._shadersToRelease[o];else{var a=this._context,s=new r(a._gl,a.logShaderCompilation,e,t,i);n={cache:this,shaderProgram:s,keyword:o,count:0},s._cachedShader=n,this._shaders[o]=n}return++n.count,n.shaderProgram},i.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.finalDestroy()}this._shadersToRelease={}},i.prototype.releaseShaderProgram=function(e){if(e){var t=e._cachedShader;t&&0===--t.count&&(this._shadersToRelease[t.keyword]=t)}},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){var e=this._shaders;for(var r in e)e.hasOwnProperty(r)&&e[r].shaderProgram.finalDestroy();return t(this)},i}),r("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../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,m){"use strict";function f(e,t){c.clone(t,e._view),c.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){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function v(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function g(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function _(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 y(e){if(e._viewportDirty){var t=e._viewport;c.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),c.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function w(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function C(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==m.SCENE2D&&e._mode!==m.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function b(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function S(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function x(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function E(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,c.inverse(e.modelView3D,e._inverseModelView3D))}function T(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,c.multiply(e._projection,e._view,e._viewProjection))}function P(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,c.inverse(e.viewProjection,e._inverseViewProjection))}function A(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,c.multiply(e._projection,e.modelView,e._modelViewProjection))}function M(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,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 D(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,c.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function I(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,c.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function O(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,c.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function R(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;c.getRotation(e.inverseModelView,t),u.transpose(t,t)}}function L(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function N(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,c.getRotation(e.inverseModelView,e._inverseNormal))}function B(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function F(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,q),s.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,i,n,a,s,u,h){var f=k;f.x=e.y,f.y=e.z,f.z=e.x;var p=U;p.x=i.y,p.y=i.z,p.z=i.x;var v=W;v.x=n.y,v.y=n.z,v.z=n.x;var g=G;g.x=t.y,g.y=t.z,g.z=t.x,s===m.SCENE2D&&(f.z=.5*a);var _=u.unproject(f,H);_.longitude=l.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=l.clamp(_.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,w=y.cartographicToCartesian(_,j),C=d.eastNorthUpToFixedFrame(w,y,Y);return c.multiplyByPointAsVector(C,p,p),c.multiplyByPointAsVector(C,v,v),c.multiplyByPointAsVector(C,g,g),o(h)||(h=new c),h[0]=p.x,h[1]=v.x,h[2]=-g.x,h[3]=0,h[4]=p.y,h[5]=v.y,h[6]=-g.y,h[7]=0,h[8]=p.z,h[9]=v.z,h[10]=-g.z,h[11]=0,h[12]=-r.dot(p,w),h[13]=-r.dot(v,w),h[14]=r.dot(g,w),h[15]=1,h}var V=function(){this._viewport=new e,this._viewportCartesian4=new i,this._viewportDirty=!1,this._viewportOrthographicMatrix=c.clone(c.IDENTITY),this._viewportTransformation=c.clone(c.IDENTITY),this._model=c.clone(c.IDENTITY),this._view=c.clone(c.IDENTITY),this._inverseView=c.clone(c.IDENTITY),this._projection=c.clone(c.IDENTITY),this._infiniteProjection=c.clone(c.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frameState=void 0,this._temeToPseudoFixed=u.clone(c.IDENTITY),this._view3DDirty=!0,this._view3D=new c,this._inverseView3DDirty=!0,this._inverseView3D=new c,this._inverseModelDirty=!0,this._inverseModel=new c,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new u,this._viewRotation=new u,this._inverseViewRotation=new u,this._viewRotation3D=new u,this._inverseViewRotation3D=new u,this._inverseProjectionDirty=!0,this._inverseProjection=new c,this._inverseProjectionOITDirty=!0,this._inverseProjectionOIT=new c,this._modelViewDirty=!0,this._modelView=new c,this._modelView3DDirty=!0,this._modelView3D=new c,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new c,this._inverseModelViewDirty=!0,this._inverseModelView=new c,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new c,this._viewProjectionDirty=!0,this._viewProjection=new c,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new c,this._modelViewProjectionDirty=!0,this._modelViewProjection=new c,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new c,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new c,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new c,this._normalDirty=!0,this._normal=new u,this._normal3DDirty=!0,this._normal3D=new u,this._inverseNormalDirty=!0,this._inverseNormal=new u,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new u,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new s,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,this._resolutionScale=1};a(V.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set: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}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return y(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return y(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){c.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}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,c.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTranposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,c.getRotation(this.inverseModel,e),u.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return this._view3DDirty&&(this._mode===m.SCENE3D?c.clone(this._view,this._view3D):z(this._cameraPosition,this._cameraDirection,this._cameraRight,this._cameraUp,this._frustum2DWidth,this._mode,this._mapProjection,this._view3D),c.getRotation(this._view3D,this._viewRotation3D),this._view3DDirty=!1),this._view3D}},viewRotation:{get:function(){return this._viewRotation}},viewRotation3D:{get:function(){return this.view3D,this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return this._inverseView3DDirty&&(c.inverseTransformation(this.view3D,this._inverseView3D),c.getRotation(this._inverseView3D,this._inverseViewRotation3D),this._inverseView3DDirty=!1),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return this.inverseView3D,this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return w(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return C(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return b(this),this._modelView}},modelView3D:{get:function(){return S(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return M(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return x(this),this._inverseModelView}},inverseModelView3D:{get:function(){return E(this),this._inverseModelView3D}},viewProjection:{get:function(){return T(this),this._viewProjection}},inverseViewProjection:{get:function(){return P(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return A(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return D(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return I(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return O(this),this._modelViewInfiniteProjection}},normal:{get:function(){return R(this),this._normal}},normal3D:{get:function(){return L(this),this._normal3D}},inverseNormal:{get:function(){return N(this),this._inverseNormal}},inverseNormal3D:{get:function(){return B(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return F(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return F(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}}}),new u,new n,V.prototype.updateFrustum=function(e){v(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&g(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far},V.prototype.update=function(e,t){this._mode=t.mode,this._mapProjection=t.mapProjection;var r=e._canvas;this._resolutionScale=r.width/r.clientWidth;var i=t.camera;f(this,i.viewMatrix),p(this,i.inverseViewMatrix),_(this,i),t.mode===m.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.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._entireFrustum.x=i.frustum.near,this._entireFrustum.y=i.frustum.far,this.updateFrustum(i.frustum),this._frameState=t,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(t.time,this._temeToPseudoFixed)};var q=new r,k=new r,U=new r,W=new r,G=new r,H=new n,j=new r,Y=new c;return V}),r("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(i,n,a){var s=r(n.vertexBuffer),l=r(n.value),u=n.value?n.value.length:n.componentsPerAttribute;if(!s&&!l)throw new o("attribute must have a vertexBuffer or a value.");if(s&&l)throw new o("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.");if(1!==u&&2!==u&&3!==u&&4!==u){if(l)throw new o("attribute.value.length must be in the range [1, 4].");throw new o("attribute.componentsPerAttribute must be in the range [1, 4].")}if(r(n.componentDatatype)&&!e.validate(n.componentDatatype))throw new o("attribute must have a valid componentDatatype or not specify it.");if(r(n.strideInBytes)&&n.strideInBytes>255)throw new o("attribute must have a strideInBytes less than or equal to 255 or not specify it.");var c={index:t(n.index,a),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0)};if(s)c.vertexAttrib=function(e){e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(this.index,this.componentsPerAttribute,this.componentDatatype,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(){}}i.push(c)}function s(e,t,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;if("number"==typeof r)n=r;else{if("object"!=typeof r||"number"!=typeof r.byteLength)throw new l("typedArrayOrSizeInBytes must be either a typed array or a number.");n=r.byteLength}if(0>=n)throw new l("typedArrayOrSizeInBytes must be greater than zero.");if(!y.validate(i))throw new l("usage is invalid.");var o=e.createBuffer();return e.bindBuffer(t,o),e.bufferData(t,r,i),e.bindBuffer(t,null),new _(e,t,n,i,o)}function G(e){if(e.validateFramebuffer){var t=e._gl,r=t.checkFramebufferStatus(t.FRAMEBUFFER); if(r!==t.FRAMEBUFFER_COMPLETE){var i;switch(r){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="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:i="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new l(i)}}}function H(e,t,r){var i=e._currentRenderState;i!==t&&(e._currentRenderState=t,M.partialApply(e._gl,i,t,r))}function j(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var r=it;if(o(t))t._bind(),G(e,t),r=t._getActiveColorAttachments();else{var i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e._drawBuffers.drawBuffersWEBGL(r)}}function Y(e,t,r,i,a,s){var u=n(n(a,r.renderState),e._defaultRenderState);if(o(t)&&u.depthTest&&u.depthTest.enabled&&!t.hasDepthAttachment)throw new l("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");j(e,t);var c=n(s,r.shaderProgram);c._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,c.maximumTextureUnitIndex),H(e,u,i)}function X(e,t,r){var i=t.primitiveType,a=t.vertexArray,s=t.offset,u=t.count;if(!p.validate(i))throw new l("drawCommand.primitiveType is required and must be valid.");if(!o(a))throw new l("drawCommand.vertexArray is required.");if(0>s)throw new l("drawCommand.offset must be omitted or greater than or equal to zero.");if(0>u)throw new l("drawCommand.count must be omitted or greater than or equal to zero.");e._us.model=n(t.modelMatrix,m.IDENTITY);var c=n(r,t.shaderProgram);c._setUniforms(t.uniformMap,e._us,e.validateShaderProgram);var h=a.indexBuffer;o(h)?(s*=h.bytesPerIndex,u=n(u,h.numberOfIndices),a._bind(),e._gl.drawElements(i,u,h.indexDatatype,s),a._unBind()):(u=n(u,a.numberOfVertices),a._bind(),e._gl.drawArrays(i,s,u),a._unBind())}function Z(e){return e.values.length/e.componentsPerAttribute}function J(e){return r.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function Q(e){var t,i,n,a=[];for(i in e)e.hasOwnProperty(i)&&o(e[i])&&o(e[i].values)&&(a.push(i),e[i].componentDatatype===r.DOUBLE&&(e[i].componentDatatype=r.FLOAT,e[i].values=r.createTypedArray(r.FLOAT,e[i].values)));var s,l=a.length;if(l>0)for(s=Z(e[a[0]]),t=1;l>t;++t){var u=Z(e[a[t]]);if(u!==s)throw new v("Each attribute list must have the same number of vertices. Attribute "+a[t]+" has a different number of vertices "+"("+u.toString()+")"+" than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(t,i){return r.getSizeInBytes(e[i].componentDatatype)-r.getSizeInBytes(e[t].componentDatatype)});var c=0,h={};for(t=0;l>t;++t)i=a[t],n=e[i],h[i]=c,c+=J(n);if(c>0){var d=r.getSizeInBytes(e[a[0]].componentDatatype),m=c%d;0!==m&&(c+=d-m);var f=s*c,p=new ArrayBuffer(f),g={};for(t=0;l>t;++t){i=a[t];var _=r.getSizeInBytes(e[i].componentDatatype);g[i]={pointer:r.createTypedArray(e[i].componentDatatype,p),index:h[i]/_,strideInComponentType:c/_}}for(t=0;s>t;++t)for(var y=0;l>y;++y){i=a[y],n=e[i];for(var w=n.values,C=g[i],b=C.pointer,S=n.componentsPerAttribute,x=0;S>x;++x)b[C.index+x]=w[t*S+x];C.index+=C.strideInComponentType}return{buffer:p,offsetsInBytes:h,vertexSizeInBytes:c}}return void 0}function K(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var $=function(r,a){if("undefined"==typeof WebGLRenderingContext)throw new v("The browser does not support WebGL. Visit http://get.webgl.org.");if(!o(r))throw new l("canvas is required.");this._canvas=r,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});if(s.alpha=n(s.alpha,!1),s.stencil=n(s.stencil,!1),s.failIfMajorPerformanceCaveat=n(s.failIfMajorPerformanceCaveat,!0),this._originalGLContext=r.getContext("webgl",s)||r.getContext("experimental-webgl",s)||void 0,!o(this._originalGLContext))throw new v("The browser supports WebGL, but initialization failed.");this._id=i(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new D(this);var u=this._gl=this._originalGLContext;this._version=u.getParameter(u.VERSION),this._shadingLanguageVersion=u.getParameter(u.SHADING_LANGUAGE_VERSION),this._vendor=u.getParameter(u.VENDOR),this._renderer=u.getParameter(u.RENDERER),this._redBits=u.getParameter(u.RED_BITS),this._greenBits=u.getParameter(u.GREEN_BITS),this._blueBits=u.getParameter(u.BLUE_BITS),this._alphaBits=u.getParameter(u.ALPHA_BITS),this._depthBits=u.getParameter(u.DEPTH_BITS),this._stencilBits=u.getParameter(u.STENCIL_BITS),this._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),this._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),this._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),this._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),this._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),this._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),this._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),this._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),this._aliasedLineWidthRange=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE),this._aliasedPointSizeRange=u.getParameter(u.ALIASED_POINT_SIZE_RANGE),this._maximumViewportDimensions=u.getParameter(u.MAX_VIEWPORT_DIMS),this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=U(u,["OES_standard_derivatives"]),this._elementIndexUint=U(u,["OES_element_index_uint"]),this._depthTexture=U(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=U(u,["OES_texture_float"]);var c=a.allowTextureFilterAnisotropic?U(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=c,this._maximumTextureFilterAnisotropy=o(c)?u.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,this._vertexArrayObject=U(u,["OES_vertex_array_object"]),this._fragDepth=U(u,["EXT_frag_depth"]),this._drawBuffers=U(u,["WEBGL_draw_buffers"]),this._maximumDrawBuffers=o(this._drawBuffers)?u.getParameter(this._drawBuffers.MAX_DRAW_BUFFERS_WEBGL):1,this._maximumColorAttachments=o(this._drawBuffers)?u.getParameter(this._drawBuffers.MAX_COLOR_ATTACHMENTS_WEBGL):1;var h=u.getParameter(u.COLOR_CLEAR_VALUE);this._clearColor=new t(h[0],h[1],h[2],h[3]),this._clearDepth=u.getParameter(u.DEPTH_CLEAR_VALUE),this._clearStencil=u.getParameter(u.STENCIL_CLEAR_VALUE);var d=new N,m=new x(this),f=this.createRenderState();this._defaultPassState=m,this._defaultRenderState=f,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=d,this._currentRenderState=f,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},M.apply(u,f,m)},et={};a($.prototype,{id:{get:function(){return this._id}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},uniformState:{get:function(){return this._us}},version:{get:function(){return this._version}},shadingLanguageVersion:{get:function(){return this._shadingLanguageVersion}},vendor:{get:function(){return this._vendor}},renderer:{get:function(){return this._renderer}},redBits:{get:function(){return this._redBits}},greenBits:{get:function(){return this._greenBits}},blueBits:{get:function(){return this._blueBits}},alphaBits:{get:function(){return this._alphaBits}},depthBits:{get:function(){return this._depthBits}},stencilBits:{get:function(){return this._stencilBits}},maximumCombinedTextureImageUnits:{get:function(){return this._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return this._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return this._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return this._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return this._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return this._maximumTextureSize}},maximumVaryingVectors:{get:function(){return this._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return this._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return this._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return this._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return this._aliasedLineWidthRange[0]}},maximumAliasedLineWidth:{get:function(){return this._aliasedLineWidthRange[1]}},minimumAliasedPointSize:{get:function(){return this._aliasedPointSizeRange[0]}},maximumAliasedPointSize:{get:function(){return this._aliasedPointSizeRange[1]}},maximumViewportWidth:{get:function(){return this._maximumViewportDimensions[0]}},maximumViewportHeight:{get:function(){return this._maximumViewportDimensions[1]}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return!!this._standardDerivatives}},elementIndexUint:{get:function(){return!!this._elementIndexUint}},depthTexture:{get:function(){return!!this._depthTexture}},floatingPointTexture:{get:function(){return!!this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},maximumTextureFilterAnisotropy:{get:function(){return this._maximumTextureFilterAnisotropy}},vertexArrayObject:{get:function(){return!!this._vertexArrayObject}},fragmentDepth:{get:function(){return!!this._fragDepth}},drawBuffers:{get:function(){return!!this._drawBuffers}},maximumDrawBuffers:{get:function(){return this._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return this._maximumColorAttachments}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=k(this._originalGLContext,e?V:null)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=this.createTexture2D({source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture}},defaultCubeMap:{get: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}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return et}}}),$.prototype.replaceShaderProgram=function(e,t,r,i){return this.shaderCache.replaceShaderProgram(e,t,r,i)},$.prototype.createShaderProgram=function(e,t,r){return this.shaderCache.getShaderProgram(e,t,r)},$.prototype.createVertexBuffer=function(e,t){return W(this._gl,this._gl.ARRAY_BUFFER,e,t)},$.prototype.createIndexBuffer=function(e,t,r){if(!h.validate(r))throw new l("Invalid indexDatatype.");if(r===h.UNSIGNED_INT&&!this.elementIndexUint)throw new l("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");var i=h.getSizeInBytes(r),n=this._gl,o=W(n,n.ELEMENT_ARRAY_BUFFER,e,t),s=o.sizeInBytes/i;return a(o,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return s}}}),o},$.prototype.createVertexArray=function(e,t){return new B(this._gl,this._vertexArrayObject,e,t)},$.prototype.createTexture2D=function(e){return new I(this,e)},$.prototype.createTexture2DFromFramebuffer=function(e,t,r,i,a,s){var u=this._gl;if(e=n(e,f.RGB),t=n(t,0),r=n(r,0),i=n(i,u.drawingBufferWidth),a=n(a,u.drawingBufferHeight),!f.validate(e))throw new l("Invalid pixelFormat.");if(f.isDepthFormat(e))throw new l("pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(0>t)throw new l("framebufferXOffset must be greater than or equal to zero.");if(0>r)throw new l("framebufferYOffset must be greater than or equal to zero.");if(t+i>u.drawingBufferWidth)throw new l("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(r+a>u.drawingBufferHeight)throw new l("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");var c=new I(this,{width:i,height:a,pixelFormat:e,source:{framebuffer:o(s)?s:this.defaultFramebuffer,xOffset:t,yOffset:r,width:i,height:a}});return c},$.prototype.createCubeMap=function(e){function t(e,t){t.arrayBufferView?v.texImage2D(e,0,h,c,c,0,h,d,t.arrayBufferView):v.texImage2D(e,0,h,h,d,t)}e=n(e,n.EMPTY_OBJECT);var r,i,a=e.source;if(o(a)){var s=[a.positiveX,a.negativeX,a.positiveY,a.negativeY,a.positiveZ,a.negativeZ];if(!(s[0]&&s[1]&&s[2]&&s[3]&&s[4]&&s[5]))throw new l("options.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces.");r=s[0].width,i=s[0].height;for(var u=1;6>u;++u)if(Number(s[u].width)!==r||Number(s[u].height)!==i)throw new l("Each face in options.source must have the same width and height.")}else r=e.width,i=e.height;var c=r,h=n(e.pixelFormat,f.RGBA),d=n(e.pixelDatatype,T.UNSIGNED_BYTE);if(!o(r)||!o(i))throw new l("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(r!==i)throw new l("Width must equal height.");if(0>=c)throw new l("Width and height must be greater than zero.");if(c>this._maximumCubeMapSize)throw new l("Width and height must be less than or equal to the maximum cube map size ("+this._maximumCubeMapSize+"). Check maximumCubeMapSize.");if(!f.validate(h))throw new l("Invalid options.pixelFormat.");if(f.isDepthFormat(h))throw new l("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!T.validate(d))throw new l("Invalid options.pixelDatatype.");if(d===T.FLOAT&&!this.floatingPointTexture)throw new l("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");var m=e.preMultiplyAlpha||h===f.RGB||h===f.LUMINANCE,p=n(e.flipY,!0),v=this._gl,g=v.TEXTURE_CUBE_MAP,_=v.createTexture();return v.activeTexture(v.TEXTURE0),v.bindTexture(g,_),o(a)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,p),t(v.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX),t(v.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX),t(v.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY),t(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY),t(v.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ),t(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,h,c,c,0,h,d,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,h,c,c,0,h,d,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,h,c,c,0,h,d,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,h,c,c,0,h,d,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,h,c,c,0,h,d,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,h,c,c,0,h,d,null)),v.bindTexture(g,null),new C(v,this._textureFilterAnisotropic,g,_,h,d,c,m,p)},$.prototype.createFramebuffer=function(e){return new S(this._gl,this._maximumColorAttachments,e)},$.prototype.createRenderbuffer=function(e){var t=this._gl;e=n(e,n.EMPTY_OBJECT);var r=n(e.format,A.RGBA4),i=o(e.width)?e.width:t.drawingBufferWidth,a=o(e.height)?e.height:t.drawingBufferHeight;if(!A.validate(r))throw new l("Invalid format.");if(0>=i)throw new l("Width must be greater than zero.");if(i>this.maximumRenderbufferSize)throw new l("Width must be less than or equal to the maximum renderbuffer size ("+this.maximumRenderbufferSize+"). Check maximumRenderbufferSize.");if(0>=a)throw new l("Height must be greater than zero.");if(a>this.maximumRenderbufferSize)throw new l("Height must be less than or equal to the maximum renderbuffer size ("+this.maximumRenderbufferSize+"). Check maximumRenderbufferSize.");return new P(t,r,i,a)};var tt=0,rt={};$.prototype.createRenderState=function(e){var t=JSON.stringify(e),r=rt[t];if(o(r))return r;var i=new M(this,e),n=JSON.stringify(i);return r=rt[n],o(r)||(i.id=tt++,r=i,rt[n]=r),rt[t]=r,r},$.prototype.createSampler=function(e){var t={wrapS:n(e.wrapS,L.CLAMP_TO_EDGE),wrapT:n(e.wrapT,L.CLAMP_TO_EDGE),minificationFilter:n(e.minificationFilter,R.LINEAR),magnificationFilter:n(e.magnificationFilter,O.LINEAR),maximumAnisotropy:o(e.maximumAnisotropy)?e.maximumAnisotropy:1};if(!L.validate(t.wrapS))throw new l("Invalid sampler.wrapS.");if(!L.validate(t.wrapT))throw new l("Invalid sampler.wrapT.");if(!R.validate(t.minificationFilter))throw new l("Invalid sampler.minificationFilter.");if(!O.validate(t.magnificationFilter))throw new l("Invalid sampler.magnificationFilter.");if(t.maximumAnisotropy<1)throw new l("sampler.maximumAnisotropy must be greater than or equal to one.");return t};var it;"undefined"!=typeof WebGLRenderingContext&&(it=[WebGLRenderingContext.BACK]);var nt=new w;$.prototype.clear=function(e,r){e=n(e,nt),r=n(r,this._defaultPassState);var i=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),i.clearColor(s.red,s.green,s.blue,s.alpha)),a|=i.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,i.clearDepth(l)),a|=i.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,i.clearStencil(u)),a|=i.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);H(this,c,r);var h=n(e.framebuffer,r.framebuffer);j(this,h),i.clear(a)},$.prototype.draw=function(e,t,r,i){if(!o(e))throw new l("drawCommand is required.");if(!o(e.shaderProgram))throw new l("drawCommand.shaderProgram is required.");t=n(t,this._defaultPassState);var a=n(e.framebuffer,t.framebuffer);Y(this,a,e,t,r,i),X(this,e,i)},$.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null),this.drawBuffers&&this._drawBuffers.drawBuffersWEBGL(it);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)},$.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;if(0>=n)throw new l("readState.width must be greater than zero.");if(0>=o)throw new l("readState.height must be greater than zero.");var s=new Uint8Array(4*n*o);return j(this,a),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s},$.prototype.createVertexArrayFromGeometry=function(e){e=n(e,n.EMPTY_OBJECT);var t,i,a,s=n(e.geometry,n.EMPTY_OBJECT),l=n(e.bufferUsage,y.DYNAMIC_DRAW),c=n(e.attributeLocations,n.EMPTY_OBJECT),m=n(e.interleave,!1),f=e.vertexArrayAttributes,p=o(f)?f:[],v=s.attributes;if(m){var g=Q(v);if(o(g)){a=this.createVertexBuffer(g.buffer,l);var _=g.offsetsInBytes,w=g.vertexSizeInBytes;for(t in v)v.hasOwnProperty(t)&&o(v[t])&&(i=v[t],o(i.values)?p.push({index:c[t],vertexBuffer:a,componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,offsetInBytes:_[t],strideInBytes:w}):p.push({index:c[t],value:i.value,componentDatatype:i.componentDatatype,normalize:i.normalize}))}}else for(t in v)if(v.hasOwnProperty(t)&&o(v[t])){i=v[t];var C=i.componentDatatype;C===r.DOUBLE&&(C=r.FLOAT),a=void 0,o(i.values)&&(a=this.createVertexBuffer(r.createTypedArray(C,i.values),l)),p.push({index:c[t],vertexBuffer:a,value:i.value,componentDatatype:C,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize})}var b,S=s.indices;return o(S)&&(b=u.computeNumberOfVertices(s)>d.SIXTY_FOUR_KILOBYTES&&this.elementIndexUint?this.createIndexBuffer(new Uint32Array(S),l,h.UNSIGNED_INT):this.createIndexBuffer(new Uint16Array(S),l,h.UNSIGNED_SHORT)),this.createVertexArray(p,b)};var ot={position:0,textureCoordinates:1};return $.prototype.createViewportQuadCommand=function(e,t){var i=this.cache.viewportQuad_vertexArray;if(!o(i)){var a=new u({attributes:{position:new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:p.TRIANGLES});i=this.createVertexArrayFromGeometry({geometry:a,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:y.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=i}return t=n(t,n.EMPTY_OBJECT),new b({vertexArray:i,primitiveType:p.TRIANGLES,renderState:t.renderState,shaderProgram:this.createShaderProgram(g,e,ot),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},$.prototype.createPickFramebuffer=function(){return new E(this)},$.prototype.getObjectByPickColor=function(e){if(!o(e))throw new l("pickColor is required.");return this._pickObjects[e.toRgba()]},a(K.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),K.prototype.destroy=function(){return delete this._pickObjects[this.key],void 0},$.prototype.createPickId=function(e){if(!o(e))throw new l("object is required.");++this._nextPickColor[0];var r=this._nextPickColor[0];if(0===r)throw new v("Out of unique Pick IDs.");return this._pickObjects[r]=e,new K(this._pickObjects,r,t.fromRgba(r))},$.prototype.isDestroyed=function(){return!1},$.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];o(r.destroy)&&r.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},$}),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(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",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++)p[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 f=e,this},this.chain=function(){return p=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.onStop=function(e){return w=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 w=m(u);for(t in n){var C=i[t]||0,b=n[t];b instanceof Array?r[t]=f(b,w):("string"==typeof b&&(b=C+parseFloat(b,10)),"number"==typeof b&&(r[t]=C+(b-C)*w))}if(null!==_&&_.call(r,w),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 S=o[t];o[t]=n[t],n[t]=S}i[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(r);for(var x=0,E=p.length;E>x;x++)p[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/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/getTimestamp","../ThirdParty/Tween"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._tweens=[]};return s.prototype.add=function(i){if(i=t(i,t.EMPTY_OBJECT),!r(i.duration))throw new n("duration is required.");if(i.duration>0){var o=t(i.delayDuration,0),s=t(i.easingFunction,a.Easing.Linear.None),l=e(i.startValue),u=new a.Tween(l);return u.onCancel=i.onCancel,u.to(i.stopValue,i.duration),u.delay(o),u.easing(s),"function"==typeof i.onUpdate&&u.onUpdate(function(){i.onUpdate(l)}),u.onComplete(t(i.onComplete,null)),u.start().stop(),this._tweens.push(u),{_tween:u}}"function"==typeof i.onComplete&&i.onComplete()},i(s.prototype,{all:{get:function(){return this._tweens}}}),s.prototype.addAlpha=function(e,i,o,s){if(!r(e))throw new n("material is required.");var l=[];for(var u in e.uniforms)e.uniforms.hasOwnProperty(u)&&r(e.uniforms[u])&&r(e.uniforms[u].alpha)&&l.push(u);if(0===l.length)throw new n("material has no properties with alpha components.");i=t(i,0),o=t(o,1),s=t(s,t.EMPTY_OBJECT);var c=t(s.duration,3e3),h=t(s.delayDuration,0),d=t(s.easingFunction,a.Easing.Linear.None),m={alpha:i},f=new a.Tween(m);return f.to({alpha:o},c),f.delay(h),f.easing(d),f.onUpdate(function(){for(var t=l.length,r=0;t>r;++r)e.uniforms[l[r]].alpha=m.alpha}),f.onComplete(t(s.onComplete,null)),f.start().stop(),this._tweens.push(f),{_tween:f}},s.prototype.addProperty=function(e,i,o,s,l){if(!r(e))throw new n("object is required.");if(!r(i))throw new n("property is required.");if(!r(e[i]))throw new n("object must have the specified property.");l=t(l,t.EMPTY_OBJECT);var u=t(l.duration,3e3),c=t(l.delayDuration,0),h=t(l.easingFunction,a.Easing.Linear.None),d={value:o},m=new a.Tween(d);return m.to({value:s},u),m.delay(c),m.easing(h),m.onUpdate(function(){e[i]=d.value}),m.onComplete(t(l.onComplete,null)),m.start().stop(),this._tweens.push(m),{_tween:m}},s.prototype.addOffsetIncrement=function(e,i){if(!r(e))throw new n("material is required.");if(!r(e.uniforms.offset))throw new n("material must have an offset property.");i=t(i,t.EMPTY_OBJECT);var o=t(i.duration,3e3),s=t(i.delayDuration,0),l=t(i.easingFunction,a.Easing.Linear.None),u={offset:e.uniforms.offset},c=new a.Tween(u);return c.to({offset:e.uniforms.offset+1},o),c.delay(s),c.easing(l),c.onUpdate(function(){e.uniforms.offset=u.offset}),c.repeat(1/0),c.start().stop(),this._tweens.push(c),{_tween:c}},s.prototype.remove=function(e){if(!r(e))return!1;var t=e._tween,i=this._tweens.indexOf(t);return-1!==i?("function"==typeof t.onCancel&&t.onCancel(),this._tweens.splice(i,1),!0):!1},s.prototype.removeAll=function(){for(var e=0;el;++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 r("options.missingImageUrl is required.");if(!t(a.pixelsToCheck))throw new r("options.pixelsToCheck is required.");this._pixelsToCheck=a.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var u=this;o(n(a.missingImageUrl),s,l)};return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new r("shouldDiscardImage must not be called before the discard policy is ready.");var n=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=n.length;u>l;++l)for(var c=n[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/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../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,r.throwInstantiationError()};return t(a.prototype,{ready:{get:r.throwInstantiationError},rectangle:{get:r.throwInstantiationError},tileWidth:{get:r.throwInstantiationError},tileHeight:{get:r.throwInstantiationError},maximumLevel:{get:r.throwInstantiationError},minimumLevel:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},tileDiscardPolicy:{get:r.throwInstantiationError},errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},proxy:{get:r.throwInstantiationError},hasAlphaChannel:{get:r.throwInstantiationError}}),a.prototype.getTileCredits=r.throwInstantiationError,a.prototype.requestImage=r.throwInstantiationError,a.loadImage=function(t,r){return e(t.tileDiscardPolicy)?o(r,n):o(r,i)},a}),r("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/jsonp","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v){"use strict";function g(e,t,r,n){var o;if(e._useTiles)o=e._url+"/tile/"+n+"/"+r+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,r,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 i(l)&&(o=l.getURL(o)),o}var _=function(n){function v(r){var n=r.tileInfo;if(C._useTiles&&i(n)){if(C._tileWidth=n.rows,C._tileHeight=n.cols,102100===n.spatialReference.wkid)C._tilingScheme=new m;else{if(4326!==r.tileInfo.spatialReference.wkid){var o="Tile spatial reference WKID "+r.tileInfo.spatialReference.wkid+" is not supported.";return w=h.handleError(w,C,C._errorEvent,o,void 0,void 0,void 0,y),void 0}C._tilingScheme=new l}if(C._maximumLevel=r.tileInfo.lods.length-1,i(r.fullExtent)){var a=C._tilingScheme.projection;if(i(r.fullExtent.spatialReference)&&i(r.fullExtent.spatialReference.wkid))if(102100===r.fullExtent.spatialReference.wkid)a=new d;else{if(4326!==r.fullExtent.spatialReference.wkid){var u="fullExtent.spatialReference WKID "+r.fullExtent.spatialReference.wkid+" is not supported.";return w=h.handleError(w,C,C._errorEvent,u,void 0,void 0,void 0,y),void 0}a=new s}var f=a.unproject(new e(r.fullExtent.xmin,r.fullExtent.ymin)),v=a.unproject(new e(r.fullExtent.xmax,r.fullExtent.ymax));C._rectangle=new c(f.longitude,f.latitude,v.longitude,v.latitude)}else C._rectangle=C._tilingScheme.rectangle;i(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new p({missingImageUrl:g(C,0,0,C._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),C._useTiles=!0}else C._tileWidth=256,C._tileHeight=256,C._tilingScheme=new l,C._rectangle=C._tilingScheme.rectangle,C._useTiles=!1;i(r.copyrightText)&&r.copyrightText.length>0&&(C._credit=new t(r.copyrightText)),C._ready=!0,h.handleSuccess(w)}function _(){var e="An error occurred while accessing "+C._url+".";w=h.handleError(w,C,C._errorEvent,e,void 0,void 0,void 0,y)}function y(){var e=u(C._url,{parameters:{f:"json"},proxy:C._proxy});f(e,v,_)}if(n=r(n,{}),!i(n.url))throw new o("options.url is required.");this._url=n.url,this._tileDiscardPolicy=n.tileDiscardPolicy,this._proxy=n.proxy,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._tilingScheme=void 0,this._credit=void 0,this._useTiles=r(n.usePreCachedTilesIfAvailable,!0),this._rectangle=void 0,this._errorEvent=new a,this._ready=!1;var w,C=this;y()};return n(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new o("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new o("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new o("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new o("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new o("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new o("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new o("tileDiscardPolicy must not be called before the imagery provider is ready.");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}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(){return void 0},_.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=g(this,e,t,r);return v.loadImage(this,i)},_}),r("Scene/BingMapsStyle",[],function(){"use strict";var e={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",ROAD:"Road",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};return e}),r("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/jsonp","../Core/Math","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v){"use strict";function g(e,t,r,i){var o=e._imageUrlTemplate,a=y.tileXYToQuadKey(t,r,i);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+r+i)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(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,h=a.coverageAreas.length;!l&&h>u;++u){var d=s[u];if(t>=d.zoomMin&&t<=d.zoomMax){var m=c.intersectWith(r,d.bbox,C);c.isEmpty(m)||(l=!0)}}l&&i.push(a.credit)}return i}var y=function b(o){function v(e){var i=e.resourceSets[0].resources[0];S._tileWidth=i.imageWidth,S._tileHeight=i.imageHeight,S._maximumLevel=i.zoomMax-1,S._imageUrlSubdomains=i.imageUrlSubdomains,S._imageUrlTemplate=i.imageUrl.replace("{culture}","");var o=S._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}S._imageUrlTemplate=S._imageUrlTemplate.replace(/^http:/,o),n(S._tileDiscardPolicy)||(S._tileDiscardPolicy=new p({missingImageUrl:g(S,0,0,S._maximumLevel),pixelsToCheck:[new t(0,0),new t(120,140),new t(130,160),new t(200,50),new t(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var s=S._attributionList=i.imageryProviders;s||(s=S._attributionList=[]);for(var l=0,d=s.length;d>l;++l){var m=s[l];m.credit=new r(m.attribution);for(var f=m.coverageAreas,v=0,_=m.coverageAreas.length;_>v;++v){var y=f[v],C=y.bbox;y.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}S._ready=!0,h.handleSuccess(w)}function _(){var e="An error occurred while accessing "+C+".";w=h.handleError(w,S,S._errorEvent,e,void 0,void 0,void 0,y)}function y(){var e=l(C,{callbackParameterName:"jsonp",proxy:S._proxy});m(e,v,_)}if(o=i(o,{}),!n(o.url))throw new a("options.url is required.");this._key=e.getKey(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=i(o.mapStyle,f.AERIAL),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new r("Bing Imagery",b._logoData,"http://www.bing.com"),this.defaultGamma=1,(this._mapStyle===f.AERIAL||this._mapStyle===f.AERIAL_WITH_LABELS)&&(this.defaultGamma=1.3),this._tilingScheme=new d({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 w,C=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,S=this;y()};o(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(){if(!this._ready)throw new a("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new a("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new a("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new a("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new a("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new a("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var w=new c;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.tileXYToRectangle(e,t,r,w);return _(this._attributionList,r,i)},y.prototype.requestImage=function(e,t,r){if(!this._ready)throw new a("requestImage must not be called before the imagery provider is ready.");var i=g(this,e,t,r);return v.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<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/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){if(!(n(e.right)&&n(e.left)&&n(e.top)&&n(e.bottom)&&n(e.near)&&n(e.far)))throw new a("right, left, top, bottom, near, or far parameters are not set.");var t=e.top,r=e.bottom,i=e.right,o=e.left,l=e.near,u=e.far;if(t!==e._top||r!==e._bottom||o!==e._left||i!==e._right||l!==e._near||u!==e._far){if(e.near<=0||e.near>e.far)throw new a("near must be greater than zero and less than far.");e._left=o,e._right=i,e._top=t,e._bottom=r,e._near=l,e._far=u,e._perspectiveMatrix=s.computePerspectiveOffCenter(o,i,r,t,l,u,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(o,i,r,t,l,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};o(c.prototype,{projectionMatrix:{get:function(){return u(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return u(this),this._infinitePerspective}}});var h=new t,d=new t,m=new t,f=new t;return c.prototype.computeCullingVolume=function(e,i,o){if(!n(e))throw new a("position is required.");if(!n(i))throw new a("direction is required.");if(!n(o))throw new a("up is required.");var s=this._cullingVolume.planes,l=this.top,u=this.bottom,c=this.right,p=this.left,v=this.near,g=this.far,_=t.cross(i,o,h),y=d;t.multiplyByScalar(i,v,y),t.add(e,y,y);var w=m;t.multiplyByScalar(i,g,w),t.add(e,w,w);var C=f;t.multiplyByScalar(_,p,C),t.add(y,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,o,C);var b=s[0];return n(b)||(b=s[0]=new r),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-t.dot(C,e),t.multiplyByScalar(_,c,C),t.add(y,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(o,C,C),b=s[1],n(b)||(b=s[1]=new r),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-t.dot(C,e),t.multiplyByScalar(o,u,C),t.add(y,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(_,C,C),b=s[2],n(b)||(b=s[2]=new r),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-t.dot(C,e),t.multiplyByScalar(o,l,C),t.add(y,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,_,C),b=s[3],n(b)||(b=s[3]=new r),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-t.dot(C,e),b=s[4],n(b)||(b=s[4]=new r),b.x=i.x,b.y=i.y,b.z=i.z,b.w=-t.dot(i,y),t.negate(i,C),b=s[5],n(b)||(b=s[5]=new r),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-t.dot(C,w),this._cullingVolume},c.prototype.getPixelSize=function(t,r,o){if(u(this),!n(t))throw new a("drawingBufferDimensions is required.");var s=t.x,l=t.y;if(0>=s)throw new a("drawingBufferDimensions.x must be greater than zero.");if(0>=l)throw new a("drawingBufferDimensions.y must be greater than zero.");r=i(r,this.near);var c=1/this.near,h=this.top*c,d=2*r*h/l;h=this.right*c;var m=2*r*h/s;return n(o)?(o.x=m,o.y=d,o):new e(m,d)},c.prototype.clone=function(e){return n(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 n(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","./PerspectiveOffCenterFrustum"],function(e,t,r,i){"use strict";function n(t){if(!(e(t.fovy)&&e(t.aspectRatio)&&e(t.near)&&e(t.far)))throw new r("fovy, aspectRatio, near, or far parameters are not set.");var i=t._offCenterFrustum;if(t.fovy!==t._fovy||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){if(t.fovy<0||t.fovy>=Math.PI)throw new r("fovy must be in the range [0, PI).");if(t.aspectRatio<0)throw new r("aspectRatio must be positive.");if(t.near<0||t.near>t.far)throw new r("near must be greater than zero and less than far.");t._fovy=t.fovy,t._aspectRatio=t.aspectRatio,t._near=t.near,t._far=t.far,i.top=t.near*Math.tan(.5*t.fovy),i.bottom=-i.top,i.right=t.aspectRatio*i.top,i.left=-i.right,i.near=t.near,i.far=t.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/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/clone","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/HermiteSpline","../Core/LinearSpline","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../ThirdParty/Tween","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g){"use strict";function _(e,r,i){return t.cross(e,r,I),t.cross(I,e,O),D[0]=I.x,D[1]=O.x,D[2]=-e.x,D[3]=I.y,D[4]=O.y,D[5]=-e.y,D[6]=I.z,D[7]=O.z,D[8]=-e.z,d.fromRotationMatrix(D,i)}function y(e,t,r){var i,n,o;if(e instanceof p){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 v?(i=e.near,n=e.top,o=e.right,Math.max(t*i/o,r*i/n)):Math.max(t,r)}function w(e,r,i,n,o,a,l){var h,m,f,p=r.maximumRadius,v=e.frustum,g=y(v,p,p),_=t.dot(t.normalize(i,R),t.normalize(a,L));if(t.magnitude(i)>g)m=p+.6*(g-p),f=.35;else{var w=t.subtract(i,a,R);m=t.magnitude(t.add(t.multiplyByScalar(w,.5,L),a,L));var C=t.magnitude(t.multiplyByScalar(n,t.dot(w,n),L)),b=t.magnitude(t.multiplyByScalar(o,t.dot(w,o),L));m+=y(v,C,b),f=u.clamp(_+1,.25,.5)}var S,x,E,T=t.multiplyByScalar(t.normalize(a,L),m,L),P=t.multiplyByScalar(t.normalize(i,R),m,R),A=new t;if(t.magnitude(a)>g&&_>.75)A=t.add(t.multiplyByScalar(t.subtract(i,a,A),.5,A),a,A),h=[i,A,a];else if(t.magnitude(i)>g&&_>0)A=t.add(t.multiplyByScalar(t.subtract(i,T,A),.5,A),T,A),h=[i,A,a];else{h=[i],x=u.acosClamped(t.dot(t.normalize(P,N),t.normalize(T,B))),S=t.cross(T,P,N),t.equalsEpsilon(S,t.ZERO,u.EPSILON6)&&(S=t.UNIT_Z);for(var M=f*x,D=x-M,I=D;I>0;I-=M)E=c.fromQuaternion(d.fromAxisAngle(S,I)),h.push(c.multiplyByVector(E,T));h.push(a)}for(var O=new Array(h.length),F=l/(h.length-1),z=0;zh;++h)u=s[h],t.normalize(t.negate(u,F),F),t.normalize(t.cross(F,t.UNIT_Z,z),z),t.cross(z,F,V),l[h]=_(F,V,q);return u=s[c],o(n)&&o(a)?l[c]=_(n,a):(t.normalize(t.negate(u,F),F),t.normalize(t.cross(F,t.UNIT_Z,z),z),t.cross(z,F,V),l[c]=_(F,V,q)),new m({points:l,times:e.times})}function b(e,r,i,n,o){var a=e.camera,s=e.mapProjection.ellipsoid,l=a.cameraToWorldCoordinatesPoint(a.position,k),u=a.cameraToWorldCoordinatesVector(a.direction,U),d=a.cameraToWorldCoordinatesVector(a.up,W),m=t.cross(u,d,G),f=w(a,s,l,d,m,r,i),p=C(f,u,d,n,o),v=function(e){var r=e.time,i=p.evaluate(r);c.fromQuaternion(i,M),h.clone(a.transform,H),h.clone(h.IDENTITY,a.transform),a.position=f.evaluate(r,a.position),a.right=c.getRow(M,0,a.right),a.up=c.getRow(M,1,a.up),a.direction=t.negate(c.getRow(M,2,a.direction),a.direction),a.setTransform(H)};return v}function S(r,i,n,o,a){if(u.equalsEpsilon(e.magnitude(n),e.magnitude(o),1e4))return new l({points:[n,o],times:[0,a]});var c,h,d=i.maximumRadius,m=r.frustum,f=y(m,Math.PI*d,u.PI_OVER_TWO*d),p=.5;if(n.z>f)h=.6*f;else{var v=t.subtract(n,o,j);h=y(m,Math.abs(v.y),Math.abs(v.x))}var g=t.clone(o);g.z=h;var _=t.clone(n);_.z=h;var w=new t;if(o.z>f)w=t.add(t.multiplyByScalar(t.subtract(n,o,w),.5,w),o,w),c=[n,w,o];else if(n.z>f)w=t.add(t.multiplyByScalar(t.subtract(n,g,w),.5,w),g,w),c=[n,w,o];else{c=[n];var C=t.subtract(_,g,j),b=t.magnitude(C);t.normalize(C,C);for(var S=p*b,x=b-S,E=x;E>0;E-=S){var T=new t;c.push(t.add(t.multiplyByScalar(C,E,T),g,T))}c.push(o)}for(var P=new Array(c.length),A=a/(c.length-1),M=0;Ml;++l)a[l]=J;return a[s]=o(r)&&o(i)?_(r,i):J,new m({points:a,times:t.times})}function E(e,r,i,n,o){var a=e.camera,s=e.mapProjection.ellipsoid,l=S(a,s,t.clone(a.position),r,i),u=x(a,l,n,o),d=function(e){var r=e.time,i=u.evaluate(r);c.fromQuaternion(i,M),h.clone(a.transform,H),h.clone(h.IDENTITY,a.transform),a.position=l.evaluate(r,a.position),a.right=c.getRow(M,0,a.right),a.up=c.getRow(M,1,a.up),a.direction=t.negate(c.getRow(M,2,a.direction),a.direction),a.setTransform(H)};return d}function T(e,r,i,n,o){var a=e.camera,s=e.mapProjection.ellipsoid,l=t.clone(a.position);l.z=a.frustum.right-a.frustum.left;var u=S(a,s,l,r,i),h=x(a,u,t.negate(t.UNIT_Z,new t),o),d=a.position.z,m=function(e){var r=e.time,i=h.evaluate(r);c.fromQuaternion(i,M),a.position=u.evaluate(r);var n=a.position.z;a.position.z=d,a.right=c.getRow(M,0,a.right),a.up=c.getRow(M,1,a.up),a.direction=t.negate(c.getRow(M,2,a.direction),a.direction);var o=a.frustum,s=o.top/o.right,l=.5*(n-(o.right-o.left));o.right+=l,o.left-=l,o.top=s*o.right,o.bottom=-o.top};return m}var P={},A=new t,M=new c,D=new c,I=new t,O=new t,R=new t,L=new t,N=new t,B=new t,F=new t,z=new t,V=new t,q=new d,k=new t,U=new t,W=new t,G=new t,H=new h,j=new t,Y=t.negate(t.UNIT_Z,new t),X=new t;X=t.normalize(t.cross(Y,t.UNIT_Y,X),X);var Z=t.cross(X,Y,new t),J=_(Y,Z),Q=new t,K=new t,$=new t,et=new r,tt=new t;return P.createAnimation=function(r,i){i=n(i,n.EMPTY_OBJECT);var s=i.destination,l=i.direction,c=i.up;if(!o(r))throw new a("scene is required.");if(!o(s))throw new a("destination is required.");if(o(l)&&!o(c)||o(c)&&!o(l))throw new a("If either direction or up is given, then both are required.");if(r.frameState.mode===g.MORPHING)return{duration:0};var h=n(i.convert,!0),d=r.frameState;if(h&&d.mode!==g.SCENE3D){var m=d.mapProjection,p=m.ellipsoid;p.cartesianToCartographic(s,et),s=m.project(et,tt)}var v=n(i.duration,3e3),_=r.screenSpaceCameraController;_.enableInputs=!1;var y=function(e){var t=function(){"function"==typeof e&&e(),_.enableInputs=!0};return t},w=y(i.onComplete),C=y(i.onCancel),S=i.endTransform;o(S)&&r.camera.setTransform(S);var x=d.camera.frustum;if(d.mode===g.SCENE2D){if(e.equalsEpsilon(d.camera.position,s,u.EPSILON6)&&u.equalsEpsilon(Math.max(x.right-x.left,x.top-x.bottom),s.z,u.EPSILON6))return{duration:0,onComplete:w,onCancel:C}}else if(t.equalsEpsilon(s,d.camera.position,u.EPSILON6))return{duration:0,onComplete:w,onCancel:C};if(0>=v){var P=function(){var e=s;if(d.mode===g.SCENE3D?(o(i.direction)||o(i.up)?(Q=i.direction,K=t.normalize(t.cross(Q,i.up,K),K)):(Q=t.normalize(t.negate(e,Q),Q),K=t.normalize(t.cross(Q,t.UNIT_Z,K),K)),$=n(i.up,t.cross(K,Q,$))):(o(i.direction)||o(i.up)?(Q=i.direction,K=t.normalize(t.cross(Q,i.up,K),K)):(Q=t.negate(t.UNIT_Z,Q),K=t.normalize(t.cross(Q,t.UNIT_Y,K),K)),$=n(i.up,t.cross(K,Q,$))),t.clone(e,d.camera.position),t.clone(Q,d.camera.direction),t.clone($,d.camera.up),t.clone(K,d.camera.right),d.mode===g.SCENE2D){var r=d.camera.position.z,a=x.top/x.right,l=.5*(r-(x.right-x.left));x.right+=l,x.left-=l,x.top=a*x.right,x.bottom=-x.top}"function"==typeof w&&w()};return{duration:0,onComplete:P,onCancel:C}}var A;return A=d.mode===g.SCENE3D?b(d,s,v,l,c):d.mode===g.SCENE2D?T(d,s,v,l,c):E(d,s,v,l,c),{duration:v,easingFunction:f.Easing.Sinusoidal.InOut,startValue:{time:0},stopValue:{time:v},onUpdate:A,onComplete:w,onCancel:C}},P.createAnimationRectangle=function(e,t){t=n(t,n.EMPTY_OBJECT);var r=t.destination;if(!o(e))throw new a("scene is required.");if(!o(r))throw new a("options.destination is required.");var s=e.frameState,l=i(t),u=s.camera;return u.getRectangleCameraCoordinates(r,A),l.destination=A,l.convert=!1,this.createAnimation(e,l)},P}),r("Scene/Camera",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Transforms","../ThirdParty/Tween","./CameraFlightPath","./PerspectiveFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";function w(e){var r=e._right,i=e._up,n=e._direction,o=e._position,a=e._viewMatrix;a[0]=r.x,a[1]=i.x,a[2]=-n.x,a[3]=0,a[4]=r.y,a[5]=i.y,a[6]=-n.y,a[7]=0,a[8]=r.z,a[9]=i.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(r,o),a[13]=-t.dot(i,o),a[14]=t.dot(n,o),a[15]=1,d.multiply(a,e._actualInvTransform,e._viewMatrix),d.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function C(e){var i=e._projection,n=i.ellipsoid,o=d.getColumn(e._transform,3,tt),a=n.cartesianToCartographic(o,K),s=i.project(a,$),l=rt;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.add(d.getColumn(e._transform,0,et),o,et);n.cartesianToCartographic(u,a),i.project(a,s);var c=it;c.x=s.z,c.y=s.x,c.z=s.y,c.w=0,t.subtract(c,l,c);var h=r.add(d.getColumn(e._transform,1,et),o,et);n.cartesianToCartographic(h,a),i.project(a,s);var m=nt;m.x=s.z,m.y=s.x,m.z=s.y,m.w=0,t.subtract(m,l,m);var f=ot;t.cross(c,m,f),t.normalize(f,f),t.cross(m,f,c),t.normalize(c,c),t.cross(f,c,m),t.normalize(m,m),d.setColumn(e._actualTransform,0,c,e._actualTransform),d.setColumn(e._actualTransform,1,m,e._actualTransform),d.setColumn(e._actualTransform,2,f,e._actualTransform),d.setColumn(e._actualTransform,3,l,e._actualTransform)}function b(e){var i=e._projection,n=i.ellipsoid,o=d.getColumn(e._transform,3,tt),a=n.cartesianToCartographic(o,K),s=i.project(a,$),l=rt;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,ot),h=r.add(d.getColumn(e._transform,0,et),o,et);n.cartesianToCartographic(h,a),i.project(a,s);var m=it;m.x=s.z,m.y=s.x,m.z=s.y,m.w=0,t.subtract(m,l,m),m.x=0;var f=nt;if(t.magnitudeSquared(m)>c.EPSILON10)t.cross(u,m,f);else{var p=r.add(d.getColumn(e._transform,1,et),o,et);n.cartesianToCartographic(p,a),i.project(a,s),f.x=s.z,f.y=s.x,f.z=s.y,f.w=0,t.subtract(f,l,f),f.x=0,t.magnitudeSquared(f)c.EPSILON2){n=t.normalize(n,e._direction),t.clone(n,e.direction);var p=1/t.magnitudeSquared(a),v=t.dot(a,n)*p,g=t.multiplyByScalar(n,v,at);a=t.normalize(t.subtract(a,g,e._up),e._up),t.clone(a,e.up),l=t.cross(n,a,e._right),t.clone(l,e.right)}}(o||h)&&(e._directionWC=d.multiplyByPointAsVector(m,n,e._directionWC)),(s||h)&&(e._upWC=d.multiplyByPointAsVector(m,a,e._upWC)),(u||h)&&(e._rightWC=d.multiplyByPointAsVector(m,l,e._rightWC)),(i||o||s||u||h)&&w(e)}function x(e){return Math.atan2(e.right.y,e.right.x)}function E(e){var t=e._projection.ellipsoid,r=p.eastNorthUpToFixedFrame(e.position,t,st),i=d.getRotation(r,lt);h.transpose(i,i);var n=h.multiplyByVector(i,e.right,ut);return Math.atan2(n.y,n.x)}function T(e,r){var i=x(e);r=i-r,e.look(t.UNIT_Z,r)}function P(e,r){var i=t.normalize(e.position,ct),n=E(e);r=n-r,e.look(i,r)}function A(e){return c.PI_OVER_TWO-c.acosClamped(-e.direction.z)}function M(e){var r=t.normalize(e.position,ht);return t.negate(r,r),c.PI_OVER_TWO-c.acosClamped(t.dot(e.direction,r))}function D(e,t){var r=e._maxCoord.x*e.maximumTranslateFactor;t.x>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 I(e,t){var r;return o(t)&&(r=d.clone(e.transform,_t),e.setTransform(t)),r}function O(e,t){o(t)&&e.setTransform(t)}function R(e,r,i){var n=I(e,i),a=e.position,s=t.normalize(a,Ct);if(o(e.constrainedAxis)){var l=t.equalsEpsilon(s,e.constrainedAxis,c.EPSILON2),u=t.equalsEpsilon(s,t.negate(e.constrainedAxis,xt),c.EPSILON2);if(l||u)(l&&0>r||u&&r>0)&&e.rotate(e.right,r);else{var h=t.normalize(e.constrainedAxis,bt),d=t.dot(s,h),m=c.acosClamped(d);r>0&&r>m&&(r=m),d=t.dot(s,t.negate(h,xt)),m=c.acosClamped(d),0>r&&-r>m&&(r=-m);var f=t.cross(h,s,St);e.rotate(f,r)}}else e.rotate(e.right,r);O(e,n)}function L(e,t,r){o(e.constrainedAxis)?e.rotate(e.constrainedAxis,t,r):e.rotate(e.up,t,r)}function N(e,t){var r=e.frustum;if(!(o(r.left)&&o(r.right)&&o(r.top)&&o(r.bottom)))throw new s("The camera frustum is expected to be orthographic for 2D camera control.");t=.5*t;var i=r.right-t,n=r.left+t,a=e._maxCoord.x*e.maximumZoomFactor;i>a&&(i=a,n=-a),n>=i&&(i=1,n=-1);var l=r.top/r.right;r.right=i,r.left=n,r.top=r.right*l,r.bottom=-r.top}function B(e,t){e.move(e.direction,t)}function F(r,i){var n=.5*-i.height,o=-n,a=r.frustum;if(o>n){var s=a.top/a.right;a.right=o,a.left=n,a.top=a.right*s,a.bottom=-a.top}e.clone(r._projection.project(i),r.position),t.negate(t.UNIT_Z,r.direction),t.clone(t.UNIT_Y,r.up),t.clone(t.UNIT_X,r.right)}function z(e,r){var i=e._projection;e.position=i.project(r),t.negate(t.UNIT_Z,e.direction),t.clone(t.UNIT_Y,e.up),t.clone(t.UNIT_X,e.right)}function V(e,r){var i=e._projection.ellipsoid;i.cartographicToCartesian(r,e.position),t.negate(e.position,e.direction),t.normalize(e.direction,e.direction),t.cross(e.direction,t.UNIT_Z,e.right),t.cross(e.right,e.direction,e.up),t.cross(e.direction,e.up,e.right)}function q(e,r,i,n,a){o(n)||(n=new t);var s=e;a&&(s=It);var l=r.north,u=r.south,h=r.east,d=r.west;d>h&&(h+=c.TWO_PI);var m=Et;m.longitude=h,m.latitude=l;var f=i.cartographicToCartesian(m,Tt);m.latitude=u;var p=i.cartographicToCartesian(m,Mt);m.longitude=d;var v=i.cartographicToCartesian(m,Pt);m.latitude=l;var g=i.cartographicToCartesian(m,At),_=t.subtract(f,v,Dt);t.multiplyByScalar(_,.5,_),t.add(v,_,_);var y=t.magnitude(_);yy?(m=v,f=m/_):(f=g,m=y),g=Math.max(2*m,2*f),o(n)||(n=new t),n.x=.5*(d.x-p.x)+p.x,n.y=.5*(d.y-p.y)+p.y,a)h=i.unproject(n,h),h.height=g,n=i.project(h,n);else{var w=e.frustum;w.right=m,w.left=-m,w.top=f,w.bottom=-f;var C=t.clone(t.UNIT_Z,e.direction);t.negate(C,C),t.clone(t.UNIT_X,e.right),t.clone(t.UNIT_Y,e.up)}return n}function W(e,t,r,i){r=n(r,l.WGS84);var o=e.getPickRay(t,zt),a=u.rayEllipsoid(o,r);return a?f.getPoint(o,a.start,i):void 0}function G(e,t,r,i){var n=e.getPickRay(t,Vt),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 H(e,r,i,n){var o=e.getPickRay(r,qt),a=-o.origin.x/o.direction.x;f.getPoint(o,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 j(e,r,i){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*r.x-1,h=2/a*(a-r.y)-1,d=e.positionWC;t.clone(d,i.origin);var m=t.multiplyByScalar(e.directionWC,u,kt);t.add(d,m,m);var f=t.multiplyByScalar(e.rightWC,c*u*l,Ut),p=t.multiplyByScalar(e.upWC,h*u*s,Wt),v=t.add(m,f,i.direction);return t.add(v,p,v),t.subtract(v,d,v),t.normalize(v,v),i}function Y(e,r,i){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*r.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-r.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=i.origin;return t.clone(e.position,u),t.multiplyByScalar(e.right,s,Gt),t.add(Gt,u,u),t.multiplyByScalar(e.up,l,Gt),t.add(Gt,u,u),t.clone(e.directionWC,i.direction),i}function X(e,r){var i=e.position,n=i.x<-e._maxCoord.x||i.x>e._maxCoord.x,o=i.y<-e._maxCoord.y||i.y>e._maxCoord.y,a=n||o,s=e.frustum,l=s.top,u=s.bottom,h=s.right,d=s.left,m=e._max2Dfrustum,f=h>e._max2Dfrustum.right;if(a||f){var p=t.clone(i);p.x>e._maxCoord.x?p.x=e._maxCoord.x:p.x<-e._maxCoord.x&&(p.x=-e._maxCoord.x),p.y>e._maxCoord.y?p.y=e._maxCoord.y:p.y<-e._maxCoord.y&&(p.y=-e._maxCoord.y);var g=function(r){a&&(e.position=t.lerp(i,p,r.time,e.position)),f&&(e.frustum.top=c.lerp(l,m.top,r.time),e.frustum.bottom=c.lerp(u,m.bottom,r.time),e.frustum.right=c.lerp(h,m.right,r.time),e.frustum.left=c.lerp(d,m.left,r.time))};return{easingFunction:v.Easing.Exponential.Out,startValue:{time:0},stopValue:{time:1},duration:r,onUpdate:g}}return void 0}function Z(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=function(i){var n=t.lerp(r,s,i.time,new t);e.worldToCameraCoordinatesPoint(n,e.position)};return{easingFunction:v.Easing.Exponential.Out,startValue:{time:0},stopValue:{time:1},duration:a,onUpdate:l}}function J(e,r){var i=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(t.UNIT_X,Ht),a=-t.dot(o,i)/t.dot(o,n),s=t.add(i,t.multiplyByScalar(n,a,jt),jt);e.cameraToWorldCoordinatesPoint(s,s),i=e.cameraToWorldCoordinatesPoint(e.position,Yt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=t.magnitude(t.subtract(i,s,Xt)),h=u*c,d=l*c,m=e._maxCoord.x,f=e._maxCoord.y,p=Math.max(h-m,m),v=Math.max(d-f,f);if(i.z<-p||i.z>p||i.y<-v||i.y>v){var g=s.y<-p||s.y>p,_=s.z<-v||s.z>v;if(g||_)return Z(e,i,s,p,v,r)}return void 0}var Q=function(e){if(!o(e))throw new s("scene is required.");this._scene=e,this.transform=d.clone(d.IDENTITY),this._transform=d.clone(d.IDENTITY),this._invTransform=d.clone(d.IDENTITY),this._actualTransform=d.clone(d.IDENTITY),this._actualInvTransform=d.clone(d.IDENTITY);var r=l.WGS84.maximumRadius,n=new t(0,-2,1);n=t.multiplyByScalar(t.normalize(n,n),2.5*r,n),this.position=n,this._position=t.clone(n),this._positionWC=t.clone(n);var a=new t;a=t.normalize(t.negate(n,a),a),this.direction=a,this._direction=t.clone(a),this._directionWC=t.clone(a);var u=new t;u=t.normalize(t.cross(a,t.UNIT_Z,u),u);var h=t.cross(u,a,new t);this.up=h,this._up=t.clone(h),this._upWC=t.clone(h),u=t.cross(a,h,new t),this.right=u,this._right=t.clone(u),this._rightWC=t.clone(u),this.frustum=new _,this.frustum.fovy=c.toRadians(60),this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,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._viewMatrix=new d,this._invViewMatrix=new d,w(this),this._mode=y.SCENE3D,this._modeChanged=!0;var m=e.mapProjection;this._projection=m,this._maxCoord=m.project(new i(Math.PI,c.PI_OVER_TWO)),this._max2Dfrustum=void 0};Q.TRANSFORM_2D=new d(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Q.TRANSFORM_2D_INVERSE=d.inverseTransformation(Q.TRANSFORM_2D);var K=new i,$=new t,et=new t,tt=new r,rt=new r,it=new r,nt=new r,ot=new r,at=new t,st=new d,lt=new h,ut=new t,ct=new t,ht=new t;a(Q.prototype,{inverseTransform:{get:function(){return S(this),this._invTransform}},viewMatrix:{get:function(){return S(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return S(this),this._invViewMatrix}},positionWC:{get:function(){return S(this),this._positionWC}},directionWC:{get:function(){return S(this),this._directionWC}},upWC:{get:function(){return S(this),this._upWC}},rightWC:{get:function(){return S(this),this._rightWC}},heading:{get:function(){return this._mode===y.SCENE2D||this._mode===y.COLUMBUS_VIEW?x(this):this._mode===y.SCENE3D?E(this):void 0},set:function(e){if(!o(e))throw new s("angle is required.");this._mode===y.SCENE2D||this._mode===y.COLUMBUS_VIEW?T(this,e):this._mode===y.SCENE3D&&P(this,e)}},tilt:{get:function(){return this._mode===y.COLUMBUS_VIEW?A(this):this._mode===y.SCENE3D?M(this):void 0},set:function(e){if(!o(e))throw new s("angle is required.");(this._mode===y.COLUMBUS_VIEW||this._mode===y.SCENE3D)&&(e=c.clamp(e,0,c.PI_OVER_TWO),e-=this.tilt,this.look(this.right,e))}}}),Q.prototype.update=function(e){if(!o(e))throw new s("mode is required.");var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==y.MORPHING,t=this._mode===y.SCENE2D),t){var r=this._max2Dfrustum=this.frustum.clone();if(!(o(r.left)&&o(r.right)&&o(r.top)&&o(r.bottom)))throw new s("The camera frustum is expected to be orthographic for 2D camera control.");var i=2,n=r.top/r.right;r.right=this._maxCoord.x*i,r.left=-r.right,r.top=n*r.right,r.bottom=-r.top}};var dt=new t,mt=new t,ft=new t;Q.prototype.setTransform=function(e){var r=t.clone(this.positionWC,dt),i=t.clone(this.upWC,mt),n=t.clone(this.directionWC,ft);d.clone(e,this.transform),S(this);var o=this._actualInvTransform;d.multiplyByPoint(o,r,this.position),d.multiplyByPointAsVector(o,n,this.direction),d.multiplyByPointAsVector(o,i,this.up),t.cross(this.direction,this.up,this.right)},Q.prototype.worldToCameraCoordinates=function(e,t){if(!o(e))throw new s("cartesian is required.");return S(this),d.multiplyByVector(this._actualInvTransform,e,t)},Q.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!o(e))throw new s("cartesian is required.");return S(this),d.multiplyByPoint(this._actualInvTransform,e,t)},Q.prototype.worldToCameraCoordinatesVector=function(e,t){if(!o(e))throw new s("cartesian is required.");return S(this),d.multiplyByPointAsVector(this._actualInvTransform,e,t)},Q.prototype.cameraToWorldCoordinates=function(e,t){if(!o(e))throw new s("cartesian is required.");return S(this),d.multiplyByVector(this._actualTransform,e,t)},Q.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!o(e))throw new s("cartesian is required.");return S(this),d.multiplyByPoint(this._actualTransform,e,t)},Q.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!o(e))throw new s("cartesian is required.");return S(this),d.multiplyByPointAsVector(this._actualTransform,e,t)};var pt=new t;Q.prototype.move=function(e,r){if(!o(e))throw new s("direction is required.");var i=this.position;t.multiplyByScalar(e,r,pt),t.add(i,pt,i),this._mode===y.SCENE2D&&D(this,i)},Q.prototype.moveForward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,e)},Q.prototype.moveBackward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,-e)},Q.prototype.moveUp=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,e)},Q.prototype.moveDown=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,-e)},Q.prototype.moveRight=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,e)},Q.prototype.moveLeft=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,-e)},Q.prototype.lookLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,-e)},Q.prototype.lookRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,e)},Q.prototype.lookUp=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,-e)},Q.prototype.lookDown=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,e)};var vt=new m,gt=new h;Q.prototype.look=function(e,t){if(!o(e))throw new s("axis is required.");var r=n(t,this.defaultLookAmount),i=m.fromAxisAngle(e,-r,vt),a=h.fromQuaternion(i,gt),l=this.direction,u=this.up,c=this.right;h.multiplyByVector(a,l,l),h.multiplyByVector(a,u,u),h.multiplyByVector(a,c,c)},Q.prototype.twistLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,e)},Q.prototype.twistRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,-e)};var _t=new d,yt=new m,wt=new h;Q.prototype.rotate=function(e,r,i){if(!o(e))throw new s("axis is required.");var a=n(r,this.defaultRotateAmount),l=m.fromAxisAngle(e,-a,yt),u=h.fromQuaternion(l,wt),c=I(this,i);h.multiplyByVector(u,this.position,this.position),h.multiplyByVector(u,this.direction,this.direction),h.multiplyByVector(u,this.up,this.up),t.cross(this.direction,this.up,this.right),t.cross(this.right,this.direction,this.up),O(this,c)},Q.prototype.rotateDown=function(e,t){e=n(e,this.defaultRotateAmount),R(this,e,t)},Q.prototype.rotateUp=function(e,t){e=n(e,this.defaultRotateAmount),R(this,-e,t)};var Ct=new t,bt=new t,St=new t,xt=new t;Q.prototype.rotateRight=function(e,t){e=n(e,this.defaultRotateAmount),L(this,-e,t)},Q.prototype.rotateLeft=function(e,t){e=n(e,this.defaultRotateAmount),L(this,e,t)},Q.prototype.zoomIn=function(e){e=n(e,this.defaultZoomAmount),this._mode===y.SCENE2D?N(this,e):B(this,e)},Q.prototype.zoomOut=function(e){e=n(e,this.defaultZoomAmount),this._mode===y.SCENE2D?N(this,-e):B(this,-e)},Q.prototype.getMagnitude=function(){return this._mode===y.SCENE3D?t.magnitude(this.position):this._mode===y.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===y.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0},Q.prototype.setPositionCartographic=function(e){if(!o(e))throw new s("cartographic is required.");this._mode===y.SCENE2D?F(this,e):this._mode===y.COLUMBUS_VIEW?z(this,e):this._mode===y.SCENE3D&&V(this,e)},Q.prototype.lookAt=function(r,i,n){if(!o(r))throw new s("eye is required");if(!o(i))throw new s("target is required");if(!o(n))throw new s("up is required");if(this._mode===y.MORPHING)throw new s("lookAt is not supported while morphing.");if(this._mode===y.SCENE2D){e.clone(i,this.position),t.negate(t.UNIT_Z,this.direction),t.clone(n,this.up),this.up.z=0,t.magnitudeSquared(this.up)=i+Math.PI;)r-=s;for(;r0||e},v.prototype.getButtonPressTime=function(e,r){if(!t(e))throw new i("type is required.");var n=u(e,r);return this._pressTime[n]},v.prototype.getButtonReleaseTime=function(e,r){if(!t(e))throw new i("type is required.");var n=u(e,r);return this._releaseTime[n]},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/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n){"use strict";function o(e,t,i){if(!r(e.element)){var n=e.text,o=e.link,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(t.hasChildNodes()){var l=document.createElement("span");l.textContent=i,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!r(e.element)){var i=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",r(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}t.appendChild(e.element)}function s(t,r){for(var i=t.length,n=0;i>n;n++){var o=t[n];if(e.equals(o,r))return!0}return!1}function l(e){var t=e.element;if(r(t)){var i=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&i.removeChild(n)}i.removeChild(t)}}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 = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n" }),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, czm_depthRange.near, czm_depthRange.far);\n}\n"}),r("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./Pass","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y){"use strict";function w(e){var i=e.cache.ellipsoidPrimitive_vertexArray;if(o(i))return i;var n=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:u.POSITION_ONLY}));return i=e.createVertexArrayFromGeometry({geometry:n,attributeLocations:C,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=i,i}var C={position:0},b=function(t){t=n(t,n.EMPTY_OBJECT),this.center=r.clone(n(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 e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,g.fromType(g.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new d({owner:n(t._owner,this)}),this._pickCommand=new d({owner:n(t._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 b.prototype.update=function(t,n,a){if(this.show&&n.mode===y.SCENE3D&&o(this.center)&&o(this.radii)){if(!o(this.material))throw new s("this.material must be defined.");var u=this.material.isTranslucent(),c=this._translucent!==u;(!o(this._rs)||c)&&(this._translucent=u,this._rs=t.createRenderState({cull:{enabled:!0,face:v.FRONT},depthTest:{enabled:!0},depthMask:!u&&t.fragmentDepth,blending:u?p.ALPHA_BLEND:void 0})),o(this._va)||(this._va=w(t));var d=!1,g=this.radii;if(!r.equals(this._radii,g)){r.clone(g,this._radii);var b=this._oneOverEllipsoidRadiiSquared;b.x=1/(g.x*g.x),b.y=1/(g.y*g.y),b.z=1/(g.z*g.z),d=!0}l.equals(this.modelMatrix,this._modelMatrix)&&r.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),r.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),d=!0),d&&(r.clone(r.ZERO,this._boundingSphere.center),this._boundingSphere.radius=r.getMaximumComponent(g),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var S=this._material!==this.material;this._material=this.material,this._material.update(t);var x=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var E=this._colorCommand;if(S||x||c){var T=h({defines:[this.onlySunLighting?"ONLY_SUN_LIGHTING":"",!u&&t.fragmentDepth?"WRITE_DEPTH":""],sources:[this.material.shaderSource,m]});this._sp=t.replaceShaderProgram(this._sp,f,T,C),E.vertexArray=this._va,E.renderState=this._rs,E.shaderProgram=this._sp,E.uniformMap=i(this._uniforms,this.material._uniforms),E.executeInClosestFrustum=u}var P=n.passes;if(P.render&&(E.boundingVolume=this._boundingSphere,E.debugShowBoundingVolume=this.debugShowBoundingVolume,E.modelMatrix=this._computedModelMatrix,E.pass=u?_.TRANSLUCENT:_.OPAQUE,a.push(E)),P.pick){var A=this._pickCommand;if(o(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})),S||x||!o(this._pickSP)){var M=h({defines:[this.onlySunLighting?"ONLY_SUN_LIGHTING":"",!u&&t.fragmentDepth?"WRITE_DEPTH":""],sources:[this.material.shaderSource,m],pickColorQualifier:"uniform"});this._pickSP=t.replaceShaderProgram(this._pickSP,f,M,C),A.vertexArray=this._va,A.renderState=this._rs,A.shaderProgram=this._pickSP,A.uniformMap=i(i(this._uniforms,this._pickUniforms),this.material._uniforms),A.executeInClosestFrustum=u}A.boundingVolume=this._boundingSphere,A.modelMatrix=this._computedModelMatrix,A.pass=u?_.TRANSLUCENT:_.OPAQUE,a.push(A)}}},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},b}),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("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("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),l=e(r.aboveGround,!1);this.material=t(r.material)?r.material:s.fromType(s.ColorType),this.translucent=e(r.translucent,!0),this._vertexShaderSource=e(r.vertexShaderSource,o),this._fragmentShaderSource=e(r.fragmentShaderSource,n),this._renderState=e(r.renderState,a.getDefaultRenderState(i,!l)),this._closed=!1,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,l),this._aboveGround=l};return r(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=i.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),r("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"#ifndef FXAA_PRESET\n#define FXAA_PRESET 3\n#endif\n#if (FXAA_PRESET == 3)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 16\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 4)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 24\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 5)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 32\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))\nfloat FxaaLuma(vec4 rgb) {\nreturn rgb.y * (0.587/0.299) + rgb.x;\n}\nvec4 FxaaLerp4(vec4 a, vec4 b, float amountOfA) {\nreturn (vec4(-amountOfA) * b) + ((a * vec4(amountOfA)) + b);\n}\nvec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {\nfloat x = pos.x + float(off.x) * rcpFrame.x;\nfloat y = pos.y + float(off.y) * rcpFrame.y;\nreturn texture2D(tex, vec2(x, y));\n}\nvec4 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame)\n{\nvec4 rgbN = FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame);\nvec4 rgbW = FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame);\nvec4 rgbM = FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame);\nvec4 rgbE = FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame);\nvec4 rgbS = FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame);\nfloat lumaN = FxaaLuma(rgbN);\nfloat lumaW = FxaaLuma(rgbW);\nfloat lumaM = FxaaLuma(rgbM);\nfloat lumaE = FxaaLuma(rgbE);\nfloat lumaS = FxaaLuma(rgbS);\nfloat rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));\nfloat rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));\nfloat range = rangeMax - rangeMin;\nif(range < max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD))\n{\nreturn rgbM;\n}\nvec4 rgbL = rgbN + rgbW + rgbM + rgbE + rgbS;\nfloat lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;\nfloat rangeL = abs(lumaL - lumaM);\nfloat blendL = max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;\nblendL = min(FXAA_SUBPIX_CAP, blendL);\nvec4 rgbNW = FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame);\nvec4 rgbNE = FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame);\nvec4 rgbSW = FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame);\nvec4 rgbSE = FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame);\nrgbL += (rgbNW + rgbNE + rgbSW + rgbSE);\nrgbL *= vec4(1.0/9.0);\nfloat lumaNW = FxaaLuma(rgbNW);\nfloat lumaNE = FxaaLuma(rgbNE);\nfloat lumaSW = FxaaLuma(rgbSW);\nfloat lumaSE = FxaaLuma(rgbSE);\nfloat edgeVert =\nabs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +\nabs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +\nabs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));\nfloat edgeHorz =\nabs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +\nabs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +\nabs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));\nbool horzSpan = edgeHorz >= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0, 1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy));\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy));\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec4 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0)));\nreturn FxaaLerp4(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = FxaaPixelShader(v_textureCoordinates, u_texture, u_step);\n}\n"}),r("Scene/FXAA",["../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/createShaderSource","../Renderer/PixelDatatype","../Renderer/RenderbufferFormat","../Shaders/PostProcessFilters/FXAA"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthTexture=e._depthTexture&&e._depthTexture.destroy(),e._depthRenderbuffer=e._depthRenderbuffer&&e._depthRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthTexture=void 0,e._depthRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}var h=function(){this._texture=void 0,this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._fbo=void 0,this._command=void 0;var e=new o({color:new t(0,0,0,0),depth:1,owner:this});this._clearCommand=e};return h.prototype.update=function(t){var i=t.drawingBufferWidth,o=t.drawingBufferHeight,c=this._texture,h=!r(c)||c.width!==i||c.height!==o;if(h&&(this._texture=this._texture&&this._texture.destroy(),this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._texture=t.createTexture2D({width:i,height:o,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),t.depthTexture?this._depthTexture=t.createTexture2D({width:i,height:o,pixelFormat:n.DEPTH_COMPONENT,pixelDatatype:s.UNSIGNED_SHORT}):this._depthRenderbuffer=t.createRenderbuffer({width:i,height:o,format:l.DEPTH_COMPONENT16})),(!r(this._fbo)||h)&&(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=t.createFramebuffer({colorTextures:[this._texture],depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,destroyAttachments:!1})),!r(this._command)){var d=a({sources:[u]});this._command=t.createViewportQuadCommand(d,{renderState:t.createRenderState(),owner:this})}if(h){var m=this,f=new e(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return m._texture},u_step:function(){return f}}}},h.prototype.execute=function(e,t){this._command.execute(e,t)},h.prototype.clear=function(e,r,i){var n=r.framebuffer;r.framebuffer=this._fbo,t.clone(i,this._clearCommand.color),this._clearCommand.execute(e,r),r.framebuffer=n},h.prototype.getColorFramebuffer=function(){return this._fbo},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return c(this),i(this)},h}),r("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp"],function(e,t,r,i,n,o,a){"use strict";function s(e){if(!(e._pauseCount>0)){var t=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=t+e.quietPeriod,e._warmupPeriodEndTime=e._quietPeriodEndTime+e.warmupPeriod+e.samplingWindow;else if(t>=e._quietPeriodEndTime){e._frameTimes.push(t);var r=t-e.samplingWindow;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);i>n?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function l(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var u=function(r){function i(){l(a)}if(!t(r)||!t(r.scene))throw new n("description.scene is required.");this._scene=r.scene,this.samplingWindow=e(r.samplingWindow,u.defaultSettings.samplingWindow),this.quietPeriod=e(r.quietPeriod,u.defaultSettings.quietPeriod),this.warmupPeriod=e(r.warmupPeriod,u.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(r.minimumFrameRateDuringWarmup,u.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(r.minimumFrameRateAfterWarmup,u.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var a=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){s(a,t)}),this._hiddenPropertyName=t(document.hidden)?"hidden":t(document.mozHidden)?"mozHidden":t(document.msHidden)?"msHidden":t(document.webkitHidden)?"webkitHidden":void 0;var c=t(document.hidden)?"visibilitychange":t(document.mozHidden)?"mozvisibilitychange":t(document.msHidden)?"msvisibilitychange":t(document.webkitHidden)?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(c)&&(document.addEventListener(c,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(c,i,!1)})};return u.defaultSettings={samplingWindow:5e3,quietPeriod:2e3,warmupPeriod:5e3,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},u.fromScene=function(e){if(!t(e))throw new n("scene is required.");return(!t(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new u({scene:e})),e._frameRateMonitor},r(u.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),u.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},u.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),i(this)},u}),r("Scene/FrameState",["./SceneMode"],function(e){"use strict";var t=function(t){this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=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("Shaders/GlobeFS",[],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_dayTextureTexCoordsRectangle[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 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.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/GlobeFSDepth",[],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/GlobeFSPole",[],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/GlobeVS",[],function(){"use strict";return"attribute vec4 position3DAndHeight;\nattribute vec2 textureCoordinates;\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileRectangle;\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_tileRectangle.st, u_tileRectangle.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_tileRectangle.st, u_tileRectangle.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/GlobeVSDepth",[],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/GlobeVSPole",[],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("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/ImageryState",[],function(){"use strict";var e={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e}),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.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(i,n,o)}this.rectangle=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)&&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.textureCoordinateRectangle=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/ImageryLayer",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/Geometry","../Core/GeometryAttribute","../Core/Math","../Core/PixelFormat","../Core/PrimitiveType","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/MipmapHint","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImageryState","./TileImagery"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I){"use strict";function O(e,t,r){return JSON.stringify([e,t,r])}function R(t,r,s,l){var u=r.cache.imageryLayer_reproject;if(!a(u)){u=r.cache.imageryLayer_reproject={framebuffer:void 0,vertexArray:void 0,shaderProgram:void 0,renderState:void 0,sampler:void 0,destroy:function(){a(this.framebuffer)&&this.framebuffer.destroy(),a(this.vertexArray)&&this.vertexArray.destroy(),a(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var c=new Array(131072),m=0,f=0;256>f;++f)for(var v=f/255,_=0;256>_;++_){var A=_/255;c[m++]=A,c[m++]=v}var M=new h({attributes:{position:new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:c})},indices:g.getRegularGridIndices(256,256),primitiveType:p.TRIANGLES}),D={position:0};u.vertexArray=r.createVertexArrayFromGeometry({geometry:M,attributeLocations:D,bufferUsage:y.STATIC_DRAW}),u.shaderProgram=r.createShaderProgram(P,T,D);var I=r.maximumTextureFilterAnisotropy;u.sampler=r.createSampler({wrapS:E.CLAMP_TO_EDGE,wrapT:E.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:S.LINEAR,maximumAnisotropy:Math.min(I,o(t._maximumAnisotropy,I))})}s.sampler=u.sampler;var O=s.width,R=s.height;B.textureDimensions.x=O,B.textureDimensions.y=R,B.texture=s,B.northLatitude=l.north,B.southLatitude=l.south;var L=Math.sin(l.south),N=.5*Math.log((1+L)/(1-L));F[0]=N,B.southMercatorYHigh=F[0],B.southMercatorYLow=N-F[0],L=Math.sin(l.north);var z=.5*Math.log((1+L)/(1-L));B.oneOverMercatorHeight=1/(z-N);var V=r.createTexture2D({width:O,height:R,pixelFormat:s.pixelFormat,pixelDatatype:s.pixelDatatype,preMultiplyAlpha:s.preMultiplyAlpha});V.generateMipmap(b.NICEST),a(u.framebuffer)&&u.framebuffer.destroy(),u.framebuffer=r.createFramebuffer({colorTextures:[V]}),u.framebuffer.destroyAttachments=!1;var q=new w({color:i.BLACK,framebuffer:u.framebuffer});q.execute(r),a(u.renderState)&&u.renderState.viewport.width===O&&u.renderState.viewport.height===R||(u.renderState=r.createRenderState({viewport:new e(0,0,O,R)}));var k=new C({framebuffer:u.framebuffer,shaderProgram:u.shaderProgram,renderState:u.renderState,primitiveType:p.TRIANGLES,vertexArray:u.vertexArray,uniformMap:B});return k.execute(r),V}function L(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.rectangle,l=o.maximumRadius*(s.east-s.west)*a/(i.tileWidth*n.getNumberOfXTilesAtLevel(0)),u=l/t,h=Math.log(u)/Math.log(2),d=Math.round(h);return 0|d}var N=function z(e,t){this._imageryProvider=e,t=o(t,{}),this.alpha=o(t.alpha,o(e.defaultAlpha,1)),this.brightness=o(t.brightness,o(e.defaultBrightness,z.DEFAULT_BRIGHTNESS)),this.contrast=o(t.contrast,o(e.defaultContrast,z.DEFAULT_CONTRAST)),this.hue=o(t.hue,o(e.defaultHue,z.DEFAULT_HUE)),this.saturation=o(t.saturation,o(e.defaultSaturation,z.DEFAULT_SATURATION)),this.gamma=o(t.gamma,o(e.defaultGamma,z.DEFAULT_GAMMA)),this.show=o(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=o(t.rectangle,v.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new I(M.createPlaceholder(this)),this._show=!1,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0};s(N.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),N.DEFAULT_BRIGHTNESS=1,N.DEFAULT_CONTRAST=1,N.DEFAULT_HUE=0,N.DEFAULT_SATURATION=1,N.DEFAULT_GAMMA=1,N.prototype.isBaseLayer=function(){return this._isBaseLayer},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return l(this)},N.prototype._createTileImagerySkeletons=function(e,t,i){if(a(this._minimumTerrainLevel)&&e.levelthis._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(a(i)||(i=e.imagery.length),!n.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),e.imagery.splice(i,0,this._skeletonPlaceholder),!0;var o=v.intersectWith(e.rectangle,n.rectangle);if(o=v.intersectWith(o,this._rectangle),o.east<=o.west||o.north<=o.south){if(!this.isBaseLayer())return!1;var s=v.intersectWith(n.rectangle,this._rectangle),l=e.rectangle;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*t.getLevelMaximumGeometricError(e.level),d=L(this,h,u);d=Math.max(0,d);var m=n.maximumLevel;if(d>m&&(d=m),a(n.minimumLevel)){var f=n.minimumLevel;f>d&&(d=f)}var p=n.tilingScheme,g=p.positionToTileXY(v.getNorthwest(o),d),_=p.positionToTileXY(v.getSoutheast(o),d),y=(e.rectangle.north-e.rectangle.south)/512,w=(e.rectangle.east-e.rectangle.west)/512,C=p.tileXYToRectangle(g.x,g.y,d);Math.abs(C.south-e.rectangle.north)g.y&&--_.y,Math.abs(b.west-e.rectangle.east)g.x&&--_.x;var S,x,E=e.rectangle,T=p.tileXYToRectangle(g.x,g.y,d),P=0,A=1;!this.isBaseLayer()&&Math.abs(T.west-e.rectangle.west)>=y&&(P=Math.min(1,(T.west-E.west)/(E.east-E.west))),!this.isBaseLayer()&&Math.abs(T.north-e.rectangle.north)>=w&&(A=Math.max(0,(T.north-E.south)/(E.north-E.south)));for(var M=A,D=g.x;D<=_.x;D++){S=P,T=p.tileXYToRectangle(D,g.y,d),P=Math.min(1,(T.east-E.west)/(E.east-E.west)),D===_.x&&(this.isBaseLayer()||Math.abs(T.east-e.rectangle.east)1e-5){var n=R(this,e,r,t.rectangle);r.destroy(),t.texture=r=n}if(m.isPowerOfTwo(r.width)&&m.isPowerOfTwo(r.height)){var s=e.cache.imageryLayer_mipmapSampler;if(!a(s)){var l=e.maximumTextureFilterAnisotropy;s=e.cache.imageryLayer_mipmapSampler=e.createSampler({wrapS:E.CLAMP_TO_EDGE,wrapT:E.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:S.LINEAR,maximumAnisotropy:Math.min(l,o(this._maximumAnisotropy,l))})}r.generateMipmap(b.NICEST),r.sampler=s}else{var u=e.cache.imageryLayer_nonMipmapSampler;a(u)||(u=e.cache.imageryLayer_nonMipmapSampler=e.createSampler({wrapS:E.CLAMP_TO_EDGE,wrapT:E.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:S.LINEAR})),r.sampler=u}t.state=D.READY},N.prototype.getImageryFromCache=function(e,t,r,i){var n=O(e,t,r),o=this._imageryCache[n];return a(o)||(o=new M(this,e,t,r,i),this._imageryCache[n]=o),o.addReference(),o},N.prototype.removeImageryFromCache=function(e){var t=O(e.x,e.y,e.level);delete this._imageryCache[t]};var B={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 t,texture:void 0,northLatitude:0,southLatitude:0,southMercatorYHigh:0,southMercatorYLow:0,oneOverMercatorHeight:0},F=u.supportsTypedArrays()?new Float32Array(1):void 0;return N}),r("Scene/TerrainState",[],function(){"use strict";var e={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e}),r("Scene/TileState",[],function(){"use strict";var e={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e}),r("Scene/terrainAttributeLocations",[],function(){"use strict";return{position3DAndHeight:0,textureCoordinates:1}}),r("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/TerrainProvider","../Core/TileProviderError","../Renderer/BufferUsage","../ThirdParty/when","./terrainAttributeLocations","./TerrainState"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t,r,n,o){function a(t){e.data=t,e.state=h.RECEIVED}function l(){e.state=h.FAILED;var i="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+o+".";t._requestError=s.handleError(t._requestError,t,t.errorEvent,i,r,n,o,c)}function c(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=h.RECEIVING,u(e.data,a,l)):e.state=h.UNLOADED}c()}function m(e,t,r,n,o,a){var s=r.tilingScheme,l=e.data,c=l.createMesh(s,n,o,a);i(c)&&(e.state=h.TRANSFORMING,u(c,function(t){e.mesh=t,e.state=h.TRANSFORMED},function(){e.state=h.FAILED}))}function f(e,t){var n=r.FLOAT,a=e.mesh.vertices,s=t.createVertexBuffer(a,l.STATIC_DRAW),u=6*r.getSizeInBytes(n),d=4,m=[{index:c.position3DAndHeight,vertexBuffer:s,componentDatatype:n,componentsPerAttribute:d,offsetInBytes:0,strideInBytes:u},{index:c.textureCoordinates,vertexBuffer:s,componentDatatype:n,componentsPerAttribute:2,offsetInBytes:d*r.getSizeInBytes(n),strideInBytes:u}],f=e.mesh.indices.indexBuffers||{},p=f[t.id];if(!i(p)||p.isDestroyed()){var v=e.mesh.indices;p=t.createIndexBuffer(v,l.STATIC_DRAW,o.UNSIGNED_SHORT),p.vertexArrayDestroyable=!1,p.referenceCount=1,f[t.id]=p,e.mesh.indices.indexBuffers=f}else++p.referenceCount;e.vertexArray=t.createVertexArray(m,p),e.state=h.READY}var p=function(e){this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e};return p.prototype.freeResources=function(){if(this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,i(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.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},p.prototype.processLoadStateMachine=function(e,t,r,i,n){this.state===h.UNLOADED&&d(this,t,r,i,n),this.state===h.RECEIVED&&m(this,e,t,r,i,n),this.state===h.TRANSFORMED&&f(this,e,t,r,i,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,o,a){if(this.state===h.UNLOADED){var s=this.upsampleDetails;if(!i(s))throw new n("TileTerrain cannot upsample unless provided upsampleDetails.");var l=s.data,c=s.x,d=s.y,p=s.level;if(this.data=l.upsample(t.tilingScheme,c,d,p,r,o,a),!i(this.data))return;this.state=h.RECEIVING;var v=this;u(this.data,function(e){v.data=e,v.state=h.RECEIVED},function(){v.state=h.FAILED})}this.state===h.RECEIVED&&m(this,e,t,r,o,a),this.state===h.TRANSFORMED&&f(this,e,t,r,o,a)},p}),r("Scene/Tile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/PixelFormat","../Core/Rectangle","../Renderer/PixelDatatype","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./TerrainState","./TileState","./TileTerrain"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v){"use strict";function g(e,r,i){var o=y(e);n(o)&&(e.upsampledTerrain=new v(o)),b(e)&&(e.loadedTerrain=new v);for(var a=0,s=i.length;s>a;++a){var u=i.get(a);u.show&&u._createTileImagerySkeletons(e,r)}var c=e.tilingScheme.ellipsoid,h=e.rectangle;c.cartographicToCartesian(l.getSouthwest(h),e.southwestCornerCartesian),c.cartographicToCartesian(l.getNortheast(h),e.northeastCornerCartesian),D.longitude=h.west,D.latitude=.5*(h.south+h.north),D.height=0;var d=c.cartographicToCartesian(D,A),m=t.cross(d,t.UNIT_Z,T);t.normalize(m,e.westNormal),D.longitude=h.east;var f=c.cartographicToCartesian(D,M),p=t.cross(t.UNIT_Z,f,T);t.normalize(p,e.eastNormal);var g=c.geodeticSurfaceNormalCartographic(l.getSoutheast(h),P),_=t.subtract(d,f,T),w=t.cross(g,_,P);t.normalize(w,e.southNormal);var C=c.geodeticSurfaceNormalCartographic(l.getNorthwest(h),P),S=t.cross(_,C,P);t.normalize(S,e.northNormal)}function _(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>=f.RECEIVED){if(e.terrainData!==i.data){e.terrainData=i.data;var s=e.terrainData.waterMask;n(s)&&(n(e.waterMaskTexture)&&(--e.waterMaskTexture.referenceCount,0===e.waterMaskTexture.referenceCount&&e.waterMaskTexture.destroy()),e.waterMaskTexture=S(t,s),e.waterMaskTranslationAndScale.x=0,e.waterMaskTranslationAndScale.y=0,e.waterMaskTranslationAndScale.z=1,e.waterMaskTranslationAndScale.w=1),C(e)}a=!0}i.state===f.READY?(i.publishToTile(e),e.loadedTerrain=void 0,e.upsampledTerrain=void 0):i.state===f.FAILED&&(e.loadedTerrain=void 0)}!a&&n(o)&&(o.processUpsampleStateMachine(t,r,e.x,e.y,e.level),o.state>=f.RECEIVED&&e.terrainData!==o.data&&(e.terrainData=o.data,r.hasWaterMask()&&x(e,t),w(e)),o.state===f.READY?(o.publishToTile(e),e.upsampledTerrain=void 0):o.state===f.FAILED&&(e.upsampledTerrain=void 0))}function y(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 w(e){if(n(e._children))for(var t=0;4>t;++t){var r=e._children[t];if(r.state!==p.START){if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())continue;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({data:e.terrainData,x:e.x,y:e.y,level:e.level}),r.state=p.LOADING}}}function C(e){if(n(e.children))for(var t=0;4>t;++t){var r=e.children[t];if(r.state!==p.START){if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())continue;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({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 v)),r.state=p.LOADING}}}function b(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:s.LUMINANCE,pixelDatatype:u.UNSIGNED_BYTE,source:{width:o,height:o,arrayBufferView:t}}),r.referenceCount=0,n(i.sampler)||(i.sampler=e.createSampler({wrapS:d.CLAMP_TO_EDGE,wrapT:d.CLAMP_TO_EDGE,minificationFilter:h.LINEAR,magnificationFilter:c.LINEAR})),r.sampler=i.sampler):(n(i.allWaterTexture)||(i.allWaterTexture=e.createTexture2D({pixelFormat:s.LUMINANCE,pixelDatatype:u.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}}),i.allWaterTexture.referenceCount=1,i.allLandTexture=e.createTexture2D({pixelFormat:s.LUMINANCE,pixelDatatype:u.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 x(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.rectangle,i=e.rectangle,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){if(!n(i))throw new a("options is required.");if(!n(i.x))throw new a("options.x is required.");if(!n(i.y))throw new a("options.y is required.");if(i.x<0||i.y<0)throw new a("options.x and options.y must be greater than or equal to zero.");if(!n(i.level))throw new a("options.level is required and must be greater than or equal to zero.");if(!n(i.tilingScheme))throw new a("options.tilingScheme is required.");this._children=void 0,this.tilingScheme=i.tilingScheme,this.x=i.x,this.y=i.y,this.level=i.level,this.parent=i.parent,this.rectangle=this.tilingScheme.tileXYToRectangle(this.x,this.y,this.level),this.state=p.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.createLevelZeroTiles=function(e){if(!n(e))throw new a("tilingScheme is required.");for(var t=e.getNumberOfXTilesAtLevel(0),r=e.getNumberOfYTilesAtLevel(0),i=new Array(t*r),o=0,s=0;r>s;++s)for(var l=0;t>l;++l)i[o++]=new E({tilingScheme:e,x:l,y:s,level:0});return i},o(E.prototype,{children:{get: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=p.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.indexBuffer,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.indexBuffer,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===p.START&&(g(this,t,r),this.state=p.LOADING),this.state===p.LOADING&&_(this,e,t);for(var i=n(this.vertexArray),o=!n(this.loadedTerrain)&&!n(this.upsampledTerrain),a=n(this.terrainData)&&this.terrainData.wasCreatedByUpsampling(),s=this.imagery,l=0,u=s.length;u>l;++l){var c=s[l];if(n(c.loadingImagery)){if(c.loadingImagery.state===m.PLACEHOLDER){var h=c.loadingImagery.imageryLayer;if(h.imageryProvider.ready){c.freeResources(),s.splice(l,1),h._createTileImagerySkeletons(this,t,l),--l,u=s.length;continue}a=!1}var d=c.processStateMachine(this,e);o=o&&d,i=i&&(d||n(c.readyImagery)),a=a&&n(c.loadingImagery)&&(c.loadingImagery.state===m.FAILED||c.loadingImagery.state===m.INVALID)}else a=!1}l===u&&(i&&(this.isRenderable=!0),o&&(this.state=a?p.UPSAMPLED_ONLY:p.READY))};var T=new t,P=new t,A=new t,M=new t,D=new i;return E}),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,f=0,p=m.length;d&&p>f;++f){var v=m[f];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/GlobeSurface",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidalOccluder","../Core/FeatureDetection","../Core/GeometryPipeline","../Core/getTimestamp","../Core/IndexDatatype","../Core/Intersect","../Core/Matrix4","../Core/PrimitiveType","../Core/Queue","../Core/Rectangle","../Core/TerrainProvider","../Core/WebMercatorProjection","../Renderer/BufferUsage","../Renderer/DrawCommand","../ThirdParty/when","./ImageryLayer","./ImageryState","./Pass","./SceneMode","./Tile","./TileReplacementQueue","./TileState"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D){"use strict";function I(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 O(e){if(e._imageryLayerCollection._update(),e._layerOrderChanged){e._layerOrderChanged=!1;for(var t=e._tileReplacementQueue.head;o(t);)t.imagery.sort(I),t=t.replacementNext}}function R(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=A.createLevelZeroTiles(c)}var h=r.camera.positionWC,d=e._terrainProvider.tilingScheme.ellipsoid,m=d.cartesianToCartographic(h,J);e._ellipsoidalOccluder.cameraPosition=h;var f,p=e._levelZeroTiles;for(n=0,a=p.length;a>n;++n)f=p[n],e._tileReplacementQueue.markTileRendered(f),f.statei.maxDepth&&(i.maxDepth=f.level),L(e,t,r,h,m,f)n;++n)F(e,r,v[n])?u.enqueue(v[n]):++i.tilesCulled}else B(e,f);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 L(e,t,r,i,n,o){if(r.mode===P.SCENE2D)return N(e,t,r,i,n,o);var a=e._terrainProvider.getLevelMaximumGeometricError(o.level),s=Math.sqrt(z(r,i,n,o));o.distance=s;var l=t.drawingBufferHeight,u=r.camera,c=u.frustum,h=c.fovy;return a*l/(2*s*Math.tan(.5*h))}function N(e,t,r,i,n,o){var a=r.camera,s=a.frustum,l=t.drawingBufferWidth,u=t.drawingBufferHeight,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 B(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 F(t,i,n){var a=i.cullingVolume,s=n.boundingSphere3D;if(i.mode!==P.SCENE3D&&(s=Q,e.fromRectangleWithHeights2D(n.rectangle,i.mapProjection,n.minimumHeight,n.maximumHeight,s),r.fromElements(s.center.z,s.center.x,s.center.y,s.center),i.mode===P.MORPHING&&(s=e.union(n.boundingSphere3D,s,s))),a.getVisibility(s)===f.OUTSIDE)return!1;if(i.mode===P.SCENE3D){var l=n.occludeePointInScaledSpace;return o(l)?t._ellipsoidalOccluder.isScaledSpacePointVisible(l):!0}return!0}function z(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!==P.SCENE3D&&(o=e.mapProjection.project(_.getSouthwest(n.rectangle),K),o.z=o.y,o.y=o.x,o.x=0,a=e.mapProjection.project(_.getNortheast(n.rectangle),$),a.z=a.y,a.y=a.x,a.x=0,s=et,u=r.UNIT_Y,l=tt,c=r.UNIT_Z,h=0);var d,m=r.subtract(t,o,rt),f=r.dot(m,s),p=r.dot(m,l),v=r.subtract(t,a,rt),g=r.dot(v,u),y=r.dot(v,c);d=e.mode===P.SCENE3D?i.height:t.x;var w=d-h,C=0;return f>0?C+=f*f:g>0&&(C+=g*g),p>0?C+=p*p:y>0&&(C+=y*y),w>0&&(C+=w*w),C}function V(e,t,r){for(var i=!0,n=!0,o=r.children,a=0,s=o.length;s>a;++a){var l=o[a];e._tileReplacementQueue.markTileRendered(l),n=n&&l.state===D.UPSAMPLED_ONLY,i=i&&l.isRenderable,l.state=0;--u){var c=r[u];if(e._tileReplacementQueue.markTileRendered(c),c.processStateMachine(t,i,n),d()>=s)break}}}function U(e,t){return e.distance-t.distance}function W(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function G(e){var n={u_center3D:function(){return this.center3D},u_tileRectangle:function(){return this.tileRectangle},u_modifiedModelView:function(){return this.modifiedModelView},u_dayTextures:function(){return this.dayTextures},u_dayTextureTranslationAndScale:function(){return this.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.dayTextureTexCoordsRectangle },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 p,tileRectangle:new i,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new t,southMercatorYLowAndHighAndOneOverHeight:new r,waterMask:void 0,waterMaskTranslationAndScale:new i};return W(n,e),n}function H(t,n,a,s,l,u,c,h){Y(t,a);for(var d=a.camera.viewMatrix,m=n.maximumTextureImageUnits,f=t._tileCommands,g=t._tileCommandUniformMaps,y=-1,C=t._tilesToRenderByTextureCount,S=0,A=C.length;A>S;++S){var M=C[S];if(o(M)&&0!==M.length){M.sort(U);for(var D=0,I=M.length;I>D;D++){var O=M[D],R=O.center,L=ot,N=0,B=0,F=0,z=0,V=0;if(a.mode!==P.SCENE3D){var q=l.project(_.getSouthwest(O.rectangle),lt),k=l.project(_.getNortheast(O.rectangle),ut);if(L.x=q.x,L.y=q.y,L.z=k.x,L.w=k.y,a.mode!==P.MORPHING&&(R=at,R.x=0,R.y=.5*(L.z+L.x),R.z=.5*(L.w+L.y),L.x-=R.y,L.y-=R.z,L.z-=R.y,L.w-=R.z),l instanceof w){N=O.rectangle.south,B=O.rectangle.north;var W=w.geodeticLatitudeToMercatorAngle(N),H=w.geodeticLatitudeToMercatorAngle(B);it[0]=W,F=it[0],z=W-it[0],V=1/(H-W)}}var X=st;X.x=R.x,X.y=R.y,X.z=R.z,X.w=1,p.multiplyByVector(d,X,X),p.setColumn(d,3,X,nt);var Z=O.imagery,J=0,Q=Z.length;do{var K=0;++y;var $=f[y];o($)||($=new b({cull:!1,boundingVolume:new e}),f[y]=$,g[y]=G(u)),$.owner=O,$.debugShowBoundingVolume=O===t._debug.boundingSphereTile;var et=g[y];et.center3D=O.center,i.clone(L,et.tileRectangle),et.southAndNorthLatitude.x=N,et.southAndNorthLatitude.y=B,et.southMercatorYLowAndHighAndOneOverHeight.x=z,et.southMercatorYLowAndHighAndOneOverHeight.y=F,et.southMercatorYLowAndHighAndOneOverHeight.z=V,p.clone(nt,et.modifiedModelView);for(var tt=!1,rt=!1,ct=!1,ht=!1,dt=!1,mt=!1;m>K&&Q>J;){var ft=Z[J],pt=ft.readyImagery;if(++J,o(pt)&&pt.state===E.READY&&0!==pt.imageryLayer.alpha){var vt=pt.imageryLayer;if(o(ft.textureTranslationAndScale)||(ft.textureTranslationAndScale=vt._calculateTextureTranslationAndScale(O,ft)),et.dayTextures[K]=pt.texture,et.dayTextureTranslationAndScale[K]=ft.textureTranslationAndScale,et.dayTextureTexCoordsRectangle[K]=ft.textureCoordinateRectangle,et.dayTextureAlpha[K]="function"==typeof vt.alpha?vt.alpha(a,vt,pt.x,pt.y,pt.level):vt.alpha,mt=mt||1!==et.dayTextureAlpha[K],et.dayTextureBrightness[K]="function"==typeof vt.brightness?vt.brightness(a,vt,pt.x,pt.y,pt.level):vt.brightness,tt=tt||et.dayTextureBrightness[K]!==x.DEFAULT_BRIGHTNESS,et.dayTextureContrast[K]="function"==typeof vt.contrast?vt.contrast(a,vt,pt.x,pt.y,pt.level):vt.contrast,rt=rt||et.dayTextureContrast[K]!==x.DEFAULT_CONTRAST,et.dayTextureHue[K]="function"==typeof vt.hue?vt.hue(a,vt,pt.x,pt.y,pt.level):vt.hue,ct=ct||et.dayTextureHue[K]!==x.DEFAULT_HUE,et.dayTextureSaturation[K]="function"==typeof vt.saturation?vt.saturation(a,vt,pt.x,pt.y,pt.level):vt.saturation,ht=ht||et.dayTextureSaturation[K]!==x.DEFAULT_SATURATION,et.dayTextureOneOverGamma[K]="function"==typeof vt.gamma?1/vt.gamma(a,vt,pt.x,pt.y,pt.level):1/vt.gamma,dt=dt||et.dayTextureOneOverGamma[K]!==1/x.DEFAULT_GAMMA,o(pt.credits))for(var gt=a.creditDisplay,_t=pt.credits,yt=0,wt=_t.length;wt>yt;++yt)gt.addCredit(_t[yt]);++K}}et.dayTextures.length=K,et.waterMask=O.waterMaskTexture,i.clone(O.waterMaskTranslationAndScale,et.waterMaskTranslationAndScale),c.push($),$.shaderProgram=s.getShaderProgram(n,S,tt,rt,ct,ht,dt,mt),$.renderState=h,$.primitiveType=v.TRIANGLES,$.vertexArray=O.vertexArray,$.uniformMap=et,$.pass=T.OPAQUE,t._debug.wireframe&&(j(n,t,O),o(O.wireframeVertexArray)&&($.vertexArray=O.wireframeVertexArray,$.primitiveType=v.LINES));var Ct=$.boundingVolume;a.mode!==P.SCENE3D?(e.fromRectangleWithHeights2D(O.rectangle,a.mapProjection,O.minimumHeight,O.maximumHeight,Ct),r.fromElements(Ct.center.z,Ct.center.x,Ct.center.y,Ct.center),a.mode===P.MORPHING&&(Ct=e.union(O.boundingSphere3D,Ct,Ct))):e.clone(O.boundingSphere3D,Ct)}while(Q>J)}}}f.length=Math.max(0,y+1)}function j(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;S(r.meshForWireframePromise,function(t){r.vertexArray===i&&(r.wireframeVertexArray=X(e,r.vertexArray,t)),r.meshForWireframePromise=void 0})}}function Y(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.imageryProvider.ready&&(r=l.imageryProvider.credit,o(r)&&i.addCredit(r))}}function X(e,t,r){var i={indices:r.indices,primitiveType:v.TRIANGLES};h.toWireframe(i);var n=i.indices,o=e.createIndexBuffer(n,C.STATIC_DRAW,m.UNSIGNED_SHORT);return e.createVertexArray(t._attributes,o)}var Z=function(e){if(!o(e.terrainProvider))throw new l("options.terrainProvider is required.");if(!o(e.imageryLayerCollection))throw new l("options.imageryLayerCollection is required.");this._terrainProvider=e.terrainProvider,this._imageryLayerCollection=e.imageryLayerCollection,this._imageryLayerCollection.layerAdded.addEventListener(Z.prototype._onLayerAdded,this),this._imageryLayerCollection.layerRemoved.addEventListener(Z.prototype._onLayerRemoved,this),this._imageryLayerCollection.layerMoved.addEventListener(Z.prototype._onLayerMoved,this),this._imageryLayerCollection.layerShownOrHidden.addEventListener(Z.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1;var t=this._terrainProvider.tilingScheme;this._levelZeroTiles=void 0,this._tilesToRenderByTextureCount=[],this._tileCommands=[],this._tileCommandUniformMaps=[],this._tileTraversalQueue=new g,this._tileLoadQueue=[],this._tileReplacementQueue=new M,this._maximumScreenSpaceError=2,this._tileCacheSize=100,this._loadQueueTimeSlice=5;var i=t.ellipsoid;this._ellipsoidalOccluder=new u(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}};a(Z.prototype,{terrainProvider:{get:function(){return this._terrainProvider},set:function(e){if(this._terrainProvider!==e){if(!o(e))throw new l("terrainProvider is required.");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}},Z.prototype._onLayerMoved=function(){o(this._levelZeroTiles)&&(this._layerOrderChanged=!0)},Z.prototype._onLayerShownOrHidden=function(e,t,r){o(this._levelZeroTiles)&&(r?this._onLayerAdded(e,t):this._onLayerRemoved(e,t))},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){var e=this._levelZeroTiles;if(o(e))for(var t=0;tf;++f)m+="color = sampleAndBlend(\n color,\n u_dayTextures["+f+"],\n"+" textureCoordinates,\n"+" u_dayTextureTexCoordsRectangle["+f+"],\n"+" u_dayTextureTranslationAndScale["+f+"],\n"+(u?" u_dayTextureAlpha["+f+"],\n":"1.0,\n")+(n?" u_dayTextureBrightness["+f+"],\n":"0.0,\n")+(o?" u_dayTextureContrast["+f+"],\n":"0.0,\n")+(a?" u_dayTextureHue["+f+"],\n":"0.0,\n")+(s?" u_dayTextureSaturation["+f+"],\n":"0.0,\n")+(l?" u_dayTextureOneOverGamma["+f+"]);\n":"0.0);\n");m+=" return color;\n}",h=t.createShaderProgram(d,m,this._attributeLocations),this._shaders[c]=h}return h},r.prototype.destroy=function(){return this.invalidateShaders(),t(this)},r}),r("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","./ImageryLayer"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r){if(!t(r))throw new n("layer is required.");var i=e.indexOf(r);if(-1===i)throw new n("layer is not in this collection.");return i}function u(e,t,r){var i=e._layers;if(t=a.clamp(t,0,i.length-1),r=a.clamp(r,0,i.length-1),t!==r){var n=i[t];i[t]=i[r],i[r]=n,e._update(),e.layerMoved.raiseEvent(n,r,t)}}var c=function(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o};return r(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,r){var i=t(r);if(!t(e))throw new n("layer is required.");if(i){if(0>r)throw new n("index must be greater than or equal to zero.");if(r>this._layers.length)throw new n("index must be less than or equal to the number of layers.")}i?this._layers.splice(r,0,e):(r=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,r)},c.prototype.addImageryProvider=function(e,r){if(!t(e))throw new n("imageryProvider is required.");var i=new s(e);return this.add(i,r),i},c.prototype.remove=function(t,r){r=e(r,!0);var i=this._layers.indexOf(t);return-1!==i?(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(t,i),r&&t.destroy(),!0):!1},c.prototype.removeAll=function(t){t=e(t,!0);for(var r=this._layers,i=0,n=r.length;n>i;i++){var o=r[i];this.layerRemoved.raiseEvent(o,i),t&&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){if(!t(e))throw new n("index is required.","index");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),i(this)},c.prototype._update=function(){for(var e,r,i=!0,n=this._layers,o=0,a=n.length;a>o;++o)r=n[o],r._layerIndex=o,r.show?(r._isBaseLayer=i,i=!1):r._isBaseLayer=!1,r.show!==r._show&&(t(r._show)&&(t(e)||(e=[]),e.push(r)),r._show=r.show);if(t(e))for(o=0,a=e.length;a>o;++o)r=e[o],this.layerShownOrHidden.raiseEvent(r,r._layerIndex,r.show)},c}),r("Scene/Globe",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/Intersect","../Core/loadImage","../Core/Math","../Core/Matrix4","../Core/Occluder","../Core/PrimitiveType","../Core/Rectangle","../Core/TerrainProvider","../Core/Transforms","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/createShaderSource","../Renderer/DrawCommand","../Shaders/GlobeFS","../Shaders/GlobeFSDepth","../Shaders/GlobeFSPole","../Shaders/GlobeVS","../Shaders/GlobeVSDepth","../Shaders/GlobeVSPole","../ThirdParty/when","./DepthFunction","./GlobeSurface","./GlobeSurfaceShaderSet","./ImageryLayerCollection","./Pass","./SceneMode","./terrainAttributeLocations"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I,O,R,L,N,B,F,z,V,q,k,U,W,G){"use strict";function H(e,t){var r=e._ellipsoid.radii,i=t.camera.positionWC,o=n.multiplyComponents(e._ellipsoid.oneOverRadii,i,J),a=n.magnitude(o),s=n.normalize(o,Q),l=n.normalize(n.cross(n.UNIT_Z,o,K),K),u=n.normalize(n.cross(s,l,$),$),c=Math.sqrt(n.magnitudeSquared(o)-1),h=n.multiplyByScalar(s,1/a,J),d=c/a,m=n.multiplyByScalar(l,d,Q),f=n.multiplyByScalar(u,d,K),p=n.add(h,f,$);n.subtract(p,m,p),n.multiplyComponents(r,p,p),n.pack(p,Z,0);var v=n.subtract(h,f,$);n.subtract(v,m,v),n.multiplyComponents(r,v,v),n.pack(v,Z,3);var g=n.add(h,f,$);n.add(g,m,g),n.multiplyComponents(r,g,g),n.pack(g,Z,6);var _=n.subtract(h,f,$);return n.add(_,m,_),n.multiplyComponents(r,_,_),n.pack(_,Z,9),Z}function j(t,r,i,a,s,l){var u,c=t._ellipsoid.cartographicToCartesian(new o(0,a)),h=t._ellipsoid.cartographicToCartesian(new o(Math.PI,a)),d=.5*n.magnitude(n.subtract(c,h,et),et),m=t._ellipsoid.cartographicToCartesian(new o(0,i)),f=r.camera.direction;u=1-n.dot(rt,f)-w.PI_OVER_TWO&&(h=new x(-Math.PI,-w.PI_OVER_TWO,Math.PI,o.south),d=t.fromRectangle3D(h,e._ellipsoid),m=i.cullingVolume.getVisibility(d)===_.OUTSIDE,f=b.computeOccludeePointFromRectangle(h,e._ellipsoid),p=f&&!A.isPointVisible(f)||!A.isBoundingSphereVisible(d),e._drawSouthPole=!m&&!p,e._drawSouthPole&&(S=j(e,i,h.south,h.north+T,l,E),ot[0]=S.x,ot[1]=S.y,ot[2]=S.x+S.width,ot[3]=S.y,ot[4]=S.x+S.width,ot[5]=S.y+S.height,ot[6]=S.x,ot[7]=S.y+S.height,u(e._southPoleCommand.vertexArray)?e._southPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(ot):(e._southPoleCommand.boundingVolume=t.fromRectangle3D(h,e._ellipsoid),y=new v({attributes:{position:new g({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:ot})}}),e._southPoleCommand.vertexArray=r.createVertexArrayFromGeometry({geometry:y,attributeLocations:{position:0},bufferUsage:P.STREAM_DRAW}))));var M=0,D=e._imageryLayerCollection.length>0?e._imageryLayerCollection.get(0):void 0;u(D)&&u(D.imageryProvider)&&u(D.imageryProvider.getPoleIntensity)&&(M=D.imageryProvider.getPoleIntensity());var I={u_dayIntensity:function(){return M}},O=e;if(!u(e._northPoleCommand.uniformMap)){var R=a(I,{u_color:function(){return O.northPoleColor}});e._northPoleCommand.uniformMap=a(R,e._drawUniforms)}if(!u(e._southPoleCommand.uniformMap)){var L=a(I,{u_color:function(){return O.southPoleColor}});e._southPoleCommand.uniformMap=a(L,e._drawUniforms)}}}var X=function(e){e=l(e,d.WGS84);var o=new m({ellipsoid:e}),a=new k;this.terrainProvider=o,this._ellipsoid=e,this._imageryLayerCollection=a,this._surface=new V({terrainProvider:o,imageryLayerCollection:a}),this._occluder=new b(new t(n.ZERO,e.minimumRadius),n.ZERO),this._surfaceShaderSet=new q(G),this._rsColor=void 0,this._rsColorWithoutDepthTest=void 0,this._clearDepthCommand=new A({depth:1,stencil:0,owner:this}),this._depthCommand=new D({boundingVolume:new t(n.ZERO,e.maximumRadius),pass:U.OPAQUE,owner:this}),this._northPoleCommand=new D({pass:U.OPAQUE,owner:this}),this._southPoleCommand=new D({pass:U.OPAQUE,owner:this}),this._drawNorthPole=!1,this._drawSouthPole=!1,this.northPoleColor=new n(2/255,6/255,18/255),this.southPoleColor=new n(1,1,1),this.show=!0,this._mode=W.SCENE3D,this.oceanNormalMapUrl=r("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 i(this.lightingFadeOutDistance,this.lightingFadeInDistance);var s=this;this._drawUniforms={u_zoomedOutOceanSpecularIntensity:function(){return s._zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return s._oceanNormalMap},u_lightingFadeDistance:function(){return s._lightingFadeDistance}}};c(X.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}}});var Z=f.supportsTypedArrays()?new Float32Array(12):[],J=new n,Q=new n,K=new n,$=new n,et=new n,tt=new n,rt=n.negate(n.UNIT_Z,new n),it=new e,nt=new C,ot=f.supportsTypedArrays()?new Float32Array(8):[];return X.prototype.update=function(e,t,r){if(this.show){var i=e.drawingBufferWidth,n=e.drawingBufferHeight;if(0!==i&&0!==n){var o=t.mode,a=t.mapProjection,l=!1;this._mode===o&&u(this._rsColor)||(l=!0,o===W.SCENE3D||o===W.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:z.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 v({attributes:{position:new g({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:c})},indices:[0,1,2,2,1,3],primitiveType:S.TRIANGLES});this._depthCommand.vertexArray=e.createVertexArrayFromGeometry({geometry:h,attributeLocations:{position:0},bufferUsage:P.DYNAMIC_DRAW})}if(u(this._depthCommand.shaderProgram)||(this._depthCommand.shaderProgram=e.createShaderProgram(N,O,{position:0})),this._surface._terrainProvider.ready&&this._surface._terrainProvider.hasWaterMask()&&this.oceanNormalMapUrl!==this._lastOceanNormalMapUrl){this._lastOceanNormalMapUrl=this.oceanNormalMapUrl;var d=this;F(y(this.oceanNormalMapUrl),function(t){d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=e.createTexture2D({source:t})})}var m=this._surface._terrainProvider.ready&&this._surface._terrainProvider.hasWaterMask(),f=this._hasWaterMask!==m,_=this._enableLighting!==this.enableLighting;if(!u(this._surfaceShaderSet)||!u(this._northPoleCommand.shaderProgram)||!u(this._southPoleCommand.shaderProgram)||l||f||_||u(this._oceanNormalMap)!==this._showingPrettyOcean){var w,C="vec4 getPosition(vec3 position3DWC) { return getPosition3DMode(position3DWC); }",b="vec4 getPosition(vec3 position3DWC) { return getPosition2DMode(position3DWC); }",x="vec4 getPosition(vec3 position3DWC) { return getPositionColumbusViewMode(position3DWC); }",E="vec4 getPosition(vec3 position3DWC) { return getPositionMorphingMode(position3DWC); }";switch(o){case W.SCENE3D:w=C;break;case W.SCENE2D:w=b;break;case W.COLUMBUS_VIEW:w=x;break;case W.MORPHING:w=E}var T,A="float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }",D="float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }";T=a instanceof p?A:D,this._surfaceShaderSet.baseVertexShaderString=M({defines:[m?"SHOW_REFLECTIVE_OCEAN":"",this.enableLighting?"ENABLE_LIGHTING":""],sources:[L,w,T]});var V=m&&u(this._oceanNormalMap);this._surfaceShaderSet.baseFragmentShaderString=M({defines:[m?"SHOW_REFLECTIVE_OCEAN":"",V?"SHOW_OCEAN_WAVES":"",this.enableLighting?"ENABLE_LIGHTING":""],sources:[I]}),this._surfaceShaderSet.invalidateShaders();var q=e.replaceShaderProgram(this._northPoleCommand.shaderProgram,B,R,G);this._northPoleCommand.shaderProgram=q,this._southPoleCommand.shaderProgram=q,this._showingPrettyOcean=u(this._oceanNormalMap),this._hasWaterMask=m,this._enableLighting=this.enableLighting}var k=t.camera.positionWC;this._occluder.cameraPosition=k,Y(this,e,t),this._mode=o;var U=t.passes;U.render&&(o===W.SCENE3D&&(this._drawNorthPole&&r.push(this._northPoleCommand),this._drawSouthPole&&r.push(this._southPoleCommand)),this._zoomedOutOceanSpecularIntensity=o===W.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.terrainProvider=this.terrainProvider,this._surface.update(e,t,r,this._drawUniforms,this._surfaceShaderSet,this._rsColor,a),(o===W.SCENE3D||o===W.COLUMBUS_VIEW)&&(this.depthTestAgainstTerrain||(r.push(this._clearDepthCommand),o===W.SCENE3D&&r.push(this._depthCommand)))),U.pick&&r.push(this._depthCommand)}}},X.prototype.isDestroyed=function(){return!1},X.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.destroy(),this._southPoleCommand.shaderProgram=this._northPoleCommand.shaderProgram,this._depthCommand.shaderProgram=this._depthCommand.shaderProgram&&this._depthCommand.shaderProgram.destroy(),this._depthCommand.vertexArray=this._depthCommand.vertexArray&&this._depthCommand.vertexArray.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),h(this)},X}),r("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function f(e,t,i,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",i),o=o.replace("{zoom}",n+1);var a=e._proxy;return r(a)&&(o=a.getURL(o)),o}var p=function v(i){function m(e){var t;try{t=JSON.parse(e)}catch(i){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;ou;++u)a=o[u],t(a.oit)&&a.shaderProgram.id===a.oit.shaderProgramId||(a.oit={colorRenderState:y(e,c,a.renderState),alphaRenderState:w(e,c,a.renderState),colorShaderProgram:S(e,c,a.shaderProgram),alphaShaderProgram:x(e,c,a.shaderProgram),shaderProgramId:a.shaderProgram.id}),s=a.oit.colorRenderState,l=a.oit.colorShaderProgram,i(a,r,c,n,s,l,m);for(n.framebuffer=e._alphaFBO,u=0;d>u;++u)a=o[u],s=a.oit.alphaRenderState,l=a.oit.alphaShaderProgram,i(a,r,c,n,s,l,m);n.framebuffer=h}function T(e,r,i,n,o){var a=r.context,s=n.framebuffer,l=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(a,n);var u=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var c=0;l>c;++c){var h=o[c];t(h.oit)&&h.shaderProgram.id===h.oit.shaderProgramId||(h.oit={translucentRenderState:_(e,a,h.renderState),translucentShaderProgram:b(e,a,h.shaderProgram),shaderProgramId:h.shaderProgram.id});var d=h.oit.translucentRenderState,m=h.oit.translucentShaderProgram;i(h,r,a,n,d,m,u)}n.framebuffer=s}var P=function(t){var r=t.floatingPointTexture&&t.depthTexture;this._translucentMRTSupport=t.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueTexture=void 0,this._accumulationTexture=void 0,this._depthTexture=void 0,this._opaqueFBO=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new n({color:new e(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new n({color:new e(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new n({color:new e(0,0,0,0),owner:this}),this._alphaClearCommand=new n({color:new e(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._translucentShaderCache={},this._alphaShaderCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0};P.prototype.update=function(e){if(this.isSupported()){var r=e.drawingBufferWidth,i=e.drawingBufferHeight,n=this._opaqueTexture,a=!t(n)||n.width!==r||n.height!==i;if(a&&p(this,e,r,i),t(this._opaqueFBO)&&!a||v(this,e)){var s,c,h=this;t(this._compositeCommand)||(s=o({defines:[this._translucentMRTSupport?"MRT":""],sources:[u]}),c={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(s,{renderState:e.createRenderState(),uniformMap:c,owner:this})),t(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(s=o({defines:["MRT"],sources:[l]}),c={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(s,{renderState:e.createRenderState(),uniformMap:c,owner:this})):this._translucentMultipassSupport&&(s=o({sources:[l]}),c={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(s,{renderState:e.createRenderState(),uniformMap:c,owner:this}),c={u_bgColor:function(){return h._alphaClearCommand.color},u_depthTexture:function(){return h._depthTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(s,{renderState:e.createRenderState(),uniformMap:c,owner:this})))}}};var A={enabled:!0,color:new e(0,0,0,0),equationRgb:c.ADD,equationAlpha:c.ADD,functionSourceRgb:h.ONE,functionDestinationRgb:h.ONE,functionSourceAlpha:h.ZERO,functionDestinationAlpha:h.ONE_MINUS_SOURCE_ALPHA},M={enabled:!0,color:new e(0,0,0,0),equationRgb:c.ADD,equationAlpha:c.ADD,functionSourceRgb:h.ONE,functionDestinationRgb:h.ONE,functionSourceAlpha:h.ONE,functionDestinationAlpha:h.ONE},D={enabled:!0,color:new e(0,0,0,0),equationRgb:c.ADD,equationAlpha:c.ADD,functionSourceRgb:h.ZERO,functionDestinationRgb:h.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:h.ZERO,functionDestinationAlpha:h.ONE_MINUS_SOURCE_ALPHA},I=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",O=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",R=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return P.prototype.executeCommands=function(e,t,r,i){return this._translucentMRTSupport?(T(this,e,t,r,i),void 0):(E(this,e,t,r,i),void 0)},P.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},P.prototype.clear=function(t,r,i){var n=r.framebuffer;r.framebuffer=this._opaqueFBO,e.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(t,r),r.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(t,r),this._translucentMultipassSupport&&(r.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(t,r)),r.framebuffer=n},P.prototype.getColorFramebuffer=function(){return this._opaqueFBO},P.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){f(this),t(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),t(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),t(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,i=this._translucentShaderCache;for(e in i)i.hasOwnProperty(e)&&t(i[e])&&i[e].destroy();this._translucentShaderCache={},i=this._alphaShaderCache;for(e in i)i.hasOwnProperty(e)&&t(i[e])&&i[e].destroy();return this._alphaShaderCache={},r(this)},P}),r("Scene/OpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Rectangle","../Core/WebMercatorTilingScheme","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,i,n){var o=e._url+n+"/"+t+"/"+i+"."+e._fileExtension,a=e._proxy;return r(a)&&(o=a.getURL(o)),o}var c=/\/$/,h=new e("MapQuest, Open Street Map and contributors, CC-BY-SA"),d=function(r){r=t(r,{});var i=t(r.url,"//a.tile.openstreetmap.org/");c.test(i)||(i+="/"),this._url=i,this._fileExtension=t(r.fileExtension,"png"),this._proxy=r.proxy,this._tileDiscardPolicy=r.tileDiscardPolicy,this._tilingScheme=new s,this._tileWidth=256,this._tileHeight=256,this._minimumLevel=t(r.minimumLevel,0),this._maximumLevel=t(r.maximumLevel,18),this._rectangle=t(r.rectangle,this._tilingScheme.rectangle);var l=this._tilingScheme.positionToTileXY(a.getSouthwest(this._rectangle),this._minimumLevel),u=this._tilingScheme.positionToTileXY(a.getNortheast(this._rectangle),this._minimumLevel),d=(Math.abs(u.x-l.x)+1)*(Math.abs(u.y-l.y)+1);if(d>4)throw new n("The imagery provider's rectangle and minimumLevel indicate that there are "+d+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new o,this._ready=!0;var m=t(r.credit,h);"string"==typeof m&&(m=new e(m)),this._credit=m};return i(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new n("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new n("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new n("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new n("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){if(!this._ready)throw new n("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new n("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new n("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(){return void 0},d.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=u(this,e,t,r);return l.loadImage(this,i)},d}),r("Scene/OrthographicFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){if(!(i(e.right)&&i(e.left)&&i(e.top)&&i(e.bottom)&&i(e.near)&&i(e.far)))throw new o("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new o("right must be greater than left.");if(e.bottom>e.top)throw new o("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new o("near must be greater than zero and less than 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};n(u.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var c=new t,h=new t,d=new t,m=new t;return u.prototype.computeCullingVolume=function(e,n,a){if(!i(e))throw new o("position is required.");if(!i(n))throw new o("direction is required.");if(!i(a))throw new o("up is required.");var s=this._cullingVolume.planes,l=this.top,u=this.bottom,f=this.right,p=this.left,v=this.near,g=this.far,_=t.cross(n,a,c),y=h;t.multiplyByScalar(n,v,y),t.add(e,y,y);var w=d;t.multiplyByScalar(_,p,w),t.add(y,w,w);var C=s[0];return i(C)||(C=s[0]=new r),C.x=_.x,C.y=_.y,C.z=_.z,C.w=-t.dot(_,w),t.multiplyByScalar(_,f,w),t.add(y,w,w),C=s[1],i(C)||(C=s[1]=new r),C.x=-_.x,C.y=-_.y,C.z=-_.z,C.w=-t.dot(t.negate(_,m),w),t.multiplyByScalar(a,u,w),t.add(y,w,w),C=s[2],i(C)||(C=s[2]=new r),C.x=a.x,C.y=a.y,C.z=a.z,C.w=-t.dot(a,w),t.multiplyByScalar(a,l,w),t.add(y,w,w),C=s[3],i(C)||(C=s[3]=new r),C.x=-a.x,C.y=-a.y,C.z=-a.z,C.w=-t.dot(t.negate(a,m),w),C=s[4],i(C)||(C=s[4]=new r),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-t.dot(n,y),t.multiplyByScalar(n,g,w),t.add(e,w,w),C=s[5],i(C)||(C=s[5]=new r),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-t.dot(t.negate(n,m),w),this._cullingVolume},u.prototype.getPixelSize=function(t,r,n){if(l(this),!i(t))throw new o("drawingBufferDimensions is required.");if(t.x<=0)throw new o("drawingBufferDimensions.x must be greater than zero.");if(t.y<=0)throw new o("drawingBufferDimensions.y must be greater than zero.");var a=this.right-this.left,s=this.top-this.bottom,u=a/t.x,c=s/t.y;return i(n)?(n.x=u,n.y=c,n):new e(u,c)},u.prototype.clone=function(e){return i(e)||(e=new u),e.left=this.left,e.right=this.right,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},u.prototype.equals=function(e){return i(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},u}),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("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/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/GeometryInstance","../Core/Math","../Core/PolygonGeometry","./EllipsoidSurfaceAppearance","./Material","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(i){i=t(i,t.EMPTY_OBJECT),this.ellipsoid=t(i.ellipsoid,a.WGS84),this._ellipsoid=void 0,this.granularity=t(i.granularity,l.RADIANS_PER_DEGREE),this._granularity=void 0,this.height=t(i.height,0),this._height=void 0,this.textureRotationAngle=t(i.textureRotationAngle,0),this._textureRotationAngle=void 0,this.show=t(i.show,!0);var n=h.fromType(h.ColorType,{color:new e(1,1,0,.5)});if(this.material=t(i.material,n),this.id=i.id,this._id=void 0,this.asynchronous=t(i.asynchronous,!0),this.debugShowBoundingVolume=t(i.debugShowBoundingVolume,!1),this._positions=void 0,this._polygonHierarchy=void 0,this._createPrimitive=!1,this._primitive=void 0,r(i.positions)&&r(i.polygonHierarchy))throw new o("Either options.positions or options.polygonHierarchy can be provided, but not both.");r(i.positions)?this.positions=i.positions:r(i.polygonHierarchy)&&this.configureFromPolygonHierarchy(i.polygonHierarchy)};return i(m.prototype,{positions:{get:function(){return this._positions},set:function(e){if(r(e)&&e.length<3)throw new o("At least three positions are required.");this._positions=e,this._polygonHierarchy=void 0,this._createPrimitive=!0}}}),m.prototype.configureFromPolygonHierarchy=function(e){this._positions=void 0,this._polygonHierarchy=e,this._createPrimitive=!0},m.prototype.update=function(e,t,i){if(!r(this.ellipsoid))throw new o("this.ellipsoid must be defined.");if(!r(this.material))throw new o("this.material must be defined.");if(this.granularity<0)throw new o("this.granularity 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 n;n=r(this._positions)?new s({geometry:u.fromPositions({positions:this._positions,height:this.height,vertexFormat:c.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}):new s({geometry:new u({polygonHierarchy:this._polygonHierarchy,height:this.height,vertexFormat:c.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}),this._primitive=new d({geometryInstances:n,appearance:new c({aboveGround:this.height>0}),asynchronous:this.asynchronous})}var a=this._primitive;a.debugShowBoundingVolume=this.debugShowBoundingVolume,a.appearance.material=this.material,a.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/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(e,t){if(!e.contains(t))throw new o("primitive is not in this collection.");return e._primitives.indexOf(t)}var s=function(r){r=t(r,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(r.show,!0),this.destroyPrimitives=t(r.destroyPrimitives,!0)};return i(s.prototype,{length:{get:function(){return this._primitives.length}}}),s.prototype.add=function(e){if(!r(e))throw new o("primitive is required.");var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},s.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},s.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,r=0;t>r;++r)e[r].destroy();this._primitives=[]},s.prototype.contains=function(e){return!!(r(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},s.prototype.raise=function(e){if(r(e)){var t=a(this,e),i=this._primitives;if(t!==i.length-1){var n=i[t];i[t]=i[t+1],i[t+1]=n}}},s.prototype.raiseToTop=function(e){if(r(e)){var t=a(this,e),i=this._primitives;t!==i.length-1&&(i.splice(t,1),i.push(e))}},s.prototype.lower=function(e){if(r(e)){var t=a(this,e),i=this._primitives;if(0!==t){var n=i[t];i[t]=i[t-1],i[t-1]=n}}},s.prototype.lowerToBottom=function(e){if(r(e)){var t=a(this,e),i=this._primitives;0!==t&&(i.splice(t,1),i.unshift(e))}},s.prototype.get=function(e){if(!r(e))throw new o("index is required.");return this._primitives[e]},s.prototype.update=function(e,t,r){if(this.show)for(var i=this._primitives,n=i.length,o=0;n>o;++o)i[o].update(e,t,r)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(),n(this)},s}),r("Scene/RectanglePrimitive",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/GeometryInstance","../Core/Math","../Core/Rectangle","../Core/RectangleGeometry","./EllipsoidSurfaceAppearance","./Material","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(r){r=t(r,t.EMPTY_OBJECT),this.ellipsoid=t(r.ellipsoid,o.WGS84),this._ellipsoid=void 0,this.rectangle=l.clone(r.rectangle),this._rectangle=void 0,this.granularity=t(r.granularity,s.RADIANS_PER_DEGREE),this._granularity=void 0,this.height=t(r.height,0),this._height=void 0,this.rotation=t(r.rotation,0),this._rotation=void 0,this.textureRotationAngle=t(r.textureRotationAngle,0),this._textureRotationAngle=void 0,this.show=t(r.show,!0);var i=h.fromType(h.ColorType,{color:new e(1,1,0,.5)});this.material=t(r.material,i),this.id=r.id,this._id=void 0,this.asynchronous=t(r.asynchronous,!0),this.debugShowBoundingVolume=t(r.debugShowBoundingVolume,!1),this._primitive=void 0};return m.prototype.update=function(e,t,i){if(!r(this.ellipsoid))throw new n("this.ellipsoid must be defined.");if(!r(this.material))throw new n("this.material must be defined.");if(this.granularity<0)throw new n("this.granularity must be greater than zero.");if(this.show&&r(this.rectangle)){if(!l.equals(this._rectangle,this.rectangle)||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._rectangle=l.clone(this.rectangle,this._rectangle),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 o=new a({geometry:new u({rectangle:this.rectangle,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 d({geometryInstances:o,appearance:new c({aboveGround:this.height>0}),asynchronous:this.asynchronous})}var s=this._primitive;s.appearance.material=this.material,s.debugShowBoundingVolume=this.debugShowBoundingVolume,s.update(e,t,i)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i(this)},m}),r("Scene/RectangularPyramidSensorVolume",["../Core/clone","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix4","./CustomSensorVolume","./Material"],function(e,t,r,i,n,o,a,s,l,u){"use strict"; var c=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.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._pickPrimitive=r(n._pickPrimitive,this),this._customSensor=new l(o)};return c.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.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)},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._customSensor=this._customSensor&&this._customSensor.destroy(),n(this)},c}),r("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/Math","../Core/Matrix4","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../ThirdParty/Tween","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p){"use strict";function v(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas);var r=function(){e._morphCancelled=!0,t(e)};e._completeMorph=r,e._morphHandler.setInputAction(r,c.LEFT_DOWN),e._morphHandler.setInputAction(r,c.MIDDLE_DOWN),e._morphHandler.setInputAction(r,c.RIGHT_DOWN),e._morphHandler.setInputAction(r,c.WHEEL)}}function g(e){for(var t=e._scene.animations,r=0;rx&&(S=0);var E=(x-S)*r;if(Ee)return 0;var r=25*(1-t);return Math.exp(-r*e)}function b(t){return e.equalsEpsilon(t.startPosition,t.endPosition,m.EPSILON14)}function S(r,i,o,a,s,l,u){var c=l[u];n(c)||(c=l[u]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var h=r.getButtonPressTime(i,o),d=r.getButtonReleaseTime(i,o),m=h&&d&&(d.getTime()-h.getTime())/1e3,f=new Date,p=d&&(f.getTime()-d.getTime())/1e3;if(h&&d&&W>m){var v=C(p,a);if(c.active)c.startPosition=e.clone(c.endPosition,c.startPosition),c.endPosition=e.multiplyByScalar(c.motion,v,c.endPosition),c.endPosition=e.add(c.startPosition,c.endPosition,c.endPosition),c.motion=t.clone(e.ZERO,c.motion);else{var g=r.getLastMovement(i,o);if(!n(g)||b(g))return;c.motion.x=.5*(g.endPosition.x-g.startPosition.x),c.motion.y=.5*(g.endPosition.y-g.startPosition.y),c.startPosition=e.clone(g.startPosition,c.startPosition),c.endPosition=e.multiplyByScalar(c.motion,v,c.endPosition),c.endPosition=e.add(c.startPosition,c.endPosition,c.endPosition),c.active=!0}if(isNaN(c.endPosition.x)||isNaN(c.endPosition.y)||b(c))return c.active=!1,void 0;r.isButtonDown(i,o)||s(l,c)}else c.active=!1}function x(e,t,r,i,o,a){if(n(r)){var s=e._aggregator;h(r)||(G[0]=r,r=G);for(var l=r.length,u=0;l>u;++u){var c=r[u],d=n(c.eventType)?c.eventType:c,m=c.modifier,f=s.isMoving(d,m)&&s.getMovement(d,m);e.enableInputs&&t&&(f?i(e,f):1>o&&S(s,d,m,o,i,e,a))}}}function E(e,t,r,i,o){var a=1;n(o)&&(a=m.clamp(Math.abs(o),.25,1));var s=e.minimumZoomDistance*a,l=e.maximumZoomDistance,u=i-s,c=r*u;c=m.clamp(c,e._minimumZoomRate,e._maximumZoomRate);var h=t.endPosition.y-t.startPosition.y,d=h/e._canvas.clientHeight;d=Math.min(d,e.maximumMovementRatio);var f=c*d;f>0&&Math.abs(i-s)<1||0>f&&Math.abs(i-l)<1||(s>i-f?f=i-s-1:i-f>l&&(f=i-l),e._camera.zoomIn(f))}function T(e,r){var i=e._camera,n=i.getPickRay(r.startPosition,H).origin,o=i.getPickRay(r.endPosition,j).origin,a=i.position,s=t.subtract(n,a,Y),l=t.subtract(o,a,X),u=t.subtract(s,l,Y),c=t.magnitude(u);c>0&&(t.normalize(u,u),i.move(u,c))}function P(e,t){n(t.distance)&&(t=t.distance),E(e,t,e._zoomFactor,e._camera.getMagnitude())}function A(t,r){if(n(r.angleAndHeight))return M(t,r.angleAndHeight),void 0;var i=t._canvas.clientWidth,o=t._canvas.clientHeight,a=Z;a.x=2/i*r.startPosition.x-1,a.y=2/o*(o-r.startPosition.y)-1,a=e.normalize(a,a);var s=J;s.x=2/i*r.endPosition.x-1,s.y=2/o*(o-r.endPosition.y)-1,s=e.normalize(s,s);var l=m.acosClamped(a.x);a.y<0&&(l=m.TWO_PI-l);var u=m.acosClamped(s.x);s.y<0&&(u=m.TWO_PI-u);var c=u-l;t._camera.twistRight(c)}function M(e,t){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),rm.EPSILON6&&(t.normalize(d,d),i.move(d,p))}function O(e,r){n(r.angleAndHeight)&&(r=r.angleAndHeight);var i=rt;i.x=e._canvas.clientWidth/2,i.y=e._canvas.clientHeight/2;var o=e._camera.getPickRay(i,it),a=t.UNIT_X,s=o.origin,u=o.direction,c=-t.dot(a,s)/t.dot(a,u),h=t.multiplyByScalar(u,c,nt);t.add(s,h,h);var d=e._camera._projection,m=d.ellipsoid;t.fromElements(h.y,h.z,h.x,h);var f=d.unproject(h,at);m.cartographicToCartesian(f,h);var p=v.eastNorthUpToFixedFrame(h,m,ot),g=e._ellipsoid;e.ellipsoid=l.UNIT_SPHERE,B(e,r,p,t.UNIT_Z),e.ellipsoid=g}function R(e,r){n(r.distance)&&(r=r.distance);var i=st;i.x=e._canvas.clientWidth/2,i.y=e._canvas.clientHeight/2;var o=e._camera.getPickRay(i,lt),a=t.UNIT_X,s=o.origin,l=o.direction,u=-t.dot(a,s)/t.dot(a,l);E(e,r,e._zoomFactor,u)}function L(e){if(f.equals(f.IDENTITY,e._camera.transform)){var t=e._animations;if(e._aggregator.anyButtonDown()&&t.removeAll(),x(e,e.enableTilt,e.tiltEventTypes,O,e.inertiaSpin,"_lastInertiaTiltMovement"),x(e,e.enableTranslate,e.translateEventTypes,I,e.inertiaTranslate,"_lastInertiaTranslateMovement"),x(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),x(e,e.enableLook,e.lookEventTypes,q),!(e._aggregator.anyButtonDown()||n(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||n(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||t.contains(e._animation))){var r=e._camera.createCorrectPositionAnimation(e.bounceAnimationTime);n(r)&&(e._animation=t.add(r))}t.update()}else x(e,e.enableRotate,e.rotateEventTypes,B,e.inertiaSpin,"_lastInertiaSpinMovement"),x(e,e.enableZoom,e.zoomEventTypes,z,e.inertiaZoom,"_lastInertiaZoomMovement")}function N(e,t){n(e._camera.pickEllipsoid(t.startPosition,e._ellipsoid,ut))?F(e,t):B(e,t)}function B(e,r,i,o,a){var s=e._camera,l=s.constrainedAxis;n(o)&&(s.constrainedAxis=o);var u=t.magnitude(s.position),c=e._rotateFactor*(u-e._rotateRateRangeAdjustment);c>e._maximumRotateRate&&(c=e._maximumRotateRate),c0&&E>0||0>x&&0>E?-1:1;x=Math.abs(x);var P=v;v=S*(v*x-T*p*(1-b)),p=S*(p*b+T*P*(1-x))}}if(s.rotateRight(p,i),s.rotateUp(v,i),n(a)){var A=t.clone(s.directionWC,ct),M=f.inverseTransformation(i,mt);A=f.multiplyByPointAsVector(M,A,A);var D=-t.dot(A,o),I=Math.acos(D);I>a&&(I-=a,s.rotateUp(-I,i))}s.constrainedAxis=l}function F(e,r){var i=e._camera,o=i.pickEllipsoid(r.startPosition,e._ellipsoid,ft),a=i.pickEllipsoid(r.endPosition,e._ellipsoid,pt);if(n(o)&&n(a))if(o=i.worldToCameraCoordinates(o,o),a=i.worldToCameraCoordinates(a,a),n(i.constrainedAxis)){var s=i.constrainedAxis,l=t.mostOrthogonalAxis(s,vt,wt);t.cross(l,s,l),t.normalize(l,l);var u=t.cross(s,l,gt),c=t.magnitude(o),h=t.dot(s,o),d=Math.acos(h/c),f=t.multiplyByScalar(s,h,_t);t.subtract(o,f,f),t.normalize(f,f);var p=t.magnitude(a),v=t.dot(s,a),g=Math.acos(v/p),_=t.multiplyByScalar(s,v,yt);t.subtract(a,_,_),t.normalize(_,_);var y=Math.acos(t.dot(f,l));t.dot(f,u)<0&&(y=m.TWO_PI-y);var w=Math.acos(t.dot(_,l));t.dot(_,u)<0&&(w=m.TWO_PI-w);var C,b=y-w;C=t.equalsEpsilon(s,i.position,m.EPSILON2)?i.right:t.cross(s,i.position,vt);var S,x=t.cross(s,C,vt),E=t.dot(x,t.subtract(o,s,gt)),T=t.dot(x,t.subtract(a,s,gt));S=E>0&&T>0?g-d:E>0&&0>=T?t.dot(i.position,s)>0?-d-g:d+g:d-g,i.rotateRight(b),i.rotateUp(S)}else{t.normalize(o,o),t.normalize(a,a);var P=t.dot(o,a),A=t.cross(o,a,vt);if(1>P&&!t.equalsEpsilon(A,t.ZERO,m.EPSILON14)){var M=Math.acos(P);i.rotate(A,M)}}}function z(e,r){n(r.distance)&&(r=r.distance);var i=e._camera,o=e._ellipsoid,a=o.cartesianToCartographic(i.position).height,s=t.normalize(i.position,Ct);E(e,r,e._zoomFactor,a,t.dot(s,i.direction))}function V(e,r){n(r.angleAndHeight)&&(r=r.angleAndHeight);var i=e._camera,o=e._ellipsoid,a=.25*e.minimumZoomDistance,s=o.cartesianToCartographic(i.positionWC).height;if(!(s-a-1c&&(u=Math.acos(c)),u=r.startPosition.x>r.endPosition.x?-u:u;var h=e._horizontalRotationAxis;n(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,Mt).direction,l=i.getPickRay(a,Dt).direction,u=0,c=t.dot(s,l),1>c&&(u=Math.acos(c)),u=r.startPosition.y>r.endPosition.y?-u:u,i.lookUp(u)}function k(e){x(e,e.enableRotate,e.rotateEventTypes,N,e.inertiaSpin,"_lastInertiaSpinMovement"),x(e,e.enableZoom,e.zoomEventTypes,z,e.inertiaZoom,"_lastInertiaZoomMovement"),x(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),x(e,e.enableLook,e.lookEventTypes,q)}var U=function(e,t){if(!n(e))throw new s("canvas is required.");if(!n(t))throw new s("camera is required.");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.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:d.CTRL}],this.lookEventTypes={eventType:y.LEFT_DRAG,modifier:d.SHIFT},this._canvas=e,this._camera=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._animations=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=u};o(U.prototype,{ellipsoid:{get:function(){return this._ellipsoid},set:function(e){if(!n(e))throw new s("ellipsoid is required");var t=e.maximumRadius;this._ellipsoid=e,this._rotateFactor=1/t,this._rotateRateRangeAdjustment=t}}});var W=.4,G=[],H=new p,j=new p,Y=new t,X=new t,Z=new e,J=new e,Q=new p,K=new p,$=new t,et=new t,tt=new t,rt=new e,it=new p,nt=new t,ot=new f,at=new i,st=new e,lt=new p,ut=new t,ct=t.clone(t.ZERO),ht=new t,dt=new t,mt=new f,ft=r.clone(r.UNIT_W),pt=r.clone(r.UNIT_W),vt=new t,gt=new t,_t=new t,yt=new t,wt=new t,Ct=new t,bt=new e,St=new p,xt=new i,Et=r.clone(r.UNIT_W),Tt=new f,Pt=new e,At=new e,Mt=new p,Dt=new p;return U.prototype.update=function(e){e===w.SCENE2D?D(this):e===w.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,L(this)):e===w.SCENE3D&&(this._horizontalRotationAxis=void 0,k(this)),this._aggregator.reset()},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){return this._animations.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(),a(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/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/RenderbufferFormat","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_){"use strict";var y=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 d,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new d,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t};y.prototype.clear=function(e,t){var r=this._clearFBO1Command;i.clone(n(t,i.BLACK),r.color),r.execute(e),r=this._clearFBO2Command,i.clone(n(t,i.BLACK),r.color),r.execute(e)},y.prototype.execute=function(e,t){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.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var w=new e,C=new e,b=new r,S=new t,x=new t,E=new l;return y.prototype.update=function(e){var r=e.drawingBufferWidth,n=e.drawingBufferHeight,a=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new i}),this._clearFBO2Command=new h({color:new i});var d,y={};this._downSampleCommand=e.createViewportQuadCommand(_,{renderState:d,uniformMap:y,owner:this}),y={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=e.createViewportQuadCommand(v,{renderState:d,uniformMap:y,owner:this});var T=1,P=2;y={delta:function(){return T},sigma:function(){return P},direction:function(){return 0}},this._blurXCommand=e.createViewportQuadCommand(g,{renderState:d,uniformMap:y,owner:this}),y={delta:function(){return T},sigma:function(){return P},direction:function(){return 1}},this._blurYCommand=e.createViewportQuadCommand(g,{renderState:d,uniformMap:y,owner:this}),y={u_center:function(){return a._uCenter},u_radius:function(){return a._uRadius}},this._blendCommand=e.createViewportQuadCommand(p,{renderState:d,uniformMap:y,owner:this}),y={},this._fullScreenCommand=e.createViewportQuadCommand(_,{renderState:d,uniformMap:y,owner:this})}var A=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))-2),M=Math.pow(2,Math.ceil(Math.log(n)/Math.log(2))-2),D=Math.max(A,M),I=w;I.width=r,I.height=n;var O=C;O.width=D,O.height=D;var R=this._fbo,L=o(R)&&R.getColorTexture(0)||void 0;if(!o(L)||L.width!==r||L.height!==n){R=R&&R.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/D;var N=[e.createTexture2D({width:r,height:n})];R=this._fbo=e.depthTexture?e.createFramebuffer({colorTextures:N,depthTexture:e.createTexture2D({width:r,height:n,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:m.UNSIGNED_SHORT})}):e.createFramebuffer({colorTextures:N,depthRenderbuffer:e.createRenderbuffer({format:f.DEPTH_COMPONENT16})}),this._downSampleFBO1=e.createFramebuffer({colorTextures:[e.createTexture2D({width:D,height:D})]}),this._downSampleFBO2=e.createFramebuffer({colorTextures:[e.createTexture2D({width:D,height:D})]}),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 B=e.createRenderState({viewport:O}),F=e.createRenderState();this._downSampleCommand.uniformMap.u_texture=function(){return R.getColorTexture(0)},this._downSampleCommand.renderState=B,this._brightPassCommand.uniformMap.u_texture=function(){return a._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=B,this._blurXCommand.uniformMap.u_texture=function(){return a._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return a._blurStep},this._blurXCommand.renderState=B,this._blurYCommand.uniformMap.u_texture=function(){return a._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return a._blurStep},this._blurYCommand.renderState=B,this._blendCommand.uniformMap.u_texture0=function(){return R.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return a._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=F,this._fullScreenCommand.uniformMap.u_texture=function(){return R.getColorTexture(0)},this._fullScreenCommand.renderState=F}var z=e.uniformState,V=z.sunPositionWC,q=z.view,k=z.viewProjection,U=z.projection,W=l.computeViewportTransformation(I,0,1,E),G=l.multiplyByPoint(q,V,b),H=c.pointToWindowCoordinates(k,W,V,S);G.x+=s.SOLAR_RADIUS;var j=c.pointToWindowCoordinates(U,W,G,G),Y=2*30*t.magnitude(t.subtract(j,H,j)),X=x;X.x=Y,X.y=Y;var Z=this._upSamplePassState.scissorTest.rectangle;return Z.x=Math.max(H.x-.5*X.x,0),Z.y=Math.max(H.y-.5*X.y,0),Z.width=Math.min(X.x,r),Z.height=Math.min(X.y,n),this._uCenter=t.clone(H,this._uCenter),this._uRadius=.5*Math.max(X.x,X.y),W=l.computeViewportTransformation(O,0,1,E),H=c.pointToWindowCoordinates(k,W,V,S),X.x*=A/r,X.y*=M/n,Z=this._downSamplePassState.scissorTest.rectangle,Z.x=Math.max(H.x-.5*X.x,0),Z.y=Math.max(H.y-.5*X.y,0),Z.width=Math.min(X.x,r),Z.height=Math.min(X.y,n),this._downSamplePassState.context=e,this._upSamplePassState.context=e,this._fbo},y.prototype.isDestroyed=function(){return!1},y.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.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},y}),r("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Renderer/ClearCommand","../Renderer/Context","../Renderer/PassState","./AnimationCollection","./Camera","./CreditDisplay","./CullingVolume","./FrameState","./FrustumCommands","./FXAA","./OIT","./OrthographicFrustum","./Pass","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./SunPostProcess"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I,O,R,L,N,B,F,z,V,q,k,U,W,G,H,j,Y){"use strict";function X(e){var t=e.globe;if(e.mode===W.SCENE3D&&s(t)){var r=t.ellipsoid;return gt.radius=r.minimumRadius,vt=b.fromBoundingSphere(gt,e._camera.positionWC,vt)}return void 0}function Z(e){e.render=!1,e.pick=!1}function J(e,t,r){var i=e._camera,n=e._frameState;n.mode=e.mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=_.clone(r,n.time),n.camera=i,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),n.occluder=X(e),n.afterRender.length=0,Z(n.passes)}function Q(e,t,r,i,n){n.length=i;for(var o=0;i>o;++o){var a=Math.max(e,Math.pow(r,o)*e),l=Math.min(t,r*a),u=n[o];s(u)?(u.near=a,u.far=l):u=n[o]=new O(a,l)}}function K(e,t,r){e.debugShowFrustums&&(t.debugOverlappingFrustums=0);for(var i=e._frustumCommandsList,n=i.length,o=0;n>o;++o){var a=i[o],l=a.near,u=a.far;if(!(r.start>u)){if(r.stoph;++h)u[h].opaqueIndex=0,u[h].translucentIndex=0;var d,m=Number.MAX_VALUE,f=Number.MIN_VALUE,p=!1;e._frameState.mode===W.SCENE3D&&(d=e._frameState.occluder);for(var g=_t.planes,_=0;5>_;++_)g[_]=n.planes[_];n=_t;for(var y=r.length,w=0;y>w;++w){var C=r[w],b=C.pass;if(b===B.OVERLAY)i.push(C);else{var S=C.boundingVolume;if(s(S)){if(C.cull&&(n.getVisibility(S)===v.OUTSIDE||s(d)&&!d.isBoundingSphereVisible(S)))continue;yt=t.getPlaneDistances(S,l,a,yt),m=Math.min(m,yt.start),f=Math.max(f,yt.stop)}else yt.start=o.frustum.near,yt.stop=o.frustum.far,p=!(C instanceof x);K(e,C,yt)}}p?(m=o.frustum.near,f=o.frustum.far):(m=Math.min(Math.max(m,o.frustum.near),o.frustum.far),f=Math.max(Math.min(f,o.frustum.far),m));var E=e.farToNearRatio,T=Math.ceil(Math.log(f/m)/Math.log(E));m!==Number.MAX_VALUE&&(T!==c||0!==u.length&&(mu[c-1].far))&&(Q(m,f,E,T,u),$(e))}function et(e){var t={},r=e.vertexAttributes;for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i].index);return t}function tt(e,t,r){var i=t.context,o=a(r,e.shaderProgram),l=o.fragmentShaderSource,u=l.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_Debug_main()"),c="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){s(e._debugColor)||(e._debugColor=n.fromRandom());var h=e._debugColor;c+=" gl_FragColor.rgb *= vec3("+h.red+", "+h.green+", "+h.blue+"); \n"}if(t.debugShowFrustums){var d=1&e.debugOverlappingFrustums?"1.0":"0.0",m=2&e.debugOverlappingFrustums?"1.0":"0.0",f=4&e.debugOverlappingFrustums?"1.0":"0.0";c+=" gl_FragColor.rgb *= vec3("+d+", "+m+", "+f+"); \n"}c+="}";var p=u+"\n"+c,v=et(o);return i.createShaderProgram(o.vertexShaderSource,p,v)}function rt(e,t,r,i,n){if(s(e.shaderProgram)||s(n)){var o=tt(e,t,n);e.execute(t.context,r,i,o),o.destroy()}}function it(e,t,r,n,a,l,u){if((!s(t.debugCommandFilter)||t.debugCommandFilter(e))&&(t.debugShowCommands||t.debugShowFrustums?rt(e,t,n,a,l):e.execute(r,n,a,l),e.debugShowBoundingVolume&&s(e.boundingVolume))){s(t._debugSphere)&&t._debugSphere.destroy();var c=t._frameState,d=e.boundingVolume,m=d.radius,v=d.center,g=p.toWireframe(h.createGeometry(new h({radii:new i(m,m,m),vertexFormat:z.FLAT_VERTEX_FORMAT})));if(c.mode!==W.SCENE3D){v=w.multiplyByPoint(wt,v);var _=c.mapProjection,y=_.unproject(v);v=_.ellipsoid.cartographicToCartesian(y)}t._debugSphere=new k({geometryInstances:new f({geometry:g,modelMatrix:w.multiplyByTranslation(w.IDENTITY,v),attributes:{color:new o(1,0,0,1)}}),appearance:new z({flat:!0,translucent:!1}),asynchronous:!1});var C=[];t._debugSphere.update(r,c,C);var b;s(u)&&(b=n.framebuffer,n.framebuffer=u),C[0].execute(r,n),s(b)&&(n.framebuffer=b)}}function nt(e,t){if(s(e)){for(var r=t.mode===W.SCENE3D?t.occluder:void 0,i=t.cullingVolume,n=_t.planes,o=0;5>o;++o)n[o]=i.planes[o];i=_t;var a=e.boundingVolume;return s(e)&&(!s(e.boundingVolume)||!e.cull||i.getVisibility(a)!==v.OUTSIDE&&(!s(r)||r.isBoundingSphereVisible(a)))}}function ot(e,r,i){return t.distanceSquaredTo(r.boundingVolume,i)-t.distanceSquaredTo(e.boundingVolume,i)}function at(e,t,r,i){var n=e.context;C(i,ot,e._camera.positionWC);for(var o=i.length,a=0;o>a;++a)t(i[a],e,n,r)}function st(e,t,r,i){var o,a=e._frameState,l=e._camera,u=e.context,c=u.uniformState;o=s(l.frustum.fovy)?l.frustum.clone(Ct):s(l.frustum.infiniteProjectionMatrix)?l.frustum.clone(bt):l.frustum.clone(St),s(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom?e._sunPostProcess=new Y:s(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!s(e.sun)&&s(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var h=a.passes.render&&s(e.skyBox)?e.skyBox.update(u,a):void 0,d=a.passes.render&&s(e.skyAtmosphere)?e.skyAtmosphere.update(u,a):void 0,m=a.passes.render&&s(e.sun)?e.sun.update(e):void 0,f=nt(m,a),p=e._clearColorCommand;n.clone(r,p.color),p.execute(u,t);var v,g=!1,_=e._frustumCommandsList,y=_.length;for(v=0;y>v;++v)if(_[v].translucentIndex>0){g=!0;break}var w=!i&&g&&e._oit.isSupported();w&&(e._oit.update(u),e._oit.clear(u,t,r),w=w&&e._oit.isSupported());var C=!i&&(e.fxaa||w&&e.fxaaOrderIndependentTranslucency);C&&(e._fxaa.update(u),e._fxaa.clear(u,t,r));var b=t.framebuffer;w?b=e._oit.getColorFramebuffer():C&&(b=e._fxaa.getColorFramebuffer()),t.framebuffer=f&&e.sunBloom?e._sunPostProcess.update(u):b,o.near=l.frustum.near,o.far=l.frustum.far,c.updateFrustum(o),s(h)&&it(h,e,u,t),s(d)&&it(d,e,u,t),s(m)&&f&&(m.execute(u,t),e.sunBloom&&(e._sunPostProcess.execute(u,b),t.framebuffer=b));var S,x=e._depthClearCommand;for(w?(s(e._executeOITFunction)||(e._executeOITFunction=function(e,t,r,i){e._oit.executeCommands(e,t,r,i)}),S=e._executeOITFunction):S=at,v=0;y>v;++v){var E=y-v-1,T=_[E];o.near=T.near,o.far=T.far,0!==E&&(o.near*=.99),c.updateFrustum(o),x.execute(u,t);for(var P=T.opaqueCommands,A=T.opaqueIndex,M=0;A>M;++M)it(P[M],e,u,t);o.near=T.near,c.updateFrustum(o),P=T.translucentCommands,P.length=T.translucentIndex,S(e,it,t,P)}w&&(t.framebuffer=C?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(u,t)),C&&(t.framebuffer=void 0,e._fxaa.execute(u,t))}function lt(e,t){for(var r=e.context,i=e._overlayCommandList,n=i.length,o=0;n>o;++o)i[o].execute(r,t)}function ut(e){var t=e.context,r=e._frameState,i=e._commandList;e._globe&&e._globe.update(t,r,i),e._primitives.update(t,r,i),s(e.moon)&&e.moon.update(t,r,i)}function ct(e){for(var t=e.afterRender,r=0,i=t.length;i>r;++r)t[r]();t.length=0}function ht(e,t){s(t)||(t=_.now()),e._preRender.raiseEvent(e,t);var r=e.context.uniformState,i=e._frameState,o=y.incrementWrap(i.frameNumber,15e6,1);J(e,o,t),i.passes.render=!0,i.creditDisplay.beginFrame();var l=e.context;r.update(l,i),e._commandList.length=0,e._overlayCommandList.length=0,ut(e),$(e);var u=e._passState;if(st(e,u,a(e.backgroundColor,n.BLACK)),lt(e,u),i.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!s(e._performanceDisplay)){var c=document.createElement("div");c.style.position="absolute",c.style.top="10px",c.style.left="10px";var h=e._canvas.parentNode;h.appendChild(c);var d=new F({container:c});e._performanceDisplay=d,e._performanceContainer=c}e._performanceDisplay.update()}else s(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));l.endFrame(),ct(i),e._postRender.raiseEvent(e,t)}function dt(e,t){var r=e._camera,n=r.frustum,o=e.drawingBufferWidth,a=e.drawingBufferHeight,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.clone(r.position,Et);i.multiplyByScalar(r.right,s,Tt),i.add(Tt,u,u),i.multiplyByScalar(r.up,l,Tt),i.add(Tt,u,u),i.fromElements(u.z,u.x,u.y,u),Pt.x=o,Pt.y=a;var c=n.getPixelSize(Pt,void 0,At),h=xt;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,r.directionWC,r.upWC)}function mt(e,t,r,i){var n=e._camera,o=n.frustum,a=o.near,s=e.drawingBufferWidth,l=e.drawingBufferHeight,u=Math.tan(.5*o.fovy),c=o.aspectRatio*u,h=2/s*t.x-1,d=2/l*(l-t.y)-1,m=h*a*c,f=d*a*u;Pt.x=s,Pt.y=l;var p=o.getPixelSize(Pt,void 0,At),v=.5*p.x*r,g=.5*p.y*i,_=Mt;return _.top=f+g,_.bottom=f-g,_.right=m+v,_.left=m-v,_.near=a,_.far=o.far,_.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function ft(e,t,r,i){return e.mode===W.SCENE2D?dt(e,t,r,i):mt(e,t,r,i)}var pt=function(e){e=a(e,a.EMPTY_OBJECT);var t=e.canvas,r=e.contextOptions,i=e.creditContainer;if(!s(t))throw new c("options and options.canvas are required.");var o=new E(t,r);s(i)||(i=document.createElement("div"),i.style.position="absolute",i.style.bottom="0",i.style["text-shadow"]="0px 0px 2px #000000",i.style.color="#ffffff",i.style["font-size"]="10px",i.style["padding-right"]="5px",t.parentNode.appendChild(i)),this._frameState=new I(new M(i)),this._passState=new T(o),this._canvas=t,this._context=o,this._globe=void 0,this._primitives=new U,this._pickFramebuffer=void 0,this._animations=new P,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._commandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._oit=new L(o),this._executeOITFunction=void 0,this._fxaa=new R,this._clearColorCommand=new x({color:new n,owner:this}),this._depthClearCommand=new x({depth:1,owner:this}),this._transitioner=new H(this),this._renderError=new d,this._preRender=new d,this._postRender=new d,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new d,this.morphComplete=new d,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=n.clone(n.BLACK),this.mode=W.SCENE3D,this._mapProjection=a(e.mapProjection,new m),this.morphTime=1,this.farToNearRatio=1e3,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.fxaaOrderIndependentTranslucency=!0,this.fxaa=!1,this._performanceDisplay=void 0,this._debugSphere=void 0;var l=new A(this);this._camera=l,this._screenSpaceCameraController=new j(t,l);var u=l.frustum.near,h=l.frustum.far,f=Math.ceil(Math.log(h/u)/Math.log(this.farToNearRatio));Q(u,h,this.farToNearRatio,f,this._frustumCommandsList),J(this,0,_.now()),this.initializeFrame()};l(pt.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return this._context.maximumAliasedLineWidth}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},animations:{get:function(){return this._animations}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}}});var vt,gt=new t,_t=new D,yt=new g,wt=w.inverseTransformation(new w(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1)),Ct=new V,bt=new q,St=new N;pt.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._animations.update(),this._camera.update(this.mode),this._screenSpaceCameraController.update(this.mode)},pt.prototype.render=function(e){try{ht(this,e)}catch(t){if(this._renderError.raiseEvent(this,t),this.rethrowRenderErrors)throw t}};var xt=new N,Et=new i,Tt=new i,Pt=new r,At=new r,Mt=new q,Dt=3,It=3,Ot=new e(0,0,Dt,It),Rt=new n(0,0,0,0),Lt=new r;return pt.prototype.pick=function(e){if(!s(e))throw new c("windowPosition is undefined.");var t=this._context,r=t.uniformState,i=this._frameState,n=G.transformWindowToDrawingBuffer(this,e,Lt);s(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),J(this,i.frameNumber,i.time),i.cullingVolume=ft(this,n,Dt,It),i.passes.pick=!0,r.update(t,i),this._commandList.length=0,ut(this),$(this),Ot.x=n.x-.5*(Dt-1),Ot.y=this.drawingBufferHeight-n.y-.5*(It-1),st(this,this._pickFramebuffer.begin(Ot),Rt,!0);var o=this._pickFramebuffer.end(Ot);return t.endFrame(),ct(i),o},pt.prototype.drillPick=function(e){if(!s(e))throw new c("windowPosition is undefined.");for(var t=[],r=this.pick(e);s(r)&&s(r.primitive);){var i=r.primitive;if(t.push(r),s(i.show))i.show=!1;else if("function"==typeof i.getGeometryInstanceAttributes){var n=i.getGeometryInstanceAttributes(r.id);s(n)&&s(n.show)&&(n.show=S.toValue(!1))}r=this.pick(e)}for(var o=0;or;++r)e[r].destroy();this._sensors=[]},s.prototype.contains=function(e){return e?-1!==this._sensors.indexOf(e):!1},s.prototype.get=function(t){if(!e(t))throw new i("index is required.");return this._sensors[t]},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/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(i){function h(e){C._image=e,C._tileWidth=e.width,C._tileHeight=e.height,C._ready=!0,u.handleSuccess(C._errorEvent)}function d(){var e="Failed to load image "+_+".";w=u.handleError(w,C,C._errorEvent,e,0,0,0,m)}function m(){c(s(_),h,d)}i=t(i,{});var f=i.url;if(!r(f))throw new n("url is required.");this._url=f;var p=i.proxy;this._proxy=p;var v=t(i.rectangle,l.MAX_VALUE),g=new a({rectangle:v,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1;var _=f;r(p)&&(_=p.getURL(_));var y=i.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var w,C=this;m()};return i(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new n("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new n("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new n("maximumLevel must not be called before the imagery provider is ready.");return 0}},minimumLevel:{get:function(){if(!this._ready)throw new n("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new n("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new n("tileDiscardPolicy must not be called before the imagery provider is ready.");return void 0}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),h.prototype.getTileCredits=function(){return void 0},h.prototype.requestImage=function(){if(!this._ready)throw new n("requestImage must not be called before the imagery provider is ready.");return this._image},h}),r("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"const float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(v_positionEC);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nfloat fCos = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat fRayleighPhase = 0.75 * (1.0 + fCos*fCos);\nfloat fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos*fCos) / pow(1.0 + g2 - 2.0*g*fCos, 1.5);\nconst float fExposure = 2.0;\nvec3 rgb = fRayleighPhase * v_rayleighColor + fMiePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-fExposure * rgb);\nfloat l = czm_luminance(rgb);\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 1.0, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),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,n},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.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),n(this)},g}),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("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("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p){"use strict";var v=function(e){this.sources=e.sources,this._sources=void 0,this.show=r(e.show,!0),this._command=new c({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0};return v.prototype.update=function(r,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 s=this.sources;if(!(i(s.positiveX)&&i(s.negativeX)&&i(s.positiveY)&&i(s.negativeY)&&i(s.positiveZ)&&i(s.negativeZ)))throw new o("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof s.positiveX!=typeof s.negativeX||typeof s.positiveX!=typeof s.positiveY||typeof s.positiveX!=typeof s.negativeY||typeof s.positiveX!=typeof s.positiveZ||typeof s.positiveX!=typeof s.negativeZ)throw new o("this.sources properties must all be the same type.");"string"==typeof s.positiveX?h(r,this._sources).then(function(e){v._cubeMap=v._cubeMap&&v._cubeMap.destroy(),v._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=r.createCubeMap({source:s}))}var c=this._command;if(!i(c.vertexArray)){var v=this;c.uniformMap={u_cubeMap:function(){return v._cubeMap}};var g=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),_=a.createAttributeLocations(g);c.vertexArray=r.createVertexArrayFromGeometry({geometry:g,attributeLocations:_,bufferUsage:u.STATIC_DRAW}),c.shaderProgram=r.createShaderProgram(m,d,_),c.renderState=r.createRenderState({blending:f.ALPHA_BLEND}) }return i(this._cubeMap)?c:void 0},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},v}),r("Scene/StencilFunction",[],function(){"use strict";var e={NEVER:512,LESS:513,EQUAL:514,LESS_OR_EQUAL:515,GREATER:516,NOT_EQUAL:517,GREATER_OR_EQUAL:518,ALWAYS:519};return e}),r("Scene/StencilOperation",[],function(){"use strict";var e={ZERO:0,KEEP:7680,REPLACE:7681,INCREMENT:7682,DECREMENT:7683,INVERT:5386,INCREMENT_WRAP:34055,DECREMENT_WRAP:34056};return e}),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("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("Scene/Sun",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S){"use strict";var x=function(){this.show=!0,this._command=new g({primitiveType:f.TRIANGLES,boundingVolume:new t,owner:this}),this._boundingVolume=new t,this._boundingVolume2D=new t,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 e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}};l(x.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var E=new r,T=new r,P=new n,A=new n;return x.prototype.update=function(n){var l=n.frameState,u=n.context;if(!this.show)return void 0;var f=l.mode;if(f===b.SCENE2D||f===b.MORPHING)return void 0;if(!l.passes.render)return void 0;var g=n.drawingBufferWidth,x=n.drawingBufferHeight;if(!s(this._texture)||g!==this._drawingBufferWidth||x!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=g,this._drawingBufferHeight=x,this._glowFactorDirty=!1;var M=Math.max(g,x);M=Math.pow(2,Math.ceil(Math.log(M)/Math.log(2))-2),this._texture=u.createTexture2D({width:M,height:M,pixelFormat:m.RGBA});var D=u.createFramebuffer({colorTextures:[this._texture]});D.destroyAttachments=!1;var I=new v({color:new o(0,0,0,0),framebuffer:D}),O=u.createRenderState({viewport:new e(0,0,M,M)});this._glowLengthTS=5*this._glowFactor,this._radiusTS=.5*(1/(1+2*this._glowLengthTS));var R=this,L={u_glowLengthTS:function(){return R._glowLengthTS},u_radiusTS:function(){return R._radiusTS}},N=u.createViewportQuadCommand(y,{renderState:O,uniformMap:L,framebuffer:D,owner:this});I.execute(u),N.execute(u),N.shaderProgram.destroy(),D.destroy()}var B=this._command;if(!s(B.vertexArray)){var F={direction:0},z=new Uint8Array(8);z[0]=0,z[1]=0,z[2]=255,z[3]=0,z[4]=255,z[5]=255,z[6]=0,z[7]=255;var V=u.createVertexBuffer(z,p.STATIC_DRAW),q=[{index:F.direction,vertexBuffer:V,componentsPerAttribute:2,normalize:!0,componentDatatype:a.UNSIGNED_BYTE}],k=u.createIndexBuffer(new Uint16Array([0,1,2,0,2,3]),p.STATIC_DRAW,c.UNSIGNED_SHORT);B.vertexArray=u.createVertexArray(q,k),B.shaderProgram=u.createShaderProgram(w,_,F),B.renderState=u.createRenderState({blending:C.ALPHA_BLEND}),B.uniformMap=this._uniformMap}var U=u.uniformState.sunPositionWC,W=u.uniformState.sunPositionColumbusView,G=this._boundingVolume,H=this._boundingVolume2D;i.clone(U,G.center),H.center.x=W.z,H.center.y=W.x,H.center.z=W.y,G.radius=h.SOLAR_RADIUS+h.SOLAR_RADIUS*this._glowLengthTS,H.radius=G.radius,f===b.SCENE3D?t.clone(G,B.boundingVolume):f===b.COLUMBUS_VIEW&&t.clone(H,B.boundingVolume);var j=S.computeActualWgs84Position(l,U,A),Y=i.magnitude(i.subtract(j,l.camera.position,A)),X=u.uniformState.projection,Z=P;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var J=d.multiplyByVector(X,Z,A),Q=S.clipToDrawingBufferCoordinates(n,J,E);Z.x=h.SOLAR_RADIUS;var K=d.multiplyByVector(X,Z,A),$=S.clipToDrawingBufferCoordinates(n,K,T);return this._size=Math.ceil(r.magnitude(r.subtract($,Q,A))),this._size=2*this._size*(1+2*this._glowLengthTS),B},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),u(this)},x}),r("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme"],function(e,t,r,i,n){"use strict";var o=function(r){r=t(r,{}),this._tilingScheme=t(r.tilingScheme,new n),this._color=t(r.color,e.YELLOW),this._errorEvent=new i,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256)};return r(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}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return void 0}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},credit:{get:function(){return void 0}},hasAlphaChannel:{get:function(){return!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/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadXML","../Core/Rectangle","../Core/WebMercatorTilingScheme","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t,r,n){var o=e._tilingScheme.getNumberOfYTilesAtLevel(n),a=e._url+n+"/"+t+"/"+(o-r-1)+"."+e._fileExtension,s=e._proxy;return i(s)&&(a=s.getURL(a)),a}var m=/\/$/,f=function(n){if(n=r(n,{}),!i(n.url))throw new o("options.url is required.");var h=n.url;m.test(h)||(h+="/"),this._url=h,this._ready=!1,this._proxy=n.proxy,this._tileDiscardPolicy=n.tileDiscardPolicy,this._errorEvent=new a;var d=n.credit;"string"==typeof d&&(d=new t(d)),this._credit=d;var f=this;l(h+"tilemapresource.xml").then(function(t){for(var o,a,l,h=/tileformat/i,d=/tileset/i,m=/tilesets/i,p=/boundingbox/i,v=[],g=t.childNodes[0].childNodes,_=0;_S.rectangle.east&&(f._rectangle.east=S.rectangle.east),f._rectangle.southS.rectangle.north&&(f._rectangle.north=S.rectangle.north);var E=S.positionToTileXY(u.getSouthwest(f._rectangle),f._minimumLevel),T=S.positionToTileXY(u.getNortheast(f._rectangle),f._minimumLevel),P=(Math.abs(T.x-E.x)+1)*(Math.abs(T.y-E.y)+1);P>4&&(f._minimumLevel=0),f._tilingScheme=S,f._ready=!0},function(){f._fileExtension=r(n.fileExtension,"png"),f._tileWidth=r(n.tileWidth,256),f._tileHeight=r(n.tileHeight,256),f._minimumLevel=r(n.minimumLevel,0),f._maximumLevel=r(n.maximumLevel,18),f._tilingScheme=r(n.tilingScheme,new c),f._rectangle=r(n.rectangle,f._tilingScheme.rectangle),f._ready=!0})};return n(f.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new o("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new o("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new o("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new o("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){if(!this._ready)throw new o("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new o("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new o("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),f.prototype.getTileCredits=function(){return void 0},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=d(this,e,t,r);return h.loadImage(this,i)},f}),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/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/createShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material","./Pass"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(i,n){this.show=!0,r(i)||(i=new e),this.rectangle=e.clone(i),r(n)||(n=l.fromType(l.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0};return c.prototype.update=function(t,i,l){if(this.show){if(!r(this.material))throw new n("this.material must be defined.");if(!r(this.rectangle))throw new n("this.rectangle must be defined.");var c=this._rs;r(c)&&e.equals(c.viewport,this.rectangle)||(this._rs=t.createRenderState({blending:s.ALPHA_BLEND,viewport:this.rectangle}));var h=i.passes;if(h.render){if(this._material!==this.material||!r(this._overlayCommand)){this._material=this.material,r(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var d=o({sources:[this._material.shaderSource,a]});this._overlayCommand=t.createViewportQuadCommand(d,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=u.OVERLAY}this._material.update(t),this._overlayCommand.uniformMap=this._material._uniforms,l.push(this._overlayCommand)}}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return r(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),i(this)},c}),r("Scene/WebMapServiceImageryProvider",["../Core/clone","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/Rectangle","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t,r,n){var o=e._url,a=o.indexOf("?");a>=0&&aa&&(o+="?");var s=e._parameters;for(var l in s)s.hasOwnProperty(l)&&(o+=l+"="+s[l]+"&");if(i(s.layers)||(o+="layers="+e._layers+"&"),i(s.srs)||(o+="srs=EPSG:4326&"),!i(s.bbox)){var u=e._tilingScheme.tileXYToNativeRectangle(t,r,n),c=u.west+","+u.south+","+u.east+","+u.north;o+="bbox="+c+"&"}i(s.width)||(o+="width=256&"),i(s.height)||(o+="height=256&");var h=e._proxy;return i(h)&&(o=h.getURL(o)),o}var d=function m(n){if(n=r(n,{}),!i(n.url))throw new o("options.url is required.");if(!i(n.layers))throw new o("options.layers is required.");this._url=n.url,this._tileDiscardPolicy=n.tileDiscardPolicy,this._proxy=n.proxy,this._layers=n.layers;var s=e(m.DefaultParameters);if(i(n.parameters))for(var c in n.parameters)if(n.parameters.hasOwnProperty(c)){var h=c.toLowerCase();s[h]=n.parameters[c]}this._parameters=s,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=n.maximumLevel;var d=r(n.rectangle,u.MAX_VALUE);this._tilingScheme=new l({rectangle:d});var f=n.credit;"string"==typeof f&&(f=new t(f)),this._credit=f,this._errorEvent=new a,this._ready=!0};return n(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){if(!this._ready)throw new o("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new o("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new o("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new o("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new o("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new o("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new o("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(){return void 0},d.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=h(this,e,t,r);return c.loadImage(this,i)},d.DefaultParameters=s({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),d}),r("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(u){u=t(u,t.EMPTY_OBJECT);var c=[],h=u.geometry;if(!r(h))throw new i("options.geometry is required.");r(h.attributes)&&r(h.primitiveType)||(h=h.constructor.createGeometry(h));var d=h.attributes,m=a.clone(t(u.modelMatrix,a.IDENTITY)),f=t(u.length,1e4);return r(d.normal)&&c.push(new n({geometry:o.createLineSegmentsForVectors(h,"normal",f),attributes:{color:new e(1,0,0,1)},modelMatrix:m})),r(d.binormal)&&c.push(new n({geometry:o.createLineSegmentsForVectors(h,"binormal",f),attributes:{color:new e(0,1,0,1)},modelMatrix:m})),r(d.tangent)&&c.push(new n({geometry:o.createLineSegmentsForVectors(h,"tangent",f),attributes:{color:new e(0,0,1,1)},modelMatrix:m})),c.length>0?new l({geometryInstances:c,appearance:new s({flat:!0,translucent:!1})}):void 0}return u}),function(){!function(e){var i=this||(0,eval)("this"),n=i.document,o=i.navigator,a=i.jQuery,s=i.JSON;!function(e){"function"==typeof t&&"object"==typeof exports&&"object"==typeof module?e(module.exports||exports):"function"==typeof r&&r.amd?r("ThirdParty/knockout-3.1.0",["exports"],e):e(i.ko={})}(function(t){function r(e,t){return null===e||typeof e in d?e===t:!1}function l(t,r){var i;return function(){i||(i=setTimeout(function(){i=e,t()},r))}}function u(e,t){var r;return function(){clearTimeout(r),r=setTimeout(e,t)}}function c(e,t,r,i){h.d[e]={init:function(e,n,o,a,s){var l,u;return h.ba(function(){var o=h.a.c(n()),a=!r!=!o,c=!u;(c||t||a!==l)&&(c&&h.ca.fa()&&(u=h.a.lb(h.e.childNodes(e),!0)),a?(c||h.e.U(e,h.a.lb(u)),h.gb(i?i(s,o):s,e)):h.e.da(e),l=a)},null,{G:e}),{controlsDescendantBindings:!0}}},h.g.aa[e]=!1,h.e.Q[e]=!0}var h="undefined"!=typeof t?t:{};h.b=function(e,t){for(var r=e.split("."),i=h,n=0;nr;r++)d[t[r]]=e});var m={propertychange:!0},f=n&&function(){for(var t=3,r=n.createElement("div"),i=r.getElementsByTagName("i");r.innerHTML="",i[0];);return t>4?t:e}();return{mb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],r:function(e,t){for(var r=0,i=e.length;i>r;r++)t(e[r],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},hb:function(e,t,r){for(var i=0,n=e.length;n>i;i++)if(t.call(r,e[i],i))return e[i];return null},ma:function(e,t){var r=h.a.l(e,t);r>0?e.splice(r,1):0===r&&e.shift()},ib:function(e){e=e||[];for(var t=[],r=0,i=e.length;i>r;r++)0>h.a.l(t,e[r])&&t.push(e[r]);return t},ya:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)r.push(t(e[i],i));return r},la:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)t(e[i],i)&&r.push(e[i]);return r},$: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},Y:function(e,t,r){var i=h.a.l(h.a.Sa(e),t);0>i?r&&e.push(t):r||e.splice(i,1)},na:u,extend:r,ra:l,sa:u?l:r,A:t,Oa: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},Fa:function(e){for(;e.firstChild;)h.removeNode(e.firstChild)},ec:function(e){e=h.a.R(e);for(var t=n.createElement("div"),r=0,i=e.length;i>r;r++)t.appendChild(h.M(e[r]));return t},lb:function(e,t){for(var r=0,i=e.length,n=[];i>r;r++){var o=e[r].cloneNode(!0);n.push(t?h.M(o):o)}return n},U:function(e,t){if(h.a.Fa(e),t)for(var r=0,i=t.length;i>r;r++)e.appendChild(t[r])},Bb: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++)h.removeNode(r[o])}},ea:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.shift();if(1f?e.setAttribute("selected",t):e.selected=t},ta:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},oc:function(e,t){for(var r=[],i=(e||"").split(t),n=0,o=i.length;o>n;n++){var a=h.a.ta(i[n]);""!==a&&r.push(a)}return r},kc:function(e,t){return e=e||"",t.length>e.length?!1:e.substring(0,t.length)===t},Sb: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},Ea:function(e){return h.a.Sb(e,e.ownerDocument.documentElement)},eb:function(e){return!!h.a.hb(e,h.a.Ea)},B:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},q:function(e,t,r){var i=f&&m[t];if(!i&&a)a(e).bind(t,r);else if(i||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){r.call(e,t)},o="on"+t;e.attachEvent(o,n),h.a.u.ja(e,function(){e.detachEvent(o,n)})}else e.addEventListener(t,r,!1)},ha:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var r;if("input"===h.a.B(e)&&e.type&&"click"==t.toLowerCase()?(r=e.type,r="checkbox"==r||"radio"==r):r=!1,a&&!r)a(e).trigger(t);else if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");r=n.createEvent(d[t]||"HTMLEvents"),r.initEvent(t,!0,!0,i,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(r)}else if(r&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}},c:function(e){return h.v(e)?e():e},Sa:function(e){return h.v(e)?e.o():e},ua:function(e,t,r){if(t){var i=/\S+/g,n=e.className.match(i)||[];h.a.r(t.match(i),function(e){h.a.Y(n,e,r)}),e.className=n.join(" ")}},Xa:function(t,r){var i=h.a.c(r);(null===i||i===e)&&(i="");var n=h.e.firstChild(t);!n||3!=n.nodeType||h.e.nextSibling(n)?h.e.U(t,[t.ownerDocument.createTextNode(i)]):n.data=i,h.a.Vb(t)},Cb:function(e,t){if(e.name=t,7>=f)try{e.mergeAttributes(n.createElement(""),!1)}catch(r){}},Vb:function(e){f>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Tb:function(e){if(f){var t=e.style.width;e.style.width=0,e.style.width=t}},ic:function(e,t){e=h.a.c(e),t=h.a.c(t);for(var r=[],i=e;t>=i;i++)r.push(i);return r},R:function(e){for(var t=[],r=0,i=e.length;i>r;r++)t.push(e[r]);return t},mc:6===f,nc:7===f,oa:f,ob:function(e,t){for(var r=h.a.R(e.getElementsByTagName("input")).concat(h.a.R(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},fc:function(e){return"string"==typeof e&&(e=h.a.ta(e))?s&&s.parse?s.parse(e):new Function("return "+e)():null},Ya: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(h.a.c(e),t,r)},gc:function(e,r,i){i=i||{};var o=i.params||{},a=i.includeFields||this.mb,s=e;if("object"==typeof e&&"form"===h.a.B(e))for(var s=e.action,l=a.length-1;l>=0;l--)for(var u=h.a.ob(e,a[l]),c=u.length-1;c>=0;c--)o[u[c].name]=u[c].value;r=h.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=h.a.Ya(h.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)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.r),h.b("utils.arrayFirst",h.a.hb),h.b("utils.arrayFilter",h.a.la),h.b("utils.arrayGetDistinctValues",h.a.ib),h.b("utils.arrayIndexOf",h.a.l),h.b("utils.arrayMap",h.a.ya),h.b("utils.arrayPushAll",h.a.$),h.b("utils.arrayRemoveItem",h.a.ma),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.mb),h.b("utils.getFormFields",h.a.ob),h.b("utils.peekObservable",h.a.Sa),h.b("utils.postJson",h.a.gc),h.b("utils.parseJson",h.a.fc),h.b("utils.registerEventHandler",h.a.q),h.b("utils.stringifyJson",h.a.Ya),h.b("utils.range",h.a.ic),h.b("utils.toggleDomNodeCssClass",h.a.ua),h.b("utils.triggerEvent",h.a.ha),h.b("utils.unwrapObservable",h.a.c),h.b("utils.objectForEach",h.a.A),h.b("utils.addOrRemoveItem",h.a.Y),h.b("unwrap",h.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)))}}),h.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},L:function(){return r++ +i}}},h.b("utils.domData",h.a.f),h.b("utils.domData.clear",h.a.f.clear),h.a.u=new function(){function t(t,r){var n=h.a.f.get(t,i);return n===e&&r&&(n=[],h.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){h.M(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){a&&"function"==typeof a.cleanData&&a.cleanData([e])}}},h.M=h.a.u.M,h.removeNode=h.a.u.removeNode,h.b("cleanNode",h.M),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.u),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.u.ja),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.u.Ab),function(){h.a.Qa=function(e){var t;if(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=h.a.ta(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=h.a.R(t.lastChild.childNodes)}return t},h.a.Va=function(t,r){if(h.a.Fa(t),r=h.a.c(r),null!==r&&r!==e)if("string"!=typeof r&&(r=r.toString()),a)a(t).html(r);else for(var i=h.a.Qa(r),n=0;ni;i++)t(n[i],r)}var r={};return{Na: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,""},Hb: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]}},Ib:function(e,r){var i=[];t(e,i);for(var n=0,o=i.length;o>n;n++){var a=i[n].Rb,s=[a];r&&h.a.$(s,r),h.w.Hb(i[n].cc,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},xb:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),h.b("memoization",h.w),h.b("memoization.memoize",h.w.Na),h.b("memoization.unmemoize",h.w.Hb),h.b("memoization.parseMemoText",h.w.xb),h.b("memoization.unmemoizeDomNodeAndDescendants",h.w.Ib),h.Ga={throttle:function(e,t){e.throttleEvaluation=t;var r=null;return h.h({read:e,write:function(i){clearTimeout(r),r=setTimeout(function(){e(i)},t)}})},rateLimit:function(e,t){var r,i,n;"number"==typeof t?r=t:(r=t.timeout,i=t.method),n="notifyWhenChangesStop"==i?u:l,e.Ma(function(e){return n(e,r)})},notify:function(e,t){e.equalityComparer="always"==t?null:r}};var d={undefined:1,"boolean":1,number:1,string:1};h.b("extenders",h.Ga),h.Fb=function(e,t,r){this.target=e,this.za=t,this.Qb=r,this.sb=!1,h.s(this,"dispose",this.F)},h.Fb.prototype.F=function(){this.sb=!0,this.Qb() },h.N=function(){h.a.sa(this,h.N.fn),this.H={}};var m="change";t={V:function(e,t,r){var i=this;r=r||m;var n=new h.Fb(i,t?e.bind(t):e,function(){h.a.ma(i.H[r],n)});return i.o&&i.o(),i.H[r]||(i.H[r]=[]),i.H[r].push(n),n},notifySubscribers:function(e,t){if(t=t||m,this.qb(t))try{h.k.jb();for(var r,i=this.H[t].slice(0),n=0;r=i[n];++n)r.sb||r.za(e)}finally{h.k.end()}},Ma:function(e){var t,r,i,n=this,o=h.v(n);n.ia||(n.ia=n.notifySubscribers,n.notifySubscribers=function(e,t){t&&t!==m?"beforeChange"===t?n.bb(e):n.ia(e,t):n.cb(e)});var a=e(function(){o&&i===n&&(i=n()),t=!1,n.Ka(r,i)&&n.ia(r=i)});n.cb=function(e){t=!0,i=e,a()},n.bb=function(e){t||(r=e,n.ia(e,"beforeChange"))}},qb:function(e){return this.H[e]&&this.H[e].length},Wb:function(){var e=0;return h.a.A(this.H,function(t,r){e+=r.length}),e},Ka:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&h.a.A(e,function(e,r){var i=h.Ga[e];"function"==typeof i&&(t=i(t,r)||t)}),t}},h.s(t,"subscribe",t.V),h.s(t,"extend",t.extend),h.s(t,"getSubscriptionsCount",t.Wb),h.a.na&&h.a.ra(t,Function.prototype),h.N.fn=t,h.tb=function(e){return null!=e&&"function"==typeof e.V&&"function"==typeof e.notifySubscribers},h.b("subscribable",h.N),h.b("isSubscribable",h.tb),h.ca=h.k=function(){function e(e){i.push(r),r=e}function t(){r=i.pop()}var r,i=[],n=0;return{jb:e,end:t,zb:function(e){if(r){if(!h.tb(e))throw Error("Only subscribable things can act as dependencies");r.za(e,e.Kb||(e.Kb=++n))}},t:function(r,i,n){try{return e(),r.apply(i,n||[])}finally{t()}},fa:function(){return r?r.ba.fa():void 0},pa:function(){return r?r.pa:void 0}}}(),h.b("computedContext",h.ca),h.b("computedContext.getDependenciesCount",h.ca.fa),h.b("computedContext.isInitial",h.ca.pa),h.m=function(e){function t(){return 0=0;i--)r(t[i])&&(t[i]._destroy=!0);this.O()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=h.a.l(t,e)}):[]},indexOf:function(e){var t=this();return h.a.l(t,e)},replace:function(e,t){var r=this.indexOf(e);r>=0&&(this.P(),this.o()[r]=t,this.O())}},h.a.r("pop push reverse shift sort splice unshift".split(" "),function(e){h.T.fn[e]=function(){var t=this.o();return this.P(),this.kb(t,e,arguments),t=t[e].apply(t,arguments),this.O(),t}}),h.a.r(["slice"],function(e){h.T.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),h.a.na&&h.a.ra(h.T.fn,h.m.fn),h.b("observableArray",h.T);var p="arrayChange";h.Ga.trackArrayChanges=function(e){function t(){if(!r){r=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,r){return r&&r!==m||++n,t.apply(this,arguments)};var o=[].concat(e.o()||[]);i=null,e.V(function(t){if(t=[].concat(t||[]),e.qb(p)){var r;(!i||n>1)&&(i=h.a.Aa(o,t,{sparse:!0})),r=i,r.length&&e.notifySubscribers(r,p)}o=t,i=null,n=0})}}if(!e.kb){var r=!1,i=null,n=0,o=e.V;e.V=e.subscribe=function(e,r,i){return i===p&&t(),o.apply(this,arguments)},e.kb=function(e,t,o){function a(e,t,r){return s[s.length]={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),d=[],m=[],f=2;c>t;++t,++f)l>t&&m.push(a("deleted",e[t],t)),u>t&&d.push(a("added",o[f],t));h.a.nb(m,d);break;default:return}i=s}}}},h.ba=h.h=function(e,t,r){function i(){m=!0,h.a.A(w,function(e,t){t.F()}),w={},C=0,u=!1}function n(){var e=a.throttleEvaluation;e&&e>=0?(clearTimeout(b),b=setTimeout(o,e)):a.wa?a.wa():o()}function o(){if(!c&&!m){if(_&&_()){if(!d)return y(),void 0}else d=!1;c=!0;try{var e=w,r=C;h.k.jb({za:function(t,i){m||(r&&e[i]?(w[i]=e[i],++C,delete e[i],--r):w[i]||(w[i]=t.V(n),++C))},ba:a,pa:!C}),w={},C=0;try{var i=t?f.call(t):f()}finally{h.k.end(),r&&h.a.A(e,function(e,t){t.F()}),u=!1}a.Ka(l,i)&&(a.notifySubscribers(l,"beforeChange"),l=i,a.wa&&!a.throttleEvaluation||a.notifySubscribers(l))}finally{c=!1}C||y()}}function a(){if(00}var l,u=!0,c=!1,d=!1,m=!1,f=e;if(f&&"object"==typeof f?(r=f,f=r.read):(r=r||{},f||(f=r.read)),"function"!=typeof f)throw Error("Pass a function that returns the value of the ko.computed");var p=r.write,v=r.disposeWhenNodeIsRemoved||r.G||null,g=r.disposeWhen||r.Da,_=g,y=i,w={},C=0,b=null;t||(t=r.owner),h.N.call(a),h.a.sa(a,h.h.fn),a.o=function(){return u&&!C&&o(),l},a.fa=function(){return C},a.Yb="function"==typeof r.write,a.F=function(){y()},a.ga=s;var S=a.Ma;return a.Ma=function(e){S.call(a,e),a.wa=function(){a.bb(l),u=!0,a.cb(a)}},h.s(a,"peek",a.o),h.s(a,"dispose",a.F),h.s(a,"isActive",a.ga),h.s(a,"getDependenciesCount",a.fa),v&&(d=!0,v.nodeType&&(_=function(){return!h.a.Ea(v)||g&&g()})),!0!==r.deferEvaluation&&o(),v&&s()&&v.nodeType&&(y=function(){h.a.u.Ab(v,y),i()},h.a.u.ja(v,y)),a},h.$b=function(e){return h.Ha(e,h.h)},t=h.m.hc,h.h[t]=h.m,h.h.fn={equalityComparer:r},h.h.fn[t]=h.h,h.a.na&&h.a.ra(h.h.fn,h.N.fn),h.b("dependentObservable",h.h),h.b("computed",h.h),h.b("isComputed",h.$b),function(){function t(n,o,a){if(a=a||new i,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),r(n,function(r){var i=o(n[r]);switch(typeof i){case"boolean":case"number":case"string":case"function":s[r]=i;break;case"object":case"undefined":var l=a.get(i);s[r]=l!==e?l:t(i,o,a)}}),s}function r(e,t){if(e instanceof Array){for(var r=0;rt;t++)e=e();return e})},h.toJSON=function(e,t,r){return e=h.Gb(e),h.a.Ya(e,t,r)},i.prototype={save:function(e,t){var r=h.a.l(this.keys,e);r>=0?this.ab[r]=t:(this.keys.push(e),this.ab.push(t))},get:function(t){return t=h.a.l(this.keys,t),t>=0?this.ab[t]:e}}}(),h.b("toJS",h.Gb),h.b("toJSON",h.toJSON),function(){h.i={p:function(t){switch(h.a.B(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?h.a.f.get(t,h.d.options.Pa):7>=h.a.oa?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?h.i.p(t.options[t.selectedIndex]):e;default:return t.value}},X:function(t,r,i){switch(h.a.B(t)){case"option":switch(typeof r){case"string":h.a.f.set(t,h.d.options.Pa,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=r;break;default:h.a.f.set(t,h.d.options.Pa,r),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof r?r:""}break;case"select":(""===r||null===r)&&(r=e);for(var n,o=-1,a=0,s=t.options.length;s>a;++a)if(n=h.i.p(t.options[a]),n==r||""==n&&r===e){o=a;break}(i||o>=0||r===e&&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&&c&&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};h.e={Q:{},childNodes:function(t){return e(t)?r(t):t.childNodes},da:function(t){if(e(t)){t=h.e.childNodes(t);for(var r=0,i=t.length;i>r;r++)h.removeNode(t[r])}else h.a.Fa(t)},U:function(t,r){if(e(t)){h.e.da(t);for(var i=t.nextSibling,n=0,o=r.length;o>n;n++)i.parentNode.insertBefore(r[n],i)}else h.a.U(t,r)},yb:function(t,r){e(t)?t.parentNode.insertBefore(r,t.nextSibling):t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},rb:function(t,r,i){i?e(t)?t.parentNode.insertBefore(r,i.nextSibling):i.nextSibling?t.insertBefore(r,i.nextSibling):t.appendChild(r):h.e.yb(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},Xb:e,lc:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},wb:function(r){if(l[h.a.B(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=h.a.oa&&r in v?(r=v[r],n?t.removeAttribute(r):t[r]=i):n||t.setAttribute(r,i.toString()),"name"===r&&h.a.Cb(t,n?"":i.toString())})}},function(){h.d.checked={after:["value","attr"],init:function(t,r,i){function n(){return i.has("checkedValue")?h.a.c(i.get("checkedValue")):t.value}function o(){var e=t.checked,o=d?n():e;if(!h.ca.pa()&&(!l||e)){var a=h.k.t(r);u?c!==o?(e&&(h.a.Y(a,o,!0),h.a.Y(a,c,!1)),c=o):h.a.Y(a,o,e):h.g.va(a,i,"checked",o,!0)}}function a(){var e=h.a.c(r());t.checked=u?0<=h.a.l(e,n()):s?e:n()===e}var s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=s&&h.a.c(r())instanceof Array,c=u?n():e,d=l||u;l&&!t.name&&h.d.uniqueName.init(t,function(){return!0}),h.ba(o,null,{G:t}),h.a.q(t,"click",o),h.ba(a,null,{G:t})}}},h.g.W.checked=!0,h.d.checkedValue={update:function(e,t){e.value=h.a.c(t())}}}(),h.d.css={update:function(e,t){var r=h.a.c(t());"object"==typeof r?h.a.A(r,function(t,r){r=h.a.c(r),h.a.ua(e,t,r)}):(r=String(r||""),h.a.ua(e,e.__ko__cssValue,!1),e.__ko__cssValue=r,h.a.ua(e,r,!0))}},h.d.enable={update:function(e,t){var r=h.a.c(t());r&&e.disabled?e.removeAttribute("disabled"):r||e.disabled||(e.disabled=!0)}},h.d.disable={update:function(e,t){h.d.enable.update(e,function(){return!h.a.c(t())})}},h.d.event={init:function(e,t,r,i,n){var o=t()||{};h.a.A(o,function(o){"string"==typeof o&&h.a.q(e,o,function(e){var a,s=t()[o];if(s){try{var l=h.a.R(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())}})})}},h.d.foreach={vb:function(e){return function(){var t=e(),r=h.a.Sa(t);return r&&"number"!=typeof r.length?(h.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:h.K.Ja}):{foreach:t,templateEngine:h.K.Ja}}},init:function(e,t){return h.d.template.init(e,h.d.foreach.vb(t))},update:function(e,t,r,i,n){return h.d.template.update(e,h.d.foreach.vb(t),r,i,n)}},h.g.aa.foreach=!1,h.e.Q.foreach=!0,h.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(),h.g.va(n,r,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var n=i.bind(null,!0),o=i.bind(null,!1);h.a.q(e,"focus",n),h.a.q(e,"focusin",n),h.a.q(e,"blur",o),h.a.q(e,"focusout",o)},update:function(e,t){var r=!!h.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===r||(r?e.focus():e.blur(),h.k.t(h.a.ha,null,[e,r?"focusin":"focusout"]))}},h.g.W.hasfocus=!0,h.d.hasFocus=h.d.hasfocus,h.g.W.hasFocus=!0,h.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){h.a.Va(e,t())}},c("if"),c("ifnot",!1,!0),c("with",!0,!1,function(e,t){return e.createChildContext(t)});var g={};h.d.options={init:function(e){if("select"!==h.a.B(e))throw Error("options binding applies only to SELECT elements");for(;0","#comment",n)})},Mb:function(e,t){return h.w.Na(function(r,i){var n=r.nextSibling;n&&n.nodeName.toLowerCase()===t&&h.xa(n,e,i)})}}}(),h.b("__tr_ambtns",h.Za.Mb),function(){h.n={},h.n.j=function(e){this.j=e},h.n.j.prototype.text=function(){var e=h.a.B(this.j),e="script"===e?"text":"textarea"===e?"value":"innerHTML";if(0==arguments.length)return this.j[e];var t=arguments[0];"innerHTML"===e?h.a.Va(this.j,t):this.j[e]=t};var t=h.a.f.L()+"_";h.n.j.prototype.data=function(e){return 1===arguments.length?h.a.f.get(this.j,t+e):(h.a.f.set(this.j,t+e,arguments[1]),void 0)};var r=h.a.f.L();h.n.Z=function(e){this.j=e},h.n.Z.prototype=new h.n.j,h.n.Z.prototype.text=function(){if(0==arguments.length){var t=h.a.f.get(this.j,r)||{};return t.$a===e&&t.Ba&&(t.$a=t.Ba.innerHTML),t.$a}h.a.f.set(this.j,r,{$a:arguments[0]})},h.n.j.prototype.nodes=function(){return 0==arguments.length?(h.a.f.get(this.j,r)||{}).Ba:(h.a.f.set(this.j,r,{Ba:arguments[0]}),void 0)},h.b("templateSources",h.n),h.b("templateSources.domElement",h.n.j),h.b("templateSources.anonymousTemplate",h.n.Z)}(),function(){function t(e,t,r){var i;for(t=h.e.nextSibling(t);e&&(i=e)!==t;)e=h.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=h.J.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),h.a.ea(e,o))}t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||h.fb(r,e)}),t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||h.w.Ib(e,[r])}),h.a.ea(e,o)}}function i(e){return e.nodeType?e:0i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),i=o=0;break}i+=o}}},h.a.Aa=function(){function e(e,t,r,i,n){var o,a,s,l,u,c=Math.min,d=Math.max,m=[],f=e.length,p=t.length,v=p-f||1,g=f+p+1;for(o=0;f>=o;o++)for(l=s,m.push(s=[]),u=c(p,o+v),a=d(0,o-1);u>=a;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],d=[],v=[],o=f,a=p;o||a;)p=m[o][a]-1,a&&p===m[o][a-1]?d.push(c[c.length]={status:r,value:t[--a],index:a}):o&&p===m[o-1][a]?v.push(c[c.length]={status:i,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return h.a.nb(d,v,10*f),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)}}(),h.b("utils.compareArrays",h.a.Aa),function(){function t(t,r,i,n,o){var a=[],s=h.h(function(){var e=r(i,o,h.a.ea(a,t))||[];0r;r++)t[r]&&h.a.r(t[r].S,function(i){e(i,r,t[r].ka)})}n=n||[],a=a||{};var c=h.a.f.get(i,r)===e,d=h.a.f.get(i,r)||[],m=h.a.ya(d,function(e){return e.ka}),f=h.a.Aa(m,n,a.dontLimitMoves),p=[],v=0,g=0,_=[],y=[];n=[];for(var w,C,b,S=[],m=[],x=0;C=f[x];x++)switch(b=C.moved,C.status){case"deleted":b===e&&(w=d[v],w.h&&w.h.F(),_.push.apply(_,h.a.ea(w.S,i)),a.beforeRemove&&(n[x]=w,y.push(w))),v++;break;case"retained":l(x,v++);break;case"added":b!==e?l(x,b):(w={ka:C.value,Ia:h.m(g++)},p.push(w),y.push(w),c||(m[x]=w))}u(a.beforeMove,S),h.a.r(_,a.beforeRemove?h.M:h.removeNode);for(var E,x=0,c=h.e.firstChild(i);w=y[x];x++){for(w.S||h.a.extend(w,t(i,o,w.ka,s,w.Ia)),v=0;f=w.S[v];c=f.nextSibling,E=f,v++)f!==c&&h.e.rb(i,f,E);!w.Zb&&s&&(s(w.ka,w.S,w.Ia),w.Zb=!0)}u(a.beforeRemove,n),u(a.afterMove,S),u(a.afterAdd,m),h.a.f.set(i,r,p)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.Ua),h.K=function(){this.allowTemplateRewriting=!1},h.K.prototype=new h.C,h.K.prototype.renderTemplateSource=function(e){var t=(9>h.a.oa?0:e.nodes)?e.nodes():null;return t?h.a.R(t.cloneNode(!0).childNodes):(e=e.text(),h.a.Qa(e))},h.K.Ja=new h.K,h.Wa(h.K.Ja),h.b("nativeTemplateEngine",h.K),function(){h.La=function(){var e=this.ac=function(){if(!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:"} "})},h.La.prototype=new h.C;var e=new h.La;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 f(e,t){var r=e._viewModel,i=r.shuttleRingDragging;if(!i||p===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 f=r.shuttleRingAngle;i||nc.left&&o>c.top&&om?r.slower():m>f&&r.faster(),t.preventDefault()}else p=void 0,r.shuttleRingDragging=!1}var p,v="http://www.w3.org/2000/svg",g="http://www.w3.org/1999/xlink",_=e.fromCssColorString("rgba(247,250,255,0.384)"),y=e.fromCssColorString("rgba(143,191,255,0.216)"),w=e.fromCssColorString("rgba(153,197,255,0.098)"),C=e.fromCssColorString("rgba(255,255,255,0.086)"),b=e.fromCssColorString("rgba(255,255,255,0.267)"),S=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),E=e.fromCssColorString("rgba(0,0,0,0.5)"),T=new e,P=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)]};P.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,r=e.length;r>t;t++)e[t].dispose();i(this)},P.prototype.isDestroyed=function(){return!1},P.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")}},P.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")))},P.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};var A=function(e,r){if(!t(e))throw new n("container is required.");if(!t(r))throw new n("viewModel is required.");e=o(e),this._viewModel=r,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 i=document.createElement("style");i.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(i,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",g);var p=document.createElementNS(v,"g");this._topG=p,this._realtimeSVG=new P(m(3,4,"#animation_pathClock"),r.playRealtimeViewModel),this._playReverseSVG=new P(d(44,99,"#animation_pathPlayReverse"),r.playReverseViewModel),this._playForwardSVG=new P(d(124,99,"#animation_pathPlay"),r.playForwardViewModel),this._pauseSVG=new P(d(84,99,"#animation_pathPause"),r.pauseViewModel);var _=document.createElementNS(v,"g");_.appendChild(this._realtimeSVG.svgElement),_.appendChild(this._playReverseSVG.svgElement),_.appendChild(this._playForwardSVG.svgElement),_.appendChild(this._pauseSVG.svgElement);var y=l({tagName:"circle","class":"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=y;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 b=61,S=l({tagName:"circle","class":"cesium-animation-knobInner",cx:0,cy:0,r:b});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var x=l({tagName:"circle","class":"cesium-animation-blank",cx:0,cy:0,r:b}),E=document.createElementNS(v,"g");E.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(s),p.appendChild(E),p.appendChild(C),p.appendChild(_),E.appendChild(y),E.appendChild(w),E.appendChild(this._shuttleRingPointer),C.appendChild(this._knobOuter),C.appendChild(S),C.appendChild(this._knobDate),C.appendChild(this._knobTime),C.appendChild(this._knobStatus),C.appendChild(x),h.appendChild(p),e.appendChild(h);var T=this,A=function(e){f(T,e)};this._mouseCallback=A,y.addEventListener("mousedown",A,!0),y.addEventListener("touchstart",A,!0),w.addEventListener("mousedown",A,!0),w.addEventListener("touchstart",A,!0),document.addEventListener("mousemove",A,!0),document.addEventListener("touchmove",A,!0),document.addEventListener("mouseup",A,!0),document.addEventListener("touchend",A,!0),this._shuttleRingPointer.addEventListener("mousedown",A,!0),this._shuttleRingPointer.addEventListener("touchstart",A,!0),this._knobOuter.addEventListener("mousedown",A,!0),this._knobOuter.addEventListener("touchstart",A,!0);var M,D=this._knobTime.childNodes[0],I=this._knobDate.childNodes[0],O=this._knobStatus.childNodes[0];this._subscriptions=[a(r.pauseViewModel,"toggled",function(e){M!==e&&(M=e,M?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){D.textContent!==e&&(D.textContent=e)}),a(r,"multiplierLabel",function(e){O.textContent!==e&&(O.textContent=e)})],this.applyThemeChanges(),this.resize()};return r(A.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),A.prototype.isDestroyed=function(){return!1},A.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,r=0,n=t.length;n>r;r++)t[r].dispose();return i(this)},A.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}},A.prototype.applyThemeChanges=function(){var e=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(e,_)},{tagName:"stop",offset:"12%","stop-color":h(e,y)},{tagName:"stop",offset:"46%","stop-color":h(e,w)},{tagName:"stop",offset:"81%","stop-color":h(e,C)}]},{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,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,_)},{tagName:"stop",offset:"12%","stop-color":h(i,y)},{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,b)},{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,E)},{tagName:"stop",offset:"100%","stop-color":h(a,E)}]},{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,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"}]});t(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},A}),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/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e){e.clockStep===r.SYSTEM_CLOCK&&(e.clockStep=r.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=1)}function d(e){h(e),e.shouldAnimate=!0}function m(e,t){return e-t}function f(t,r){var i=e(r,t,m);return 0>i?~i:i}function p(e,t){if(Math.abs(e)<=_)return e/_;var r,i,n=_,o=y,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 v(e,t,i){if(i.clockStep===r.SYSTEM_CLOCK)return _;if(Math.abs(e)<=1)return e*_;var n,o,a=_,s=y,l=0;return e>0?(n=Math.log(t[t.length-1]),o=(n-l)/(s-a),(Math.log(e)-l)/o+a):(n=Math.log(-t[0]),o=(n-l)/(s-a),-((Math.log(Math.abs(e))-l)/o+a))}var g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_=15,y=105,w=function(e){if(!i(e))throw new o("clockViewModel is required.");var n=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=w.defaultDateFormatter,this._timeFormatter=w.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(w.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return n._timeFormatter(n._clockViewModel.currentTime,n)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return n._dateFormatter(n._clockViewModel.currentTime,n)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=n._clockViewModel;if(e.clockStep===r.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return 0===t%1?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return v(e.multiplier,n._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,y),-y);var t=n._allShuttleRingTicks,i=n._clockViewModel;if(i.clockStep=r.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===y)return i.multiplier=e>0?t[t.length-1]:t[0],void 0;var o=p(e,t);if(n.snapToTicks)o=t[f(o,t)];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>_?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}i.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=n._clockViewModel,r=e.clockRange;if(n.shuttleRingDragging||r===t.UNBOUNDED)return!0;var i=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(r===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&i>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&i>0||o.equals(u)&&0>i}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=n._clockViewModel,r=e.clockRange;if(r===t.UNBOUNDED)return!0;var i=e.systemTime;return a.greaterThanOrEquals(i,e.startTime)&&a.lessThanOrEquals(i,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return n._clockViewModel.shouldAnimate&&(n._canAnimate||n.shuttleRingDragging)});var l=u(function(){var e=n._clockViewModel;e.shouldAnimate?(h(e),e.shouldAnimate=!1):n._canAnimate&&d(e)});this._pauseViewModel=new c(l,{toggled:s.computed(function(){return!n._isAnimating}),tooltip:"Pause"});var m=u(function(){var e=n._clockViewModel;h(e);var t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(m,{toggled:s.computed(function(){return n._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var g=u(function(){var e=n._clockViewModel;h(e);var t=e.multiplier;0>t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(g,{toggled:s.computed(function(){return n._isAnimating&&e.multiplier>0&&e.clockStep!==r.SYSTEM_CLOCK}),tooltip:"Play Forward"});var C=u(function(){var e=n._clockViewModel;e.clockStep=r.SYSTEM_CLOCK,e.multiplier=1,e.shouldAnimate=!0},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(C,{toggled:s.computed(function(){return e.shouldAnimate&&e.clockStep===r.SYSTEM_CLOCK}),tooltip:s.computed(function(){return n._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=n._clockViewModel;h(e);var t=n._allShuttleRingTicks,r=e.multiplier,i=f(r,t)-1;i>=0&&(e.multiplier=t[i])}),this._faster=u(function(){var e=n._clockViewModel;h(e);var t=n._allShuttleRingTicks,r=e.multiplier,i=f(r,t)+1;it;++t)n=e[t],a.hasOwnProperty(n)||(a[n]=!0,s.push(n));s.sort(m);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(w.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}}}),w._maxShuttleRingAngle=y,w._realtimeShuttleRingAngle=_,w}),r("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){r=e(r,e.EMPTY_OBJECT);var l=r.globe,u=e(r.imageryProviderViewModels,[]),c=e(r.terrainProviderViewModels,[]);if(!t(l))throw new i("globe is required");this._globe=l,this.imageryProviderViewModels=u.slice(0),this.terrainProviderViewModels=c.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,r=this.selectedTerrain,i=t(e)?e.name:void 0,n=t(r)?r.name:void 0;return t(i)&&t(n)?i+"\n"+n:t(i)?i:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var h=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return h()},set:function(e){if(h()===e)return this.dropDownVisible=!1,void 0;var r,i=this._currentImageryProviders,n=i.length,a=this._globe.imageryLayers;for(r=0;n>r;r++)for(var s=a.length,l=0;s>l;l++){var u=a.get(l);if(u.imageryProvider===i[r]){a.remove(u);break}}if(t(e)){var c=e.creationCommand();if(o(c)){var d=c.length;for(r=d-1;r>=0;r--)a.addImageryProvider(c[r],0);this._currentImageryProviders=c.slice(0)}else this._currentImageryProviders=[c],a.addImageryProvider(c,0)}h(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var d=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(e){if(d()===e)return this.dropDownVisible=!1,void 0;var r;t(e)&&(r=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(r instanceof n),this._globe.terrainProvider=r,d(e),this.dropDownVisible=!1}});var m=this;this._toggleDropDown=s(function(){m.dropDownVisible=!m.dropDownVisible}),this.selectedImagery=e(r.selectedImageryProviderViewModel,u[0]),this.selectedTerrain=e(r.selectedTerrainProviderViewModel,c[0])};return r(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),r("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r){if(!e(t))throw new i("container is required.");t=o(t);var s=new a(r),l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button",l.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),t.appendChild(l);var u=document.createElement("img");u.setAttribute("draggable","false"),u.className="cesium-baseLayerPicker-selected",u.setAttribute("data-bind","attr: { src: buttonImageUrl }"),l.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-dropDown",c.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),t.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),h.innerHTML="Imagery",c.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: imageryProviderViewModels"),c.appendChild(d);var m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),d.appendChild(m);var f=document.createElement("img");f.className="cesium-baseLayerPicker-itemIcon",f.setAttribute("data-bind","attr: { src: iconUrl }"),f.setAttribute("draggable","false"),m.appendChild(f);var p=document.createElement("div");p.className="cesium-baseLayerPicker-itemLabel",p.setAttribute("data-bind","text: name"),m.appendChild(p);var v=document.createElement("div");v.className="cesium-baseLayerPicker-sectionTitle",v.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),v.innerHTML="Terrain",c.appendChild(v);var g=document.createElement("div");g.className="cesium-baseLayerPicker-choices",g.setAttribute("data-bind","foreach: terrainProviderViewModels"),c.appendChild(g);var _=document.createElement("div");_.className="cesium-baseLayerPicker-item",_.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),g.appendChild(_);var y=document.createElement("img");y.className="cesium-baseLayerPicker-itemIcon",y.setAttribute("data-bind","attr: { src: iconUrl }"),y.setAttribute("draggable","false"),_.appendChild(y);var w=document.createElement("div");w.className="cesium-baseLayerPicker-itemLabel",w.setAttribute("data-bind","text: name"),_.appendChild(w),n.applyBindings(s,l),n.applyBindings(s,c),this._viewModel=s,this._container=t,this._element=l,this._dropPanel=c,this._closeDropDown=function(e){l.contains(e.target)||c.contains(e.target)||(s.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),n.cleanNode(this._element),n.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),r(this)},s}),r("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";var o=function(t){if(!e(t.name))throw new r("options.name is required.");if(!e(t.tooltip))throw new r("options.tooltip is required.");if(!e(t.iconUrl))throw new r("options.iconUrl is required.");if("function"!=typeof t.creationFunction)throw new r("options.creationFunction is required.");var o=t.creationFunction;e(o.canExecute)||(o=n(o)),this._creationCommand=o,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,i.track(this,["name","tooltip","iconUrl"])};return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),r("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/OpenStreetMapImageryProvider","../../Scene/TileMapServiceImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(){var s=[];return s.push(new a({name:"Bing Maps Aerial",iconUrl:e("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 a({name:"Bing Maps Aerial with Labels",iconUrl:e("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 a({name:"Bing Maps Roads",iconUrl:e("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 a({name:"ESRI World Imagery",iconUrl:e("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 t({url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"})}})),s.push(new a({name:"ESRI World Street Map",iconUrl:e("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 t({url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"})}})),s.push(new a({name:"ESRI National Geographic",iconUrl:e("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 t({url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/"})}})),s.push(new a({name:"Open�Street�Map",iconUrl:e("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 n({url:"//a.tile.openstreetmap.org/"})}})),s.push(new a({name:"Stamen Watercolor",iconUrl:e("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 n({url:"//stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),s.push(new a({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return new n({url:"//stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),s.push(new a({name:"MapQuest Open�Street�Map",iconUrl:e("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 n({url:"//otile1-s.mqcdn.com/tiles/1.0.0/osm/"})}})),s.push(new a({name:"The Black Marble",iconUrl:e("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 o({url:"//cesiumjs.org/blackmarble",maximumLevel:8,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),s.push(new a({name:"Natural Earth�II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return new o({url:e("Assets/Textures/NaturalEarthII")})}})),s}return s}),r("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i){"use strict";function n(){var n=[];return n.push(new i({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new r}})),n.push(new i({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"//cesiumjs.org/stk-terrain/tilesets/world/tiles"})}})),n.push(new i({name:"Small Terrain heightmaps with water",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"Medium-resolution, heightmap-based terrain for the entire globe. This tileset also includes a water mask. Free for use on the Internet.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"//cesiumjs.org/smallterrain",credit:"Terrain data courtesy Analytical Graphics, Inc."})}})),n}return n}),r("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Rectangle","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(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 h=new e(.15,.15,.15,.75),d=document.createElement("div");d.className="cesium-cesiumInspector-performanceDisplay";var m=function(e){if(!t(e))throw new i("scene is required");var r=this,c=e.canvas;c.parentNode.appendChild(d),this._scene=e,this._canvas=c,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0;var m=this._scene.globe;m.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=u(function(){r.dropDownVisible=!r.dropDownVisible}),this._toggleGeneral=u(function(){r.generalVisible=!r.generalVisible,r.generalSwitchText=r.generalVisible?"-":"+"}),this._togglePrimitives=u(function(){r.primitivesVisible=!r.primitivesVisible,r.primitivesSwitchText=r.primitivesVisible?"-":"+"}),this._toggleTerrain=u(function(){r.terrainVisible=!r.terrainVisible,r.terrainSwitchText=r.terrainVisible?"-":"+"}),this._showFrustums=u(function(){return r._scene.debugShowFrustums=r.frustums?!0:!1,!0}),this._showPerformance=u(function(){return r.performance?r._performanceDisplay=new a({container:d,backgroundColor:h,font:"12px arial,sans-serif"}):d.innerHTML="",!0}),this._showPrimitiveBoundingSphere=u(function(){return r._primitive.debugShowBoundingVolume=r.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=u(function(){if(r.primitiveReferenceFrame){var e=r._primitive.modelMatrix;r._modelMatrixPrimitive=new o({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=u(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=u(function(){return m._surface._debug.wireframe=r.wireframe,!0}),this._doSuspendUpdates=u(function(){return m._surface._debug.suspendLodUpdate=r.suspendUpdates,r.suspendUpdates||(r.filterTile=!1),!0});var f;this._showTileCoordinates=u(function(){return r.tileCoordinates&&!t(f)?f=e.imageryLayers.addImageryProvider(new s({tilingScheme:e.terrainProvider.tilingScheme})):!r.tileCoordinates&&t(f)&&(e.imageryLayers.remove(f),f=void 0),!0}),this._showTileBoundingSphere=u(function(){return m._surface._debug.boundingSphereTile=r.tileBoundingSphere?r._tile:void 0,!0}),this._doFilterTile=u(function(){if(r.filterTile){if(r.suspendUpdates=!0,r.doSuspendUpdates(),m._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}m._surface._tilesToRenderByTextureCount[e]=[r._tile],m._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=u(function(){r.pickPrimitiveActive=!r.pickPrimitiveActive,r.pickPrimitiveActive?r._canvas.addEventListener("mousedown",p,!1):r._canvas.removeEventListener("mousedown",p,!1)});var v=function(e){var i,o=m.ellipsoid,a=r._scene.camera.pickEllipsoid({x:e.clientX,y:e.clientY},o);if(t(a))for(var s=o.cartesianToCartographic(a),l=m._surface._tilesToRenderByTextureCount,u=0;!i&&un&&(e.resize(),e.render(),e._lastFrameTime=a-s%n),d(t)}else e.resize(),e.render(),d(t)}else e._renderLoopRunning=!1}e._renderLoopRunning=!0,e._lastFrameTime=h(),d(t)}var E="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",T=function(e,a){if(!o(e))throw new l("container is required.");e=b(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s),this._element=s;try{var c=document.createElement("canvas");c.oncontextmenu=function(){return!1},c.onselectstart=function(){return!1},s.appendChild(c);var h=document.createElement("div");h.className="cesium-widget-credits";var d=o(a.creditContainer)?b(a.creditContainer):s;d.appendChild(h);var x=new g({canvas:c,contextOptions:a.contextOptions,creditContainer:h,mapProjection:a.mapProjection});x.camera.constrainedAxis=t.UNIT_Z;var T=u.WGS84,P=x.frameState.creditDisplay,A=new i("Cesium",E,"http://cesiumjs.org/");P.addDefaultCredit(A);var M=new p(T);x.globe=M;var D=a.skyBox;o(D)||(D=new w({sources:{positiveX:S("px"),negativeX:S("mx"),positiveY:S("py"),negativeY:S("my"),positiveZ:S("pz"),negativeZ:S("mz")}})),x.skyBox=D,x.skyAtmosphere=new y(T),x.sun=new C,x.moon=new v;var I=a.imageryProvider;o(I)||(I=new f({url:"//dev.virtualearth.net"})),I!==!1&&x.imageryLayers.addImageryProvider(I),o(a.terrainProvider)&&(x.terrainProvider=a.terrainProvider),this._container=e,this._canvas=c,this._canvasWidth=0,this._canvasHeight=0,this._scene=x,this._globe=M,this._clock=n(a.clock,new r),this._screenSpaceEventHandler=new m(c),this._useDefaultRenderLoop=void 0,this._renderLoopRunning=!1,this._creditContainer=h,this._canRender=!1,this._showRenderLoopErrors=n(a.showRenderLoopErrors,!0),this._resolutionScale=1,this._forceResize=!1,this._lastFrameTime=void 0,this._targetFrameRate=void 0,o(a.sceneMode)&&(a.sceneMode===_.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===_.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this.targetFrameRate=a.targetFrameRate;var O=this;x.renderError.addEventListener(function(e,t){if(O._useDefaultRenderLoop=!1,O._renderLoopRunning=!1,O._showRenderLoopErrors){var r="An error occurred while rendering. Rendering has stopped.",i='This may indicate an incompatibility with your hardware or web browser, or it may indicate a bug in the application. Visit http://get.webgl.org to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';O.showErrorPanel(r,i,t)}})}catch(R){var L="Error constructing CesiumWidget.",N='Visit http://get.webgl.org to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';throw this.showErrorPanel(L,N,R),R}};return a(T.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){if(0>=e)throw new l("targetFrameRate must be greater than 0.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&x(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(0>=e)throw new l("resolutionScale must be greater than 0.");this._resolutionScale=e,this._forceResize=!0}}}),T.prototype.showErrorPanel=function(e,t,r){var i=this._element,n=document.createElement("div");n.className="cesium-widget-errorPanel";var a=document.createElement("div");a.className="cesium-widget-errorPanel-content",n.appendChild(a);var s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-scroll",a.appendChild(l);var u=function(){l.style.maxHeight=Math.max(Math.round(.9*i.clientHeight-100),30)+"px"};u(),o(window.addEventListener)&&window.addEventListener("resize",u,!1);var h=document.createElement("div");h.className="cesium-widget-errorPanel-message",h.innerHTML="

"+t+"

",l.appendChild(h);var d="(no error details available)";o(r)&&(d=c(r));var m=document.createElement("div");m.className="cesium-widget-errorPanel-message",m.appendChild(document.createTextNode(d)),l.appendChild(m);var f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(f);var p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){o(u)&&o(window.removeEventListener)&&window.removeEventListener("resize",u,!1),i.removeChild(n)},f.appendChild(p),i.appendChild(n),console.error(e+"\n"+t+"\n"+d)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},T.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,r=e.clientHeight;if(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==r){this._forceResize=!1;var i=n(window.devicePixelRatio,1)*this._resolutionScale;this._canvasWidth=t,this._canvasHeight=r,t*=i,r*=i,e.width=t,e.height=r;var a=0!==t&&0!==r;if(this._canRender=a,a){var s=this._scene.camera.frustum;o(s.aspectRatio)?s.aspectRatio=t/r:(s.top=s.right*(r/t),s.bottom=-s.top)}}},T.prototype.render=function(){this._scene.initializeFrame();var e=this._clock.tick();this._canRender&&this._scene.render(e)},T}),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(o.now()),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.canAnimate);this.canAnimate=void 0,a.defineProperty(this,"canAnimate",{get:d,set:function(e){d(e),r.canAnimate=e}});var m=a.observable(r.shouldAnimate);this.shouldAnimate=void 0,a.defineProperty(this,"shouldAnimate",{get:m,set:function(e){m(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.canAnimate,u=e.shouldAnimate;this.systemTime=o.now(),this.startTime=t,this.stopTime=r,this.currentTime=i,this.multiplier=n,this.clockStep=a,this.clockRange=s,this.canAnimate=l,this.shouldAnimate=u},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(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()};return t}),r("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){var r=this,i=o.observable(n.fullscreen),s=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return s()},set:function(e){s(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(r._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(t,document.body),this._callback=function(){i(n.fullscreen)},document.addEventListener(n.changeEventName,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.changeEventName,this._callback),r(this)},s}),r("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],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,r){if(!e(t))throw new i("container is required.");t=o(t);var u=new a(r);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),n.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(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},u}),r("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/jsonp","../../Core/Matrix4","../../Core/Rectangle","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e){var t=e.searchText;if(!/^\s*$/.test(t)){e._isSearchInProgress=!0;var i=a(e._url+"REST/v1/Locations",{parameters:{query:t,key:e._key},callbackParameterName:"jsonp"}),n=e._geocodeInProgress=h(i,function(t){if(!n.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return e.searchText=e._searchText+" (not found)",void 0;var i=t.resourceSets[0];if(0===i.resources.length)return e.searchText=e._searchText+" (not found)",void 0;var o=i.resources[0];e._searchText=o.name;var a=o.bbox,u=a[0],c=a[1],h=a[2],d=a[3],m=l.fromDegrees(c,u,d,h),f=e._scene.camera,p=f.getRectangleCameraCoordinates(m);r(p)&&e._scene.camera.flyTo({destination:p,duration:e._flightDuration,onComplete:function(){var t=e._scene.screenSpaceCameraController;t.ellipsoid=e._ellipsoid},endTransform:s.IDENTITY,convert:!1})}},function(){n.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function f(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}var p=function(i){if(!r(i)||!r(i.scene))throw new n("options.scene is required.");this._url=t(i.url,"//dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(i.key),this._scene=i.scene,this._ellipsoid=t(i.ellipsoid,o.WGS84),this._flightDuration=t(i.flightDuration,1500),this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0;var a=this;this._searchCommand=d(function(){a.isSearchInProgress?f(a):m(a)}),c.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,c.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,c.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){if("string"!=typeof e)throw new n("value must be a valid string.");this._searchText=e}}),this.flightDuration=void 0,c.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){if(0>e)throw new n("value must be positive.");this._flightDuration=e}})};return i(p.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}}}),p}),r("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],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("options.container is required.");if(!e(t.scene))throw new i("options.scene is required.");var r=o(t.container),u=new a(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),n.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),n.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/Matrix4","../../Core/Rectangle","../../Scene/Camera","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(t,i,n){var o=t.mode,c=t.screenSpaceCameraController;if(c.ellipsoid=i,r(t)&&o===u.MORPHING&&t.completeMorph(),o===u.SCENE2D)t.camera.flyToRectangle({destination:s.MAX_VALUE,duration:n,endTransform:a.IDENTITY});else if(o===u.SCENE3D){var h=new l(t);t.camera.flyTo({destination:h.position,duration:n,up:h.up,direction:h.direction,endTransform:a.IDENTITY})}else if(o===u.COLUMBUS_VIEW){var d=i.maximumRadius,m=new e(0,-1,1);m=e.multiplyByScalar(e.normalize(m,m),5*d,m);var f=new e;f=e.normalize(e.subtract(e.ZERO,m,f),f);var p=e.cross(f,e.UNIT_Z,new e),v=e.cross(p,f,new e);t.camera.flyTo({destination:m,duration:n,up:v,direction:f,endTransform:a.IDENTITY,convert:!1})}}var m=function(e,i,a){if(!r(e))throw new n("scene is required.");i=t(i,o.WGS84),a=t(a,1500),this._scene=e,this._ellipsoid=i,this._duration=a;var s=this;this._command=h(function(){d(s._scene,s._ellipsoid,s._duration)}),this.tooltip="View Home",c.track(this,["tooltip"])};return i(m.prototype,{scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(0>e)throw new n("value must be positive.");this._duration=e}}}),m}),r("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r,s,l){if(!e(t))throw new i("container is required.");t=o(t);var u=new a(r,s,l);u._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 c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-home-button",c.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),t.appendChild(c),n.applyBindings(u,c),this._container=t,this._viewModel=u,this._element=c};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 n.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(m)||(m=new a("sanitizeHtml",1/0)),m.scheduleTask(e)}new e;var c="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",h="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",d=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="",this.loadingIndicatorHtml='
',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=this.loadingIndicatorHtml;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?c:h}}),s.defineProperty(this,"_bodyless",{get:function(){return!this._descriptionSanitizedHtml}})};d.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"};var m;return d.defaultSanitizer=u,i(d.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}},sanitizer:{get:function(){return t(this._sanitizer,d.defaultSanitizer)},set:function(e){this._sanitizer=e;var t=this._descriptionRawHtml;this._descriptionRawHtml="",this.descriptionRawHtml=t}}}),d}),r("Widgets/InfoBox/InfoBox",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./InfoBoxViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){if(!e(t))throw new i("container is required.");t=o(t),this._container=t;var r=document.createElement("div");r.className="cesium-infoBox",r.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),t.appendChild(r),this._element=r;var s=document.createElement("div");s.className="cesium-infoBox-title",s.setAttribute("data-bind","text: titleText"),r.appendChild(s);var l=document.createElement("button");l.type="button",l.className="cesium-button cesium-infoBox-camera",l.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),r.appendChild(l);var u=document.createElement("button");u.type="button",u.className="cesium-infoBox-close",u.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(); }"),u.innerHTML="×",r.appendChild(u); var c=document.createElement("div");c.className="cesium-infoBox-body",r.appendChild(c);var h=document.createElement("div");h.className="cesium-infoBox-description",h.setAttribute("data-bind","html: descriptionSanitizedHtml,style : { maxHeight : maxHeightOffset(40) }"),c.appendChild(h);var d=new a;this._viewModel=d,n.applyBindings(this._viewModel,r)};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 n.cleanNode(this._element),e.removeChild(this._element),r(this)},s}),r("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,r){"use strict";var i=function(){this.showInstructions=!1;var e=this;this._command=r(function(){e.showInstructions=!e.showInstructions}),this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions"])};return e(i.prototype,{command:{get:function(){return this._command}}}),i}),r("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){if(!t(r)||!t(r.container))throw new n("options.container is required.");var i=a(r.container),l=new s;r.instructionsInitiallyVisible&&(l.showInstructions=!0),l._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var u=document.createElement("span");u.className="cesium-navigationHelpButton-wrapper",i.appendChild(u);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",c.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),u.appendChild(c);var h=document.createElement("div");h.className="cesium-navigation-help",h.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions }'),h.innerHTML='
Pan view
Left click + drag
Zoom view
Right click + drag, or
Mouse wheel scroll
Rotate view
Middle click + drag, or
CTRL + Left click + drag
',u.appendChild(h),o.applyBindings(l,u),this._container=i,this._viewModel=l,this._wrapper=u,this._closeInstructions=function(e){u.contains(e.target)||(l.showInstructions=!1)},document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0)};return r(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),r("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Event","../../Core/getTimestamp","../../Scene/FrameRateMonitor","../createCommand","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(r){if(!t(r)||!t(r.scene))throw new n("description.scene is required.");this._scene=r.scene,this.lowFrameRateMessage=e(r.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,u.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=l(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var o=s.fromScene(r.scene);this._unsubscribeLowFrameRate=o.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=o.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})};return r(c.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),c.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),i(this)},c}),r("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","./PerformanceWatchdogViewModel","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=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),s=new o(t),l=document.createElement("div");l.className="cesium-performance-watchdog-message-area",l.setAttribute("data-bind","visible: showingLowFrameRateMessage");var u=document.createElement("button");u.setAttribute("type","button"),u.className="cesium-performance-watchdog-message-dismiss",u.innerHTML="×",u.setAttribute("data-bind","click: dismissMessage"),l.appendChild(u);var c=document.createElement("div");c.className="cesium-performance-watchdog-message",c.setAttribute("data-bind","html: lowFrameRateMessage"),l.appendChild(c),r.appendChild(l),a.applyBindings(s,l),this._container=r,this._viewModel=s,this._element=l};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 this._viewModel.destroy(),a.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),r("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r,i){if(!t(r))throw new n("scene is required.");this._scene=r;var u=this,c=function(e,t,r){u.sceneMode=r,u.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(r.morphStart,c),this._duration=e(i,2e3),this.sceneMode=r.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=u.sceneMode;return e===a.SCENE2D?u.tooltip2D:e===a.SCENE3D?u.tooltip3D:u.tooltipColumbusView}),this._toggleDropDown=l(function(){u.dropDownVisible=!u.dropDownVisible}),this._morphTo2D=l(function(){r.morphTo2D(u._duration)}),this._morphTo3D=l(function(){r.morphTo3D(u._duration)}),this._morphToColumbusView=l(function(){r.morphToColumbusView(u._duration)}),this._sceneMode=a};return r(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(0>e)throw new n("duration value must be positive.");this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},u}),r("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],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(t,r){if(!e(t))throw new i("container is required.");if(!e(r))throw new i("scene is required.");t=o(t);var c=new a(r);c._globePath=s,c._flatMapPath=l,c._columbusViewPath=u;var h=document.createElement("span");h.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",t.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 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.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(f);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.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(p),n.applyBindings(c,h),this._viewModel=c,this._container=t,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 t(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),n.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,s){if(!r(e))throw new n("scene is required.");if(!r(i))throw new n("selectionIndicatorElement is required.");if(!r(s))throw new n("container is required.");this._scene=e,this._screenPositionX="-1000px",this._screenPositionY="0",this._animationCollection=e.animations,this._container=t(s,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/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r){if(!e(t))throw new i("container is required.");t=o(t),this._container=t;var s=document.createElement("div");s.className="cesium-selection-wrapper",s.setAttribute("data-bind",'style: { "bottom" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),t.appendChild(s),this._element=s;var l="http://www.w3.org/2000/svg",u="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",c=document.createElementNS(l,"svg:svg");c.setAttribute("width",160),c.setAttribute("height",160),c.setAttribute("viewBox","0 0 160 160");var h=document.createElementNS(l,"g");h.setAttribute("transform","translate(80,80)"),c.appendChild(h);var d=document.createElementNS(l,"path");d.setAttribute("data-bind","attr: { transform: _transform }"),d.setAttribute("d",u),h.appendChild(d),s.appendChild(c);var m=new a(r,this._element,this._container);this._viewModel=m,n.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 n.cleanNode(this._element),e.removeChild(this._element),r(this)},s}),r("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function r(t,r,i){this._color=t,this._height=r,this._base=e(i,0)}return r.prototype.getHeight=function(){return this._height},r.prototype.getBase=function(){return this._base},r.prototype.getStartTime=function(){return this._start},r.prototype.getStopTime=function(){return this._stop},r.prototype.setRange=function(e,t){this._start=e,this._stop=t},r.prototype.render=function(e){var r="";if(this._start&&this._stop&&this._color){var i=t.getSecondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(i)),o=t.getSecondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;0>n&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(r='')}return r},r}),r("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,r){"use strict";function i(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 i.prototype.render=function(e,i){var n=this.interval.start,o=this.interval.stop,a=i.startJulian,s=r.addSeconds(i.startJulian,i.duration,new r);if(r.lessThan(n,a)&&r.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height);else if(r.lessThanOrEquals(n,s)&&r.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;le?"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 o=r*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new 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 f(e){return function(t){var r,i,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=_.touchOnly,1===o?(r=n.getSecondsDifference(e._scrubJulian,e._startJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-i)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function p(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(r){var i,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left; e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=_.touchOnly,e._touchMode===y.scrub?(r.preventDefault(),1===r.changedTouches.length&&(o=r.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=r.touches.length,2===a?(s=.5*(r.touches[0].clientX+r.touches[1].clientX)-h,l=Math.abs(r.touches[0].clientX-r.touches[1].clientX)):1===a&&(s=r.touches[0].clientX-h,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(i=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,i*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,_={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={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),r(this)},l.prototype.addHighlightRange=function(e,t,r){var i=new a(e,t,r);return this._highlightRanges.push(i),this.resize(),i},l.prototype.addTrack=function(e,t,r,i){var n=new s(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,r){if(this._timeBarSecondsSpan=n.getSecondsDifference(r,t),this._timeBarSecondsSpan<=0)throw new i("Start time must come before end time.");if(this._startJulian=t,this._endJulian=r,this._clock&&this._clock.clockRange!==e.UNBOUNDED){var o=this._clock.startTime,a=this._clock.stopTime,s=n.getSecondsDifference(a,o),l=n.getSecondsDifference(o,this._startJulian),u=n.getSecondsDifference(a,this._endJulian);this._timeBarSecondsSpan>=s?(this._timeBarSecondsSpan=s,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):l>0?(this._endJulian=n.addSeconds(this._endJulian,l,new n),this._startJulian=o,this._timeBarSecondsSpan=n.getSecondsDifference(this._endJulian,this._startJulian)):0>u&&(this._startJulian=n.addSeconds(this._startJulian,u,new n),this._endJulian=a,this._timeBarSecondsSpan=n.getSecondsDifference(this._endJulian,this._startJulian))}this._makeTics();var c=document.createEvent("Event");c.initEvent("setzoom",!0,!0),c.startJulian=this._startJulian,c.endJulian=this._endJulian,c.epochJulian=this._epochJulian,c.totalSpan=this._timeBarSecondsSpan,c.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(c)},l.prototype.zoomFrom=function(e){var t=n.getSecondsDifference(this._scrubJulian,this._startJulian);e>1||0>t||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var r=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,r*e-r,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),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(b/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-b)/v}function i(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.getSecondsDifference(this._scrubJulian,this._startJulian),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,f=1e-10,p=0,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):v>m&&(v=m,this._timeBarSecondsSpan=m,this._endJulian=n.addSeconds(this._startJulian,m,new n));var g=this._timeBarEle.clientWidth;10>g&&(g=10);var _,y=this._startJulian,C=Math.min(1e-5*(v/g),.4);_=v>31536e4?n.fromIso8601(n.toDate(y).toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(n.toDate(y).toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(n.toDate(y).toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(n.toDate(y).toISOString().substring(0,10)+"T00:00:00Z");var b=n.getSecondsDifference(this._startJulian,n.addSeconds(_,C,new n)),S=b+v;this._epochJulian=_,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var x=this._rulerEle.offsetWidth+20;30>x&&(x=180);var E=p;p-=f;var T={startTime:b,startJulian:y,epochJulian:_,duration:v,timeBarWidth:g,getAlpha:r};this._highlightRanges.forEach(function(e){h+=e.render(T)});var P=0,A=0,M=0,D=x/g;D>1&&(D=1),D*=this._timeBarSecondsSpan;var I,O=-1,R=-1,L=w.length;for(I=0;L>I;++I){var N=w[I];if(++O,P=N,N>D&&N>p)break;0>R&&g*(N/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=O)}if(O>0){for(;O>0;)if(--O,Math.abs(i(P,w[O]))<1e-5){w[O]>=p&&(A=w[O]);break}if(R>=0)for(;O>R;){if(Math.abs(i(A,w[R]))<1e-5&&w[R]>=p){M=w[R];break}++R}}p=E,p>f&&1e-5>M&&Math.abs(p-P)>f&&(M=p,P+f>=p&&(A=0));var B,F=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);S>=o;o=t(o,M))h+='';if(g*(A/this._timeBarSecondsSpan)>=3)for(o=e(A);S>=o;o=t(o,A))h+='';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,S+=P,o=e(P);for(var z=n.getTaiMinusUtc(_);S>=o;){var V=n.addSeconds(y,o-b,new n);if(P>2.1){var q=n.getTaiMinusUtc(V);Math.abs(q-z)>.1&&(o+=q-z,V=n.addSeconds(y,o-b,new n))}var k=Math.round(g*r(o)),U=this.makeLabel(V);this._rulerEle.innerHTML=U,B=this._rulerEle.offsetWidth,10>B&&(B=x);var W=k-(B/2-1);W>F?(F=W+B+5,h+=''+''+U+""):h+='',o=t(o,P)}}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(t(this._scrubElement)){var r=n.getSecondsDifference(this._scrubJulian,this._startJulian),i=Math.round(r*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),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/clone","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../DynamicScene/DataSourceCollection","../../DynamicScene/DataSourceDisplay","../../ThirdParty/knockout","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T){"use strict";function P(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function A(e){var t=e._container,i=t.clientWidth,n=t.clientHeight,o=r(e._animation),a=r(e._timeline);if(i!==e._lastWidth||n!==e._lastHeight){var s=n-125,l=e._baseLayerPickerDropDown;r(l)&&(l.style.maxHeight=s+"px"),r(e._infoBox)&&(e._infoBox.viewModel.maxHeight=s);var u,c=e._timeline,h=0,d=0,m=0;if(o&&"hidden"!==window.getComputedStyle(e._animation.container).visibility){var f=e._lastWidth;u=e._animation.container,i>900?(h=169,900>=f&&(u.style.width="169px",u.style.height="112px",e._animation.resize())):i>=600?(h=136,(600>f||f>900)&&(u.style.width="136px",u.style.height="90px",e._animation.resize())):(h=106,(f>600||0===f)&&(u.style.width="106px",u.style.height="70px",e._animation.resize())),d=h+5}if(a&&"hidden"!==window.getComputedStyle(e._timeline.container).visibility){var p=e._fullscreenButton,v=c.container,g=v.style;m=v.clientHeight+3,g.left=h+"px",r(p)&&(g.right=p.container.clientWidth+"px"),c.resize()}e._bottomContainer.style.left=d+"px",e._bottomContainer.style.bottom=m+"px",e._lastWidth=i,e._lastHeight=n}}var M=function(e,i){function n(e){if(r(e)){var t=e.clock;r(t)&&(t.getValue(B),r(rt)&&(rt.updateFromClock(),rt.zoomTo(t.startTime,t.stopTime)))}}if(!r(e))throw new o("container is required.");e=y(e),i=t(i,t.EMPTY_OBJECT);var M=!r(i.baseLayerPicker)||i.baseLayerPicker!==!1;if(M&&r(i.imageryProvider))throw new o("options.imageryProvider is not available when using the BaseLayerPicker widget. Either specify options.selectedImageryProviderViewModel instead or set options.baseLayerPicker to false.");if(!M&&r(i.selectedImageryProviderViewModel))throw new o("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.imageryProvider instead or set options.baseLayerPicker to true.");if(M&&r(i.terrainProvider))throw new o("options.terrainProvider is not available when using the BaseLayerPicker widget. Either specify options.selectedTerrainProviderViewModel instead or set options.baseLayerPicker to false.");if(!M&&r(i.selectedTerrainProviderViewModel))throw new o("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");var D=document.createElement("div");D.className="cesium-viewer",e.appendChild(D);var I=document.createElement("div");I.className="cesium-viewer-cesiumWidgetContainer",D.appendChild(I);var O=document.createElement("div");O.className="cesium-viewer-bottom",D.appendChild(O);var R=new p(I,{terrainProvider:i.terrainProvider,imageryProvider:M?!1:i.imageryProvider,skyBox:i.skyBox,sceneMode:i.sceneMode,mapProjection:i.mapProjection,contextOptions:i.contextOptions,useDefaultRenderLoop:i.useDefaultRenderLoop,targetFrameRate:i.targetFrameRate,showRenderLoopErrors:i.showRenderLoopErrors,creditContainer:r(i.creditContainer)?i.creditContainer:O}),L=i.dataSources;r(L)||(L=new s);var N=new l(R.scene,L),B=R.clock,F=new v(B),z=new a,V=this;z.add(B.onTick,function(e){var t=N.update(e.currentTime);V._allowDataSourcesToSuspendAnimation&&(F.canAnimate=t)});var q;if(!r(i.selectionIndicator)||i.selectionIndicator!==!1){var k=document.createElement("div");k.className="cesium-viewer-selectionIndicatorContainer",D.appendChild(k),q=new x(k,R.scene)}var U;if(!r(i.infoBox)||i.infoBox!==!1){var W=document.createElement("div");W.className="cesium-viewer-infoBoxContainer",D.appendChild(W),U=new C(W)}var G=document.createElement("div");G.className="cesium-viewer-toolbar",D.appendChild(G);var H;if(!r(i.geocoder)||i.geocoder!==!1){var j=document.createElement("div");j.className="cesium-viewer-geocoderContainer",G.appendChild(j),H=new _({container:j,scene:R.scene,ellipsoid:R.scene.globe.ellipsoid})}var Y;r(i.homeButton)&&i.homeButton===!1||(Y=new w(G,R.scene,R.scene.globe.ellipsoid),r(H)&&z.add(Y.viewModel.command.afterExecute,function(){var e=H.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}));var X;r(i.sceneModePicker)&&i.sceneModePicker===!1||(X=new S(G,R.scene));var Z;if(M){var J=t(i.imageryProviderViewModels,m()),Q=t(i.terrainProviderViewModels,f());Z=new d(G,{globe:R.scene.globe,imageryProviderViewModels:J,selectedImageryProviderViewModel:i.selectedImageryProviderViewModel,terrainProviderViewModels:Q,selectedTerrainProviderViewModel:i.selectedTerrainProviderViewModel});var K=G.getElementsByClassName("cesium-baseLayerPicker-dropDown");this._baseLayerPickerDropDown=K[0]}var $;r(i.navigationHelpButton)&&i.navigationHelpButton===!1||($=new b({container:G,instructionsInitiallyVisible:t(i.navigationInstructionsInitiallyVisible,!0)}));var et;if(!r(i.animation)||i.animation!==!1){var tt=document.createElement("div");tt.className="cesium-viewer-animationContainer",D.appendChild(tt),et=new c(tt,new h(F))}var rt;if(!r(i.timeline)||i.timeline!==!1){var it=document.createElement("div");it.className="cesium-viewer-timelineContainer",D.appendChild(it),rt=new T(it,B),rt.addEventListener("settime",P,!1),rt.zoomTo(B.startTime,B.stopTime)}var nt;if(r(i.fullscreenButton)&&i.fullscreenButton===!1)r(rt)&&(rt.container.style.right=0);else{var ot=document.createElement("div");ot.className="cesium-viewer-fullscreenContainer",D.appendChild(ot),nt=new g(ot,i.fullscreenElement),this._fullscreenSubscription=E(nt.viewModel,"isFullscreenEnabled",function(e){ot.style.display=e?"block":"none",r(rt)&&(rt.container.style.right=ot.clientWidth+"px",rt.resize())})}this.clockTrackedDataSource=void 0,u.track(this,["clockTrackedDataSource"]),this._dataSourceChangedListeners={},this._knockoutSubscriptions=[];var at=t(i.automaticallyTrackDataSourceClocks,!0);this._knockoutSubscriptions.push(E(this,"clockTrackedDataSource",function(e){n(e)}));var st=function(e){V.clockTrackedDataSource===e&&n(e)},lt=function(e,t){at&&(V.clockTrackedDataSource=t);var r=t.dynamicObjects.id,i=z.add(t.changedEvent,st);V._dataSourceChangedListeners[r]=i},ut=function(e,t){var r=V.clockTrackedDataSource===t,i=t.dynamicObjects.id;if(V._dataSourceChangedListeners[i](),V._dataSourceChangedListeners[i]=void 0,r){var n=e.length;V.clockTrackedDataSource=at&&n>0?e.get(n-1):void 0}};z.add(L.dataSourceAdded,lt),z.add(L.dataSourceRemoved,ut),this._container=e,this._bottomContainer=O,this._element=D,this._cesiumWidget=R,this._selectionIndicator=q,this._infoBox=U,this._dataSourceCollection=L,this._dataSourceDisplay=N,this._clockViewModel=F,this._toolbar=G,this._homeButton=Y,this._sceneModePicker=X,this._baseLayerPicker=Z,this._animation=et,this._timeline=rt,this._fullscreenButton=nt,this._geocoder=H,this._eventHelper=z,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,R.scene.preRender.addEventListener(function(){A(V)})};return i(M.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},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}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}}}),M.prototype.extend=function(e,t){if(!r(e))throw new o("mixin is required.");e(this,t)},M.prototype.resize=function(){var e=this._cesiumWidget;e.resize(),A(this)},M.prototype.forceResize=function(){this._lastWidth=0,this.resize()},M.prototype.render=function(){this._cesiumWidget.render()},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e,t=this._knockoutSubscriptions.length;for(e=0;t>e;e++)this._knockoutSubscriptions[e].dispose();return this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",P,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(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)},M}),r("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,r,i){"use strict";var n=function(n){if(!e(n))throw new r("viewer is required.");var o=document.createElement("div");o.className="cesium-viewer-cesiumInspectorContainer",n.container.appendChild(o);var a=new i(o,n.scene);t(n,{cesiumInspector:{get:function(){return a}}}),n.scene.postRender.addEventListener(function(){n.cesiumInspector.viewModel.update()})};return n}),r("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DynamicScene/CzmlDataSource","../../DynamicScene/GeoJsonDataSource","../getElement"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e.stopPropagation(),e.preventDefault()}function c(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",u,!1),i.removeEventListener("dragover",u,!1),i.removeEventListener("dragexit",u,!1))}function h(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",u,!1),e.addEventListener("dragover",u,!1),e.addEventListener("dragexit",u,!1)}function d(e,r){return function(i){var n=r.name;try{var o,l;if(/\.czml$/i.test(n))o=new a(n),o.load(JSON.parse(i.target.result),n);else{if(!(/\.geojson$/i.test(n)||/\.json$/i.test(n)||/\.topojson$/i.test(n)))return e.dropError.raiseEvent(e,n,"Unrecognized file: "+n),void 0;o=new s(n),l=o.load(JSON.parse(i.target.result),n)}e.dataSources.add(o),t(l)&&l.otherwise(function(t){e.dropError.raiseEvent(e,n,t)})}catch(u){e.dropError.raiseEvent(e,n,u)}}}function m(e,t){return function(r){e.dropError.raiseEvent(e,t.name,r.target.error)}}var f=function(a,s){function f(e){u(e),g&&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=d(a,n),o.onerror=m(a,n),o.readAsText(n)}}if(!t(a))throw new i("viewer is required.");if(a.hasOwnProperty("dropTarget"))throw new i("dropTarget is already defined by another mixin.");if(a.hasOwnProperty("dropEnabled"))throw new i("dropEnabled is already defined by another mixin.");if(a.hasOwnProperty("dropError"))throw new i("dropError is already defined by another mixin.");if(a.hasOwnProperty("clearOnDrop"))throw new i("clearOnDrop is already defined by another mixin.");s=e(s,e.EMPTY_OBJECT);var p=!0,v=new n,g=e(s.clearOnDrop,!0),_=e(s.dropTarget,a.container);_=l(_),r(a,{dropTarget:{get:function(){return _},set:function(e){if(!t(e))throw new i("value is required.");c(_,f),_=e,h(_,f)}},dropEnabled:{get:function(){return p},set:function(e){e!==p&&(e?h(_,f):c(_,f),p=e)}},dropError:{get:function(){return v}},clearOnDrop:{get:function(){return g},set:function(e){g=e}}}),h(_,f),a.destroy=o(a,a.destroy,function(){a.dropEnabled=!1}),a._handleDrop=f};return f}),r("Widgets/Viewer/viewerDynamicObjectMixin",["../../Core/BoundingSphere","../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/EventHelper","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../DynamicScene/DynamicObject","../../DynamicScene/DynamicObjectView","../../Scene/SceneMode","../../ThirdParty/knockout","../subscribeAndEvaluate"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(d){function m(){d.trackedObject=d.selectedObject}function f(){d.trackedObject=void 0}function p(){d.selectedObject=void 0}function v(){d.trackedObject=void 0,d.selectedObject=void 0}function g(i){var n=i.currentTime;r(E)&&E.update(n);var o=d.selectedObject,a=r(o)&&D;if(a){var s,l=r(M)?M.position:void 0,u=!1;o.isAvailable(n)&&(r(o.position)?(s=o.position.getValue(n,l),u=r(s)&&d.trackedObject!==d.selectedObject):r(o.vertexPositions)&&(O=o.vertexPositions.getValue(n,O),R=e.fromPoints(O,R),s=R.center)),r(M)&&(M.position=s),r(P)&&(P.enableCamera=u,P.isCameraTracking=d.trackedObject===d.selectedObject,P.descriptionRawHtml=r(o.description)?t(o.description.getValue(n),""):"")}r(M)&&(M.showSelection=a,M.update()),r(P)&&(P.showInfo=a)}function _(e){var i=d.scene.pick(e.position);if(r(i)){var n=t(i.id,i.primitive.id);if(n instanceof s)return n}}function y(e){r(e)&&r(e.position)&&(d.trackedObject=e)}function w(e){var t=_(e);r(t)&&y(t)}function C(e){d.selectedObject=_(e)}function b(e,t,r){for(var i=r.length,n=0;i>n;n++){var o=r[n];d.trackedObject===o&&d.homeButton.viewModel.command(),d.selectedObject===o&&(d.selectedObject=void 0)}}function S(e,t){var r=t.dynamicObjects;r.collectionChanged.addEventListener(b)}function x(e,t){var i=t.dynamicObjects;i.collectionChanged.removeEventListener(b),r(d.trackedObject)&&i.getById(d.trackedObject.id)===d.trackedObject&&d.homeButton.viewModel.command(),r(d.selectedObject)&&i.getById(d.selectedObject.id)===d.selectedObject&&(d.selectedObject=void 0)}if(!r(d))throw new i("viewer is required.");if(d.hasOwnProperty("trackedObject"))throw new i("trackedObject is already defined by another mixin.");if(d.hasOwnProperty("selectedObject"))throw new i("selectedObject is already defined by another mixin.");var E,T=d.infoBox,P=r(T)?T.viewModel:void 0,A=d.selectionIndicator,M=r(A)?A.viewModel:void 0,D=r(T)||r(A),I=new n;r(P)&&(I.add(P.cameraClicked,m),I.add(P.closeClicked,p));var O,R;I.add(d.clock.onTick,g),r(d.homeButton)&&I.add(d.homeButton.viewModel.command.beforeExecute,f),r(d.geocoder)&&I.add(d.geocoder.viewModel.search.beforeExecute,v);for(var L=d.dataSources,N=L.length,B=0;N>B;B++)S(L,L.get(B));I.add(d.dataSources.dataSourceAdded,S),I.add(d.dataSources.dataSourceRemoved,x),d.screenSpaceEventHandler.setInputAction(C,o.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(w,o.LEFT_DOUBLE_CLICK),d.trackedObject=void 0,d.selectedObject=void 0,c.track(d,["trackedObject","selectedObject"]);var F=[];F.push(h(d,"trackedObject",function(e){var t=d.scene,i=t.frameState.mode,n=r(e);(i===u.COLUMBUS_VIEW||i===u.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!n),(i===u.COLUMBUS_VIEW||i===u.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!n),E=n&&r(e.position)?new l(e,t,d.scene.globe.ellipsoid):void 0})),F.push(h(d,"selectedObject",function(e){r(e)?(r(P)&&(P.titleText=r(e.name)?e.name:e.id),r(M)&&M.animateAppear()):r(M)&&M.animateDepart()})),d.destroy=a(d,d.destroy,function(){I.removeAll();var e;for(e=0;ee;e++)x(t,t.get(e))})};return d}),r("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,r,i,n){"use strict";var o=function(o,a){if(!t(o))throw new i("viewer is required.");a=e(a,e.EMPTY_OBJECT);var s=new n({scene:o.scene,container:o.bottomContainer,lowFrameRateMessage:a.lowFrameRateMessage});r(o,{performanceWatchdog:{get:function(){return s}}})};return o}),r("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";var i=function(i){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=i(l.parameters,o)}catch(u){a.error=u instanceof Error?{name:u.name,message:u.message,stack:u.stack}:u}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(u){a.result=void 0,a.error="postMessage failed with error: "+r(u)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}};return i}),r("Cesium",["./Core/ArcGisImageServerTerrainProvider","./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/CesiumTerrainProvider","./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/Credit","./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/EllipsoidTerrainProvider","./Core/EllipsoidalOccluder","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/FAR","./Core/FeatureDetection","./Core/Fullscreen","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GregorianDate","./Core/HeightmapTerrainData","./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/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/NearFarScalar","./Core/ObjectOrientedBoundingBox","./Core/Occluder","./Core/Packable","./Core/PackableForInterpolation","./Core/PixelFormat","./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/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TridiagonalSystemSolver","./Core/VRTheWorldTerrainProvider","./Core/VertexFormat","./Core/Visibility","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/barycentricCoordinates","./Core/binarySearch","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/clone","./Core/combine","./Core/createGuid","./Core/defaultValue","./Core/defineProperties","./Core/defined","./Core/deprecationWarning","./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/mergeSort","./Core/parseResponseHeaders","./Core/pointInsideTriangle","./Core/requestAnimationFrame","./Core/sampleTerrain","./Core/subdivideArray","./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/DynamicRectangle","./DynamicScene/DynamicVector","./DynamicScene/DynamicVectorVisualizer","./DynamicScene/DynamicWall","./DynamicScene/EllipseGeometryUpdater","./DynamicScene/EllipsoidGeometryUpdater","./DynamicScene/GeoJsonDataSource","./DynamicScene/GeometryUpdater","./DynamicScene/GeometryVisualizer","./DynamicScene/GridMaterialProperty","./DynamicScene/ImageMaterialProperty","./DynamicScene/MaterialProperty","./DynamicScene/PolygonGeometryUpdater","./DynamicScene/PolylineGeometryUpdater","./DynamicScene/PolylineGlowMaterialProperty","./DynamicScene/PolylineOutlineMaterialProperty","./DynamicScene/PositionProperty","./DynamicScene/PositionPropertyArray","./DynamicScene/Property","./DynamicScene/PropertyArray","./DynamicScene/RectangleGeometryUpdater","./DynamicScene/ReferenceProperty","./DynamicScene/SampledPositionProperty","./DynamicScene/SampledProperty","./DynamicScene/StaticGeometryColorBatch","./DynamicScene/StaticGeometryPerMaterialBatch","./DynamicScene/StaticOutlineGeometryBatch","./DynamicScene/StripeMaterialProperty","./DynamicScene/StripeOrientation","./DynamicScene/TimeIntervalCollectionPositionProperty","./DynamicScene/TimeIntervalCollectionProperty","./DynamicScene/Visualizer","./DynamicScene/WallGeometryUpdater","./DynamicScene/createDynamicPropertyDescriptor","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/Context","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/MipmapHint","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/RenderState","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/createShaderSource","./Renderer/loadCubeMap","./Scene/AnimationCollection","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/CustomSensorVolume","./Scene/DebugAppearance","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/FXAA","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/Globe","./Scene/GlobeSurface","./Scene/GlobeSurfaceShaderSet","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./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/ModelMaterial","./Scene/ModelMesh","./Scene/ModelNode","./Scene/ModelTypes","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/Pass","./Scene/PerInstanceColorAppearance","./Scene/PerformanceDisplay","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/Polygon","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/RectanglePrimitive","./Scene/RectangularPyramidSensorVolume","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/SensorVolumeCollection","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TextureAtlasBuilder","./Scene/Tile","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileMapServiceImageryProvider","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/terrainAttributeLocations","./Shaders/AdjustTranslucentFS","./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/depthRange","./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/alphaWeight","./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/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/CompositeOITFS","./Shaders/CustomSensorVolumeFS","./Shaders/CustomSensorVolumeVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeFSDepth","./Shaders/GlobeFSPole","./Shaders/GlobeVS","./Shaders/GlobeVSDepth","./Shaders/GlobeVSPole","./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/FXAA","./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.1.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/ProviderViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./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/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./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/Viewer/viewerPerformanceWatchdogMixin","./Widgets/createCommand","./Widgets/getElement","./Widgets/subscribeAndEvaluate","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,f,p,v,g,_,y,w,C,b,S,x,E,T,P,A,M,D,I,O,R,L,N,B,F,z,V,q,k,U,W,G,H,j,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,mt,ft,pt,vt,gt,_t,yt,wt,Ct,bt,St,xt,Et,Tt,Pt,At,Mt,Dt,It,Ot,Rt,Lt,Nt,Bt,Ft,zt,Vt,qt,kt,Ut,Wt,Gt,Ht,jt,Yt,Xt,Zt,Jt,Qt,Kt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,hr,dr,mr,fr,pr,vr,gr,_r,yr,wr,Cr,br,Sr,xr,Er,Tr,Pr,Ar,Mr,Dr,Ir,Or,Rr,Lr,Nr,Br,Fr,zr,Vr,qr,kr,Ur,Wr,Gr,Hr,jr,Yr,Xr,Zr,Jr,Qr,Kr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,hi,di,mi,fi,pi,vi,gi,_i,yi,wi,Ci,bi,Si,xi,Ei,Ti,Pi,Ai,Mi,Di,Ii,Oi,Ri,Li,Ni,Bi,Fi,zi,Vi,qi,ki,Ui,Wi,Gi,Hi,ji,Yi,Xi,Zi,Ji,Qi,Ki,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,mn,fn,pn,vn,gn,_n,yn,wn,Cn,bn,Sn,xn,En,Tn,Pn,An,Mn,Dn,In,On,Rn,Ln,Nn,Bn,Fn,zn,Vn,qn,kn,Un,Wn,Gn,Hn,jn,Yn,Xn,Zn,Jn,Qn,Kn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,mo,fo,po,vo,go,_o,yo,wo,Co,bo,So,xo,Eo,To,Po,Ao,Mo,Do,Io,Oo,Ro,Lo,No,Bo,Fo,zo,Vo,qo,ko,Uo,Wo,Go,Ho,jo,Yo,Xo,Zo,Jo,Qo,Ko,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,ha,da,ma,fa,pa,va,ga,_a,ya,wa,Ca,ba,Sa,xa,Ea,Ta,Pa,Aa,Ma,Da,Ia,Oa,Ra,La,Na,Ba,Fa,za,Va,qa,ka,Ua,Wa,Ga,Ha,ja,Ya,Xa,Za,Ja,Qa,Ka,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,hs,ds,ms,fs,ps,vs,gs,_s,ys,ws,Cs,bs,Ss,xs,Es,Ts,Ps,As,Ms,Ds,Is,Os,Rs,Ls,Ns,Bs,Fs,zs,Vs,qs,ks,Us,Ws,Gs,Hs,js,Ys,Xs,Zs,Js,Qs,Ks,$s,el,tl,rl,il,nl,ol,al,sl,ll,ul,cl,hl,dl,ml,fl,pl,vl,gl,_l,yl,wl,Cl,bl,Sl,xl,El,Tl,Pl,Al,Ml,Dl,Il,Ol,Rl,Ll,Nl,Bl,Fl,zl,Vl,ql,kl,Ul,Wl,Gl,Hl,jl,Yl,Xl,Zl,Jl,Ql,Kl,$l,eu,tu,ru,iu,nu,ou,au,su,lu,uu,cu,hu,du,mu,fu,pu,vu,gu,_u,yu,wu,Cu,bu,Su,xu,Eu,Tu,Pu,Au,Mu,Du,Iu,Ou,Ru,Lu,Nu,Bu,Fu,zu,Vu,qu,ku,Uu,Wu,Gu,Hu,ju,Yu,Xu,Zu,Ju,Qu,Ku,$u,ec,tc,rc,ic,nc,oc,ac,sc,lc,uc,cc,hc,dc,mc,fc,pc,vc,gc,_c,yc,wc,Cc,bc,Sc,xc,Ec,Tc,Pc,Ac,Mc,Dc){"use strict"; var Ic={VERSION:"b29",_shaders:{}};return Ic.ArcGisImageServerTerrainProvider=e,Ic.AssociativeArray=t,Ic.AxisAlignedBoundingBox=r,Ic.BingMapsApi=i,Ic.BoundingRectangle=n,Ic.BoundingSphere=o,Ic.BoxGeometry=a,Ic.BoxOutlineGeometry=s,Ic.Cartesian2=l,Ic.Cartesian3=u,Ic.Cartesian4=c,Ic.Cartographic=h,Ic.CatmullRomSpline=d,Ic.CesiumTerrainProvider=m,Ic.CircleGeometry=f,Ic.CircleOutlineGeometry=p,Ic.Clock=v,Ic.ClockRange=g,Ic.ClockStep=_,Ic.Color=y,Ic.ColorGeometryInstanceAttribute=w,Ic.ComponentDatatype=C,Ic.CornerType=b,Ic.CorridorGeometry=S,Ic.CorridorGeometryLibrary=x,Ic.CorridorOutlineGeometry=E,Ic.Credit=T,Ic.CubicRealPolynomial=P,Ic.CylinderGeometry=A,Ic.CylinderGeometryLibrary=M,Ic.CylinderOutlineGeometry=D,Ic.DefaultProxy=I,Ic.DeveloperError=O,Ic.EarthOrientationParameters=R,Ic.EarthOrientationParametersSample=L,Ic.EllipseGeometry=N,Ic.EllipseGeometryLibrary=B,Ic.EllipseOutlineGeometry=F,Ic.Ellipsoid=z,Ic.EllipsoidGeodesic=V,Ic.EllipsoidGeometry=q,Ic.EllipsoidOutlineGeometry=k,Ic.EllipsoidTangentPlane=U,Ic.EllipsoidTerrainProvider=W,Ic.EllipsoidalOccluder=G,Ic.EncodedCartesian3=H,Ic.Event=j,Ic.EventHelper=Y,Ic.FAR=X,Ic.FeatureDetection=Z,Ic.Fullscreen=J,Ic.GeographicProjection=Q,Ic.GeographicTilingScheme=K,Ic.Geometry=$,Ic.GeometryAttribute=et,Ic.GeometryAttributes=tt,Ic.GeometryInstance=rt,Ic.GeometryInstanceAttribute=it,Ic.GeometryPipeline=nt,Ic.GregorianDate=ot,Ic.HeightmapTerrainData=at,Ic.HeightmapTessellator=st,Ic.HermitePolynomialApproximation=lt,Ic.HermiteSpline=ut,Ic.Iau2000Orientation=ct,Ic.Iau2006XysData=ht,Ic.Iau2006XysSample=dt,Ic.IauOrientationAxes=mt,Ic.IauOrientationParameters=ft,Ic.IndexDatatype=pt,Ic.InterpolationAlgorithm=vt,Ic.Intersect=gt,Ic.IntersectionTests=_t,Ic.Intersections2D=yt,Ic.Interval=wt,Ic.Iso8601=Ct,Ic.JulianDate=bt,Ic.KeyboardEventModifier=St,Ic.LagrangePolynomialApproximation=xt,Ic.LeapSecond=Et,Ic.LinearApproximation=Tt,Ic.LinearSpline=Pt,Ic.MapProjection=At,Ic.Math=Mt,Ic.Matrix2=Dt,Ic.Matrix3=It,Ic.Matrix4=Ot,Ic.NearFarScalar=Rt,Ic.ObjectOrientedBoundingBox=Lt,Ic.Occluder=Nt,Ic.Packable=Bt,Ic.PackableForInterpolation=Ft,Ic.PixelFormat=zt,Ic.Plane=Vt,Ic.PolygonGeometry=qt,Ic.PolygonGeometryLibrary=kt,Ic.PolygonOutlineGeometry=Ut,Ic.PolygonPipeline=Wt,Ic.PolylineGeometry=Gt,Ic.PolylinePipeline=Ht,Ic.PolylineVolumeGeometry=jt,Ic.PolylineVolumeGeometryLibrary=Yt,Ic.PolylineVolumeOutlineGeometry=Xt,Ic.PrimitiveType=Zt,Ic.QuadraticRealPolynomial=Jt,Ic.QuantizedMeshTerrainData=Qt,Ic.QuarticRealPolynomial=Kt,Ic.Quaternion=$t,Ic.QuaternionSpline=er,Ic.Queue=tr,Ic.Ray=rr,Ic.Rectangle=ir,Ic.RectangleGeometry=nr,Ic.RectangleOutlineGeometry=or,Ic.ReferenceFrame=ar,Ic.RequestErrorEvent=sr,Ic.RuntimeError=lr,Ic.ScreenSpaceEventHandler=ur,Ic.ScreenSpaceEventType=cr,Ic.ShowGeometryInstanceAttribute=hr,Ic.Simon1994PlanetaryPositions=dr,Ic.SimplePolylineGeometry=mr,Ic.SphereGeometry=fr,Ic.SphereOutlineGeometry=pr,Ic.Spherical=vr,Ic.Spline=gr,Ic.TaskProcessor=_r,Ic.TerrainData=yr,Ic.TerrainMesh=wr,Ic.TerrainProvider=Cr,Ic.TileProviderError=br,Ic.TilingScheme=Sr,Ic.TimeConstants=xr,Ic.TimeInterval=Er,Ic.TimeIntervalCollection=Tr,Ic.TimeStandard=Pr,Ic.Tipsify=Ar,Ic.Transforms=Mr,Ic.TridiagonalSystemSolver=Dr,Ic.VRTheWorldTerrainProvider=Ir,Ic.VertexFormat=Or,Ic.Visibility=Rr,Ic.WallGeometry=Lr,Ic.WallGeometryLibrary=Nr,Ic.WallOutlineGeometry=Br,Ic.WebMercatorProjection=Fr,Ic.WebMercatorTilingScheme=zr,Ic.WindingOrder=Vr,Ic.barycentricCoordinates=qr,Ic.binarySearch=kr,Ic.buildModuleUrl=Ur,Ic.cancelAnimationFrame=Wr,Ic.clone=Gr,Ic.combine=Hr,Ic.createGuid=jr,Ic.defaultValue=Yr,Ic.defineProperties=Xr,Ic.defined=Zr,Ic.deprecationWarning=Jr,Ic.destroyObject=Qr,Ic.formatError=Kr,Ic.freezeObject=$r,Ic.getFilenameFromUri=ei,Ic.getImagePixels=ti,Ic.getTimestamp=ri,Ic.isArray=ii,Ic.isCrossOriginUrl=ni,Ic.isLeapYear=oi,Ic.jsonp=ai,Ic.loadArrayBuffer=si,Ic.loadBlob=li,Ic.loadImage=ui,Ic.loadImageViaBlob=ci,Ic.loadJson=hi,Ic.loadText=di,Ic.loadWithXhr=mi,Ic.loadXML=fi,Ic.mergeSort=pi,Ic.parseResponseHeaders=vi,Ic.pointInsideTriangle=gi,Ic.requestAnimationFrame=_i,Ic.sampleTerrain=yi,Ic.subdivideArray=wi,Ic.throttleRequestByServer=Ci,Ic.wrapFunction=bi,Ic.writeTextToCanvas=Si,Ic.ColorMaterialProperty=xi,Ic.CompositeDynamicObjectCollection=Ei,Ic.CompositeMaterialProperty=Ti,Ic.CompositePositionProperty=Pi,Ic.CompositeProperty=Ai,Ic.ConstantPositionProperty=Mi,Ic.ConstantProperty=Di,Ic.CzmlDataSource=Ii,Ic.DataSource=Oi,Ic.DataSourceCollection=Ri,Ic.DataSourceDisplay=Li,Ic.DynamicBillboard=Ni,Ic.DynamicBillboardVisualizer=Bi,Ic.DynamicClock=Fi,Ic.DynamicCone=zi,Ic.DynamicConeVisualizerUsingCustomSensor=Vi,Ic.DynamicEllipse=qi,Ic.DynamicEllipsoid=ki,Ic.DynamicGeometryUpdater=Ui,Ic.DynamicLabel=Wi,Ic.DynamicLabelVisualizer=Gi,Ic.DynamicModel=Hi,Ic.DynamicModelVisualizer=ji,Ic.DynamicObject=Yi,Ic.DynamicObjectCollection=Xi,Ic.DynamicObjectView=Zi,Ic.DynamicPath=Ji,Ic.DynamicPathVisualizer=Qi,Ic.DynamicPoint=Ki,Ic.DynamicPointVisualizer=$i,Ic.DynamicPolygon=en,Ic.DynamicPolyline=tn,Ic.DynamicPyramid=rn,Ic.DynamicPyramidVisualizer=nn,Ic.DynamicRectangle=on,Ic.DynamicVector=an,Ic.DynamicVectorVisualizer=sn,Ic.DynamicWall=ln,Ic.EllipseGeometryUpdater=un,Ic.EllipsoidGeometryUpdater=cn,Ic.GeoJsonDataSource=hn,Ic.GeometryUpdater=dn,Ic.GeometryVisualizer=mn,Ic.GridMaterialProperty=fn,Ic.ImageMaterialProperty=pn,Ic.MaterialProperty=vn,Ic.PolygonGeometryUpdater=gn,Ic.PolylineGeometryUpdater=_n,Ic.PolylineGlowMaterialProperty=yn,Ic.PolylineOutlineMaterialProperty=wn,Ic.PositionProperty=Cn,Ic.PositionPropertyArray=bn,Ic.Property=Sn,Ic.PropertyArray=xn,Ic.RectangleGeometryUpdater=En,Ic.ReferenceProperty=Tn,Ic.SampledPositionProperty=Pn,Ic.SampledProperty=An,Ic.StaticGeometryColorBatch=Mn,Ic.StaticGeometryPerMaterialBatch=Dn,Ic.StaticOutlineGeometryBatch=In,Ic.StripeMaterialProperty=On,Ic.StripeOrientation=Rn,Ic.TimeIntervalCollectionPositionProperty=Ln,Ic.TimeIntervalCollectionProperty=Nn,Ic.Visualizer=Bn,Ic.WallGeometryUpdater=Fn,Ic.createDynamicPropertyDescriptor=zn,Ic.AutomaticUniforms=Vn,Ic.Buffer=qn,Ic.BufferUsage=kn,Ic.ClearCommand=Un,Ic.Context=Wn,Ic.CubeMap=Gn,Ic.CubeMapFace=Hn,Ic.DrawCommand=jn,Ic.Framebuffer=Yn,Ic.MipmapHint=Xn,Ic.PassState=Zn,Ic.PickFramebuffer=Jn,Ic.PixelDatatype=Qn,Ic.RenderState=Kn,Ic.Renderbuffer=$n,Ic.RenderbufferFormat=eo,Ic.ShaderCache=to,Ic.ShaderProgram=ro,Ic.Texture=io,Ic.TextureMagnificationFilter=no,Ic.TextureMinificationFilter=oo,Ic.TextureWrap=ao,Ic.UniformState=so,Ic.VertexArray=lo,Ic.VertexArrayFacade=uo,Ic.createShaderSource=co,Ic.loadCubeMap=ho,Ic.AnimationCollection=mo,Ic.Appearance=fo,Ic.ArcGisMapServerImageryProvider=po,Ic.Billboard=vo,Ic.BillboardCollection=go,Ic.BingMapsImageryProvider=_o,Ic.BingMapsStyle=yo,Ic.BlendEquation=wo,Ic.BlendFunction=Co,Ic.BlendingState=bo,Ic.Camera=So,Ic.CameraEventAggregator=xo,Ic.CameraEventType=Eo,Ic.CameraFlightPath=To,Ic.CreditDisplay=Po,Ic.CullFace=Ao,Ic.CullingVolume=Mo,Ic.CustomSensorVolume=Do,Ic.DebugAppearance=Io,Ic.DebugModelMatrixPrimitive=Oo,Ic.DepthFunction=Ro,Ic.DiscardMissingTileImagePolicy=Lo,Ic.EllipsoidPrimitive=No,Ic.EllipsoidSurfaceAppearance=Bo,Ic.FXAA=Fo,Ic.FrameRateMonitor=zo,Ic.FrameState=Vo,Ic.FrustumCommands=qo,Ic.Globe=ko,Ic.GlobeSurface=Uo,Ic.GlobeSurfaceShaderSet=Wo,Ic.GoogleEarthImageryProvider=Go,Ic.GridImageryProvider=Ho,Ic.HorizontalOrigin=jo,Ic.Imagery=Yo,Ic.ImageryLayer=Xo,Ic.ImageryLayerCollection=Zo,Ic.ImageryProvider=Jo,Ic.ImageryState=Qo,Ic.Label=Ko,Ic.LabelCollection=$o,Ic.LabelStyle=ea,Ic.Material=ta,Ic.MaterialAppearance=ra,Ic.Model=ia,Ic.ModelAnimation=na,Ic.ModelAnimationCache=oa,Ic.ModelAnimationCollection=aa,Ic.ModelAnimationLoop=sa,Ic.ModelAnimationState=la,Ic.ModelMaterial=ua,Ic.ModelMesh=ca,Ic.ModelNode=ha,Ic.ModelTypes=da,Ic.Moon=ma,Ic.NeverTileDiscardPolicy=fa,Ic.OIT=pa,Ic.OpenStreetMapImageryProvider=va,Ic.OrthographicFrustum=ga,Ic.Pass=_a,Ic.PerInstanceColorAppearance=ya,Ic.PerformanceDisplay=wa,Ic.PerspectiveFrustum=Ca,Ic.PerspectiveOffCenterFrustum=ba,Ic.Polygon=Sa,Ic.Polyline=xa,Ic.PolylineCollection=Ea,Ic.PolylineColorAppearance=Ta,Ic.PolylineMaterialAppearance=Pa,Ic.Primitive=Aa,Ic.PrimitiveCollection=Ma,Ic.PrimitivePipeline=Da,Ic.PrimitiveState=Ia,Ic.RectanglePrimitive=Oa,Ic.RectangularPyramidSensorVolume=Ra,Ic.Scene=La,Ic.SceneMode=Na,Ic.SceneTransforms=Ba,Ic.SceneTransitioner=Fa,Ic.ScreenSpaceCameraController=za,Ic.SensorVolumeCollection=Va,Ic.SingleTileImageryProvider=qa,Ic.SkyAtmosphere=ka,Ic.SkyBox=Ua,Ic.StencilFunction=Wa,Ic.StencilOperation=Ga,Ic.Sun=Ha,Ic.SunPostProcess=ja,Ic.TerrainState=Ya,Ic.TextureAtlas=Xa,Ic.TextureAtlasBuilder=Za,Ic.Tile=Ja,Ic.TileCoordinatesImageryProvider=Qa,Ic.TileDiscardPolicy=Ka,Ic.TileImagery=$a,Ic.TileMapServiceImageryProvider=es,Ic.TileReplacementQueue=ts,Ic.TileState=rs,Ic.TileTerrain=is,Ic.VerticalOrigin=ns,Ic.ViewportQuad=os,Ic.WebMapServiceImageryProvider=as,Ic.createTangentSpaceDebugPrimitive=ss,Ic.terrainAttributeLocations=ls,Ic._shaders.AdjustTranslucentFS=us,Ic._shaders.AllMaterialAppearanceFS=cs,Ic._shaders.AllMaterialAppearanceVS=hs,Ic._shaders.BasicMaterialAppearanceFS=ds,Ic._shaders.BasicMaterialAppearanceVS=ms,Ic._shaders.EllipsoidSurfaceAppearanceFS=fs,Ic._shaders.EllipsoidSurfaceAppearanceVS=ps,Ic._shaders.PerInstanceColorAppearanceFS=vs,Ic._shaders.PerInstanceColorAppearanceVS=gs,Ic._shaders.PerInstanceFlatColorAppearanceFS=_s,Ic._shaders.PerInstanceFlatColorAppearanceVS=ys,Ic._shaders.PolylineColorAppearanceVS=ws,Ic._shaders.PolylineMaterialAppearanceVS=Cs,Ic._shaders.TexturedMaterialAppearanceFS=bs,Ic._shaders.TexturedMaterialAppearanceVS=Ss,Ic._shaders.BillboardCollectionFS=xs,Ic._shaders.BillboardCollectionVS=Es,Ic._shaders.degreesPerRadian=Ts,Ic._shaders.depthRange=Ps,Ic._shaders.epsilon1=As,Ic._shaders.epsilon2=Ms,Ic._shaders.epsilon3=Ds,Ic._shaders.epsilon4=Is,Ic._shaders.epsilon5=Os,Ic._shaders.epsilon6=Rs,Ic._shaders.epsilon7=Ls,Ic._shaders.infinity=Ns,Ic._shaders.oneOverPi=Bs,Ic._shaders.oneOverTwoPi=Fs,Ic._shaders.pi=zs,Ic._shaders.piOverFour=Vs,Ic._shaders.piOverSix=qs,Ic._shaders.piOverThree=ks,Ic._shaders.piOverTwo=Us,Ic._shaders.radiansPerDegree=Ws,Ic._shaders.sceneMode2D=Gs,Ic._shaders.sceneMode3D=Hs,Ic._shaders.sceneModeColumbusView=js,Ic._shaders.sceneModeMorphing=Ys,Ic._shaders.solarRadius=Xs,Ic._shaders.threePiOver2=Zs,Ic._shaders.twoPi=Js,Ic._shaders.webMercatorMaxLatitude=Qs,Ic._shaders.CzmBuiltins=Ks,Ic._shaders.RGBToXYZ=$s,Ic._shaders.XYZToRGB=el,Ic._shaders.alphaWeight=tl,Ic._shaders.antialias=rl,Ic._shaders.columbusViewMorph=il,Ic._shaders.computePosition=nl,Ic._shaders.eastNorthUpToEyeCoordinates=ol,Ic._shaders.ellipsoidContainsPoint=al,Ic._shaders.ellipsoidNew=sl,Ic._shaders.ellipsoidWgs84TextureCoordinates=ll,Ic._shaders.equalsEpsilon=ul,Ic._shaders.eyeOffset=cl,Ic._shaders.eyeToWindowCoordinates=hl,Ic._shaders.geodeticSurfaceNormal=dl,Ic._shaders.getDefaultMaterial=ml,Ic._shaders.getLambertDiffuse=fl,Ic._shaders.getSpecular=pl,Ic._shaders.getWaterNoise=vl,Ic._shaders.getWgs84EllipsoidEC=gl,Ic._shaders.hue=_l,Ic._shaders.isEmpty=yl,Ic._shaders.isFull=wl,Ic._shaders.latitudeToWebMercatorFraction=Cl,Ic._shaders.luminance=bl,Ic._shaders.modelToWindowCoordinates=Sl,Ic._shaders.multiplyWithColorBalance=xl,Ic._shaders.phong=El,Ic._shaders.pointAlongRay=Tl,Ic._shaders.rayEllipsoidIntersectionInterval=Pl,Ic._shaders.saturation=Al,Ic._shaders.tangentToEyeSpaceMatrix=Ml,Ic._shaders.translateRelativeToEye=Dl,Ic._shaders.translucentPhong=Il,Ic._shaders.transpose=Ol,Ic._shaders.windowToEyeCoordinates=Rl,Ic._shaders.depthRangeStruct=Ll,Ic._shaders.ellipsoid=Nl,Ic._shaders.material=Bl,Ic._shaders.materialInput=Fl,Ic._shaders.ray=zl,Ic._shaders.raySegment=Vl,Ic._shaders.CompositeOITFS=ql,Ic._shaders.CustomSensorVolumeFS=kl,Ic._shaders.CustomSensorVolumeVS=Ul,Ic._shaders.EllipsoidFS=Wl,Ic._shaders.EllipsoidVS=Gl,Ic._shaders.GlobeFS=Hl,Ic._shaders.GlobeFSDepth=jl,Ic._shaders.GlobeFSPole=Yl,Ic._shaders.GlobeVS=Xl,Ic._shaders.GlobeVSDepth=Zl,Ic._shaders.GlobeVSPole=Jl,Ic._shaders.BumpMapMaterial=Ql,Ic._shaders.CheckerboardMaterial=Kl,Ic._shaders.DotMaterial=$l,Ic._shaders.FadeMaterial=eu,Ic._shaders.FresnelMaterial=tu,Ic._shaders.GridMaterial=ru,Ic._shaders.NormalMapMaterial=iu,Ic._shaders.PolylineArrowMaterial=nu,Ic._shaders.PolylineGlowMaterial=ou,Ic._shaders.PolylineOutlineMaterial=au,Ic._shaders.ReflectionMaterial=su,Ic._shaders.RefractionMaterial=lu,Ic._shaders.RimLightingMaterial=uu,Ic._shaders.StripeMaterial=cu,Ic._shaders.Water=hu,Ic._shaders.PolylineCommon=du,Ic._shaders.PolylineFS=mu,Ic._shaders.PolylineVS=fu,Ic._shaders.AdditiveBlend=pu,Ic._shaders.BrightPass=vu,Ic._shaders.FXAA=gu,Ic._shaders.GaussianBlur1D=_u,Ic._shaders.PassThrough=yu,Ic._shaders.ReprojectWebMercatorFS=wu,Ic._shaders.ReprojectWebMercatorVS=Cu,Ic._shaders.SensorVolume=bu,Ic._shaders.SkyAtmosphereFS=Su,Ic._shaders.SkyAtmosphereVS=xu,Ic._shaders.SkyBoxFS=Eu,Ic._shaders.SkyBoxVS=Tu,Ic._shaders.SunFS=Pu,Ic._shaders.SunTextureFS=Au,Ic._shaders.SunVS=Mu,Ic._shaders.ViewportQuadFS=Du,Ic._shaders.ViewportQuadVS=Iu,Ic.Tween=Ou,Ic.Uri=Ru,Ic.gltfDefaults=Lu,Ic["knockout-3.1.0"]=Nu,Ic["knockout-es5"]=Bu,Ic.knockout=Fu,Ic.measureText=zu,Ic["mersenne-twister"]=Vu,Ic.sprintf=qu,Ic.topojson=ku,Ic.when=Uu,Ic.Animation=Wu,Ic.AnimationViewModel=Gu,Ic.BaseLayerPicker=Hu,Ic.BaseLayerPickerViewModel=ju,Ic.ProviderViewModel=Yu,Ic.createDefaultImageryProviderViewModels=Xu,Ic.createDefaultTerrainProviderViewModels=Zu,Ic.CesiumInspector=Ju,Ic.CesiumInspectorViewModel=Qu,Ic.CesiumWidget=Ku,Ic.ClockViewModel=$u,Ic.Command=ec,Ic.FullscreenButton=tc,Ic.FullscreenButtonViewModel=rc,Ic.Geocoder=ic,Ic.GeocoderViewModel=nc,Ic.HomeButton=oc,Ic.HomeButtonViewModel=ac,Ic.InfoBox=sc,Ic.InfoBoxViewModel=lc,Ic.NavigationHelpButton=uc,Ic.NavigationHelpButtonViewModel=cc,Ic.PerformanceWatchdog=hc,Ic.PerformanceWatchdogViewModel=dc,Ic.SceneModePicker=mc,Ic.SceneModePickerViewModel=fc,Ic.SelectionIndicator=pc,Ic.SelectionIndicatorViewModel=vc,Ic.SvgPathBindingHandler=gc,Ic.Timeline=_c,Ic.TimelineHighlightRange=yc,Ic.TimelineTrack=wc,Ic.ToggleButtonViewModel=Cc,Ic.Viewer=bc,Ic.viewerCesiumInspectorMixin=Sc,Ic.viewerDragDropMixin=xc,Ic.viewerDynamicObjectMixin=Ec,Ic.viewerPerformanceWatchdogMixin=Tc,Ic.createCommand=Pc,Ic.getElement=Ac,Ic.subscribeAndEvaluate=Mc,Ic.createTaskProcessorWorker=Dc,Ic}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); (function() {function aa(a){return function(){return this[a]}}var h,m=this;function r(a,b){var c=a.split("."),d=m;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b}function s(){} function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function w(a){return void 0!==a}function x(a){return"array"==ba(a)}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function y(a){return"string"==typeof a}function da(a){return"number"==typeof a}function ea(a){return"function"==ba(a)}function fa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function z(a){return a[ga]||(a[ga]=++ha)} var ga="closure_uid_"+(1E9*Math.random()>>>0),ha=0;function ia(a,b,c){return a.call.apply(a.bind,arguments)}function ja(a,b,c){if(!a)throw Error();if(2/g,pa=/\"/g,la=/[&<>\"]/;var E=Array.prototype,qa=E.indexOf?function(a,b,c){return E.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(y(a))return y(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc?null:y(a)?a.charAt(c):a[c]} function ua(a,b){var c;a:{c=y(a)?a.split(""):a;for(var d=a.length-1;0<=d;d--)if(d in c&&b.call(void 0,c[d],d,a)){c=d;break a}c=-1}return 0>c?null:y(a)?a.charAt(c):a[c]}function va(a,b){var c=qa(a,b),d;(d=0<=c)&&E.splice.call(a,c,1);return d}function wa(a){return E.concat.apply(E,arguments)}function xa(a){var b=a.length;if(0=arguments.length?E.slice.call(a,b):E.slice.call(a,b,c)} function za(a){for(var b=[],c=0;cc*b?c+b:c}function G(a){return a*Math.PI/180}function I(a){return 180*a/Math.PI};(function(a){function b(a){for(var b=a.length,c=new Uint8Array(3*(b/4)|0),k=0,l=0,p=[0,0],n=0,q=0;b--;){var t=a.charCodeAt(k++),H=d[t-43];255!==H&&void 0!==H&&(p[1]=p[0],p[0]=t,q=q<<6|H,n++,4===n&&(c[l++]=q>>>16,61!==p[1]&&(c[l++]=q>>>8),61!==p[0]&&(c[l++]=q),n=0))}return c.buffer}var c=/\s*;\s*base64\s*(?:;|$)/i,d=new Uint8Array([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31, 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]);HTMLCanvasElement&&!HTMLCanvasElement.prototype.Wb&&(HTMLCanvasElement.prototype.Wb=function(d,f){f||(f="image/png");if(this.mozGetAsFile)d(this.mozGetAsFile("canvas",f));else{var g=Array.prototype.slice.call(arguments,1),k=this.toDataURL.apply(this,g),l=k.indexOf(","),g=k.substring(l+1),k=c.test(k.substring(0,l)),l=new (a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder);k?l.append(b(g)):l.append(decodeURIComponent(g));d(l.getBlob(f))}})})(self); var Ba,Ca=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,Da=window.URL||window.webkitURL||window.mozURL,Ea=navigator.saveBlob||navigator.mozSaveBlob||navigator.webkitSaveBlob,Fa=window.saveAs||window.webkitSaveAs||window.mozSaveAs; Ca&&(Fa||Ea)?Ba=function(a,b,c){var d=new Ca;d.append(a);a=d.getBlob(c||"application/octet-stream");b||(b="Download.bin");Fa?Fa(a,b):Ea(a,b)}:Ca&&Da&&(Ba=function(a,b,c){var d,e=new Ca;e.append(a);c||(c="application/octet-stream");"download"in document.createElement("a")?(a=e.getBlob(c),d=Da.createObjectURL(a),a=document.createElement("a"),a.setAttribute("href",d),a.setAttribute("download",b||"Download.bin"),b=document.createEvent("MouseEvents"),b.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1, !1,!1,!1,0,null),a.dispatchEvent(b)):(!0==={"image/jpeg":!0,"image/png":!0,"image/gif":!0,"image/svg+xml":!0,"image/bmp":!0,"image/x-windows-bmp":!0,"image/webp":!0,"audio/wav":!0,"audio/mpeg":!0,"audio/webm":!0,"audio/ogg":!0,"video/mpeg":!0,"video/webm":!0,"video/ogg":!0,"text/plain":!0,"text/html":!0,"text/xml":!0,"application/xhtml+xml":!0,"application/json":!0}[c.split(";")[0]]&&(c="application/octet-stream"),a=e.getBlob(c),d=Da.createObjectURL(a),window.open(d,"_blank",""));setTimeout(function(){Da.revokeObjectURL(d)}, 250)});function Ga(a,b,c){var d=a;if(b||c){d=document.createElement("canvas");d.width=a.width;d.height=a.height;var e=d.getContext("2d");e.drawImage(a,0,0);b&&b.forEach(function(a){a.Hc(e)});c&&Ha(c,e)}return d}function Ia(a,b){if(Ba&&a.Wb)a.Wb(function(a){Ba(a,b,"image/png")},"image/png");else if(a.toDataURL){var c=a.toDataURL();document.location.href=c.replace("image/png","image/octet-stream")}};var Ja,Ka,La,Ma;function Na(){return m.navigator?m.navigator.userAgent:null}Ma=La=Ka=Ja=!1;var Oa;if(Oa=Na()){var Pa=m.navigator;Ja=0==Oa.lastIndexOf("Opera",0);Ka=!Ja&&(-1!=Oa.indexOf("MSIE")||-1!=Oa.indexOf("Trident"));La=!Ja&&-1!=Oa.indexOf("WebKit");Ma=!Ja&&!La&&!Ka&&"Gecko"==Pa.product}var Qa=Ja,J=Ka,Ra=Ma,K=La,Sa=m.navigator,Ta=-1!=(Sa&&Sa.platform||"").indexOf("Mac");function Ua(){var a=m.document;return a?a.documentMode:void 0}var Va; a:{var Wa="",Xa;if(Qa&&m.opera)var Ya=m.opera.version,Wa="function"==typeof Ya?Ya():Ya;else if(Ra?Xa=/rv\:([^\);]+)(\)|;)/:J?Xa=/\b(?:MSIE|rv)\s+([^\);]+)(\)|;)/:K&&(Xa=/WebKit\/(\S+)/),Xa)var Za=Xa.exec(Na()),Wa=Za?Za[1]:"";if(J){var $a=Ua();if($a>parseFloat(Wa)){Va=String($a);break a}}Va=Wa}var ab={}; function M(a){var b;if(!(b=ab[a])){b=0;for(var c=String(Va).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f(0==q[1].length?0:parseInt(q[1],10))?1:0)||((0==n[2].length)<(0==q[2].length)?-1:(0==n[2].length)>(0==q[2].length)?1:0)||(n[2]q[2]?1:0)}while(0==b)}b=ab[a]=0<=b}return b}var bb=m.document,cb=bb&&J?Ua()||("CSS1Compat"==bb.compatMode?parseInt(Va,10):5):void 0;var db,eb=!J||J&&9<=cb;!Ra&&!J||J&&J&&9<=cb||Ra&&M("1.9.1");J&&M("9");function fb(a,b){var c;c=a.className;c=y(c)&&c.match(/\S+/g)||[];for(var d=ya(arguments,1),e=c.length+d.length,f=c,g=0;g=a.keyCode)a.keyCode=-1}catch(b){}}; h.C=function(){};var Hb="closure_listenable_"+(1E6*Math.random()|0);function Ib(a){return!(!a||!a[Hb])}var Jb=0;function Kb(a,b,c,d,e,f){this.Q=a;this.Ja=b;this.src=c;this.type=d;this.capture=!!e;this.la=f;this.key=++Jb;this.ba=this.ka=!1}function Lb(a){a.ba=!0;a.Q=null;a.Ja=null;a.src=null;a.la=null};var Mb={},Q={},R={},Nb={};function S(a,b,c,d,e){if(x(b)){for(var f=0;fe.keyCode||void 0!=e.returnValue)return!0;a:{var k=!1;if(0==e.keyCode)try{e.keyCode=-1;break a}catch(l){k=!0}if(k||void 0==e.returnValue)e.returnValue=!0}}k=new Fb;Gb(k,e,this);e=!0;try{if(c){for(var p=[],n=k.currentTarget;n;n=n.parentNode)p.push(n);f=d[!0];for(var q= p.length-1;!k.ha&&0<=q;q--)k.currentTarget=p[q],e&=Yb(f,p[q],k);if(g)for(f=d[!1],q=0;!k.ha&&q>>0);function Ob(a){return ea(a)?a:a[$b]||(a[$b]=function(b){return a.handleEvent(b)})};function ac(a){this.src=a;this.r={};this.lb=0}ac.prototype.add=function(a,b,c,d,e){var f=this.r[a];f||(f=this.r[a]=[],this.lb++);var g=bc(f,b,d,e);-1Math.PI&&(v+=2*Math.PI);n=[q[0],H,f,n.H(),n.M()];e=[a,v,t,d||0,e||0];var Eb=p(0.5);d=["begin","animate","end","finish"];this.F=new qc;g=1E3*(g||3);c? (a=rc(q[0],q[1],a,b),a=Math.min(f,t)+0.2*a,aCesium.Cartesian3.cross(b,a.up,new Cesium.Cartesian3).z?c:-c};wc.prototype.M=function(){var a=this.camera;return-Math.acos(Cesium.Cartesian3.dot(a.up,Cesium.Cartesian3.normalize(a.positionWC,new Cesium.Cartesian3)))+Math.PI/2};wc.prototype.hb=function(a){var b=this.M();a-=this.H();this.camera.lookDown(b);this.camera.twistLeft(a);this.camera.lookUp(b)}; wc.prototype.Qb=function(a){a-=this.M();var b=this.H();this.camera.lookUp(a);this.hb(b)};function vc(a,b,c,d,e,f){b=new Cesium.Cartographic(c,b,d);a.camera.setPositionCartographic(b);a.camera.twistLeft(e);a.camera.lookUp(f)} function yc(a,b,c,d,e){var f=(b+c)/2;d=rc(f,d,f,e);b=rc(b,0,c,0);c=Math.min(Math.max(a.camera.frustum.aspectRatio,d/b),1);a=G(I(a.camera.frustum.fovy)/(c+0.4)-2);b=Math.max(b,d);b=Math.min(Math.PI/2,a+b/12756274);return 9567205.5*(Math.sin(b)*Math.sqrt(1+1/Math.pow(Math.tan(a),2))-1)}function uc(a,b,c,d,e){e=Math.PI-(e||0);c=Math.PI-Math.asin(Math.sin(e)/(1+c/6378137))-e;d=d||0;return[a-Math.cos(d)*c,b+Math.sin(d)*c]} function zc(a,b,c,d){a=2*Math.cos(Math.abs(d))*Math.PI/Math.pow(2,c)*(0.7*a.height/256);return 6378137*1/Math.tan(b/2)*(a/2)};function Ac(a){this.K=a;this.Ta=new Cesium.TextureAtlas({scene:this.K.e});this.mb={}}function Bc(a,b,c){if(null!=a.mb[b])c(a.mb[b]);else{var d=new Image;d.onload=A(function(){this.mb[b]=this.Ta.addImage(d);c(this.mb[b])},a);d.src=b}};function Cc(a){if("function"==typeof a.N)return a.N();if(y(a))return a.split("");if(ca(a)){for(var b=[],c=a.length,d=0;d2*this.b&&Fc(this),!0):!1}; function Fc(a){if(a.b!=a.m.length){for(var b=0,c=0;bb)throw Error("Bad port number "+b);a.fb=b}else a.fb=null}function Oc(a,b,c){V(a);b instanceof Pc?(a.$=b,a.$.Ob(a.t)):(c||(b=Qc(b,Vc)),a.$=new Pc(b,0,a.t))}function Wc(a,b,c){V(a);x(c)||(c=[String(c)]);Xc(a.$,b,c)}function V(a){if(a.cd)throw Error("Tried to modify a read-only Uri");}h.Ob=function(a){this.t=a;this.$&&this.$.Ob(a);return this}; function Qc(a,b){return y(a)?encodeURI(a).replace(b,Yc):null}function Yc(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Rc=/[#\/\?@]/g,Tc=/[\#\?:]/g,Sc=/[\#\?]/g,Vc=/[\#\?@]/g,Uc=/#/g;function Pc(a,b,c){this.s=a||null;this.t=!!c} function W(a){if(!a.g&&(a.g=new Ec,a.b=0,a.s))for(var b=a.s.split("\x26"),c=0;cthis.maximumLevel)return this.sb;var d=this.url.replace("{z}",c.toFixed(0)),d=d.replace("{x}",a.toFixed(0)),d=d.replace("{y}",(this.Lc?(1<d||1.1f||1.1k){b=null;break a}c=Math.min(g+Math.sqrt(k),g-Math.sqrt(k));g=Math.max(g+Math.sqrt(k),g-Math.sqrt(k));g=Math.abs(e-c)a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return null};function ld(a,b,c){var d=O("div",{"class":"we-pp-content"});d.innerHTML=a;a=O("div",{"class":"we-pp-wrapper"},d);d=O("div",{"class":"we-pp-tip-cont"},O("div",{"class":"we-pp-tip"}));this.i=O("div",{"class":"we-pp"});!1!==c&&(c=O("a",{"class":"we-pp-close",href:"#"}),c.onclick=A(this.show,this,!1),this.i.appendChild(c));this.i.appendChild(a);this.i.appendChild(d);b=(b||300)+40;this.i.style.width=b.toFixed(0)+"px";this.i.style.left=(-b/2).toFixed(0)+"px";this.show(!1)}ld.prototype.ub=aa("i"); ld.prototype.show=function(a){(null!=a?a:1!==parseFloat(this.i.style.opacity))?(this.i.style.opacity=1,this.i.style.visibility="visible"):(this.i.style.opacity=0,this.i.style.visibility="hidden")};sc('.we-pp-content p{margin:18px 0;text-align:justify;}.we-pp-wrapper{padding:1px;text-align:left;border-radius:12px;}.we-pp{z-index:100;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;-o-transition:opacity 0.2s linear;transition:opacity 0.2s linear;position:absolute;}.we-pp-wrapper,.we-pp-tip{background:white;box-shadow:0 1px 10px #888;-moz-box-shadow:0 1px 10px #888;-webkit-box-shadow:0 1px 14px #999;}.we-pp-close{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1BMVEX////Ny8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8sw0horAAAAMHRSTlMA/bGBFK1LgjellwUx2+VZo73SE6z5fQYOtzLRpxI22CC4g6ieV+yAEc8/ZocEHTzU+GNbAAAAV0lEQVQI1wXBBQKDMADAwLRl7szdgCks/3/d7hh0ehl0W21IwZgNR44nTNVZribmC1WXqzVstmpIALu9Gg5HOJ1VNV64arjd1YKy8sEz+nrD51tD0//xB/w6CnrIHetcAAAAAElFTkSuQmCC);position:absolute;top:9px;right:9px;width:10px;height:10px;overflow:hidden;}.we-pp-content{display:inline-block;margin:13px 19px;font:12px/1.4 "Helvetica Neue",Arial,Helvetica,sans-serif;}.we-pp-tip-cont{margin:0 auto;width:40px;height:16px;position:relative;overflow:hidden;}.we-pp-tip{width:15px;height:15px;padding:1px;margin:-8px auto 0;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);}');function Y(a,b,c,d,e){var f=O("div",{"class":"we-pm-icon"});y(c)&&(f.style.backgroundImage="url("+c+")");this.vc=d||25;this.zb=e||41;f.style.width=this.vc.toFixed(0)+"px";f.style.height=this.zb.toFixed(0)+"px";f.style.marginLeft=(-this.vc/2).toFixed(0)+"px";f.style.marginTop=(-this.zb).toFixed(0)+"px";c=O("div",{style:"position:absolute;"},f);ed.call(this,a,b,c);this.i=null;this.show(!1);this.ib(!1);f.onclick=A(this.ib,this,void 0)}C(Y,ed); function md(a,b){a.i&&wb(a.i.ub());a.i=b;a.element.appendChild(a.i.ub());b.i.style.bottom=a.zb.toFixed(0)+"px"}Y.prototype.ib=function(a){this.i&&this.i.show(a)};sc(".we-pm-icon{position:absolute;z-index:64;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFtklEQVR42p3Wa0xTZxgH8CYkS5aQLGFxcXNZNNu4FIFCK9eCWOQm3lDizLYP+zTnxLk5wQpICxRaLuWi3FpQFMU55xDkjiBTFMeA9Zy2JzMxWUZisoS4TyRuQvG/pydQKb3Q2uSXw3nf93n+5z2nLRVIiga88RERL/MlAgDrosJ+d/zISTJMEFt2B9LyEV5kySBo7G+iI9vdhyj7nfEhcjKfUvcAma0z+Pwa5+BwuxG7myaRUH4XtHaAhLgI6VvLjwwn14zj0CUWn13lkHXZhPQWBml6e3svGq3zvIyGX0F1z0mWQ4hY0buaH3mcUvsAn17hcKDNhFQdsy4K5Nfv108jsXIM1OOoqxAfMppMAYepIF3PIrmZ8cqhy2ZkXjBYQyxE9iqksGeFXKa9h0PtHF0di6Qmxhk+fKeLOcLX72r8DdRvjvjxIRGFt638yPz+Vha7W0zY0cDYydAbkXWJ4+1rYWx/H2gzO6wl/JysehzUUw0+5Oxtq+zEyns42MYhsZ6xQ2N0C0yQae9DouhFZt1dOvYgnt5RGU3T/Dw1tqtJ1xn5Gur7D/ERRBR0W43vapzhd5FwnrHZ02Kmt+jvkBTeRsOdPzD/7wJWXkPGp0hSD2BnzUMcuMjZ1RF+LFY1BOotFYQXdPkSy/5WDvF1DKSr8GOau7g1/RecvWafzSOuuBf79CYkNxodandox0G9VYLw/FvCSGUf9rZQci1js6PeiPRGAw7WjTgNePnyJa9mgJ5h1QPsWVOf0kTBdZOg/p0CUV6nNKp4ALv1HKJrGJu0Znqo1RNQds64DLBYLBjjniK6ZMihXtZgRPK5KVD/UYHozM+R1p1k6DhEaRmblAYK0U4g/8aUy4DFxUUMMLOIUQ071CfVm5BUOwnq30shNzeJC7qwq5nDtirGJq6GRWoDixR1HxYsS3YhS0tLWFhY4OVdf4TEqgmkNprt6ukiafwhqL9OECb/yYfMpzaaEKllIa5kbNKa6D6XjqK632i3C9oBH3DPPIttyn5+XUy1Y22cegzUO18QdvqGVWdC5SNK5xBezqyg3dB9pW1Hl4wgu20cM3/O4b+FRTx++gwNgywkeTfhrE5cwfBj4oJuUG+hIDT3RyuZpLAXO+s5hGkYOzHVRn5cWv4Q4rM91iJE5HchpnQMsjrWWY1tPfUd5j/xoTnXV0zEV05Cds6MUDVjR6RhkXSecxBTbXJYG0ZojnbRA+opXQ75YUWmpLCfro7D1lLmdfH1Us0EqN+o7Vs45NS1FT7kSXzVDGK1ZghVzGtJpJAI2gX1Sn4V8n3HakcliiEk1HIILGG8FldtRqxmEtRn2u6f1taTHau9SebitCzCNUb4FzNekdZwCC/oA/XIsg/57upaKrFiBHFaDh8rGY9FVZgRrZ4C1T8mPnYhwd9eWWsDeR5TaUKwyogPFYxHYqo4iPL7QbVf8M3tQ9qd0UUoxhBdyWFLIbOucLUJkeoZUN0secMx5MRlZwKIhW4BXSWLzWcZt6IqrLsYBNWccPq7S/jNJVe6wxX3sU1jxgf5BpeExUZIygyg9XPE13nI8TZXtm89dRNiCnk/z+AKPx+aNwhaX+jyZ2pQ9kV3JkTKRxCVmrDpjMGBv4JFRBkLWjdP3nITcsGdT4JzuiAqM+NduWEtfjzkzBBoXQXf0GXIsVZ3fMiTsKIpBBYZsfG0wWZzAQuRygSaf0E2ug0J/LplPdnBOT0IVZnxTq5hBX8eLB8Gzev4Zu5D9OvxJXMhRQZsoavfkEPPQ84gpMQEGreQLeuGBBzVe0IVlDuA4GIz3j5l4I9B8hHQeIfbAFvIVzpPbCQvhEoT3pOzEBaZEZh9BTQW4mFIs6d0gbl3EKSkAPkY6LyXCDwLOdLsKWHAsXYEKswIOH4NdC4lnoX4H2nyRnfA6THQ8Zflcw9Dvmz0xnb/7A7QMW353OMQb7USgTch/wNGSWfRl/HE1wAAAABJRU5ErkJggg\x3d\x3d);}");function Z(a,b){var c=b||{},d=y(a)?document.getElementById(a):a,e=nd();this.gb=(this.lc="file:"==window.location.protocol)?"http:":"";(function(a,b,c,d,e){a.GoogleAnalyticsObject=e;a[e]=a[e]||function(){(a[e].q=a[e].q||[]).push(arguments)};a[e].l=1*new Date;var f=b.createElement(c);b=b.getElementsByTagName(c)[0];f.async=1;f.src=d;b.parentNode.insertBefore(f,b)})(window,document,"script",this.gb+"//www.google-analytics.com/analytics.js","__WE_ga");window.__WE_ga("create","UA-20846306-1",{name:"we0"}); window.__WE_ga("we0.send","event",(2).toString(),window.location.host,window.location.href,e?1:0);if(e){sc(".cesium-credit-textContainer:before{content:'WebGL Earth \\2022\\20 Cesium \\2022\\20';}");this.ob=!1;cd(this,"osm");d.style.position="relative";d.style.overflow="hidden";this.canvas=document.createElement("canvas");this.canvas.style.width="100%";this.canvas.style.height="100%";this.canvas.oncontextmenu=function(){return!1};d.appendChild(this.canvas);this.sa=null;this.e=new Cesium.Scene({canvas:this.canvas, contextOptions:{webgl:{alpha:!0!==c.sky}}});this.fa=null;this.tb=!1;this.d=!0;this.Cb=new Cesium.Matrix4;var f=c.proxyHost||null;this.Eb={getURL:function(a){return null!=f?f+encodeURIComponent(a):a}};c.atmosphere&&(this.e.skyAtmosphere=new Cesium.SkyAtmosphere);c.sky?(e=(y(c.sky)?c.sky:window.CESIUM_BASE_URL)+"SkyBox/",this.e.skyBox=new Cesium.SkyBox({sources:{positiveX:e+"px.jpg",negativeX:e+"mx.jpg",positiveY:e+"py.jpg",negativeY:e+"my.jpg",positiveZ:e+"pz.jpg",negativeZ:e+"mz.jpg"}})):this.e.backgroundColor= new Cesium.Color(0,0,0,0);var e=this.e.primitives,g=Cesium.Ellipsoid.WGS84;this.globe=new Cesium.Globe(g);this.camera=new wc(this.e.camera,g);this.e.globe=this.globe;!0!==c.empty&&(g=new Cesium.BingMapsImageryProvider({url:this.gb+"//dev.virtualearth.net",mapStyle:Cesium.BingMapsStyle.AERIAL_WITH_LABELS,key:"AsLurrtJotbxkJmnsefUYbatUuBkeBTzTL930TvcOekeG8SaQPY9Z5LDKtiuzAOu"}),this.e.imageryLayers.addImageryProvider(g));if(this.wc=!0==c.terrain)g=new Cesium.CesiumTerrainProvider({url:this.gb+"//cesiumjs.org/stk-terrain/tilesets/world/tiles"}), this.e.terrainProvider=g;this.Y=new gd(this,d);this.rb=[];this.eb=new Ac(this);this.ga=new Cesium.BillboardCollection;this.ga.textureAtlas=this.eb.Ta;this.ga.sizeReal=!0;e.add(this.ga);var k=A(function(){if(!this.tb){this.e.initializeFrame();var a=this.wc||this.d;this.d=!1;if(!a){var b=this.camera.camera.viewMatrix;this.Cb&&this.Cb.equals(b)||(b.clone(this.Cb),a=!0)}a&&(this.e.render(),null!=this.fa&&od(this.fa),a=this.Y,F(a.I.L(),a.xd,a),null!=this.sa&&(this.sa(),this.sa=null))}Cesium.requestAnimationFrame(k)}, this);Cesium.requestAnimationFrame(k);d=new Cesium.ScreenSpaceEventHandler(this.canvas);e=A(function(){this.camera.V.cancel()},this);d.setInputAction(e,Cesium.ScreenSpaceEventType.LEFT_DOWN);d.setInputAction(e,Cesium.ScreenSpaceEventType.RIGHT_DOWN);d.setInputAction(e,Cesium.ScreenSpaceEventType.MIDDLE_DOWN);d.setInputAction(e,Cesium.ScreenSpaceEventType.WHEEL);d.setInputAction(e,Cesium.ScreenSpaceEventType.PINCH_START);S(window,"resize",this.yb,!1,this);this.yb();d=c.position;e=c.center;null!=d&& 1a.length});if(!c){c=new Cesium.PrimitiveCollection;a.rb.push(c);var d=a.e.primitives;d.add(c);d.raiseToTop(a.ga)}c.add(b)}function qd(a,b){F(a.rb,function(a){a.remove(b)})}h=Z.prototype;h.yb=function(){var a=this.canvas.clientWidth,b=this.canvas.clientHeight;if(this.canvas.width!==a||this.canvas.height!==b)this.canvas.width=a,this.canvas.height=b,this.e.camera.frustum.aspectRatio=a/b,this.d=!0}; h.qd=function(a){var b=this.e.imageryLayers;b.remove(b.get(0),!1);b.add(a.u,0);a.a=this;this.d=!0};h.vd=function(a){var b=this.e.imageryLayers;1n.screenX||0>n.screenY),l=new gb(0,0),v;n=q?pb(q):document;(v=!J)||(v=J&&9<=cb)||(v="CSS1Compat"==nb(n).W.compatMode); v=v?n.documentElement:n.body;if(p!=v)if(p.getBoundingClientRect){b:{var u;try{u=p.getBoundingClientRect()}catch(Eb){n={left:0,top:0,right:0,bottom:0};break b}J&&(n=p.ownerDocument,u.left-=n.documentElement.clientLeft+n.body.clientLeft,u.top-=n.documentElement.clientTop+n.body.clientTop);n=u}q=nb(q).W;u=K||"CSS1Compat"!=q.compatMode?q.body:q.documentElement;q=q.parentWindow||q.defaultView;u=J&&M("10")&&q.pageYOffset!=u.scrollTop?new gb(u.scrollLeft,u.scrollTop):new gb(q.pageXOffset||u.scrollLeft,q.pageYOffset|| u.scrollTop);l.x=n.left+u.x;l.y=n.top+u.y}else if(q.getBoxObjectFor&&!H)n=q.getBoxObjectFor(p),u=q.getBoxObjectFor(v),l.x=n.screenX-u.screenX,l.y=n.screenY-u.screenY;else{n=p;do{l.x+=n.offsetLeft;l.y+=n.offsetTop;n!=p&&(l.x+=n.clientLeft||0,l.y+=n.clientTop||0);if(K&&"fixed"==jd(n)){l.x+=q.body.scrollLeft;l.y+=q.body.scrollTop;break}n=n.offsetParent}while(n&&n!=p);if(Qa||K&&"absolute"==t)l.y-=q.body.offsetTop;for(n=p;(n=kd(n))&&n!=q.body&&n!=v;)l.x-=n.scrollLeft,Qa&&"TR"==n.tagName||(l.y-=n.scrollTop)}g-= l.x;k-=l.y}null!=g&&null!=k&&(k=a.camera.camera.pickEllipsoid(new Cesium.Cartesian2(g,k)),null!=k&&(k=Cesium.Ellipsoid.WGS84.cartesianToCartographic(k),g=I(k.latitude),l=I(k.longitude),c.latlng={lat:g,lng:l},c.latitude=g,c.longitude=l,c.altitude=k.height,c.originalEvent=c.xa));b(c)}}(this,b));return b[z(this)+"___eventKey_"+a]=c};h.Fa=function(a,b){if(null!=b){var c=b[z(this)+"___eventKey_"+a];null!=c&&Ub(c)}else y(a)||Ub(a)};h.$a=function(a){Wb(this.canvas,a)}; h.ad=function(a,b,c,d,e){a=da(a)?new Y(G(a),G(b),c,d,e):a;hd(this.Y,null,a);this.d=!0;return a};h.aa=function(a){id(this.Y,a);this.d=!0};var rd=/#(.)(.)(.)/;function sd(a){if(!td.test(a))throw Error("'"+a+"' is not a valid hex color");4==a.length&&(a=a.replace(rd,"#$1$1$2$2$3$3"));return a.toLowerCase()}var td=/^#(?:[0-9a-f]{3}){1,2}$/i;function ud(a,b,c){this.a=c;this.o=null;this.Za=this.Ya=0;this.ia(a,b);this.src="";this.ed=0;this.dd=null}ud.prototype.ia=function(a,b){this.Ya=a;this.Za=b;if(this.o){var c=Cesium.Ellipsoid.WGS84.cartographicToCartesian(new Cesium.Cartographic(this.Za,this.Ya));this.o.position=c}};ud.prototype.enable=function(a){this.o&&(this.o.show=a)};ud.prototype.destroy=function(){this.o&&(this.a.ga.remove(this.o),this.o=null)}; function vd(a,b,c,d,e){0c(a[1],a[2]),d=0>c(a[2],a[0]);0>c(a[0],a[1])==b&&b==d&&(f=!0)});return f}; h.Ab=function(a){function b(a,b){function c(b,e){return(a.x-e.x)*(b.y-e.y)-(b.x-e.x)*(a.y-e.y)}var g=0>c(b[1],b[2]),k=0>c(b[2],b[0]);return 0>c(b[0],b[1])==g&&g==k}function c(a,b,c,g){var k=(g.y-c.y)*(b.x-a.x)-(g.x-c.x)*(b.y-a.y),l=a.y-c.y,p=a.x-c.x;c=((g.x-c.x)*l-(g.y-c.y)*p)/k;a=((b.x-a.x)*l-(b.y-a.y)*p)/k;return 0c&&0a}return null!==ta(this.Ra,function(d){return null!==ta(a.Ra,function(a){return c(d[0],d[1],a[0],a[1])||(c(d[0],d[1],a[1],a[2])||c(d[0],d[1],a[2],a[0])||c(d[1],d[2],a[0], a[1])||c(d[1],d[2],a[1],a[2])||c(d[1],d[2],a[2],a[0])||c(d[2],d[0],a[0],a[1])||c(d[2],d[0],a[1],a[2])||c(d[2],d[0],a[2],a[0]))||b(d[0],a)&&b(d[1],a)&&b(d[2],a)||b(a[0],d)&&b(a[1],d)&&b(a[2],d)?!0:!1})})};function zd(a){if(a.f&&!(3>a.Ea)){var b=[],c=a.f;do b.push(new Cesium.Cartographic(c.x,c.y)),c=c.next;while(c!=a.f);b=Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(b);a.na.positions=b;b.push(b[0]);a.Ia.positions=b}} function Ad(a){var b=a.Ea;a.pa=0;a.Ra=[];a.U=!1;if(2p&&0g)&&(e=!1);g=k}while(e&&g!=a.f);e&&(c=d);a.U=a.U&&e;d=f}while(d!=a.f);a.U||4!=b||(d=function(a,b){var c=a.k,d=b.next;a.k=b;b.next=a;a.next=d;b.k=c;d.k=a;c.next=b},c&&d(c,c.next),zd(a),a.U=!0,a.cb=!0)}if(a.na.show=a.U){c=0; if(0b))if(3==b)c(a.f,a.f.k,a.f.next);else{var q=a.f,t=function(a,b,c){return-((b.x-a.x)*(c.y-a.y)-(c.x- a.x)*(b.y-a.y))},H=function(a,b){var c=a.ja,d=a.D;return 0<=t(a,d,c)?0=Math.max(Math.abs(a.offsetX-b.offsetX),Math.abs(a.offsetY-b.offsetY))){var c=this.a.camera.camera.pickEllipsoid(new Cesium.Cartesian2(b.offsetX,b.offsetY));null!=c&&(c=Cesium.Ellipsoid.WGS84.cartesianToCartographic(c),this.da(I(c.latitude),I(c.longitude)),b.preventDefault(),this.mc=B())}},!1,this)},!1,this))}; h.fc=function(){Ub(this.ta);this.ta=null};h.setFillColor=function(a,b){a=sd(a);this.c.na.material.uniforms.color=new Cesium.Color(parseInt(a.substr(1,2),16)/255,parseInt(a.substr(3,2),16)/255,parseInt(a.substr(5,2),16)/255,b);this.a.d=!0};h.setStrokeColor=function(a,b){a=sd(a);this.c.Ia.material.uniforms.color=new Cesium.Color(parseInt(a.substr(1,2),16)/255,parseInt(a.substr(3,2),16)/255,parseInt(a.substr(5,2),16)/255,b);this.a.d=!0};h.rd=function(a,b,c,d){vd(this.Aa,a,b,c,d);Gd(this);this.a.d=!0}; h.ud=function(a){this.Ga=a};h.Da=function(){return this.c.Da()};h.vb=function(){return this.c.vb()};h.Pc=function(){var a=Dd(this.c);return{lat:a[1],lng:a[0]}};h.Ca=function(a,b){return 100>B()-this.mc?!1:this.c.Ca(a,b)};h.Ab=function(a){return this.c.Ab(a.c)};function Gd(a){var b;if(!(b=Dd(a.c)))if(b=a.c,b.f){var c=0,d=0,e=0,f=b.f;do c+=f.x,d+=f.y,e++,f=f.next;while(f!=b.f);e=e/180*Math.PI;b=[c/e,d/e]}else b=[0,0];a.Aa.ia(G(b[1]),G(b[0]));a.Aa.enable(a.c.Da())} h.tc=function(a,b){N(this.J,function(b){b.enable(a)},this);!0!==b&&N(this.X,function(b){this.T.I.get(b).enable(a)},this);this.a.d=!0};h.Uc=function(){var a=this.c,b=180/Math.PI,c=[],d=a.f;do c.push({lat:d.y*b,lng:d.x*b}),d=d.next;while(d!=a.f);return c};function Hd(a,b){var c=Bd(a.c,b);if(0=k;k++)for(var l=k*Math.PI/32,p=Math.sin(l),n=Math.cos(l),l=0;32>=l;l++){var q=2*l*Math.PI/32,q=q-Math.PI/2,t=Math.cos(q)*p,H=n,q=Math.sin(q)*p,v=1-k/32;f.push(1-l/32);f.push(v);d.push(1*t);d.push(1*H);d.push(1*q)}for(k=0;32>k;k++)for(l=0;32>l;l++)p=33*k+l,n=p+32+1,g.push(p+1),g.push(n),g.push(p),g.push(p+1),g.push(n+1),g.push(n);this.ra=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.ra);e.bufferData(e.ARRAY_BUFFER, new Float32Array(d),e.STATIC_DRAW);this.ra.Xa=3;this.ra.Fb=d.length/3;this.Qa=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.Qa);e.bufferData(e.ARRAY_BUFFER,new Float32Array(f),e.STATIC_DRAW);this.Qa.Xa=2;this.Qa.Fb=f.length/2;this.Ba=e.createBuffer();e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.Ba);e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array(g),e.STATIC_DRAW);this.Ba.Xa=1;this.Ba.Fb=g.length;this.jb=null;var u=new Image;u.onload=A(function(){this.jb=e.createTexture();e.activeTexture(e.TEXTURE0); e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1);e.bindTexture(e.TEXTURE_2D,this.jb);e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,u);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},this);u.src=b;d=c("precision lowp float;varying vec2 vTextureCoord;uniform sampler2D uSampler;void main(){gl_FragColor\x3dtexture2D(uSampler,vTextureCoord);}",e.FRAGMENT_SHADER);f=c("precision mediump float;attribute vec3 aVertexPosition;attribute vec2 aTextureCoord;uniform mat4 uMVMatrix;uniform mat4 uPMatrix;uniform float uAspect;varying vec2 vTextureCoord;void main(){gl_Position\x3duPMatrix*uMVMatrix*vec4(aVertexPosition,1.0);gl_Position.x*\x3duAspect;gl_Position.z\x3d0.0;vTextureCoord\x3daTextureCoord;}", e.VERTEX_SHADER);this.p=e.createProgram();if(null===this.p)throw Error("Unknown");e.attachShader(this.p,f);e.attachShader(this.p,d);e.bindAttribLocation(this.p,0,"aVertexPosition");e.linkProgram(this.p);if(!e.getProgramParameter(this.p,e.LINK_STATUS))throw Error("Shader program err: "+e.getProgramInfoLog(this.p));e.useProgram(this.p);this.Yb=e.getAttribLocation(this.p,"aVertexPosition");this.Tb=e.getAttribLocation(this.p,"aTextureCoord");this.yc=e.getUniformLocation(this.p,"uAspect");this.jd=e.getUniformLocation(this.p, "uPMatrix");this.fd=e.getUniformLocation(this.p,"uMVMatrix");this.nd=e.getUniformLocation(this.p,"uSampler");this.Na=128;this.qc=0.1}function Ha(a,b){var c=a.Na*(1+a.qc);b.drawImage(a.canvas,a.K.canvas.width-c,a.K.canvas.height-c)} function od(a){if(null!=a.jb){var b=a.xb;b.useProgram(a.p);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a.jb);b.uniform1i(a.nd,0);var c=U(a.K.camera),d=a.K.camera.camera.frustum,e=Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,-1.2/Math.tan(d.fovy/2)));(function(a,b){var c=Math.cos(b),d=Math.sin(b);Cesium.Matrix4.multiply(a,new Cesium.Matrix4(1,0,0,0,0,c,-d,0,0,d,c,0,0,0,0,1),a)})(e,c[0]);(function(a,b){var c=Math.cos(b),d=Math.sin(b);Cesium.Matrix4.multiply(a,new Cesium.Matrix4(c, 0,d,0,0,1,0,0,-d,0,c,0,0,0,0,1),a)})(e,-c[1]);c=new Float32Array(za(Cesium.Matrix4.toArray(d.projectionMatrix)));b.uniformMatrix4fv(a.fd,!1,new Float32Array(za(Cesium.Matrix4.toArray(e))));b.uniformMatrix4fv(a.jd,!1,c);b.uniform1f(a.yc,d.aspectRatio);b.bindBuffer(b.ARRAY_BUFFER,a.ra);b.vertexAttribPointer(a.Yb,a.ra.Xa,b.FLOAT,!1,0,0);b.bindBuffer(b.ARRAY_BUFFER,a.Qa);b.vertexAttribPointer(a.Tb,a.Qa.Xa,b.FLOAT,!1,0,0);b.enableVertexAttribArray(a.Yb);b.enableVertexAttribArray(a.Tb);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, a.Ba);b.drawElements(b.TRIANGLES,a.Ba.Fb,b.UNSIGNED_SHORT,0);b.disableVertexAttribArray(a.Yb);b.disableVertexAttribArray(a.Tb)}};r("WebGLEarth",Z);r("WebGLEarth.isSupported",Z.Bd);Z.prototype.pd=function(a){var b=this.camera;b.V.cancel();var c=b.H(),d=b.M();xc(b,void 0,void 0,a);a=b.M();c-=b.H();b.camera.lookDown(a);b.camera.twistLeft(c);b.camera.lookUp(d)};r("WebGLEarth.prototype.setAltitude",Z.prototype.pd);Z.prototype.Mc=function(){return U(this.camera)[2]};r("WebGLEarth.prototype.getAltitude",Z.prototype.Mc);Z.prototype.Ma=function(a){a=zc(this.canvas,this.camera.camera.frustum.fovy,a,U(this.camera)[0]);this.setAltitude(a)}; r("WebGLEarth.prototype.setZoom",Z.prototype.Ma);Z.prototype.wb=function(){var a=U(this.camera),b=a[0],c=0.7*this.canvas.height/256,a=2*(a[2]/6378137)*Math.tan(this.camera.camera.frustum.fovy/2)/c;return Math.log(2*Math.cos(Math.abs(b))*Math.PI/a)/Math.LN2};r("WebGLEarth.prototype.getZoom",Z.prototype.wb); Z.prototype.ca=function(a,b,c,d,e,f,g){var k=this.camera;k.V.cancel();a=G(a);b=G(b);null!=c&&(d=zc(this.canvas,k.camera.frustum.fovy,c,a));d=w(d)?d:U(k)[2];e=w(e)?G(e):k.H();f=w(f)?G(f):k.M();g&&(b=uc(a,b,d,e,f),a=b[0],b=b[1],null!=c&&(d=zc(this.canvas,k.camera.frustum.fovy,c,a)));vc(k,a,b,d,e,f)};r("WebGLEarth.prototype.setPosition",Z.prototype.ca);Z.prototype.Vc=function(){var a=U(this.camera);return[I(a[0]),I(a[1])]};r("WebGLEarth.prototype.getPosition",Z.prototype.Vc);Z.prototype.H=function(){return I(this.camera.H())}; r("WebGLEarth.prototype.getHeading",Z.prototype.H);Z.prototype.M=function(){return I(this.camera.M())};r("WebGLEarth.prototype.getTilt",Z.prototype.M);Z.prototype.hb=function(a){this.camera.V.cancel();this.camera.hb(G(a))};r("WebGLEarth.prototype.setHeading",Z.prototype.hb);Z.prototype.Qb=function(a){this.camera.V.cancel();this.camera.Qb(G(a))};r("WebGLEarth.prototype.setTilt",Z.prototype.Qb);Z.prototype.ya=function(a,b,c,d,e,f,g){this.camera.V.ya(G(a),G(b),c,w(d)?G(d):void 0,w(e)?G(e):void 0,f,g)}; r("WebGLEarth.prototype.flyTo",Z.prototype.ya);Z.prototype.hc=function(a,b,c,d,e,f,g){a=G(a);b=G(b);c=G(c);d=G(d);var k=yc(this.camera,a,b,c,d);c=Aa(c,2*Math.PI);d=Aa(d,2*Math.PI);var l=c-d;l<-Math.PI?c+=2*Math.PI:l>Math.PI&&(d+=2*Math.PI);a=[(a+b)/2,(c+d)/2];this.camera.V.ya(a[0],a[1],k,w(e)?G(e):void 0,w(f)?G(f):void 0,w(e)||w(f),g)};r("WebGLEarth.prototype.flyToFitBounds",Z.prototype.hc); Z.prototype.Yc=function(){var a=new Cesium.Cartesian2(this.canvas.width/2,this.canvas.height/2),a=this.camera.camera.pickEllipsoid(a);if(null!=a)return a=this.camera.ellipsoid.cartesianToCartographic(a),[I(a.latitude),I(a.longitude)]};r("WebGLEarth.prototype.getTarget",Z.prototype.Yc); Z.prototype.Oc=function(a,b){b=b||4;for(var c=[90,-90,180,-180],d=0,e=this.canvas.width/(b-1),f=this.canvas.height/(b-1),g=0;g=b.qb&&b.cancel())}this.oc?this.oc.call(this.dc,this):this.Rb=!0;this.ea||(a=new Ld(this),Md(this),Nd(this,!1,a))}};h.bc=function(a,b){this.pb=!1;Nd(this,a,b)};function Nd(a,b,c){a.ea=!0;a.Ka=c;a.za=!b;Od(a)} function Md(a){if(a.ea){if(!a.Rb)throw new Pd(a);a.Rb=!1}}function Qd(a){return sa(a.La,function(a){return ea(a[1])})} function Od(a){a.Xb&&(a.ea&&Qd(a))&&(m.clearTimeout(a.Xb),delete a.Xb);a.Ha&&(a.Ha.qb--,delete a.Ha);for(var b=a.Ka,c=!1,d=!1;a.La.length&&!a.pb;){var e=a.La.shift(),f=e[0],g=e[1],e=e[2];if(f=a.za?g:f)try{var k=f.call(e||a.dc,b);w(k)&&(a.za=a.za&&(k==b||k instanceof Error),a.Ka=b=k);b instanceof Kd&&(d=!0,a.pb=!0)}catch(l){b=l,a.za=!0,Qd(a)||(c=!0)}}a.Ka=b;d&&(d=b,k=A(a.bc,a,!0),f=A(a.bc,a,!1),d.La.push([k,f,void 0]),d.ea&&Od(d),b.Ac=!0);c&&(a.Xb=m.setTimeout(fc(b),0))} function Pd(a){D.call(this);this.Fc=a}C(Pd,D);Pd.prototype.message="Deferred has already fired";Pd.prototype.name="AlreadyCalledError";function Ld(a){D.call(this);this.Fc=a}C(Ld,D);Ld.prototype.message="Deferred was canceled";Ld.prototype.name="CanceledError";function Rd(a,b){var c=b||{},d=c.document||document,e=document.createElement("SCRIPT"),f={sc:e,kb:void 0},g=new Kd(Sd,f),k=null,l=null!=c.timeout?c.timeout:5E3;0Math.PI&&(f+=2*Math.PI);c=[(c+d)/2,(e+f)/2];this.ca(I(c[0]),I(c[1]),void 0,l,g,k,w(g)||w(k))}); r("WebGLEarth.prototype.panTo",function(a,b){x(a)||(a=[a.lat,a.lng]);b=b||{};this.ya(a[0],a[1],void 0,void 0,0,0,void 0,b.duration)}); r("WE.tileLayer",function(a,b){var c=b||{};N(c,function(b,c){a=a.replace("{"+c+"}",b)});a=a.replace("{s}","{sub}");var d=c.subdomains||"abc";y(d)&&(d=d.split(""));var e=c.bounds;e&&x(e[0])&&(e=[e[0][0],e[1][0],e[0][1],e[1][1]]);return cd(null,"custom",{url:a,minimumLevel:c.minZoom||0,maximumLevel:c.maxZoom||18,tileSize:c.tileSize||256,flipY:c.tms||!1,subdomains:d,copyright:(c.attribution||"").replace(/<(?:.|\n)*?>/gm,""),opacity:c.opacity,bounds:e})}); r("WE.tileLayerJSON",function(a,b){function c(a,b,c){var d=a.bounds,l=a.center,p={url:a.tiles[0],minimumLevel:a.minzoom||0,maximumLevel:a.maxzoom||18,copyright:(a.attribution||"").replace(/<(?:.|\n)*?>/gm,""),bounds:d?[d[1],d[3],d[0],d[2]]:void 0};c?(ad(c.u.imageryProvider,p),a.opacity&&1==c.u.alpha&&c.Pb(parseFloat(a.opacity)),d&&c.Nb(d[1],d[3],d[0],d[2])):c=cd(null,"custom",p);b&&(c.addTo(b),l&&(l.length&&1