i&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t='')}return e.y+=this._height,t},e}),r("Widgets/Timeline/Timeline",["../../Core/DeveloperError","../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/JulianDate","../getElement","./TimelineTrack","./TimelineHighlightRange"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,i){if(!r(t))throw new e("container is required.");if(!r(i))throw new e("clock is required.");t=o(t),this.container=t;var n=document.createElement("div");n.className="cesium-timeline-main",t.appendChild(n),this._topDiv=n,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=i,this._scrubJulian=i.currentTime,this._mainTicSpan=-1,this._mouseMode=g.none,this._touchMode=_.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(i.startTime,i.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=m(this),this._onTouchStart=p(this),this._onTouchMove=v(this),this._onTouchEnd=f(this);var a=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),a.addEventListener("mousedown",this._onMouseDown,!1),a.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),a.addEventListener("mousewheel",this._onMouseWheel,!1),a.addEventListener("touchstart",this._onTouchStart,!1),a.addEventListener("touchmove",this._onTouchMove,!1),a.addEventListener("touchend",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},i.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return 10>e?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==g.touchOnly&&(0===t.button?(e._mouseMode=g.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,e._mouseMode=2===t.button?g.zoom:g.slide)),t.preventDefault()}}function h(e){return function(){e._mouseMode=g.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0px 0px"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var r;if(e._mouseMode===g.scrub){t.preventDefault();var i=t.clientX-e._topDiv.getBoundingClientRect().left;0>i?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===g.slide){if(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r){var n=r*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(e._startJulian.addSeconds(n),e._endJulian.addSeconds(n))}}else e._mouseMode===g.zoom&&(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r&&e.zoomFrom(Math.pow(1.01,r)))}}function m(e){return function(t){var r=t.wheelDeltaY||t.wheelDelta||-t.detail;y=Math.max(Math.min(Math.abs(r),y),1),r/=y,e.zoomFrom(Math.pow(1.05,-r))}}function p(e){return function(t){var r,i,n=t.touches.length,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=g.touchOnly,1===n?(r=e._startJulian.getSecondsDifference(e._scrubJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-i)<50?(e._touchMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===n?"-16px 0":"0 0")):(e._touchMode=_.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):2===n?(e._touchMode=_.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=_.ignore}}function f(e){return function(t){var r=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===_.singleTap?(e._touchMode=_.scrub,e._handleTouchMove(t)):e._touchMode===_.scrub&&e._handleTouchMove(t),e._mouseMode=g.touchOnly,1!==r?e._touchMode=r>0?_.ignore:_.none:e._touchMode===_.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function v(e){return function(t){var i,n,o,a,s,l,u=1,c=e._topDiv.getBoundingClientRect().left;e._touchMode===_.singleTap&&(e._touchMode=_.slideZoom),e._mouseMode=g.touchOnly,e._touchMode===_.scrub?(t.preventDefault(),1===t.changedTouches.length&&(n=t.changedTouches[0].clientX-c,n>=0&&n<=e._topDiv.clientWidth&&e._setTimeBarTime(n,n*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===_.slideZoom&&(o=t.touches.length,2===o?(a=.5*(t.touches[0].clientX+t.touches[1].clientX)-c,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):1===o&&(a=t.touches[0].clientX-c,s=0),r(a)&&(s>0&&e._touchState.spanX>0?(u=e._touchState.spanX/s,l=e._startJulian.addSeconds((e._touchState.centerX*e._timeBarSecondsSpan-a*e._timeBarSecondsSpan*u)/e._topDiv.clientWidth)):(i=e._touchState.centerX-a,l=e._startJulian.addSeconds(i*e._timeBarSecondsSpan/e._topDiv.clientWidth)),e.zoomTo(l,l.addSeconds(e._timeBarSecondsSpan*u)),e._touchState.centerX=a,e._touchState.spanX=s))}}var y=1e12,g={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},_={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},w=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,r){this._topDiv.addEventListener(e,t,r)},l.prototype.removeEventListener=function(e,t,r){this._topDiv.removeEventListener(e,t,r)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t){var r=new s(e,t);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,r,i){var n=new a(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(r,i){if(this._timeBarSecondsSpan=r.getSecondsDifference(i),this._timeBarSecondsSpan<=0)throw new e("Start time must come before end time.");if(this._startJulian=r,this._endJulian=i,this._clock&&this._clock.clockRange!==t.UNBOUNDED){var n=this._clock.startTime,o=this._clock.stopTime,a=n.getSecondsDifference(o),s=this._startJulian.getSecondsDifference(n),l=this._endJulian.getSecondsDifference(o);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=this._endJulian.addSeconds(s),this._startJulian=n,this._timeBarSecondsSpan=this._startJulian.getSecondsDifference(this._endJulian)):0>l&&(this._startJulian=this._startJulian.addSeconds(l),this._endJulian=o,this._timeBarSecondsSpan=this._startJulian.getSecondsDifference(this._endJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=this._startJulian.getSecondsDifference(this._scrubJulian);e>1||0>t||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var r=this._timeBarSecondsSpan-t;this.zoomTo(this._startJulian.addSeconds(t-t*e),this._endJulian.addSeconds(r*e-r))},l.prototype.makeLabel=function(e){var t=e.toGregorianDate(),r=t.millisecond,i=" UTC";if(r>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(r).toString();i.length<3;)i="0"+i;i="."+i}return C[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+i},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(x/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-x)/v}function i(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=this._startJulian.getSecondsDifference(this._scrubJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,m=31536e6,p=1e-10,f=0,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=this._startJulian.addSeconds(d)):v>m&&(v=m,this._timeBarSecondsSpan=m,this._endJulian=this._startJulian.addSeconds(m));var y=this._timeBarEle.clientWidth;10>y&&(y=10);var g,_=this._startJulian,C=Math.min(1e-5*(v/y),.4);g=v>31536e4?n.fromIso8601(_.toDate().toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(_.toDate().toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(_.toDate().toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(_.toDate().toISOString().substring(0,10)+"T00:00:00Z");var x=g.addSeconds(C).getSecondsDifference(this._startJulian),S=x+v;this._epochJulian=g,this._rulerEle.innerHTML=this.makeLabel(this._endJulian.addSeconds(-d));var E=this._rulerEle.offsetWidth+20,b=f;f-=p;var T={y:0,startTime:x,startJulian:_,epochJulian:g,duration:v,timeBarWidth:y,getAlpha:r};this._highlightRanges.forEach(function(e){h+=e.render(T)});var A=0,D=0,P=0,M=E/y;M>1&&(M=1),M*=this._timeBarSecondsSpan;var I,O=-1,R=-1,L=w.length;for(I=0;L>I;++I){var z=w[I];if(++O,A=z,z>M&&z>f)break;0>R&&y*(z/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=O)}if(O>0){for(;O>0;)if(--O,Math.abs(i(A,w[O]))<1e-5){w[O]>=f&&(D=w[O]);break}if(R>=0)for(;O>R;){if(Math.abs(i(D,w[R]))<1e-5&&w[R]>=f){P=w[R];break}++R}}f=b,f>p&&1e-5>P&&Math.abs(f-A)>p&&(P=f,A+p>=f&&(D=0));var N,B=-999999;if(y*(P/this._timeBarSecondsSpan)>=3)for(o=e(P);S>=o;o=t(o,P))h+='';if(y*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);S>=o;o=t(o,D))h+='';if(y*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,S+=A,o=e(A);for(var F=g.getTaiMinusUtc();S>=o;){var V=_.addSeconds(o-x);if(A>2.1){var k=V.getTaiMinusUtc();Math.abs(k-F)>.1&&(o+=k-F,V=_.addSeconds(o-x))}var U=Math.round(y*r(o)),W=this.makeLabel(V);
-this._rulerEle.innerHTML=W,N=this._rulerEle.offsetWidth;var q=U-(N/2-1);q>B?(B=q+N+5,h+=''+''+W+""):h+='',o=t(o,A)}}else this._mainTicSpan=-1;h+='',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),T.y=0,this._trackList.forEach(function(e){e.render(c._context,T),T.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(r(this._scrubElement)){var t=this._startJulian.getSecondsDifference(this._scrubJulian),i=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}r(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(this._startJulian.addSeconds(this._timelineDrag),this._endJulian.addSeconds(this._timelineDrag)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=this._startJulian.addSeconds(t),this._scrubElement){var r=e-8;this._scrubElement.style.left=r.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var r=1;this._trackList.forEach(function(e){r+=e.height}),this._trackListEle.style.height=r.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=r,this._makeTics(),this._lastWidth=e,this._lastHeight=t}},l}),r("Widgets/Viewer/Viewer",["../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/destroyObject","../../Core/Event","../../Core/EventHelper","../../Core/requestAnimationFrame","../../DynamicScene/DataSourceCollection","../../DynamicScene/DataSourceDisplay","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultBaseLayers","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../subscribeAndEvaluate","../HomeButton/HomeButton","../SceneModePicker/SceneModePicker","../Timeline/Timeline"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x){"use strict";function S(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function E(e){function t(){if(!e.isDestroyed())try{e._useDefaultRenderLoop?(e.resize(),e.render(),s(t)):e._renderLoopRunning=!1}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._renderLoopError.raiseEvent(e,r),e._showRenderLoopErrors&&(e.cesiumWidget.showErrorPanel("An error occurred while rendering. Rendering has stopped.",r),console.error(r))}}e._renderLoopRunning=!0,s(t)}var b=function(i,n){function s(e){M.update(e.currentTime)}function E(e,r){if(1===e.getLength()){var i=r.getClock();t(i)&&(i.getValue(I),t(G)&&(G.updateFromClock(),G.zoomTo(i.startTime,i.stopTime)))}}if(!t(i))throw new r("container is required.");i=g(i),n=e(n,e.EMPTY_OBJECT);var b=!t(n.baseLayerPicker)||n.baseLayerPicker!==!1;if(b&&t(n.imageryProvider))throw new r("options.imageryProvider is not available when using the BaseLayerPicker widget. Either specify options.selectedImageryProviderViewModel instead or set options.baseLayerPicker to false.");if(!b&&t(n.selectedImageryProviderViewModel))throw new r("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.imageryProvider instead or set options.baseLayerPicker to true.");var T=document.createElement("div");T.className="cesium-viewer",i.appendChild(T);var A=document.createElement("div");A.className="cesium-viewer-cesiumWidgetContainer",T.appendChild(A);var D=new p(A,{terrainProvider:n.terrainProvider,imageryProvider:b?!1:n.imageryProvider,skyBox:n.skyBox,sceneMode:n.sceneMode,contextOptions:n.contextOptions,useDefaultRenderLoop:!1}),P=new l,M=new u(D.scene,P),I=D.clock,O=new f(I),R=new a,L=document.createElement("div");L.className="cesium-viewer-toolbar",T.appendChild(L);var z;if(!t(n.geocoder)||n.geocoder!==!1){var N=document.createElement("div");N.className="cesium-viewer-geocoderContainer",L.appendChild(N),z=new y({container:N,scene:D.scene,ellipsoid:D.centralBody.getEllipsoid()})}var B;t(n.homeButton)&&n.homeButton===!1||(B=new w(L,D.scene,D.sceneTransitioner,D.centralBody.getEllipsoid()),t(z)&&R.add(B.viewModel.command.afterExecute,function(){var e=z.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}));var F;t(n.sceneModePicker)&&n.sceneModePicker===!1||(F=new C(L,D.sceneTransitioner));var V;if(b){var k=e(n.imageryProviderViewModels,m());V=new d(L,D.centralBody.getImageryLayers(),k),V.viewModel.selectedItem=e(n.selectedImageryProviderViewModel,k[0]);var U=L.getElementsByClassName("cesium-baseLayerPicker-dropDown");this._baseLayerPickerDropDown=U[0]}var W;if(!t(n.animation)||n.animation!==!1){var q=document.createElement("div");q.className="cesium-viewer-animationContainer",T.appendChild(q),W=new c(q,new h(O))}var G;if(!t(n.timeline)||n.timeline!==!1){var H=document.createElement("div");H.className="cesium-viewer-timelineContainer",T.appendChild(H),G=new x(H,I),G.addEventListener("settime",S,!1),G.zoomTo(I.startTime,I.stopTime)}var j;if(t(n.fullscreenButton)&&n.fullscreenButton===!1)t(G)&&(G.container.style.right=0);else{var Y=document.createElement("div");Y.className="cesium-viewer-fullscreenContainer",T.appendChild(Y),j=new v(Y,e(n.fullscreenElement,i)),this._fullscreenSubscription=_(j.viewModel,"isFullscreenEnabled",function(e){Y.style.display=e?"block":"none",t(G)&&(G.container.style.right=Y.clientWidth+"px",G.resize())})}R.add(I.onTick,s),R.add(P.dataSourceAdded,E),this._container=i,this._element=T,this._cesiumWidget=D,this._dataSourceCollection=P,this._dataSourceDisplay=M,this._clockViewModel=O,this._toolbar=L,this._homeButton=B,this._sceneModePicker=F,this._baseLayerPicker=V,this._animation=W,this._timeline=G,this._fullscreenButton=j,this._geocoder=z,this._eventHelper=R,this._lastWidth=0,this._lastHeight=0,this._useDefaultRenderLoop=void 0,this._renderLoopRunning=!1,this._showRenderLoopErrors=e(n.showRenderLoopErrors,!0),this._renderLoopError=new o,this.useDefaultRenderLoop=e(n.useDefaultRenderLoop,!0)};return i(b.prototype,{container:{get:function(){return this._container}},cesiumWidget:{get:function(){return this._cesiumWidget}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},centralBody:{get:function(){return this._cesiumWidget.centralBody}},clock:{get:function(){return this._cesiumWidget.clock}},sceneTransitioner:{get:function(){return this._cesiumWidget.sceneTransitioner}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},renderLoopError:{get:function(){return this._renderLoopError}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&E(this))}}}),b.prototype.extend=function(e,i){if(!t(e))throw new r("mixin is required.");e(this,i)},b.prototype.resize=function(){var e=this._cesiumWidget;e.resize();var r=this._container,i=r.clientWidth,n=r.clientHeight;if(i!==this._lastWidth||n!==this._lastHeight){var o=this._baseLayerPickerDropDown;if(t(o)){var a=n-125;o.style.maxHeight=a+"px"}var s,l=t(this._timeline),u=t(this._animation),c=!u,h=0;if(u){var d=this._lastWidth;s=this._animation.container,i>900?900>=d&&(h=169,s.style.width="169px",s.style.height="112px",c=!0,this._animation.resize()):i>=600?(600>d||d>900)&&(h=136,s.style.width="136px",s.style.height="90px",c=!0,this._animation.resize()):(d>600||0===d)&&(h=106,s.style.width="106px",s.style.height="70px",c=!0,this._animation.resize())}if(c){var m=0,p=h+5;if(l&&(m=this._timeline.container.clientHeight+3,this._timeline.container.style.left=h+"px"),l||u){var f=e.creditContainer;f.style.bottom=m+"px",f.style.left=p+"px"}}l&&this._timeline.resize(),this._lastWidth=i,this._lastHeight=n}},b.prototype.render=function(){this._cesiumWidget.render()},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),t(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),t(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),t(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),t(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),t(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),t(this._timeline)&&(this._timeline.removeEventListener("settime",S,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),t(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._dataSourceCollection=this._dataSourceCollection.destroy(),n(this)},b}),r("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/Event","../../Core/wrapFunction","../../DynamicScene/CzmlDataSource","../../DynamicScene/GeoJsonDataSource","../../ThirdParty/when","../getElement"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e.stopPropagation(),e.preventDefault()}function h(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",c,!1),i.removeEventListener("dragover",c,!1),i.removeEventListener("dragexit",c,!1))}function d(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",c,!1),e.addEventListener("dragover",c,!1),e.addEventListener("dragexit",c,!1)}function m(e,t){var r=e.length,i=t.length;return r>i&&-1!==e.indexOf(t,r-i)}function p(e,t){var r,i=t.toUpperCase();if(m(i,".CZML"))r=a;else{if(!(m(i,".GEOJSON")||m(i,".JSON")||m(i,".TOPOJSON")))return e.dropError.raiseEvent(e,t,"Unrecognized file extension: "+t),void 0;r=s}return function(i){var n=new r;try{l(n.load(JSON.parse(i.target.result),t),function(){e.dataSources.add(n)},function(r){e.dropError.raiseEvent(e,t,r)})}catch(o){e.dropError.raiseEvent(e,t,o)}}}function f(e,t){return function(r){e.dropError.raiseEvent(e,t,r.target.error)}}var v=function(a,s){function l(e){c(e),y&&a.dataSources.removeAll();for(var t=e.dataTransfer.files,r=t.length,i=0;r>i;i++){var n=t[i],o=new FileReader;o.onload=p(a,n.name),o.onerror=f(a,n.name),o.readAsText(n)}}if(!t(a))throw new r("viewer is required.");if(a.hasOwnProperty("dropTarget"))throw new r("dropTarget is already defined by another mixin.");if(a.hasOwnProperty("dropEnabled"))throw new r("dropEnabled is already defined by another mixin.");if(a.hasOwnProperty("dropError"))throw new r("dropError is already defined by another mixin.");if(a.hasOwnProperty("clearOnDrop"))throw new r("clearOnDrop is already defined by another mixin.");s=e(s,e.EMPTY_OBJECT);var m=!0,v=new n,y=e(s.clearOnDrop,!0),g=e(s.dropTarget,a.container);g=u(g),i(a,{dropTarget:{get:function(){return g},set:function(e){if(!t(e))throw new r("value is required.");h(g,l),g=e,d(g,l)}},dropEnabled:{get:function(){return m},set:function(e){e!==m&&(e?d(g,l):h(g,l),m=e)}},dropError:{get:function(){return v}},clearOnDrop:{get:function(){return y},set:function(e){y=e}}}),d(g,l),a.destroy=o(a,a.destroy,function(){a.dropEnabled=!1}),a._handleDrop=l};return v}),r("Widgets/Viewer/viewerDynamicObjectMixin",["../../Core/defined","../../Core/DeveloperError","../../Core/defineProperties","../../Core/Event","../../Core/EventHelper","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../Scene/SceneMode","../../DynamicScene/DynamicObjectView"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(u){function c(t){e(y)&&y.update(t.currentTime)}function h(t){var r=u.scene.pick(t.position);e(r)&&e(r.primitive)&&e(r.primitive.dynamicObject)&&e(r.primitive.dynamicObject.position)&&(u.trackedObject=r.primitive.dynamicObject)}function d(){u.trackedObject=void 0}function m(e,t,r){for(var i=r.length,n=0;i>n;n++){var o=r[n];if(u.trackedObject===o){u.homeButton.viewModel.command();break}}}function p(e,t){t.getDynamicObjectCollection().collectionChanged.addEventListener(m)}function f(t,r){r.getDynamicObjectCollection().collectionChanged.removeEventListener(m),e(v)&&r.getDynamicObjectCollection().getById(u.trackedObject.id)===u.trackedObject&&u.homeButton.viewModel.command()}if(!e(u))throw new t("viewer is required.");if(u.hasOwnProperty("trackedObject"))throw new t("trackedObject is already defined by another mixin.");if(u.hasOwnProperty("objectTracked"))throw new t("objectTracked is already defined by another mixin.");var v,y,g=new n,_=new i;g.add(u.clock.onTick,c),e(u.homeButton)&&g.add(u.homeButton.viewModel.command.beforeExecute,d),e(u.geocoder)&&g.add(u.geocoder.viewModel.search.beforeExecute,d);for(var w=u.dataSources,C=w.getLength(),x=0;C>x;x++)p(w,w.get(x));g.add(u.dataSources.dataSourceAdded,p),g.add(u.dataSources.dataSourceRemoved,f),u.screenSpaceEventHandler.setInputAction(h,o.LEFT_CLICK),r(u,{trackedObject:{get:function(){return v},set:function(t){var r=u.scene.getFrameState().mode;(r===s.COLUMBUS_VIEW||r===s.SCENE2D)&&(u.scene.getScreenSpaceCameraController().enableTranslate=!e(t)),(r===s.COLUMBUS_VIEW||r===s.SCENE3D)&&(u.scene.getScreenSpaceCameraController().enableTilt=!e(t)),v!==t&&(v=t,y=e(t)?new l(t,u.scene,u.centralBody.getEllipsoid()):void 0,_.raiseEvent(u,t))}},objectTracked:{get:function(){return _}}}),u.destroy=a(u,u.destroy,function(){g.removeAll(),u.screenSpaceEventHandler.removeInputAction(o.LEFT_CLICK);for(var e=u.dataSources,t=e.getLength(),r=0;t>r;r++)f(e,e.get(r))})};return u}),r("Widgets/checkForChromeFrame",["../Core/FeatureDetection","./getElement","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){e=t(e);var r=document.createElement("div");r.className="cesium-chromeFrameOverlay";var i=document.createElement("div");r.appendChild(i),i.innerHTML='Cesium requires WebGL, an open standard for displaying 3D content in a web browser. To enable WebGL in Internet Explorer, we recommend installing Google Chrome Frame, a free, unobtrusive plug-in offered by Google. To learn more about WebGL, visit http://www.khronos.org/webgl/.Would you like to install Chrome Frame now?
';var n=document.createElement("p");i.appendChild(n);var o=document.createElement("a");o.href="#",o.innerHTML="Yes, install Google Chrome Frame",o.onclick=function(){window.CFInstall.check({mode:"overlay",destination:document.URL}),e.removeChild(r)},n.appendChild(o),n=document.createElement("p"),i.appendChild(n);var a=document.createElement("a");a.href="#",a.innerHTML="No, not at this time",a.onclick=function(){e.removeChild(r)},n.appendChild(a),e.appendChild(r)}var n=function(t){var n=r.defer();if(e.isInternetExplorer()){var o=document.createElement("script");o.type="text/javascript",o.src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js";var a=document.getElementsByTagName("head")[0];a.appendChild(o);var s=setInterval(function(){if(window.CFInstall){clearInterval(s);var e=!1;window.CFInstall.check({mode:"overlay",preventPrompt:!0,onmissing:function(){e=!0}}),e&&i(t),n.resolve(e)}},50)}else n.resolve(!1);return n.promise};return n}),r("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";var r=function(r){var i,n=[],o={id:void 0,result:void 0,error:void 0};return function(a){var s=a.data;n.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,n)}catch(l){o.error=l}t(i)||(i=e(self.webkitPostMessage,self.postMessage));try{i(o,n)}catch(l){o.result=void 0,o.error="postMessage failed with error: "+l+"\n with responseMessage: "+JSON.stringify(o),i(o)}}};return r}),r("Cesium",["./Core/AxisAlignedBoundingBox","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/DeveloperError","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidalOccluder","./Core/EncodedCartesian3","./Core/Enumeration","./Core/Event","./Core/EventHelper","./Core/Extent","./Core/ExtentGeometry","./Core/ExtentOutlineGeometry","./Core/FAR","./Core/FeatureDetection","./Core/Fullscreen","./Core/GeographicProjection","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/IntersectionTests","./Core/Interval","./Core/Iso8601","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/NearFarScalar","./Core/ObjectOrientedBoundingBox","./Core/Occluder","./Core/Packable","./Core/PackableForInterpolation","./Core/Plane","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/Queue","./Core/Ray","./Core/ReferenceFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/Shapes","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/TaskProcessor","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TridiagonalSystemSolver","./Core/VertexFormat","./Core/Visibility","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebMercatorProjection","./Core/WindingOrder","./Core/barycentricCoordinates","./Core/binarySearch","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/clone","./Core/combine","./Core/createGuid","./Core/defaultValue","./Core/defineProperties","./Core/defined","./Core/destroyObject","./Core/freezeObject","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/jsonp","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/pointInsideTriangle","./Core/requestAnimationFrame","./Core/throttleRequestByServer","./Core/wrapFunction","./Core/writeTextToCanvas","./DynamicScene/ColorMaterialProperty","./DynamicScene/CompositeDynamicObjectCollection","./DynamicScene/CompositeMaterialProperty","./DynamicScene/CompositePositionProperty","./DynamicScene/CompositeProperty","./DynamicScene/ConstantPositionProperty","./DynamicScene/ConstantProperty","./DynamicScene/CzmlDataSource","./DynamicScene/DataSource","./DynamicScene/DataSourceCollection","./DynamicScene/DataSourceDisplay","./DynamicScene/DynamicBillboard","./DynamicScene/DynamicBillboardVisualizer","./DynamicScene/DynamicClock","./DynamicScene/DynamicCone","./DynamicScene/DynamicConeVisualizerUsingCustomSensor","./DynamicScene/DynamicDirectionsProperty","./DynamicScene/DynamicEllipse","./DynamicScene/DynamicEllipsoid","./DynamicScene/DynamicEllipsoidVisualizer","./DynamicScene/DynamicLabel","./DynamicScene/DynamicLabelVisualizer","./DynamicScene/DynamicObject","./DynamicScene/DynamicObjectCollection","./DynamicScene/DynamicObjectView","./DynamicScene/DynamicPath","./DynamicScene/DynamicPathVisualizer","./DynamicScene/DynamicPoint","./DynamicScene/DynamicPointVisualizer","./DynamicScene/DynamicPolygon","./DynamicScene/DynamicPolygonVisualizer","./DynamicScene/DynamicPolyline","./DynamicScene/DynamicPolylineVisualizer","./DynamicScene/DynamicPyramid","./DynamicScene/DynamicPyramidVisualizer","./DynamicScene/DynamicVector","./DynamicScene/DynamicVectorVisualizer","./DynamicScene/DynamicVertexPositionsProperty","./DynamicScene/GeoJsonDataSource","./DynamicScene/GridMaterialProperty","./DynamicScene/ImageMaterialProperty","./DynamicScene/MaterialProperty","./DynamicScene/PolylineOutlineMaterialProperty","./DynamicScene/PositionProperty","./DynamicScene/Property","./DynamicScene/ReferenceProperty","./DynamicScene/SampledPositionProperty","./DynamicScene/SampledProperty","./DynamicScene/TimeIntervalCollectionPositionProperty","./DynamicScene/TimeIntervalCollectionProperty","./DynamicScene/VisualizerCollection","./DynamicScene/createDynamicPropertyDescriptor","./Renderer/AutomaticUniforms","./Renderer/BlendEquation","./Renderer/BlendFunction","./Renderer/BlendingState","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/Context","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/CullFace","./Renderer/DepthFunction","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/PixelFormat","./Renderer/RenderState","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/StencilFunction","./Renderer/StencilOperation","./Renderer/Texture","./Renderer/TextureAtlas","./Renderer/TextureAtlasBuilder","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformDatatype","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/VertexLayout","./Renderer/createShaderSource","./Renderer/loadCubeMap","./Scene/AnimationCollection","./Scene/Appearance","./Scene/ArcGisImageServerTerrainProvider","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/Camera","./Scene/CameraColumbusViewMode","./Scene/CameraController","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/CentralBody","./Scene/CentralBodySurface","./Scene/CentralBodySurfaceShaderSet","./Scene/CesiumTerrainProvider","./Scene/CompositePrimitive","./Scene/Credit","./Scene/CreditDisplay","./Scene/CullingVolume","./Scene/CustomSensorVolume","./Scene/DebugAppearance","./Scene/DebugModelMatrixPrimitive","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/EllipsoidTerrainProvider","./Scene/ExtentPrimitive","./Scene/FrameState","./Scene/FrustumCommands","./Scene/GeographicTilingScheme","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/HeightmapTerrainData","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/Material","./Scene/MaterialAppearance","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/PerInstanceColorAppearance","./Scene/PerformanceDisplay","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/Polygon","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/RectangularPyramidSensorVolume","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/SensorVolumeCollection","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainData","./Scene/TerrainMesh","./Scene/TerrainProvider","./Scene/TerrainState","./Scene/TexturePool","./Scene/Tile","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileMapServiceImageryProvider","./Scene/TileProviderError","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TilingScheme","./Scene/VRTheWorldTerrainProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMercatorTilingScheme","./Scene/createTangentSpaceDebugPrimitive","./Scene/sampleTerrain","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/knockout-3.0.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/weakmap","./ThirdParty/when","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/ImageryProviderViewModel","./Widgets/BaseLayerPicker/createDefaultBaseLayers","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/Observable","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerDynamicObjectMixin","./Widgets/checkForChromeFrame","./Widgets/createCommand","./Widgets/getElement","./Widgets/subscribeAndEvaluate","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,y,g,_,w,C,x,S,E,b,T,A,D,P,M,I,O,R,L,z,N,B,F,V,k,U,W,q,G,H,j,Y,X,Z,J,K,Q,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,mt,pt,ft,vt,yt,gt,_t,wt,Ct,xt,St,Et,bt,Tt,At,Dt,Pt,Mt,It,Ot,Rt,Lt,zt,Nt,Bt,Ft,Vt,kt,Ut,Wt,qt,Gt,Ht,jt,Yt,Xt,Zt,Jt,Kt,Qt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,hr,dr,mr,pr,fr,vr,yr,gr,_r,wr,Cr,xr,Sr,Er,br,Tr,Ar,Dr,Pr,Mr,Ir,Or,Rr,Lr,zr,Nr,Br,Fr,Vr,kr,Ur,Wr,qr,Gr,Hr,jr,Yr,Xr,Zr,Jr,Kr,Qr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,hi,di,mi,pi,fi,vi,yi,gi,_i,wi,Ci,xi,Si,Ei,bi,Ti,Ai,Di,Pi,Mi,Ii,Oi,Ri,Li,zi,Ni,Bi,Fi,Vi,ki,Ui,Wi,qi,Gi,Hi,ji,Yi,Xi,Zi,Ji,Ki,Qi,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,mn,pn,fn,vn,yn,gn,_n,wn,Cn,xn,Sn,En,bn,Tn,An,Dn,Pn,Mn,In,On,Rn,Ln,zn,Nn,Bn,Fn,Vn,kn,Un,Wn,qn,Gn,Hn,jn,Yn,Xn,Zn,Jn,Kn,Qn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,mo,po,fo,vo,yo,go,_o,wo,Co,xo,So,Eo,bo,To,Ao,Do,Po,Mo,Io,Oo,Ro,Lo,zo,No,Bo,Fo,Vo,ko,Uo,Wo,qo,Go,Ho,jo,Yo,Xo,Zo,Jo,Ko,Qo,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,ha,da,ma,pa,fa,va,ya,ga,_a,wa,Ca,xa,Sa,Ea,ba,Ta,Aa,Da,Pa,Ma,Ia,Oa,Ra,La,za,Na,Ba,Fa,Va,ka,Ua,Wa,qa,Ga,Ha,ja,Ya,Xa,Za,Ja,Ka,Qa,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,hs,ds,ms,ps,fs){"use strict";var vs={_shaders:{}};return vs.AxisAlignedBoundingBox=e,vs.BingMapsApi=t,vs.BoundingRectangle=r,vs.BoundingSphere=i,vs.BoxGeometry=n,vs.BoxOutlineGeometry=o,vs.Cartesian2=a,vs.Cartesian3=s,vs.Cartesian4=l,vs.Cartographic=u,vs.CatmullRomSpline=c,vs.CircleGeometry=h,vs.CircleOutlineGeometry=d,vs.Clock=m,vs.ClockRange=p,vs.ClockStep=f,vs.Color=v,vs.ColorGeometryInstanceAttribute=y,vs.ComponentDatatype=g,vs.CornerType=_,vs.CorridorGeometry=w,vs.CorridorGeometryLibrary=C,vs.CorridorOutlineGeometry=x,vs.CubicRealPolynomial=S,vs.CylinderGeometry=E,vs.CylinderGeometryLibrary=b,vs.CylinderOutlineGeometry=T,vs.DefaultProxy=A,vs.DeveloperError=D,vs.EarthOrientationParameters=P,vs.EarthOrientationParametersSample=M,vs.EllipseGeometry=I,vs.EllipseGeometryLibrary=O,vs.EllipseOutlineGeometry=R,vs.Ellipsoid=L,vs.EllipsoidGeodesic=z,vs.EllipsoidGeometry=N,vs.EllipsoidOutlineGeometry=B,vs.EllipsoidTangentPlane=F,vs.EllipsoidalOccluder=V,vs.EncodedCartesian3=k,vs.Enumeration=U,vs.Event=W,vs.EventHelper=q,vs.Extent=G,vs.ExtentGeometry=H,vs.ExtentOutlineGeometry=j,vs.FAR=Y,vs.FeatureDetection=X,vs.Fullscreen=Z,vs.GeographicProjection=J,vs.Geometry=K,vs.GeometryAttribute=Q,vs.GeometryAttributes=$,vs.GeometryInstance=et,vs.GeometryInstanceAttribute=tt,vs.GeometryPipeline=rt,vs.HeightmapTessellator=it,vs.HermitePolynomialApproximation=nt,vs.HermiteSpline=ot,vs.Iau2000Orientation=at,vs.Iau2006XysData=st,vs.Iau2006XysSample=lt,vs.IauOrientationAxes=ut,vs.IauOrientationParameters=ct,vs.IndexDatatype=ht,vs.InterpolationAlgorithm=dt,vs.Intersect=mt,vs.IntersectionTests=pt,vs.Interval=ft,vs.Iso8601=vt,vs.JulianDate=yt,vs.KeyboardEventModifier=gt,vs.LagrangePolynomialApproximation=_t,vs.LeapSecond=wt,vs.LinearApproximation=Ct,vs.LinearSpline=xt,vs.Math=St,vs.Matrix2=Et,vs.Matrix3=bt,vs.Matrix4=Tt,vs.NearFarScalar=At,vs.ObjectOrientedBoundingBox=Dt,vs.Occluder=Pt,vs.Packable=Mt,vs.PackableForInterpolation=It,vs.Plane=Ot,vs.PolygonGeometry=Rt,vs.PolygonGeometryLibrary=Lt,vs.PolygonOutlineGeometry=zt,vs.PolygonPipeline=Nt,vs.PolylineGeometry=Bt,vs.PolylinePipeline=Ft,vs.PolylineVolumeGeometry=Vt,vs.PolylineVolumeGeometryLibrary=kt,vs.PolylineVolumeOutlineGeometry=Ut,vs.PrimitiveType=Wt,vs.QuadraticRealPolynomial=qt,vs.QuarticRealPolynomial=Gt,vs.Quaternion=Ht,vs.QuaternionSpline=jt,vs.Queue=Yt,vs.Ray=Xt,vs.ReferenceFrame=Zt,vs.RequestErrorEvent=Jt,vs.RuntimeError=Kt,vs.ScreenSpaceEventHandler=Qt,vs.ScreenSpaceEventType=$t,vs.Shapes=er,vs.ShowGeometryInstanceAttribute=tr,vs.Simon1994PlanetaryPositions=rr,vs.SimplePolylineGeometry=ir,vs.SphereGeometry=nr,vs.SphereOutlineGeometry=or,vs.Spherical=ar,vs.Spline=sr,vs.TaskProcessor=lr,vs.TimeConstants=ur,vs.TimeInterval=cr,vs.TimeIntervalCollection=hr,vs.TimeStandard=dr,vs.Tipsify=mr,vs.Transforms=pr,vs.TridiagonalSystemSolver=fr,vs.VertexFormat=vr,vs.Visibility=yr,vs.WallGeometry=gr,vs.WallGeometryLibrary=_r,vs.WallOutlineGeometry=wr,vs.WebMercatorProjection=Cr,vs.WindingOrder=xr,vs.barycentricCoordinates=Sr,vs.binarySearch=Er,vs.buildModuleUrl=br,vs.cancelAnimationFrame=Tr,vs.clone=Ar,vs.combine=Dr,vs.createGuid=Pr,vs.defaultValue=Mr,vs.defineProperties=Ir,vs.defined=Or,vs.destroyObject=Rr,vs.freezeObject=Lr,vs.getFilenameFromUri=zr,vs.getImagePixels=Nr,vs.isCrossOriginUrl=Br,vs.isLeapYear=Fr,vs.jsonp=Vr,vs.loadArrayBuffer=kr,vs.loadBlob=Ur,vs.loadImage=Wr,vs.loadImageViaBlob=qr,vs.loadJson=Gr,vs.loadText=Hr,vs.loadWithXhr=jr,vs.loadXML=Yr,vs.pointInsideTriangle=Xr,vs.requestAnimationFrame=Zr,vs.throttleRequestByServer=Jr,vs.wrapFunction=Kr,vs.writeTextToCanvas=Qr,vs.ColorMaterialProperty=$r,vs.CompositeDynamicObjectCollection=ei,vs.CompositeMaterialProperty=ti,vs.CompositePositionProperty=ri,vs.CompositeProperty=ii,vs.ConstantPositionProperty=ni,vs.ConstantProperty=oi,vs.CzmlDataSource=ai,vs.DataSource=si,vs.DataSourceCollection=li,vs.DataSourceDisplay=ui,vs.DynamicBillboard=ci,vs.DynamicBillboardVisualizer=hi,vs.DynamicClock=di,vs.DynamicCone=mi,vs.DynamicConeVisualizerUsingCustomSensor=pi,vs.DynamicDirectionsProperty=fi,vs.DynamicEllipse=vi,vs.DynamicEllipsoid=yi,vs.DynamicEllipsoidVisualizer=gi,vs.DynamicLabel=_i,vs.DynamicLabelVisualizer=wi,vs.DynamicObject=Ci,vs.DynamicObjectCollection=xi,vs.DynamicObjectView=Si,vs.DynamicPath=Ei,vs.DynamicPathVisualizer=bi,vs.DynamicPoint=Ti,vs.DynamicPointVisualizer=Ai,vs.DynamicPolygon=Di,vs.DynamicPolygonVisualizer=Pi,vs.DynamicPolyline=Mi,vs.DynamicPolylineVisualizer=Ii,vs.DynamicPyramid=Oi,vs.DynamicPyramidVisualizer=Ri,vs.DynamicVector=Li,vs.DynamicVectorVisualizer=zi,vs.DynamicVertexPositionsProperty=Ni,vs.GeoJsonDataSource=Bi,vs.GridMaterialProperty=Fi,vs.ImageMaterialProperty=Vi,vs.MaterialProperty=ki,vs.PolylineOutlineMaterialProperty=Ui,vs.PositionProperty=Wi,vs.Property=qi,vs.ReferenceProperty=Gi,vs.SampledPositionProperty=Hi,vs.SampledProperty=ji,vs.TimeIntervalCollectionPositionProperty=Yi,vs.TimeIntervalCollectionProperty=Xi,vs.VisualizerCollection=Zi,vs.createDynamicPropertyDescriptor=Ji,vs.AutomaticUniforms=Ki,vs.BlendEquation=Qi,vs.BlendFunction=$i,vs.BlendingState=en,vs.Buffer=tn,vs.BufferUsage=rn,vs.ClearCommand=nn,vs.Context=on,vs.CubeMap=an,vs.CubeMapFace=sn,vs.CullFace=ln,vs.DepthFunction=un,vs.DrawCommand=cn,vs.Framebuffer=hn,vs.MipmapHint=dn,vs.Pass=mn,vs.PassState=pn,vs.PickFramebuffer=fn,vs.PixelDatatype=vn,vs.PixelFormat=yn,vs.RenderState=gn,vs.Renderbuffer=_n,vs.RenderbufferFormat=wn,vs.ShaderCache=Cn,vs.ShaderProgram=xn,vs.StencilFunction=Sn,vs.StencilOperation=En,vs.Texture=bn,vs.TextureAtlas=Tn,vs.TextureAtlasBuilder=An,vs.TextureMagnificationFilter=Dn,vs.TextureMinificationFilter=Pn,vs.TextureWrap=Mn,vs.UniformDatatype=In,vs.UniformState=On,vs.VertexArray=Rn,vs.VertexArrayFacade=Ln,vs.VertexLayout=zn,vs.createShaderSource=Nn,vs.loadCubeMap=Bn,vs.AnimationCollection=Fn,vs.Appearance=Vn,vs.ArcGisImageServerTerrainProvider=kn,vs.ArcGisMapServerImageryProvider=Un,vs.Billboard=Wn,vs.BillboardCollection=qn,vs.BingMapsImageryProvider=Gn,vs.BingMapsStyle=Hn,vs.Camera=jn,vs.CameraColumbusViewMode=Yn,vs.CameraController=Xn,vs.CameraEventAggregator=Zn,vs.CameraEventType=Jn,vs.CameraFlightPath=Kn,vs.CentralBody=Qn,vs.CentralBodySurface=$n,vs.CentralBodySurfaceShaderSet=eo,vs.CesiumTerrainProvider=to,vs.CompositePrimitive=ro,vs.Credit=io,vs.CreditDisplay=no,vs.CullingVolume=oo,vs.CustomSensorVolume=ao,vs.DebugAppearance=so,vs.DebugModelMatrixPrimitive=lo,vs.DiscardMissingTileImagePolicy=uo,vs.EllipsoidPrimitive=co,vs.EllipsoidSurfaceAppearance=ho,vs.EllipsoidTerrainProvider=mo,vs.ExtentPrimitive=po,vs.FrameState=fo,vs.FrustumCommands=vo,vs.GeographicTilingScheme=yo,vs.GoogleEarthImageryProvider=go,vs.GridImageryProvider=_o,vs.HeightmapTerrainData=wo,vs.HorizontalOrigin=Co,vs.Imagery=xo,vs.ImageryLayer=So,vs.ImageryLayerCollection=Eo,vs.ImageryProvider=bo,vs.ImageryState=To,vs.Label=Ao,vs.LabelCollection=Do,vs.LabelStyle=Po,vs.Material=Mo,vs.MaterialAppearance=Io,vs.Moon=Oo,vs.NeverTileDiscardPolicy=Ro,vs.OpenStreetMapImageryProvider=Lo,vs.OrthographicFrustum=zo,vs.PerInstanceColorAppearance=No,vs.PerformanceDisplay=Bo,vs.PerspectiveFrustum=Fo,vs.PerspectiveOffCenterFrustum=Vo,vs.Polygon=ko,vs.Polyline=Uo,vs.PolylineCollection=Wo,vs.PolylineColorAppearance=qo,vs.PolylineMaterialAppearance=Go,vs.Primitive=Ho,vs.PrimitivePipeline=jo,vs.PrimitiveState=Yo,vs.RectangularPyramidSensorVolume=Xo,vs.Scene=Zo,vs.SceneMode=Jo,vs.SceneTransforms=Ko,vs.SceneTransitioner=Qo,vs.ScreenSpaceCameraController=$o,vs.SensorVolumeCollection=ea,vs.SingleTileImageryProvider=ta,vs.SkyAtmosphere=ra,vs.SkyBox=ia,vs.Sun=na,vs.SunPostProcess=oa,vs.TerrainData=aa,vs.TerrainMesh=sa,vs.TerrainProvider=la,vs.TerrainState=ua,vs.TexturePool=ca,vs.Tile=ha,vs.TileCoordinatesImageryProvider=da,vs.TileDiscardPolicy=ma,vs.TileImagery=pa,vs.TileMapServiceImageryProvider=fa,vs.TileProviderError=va,vs.TileReplacementQueue=ya,vs.TileState=ga,vs.TileTerrain=_a,vs.TilingScheme=wa,vs.VRTheWorldTerrainProvider=Ca,vs.VerticalOrigin=xa,vs.ViewportQuad=Sa,vs.WebMapServiceImageryProvider=Ea,vs.WebMercatorTilingScheme=ba,vs.createTangentSpaceDebugPrimitive=Ta,vs.sampleTerrain=Aa,vs.Tween=Da,vs.Uri=Pa,vs["knockout-3.0.0"]=Ma,vs["knockout-es5"]=Ia,vs.knockout=Oa,vs.measureText=Ra,vs["mersenne-twister"]=La,vs.sprintf=za,vs.topojson=Na,vs.weakmap=Ba,vs.when=Fa,vs.Animation=Va,vs.AnimationViewModel=ka,vs.BaseLayerPicker=Ua,vs.BaseLayerPickerViewModel=Wa,vs.ImageryProviderViewModel=qa,vs.createDefaultBaseLayers=Ga,vs.CesiumWidget=Ha,vs.ClockViewModel=ja,vs.Command=Ya,vs.FullscreenButton=Xa,vs.FullscreenButtonViewModel=Za,vs.Geocoder=Ja,vs.GeocoderViewModel=Ka,vs.HomeButton=Qa,vs.HomeButtonViewModel=$a,vs.Observable=es,vs.SceneModePicker=ts,vs.SceneModePickerViewModel=rs,vs.SvgPathBindingHandler=is,vs.Timeline=ns,vs.TimelineHighlightRange=os,vs.TimelineTrack=as,vs.ToggleButtonViewModel=ss,vs.Viewer=ls,vs.viewerDragDropMixin=us,vs.viewerDynamicObjectMixin=cs,vs.checkForChromeFrame=hs,vs.createCommand=ds,vs.getElement=ms,vs.subscribeAndEvaluate=ps,vs.createTaskProcessorWorker=fs,vs
-}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}();
\ No newline at end of file
+!function(){var e,t,r;!function(i){function n(e,t){return C.call(e,t)}function o(e,t){var r,i,n,o,a,s,l,u,c,h,d=t&&t.split("/"),m=_.map,p=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),u=0;u0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||p)&&m){for(r=e.split("/"),u=r.length;u>0;u-=1){if(i=r.slice(0,u).join("/"),d)for(c=d.length;c>0;c-=1)if(n=m[d.slice(0,c).join("/")],n&&(n=n[i])){o=n,a=u;break}if(o)break;!s&&p&&p[i]&&(s=p[i],l=u)}!o&&s&&(o=s,a=l),o&&(r.splice(0,a,o),e=r.join("/"))}return e}function a(e,t){return function(){return m.apply(i,S.call(arguments,0).concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(g,e)){var t=g[e];delete g[e],y[e]=!0,d.apply(i,t)}if(!n(v,e)&&!n(y,e))throw new Error("No "+e);return v[e]}function c(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function h(e){return function(){return _&&_.config&&_.config[e]||{}}}var d,m,p,f,v={},g={},_={},y={},C=Object.prototype.hasOwnProperty,S=[].slice;p=function(e,t){var r,i=c(e),n=i[0];return e=i[1],n&&(n=o(n,t),r=u(n)),n?e=r&&r.normalize?r.normalize(e,s(t)):o(e,t):(e=o(e,t),i=c(e),n=i[0],e=i[1],n&&(r=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:r}},f={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,r,o){var s,c,h,d,m,_,C=[];if(o=o||e,"function"==typeof r){for(t=!t.length&&r.length?["require","exports","module"]:t,m=0;md;d++){var m=e[d],p=m.x,f=m.y,v=m.z;n=Math.min(p,n),l=Math.max(p,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(v,s),c=Math.max(v,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var _=r.maximum;_.x=l,_.y=u,_.z=c;var y=i.add(g,_,r.center);return i.multiplyByScalar(y,.5,y),r},o.clone=function(e,r){return t(e)?t(r)?(r.minimum=i.clone(e.minimum,r.minimum),r.maximum=i.clone(e.maximum,r.maximum),r.center=i.clone(e.center,r.center),r):new o(e.minimum,e.maximum):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&i.equals(e.center,r.center)&&i.equals(e.minimum,r.minimum)&&i.equals(e.maximum,r.maximum)};var a=new i;return o.intersect=function(e,t){a=i.subtract(e.maximum,e.minimum,a);var r=i.multiplyByScalar(a,.5,a),o=r.x*Math.abs(t.x)+r.y*Math.abs(t.y)+r.z*Math.abs(t.z),s=i.dot(e.center,t)+t.w;return s-o>0?n.INSIDE:0>s+o?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersect=function(e){return o.intersect(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),r("Core/BingMapsApi",["./defined"],function(e){"use strict";var t={};t.defaultKey=void 0;var r=!1;return t.getKey=function(i){return e(i)?i:e(t.defaultKey)?t.defaultKey:(r||(console.log("This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API."),r=!0),"Aj1ony_-Typ-KjG9SJWiKSHY23U1KmK7yAmZa9lDmuF2osXWkcZ22VPsqmCt0TCt")},t}),r("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";var n=function(t,r){this.x=e(t,0),this.y=e(r,0)};n.fromElements=function(e,r,i){return t(i)?(i.x=e,i.y=r,i):new n(e,r)},n.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new n(e.x,e.y):void 0},n.fromCartesian3=n.clone,n.fromCartesian4=n.clone,n.packedLength=2,n.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i]=t.y},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.x=r[i++],o.y=r[i],o},n.fromArray=n.unpack,n.getMaximumComponent=function(e){return Math.max(e.x,e.y)},n.getMinimumComponent=function(e){return Math.min(e.x,e.y)},n.getMinimumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.min(e.x,r.x),i.y=Math.min(e.y,r.y),i},n.getMaximumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.max(e.x,r.x),i.y=Math.max(e.y,r.y),i},n.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},n.magnitude=function(e){return Math.sqrt(n.magnitudeSquared(e))};var o=new n;n.distance=function(e,t){return n.subtract(e,t,o),n.magnitude(o)},n.normalize=function(e,r){var i=n.magnitude(e);return t(r)?(r.x=e.x/i,r.y=e.y/i,r):new n(e.x/i,e.y/i)},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.multiplyComponents=function(e,r,i){return t(i)?(i.x=e.x*r.x,i.y=e.y*r.y,i):new n(e.x*r.x,e.y*r.y)},n.add=function(e,r,i){return t(i)?(i.x=e.x+r.x,i.y=e.y+r.y,i):new n(e.x+r.x,e.y+r.y)},n.subtract=function(e,r,i){return t(i)?(i.x=e.x-r.x,i.y=e.y-r.y,i):new n(e.x-r.x,e.y-r.y)},n.multiplyByScalar=function(e,r,i){return t(i)?(i.x=e.x*r,i.y=e.y*r,i):new n(e.x*r,e.y*r)},n.divideByScalar=function(e,r,i){return t(i)?(i.x=e.x/r,i.y=e.y/r,i):new n(e.x/r,e.y/r)},n.negate=function(e,r){return t(r)?(r.x=-e.x,r.y=-e.y,r):new n(-e.x,-e.y)},n.abs=function(e,r){return t(r)?(r.x=Math.abs(e.x),r.y=Math.abs(e.y),r):new n(Math.abs(e.x),Math.abs(e.y))};var a=new n;n.lerp=function(e,t,r,i){return n.multiplyByScalar(t,r,a),i=n.multiplyByScalar(e,1-r,i),n.add(a,i,i)};var s=new n,l=new n;n.angleBetween=function(e,t){return n.normalize(e,s),n.normalize(t,l),Math.acos(n.dot(s,l))};var u=new n;return n.mostOrthogonalAxis=function(e,t){var r=n.normalize(e,u);return n.abs(r,r),t=r.x<=r.y?n.clone(n.UNIT_X,t):n.clone(n.UNIT_Y,t)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},n.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i},n.ZERO=i(new n(0,0)),n.UNIT_X=i(new n(1,0)),n.UNIT_Y=i(new n(0,1)),n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.x+", "+this.y+")"},n}),r("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r>>1^t[1&e];for(;r>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),r("Core/Math",["./defaultValue","./defined","./DeveloperError","../ThirdParty/mersenne-twister"],function(e,t,r,i){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},n.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},n.lerp=function(e,t,r){return(1-r)*e+r*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+t)>e;)e+=i;if(-r>e)return-r;for(;e>r+t;)e-=i;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(t,r,i){return i=e(i,0),Math.abs(t-r)<=i};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var r=o[t-1],i=t;e>=i;i++)o.push(r*i);return o[e]},n.incrementWrap=function(t,r,i){return i=e(i,0),++t,t>r&&(t=i),t},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new i;return n.setRandomNumberSeed=function(e){a=new i(e)},n.nextRandomNumber=function(){return a.random()},n}),r("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(i,0)};return o.fromDegrees=function(r,i,a,s){return r=n.toRadians(e(r,0)),i=n.toRadians(e(i,0)),a=e(a,0),t(s)?(s.longitude=r,s.latitude=i,s.height=a,s):new o(r,i,a)},o.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new o(e.longitude,e.latitude,e.height):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},o.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=i&&Math.abs(e.latitude-r.latitude)<=i&&Math.abs(e.height-r.height)<=i},o.toString=function(e){return"("+e.longitude+", "+e.latitude+", "+e.height+")"},o.ZERO=i(new o(0,0,0)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return o.toString(this)},o}),r("Core/Ellipsoid",["./freezeObject","./defaultValue","./defined","./defineProperties","./DeveloperError","./Math","./Cartesian3","./Cartographic"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,r,i){e=t(e,0),r=t(r,0),i=t(i,0),this._radii=new a(e,r,i),this._radiiSquared=new a(e*e,r*r,i*i),this._radiiToTheFourth=new a(e*e*e*e,r*r*r*r,i*i*i*i),this._oneOverRadii=new a(0===e?0:1/e,0===r?0:1/r,0===i?0:1/i),this._oneOverRadiiSquared=new a(0===e?0:1/(e*e),0===r?0:1/(r*r),0===i?0:1/(i*i)),this._minimumRadius=Math.min(e,r,i),this._maximumRadius=Math.max(e,r,i),this._centerToleranceSquared=o.EPSILON1};i(l.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),l.clone=function(e,t){if(!r(e))return void 0;var i=e._radii;return r(t)?(a.clone(i,t._radii),a.clone(e._radiiSquared,t._radiiSquared),a.clone(e._radiiToTheFourth,t._radiiToTheFourth),a.clone(e._oneOverRadii,t._oneOverRadii),a.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new l(i.x,i.y,i.z)},l.fromCartesian3=function(e){return r(e)?new l(e.x,e.y,e.z):new l},l.WGS84=e(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=e(new l(1,1,1)),l.MOON=e(new l(o.LUNAR_RADIUS,o.LUNAR_RADIUS,o.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.geocentricSurfaceNormal=a.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,n=e.latitude,o=Math.cos(n),s=o*Math.cos(i),l=o*Math.sin(i),u=Math.sin(n);return r(t)||(t=new a),t.x=s,t.y=l,t.z=u,a.normalize(t,t)},l.prototype.geodeticSurfaceNormal=function(e,t){return t=a.multiplyComponents(e,this._oneOverRadiiSquared,t),a.normalize(t,t)};var u=new a,c=new a;l.prototype.cartographicToCartesian=function(e,t){var r=u,i=c;this.geodeticSurfaceNormalCartographic(e,r),a.multiplyComponents(this._radiiSquared,r,i);var n=Math.sqrt(a.dot(r,i));return a.divideByScalar(i,n,i),a.multiplyByScalar(r,e.height,r),a.add(i,r,t)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var h=new a,d=new a,m=new a;l.prototype.cartesianToCartographic=function(e,t){var i=this.scaleToGeodeticSurface(e,d);if(!r(i))return void 0;var n=this.geodeticSurfaceNormal(i,h),l=a.subtract(e,i,m),u=Math.atan2(n.y,n.x),c=Math.asin(n.z),p=o.sign(a.dot(l,e))*a.magnitude(l);return r(t)?(t.longitude=u,t.latitude=c,t.height=p,t):new s(u,c,p)},l.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t};var p=new a,f=new a;return l.prototype.scaleToGeodeticSurface=function(e,t){var i=e.x,n=e.y,s=e.z,l=this._oneOverRadii,u=l.x,c=l.y,h=l.z,d=i*i*u*u,m=n*n*c*c,v=s*s*h*h,g=d+m+v,_=Math.sqrt(1/g),y=a.multiplyByScalar(e,_,p);if(go.EPSILON12);return r(t)?(t.x=i*A,t.y=n*P,t.z=s*D,t):new a(i*A,n*P,s*D)},l.prototype.scaleToGeocentricSurface=function(e,t){var r=e.x,i=e.y,n=e.z,o=this._oneOverRadiiSquared,s=1/Math.sqrt(r*r*o.x+i*i*o.y+n*n*o.z);return a.multiplyByScalar(e,s,t)},l.prototype.transformPositionToScaledSpace=function(e,t){return a.multiplyComponents(e,this._oneOverRadii,t)},l.prototype.transformPositionFromScaledSpace=function(e,t){return a.multiplyComponents(e,this._radii,t)},l.prototype.equals=function(e){return this===e||r(e)&&a.equals(this._radii,e._radii)},l.prototype.toString=function(){return this._radii.toString()},l}),r("Core/GeographicProjection",["./defaultValue","./defined","./defineProperties","./Cartesian3","./Cartographic","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";var a=function(t){this._ellipsoid=e(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return r(a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),a.prototype.project=function(e,r){var n=this._semimajorAxis,o=e.longitude*n,a=e.latitude*n,s=e.height;return t(r)?(r.x=o,r.y=a,r.z=s,r):new i(o,a,s)},a.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,o=e.x*i,a=e.y*i,s=e.z;return t(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new n(o,a,s)},a}),r("Core/BoundingRectangle",["./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartographic","./GeographicProjection","./Intersect"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r,i,n){this.x=e(t,0),this.y=e(r,0),this.width=e(i,0),this.height=e(n,0)};s.fromPoints=function(e,r){if(t(r)||(r=new s),!t(e)||0===e.length)return r.x=0,r.y=0,r.width=0,r.height=0,r;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,l=e[0].y,u=1;i>u;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),l=Math.max(d,l)}return r.x=n,r.y=o,r.width=a-n,r.height=l-o,r};var l=new o,u=new n,c=new n;return s.fromExtent=function(r,n,o){if(t(o)||(o=new s),!t(r))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=e(n,l);var a=n.project(r.getSouthwest(u)),h=n.project(r.getNortheast(c));return i.subtract(h,a,h),o.x=a.x,o.y=a.y,o.width=h.x,o.height=h.y,o},s.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.width=e.width,r.height=e.height,r):new s(e.x,e.y,e.width,e.height):void 0},s.union=function(e,r,i){t(i)||(i=new s);var n=Math.min(e.x,r.x),o=Math.min(e.y,r.y),a=Math.max(e.x+e.width,r.x+r.width),l=Math.max(e.y+e.height,r.y+r.height);return i.x=n,i.y=o,i.width=a-n,i.height=l-o,i},s.expand=function(e,t,r){r=s.clone(e,r);var i=t.x-r.x,n=t.y-r.y;return i>r.width?r.width=i:0>i&&(r.width-=i,r.x=t.x),n>r.height?r.height=n:0>n&&(r.height-=n,r.y=t.y),r},s.intersect=function(e,t){var r=e.x,i=e.y,n=t.x,o=t.y;return r>n+t.width||r+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.union=function(e,t){return s.union(this,e,t)},s.prototype.expand=function(e,t){return s.expand(this,e,t)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),r("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),r("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";var n=function(t,r,i,n){this.x=e(t,0),this.y=e(r,0),this.z=e(i,0),this.w=e(n,0)};n.fromElements=function(e,r,i,o,a){return t(a)?(a.x=e,a.y=r,a.z=i,a.w=o,a):new n(e,r,i,o)},n.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new n(e.x,e.y,e.z,e.w):void 0},n.packedLength=4,n.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i++]=t.y,r[i++]=t.z,r[i]=t.w},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.x=r[i++],o.y=r[i++],o.z=r[i++],o.w=r[i],o},n.fromArray=n.unpack,n.getMaximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},n.getMinimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},n.getMinimumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.min(e.x,r.x),i.y=Math.min(e.y,r.y),i.z=Math.min(e.z,r.z),i.w=Math.min(e.w,r.w),i},n.getMaximumByComponent=function(e,r,i){return t(i)||(i=new n),i.x=Math.max(e.x,r.x),i.y=Math.max(e.y,r.y),i.z=Math.max(e.z,r.z),i.w=Math.max(e.w,r.w),i},n.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},n.magnitude=function(e){return Math.sqrt(n.magnitudeSquared(e))};var o=new n;n.distance=function(e,t){return n.subtract(e,t,o),n.magnitude(o)},n.normalize=function(e,r){var i=n.magnitude(e);return t(r)?(r.x=e.x/i,r.y=e.y/i,r.z=e.z/i,r.w=e.w/i,r):new n(e.x/i,e.y/i,e.z/i,e.w/i)},n.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},n.multiplyComponents=function(e,r,i){return t(i)?(i.x=e.x*r.x,i.y=e.y*r.y,i.z=e.z*r.z,i.w=e.w*r.w,i):new n(e.x*r.x,e.y*r.y,e.z*r.z,e.w*r.w)},n.add=function(e,r,i){return t(i)?(i.x=e.x+r.x,i.y=e.y+r.y,i.z=e.z+r.z,i.w=e.w+r.w,i):new n(e.x+r.x,e.y+r.y,e.z+r.z,e.w+r.w)},n.subtract=function(e,r,i){return t(i)?(i.x=e.x-r.x,i.y=e.y-r.y,i.z=e.z-r.z,i.w=e.w-r.w,i):new n(e.x-r.x,e.y-r.y,e.z-r.z,e.w-r.w)},n.multiplyByScalar=function(e,r,i){return t(i)?(i.x=e.x*r,i.y=e.y*r,i.z=e.z*r,i.w=e.w*r,i):new n(e.x*r,e.y*r,e.z*r,e.w*r)},n.divideByScalar=function(e,r,i){return t(i)?(i.x=e.x/r,i.y=e.y/r,i.z=e.z/r,i.w=e.w/r,i):new n(e.x/r,e.y/r,e.z/r,e.w/r)},n.negate=function(e,r){return t(r)?(r.x=-e.x,r.y=-e.y,r.z=-e.z,r.w=-e.w,r):new n(-e.x,-e.y,-e.z,-e.w)},n.abs=function(e,r){return t(r)?(r.x=Math.abs(e.x),r.y=Math.abs(e.y),r.z=Math.abs(e.z),r.w=Math.abs(e.w),r):new n(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z),Math.abs(e.w))};var a=new n;n.lerp=function(e,t,r,i){return n.multiplyByScalar(t,r,a),i=n.multiplyByScalar(e,1-r,i),n.add(a,i,i)};var s=new n;return n.mostOrthogonalAxis=function(e,t){var r=n.normalize(e,s);return n.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?n.clone(n.UNIT_X,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t):r.y<=r.z?r.y<=r.w?n.clone(n.UNIT_Y,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},n.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i&&Math.abs(e.z-r.z)<=i&&Math.abs(e.w-r.w)<=i},n.ZERO=i(new n(0,0,0,0)),n.UNIT_X=i(new n(1,0,0,0)),n.UNIT_Y=i(new n(0,1,0,0)),n.UNIT_Z=i(new n(0,0,1,0)),n.UNIT_W=i(new n(0,0,0,1)),n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},n}),r("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e){for(var t=0,r=0;9>r;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var i=e[u.getElementIndex(h[r],c[r])];t+=2*i*i}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,i=0,n=1,a=0;3>a;++a){var s=Math.abs(e[u.getElementIndex(h[a],c[a])]);s>i&&(n=a,i=s)}var l=1,d=0,m=c[n],p=h[n];if(Math.abs(e[u.getElementIndex(p,m)])>r){var f,v=e[u.getElementIndex(p,p)],g=e[u.getElementIndex(m,m)],_=e[u.getElementIndex(p,m)],y=(v-g)/2/_;f=0>y?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),l=1/Math.sqrt(1+f*f),d=f*l}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(m,m)]=t[u.getElementIndex(p,p)]=l,t[u.getElementIndex(p,m)]=d,t[u.getElementIndex(m,p)]=-d,t}var u=function(e,r,i,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(r,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(i,0),this[7]=t(a,0),this[8]=t(u,0)};u.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},u.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new u),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n[4]=e[i+4],n[5]=e[i+5],n[6]=e[i+6],n[7]=e[i+7],n[8]=e[i+8],n[9]=e[i+9],n},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var i=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,l=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,m=e.w*e.w,p=i-s-h+m,f=2*(n-d),v=2*(o+c),g=2*(n+d),_=-i+s-h+m,y=2*(l-a),C=2*(o-c),S=2*(l+a),w=-i-s+h+m;return r(t)?(t[0]=p,t[1]=g,t[2]=C,t[3]=f,t[4]=_,t[5]=S,t[6]=v,t[7]=y,t[8]=w,t):new u(p,f,v,g,_,y,C,S,w)},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new u(e,0,0,0,e,0,0,0,e)},u.fromRotationX=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=n,t[6]=0,t[7]=-n,t[8]=i,t):new u(1,0,0,0,i,-n,0,n,i)},u.fromRotationY=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=i,t):new u(i,0,n,0,1,0,-n,0,i)},u.fromRotationZ=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(i,-n,0,n,i,0,0,0,1)},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(t,i,n){var o=3*i,a=t[o],s=t[o+1],l=t[o+2];return r(n)?(n.x=a,n.y=s,n.z=l,n):new e(a,s,l)},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},u.getRow=function(t,i,n){var o=t[i],a=t[i+3],s=t[i+6];return r(n)?(n.x=o,n.y=a,n.z=s,n):new e(o,a,s)},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i},u.multiply=function(e,t,i){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],l=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],h=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],m=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r(i)?(i[0]=n,i[1]=o,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i[6]=h,i[7]=d,i[8]=m,i):new u(n,s,h,o,l,d,a,c,m)},u.multiplyByVector=function(t,i,n){var o=i.x,a=i.y,s=i.z,l=t[0]*o+t[3]*a+t[6]*s,u=t[1]*o+t[4]*a+t[7]*s,c=t[2]*o+t[5]*a+t[8]*s;
+return r(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByScalar=function(e,t,i){return r(i)?(i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i):new u(e[0]*t,e[3]*t,e[6]*t,e[1]*t,e[4]*t,e[7]*t,e[2]*t,e[5]*t,e[8]*t)},u.negate=function(e,t){return r(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t):new u(-e[0],-e[3],-e[6],-e[1],-e[4],-e[7],-e[2],-e[5],-e[8])},u.transpose=function(e,t){var i=e[0],n=e[3],o=e[6],a=e[1],s=e[4],l=e[7],c=e[2],h=e[5],d=e[8];return r(t)?(t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=h,t[8]=d,t):new u(i,a,c,n,s,h,o,l,d)};var c=[1,0,0],h=[2,2,1],d=new u,m=new u;return u.getEigenDecomposition=function(e,t){var i=o.EPSILON20,n=10,c=0,h=0;r(t)||(t={});for(var p=t.unitary=u.clone(u.IDENTITY,t.unitary),f=t.diagonal=u.clone(e,t.diagonal),v=i*a(f);n>h&&s(f)>v;)l(f,d),u.transpose(d,m),u.multiply(f,d,f),u.multiply(m,f,f),u.multiply(p,d,p),++c>2&&(++h,c=0);return t},u.abs=function(e,t){return r(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t):new u(Math.abs(e[0]),Math.abs(e[3]),Math.abs(e[6]),Math.abs(e[1]),Math.abs(e[4]),Math.abs(e[7]),Math.abs(e[2]),Math.abs(e[5]),Math.abs(e[8]))},u.determinant=function(e){var t=e[0],r=e[3],i=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*i-r*u)+s*(r*a-o*i)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],s=e[3],l=e[4],c=e[5],h=e[6],d=e[7],m=e[8],p=u.determinant(e);if(Math.abs(p)<=o.EPSILON15)throw new i("matrix is not invertible");var f=new u(l*m-d*c,h*c-s*m,s*d-h*l,d*a-n*m,r*m-h*a,h*n-r*d,n*c-l*a,s*a-r*c,r*l-s*n),v=1/p;return u.multiplyByScalar(f,v,t)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},u.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},u.IDENTITY=n(new u(1,0,0,0,1,0,0,0,1)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},u}),r("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),r("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(e,t,i,n,o,a,s,l,u,c,h,d,m,p,f,v){this[0]=r(e,0),this[1]=r(o,0),this[2]=r(u,0),this[3]=r(m,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(c,0),this[7]=r(p,0),this[8]=r(i,0),this[9]=r(s,0),this[10]=r(h,0),this[11]=r(f,0),this[12]=r(n,0),this[13]=r(l,0),this[14]=r(d,0),this[15]=r(v,0)};u.clone=function(e,t){return i(e)?i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},u.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new u),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n[9]=e[t+9],n[10]=e[t+10],n[11]=e[t+11],n[12]=e[t+12],n[13]=e[t+13],n[14]=e[t+14],n[15]=e[t+15],n},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},u.fromRotationTranslation=function(e,t,r){return i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=0,r[4]=e[3],r[5]=e[4],r[6]=e[5],r[7]=0,r[8]=e[6],r[9]=e[7],r[10]=e[8],r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r):new u(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},new s,u.fromTranslationQuaternionRotationScale=function(e,t,r,n){i(n)||(n=new u);var o=r.x,a=r.y,s=r.z,l=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,m=t.y*t.y,p=t.y*t.z,f=t.y*t.w,v=t.z*t.z,g=t.z*t.w,_=t.w*t.w,y=l-m-v+_,C=2*(c-g),S=2*(h+f),w=2*(c+g),E=-l+m-v+_,x=2*(p-d),b=2*(h-f),T=2*(p+d),A=-l-m+v+_;return n[0]=y*o,n[1]=w*o,n[2]=b*o,n[3]=0,n[4]=C*a,n[5]=E*a,n[6]=T*a,n[7]=0,n[8]=S*s,n[9]=x*s,n[10]=A*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},u.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,d=new e;u.fromCamera=function(t,r){var n=t.eye,o=t.target,a=t.up;e.normalize(e.subtract(o,n,c),c),e.normalize(e.cross(c,a,h),h),e.normalize(e.cross(h,c,d),d);var s=h.x,l=h.y,m=h.z,p=c.x,f=c.y,v=c.z,g=d.x,_=d.y,y=d.z,C=n.x,S=n.y,w=n.z,E=s*-C+l*-S+m*-w,x=g*-C+_*-S+y*-w,b=p*C+f*S+v*w;return i(r)?(r[0]=s,r[1]=g,r[2]=-p,r[3]=0,r[4]=l,r[5]=_,r[6]=-f,r[7]=0,r[8]=m,r[9]=y,r[10]=-v,r[11]=0,r[12]=E,r[13]=x,r[14]=b,r[15]=1,r):new u(s,l,m,E,g,_,y,x,-p,-f,-v,b,0,0,0,1)},u.computePerspectiveFieldOfView=function(e,t,r,n,o){var a=Math.tan(.5*e),s=1/a,l=s/t,c=(n+r)/(r-n),h=2*n*r/(r-n);return i(o)?(o[0]=l,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o):new u(l,0,0,0,0,s,0,0,0,0,c,h,0,0,-1,0)},u.computeOrthographicOffCenter=function(e,t,r,n,o,a,s){var l=1/(t-e),c=1/(n-r),h=1/(a-o),d=-(t+e)*l,m=-(n+r)*c,p=-(a+o)*h;return l*=2,c*=2,h*=-2,i(s)?(s[0]=l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=h,s[11]=0,s[12]=d,s[13]=m,s[14]=p,s[15]=1,s):new u(l,0,0,d,0,c,0,m,0,0,h,p,0,0,0,1)},u.computePerspectiveOffCenter=function(e,t,r,n,o,a,s){var l=2*o/(t-e),c=2*o/(n-r),h=(t+e)/(t-e),d=(n+r)/(n-r),m=-(a+o)/(a-o),p=-1,f=-2*a*o/(a-o);return i(s)?(s[0]=l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=h,s[9]=d,s[10]=m,s[11]=p,s[12]=0,s[13]=0,s[14]=f,s[15]=0,s):new u(l,0,h,0,0,c,d,0,0,0,m,f,0,0,p,0)},u.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,a){var s=2*o/(t-e),l=2*o/(n-r),c=(t+e)/(t-e),h=(n+r)/(n-r),d=-1,m=-1,p=-2*o;return i(a)?(a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=c,a[9]=h,a[10]=d,a[11]=m,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a):new u(s,0,c,0,0,l,h,0,0,0,d,p,0,0,m,0)},u.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),s=r(e.y,0),l=r(e.width,0),c=r(e.height,0);t=r(t,0),n=r(n,1);var h=.5*l,d=.5*c,m=.5*(n-t),p=h,f=d,v=m,g=a+h,_=s+d,y=t+m,C=1;return i(o)?(o[0]=p,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=f,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=v,o[11]=0,o[12]=g,o[13]=_,o[14]=y,o[15]=C,o):new u(p,0,0,g,0,f,0,_,0,0,v,y,0,0,0,C)},u.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},u.getElementIndex=function(e,t){return 4*e+t},u.getColumn=function(e,r,n){var o=4*r,a=e[o],s=e[o+1],l=e[o+2],u=e[o+3];return i(n)?(n.x=a,n.y=s,n.z=l,n.w=u,n):new t(a,s,l,u)},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=4*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i[n+3]=r.w,i},u.getRow=function(e,r,n){var o=e[r],a=e[r+4],s=e[r+8],l=e[r+12];return i(n)?(n.x=o,n.y=a,n.z=s,n.w=l,n):new t(o,a,s,l)},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+4]=r.y,i[t+8]=r.z,i[t+12]=r.w,i},u.multiply=function(e,t,r){var n=e[0],o=e[1],a=e[2],s=e[3],l=e[4],c=e[5],h=e[6],d=e[7],m=e[8],p=e[9],f=e[10],v=e[11],g=e[12],_=e[13],y=e[14],C=e[15],S=t[0],w=t[1],E=t[2],x=t[3],b=t[4],T=t[5],A=t[6],P=t[7],D=t[8],M=t[9],I=t[10],O=t[11],R=t[12],L=t[13],N=t[14],B=t[15],z=n*S+l*w+m*E+g*x,F=o*S+c*w+p*E+_*x,V=a*S+h*w+f*E+y*x,k=s*S+d*w+v*E+C*x,U=n*b+l*T+m*A+g*P,W=o*b+c*T+p*A+_*P,G=a*b+h*T+f*A+y*P,H=s*b+d*T+v*A+C*P,j=n*D+l*M+m*I+g*O,q=o*D+c*M+p*I+_*O,Y=a*D+h*M+f*I+y*O,X=s*D+d*M+v*I+C*O,Z=n*R+l*L+m*N+g*B,J=o*R+c*L+p*N+_*B,Q=a*R+h*L+f*N+y*B,K=s*R+d*L+v*N+C*B;return i(r)?(r[0]=z,r[1]=F,r[2]=V,r[3]=k,r[4]=U,r[5]=W,r[6]=G,r[7]=H,r[8]=j,r[9]=q,r[10]=Y,r[11]=X,r[12]=Z,r[13]=J,r[14]=Q,r[15]=K,r):new u(z,U,j,Z,F,W,q,J,V,G,Y,Q,k,H,X,K)},u.multiplyTransformation=function(e,t,r){var n=e[0],o=e[1],a=e[2],s=e[4],l=e[5],c=e[6],h=e[8],d=e[9],m=e[10],p=e[12],f=e[13],v=e[14],g=t[0],_=t[1],y=t[2],C=t[4],S=t[5],w=t[6],E=t[8],x=t[9],b=t[10],T=t[12],A=t[13],P=t[14],D=n*g+s*_+h*y,M=o*g+l*_+d*y,I=a*g+c*_+m*y,O=n*C+s*S+h*w,R=o*C+l*S+d*w,L=a*C+c*S+m*w,N=n*E+s*x+h*b,B=o*E+l*x+d*b,z=a*E+c*x+m*b,F=n*T+s*A+h*P+p,V=o*T+l*A+d*P+f,k=a*T+c*A+m*P+v;return i(r)?(r[0]=D,r[1]=M,r[2]=I,r[3]=0,r[4]=O,r[5]=R,r[6]=L,r[7]=0,r[8]=N,r[9]=B,r[10]=z,r[11]=0,r[12]=F,r[13]=V,r[14]=k,r[15]=1,r):new u(D,O,N,F,M,R,B,V,I,L,z,k,0,0,0,1)},u.multiplyByTranslation=function(e,t,r){var n=t.x,o=t.y,a=t.z,s=n*e[0]+o*e[4]+a*e[8]+e[12],l=n*e[1]+o*e[5]+a*e[9]+e[13],c=n*e[2]+o*e[6]+a*e[10]+e[14];return i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=s,r[13]=l,r[14]=c,r[15]=e[15],r):new u(e[0],e[4],e[8],s,e[1],e[5],e[9],l,e[2],e[6],e[10],c,e[3],e[7],e[11],e[15])};var m=new e;return u.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,u.multiplyByScale(e,m,r)},u.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,a=t.z;return 1===n&&1===o&&1===a?u.clone(e,r):i(r)?(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r):new u(n*e[0],o*e[4],a*e[8],e[12],n*e[1],o*e[5],a*e[9],e[13],n*e[2],o*e[6],a*e[10],e[14],0,0,0,1)},u.multiplyByVector=function(e,r,n){var o=r.x,a=r.y,s=r.z,l=r.w,u=e[0]*o+e[4]*a+e[8]*s+e[12]*l,c=e[1]*o+e[5]*a+e[9]*s+e[13]*l,h=e[2]*o+e[6]*a+e[10]*s+e[14]*l,d=e[3]*o+e[7]*a+e[11]*s+e[15]*l;return i(n)?(n.x=u,n.y=c,n.z=h,n.w=d,n):new t(u,c,h,d)},u.multiplyByPointAsVector=function(t,r,n){var o=r.x,a=r.y,s=r.z,l=t[0]*o+t[4]*a+t[8]*s,u=t[1]*o+t[5]*a+t[9]*s,c=t[2]*o+t[6]*a+t[10]*s;return i(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByPoint=function(t,r,n){var o=r.x,a=r.y,s=r.z,l=t[0]*o+t[4]*a+t[8]*s+t[12],u=t[1]*o+t[5]*a+t[9]*s+t[13],c=t[2]*o+t[6]*a+t[10]*s+t[14];return i(n)?(n.x=l,n.y=u,n.z=c,n):new e(l,u,c)},u.multiplyByScalar=function(e,t,r){return i(r)?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r):new u(e[0]*t,e[4]*t,e[8]*t,e[12]*t,e[1]*t,e[5]*t,e[9]*t,e[13]*t,e[2]*t,e[6]*t,e[10]*t,e[14]*t,e[3]*t,e[7]*t,e[11]*t,e[15]*t)},u.negate=function(e,t){return i(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t):new u(-e[0],-e[4],-e[8],-e[12],-e[1],-e[5],-e[9],-e[13],-e[2],-e[6],-e[10],-e[14],-e[3],-e[7],-e[11],-e[15])},u.transpose=function(e,t){if(!i(t))return new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);var r=e[1],n=e[2],o=e[3],a=e[6],s=e[7],l=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=l,t[15]=e[15],t},u.abs=function(e,t){return i(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t):new u(Math.abs(e[0]),Math.abs(e[4]),Math.abs(e[8]),Math.abs(e[12]),Math.abs(e[1]),Math.abs(e[5]),Math.abs(e[9]),Math.abs(e[13]),Math.abs(e[2]),Math.abs(e[6]),Math.abs(e[10]),Math.abs(e[14]),Math.abs(e[3]),Math.abs(e[7]),Math.abs(e[11]),Math.abs(e[15]))},u.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},u.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},u.getTranslation=function(t,r){return i(r)?(r.x=t[12],r.y=t[13],r.z=t[14],r):new e(t[12],t[13],t[14])},u.getRotation=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t):new s(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10])},u.inverse=function(e,t){var r=e[0],n=e[4],o=e[8],s=e[12],c=e[1],h=e[5],d=e[9],m=e[13],p=e[2],f=e[6],v=e[10],g=e[14],_=e[3],y=e[7],C=e[11],S=e[15],w=v*S,E=g*C,x=f*S,b=g*y,T=f*C,A=v*y,P=p*S,D=g*_,M=p*C,I=v*_,O=p*y,R=f*_,L=w*h+b*d+T*m-(E*h+x*d+A*m),N=E*c+P*d+I*m-(w*c+D*d+M*m),B=x*c+D*h+O*m-(b*c+P*h+R*m),z=A*c+M*h+R*d-(T*c+I*h+O*d),F=E*n+x*o+A*s-(w*n+b*o+T*s),V=w*r+D*o+M*s-(E*r+P*o+I*s),k=b*r+P*n+R*s-(x*r+D*n+O*s),U=T*r+I*n+O*o-(A*r+M*n+R*o);w=o*m,E=s*d,x=n*m,b=s*h,T=n*d,A=o*h,P=r*m,D=s*c,M=r*d,I=o*c,O=r*h,R=n*c;var W=w*y+b*C+T*S-(E*y+x*C+A*S),G=E*_+P*C+I*S-(w*_+D*C+M*S),H=x*_+D*y+O*S-(b*_+P*y+R*S),j=A*_+M*y+R*C-(T*_+I*y+O*C),q=x*v+A*g+E*f-(T*g+w*f+b*v),Y=M*g+w*p+D*v-(P*v+I*g+E*p),X=P*f+R*g+b*p-(O*g+x*p+D*f),Z=O*v+T*p+I*f-(M*f+R*v+A*p),J=r*L+n*N+o*B+s*z;if(Math.abs(J)b;b++){e.clone(t[b],n);var T=n.x,A=n.y,P=n.z;Tl.x&&e.clone(n,l),Au.y&&e.clone(n,u),PE.z&&e.clone(n,E)}var D=e.magnitudeSquared(e.subtract(l,o,_)),M=e.magnitudeSquared(e.subtract(u,a,_)),I=e.magnitudeSquared(e.subtract(E,s,_)),O=o,R=l,L=D;M>L&&(L=M,O=a,R=u),I>L&&(L=I,O=s,R=E);var N=y;N.x=.5*(O.x+R.x),N.y=.5*(O.y+R.y),N.z=.5*(O.z+R.z);var B=e.magnitudeSquared(e.subtract(R,N,_)),z=Math.sqrt(B),F=C;F.x=o.x,F.y=a.y,F.z=s.z;var V=S;V.x=l.x,V.y=u.y,V.z=E.z;var k=e.multiplyByScalar(e.add(F,V,_),.5,w),U=0;for(b=0;x>b;b++){e.clone(t[b],n);var W=e.magnitude(e.subtract(n,k,_));W>U&&(U=W);var G=e.magnitudeSquared(e.subtract(n,N,_));if(G>B){var H=Math.sqrt(G);z=.5*(z+H),B=z*z;var j=H-z;N.x=(z*N.x+j*n.x)/H,N.y=(z*N.y+j*n.y)/H,N.z=(z*N.z+j*n.z)/H}}return U>z?(e.clone(N,r.center),r.radius=z):(e.clone(k,r.center),r.radius=U),r};var E=new a,x=new e,b=new e,T=new t,A=new t;c.fromExtent2D=function(e,t,r){return c.fromExtentWithHeights2D(e,t,0,0,r)},c.fromExtentWithHeights2D=function(t,n,o,a,s){if(i(s)||(s=new c),!i(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=r(n,E),t.getSouthwest(T),T.height=o,t.getNortheast(A),A.height=a;var l=n.project(T,x),u=n.project(A,b),h=u.x-l.x,d=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(h*h+d*d+m*m);var p=s.center;return p.x=l.x+.5*h,p.y=l.y+.5*d,p.z=l.z+.5*m,s};var P=[];c.fromExtent3D=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0);var s;return i(e)&&(s=e.subsample(t,n,P)),c.fromPoints(s,a)},c.fromVertices=function(t,n,o,a){if(i(a)||(a=new c),!i(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;n=r(n,e.ZERO),o=r(o,3);var s=g;s.x=t[0]+n.x,s.y=t[1]+n.y,s.z=t[2]+n.z;for(var l=e.clone(s,h),u=e.clone(s,d),E=e.clone(s,m),x=e.clone(s,p),b=e.clone(s,f),T=e.clone(s,v),A=t.length,P=0;A>P;P+=o){var D=t[P]+n.x,M=t[P+1]+n.y,I=t[P+2]+n.z;s.x=D,s.y=M,s.z=I,Dx.x&&e.clone(s,x),Mb.y&&e.clone(s,b),IT.z&&e.clone(s,T)}var O=e.magnitudeSquared(e.subtract(x,l,_)),R=e.magnitudeSquared(e.subtract(b,u,_)),L=e.magnitudeSquared(e.subtract(T,E,_)),N=l,B=x,z=O;R>z&&(z=R,N=u,B=b),L>z&&(z=L,N=E,B=T);var F=y;F.x=.5*(N.x+B.x),F.y=.5*(N.y+B.y),F.z=.5*(N.z+B.z);var V=e.magnitudeSquared(e.subtract(B,F,_)),k=Math.sqrt(V),U=C;U.x=l.x,U.y=u.y,U.z=E.z;var W=S;W.x=x.x,W.y=b.y,W.z=T.z;var G=e.multiplyByScalar(e.add(U,W,_),.5,w),H=0;for(P=0;A>P;P+=o){s.x=t[P]+n.x,s.y=t[P+1]+n.y,s.z=t[P+2]+n.z;var j=e.magnitude(e.subtract(s,G,_));j>H&&(H=j);var q=e.magnitudeSquared(e.subtract(s,F,_));if(q>V){var Y=Math.sqrt(q);k=.5*(k+Y),V=k*k;var X=Y-k;F.x=(k*F.x+X*s.x)/Y,F.y=(k*F.y+X*s.y)/Y,F.z=(k*F.z+X*s.z)/Y}}return H>k?(e.clone(F,a.center),a.radius=k):(e.clone(G,a.center),a.radius=H),a},c.fromCornerPoints=function(t,r,n){i(n)||(n=new c);var o=n.center;return e.add(t,r,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,r),n},c.fromEllipsoid=function(t,r){return i(r)||(r=new c),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},c.clone=function(t,r){return i(t)?i(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new c(t.center,t.radius):void 0};var D=new e,M=new e;c.union=function(t,r,n){i(n)||(n=new c);var o=t.center,a=r.center;e.add(o,a,M);var s=e.multiplyByScalar(M,.5,M),l=e.magnitude(e.subtract(o,s,D))+t.radius,u=e.magnitude(e.subtract(a,s,D))+r.radius;return n.radius=Math.max(l,u),e.clone(s,n.center),n};var I=new e;c.expand=function(t,r,i){i=c.clone(t,i);var n=e.magnitude(e.subtract(r,i.center,I));return n>i.radius&&(i.radius=n),i},c.intersect=function(t,r){var i=t.center,n=t.radius,o=e.dot(r,i)+r.w;return-n>o?s.OUTSIDE:n>o?s.INTERSECTING:s.INSIDE};var O=new e;c.transform=function(t,r,n){return i(n)||(n=new c),n.center=u.multiplyByPoint(r,t.center,n.center),n.radius=Math.max(e.magnitude(u.getColumn(r,0,O)),e.magnitude(u.getColumn(r,1,O)),e.magnitude(u.getColumn(r,2,O)))*t.radius,n},c.transformWithoutScale=function(e,t,r){return i(r)||(r=new c),r.center=u.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var R=new e;c.getPlaneDistances=function(t,r,n,o){i(o)||(o=new l);var a=e.subtract(t.center,r,R),s=e.multiplyByScalar(n,e.dot(n,a),R),u=e.magnitude(s);return o.start=u-t.radius,o.stop=u+t.radius,o};for(var L=new e,N=new e,B=new e,z=new e,F=new e,V=new t,k=new Array(8),U=0;8>U;++U)k[U]=new e;var W=new a;return c.projectTo2D=function(t,i,n){i=r(i,W);var o=i.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,L),u=e.cross(e.UNIT_Z,l,N);e.normalize(u,u);var h=e.cross(l,u,B);e.normalize(h,h),e.multiplyByScalar(l,s,l),e.multiplyByScalar(h,s,h),e.multiplyByScalar(u,s,u);var d=e.negate(h,F),m=e.negate(u,z),p=k,f=p[0];e.add(l,h,f),e.add(f,u,f),f=p[1],e.add(l,h,f),e.add(f,m,f),f=p[2],e.add(l,d,f),e.add(f,m,f),f=p[3],e.add(l,d,f),e.add(f,u,f),e.negate(l,l),f=p[4],e.add(l,h,f),e.add(f,u,f),f=p[5],e.add(l,h,f),e.add(f,m,f),f=p[6],e.add(l,d,f),e.add(f,m,f),f=p[7],e.add(l,d,f),e.add(f,u,f);for(var v=p.length,g=0;v>g;++g){var _=p[g];e.add(a,_,_);var y=o.cartesianToCartographic(_,V);i.project(y,_)}n=c.fromPoints(p,n),a=n.center;var C=a.x,S=a.y,w=a.z;return a.x=w,a.y=C,a.z=S,n},c.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.union=function(e,t){return c.union(this,e,t)},c.prototype.expand=function(e,t){return c.expand(this,e,t)},c.prototype.intersect=function(e){return c.intersect(this,e)},c.prototype.getPlaneDistances=function(e,t,r){return c.getPlaneDistances(this,e,t,r)},c.prototype.projectTo2D=function(e,t){return c.projectTo2D(this,e,t)},c.prototype.equals=function(e){return c.equals(this,e)},c}),r("Core/Fullscreen",["./defined"],function(e){"use strict";var t,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return i.supportsFullscreen=function(){if(e(t))return t;t=!1;var i=document.body;if("function"==typeof i.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",t=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;s>a;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof i[n]?(r.requestFullscreen=n,t=!0):(n=l+"RequestFullScreen","function"==typeof i[n]&&(r.requestFullscreen=n,t=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",e(document[n])?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?r.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(r.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return t},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[r.requestFullscreen]()},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i.isFullscreenEnabled=function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0},i.getFullscreenElement=function(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0},i.isFullscreen=function(){return i.supportsFullscreen()?null!==i.getFullscreenElement():void 0},i.getFullscreenChangeEventName=function(){return i.supportsFullscreen()?r.fullscreenchange:void 0},i.getFullscreenErrorEventName=function(){return i.supportsFullscreen()?r.fullscreenerror:void 0},i}),r("Core/FeatureDetection",["./defined","./Fullscreen"],function(e,t){"use strict";function r(e){for(var t=e.split("."),r=0,i=t.length;i>r;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!e(h)){var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null===t?h=!1:(h=!0,d=r(t[1]))}return h}function n(){return i()&&d}function o(){if(!e(m))if(i()||!/ Safari\/[\.0-9]+/.test(navigator.userAgent))m=!1;else{var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null===t?m=!1:(m=!0,p=r(t[1]))}return m}function a(){return o()&&p}function s(){if(!e(f)){var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null===t?f=!1:(f=!0,v=r(t[1]),v.isNightly=!!t[2])}return f}function l(){return s()&&v}function u(){if(!e(g)){var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,_=r(t[1]))):"Netscape"===navigator.appName?(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,_=r(t[1]))):g=!1}return g}function c(){return u()&&_}var h,d,m,p,f,v,g,_,y={isChrome:i,chromeVersion:n,isSafari:o,safariVersion:a,isWebkit:s,webkitVersion:l,isInternetExplorer:u,internetExplorerVersion:c};y.supportsFullscreen=function(){return t.supportsFullscreen()},y.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer};var C;return y.supportsTransferringArrayBuffers=function(){if(!e(C)){if(!y.supportsTypedArrays())return C=!1,void 0;var t=new ArrayBuffer(1);try{postMessage({value:t},[t]),C=!0}catch(r){C=!1}}return C},y}),r("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./Enumeration"],function(e,t,r,i,n){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:new n(5120,"BYTE",{sizeInBytes:Int8Array.BYTES_PER_ELEMENT}),UNSIGNED_BYTE:new n(5121,"UNSIGNED_BYTE",{sizeInBytes:Uint8Array.BYTES_PER_ELEMENT}),SHORT:new n(5122,"SHORT",{sizeInBytes:Int16Array.BYTES_PER_ELEMENT}),UNSIGNED_SHORT:new n(5123,"UNSIGNED_SHORT",{sizeInBytes:Uint16Array.BYTES_PER_ELEMENT}),FLOAT:new n(5126,"FLOAT",{sizeInBytes:Float32Array.BYTES_PER_ELEMENT}),DOUBLE:new n(5130,"DOUBLE",{sizeInBytes:Float64Array.BYTES_PER_ELEMENT})};return o.validate=function(e){return t(e)&&t(e.value)&&(e.value===o.BYTE.value||e.value===o.UNSIGNED_BYTE.value||e.value===o.SHORT.value||e.value===o.UNSIGNED_SHORT.value||e.value===o.FLOAT.value||e.value===o.DOUBLE.value)},o.createTypedArray=function(e,t){switch(e.value){case o.BYTE.value:return new Int8Array(t);case o.UNSIGNED_BYTE.value:return new Uint8Array(t);case o.SHORT.value:return new Int16Array(t);case o.UNSIGNED_SHORT.value:return new Uint16Array(t);case o.FLOAT.value:return new Float32Array(t);case o.DOUBLE.value:return new Float64Array(t);default:throw new r("componentDatatype is not a valid enumeration value.")}},o.createArrayBufferView=function(t,i,n,a){switch(n=e(n,0),a=e(a,(i.byteLength-n)/t.sizeInBytes),t.value){case o.BYTE.value:return new Int8Array(i,n,a);case o.UNSIGNED_BYTE.value:return new Uint8Array(i,n,a);case o.SHORT.value:return new Int16Array(i,n,a);case o.UNSIGNED_SHORT.value:return new Uint16Array(i,n,a);case o.FLOAT.value:return new Float32Array(i,n,a);case o.DOUBLE.value:return new Float64Array(i,n,a);default:throw new r("componentDatatype is not a valid enumeration value.")}},o}),r("Core/PrimitiveType",[],function(){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return e}),r("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),r("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color};return t}),r("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1)};return r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),r("Core/Geometry",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType,this.boundingSphere=t.boundingSphere};return i.computeNumberOfVertices=function(e){var i=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(i!==a&&-1!==i)throw new r("All attribute lists must have the same number of attributes.");i=a}return i},i}),r("Core/BoxGeometry",["./defined","./DeveloperError","./Cartesian3","./ComponentDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./GeometryAttribute","./GeometryAttributes","./VertexFormat","./Geometry"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=new r,d=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.minimumCorner,i=e.maximumCorner,n=o(e.vertexFormat,u.DEFAULT);this._minimumCorner=r.clone(t),this._maximumCorner=r.clone(i),this._vertexFormat=n,this._workerName="createBoxGeometry"};return d.fromDimensions=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.dimensions,i=r.multiplyByScalar(t,.5),n=r.negate(i),a=i,s={minimumCorner:n,maximumCorner:a,vertexFormat:e.vertexFormat};return new d(s)},d.createGeometry=function(e){var t,o,u=e._minimumCorner,d=e._maximumCorner,m=e._vertexFormat,p=new l;if(m.position&&(m.st||m.normal||m.binormal||m.tangent)){if(m.position&&(o=new Float64Array(72),o[0]=u.x,o[1]=u.y,o[2]=d.z,o[3]=d.x,o[4]=u.y,o[5]=d.z,o[6]=d.x,o[7]=d.y,o[8]=d.z,o[9]=u.x,o[10]=d.y,o[11]=d.z,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=d.x,o[16]=u.y,o[17]=u.z,o[18]=d.x,o[19]=d.y,o[20]=u.z,o[21]=u.x,o[22]=d.y,o[23]=u.z,o[24]=d.x,o[25]=u.y,o[26]=u.z,o[27]=d.x,o[28]=d.y,o[29]=u.z,o[30]=d.x,o[31]=d.y,o[32]=d.z,o[33]=d.x,o[34]=u.y,o[35]=d.z,o[36]=u.x,o[37]=u.y,o[38]=u.z,o[39]=u.x,o[40]=d.y,o[41]=u.z,o[42]=u.x,o[43]=d.y,o[44]=d.z,o[45]=u.x,o[46]=u.y,o[47]=d.z,o[48]=u.x,o[49]=d.y,o[50]=u.z,o[51]=d.x,o[52]=d.y,o[53]=u.z,o[54]=d.x,o[55]=d.y,o[56]=d.z,o[57]=u.x,o[58]=d.y,o[59]=d.z,o[60]=u.x,o[61]=u.y,o[62]=u.z,o[63]=d.x,o[64]=u.y,o[65]=u.z,o[66]=d.x,o[67]=u.y,o[68]=d.z,o[69]=u.x,o[70]=u.y,o[71]=d.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o})),m.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,p.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})
+}if(m.st){var v=new Float32Array(48);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=1,v[5]=1,v[6]=0,v[7]=1,v[8]=1,v[9]=0,v[10]=0,v[11]=0,v[12]=0,v[13]=1,v[14]=1,v[15]=1,v[16]=0,v[17]=0,v[18]=1,v[19]=0,v[20]=1,v[21]=1,v[22]=0,v[23]=1,v[24]=1,v[25]=0,v[26]=0,v[27]=0,v[28]=0,v[29]=1,v[30]=1,v[31]=1,v[32]=1,v[33]=0,v[34]=0,v[35]=0,v[36]=0,v[37]=1,v[38]=1,v[39]=1,v[40]=0,v[41]=0,v[42]=1,v[43]=0,v[44]=1,v[45]=1,v[46]=0,v[47]=1,p.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:v})}if(m.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,p.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(m.binormal){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,p.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}t=new Uint16Array(36),t[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3,t[6]=6,t[7]=5,t[8]=4,t[9]=7,t[10]=6,t[11]=4,t[12]=8,t[13]=9,t[14]=10,t[15]=8,t[16]=10,t[17]=11,t[18]=14,t[19]=13,t[20]=12,t[21]=15,t[22]=14,t[23]=12,t[24]=18,t[25]=17,t[26]=16,t[27]=19,t[28]=18,t[29]=16,t[30]=20,t[31]=21,t[32]=22,t[33]=20,t[34]=22,t[35]=23}else o=new Float64Array(24),o[0]=u.x,o[1]=u.y,o[2]=u.z,o[3]=d.x,o[4]=u.y,o[5]=u.z,o[6]=d.x,o[7]=d.y,o[8]=u.z,o[9]=u.x,o[10]=d.y,o[11]=u.z,o[12]=u.x,o[13]=u.y,o[14]=d.z,o[15]=d.x,o[16]=u.y,o[17]=d.z,o[18]=d.x,o[19]=d.y,o[20]=d.z,o[21]=u.x,o[22]=d.y,o[23]=d.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),t=new Uint16Array(36),t[0]=4,t[1]=5,t[2]=6,t[3]=4,t[4]=6,t[5]=7,t[6]=1,t[7]=0,t[8]=3,t[9]=1,t[10]=3,t[11]=2,t[12]=1,t[13]=6,t[14]=5,t[15]=1,t[16]=2,t[17]=6,t[18]=2,t[19]=3,t[20]=7,t[21]=2,t[22]=7,t[23]=6,t[24]=3,t[25]=0,t[26]=4,t[27]=3,t[28]=4,t[29]=7,t[30]=0,t[31]=1,t[32]=5,t[33]=0,t[34]=5,t[35]=4;var y=r.subtract(d,u,h),C=.5*r.magnitude(y);return new c({attributes:p,indices:t,primitiveType:n.TRIANGLES,boundingSphere:new a(r.ZERO,C)})},d}),r("Core/BoxOutlineGeometry",["./defined","./DeveloperError","./Cartesian3","./ComponentDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=new r,h=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.minimumCorner,i=e.maximumCorner;this._min=r.clone(t),this._max=r.clone(i),this._workerName="createBoxOutlineGeometry"};return h.fromDimensions=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.dimensions,i=r.multiplyByScalar(t,.5),n=r.negate(i),a=i,s={minimumCorner:n,maximumCorner:a};return new h(s)},h.createGeometry=function(e){var t=e._min,o=e._max,h=new u,d=new Uint16Array(24),m=new Float64Array(24);m[0]=t.x,m[1]=t.y,m[2]=t.z,m[3]=o.x,m[4]=t.y,m[5]=t.z,m[6]=o.x,m[7]=o.y,m[8]=t.z,m[9]=t.x,m[10]=o.y,m[11]=t.z,m[12]=t.x,m[13]=t.y,m[14]=o.z,m[15]=o.x,m[16]=t.y,m[17]=o.z,m[18]=o.x,m[19]=o.y,m[20]=o.z,m[21]=t.x,m[22]=o.y,m[23]=o.z,h.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var p=r.subtract(o,t,c),f=.5*r.magnitude(p);return new s({attributes:h,indices:d,primitiveType:n.LINES,boundingSphere:new a(r.ZERO,f)})},h}),r("Core/Spline",["../Core/defaultValue","../Core/defined","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(){this.times=void 0,this.points=void 0,r.throwInstantiationError()};return i.prototype.evaluate=r.throwInstantiationError,i.prototype.findTimeInterval=function(t,r){var i=this.times,n=i.length;if(r=e(r,0),t>=i[r]){if(n>r+1&&tr+2&&t=0&&t>=i[r-1])return r-1;var o;if(t>i[r])for(o=r;n-1>o&&!(t>=i[o]&&t=0&&!(t>=i[o]&&t=0;--u)s[u]=r.subtract(a[u],r.multiplyByScalar(s[u+1],o[u]));return s},i}),r("Core/HermiteSpline",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./Matrix4","./Cartesian4","./Spline","./LinearSpline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,r,n){var o=h,a=m,s=d,u=p;o.length=a.length=e.length-1,s.length=u.length=e.length;var c;o[0]=s[0]=1,a[0]=0;var f=u[0];for(t(f)||(f=u[0]=new i),i.clone(r,f),c=1;c2&&(t(a)||(a=d,n.multiplyByScalar(i[1],2,a),n.subtract(a,i[2],a),n.subtract(a,i[0],a),n.multiplyByScalar(a,.5,a)),!t(s))){var u=i.length-1;s=m,n.multiplyByScalar(i[u-1],2,s),n.subtract(i[u],s,s),n.add(s,i[u-2],s),n.multiplyByScalar(s,.5,s)}this.times=o,this.points=i,this.firstTangent=n.clone(a),this.lastTangent=n.clone(s),this._evaluateFunction=l(this),this._lastTimeIndex=0};return p.catmullRomCoefficientMatrix=new i(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),p.prototype.findTimeInterval=a.prototype.findTimeInterval,p.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},p}),r("Core/IndexDatatype",["./defined","./DeveloperError","./Math"],function(e,t,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i}),r("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,i,n,o,a,s){"use strict";var l,u=function(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)};u.fromAxisAngle=function(t,i,n){var o=i/2,a=Math.sin(o);l=e.normalize(t,l);var s=l.x*a,c=l.y*a,h=l.z*a,d=Math.cos(o);return r(n)?(n.x=s,n.y=c,n.z=h,n.w=d,n):new u(s,c,h,d)};var c=[1,2,0],h=new Array(3);u.fromRotationMatrix=function(e,t){var i,n,o,a,l,d=e[s.COLUMN0ROW0],m=e[s.COLUMN1ROW1],p=e[s.COLUMN2ROW2],f=d+m+p;if(f>0)i=Math.sqrt(f+1),l=.5*i,i=.5/i,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*i,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*i,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*i;else{var v=c,g=0;m>d&&(g=1),p>d&&p>m&&(g=2);var _=v[g],y=v[_];i=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*i,i=.5/i,l=(e[s.getElementIndex(y,_)]-e[s.getElementIndex(_,y)])*i,C[_]=(e[s.getElementIndex(_,g)]+e[s.getElementIndex(g,_)])*i,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*i,n=-C[0],o=-C[1],a=-C[2]}return r(t)?(t.x=n,t.y=o,t.z=a,t.w=l,t):new u(n,o,a,l)};var d=new e,m=new e,p=new u,f=new u,v=new u;u.packedLength=4,u.pack=function(e,r,i){i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w},u.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new u),n.x=e[i],n.y=e[i+1],n.z=e[i+2],n.w=e[i+3],n},u.packedInterpolationLength=3,u.convertPackedArrayForInterpolation=function(e,t,r,i){u.unpack(e,4*r,v),u.conjugate(v,v);for(var n=0,o=r-t+1;o>n;n++){var a=3*n;u.unpack(e,4*(t+n),p),u.multiply(p,v,p),p.w<0&&u.negate(p,p),u.getAxis(p,d);var s=u.getAngle(p);i[a]=d.x*s,i[a+1]=d.y*s,i[a+2]=d.z*s}},u.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new u),e.fromArray(t,0,m);var s=e.magnitude(m);return u.unpack(i,4*o,f),0===s?u.clone(u.IDENTITY,p):u.fromAxisAngle(m,s,p),u.multiply(p,f,a)},u.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new u(e.x,e.y,e.z,e.w):void 0},u.conjugate=function(e,t){return r(t)?(t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t):new u(-e.x,-e.y,-e.z,e.w)},u.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},u.magnitude=function(e){return Math.sqrt(u.magnitudeSquared(e))},u.normalize=function(e,t){var i=1/u.magnitude(e),n=e.x*i,o=e.y*i,a=e.z*i,s=e.w*i;return r(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new u(n,o,a,s)},u.inverse=function(e,t){var r=u.magnitudeSquared(e);return t=u.conjugate(e,t),u.multiplyByScalar(t,1/r,t)},u.add=function(e,t,i){return r(i)?(i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i):new u(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w)},u.subtract=function(e,t,i){return r(i)?(i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i):new u(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w)},u.negate=function(e,t){return r(t)?(t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t):new u(-e.x,-e.y,-e.z,-e.w)},u.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},u.multiply=function(e,t,i){var n=e.x,o=e.y,a=e.z,s=e.w,l=t.x,c=t.y,h=t.z,d=t.w,m=s*l+n*d+o*h-a*c,p=s*c-n*h+o*d+a*l,f=s*h+n*c-o*l+a*d,v=s*d-n*l-o*c-a*h;return r(i)?(i.x=m,i.y=p,i.z=f,i.w=v,i):new u(m,p,f,v)},u.multiplyByScalar=function(e,t,i){return r(i)?(i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i):new u(e.x*t,e.y*t,e.z*t,e.w*t)},u.divideByScalar=function(e,t,i){return r(i)?(i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i):new u(e.x/t,e.y/t,e.z/t,e.w/t)},u.getAxis=function(t,i){var n=t.w;if(Math.abs(n-1)n&&(n=-n,o=_=u.negate(t,_)),1-nI;++I){var O=I+1,R=2*O+1;A[I]=1/(O*R),P[I]=O/R}return A[7]=T/136,P[7]=8*T/17,u.fastSlerp=function(e,t,i,n){r(n)||(n=new u);var o,a=u.dot(e,t);a>=0?o=1:(o=-1,a=-a);for(var s=a-1,l=1-i,c=i*i,h=l*l,d=7;d>=0;--d)D[d]=(A[d]*c-P[d])*s,M[d]=(A[d]*h-P[d])*s;var m=o*i*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),p=l*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),f=u.multiplyByScalar(e,p,b);return u.multiplyByScalar(t,m,n),u.add(f,n,n)},u.fastSquad=function(e,t,r,i,n,o){var a=u.fastSlerp(e,t,n,E),s=u.fastSlerp(r,i,n,x);return u.fastSlerp(a,s,2*n*(1-n),o)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},u.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},u.ZERO=o(new u(0,0,0,0)),u.IDENTITY=o(new u(0,0,0,1)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},u}),r("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,i){"use strict";function n(t,n,o,c,h,d,m,p,f,v){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(m*_+h*y),S=C/p;return i.fromAxisAngle(a,S,l),r.fromQuaternion(l,u),r.multiplyByVector(u,f,v),e.normalize(v,v),e.multiplyByScalar(v,p,v),v}var o={},a=new e,s=new e,l=new i,u=new r,c=new e,h=new e,d=new e,m=new e;o.raisePositionsToHeight=function(t,r,i){for(var n=r.ellipsoid,o=r.height,a=r.extrudedHeight,s=i?2*(t.length/3):t.length/3,l=new Float64Array(3*s),u=m,p=t.length,f=i?p:0,v=0;p>v;v+=3){var g,_=v+1,y=v+2,C=e.fromArray(t,v,c);C=n.scaleToGeodeticSurface(C,C),g=e.clone(C,h),u=n.geodeticSurfaceNormal(C,u);var S=e.multiplyByScalar(u,o,d);C=e.add(C,S,C),i&&(S=e.multiplyByScalar(u,a,S),g=e.add(g,S,g),l[v+f]=g.x,l[_+f]=g.y,l[y+f]=g.z),l[v]=C.x,l[_]=C.y,l[y]=C.z}return l};var p=new e,f=new e,v=new e;return o.computeEllipsePositions=function(r,i,o){var a=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,m=r.granularity,g=2.31,_=a*a,y=s*s,C=s*a,S=e.magnitude(u),w=e.normalize(u,p),E=e.cross(e.UNIT_Z,u,f);E=e.normalize(E,E);var x,b,T,A,P,D=e.cross(w,E,v),M=1+Math.ceil(t.PI_OVER_TWO/m),I=g/(M-1),O=2*M*(M+1),R=i?new Array(3*O):void 0,L=0,N=c,B=h,z=o?[]:void 0,F=o?[]:void 0,V=t.PI_OVER_TWO;for(x=0;M>x&&V>0;++x){if(N=n(V,l,D,E,_,C,y,S,w,N),B=n(Math.PI-V,l,D,E,_,C,y,S,w,B),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,T=2*x+2,b=1;T-1>b;++b)A=b/(T-1),P=e.lerp(N,B,A,d),R[L++]=P.x,R[L++]=P.y,R[L++]=P.z;R[L++]=B.x,R[L++]=B.y,R[L++]=B.z}o&&(F.unshift(N.x,N.y,N.z),0!==x&&z.push(B.x,B.y,B.z)),V=t.PI_OVER_TWO-(x+1)*I}for(M=x,x=M;x>0;--x){if(V=t.PI_OVER_TWO-(x-1)*I,N=n(-V,l,D,E,_,C,y,S,w,N),B=n(V+Math.PI,l,D,E,_,C,y,S,w,B),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,T=2*(x-1)+2,b=1;T-1>b;++b)A=b/(T-1),P=e.lerp(N,B,A,d),R[L++]=P.x,R[L++]=P.y,R[L++]=P.z;R[L++]=B.x,R[L++]=B.y,R[L++]=B.z}o&&(F.unshift(N.x,N.y,N.z),1!==x&&z.push(B.x,B.y,B.z))}var k={};return i&&(R.length!==L&&(O=L/3,R.length=L),k.positions=R,k.numPts=M),o&&(k.outerPositions=F.concat(z)),k},o}),r("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=new t,n=new t,o=new t,a=function(a,s,l,u,c){r(c)||(c=new t);var h,d,m,p,f,v,g,_;r(s.z)?(h=t.subtract(l,s,i),d=t.subtract(u,s,n),m=t.subtract(a,s,o),p=t.dot(h,h),f=t.dot(h,d),v=t.dot(h,m),g=t.dot(d,d),_=t.dot(d,m)):(h=e.subtract(l,s,i),d=e.subtract(u,s,n),m=e.subtract(a,s,o),p=e.dot(h,h),f=e.dot(h,d),v=e.dot(h,m),g=e.dot(d,d),_=e.dot(d,m));var y=1/(p*g-f*f);return c.y=(g*v-f*_)*y,c.z=(p*_-f*v)*y,c.x=1-c.y-c.z,c};return a}),r("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var i;return e>=0?(i=65536*Math.floor(e/65536),r.high=i,r.low=e-i):(i=65536*Math.floor(-e/65536),r.high=-i,r.low=e+i),r};var i={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var o=n.high,a=n.low;return r.encode(e.x,i),o.x=i.high,a.x=i.low,r.encode(e.y,i),o.y=i.high,a.y=i.low,r.encode(e.z,i),o.z=i.high,a.z=i.low,n};var n=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,n);var o=n.high,a=n.low;t[i]=o.x,t[i+1]=o.y,t[i+2]=o.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),r("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,i){var n=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))a&&a/ss&&s/ao)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-i/e,0>o?[o,0]:[0,o];var u=i*i,c=4*e*n,h=r(u,-c,t.EPSILON14);if(0>h)return[];var d=-.5*r(i,t.sign(i)*Math.sqrt(h),t.EPSILON14);return i>0?[d/e,n/d]:[n/d,d/e]},i}),r("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,h=s*u,d=s*s,m=l*l,p=a*l-d,f=a*u-s*l,v=s*u-m,g=4*p*v-f*f;if(0>g){var _,y,C;d*h>=c*m?(_=a,y=p,C=-2*s*p+a*f):(_=u,y=v,C=-u*f+2*l*v);var S=0>C?-1:1,w=-S*Math.abs(_)*Math.sqrt(-g);o=-C+w;var E=o/2,x=0>E?-Math.pow(-E,1/3):Math.pow(E,1/3),b=o===w?-x:-y/x;return n=0>=y?x+b:-C/(x*x+b*b+y),d*h>=c*m?[(n-s)/a]:[-u/(n+l)]}var T=p,A=-2*s*p+a*f,P=v,D=-u*f+2*l*v,M=Math.sqrt(g),I=Math.sqrt(3)/2,O=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-T);var R=Math.cos(O);o=n*R;var L=n*(-R/2-I*Math.sin(O)),N=o+L>2*s?o-s:L-s,B=a,z=N/B;O=Math.abs(Math.atan2(u*M,-D)/3),n=2*Math.sqrt(-P),R=Math.cos(O),o=n*R,L=n*(-R/2-I*Math.sin(O));var F=-u,V=2*l>o+L?o+l:L+l,k=F/V,U=B*V,W=-N*V-B*F,G=N*F,H=(l*W-s*G)/(-s*W+l*U);return H>=z?k>=z?k>=H?[z,H,k]:[z,k,H]:[k,z,H]:k>=z?[H,z,k]:k>=H?[H,k,z]:[k,H,z]}var i={};return i.discriminant=function(e,t,r,i){var n=e*e,o=t*t,a=r*r,s=i*i,l=18*e*t*r*i+o*a-27*n*s-4*(e*a*r+o*t*i);return l},i.realRoots=function(e,i,n,o){var a,s;if(0===e)return t.realRoots(i,n,o);if(0===i){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.realRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):r(e,0,n,o)}return 0===n?0===o?(s=-i/e,0>s?[s,0,0]:[0,0,s]):r(e,i,0,o):0===o?(a=t.realRoots(e,i,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):r(e,i,n,o)},i}),r("Core/QuarticRealPolynomial",["./DeveloperError","./Math","./CubicRealPolynomial","./QuadraticRealPolynomial"],function(e,t,r,i){"use strict";function n(e,n,o,a){var s=e*e,l=n-3*s/8,u=o-n*e/2+s*e/8,c=a-o*e/4+n*s/16-3*s*s/256,h=r.realRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-e/4,m=h[h.length-1];if(Math.abs(m)=0&&g>=0){var _=Math.sqrt(v),y=Math.sqrt(g);return[d-y,d-_,d+_,d+y]}if(v>=0&&0>g)return f=Math.sqrt(v),[d-f,d+f];if(0>v&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(m>0){var C=Math.sqrt(m),S=(l+m-u/C)/2,w=(l+m+u/C)/2,E=i.realRoots(1,C,S),x=i.realRoots(1,-C,w);return 0!==E.length?(E[0]+=d,E[1]+=d,0!==x.length?(x[0]+=d,x[1]+=d,E[1]<=x[0]?[E[0],E[1],x[0],x[1]]:x[1]<=E[0]?[x[0],x[1],E[0],E[1]]:E[0]>=x[0]&&E[1]<=x[1]?[x[0],E[0],E[1],x[1]]:x[0]>=E[0]&&x[1]<=E[1]?[E[0],x[0],x[1],E[1]]:E[0]>x[0]&&E[0]0){var p,f,v=m[0],g=n-v,_=g*g,y=e/2,C=g/2,S=_-4*a,w=_+4*Math.abs(a),E=u-4*v,x=u+4*Math.abs(v);if(0>v||E*w>S*x){var b=Math.sqrt(E);p=b/2,f=0===b?0:(e*C-o)/b}else{var T=Math.sqrt(S);p=0===T?0:(e*C-o)/T,f=T/2}var A,P;0===y&&0===p?(A=0,P=0):t.sign(y)===t.sign(p)?(A=y+p,P=v/A):(P=y-p,A=v/P);var D,M;0===C&&0===f?(D=0,M=0):t.sign(C)===t.sign(f)?(D=C+f,M=a/D):(M=C-f,D=a/M);var I=i.realRoots(1,A,D),O=i.realRoots(1,P,M);if(0!==I.length)return 0!==O.length?I[1]<=O[0]?[I[0],I[1],O[0],O[1]]:O[1]<=I[0]?[O[0],O[1],I[0],I[1]]:I[0]>=O[0]&&I[1]<=O[1]?[O[0],I[0],I[1],O[1]]:O[0]>=I[0]&&O[1]<=I[1]?[I[0],O[0],O[1],I[1]]:I[0]>O[0]&&I[0]u?1:0;switch(m+=0>c?m+1:m,m+=0>h?m+1:m,m+=0>d?m+1:m){case 0:return n(u,c,h,d);case 1:return o(u,c,h,d);case 2:return o(u,c,h,d);case 3:return n(u,c,h,d);case 4:return n(u,c,h,d);case 5:return o(u,c,h,d);case 6:return n(u,c,h,d);case 7:return n(u,c,h,d);case 8:return o(u,c,h,d);case 9:return n(u,c,h,d);case 10:return n(u,c,h,d);case 11:return o(u,c,h,d);case 12:return n(u,c,h,d);case 13:return n(u,c,h,d);case 14:return n(u,c,h,d);case 15:return n(u,c,h,d);default:return void 0}},a}),r("Core/IntersectionTests",["./defined","./DeveloperError","./Math","./Cartesian3","./Cartographic","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i){var n=e+t;return r.sign(e)!==r.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))L;++L){var N,B=h[L],z=B*B,F=Math.max(1-z,0),V=Math.sqrt(F);N=r.sign(p)===r.sign(v)?l(p*z+v,f*B,r.EPSILON12):r.sign(v)===r.sign(f*B)?l(p*z,f*B+v,r.EPSILON12):l(p*z+f*B,v,r.EPSILON12);var k=l(g*B,_,r.EPSILON15),U=N*k;0>U?y.push(new i(u,c*B,c*V)):U>0?y.push(new i(u,c*B,c*-V)):0!==V?(y.push(new i(u,c*B,c*-V)),y.push(new i(u,c*B,c*V)),++L):y.push(new i(u,c*B,c*V))}return y}var c={};c.rayPlane=function(e,t,n){var o=e.origin,a=e.direction,s=t.normal,l=i.dot(s,a);if(Math.abs(l)u?void 0:(n=i.multiplyByScalar(a,u,n),i.add(o,n,n))};var h=new i,d=new i;c.rayEllipsoid=function(e,t){var r,n,o,a,s,l=t.oneOverRadii,u=i.multiplyComponents(l,e.origin,h),c=i.multiplyComponents(l,e.direction,d),m=i.magnitudeSquared(u),p=i.dot(u,c);if(m>1){if(p>=0)return void 0;var f=p*p;if(r=m-1,n=i.magnitudeSquared(c),o=n*r,o>f)return void 0;if(f>o){a=p*p-o,s=-p+Math.sqrt(a);var v=s/n,g=r/s;return g>v?{start:v,stop:g}:{start:g,stop:v}}var _=Math.sqrt(r/n);return{start:_,stop:_}}return 1>m?(r=m-1,n=i.magnitudeSquared(c),o=n*r,a=p*p-o,s=-p+Math.sqrt(a),{start:0,stop:s/n}):0>p?(n=i.magnitudeSquared(c),{start:0,stop:-p/n}):void 0},c.grazingAltitudeLocation=function(t,a){var s=t.origin,l=t.direction,c=a.geodeticSurfaceNormal(s);if(i.dot(l,c)>=0)return s;var h,d,m=e(this.rayEllipsoid(t,a)),p=a.transformPositionToScaledSpace(l),f=i.normalize(p),v=i.mostOrthogonalAxis(p),g=i.normalize(i.cross(v,f)),_=i.normalize(i.cross(f,g)),y=new o(f.x,g.x,_.x,f.y,g.y,_.y,f.z,g.z,_.z),C=o.transpose(y),S=o.fromScale(a.radii),w=o.fromScale(a.oneOverRadii),E=new o(0,l.z,-l.y,-l.z,0,l.x,l.y,-l.x,0),x=o.multiply(o.multiply(C,w),E),b=o.multiply(o.multiply(x,S),y),T=o.multiplyByVector(x,s),A=u(b,i.negate(T),0,0,1),P=A.length;if(P>0){for(var D=i.ZERO,M=Number.NEGATIVE_INFINITY,I=0;P>I;++I){h=o.multiplyByVector(S,o.multiplyByVector(y,A[I]));var O=i.normalize(i.subtract(h,s)),R=i.dot(O,l);R>M&&(M=R,D=h)}var L=a.cartesianToCartographic(D);return M=r.clamp(M,0,1),d=i.magnitude(i.subtract(D,s))*Math.sqrt(1-M*M),d=m?-d:d,a.cartographicToCartesian(new n(L.longitude,L.latitude,d))}return void 0};var m=new i;return c.lineSegmentPlane=function(t,n,o,a){var s=i.subtract(n,t,m),l=o.normal,u=i.dot(l,s);if(Math.abs(u)h||h>1?void 0:(e(a)||(a=new i),i.multiplyByScalar(s,h,a),i.add(t,a,a),a)},c.trianglePlaneIntersection=function(e,t,r,n){var o=n.normal,a=n.distance,s=i.dot(o,e)+a<0,l=i.dot(o,t)+a<0,u=i.dot(o,r)+a<0,h=0;h+=s?1:0,h+=l?1:0,h+=u?1:0;var d,m;if((1===h||2===h)&&(d=new i,m=new i),1===h){if(s)return c.lineSegmentPlane(e,t,n,d),c.lineSegmentPlane(e,r,n,m),{positions:[e,t,r,d,m],indices:[0,3,4,1,2,4,1,4,3]};if(l)return c.lineSegmentPlane(t,r,n,d),c.lineSegmentPlane(t,e,n,m),{positions:[e,t,r,d,m],indices:[1,3,4,2,0,4,2,4,3]};if(u)return c.lineSegmentPlane(r,e,n,d),c.lineSegmentPlane(r,t,n,m),{positions:[e,t,r,d,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===h){if(!s)return c.lineSegmentPlane(t,e,n,d),c.lineSegmentPlane(r,e,n,m),{positions:[e,t,r,d,m],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return c.lineSegmentPlane(r,t,n,d),c.lineSegmentPlane(e,t,n,m),{positions:[e,t,r,d,m],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return c.lineSegmentPlane(e,r,n,d),c.lineSegmentPlane(t,r,n,m),{positions:[e,t,r,d,m],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},c}),r("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(i,n,o){var a=-e.dot(n,i);return t(o)?(e.clone(n,o.normal),o.distance=a,o):new r(n,a)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r.prototype.getPointDistance=function(e){return r.getPointDistance(this,e)},r}),r("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.indices,n=r.maximumIndex,o=e(r.cacheSize,24),a=i.length;if(!t(n)){n=0;for(var s=0,l=i[s];a>s;)l>n&&(n=l),++s,l=i[s]}for(var u=[],c=0;n+1>c;c++)u[c]=0;for(var h=o+1,d=0;a>d;++d)h-u[i[d]]>o&&(u[i[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(r){function i(e,t,r,i){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;i>o;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,h=0;hc||-1===c)&&(c=l,u=d)),++h}return-1===u?i(n,a,e,s):u}r=e(r,e.EMPTY_OBJECT);var o,a=r.indices,s=r.maximumIndex,l=e(r.cacheSize,24),u=a.length,c=0,h=0,d=a[h],m=u;if(t(s))c=s+1;else{for(;m>h;)d>c&&(c=d),++h,d=a[h];if(-1===c)return 0;++c}for(var p=[],f=0;c>f;f++)p[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var v=0;m>h;)p[a[h]].vertexTriangles.push(v),++p[a[h]].numLiveTriangles,p[a[h+1]].vertexTriangles.push(v),++p[a[h+1]].numLiveTriangles,p[a[h+2]].vertexTriangles.push(v),++p[a[h+2]].numLiveTriangles,++v,h+=3;var g=0,_=l+1;o=1;var y,C,S=[],w=[],E=0,x=[],b=u/3,T=[];for(f=0;b>f;f++)T[f]=!1;for(var A,P;-1!==g;){S=[],C=p[g],P=C.vertexTriangles.length;for(var D=0;P>D;++D)if(v=C.vertexTriangles[D],!T[v]){T[v]=!0,h=v+v+v;for(var M=0;3>M;++M)A=a[h],S.push(A),w.push(A),x[E]=A,++E,y=p[A],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++h
+}g=n(a,l,S,p,_,w,c)}return x},r}),r("Core/GeometryPipeline",["./barycentricCoordinates","./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./EncodedCartesian3","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./GeographicProjection","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./Tipsify","./BoundingSphere","./Geometry","./GeometryAttribute"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w){"use strict";function E(e,t,r,i,n){e[t++]=r,e[t++]=i,e[t++]=i,e[t++]=n,e[t++]=n,e[t]=r}function x(e){for(var t=e.length,r=6*(t/3),i=g.createTypedArray(t,r),n=0,o=0;t>o;o+=3,n+=6)E(i,n,e[o],e[o+1],e[o+2]);return i}function b(e){var t=e.length;if(t>=3){var r=6*(t-2),i=g.createTypedArray(t,r);E(i,0,e[0],e[1],e[2]);for(var n=6,o=3;t>o;++o,n+=6)E(i,n,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function T(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=g.createTypedArray(t,r),n=e[0],o=0,a=1;t>a;++a,o+=6)E(i,o,n,e[a],e[a+1]);return i}return new Uint16Array}function A(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&r(e[i])&&r(e[i].values)){var n=e[i];t[i]=new w({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function P(e,t,i){for(var n in t)if(t.hasOwnProperty(n)&&r(t[n])&&r(t[n].values))for(var o=t[n],a=0;aa;a+=3)o.unpack(i,a,Z),m.multiplyByPoint(e,Z,Z),o.pack(Z,i,a)}function M(e,t){if(r(t))for(var i=t.values,n=i.length,a=0;n>a;a+=3)o.unpack(i,a,Z),d.multiplyByVector(e,Z,Z),Z=o.normalize(Z,Z),o.pack(Z,i,a)}function I(e){var t,i=e.length,n={},o=e[0].geometry.attributes;for(t in o)if(o.hasOwnProperty(t)&&r(o[t])&&r(o[t].values)){for(var a=o[t],s=a.values.length,l=!0,u=1;i>u;++u){var c=e[u].geometry.attributes[t];if(!r(c)||a.componentDatatype.value!==c.componentDatatype.value||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){l=!1;break}s+=c.values.length}l&&(n[t]=new w({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:v.createTypedArray(a.componentDatatype,s)}))}return n}function O(e){if(r(e.indices))return e;for(var t=S.computeNumberOfVertices(e),i=g.createTypedArray(t,t),n=0;t>n;++n)i[n]=n;return e.indices=i,e}function R(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var i=3,n=3;t>n;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;return e.indices=r,e.primitiveType=_.TRIANGLES,e}function L(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var i=6,n=3;t-1>n;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,t>n+2&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);return e.indices=r,e.primitiveType=_.TRIANGLES,e}function N(e){if(r(e.indices))return e;for(var t=S.computeNumberOfVertices(e),i=g.createTypedArray(t,t),n=0;t>n;++n)i[n]=n;return e.indices=i,e}function B(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var i=2,n=2;t>n;++n)r[i++]=n-1,r[i++]=n;return e.indices=r,e.primitiveType=_.LINES,e}function z(e){var t=S.computeNumberOfVertices(e),r=g.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var i=2,n=2;t>n;++n)r[i++]=n-1,r[i++]=n;return r[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=_.LINES,e}function F(e){switch(e.primitiveType){case _.TRIANGLE_FAN:return R(e);case _.TRIANGLE_STRIP:return L(e);case _.TRIANGLES:return O(e);case _.LINE_STRIP:return B(e);case _.LINE_LOOP:return z(e);case _.LINES:return N(e)}return e}function V(e,t){Math.abs(e.y)=0||t.x>=0||r.x>=0)return void 0;var i=e.y<0,n=t.y<0,o=r.y<0;V(e,i),V(t,n),V(r,o);var a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=ct.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(k(e,t,at,lt),k(e,r,st,ut),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(k(t,r,at,lt),k(t,e,st,ut),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(k(r,e,at,lt),k(r,t,st,ut),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?n?o||(k(r,e,at,lt),k(r,t,st,ut),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(k(t,r,at,lt),k(t,e,st,ut),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(k(e,t,at,lt),k(e,r,st,ut),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=ct.positions;return l[0]=e,l[1]=t,l[2]=r,ct.length=3,(1===a||2===a)&&(l[3]=at,l[4]=st,l[5]=lt,l[6]=ut,ct.length=7),ct}function W(t,i,a,s,l,u,c,h){if(r(l)||r(u)||r(c)||r(h)){var d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M=s.positions,I=M[0],O=M[1],R=M[2];r(l)&&(d=o.fromArray(l,3*t),m=o.fromArray(l,3*i),p=o.fromArray(l,3*a)),r(u)&&(f=o.fromArray(u,3*t),v=o.fromArray(u,3*i),g=o.fromArray(u,3*a)),r(c)&&(_=o.fromArray(c,3*t),y=o.fromArray(c,3*i),C=o.fromArray(c,3*a)),r(h)&&(S=n.fromArray(h,2*t),w=n.fromArray(h,2*i),E=n.fromArray(h,2*a));for(var L=3;Ly;y+=3){var C=u[y],w=u[y+1],E=u[y+2],x=o.fromArray(i,3*C),b=o.fromArray(i,3*w),T=o.fromArray(i,3*E),A=U(x,b,T);if(r(A))if(c[3*C+1]=A.positions[0].y,c[3*w+1]=A.positions[1].y,c[3*E+1]=A.positions[2].y,A.length>3){for(var P=c.length/3,D=0;DM?f.push(u[y+M]):f.push(M-3+P)}for(var I=3;Id;d+=2){var m=n[d],f=n[d+1],v=o.fromArray(i,3*m),_=o.fromArray(i,3*f);if(Math.abs(v.y)c;c+=3)l[u++]=o[c],l[u++]=o[c+1],l[u++]=o[c+2],l[u++]=o[c]+a[c]*n,l[u++]=o[c+1]+a[c+1]*n,l[u++]=o[c+2]+a[c+2]*n;var h,d=e.boundingSphere;return r(d)&&(h=new C(d.center,d.radius+n)),new S({attributes:{position:new w({componentDatatype:v.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:_.LINES,boundingSphere:h})},j.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent"],n=e.attributes,o={},a=0,s=i.length;for(t=0;s>t;++t){var l=i[t];r(n[l])&&(o[l]=a++)}for(var u in n)n.hasOwnProperty(u)&&!r(o[u])&&(o[u]=a++);return o},j.reorderForPreVertexCache=function(e){var t=S.computeNumberOfVertices(e),i=e.indices;if(r(i)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var a,s=i,l=s.length,u=g.createTypedArray(t,l),c=0,h=0,d=0;l>c;)a=n[s[c]],-1!==a?u[h]=a:(a=s[c],n[a]=d,u[h]=d,++d),++c,++h;e.indices=u;var m=e.attributes;for(var p in m)if(m.hasOwnProperty(p)&&r(m[p])&&r(m[p].values)){for(var f=m[p],_=f.values,y=0,C=f.componentsPerAttribute,w=v.createTypedArray(f.componentDatatype,d*C);t>y;){var E=n[y];if(-1!==E)for(o=0;C>o;o++)w[C*E+o]=_[C*y+o];++y}f.values=w}}return e},j.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===_.TRIANGLES&&r(i)){for(var n=i.length,o=0,a=0;n>a;a++)i[a]>o&&(o=i[a]);e.indices=y.tipsify({indices:i,maximumIndex:o,cacheSize:t})}return e},j.fitToUnsignedShortIndices=function(e){var t=[],i=S.computeNumberOfVertices(e);if(r(e.indices)&&i>h.SIXTY_FOUR_KILOBYTES){var n,o=[],a=[],s=0,l=A(e.attributes),u=e.indices,c=u.length;e.primitiveType===_.TRIANGLES?n=3:e.primitiveType===_.LINES?n=2:e.primitiveType===_.POINTS&&(n=1);for(var d=0;c>d;d+=n){for(var m=0;n>m;++m){var p=u[d+m],f=o[p];r(f)||(f=s++,o[p]=f,P(l,e.attributes,p)),a.push(f)}s+n>h.SIXTY_FOUR_KILOBYTES&&(t.push(new S({attributes:l,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),o=[],a=[],s=0,l=A(e.attributes))}0!==a.length&&t.push(new S({attributes:l,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var q=new o,Y=new s;j.projectTo2D=function(e,t,n,a,s){var l=e.attributes[t];s=r(s)?s:new f;for(var u=s.ellipsoid,c=l.values,h=new Float64Array(c.length),d=0,m=0;mc;++c)l.encode(o[c],X),s[c]=X.high,u[c]=X.low;var h=n.componentsPerAttribute;return e.attributes[r]=new w({componentDatatype:v.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[i]=new w({componentDatatype:v.FLOAT,componentsPerAttribute:h,values:u}),delete e.attributes[t],e};var Z=new o,J=new m,Q=new d;j.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(m.equals(t,m.IDENTITY))return e;var i=e.geometry.attributes;D(t,i.position),D(t,i.prevPosition),D(t,i.nextPosition),(r(i.normal)||r(i.binormal)||r(i.tangent))&&(m.inverse(t,J),m.transpose(J,J),m.getRotation(J,Q),M(Q,i.normal),M(Q,i.binormal),M(Q,i.tangent));var n=e.geometry.boundingSphere;return r(n)&&(e.geometry.boundingSphere=C.transform(n,t,n)),e.modelMatrix=m.clone(m.IDENTITY),e},j.combine=function(e){var t,i,n,a,s=e.length;e[0].modelMatrix;var l,u,c,h=r(e[0].geometry.indices),d=e[0].geometry.primitiveType,m=I(e);for(t in m)if(m.hasOwnProperty(t))for(l=m[t].values,a=0,i=0;s>i;++i)for(u=e[i].geometry.attributes[t].values,c=u.length,n=0;c>n;++n)l[a++]=u[n];var p;if(h){var f=0;for(i=0;s>i;++i)f+=e[i].geometry.indices.length;var v=S.computeNumberOfVertices(new S({attributes:m,primitiveType:_.POINTS})),y=g.createTypedArray(v,f),w=0,E=0;for(i=0;s>i;++i){var x=e[i].geometry.indices,b=x.length;for(a=0;b>a;++a)y[w++]=E+x[a];E+=S.computeNumberOfVertices(e[i].geometry)}p=y}var T,A=new o,P=0;for(i=0;s>i;++i){if(T=e[i].geometry.boundingSphere,!r(T)){A=void 0;break}o.add(T.center,A,A)}if(r(A))for(o.divideByScalar(A,s,A),i=0;s>i;++i){T=e[i].geometry.boundingSphere;var D=o.magnitude(o.subtract(T.center,A))+T.radius;D>P&&(P=D)}return new S({attributes:m,indices:p,primitiveType:d,boundingSphere:r(A)?new C(A,P):void 0})};var K=new o,$=new o,et=new o,tt=new o;j.computeNormal=function(e){for(var t=e.indices,r=e.attributes,i=r.position.values,n=r.position.values.length/3,a=t.length,s=new Array(n),l=new Array(a/3),u=new Array(a),c=0;n>c;c++)s[c]={indexOffset:0,count:0,currentCount:0};var h=0;for(c=0;a>c;c+=3){var d=t[c],m=t[c+1],p=t[c+2],f=3*d,g=3*m,_=3*p;$.x=i[f],$.y=i[f+1],$.z=i[f+2],et.x=i[g],et.y=i[g+1],et.z=i[g+2],tt.x=i[_],tt.y=i[_+1],tt.z=i[_+2],s[d].count++,s[m].count++,s[p].count++,o.subtract(et,$,et),o.subtract(tt,$,tt),l[h]=o.cross(et,tt),h++}var y=0;for(c=0;n>c;c++)s[c].indexOffset+=y,y+=s[c].count;h=0;var C;for(c=0;a>c;c+=3){C=s[t[c]];var S=C.indexOffset+C.currentCount;u[S]=h,C.currentCount++,C=s[t[c+1]],S=C.indexOffset+C.currentCount,u[S]=h,C.currentCount++,C=s[t[c+2]],S=C.indexOffset+C.currentCount,u[S]=h,C.currentCount++,h++}var E=new Float32Array(3*n);for(c=0;n>c;c++){var x=3*c;if(C=s[c],C.count>0){for(o.clone(o.ZERO,K),h=0;hu;u+=3){var m=t[u],p=t[u+1],f=t[u+2];c=3*m,h=3*p,d=3*f;var g=2*m,_=2*p,y=2*f,C=r[c],S=r[c+1],E=r[c+2],x=n[g],b=n[g+1],T=n[_+1]-b,A=n[y+1]-b,P=1/((n[_]-x)*A-(n[y]-x)*T),D=(A*(r[h]-C)-T*(r[d]-C))*P,M=(A*(r[h+1]-S)-T*(r[d+1]-S))*P,I=(A*(r[h+2]-E)-T*(r[d+2]-E))*P;l[c]+=D,l[c+1]+=M,l[c+2]+=I,l[h]+=D,l[h+1]+=M,l[h+2]+=I,l[d]+=D,l[d+1]+=M,l[d+2]+=I}var O=new Float32Array(3*a),R=new Float32Array(3*a);for(u=0;a>u;u++){c=3*u,h=c+1,d=c+2;var L=o.fromArray(i,c,rt),N=o.fromArray(l,c,nt),B=o.dot(L,N);o.multiplyByScalar(L,B,it),o.normalize(o.subtract(N,it,N),N),R[c]=N.x,R[h]=N.y,R[d]=N.z,o.normalize(o.cross(L,N,N),N),O[c]=N.x,O[h]=N.y,O[d]=N.z}return e.attributes.tangent=new w({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.binormal=new w({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:O}),e};var ot=new o,at=new o,st=new o,lt=new o,ut=new o,ct={positions:new Array(7),indices:new Array(9)};return j.wrapLongitude=function(e){var t=e.boundingSphere;if(r(t)){var i=t.center.x-t.radius;if(i>0||C.intersect(t,a.UNIT_Y)!==u.INTERSECTING)return e}return F(e),e.primitiveType===_.TRIANGLES?G(e):e.primitiveType===_.LINES&&H(e),e},j}),r("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=i.clone(e(t.modelMatrix,i.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{})};return n}),r("Core/EllipseGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./EllipseGeometryLibrary","./GeographicProjection","./Geometry","./GeometryPipeline","./GeometryInstance","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S){"use strict";function w(e,t,r){var i=t.vertexFormat,o=t.center,s=t.semiMajorAxis,l=t.ellipsoid,u=t.stRotation,d=r?2*(e.length/3):e.length/3,m=i.st?new Float32Array(2*d):void 0,p=i.normal?new Float32Array(3*d):void 0,g=i.tangent?new Float32Array(3*d):void 0,y=i.binormal?new Float32Array(3*d):void 0,S=0,w=N,E=B,x=z,b=new h(l),T=b.project(l.cartesianToCartographic(o,F),V),A=l.scaleToGeodeticSurface(o,P);l.geodeticSurfaceNormal(A,A);for(var I=C.fromAxisAngle(A,u,L),k=_.fromQuaternion(I,R),U=e.length,W=r?U:0,G=2*(W/3),H=0;U>H;H+=3){var j=H+1,q=H+2,Y=n.fromArray(e,H,P);if(i.st){var X=_.multiplyByVector(k,Y,D),Z=b.project(l.cartesianToCartographic(X,F),M);n.subtract(Z,T,Z),O.x=(Z.x+s)/(2*s),O.y=(Z.y+s)/(2*s),r&&(m[S+G]=O.x,m[S+1+G]=O.y),m[S++]=O.x,m[S++]=O.y}w=l.geodeticSurfaceNormal(Y,w),(i.normal||i.tangent||i.binormal)&&((i.tangent||i.binormal)&&(E=n.cross(n.UNIT_Z,w,E),_.multiplyByVector(k,E,E)),i.normal&&(p[H]=w.x,p[j]=w.y,p[q]=w.z,r&&(p[H+W]=-w.x,p[j+W]=-w.y,p[q+W]=-w.z)),i.tangent&&(g[H]=E.x,g[j]=E.y,g[q]=E.z,r&&(g[H+W]=-E.x,g[j+W]=-E.y,g[q+W]=-E.z)),i.binormal&&(x=n.cross(w,E,x),y[H]=x.x,y[j]=x.y,y[q]=x.z,r&&(y[H+W]=x.x,y[j+W]=x.y,y[q+W]=x.z)))}var J=new v;if(i.position){var Q=c.raisePositionsToHeight(e,t,r);J.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:Q})}return i.st&&(J.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(J.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(J.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),i.binormal&&(J.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:y})),J}function E(e){var t,r,i,n,o,a=new Array(2*e*(e+1)),s=0;for(n=1;e>n;++n){for(i=n*(n+1),t=(n-1)*n,a[s++]=i++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=i++,a[s++]=t,a[s++]=i}for(r=2*e,++i,++t,n=0;r-1>n;++n)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;for(++t,++i,n=e-1;n>0;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=t++,a[s++]=t++,a[s++]=i++}return a}function x(e){var t=e.center;k=n.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,k),e.height,k),k=n.add(t,k,k);var i=new r(k,e.semiMajorAxis),o=c.computeEllipsePositions(e,!0,!1),a=o.positions,l=o.numPts,u=w(a,e,!1),h=E(l);return h=s.createTypedArray(a.length/3,h),{boundingSphere:i,attributes:u,indices:h}}function b(e,t){var r=t.vertexFormat,i=t.center,o=t.semiMajorAxis,s=t.ellipsoid,l=t.height,u=t.extrudedHeight,c=t.stRotation,d=2*(e.length/3),m=new Float64Array(3*d),p=r.st?new Float32Array(2*d):void 0,g=r.normal?new Float32Array(3*d):void 0,y=r.tangent?new Float32Array(3*d):void 0,S=r.binormal?new Float32Array(3*d):void 0,w=0,E=N,x=B,b=z,T=new h(s),A=T.project(s.cartesianToCartographic(i,F),V),k=s.scaleToGeodeticSurface(i,P);s.geodeticSurfaceNormal(k,k);for(var U=C.fromAxisAngle(k,c,L),W=_.fromQuaternion(U,R),G=e.length,H=2*(G/3),j=0;G>j;j+=3){var q,Y=j+1,X=j+2,Z=n.fromArray(e,j,P);if(r.st){var J=_.multiplyByVector(W,Z,D),Q=T.project(s.cartesianToCartographic(J,F),M);n.subtract(Q,A,Q),O.x=(Q.x+o)/(2*o),O.y=(Q.y+o)/(2*o),p[w+H]=O.x,p[w+1+H]=O.y,p[w++]=O.x,p[w++]=O.y}Z=s.scaleToGeodeticSurface(Z,Z),q=n.clone(Z,D),E=s.geodeticSurfaceNormal(Z,E);var K=n.multiplyByScalar(E,l,I);if(Z=n.add(Z,K,Z),K=n.multiplyByScalar(E,u,K),q=n.add(q,K,q),r.position&&(m[j+G]=q.x,m[Y+G]=q.y,m[X+G]=q.z,m[j]=Z.x,m[Y]=Z.y,m[X]=Z.z),r.normal||r.tangent||r.binormal){b=n.clone(E,b);var $=n.fromArray(e,(j+3)%G,I);n.subtract($,Z,$);var et=n.subtract(q,Z,M);E=n.normalize(n.cross(et,$,E),E),r.normal&&(g[j]=E.x,g[Y]=E.y,g[X]=E.z,g[j+G]=E.x,g[Y+G]=E.y,g[X+G]=E.z),r.tangent&&(x=n.normalize(n.cross(b,E,x),x),y[j]=x.x,y[Y]=x.y,y[X]=x.z,y[j+G]=x.x,y[j+1+G]=x.y,y[j+2+G]=x.z),r.binormal&&(S[j]=b.x,S[Y]=b.y,S[X]=b.z,S[j+G]=b.x,S[Y+G]=b.y,S[X+G]=b.z)}}var tt=new v;return r.position&&(tt.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:m})),r.st&&(tt.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:p})),r.normal&&(tt.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),r.tangent&&(tt.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:y})),r.binormal&&(tt.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),tt}function T(e){for(var t,r,i,n,o=e.length/3,a=s.createTypedArray(o,6*o),l=0,u=0;o-1>u;u++)t=u,i=u+o,r=t+1,n=r+o,a[l++]=t,a[l++]=i,a[l++]=r,a[l++]=r,a[l++]=i,a[l++]=n;return t=o-1,i=u+o,r=0,n=r+o,a[l++]=t,a[l++]=i,a[l++]=r,a[l++]=r,a[l++]=i,a[l++]=n,a}function A(e){var t=e.center,i=e.ellipsoid,o=e.semiMajorAxis,a=n.multiplyByScalar(i.geodeticSurfaceNormal(t,P),e.height,P);U.center=n.add(t,a,U.center),U.radius=o,a=n.multiplyByScalar(i.geodeticSurfaceNormal(t,a),e.extrudedHeight,a),W.center=n.add(t,a,W.center),W.radius=o;var l=c.computeEllipsePositions(e,!0,!0),u=l.positions,h=l.numPts,f=l.outerPositions,v=r.union(U,W),g=w(u,e,!0),_=E(h),C=_.length;_.length=2*C;for(var S=u.length/3,x=0;C>x;x+=3)_[x+C]=_[x+2]+S,_[x+1+C]=_[x+1]+S,_[x+2+C]=_[x]+S;var A=s.createTypedArray(2*S/3,_),D=new d({attributes:g,indices:A,primitiveType:y.TRIANGLES}),M=b(f,e);_=T(f);var I=s.createTypedArray(2*f.length/3,_),O=new d({attributes:M,indices:I,primitiveType:y.TRIANGLES}),R=m.combine([new p({geometry:D}),new p({geometry:O})]);return{boundingSphere:v,attributes:R.attributes,indices:R.indices}}var P=new n,D=new n,M=new n,I=new n,O=new i,R=new _,L=new C,N=new n,B=new n,z=new n,F=new o,V=new n,k=new n,U=new r,W=new r,G=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.center,o=r.semiMajorAxis,a=r.semiMinorAxis,s=e(r.granularity,g.RADIANS_PER_DEGREE),l=e(r.height,0),c=r.extrudedHeight,h=t(c)&&!g.equalsEpsilon(l,c,1);this._center=n.clone(i),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=e(r.ellipsoid,u.WGS84),this._rotation=e(r.rotation,0),this._stRotation=e(r.stRotation,0),this._height=l,this._granularity=s,this._vertexFormat=e(r.vertexFormat,S.DEFAULT),this._extrudedHeight=c,this._extrude=h,this._workerName="createEllipseGeometry"};return G.createGeometry=function(e){var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=A(r)):t=x(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},G}),r("Core/CircleGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseGeometry"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.radius,n={center:t.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,vertexFormat:t.vertexFormat,stRotation:t.stRotation};this._ellipseGeometry=new i(n),this._workerName="createCircleGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/EllipseOutlineGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./EllipseGeometryLibrary","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e){var t=e.center;g=i.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=i.add(t,g,g);for(var a=new r(g,e.semiMajorAxis),s=l.computeEllipsePositions(e,!1,!0).outerPositions,u=new h({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l.raisePositionsToHeight(s,e,!1)})}),d=s.length/3,m=o.createTypedArray(d,2*d),p=0,f=0;d-1>f;f++)m[p++]=f,m[p++]=f+1;return m[p++]=d-1,m[p++]=0,{boundingSphere:a,attributes:u,indices:m}}function f(t){var a=e(t.numberOfVerticalLines,16);a=Math.max(a,0);var s=t.center,u=t.ellipsoid,d=t.semiMajorAxis,m=i.multiplyByScalar(u.geodeticSurfaceNormal(s,v),t.height,v);_.center=i.add(s,m,_.center),_.radius=d,m=i.multiplyByScalar(u.geodeticSurfaceNormal(s,m),t.extrudedHeight,m),y.center=i.add(s,m,y.center),y.radius=d;var p=l.computeEllipsePositions(t,!1,!0).outerPositions,f=new h({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l.raisePositionsToHeight(p,t,!0)})});p=f.position.values;var g=r.union(_,y),C=p.length/3,S=o.createTypedArray(C,2*C+2*a);C/=2;for(var w=0,E=0;C-1>E;E++)S[w++]=E,S[w++]=E+1,S[w++]=E+C,S[w++]=E+C+1;S[w++]=C-1,S[w++]=0,S[w++]=C+C-1,S[w++]=C;var x;if(a>0){var b=Math.min(a,C);x=Math.round(C/b)}var T=Math.min(x*a,C);if(a>0)for(E=0;T>E;E+=x)S[w++]=E,S[w++]=E+C;return{boundingSphere:g,attributes:f,indices:S}}var v=new i,g=new i,_=new r,y=new r,C=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.center,o=r.semiMajorAxis,a=r.semiMinorAxis,l=e(r.granularity,d.RADIANS_PER_DEGREE),u=e(r.height,0),c=r.extrudedHeight,h=t(c)&&!d.equalsEpsilon(u,c,1);this._center=i.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=e(r.ellipsoid,s.WGS84),this._rotation=e(r.rotation,0),this._height=u,this._granularity=l,this._extrudedHeight=c,this._extrude=h,this._numberOfVerticalLines=Math.max(e(r.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"};return C.createGeometry=function(e){var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=f(r)):t=p(r),new u({attributes:t.attributes,indices:t.indices,primitiveType:m.LINES,boundingSphere:t.boundingSphere})},C}),r("Core/CircleOutlineGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.radius,n={center:t.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,numberOfVerticalLines:t.numberOfVerticalLines};this._ellipseGeometry=new i(n),this._workerName="createCircleOutlineGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/ClockRange",["./Enumeration"],function(e){"use strict";var t={UNBOUNDED:new e(0,"UNBOUNDED"),CLAMPED:new e(1,"CLAMPED"),LOOP_STOP:new e(2,"LOOP_STOP")};return t}),r("Core/ClockStep",["./Enumeration"],function(e){"use strict";var t={TICK_DEPENDENT:new e(0,"TICK_DEPENDENT"),SYSTEM_CLOCK_MULTIPLIER:new e(1,"SYSTEM_CLOCK_MULTIPLIER"),SYSTEM_CLOCK:new e(2,"SYSTEM_CLOCK")};return t}),r("Core/Event",["./DeveloperError"],function(){"use strict";var e=function(){this._listeners=[],this._scopes=[]};return e.prototype.getNumberOfListeners=function(){return this._listeners.length},e.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var r=this;return function(){r.removeEventListener(e,t)}},e.prototype.removeEventListener=function(e,t){for(var r=this._listeners,i=this._scopes,n=-1,o=0;oi;i++)e[i].apply(t[i],arguments)},e}),r("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),r("Core/binarySearch",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t,r){for(var i,n,o=0,a=e.length-1;a>=o;)if(i=~~((o+a)/2),n=r(e[i],t),0>n)o=i+1;else{if(!(n>0))return i;a=i-1}return~(a+1)};return e}),r("Core/TimeConstants",[],function(){"use strict";var e={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e}),r("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),r("Core/LeapSecond",["./defined","./DeveloperError","./isArray"],function(){"use strict";var e=function(e,t){this.julianDate=e,this.offset=t};return e.setLeapSeconds=function(t){e._leapSeconds=t,e._leapSeconds.sort(e.compareLeapSecondDate)},e.getLeapSeconds=function(){return e._leapSeconds},e.prototype.equals=function(e){return this.julianDate.equals(e.julianDate)&&this.offset===e.offset},e.compareLeapSecondDate=function(e,t){return e.julianDate.compareTo(t.julianDate)},e._leapSeconds=[],e}),r("Core/TimeStandard",[],function(){"use strict";var e={UTC:0,TAI:1};return e}),r("Core/isLeapYear",["./DeveloperError"],function(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),r("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,i=t[r++],n=function(e,t,r,i){r||(r=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return i?e+n:n+e},o=function(e,t,r,i,o,a){var s=i-e.length;return s>0&&(e=r||!o?n(e,i,a,r):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,i,a,s,l){var u=e>>>0;return r=r&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+n(u.toString(t),s||0,"0",!1),o(e,r,i,a,l)},s=function(e,t,r,i,n,a){return null!=i&&(e=e.slice(0,i)),o(e,"",t,r,n,a)},l=function(e,i,l,u,c,h,d){var m,p,f,v,g;if("%%"==e)return"%";for(var _=!1,y="",C=!1,S=!1,w=" ",E=l.length,x=0;l&&E>x;x++)switch(l.charAt(x)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":w=l.charAt(x+1);break;case"0":C=!0;break;case"#":S=!0}if(u=u?"*"==u?+t[r++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,0>u&&(u=-u,_=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[r++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,g=i?t[i.slice(0,-1)]:t[r++],d){case"s":return s(String(g),_,u,h,C,w);case"c":return s(String.fromCharCode(+g),_,u,h,C);case"b":return a(g,2,S,_,u,h,C);case"o":return a(g,8,S,_,u,h,C);case"x":return a(g,16,S,_,u,h,C);case"X":return a(g,16,S,_,u,h,C).toUpperCase();case"u":return a(g,10,S,_,u,h,C);case"i":case"d":return m=+g||0,m=Math.round(m-m%1),p=0>m?"-":y,g=p+n(String(Math.abs(m)),h,"0",!1),o(g,p,_,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return m=+g,p=0>m?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=p+Math.abs(m)[f](h),o(g,p,_,u,C)[v]();default:return e}};return i.replace(e,l)}return e}),r("Core/JulianDate",["./DeveloperError","./binarySearch","./defined","./defaultValue","./TimeConstants","./LeapSecond","./TimeStandard","./isLeapYear","../ThirdParty/sprintf"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){g.julianDate=e;var r=o.getLeapSeconds(),i=t(r,g,o.compareLeapSecondDate);0>i&&(i=~i),i>=r.length&&(i=r.length-1);var n=r[i].offset;if(i>0){var a=e.getSecondsDifference(r[i].julianDate);a>n&&(i--,n=r[i].offset)}e.addSeconds(n,e)}function c(e,r){g.julianDate=e;var i=o.getLeapSeconds(),n=t(i,g,o.compareLeapSecondDate);if(0>n&&(n=~n),0===n)return e.addSeconds(-i[0].offset,r);if(n>=i.length)return e.addSeconds(-i[n-1].offset,r);var a=e.getSecondsDifference(i[n].julianDate);
+return 0===a?e.addSeconds(-i[n].offset,r):1>=a?void 0:e.addSeconds(-i[--n].offset,r)}function h(e,t,i){var o=0|t/n.SECONDS_PER_DAY;return e+=o,t-=n.SECONDS_PER_DAY*o,0>t&&(e--,t+=n.SECONDS_PER_DAY),r(i)?(i._julianDayNumber=e,i._secondsOfDay=t,i):new P(e,t,a.TAI)}function d(e,t,r,i,o,a,s){var l=0|(t-14)/12,u=e+4800+l,c=(0|1461*u/4)+(0|367*(t-2-12*l)/12)-(0|3*((u+100)/100)/4)+r-32075;i-=12,0>i&&(i+=24);var h=a+(i*n.SECONDS_PER_HOUR+o*n.SECONDS_PER_MINUTE+s*n.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function m(e){return d(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())}var p=function(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s},f=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g={julianDate:void 0},_=/^(\d{4})$/,y=/^(\d{4})-(\d{2})$/,C=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,w=/^(\d{4})-?(\d{2})-?(\d{2})$/,E=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+E.source,b=/^(\d{2}):?(\d{2})(\.\d+)?/.source+E.source,T=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+E.source,A="Valid ISO 8601 date string required.",P=function(e,t,o){this._julianDayNumber=void 0,this._secondsOfDay=void 0;var s,l;if(r(e)||r(t)||r(o))o=i(o,a.UTC),s=0|e,l=t+(e-s)*n.SECONDS_PER_DAY;else{var c=new Date,d=m(c);s=d[0],l=d[1],o=a.UTC}h(s,l,this),o===a.UTC&&u(this)};P.clone=function(e,t){return r(e)?r(t)?(t._julianDayNumber=e._julianDayNumber,t._secondsOfDay=e._secondsOfDay,t):new P(e._julianDayNumber,e._secondsOfDay,a.TAI):void 0},P.fromDate=function(e,t){var r=m(e);return new P(r[0],r[1],t)},P.fromIso8601=function(t){t=t.replace(",",".");var i,n,o,l=t.split("T"),u=1,c=1,h=0,m=0,p=0,g=0,E=l[0],D=l[1];if(!r(E))throw new e(A);var M;if(l=E.match(w),null!==l){if(M=E.split("-").length-1,M>0&&2!==M)throw new e(A);i=+l[1],u=+l[2],c=+l[3]}else if(l=E.match(y),null!==l)i=+l[1],u=+l[2];else if(l=E.match(_),null!==l)i=+l[1];else{var I;if(l=E.match(C),null!==l){if(i=+l[1],I=+l[2],o=s(i),1>I||o&&I>366||!o&&I>365)throw new e(A)}else{if(l=E.match(S),null===l)throw new e(A);i=+l[1];var O=+l[2],R=+l[3]||0;if(M=E.split("-").length-1,M>0&&(!r(l[3])&&1!==M||r(l[3])&&2!==M))throw new e(A);var L=new Date(Date.UTC(i,0,4));I=7*O+R-L.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),u=n.getUTCMonth()+1,c=n.getUTCDate()}if(o=s(i),1>u||u>12||1>c||(2!==u||!o)&&c>f[u-1]||o&&2===u&&c>v)throw new e(A);var N;if(r(D)){if(l=D.match(T),null!==l){if(M=D.split(":").length-1,M>0&&2!==M&&3!==M)throw new e(A);h=+l[1],m=+l[2],p=+l[3],g=1e3*+(l[4]||0),N=5}else if(l=D.match(b),null!==l){if(M=D.split(":").length-1,M>0&&1!==M)throw new e(A);h=+l[1],m=+l[2],p=60*+(l[3]||0),N=4}else{if(l=D.match(x),null===l)throw new e(A);h=+l[1],m=60*+(l[2]||0),N=3}if(m>=60||p>=61||h>24||24===h&&(m>0||p>0||g>0))throw new e(A);var B=l[N],z=+l[N+1],F=+(l[N+2]||0);switch(B){case"+":h-=z,m-=F;break;case"-":h+=z,m+=F;break;case"Z":break;default:m+=new Date(Date.UTC(i,u-1,c,h,m)).getTimezoneOffset()}}else m+=new Date(Date.UTC(i,u-1,c)).getTimezoneOffset();var V=60===p;for(V&&p--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===u?v:f[u-1];c>n;)c-=n,u++,u>12&&(u-=12,i++),n=o&&2===u?v:f[u-1];for(;0>m;)m+=60,h--;for(;0>h;)h+=24,c--;for(;1>c;)u--,1>u&&(u+=12,i--),n=o&&2===u?v:f[u-1],c+=n;var k=d(i,u,c,h,m,p,g),U=new P(k[0],k[1],a.UTC);return V&&U.addSeconds(1,U),U},P.fromTotalDays=function(e,t){return new P(e,0,t)},P.compare=function(e,t){var r=e._julianDayNumber-t._julianDayNumber;return 0!==r?r:e._secondsOfDay-t._secondsOfDay},P.equals=function(e,t){return e===t||r(e)&&r(t)&&e._julianDayNumber===t._julianDayNumber&&e._secondsOfDay===t._secondsOfDay},P.equalsEpsilon=function(e,t,r){return Math.abs(e.getSecondsDifference(t))<=r},P.prototype.clone=function(e){return P.clone(this,e)},P.prototype.getTotalDays=function(){return this._julianDayNumber+this._secondsOfDay/n.SECONDS_PER_DAY},P.prototype.getJulianDayNumber=function(){return this._julianDayNumber},P.prototype.getJulianTimeFraction=function(){return this._secondsOfDay/n.SECONDS_PER_DAY},P.prototype.getSecondsOfDay=function(){return this._secondsOfDay};var D=new P(0,0,a.TAI);return P.prototype.toGregorianDate=function(){var e=!1,t=c(this,D);r(t)||(this.addSeconds(-1,D),t=c(D,D),e=!0);var i=t._julianDayNumber,o=t._secondsOfDay;o>=43200&&(i+=1);var a=0|i+68569,s=0|4*a/146097;a=0|a-(0|(146097*s+3)/4);var l=0|4e3*(a+1)/1461001;a=0|a-(0|1461*l/4)+31;var u=0|80*a/2447,h=0|a-(0|2447*u/80);a=0|u/11;var d=0|u+2-12*a,m=0|100*(s-49)+l+a,f=0|o/n.SECONDS_PER_HOUR,v=o-f*n.SECONDS_PER_HOUR,g=0|v/n.SECONDS_PER_MINUTE;v-=g*n.SECONDS_PER_MINUTE;var _=0|v,y=(v-_)/n.SECONDS_PER_MILLISECOND;return f+=12,f>23&&(f-=24),e&&(_+=1),new p(m,d,h,f,g,_,y,e)},P.prototype.toDate=function(){var e=this.toGregorianDate(),t=e.second;return e.isLeapSecond&&(t-=1),new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,t,e.millisecond))},P.prototype.toIso8601=function(e){var t,i=this.toGregorianDate();return r(e)||0===i.millisecond?r(e)&&0!==e?(t=(.01*i.millisecond).toFixed(e).replace(".","").slice(0,e),l("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,t)):l("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(t=(.01*i.millisecond).toString().replace(".",""),l("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,t))},P.prototype.getSecondsDifference=function(e){var t=this,r=e,i=(r._julianDayNumber-t._julianDayNumber)*n.SECONDS_PER_DAY;return i+(r._secondsOfDay-t._secondsOfDay)},P.prototype.getMinutesDifference=function(e){return this.getSecondsDifference(e)/n.SECONDS_PER_MINUTE},P.prototype.getDaysDifference=function(e){var t=this,r=e,i=r._julianDayNumber-t._julianDayNumber,o=(r._secondsOfDay-t._secondsOfDay)/n.SECONDS_PER_DAY;return i+o},P.prototype.getTaiMinusUtc=function(){g.julianDate=this;var e=o.getLeapSeconds(),r=t(e,g,o.compareLeapSecondDate);return 0>r&&(r=~r,--r,0>r&&(r=0)),e[r].offset},P.prototype.addSeconds=function(e,t){return h(this._julianDayNumber,this._secondsOfDay+e,t)},P.prototype.addMinutes=function(e){var t=this._secondsOfDay+e*n.SECONDS_PER_MINUTE;return new P(this._julianDayNumber,t,a.TAI)},P.prototype.addHours=function(e){var t=this._secondsOfDay+e*n.SECONDS_PER_HOUR;return new P(this._julianDayNumber,t,a.TAI)},P.prototype.addDays=function(e){var t=this._julianDayNumber+e;return new P(t,this._secondsOfDay,a.TAI)},P.prototype.lessThan=function(e){return P.compare(this,e)<0},P.prototype.lessThanOrEquals=function(e){return P.compare(this,e)<=0},P.prototype.greaterThan=function(e){return P.compare(this,e)>0},P.prototype.greaterThanOrEquals=function(e){return P.compare(this,e)>=0},P.prototype.compareTo=function(e){return P.compare(this,e)},P.prototype.equals=function(e){return P.equals(this,e)},P.prototype.equalsEpsilon=function(e,t){return P.equalsEpsilon(this,e,t)},0===o._leapSeconds.length&&(o._leapSeconds=[new o(new P(2441317,43210,a.TAI),10),new o(new P(2441499,43211,a.TAI),11),new o(new P(2441683,43212,a.TAI),12),new o(new P(2442048,43213,a.TAI),13),new o(new P(2442413,43214,a.TAI),14),new o(new P(2442778,43215,a.TAI),15),new o(new P(2443144,43216,a.TAI),16),new o(new P(2443509,43217,a.TAI),17),new o(new P(2443874,43218,a.TAI),18),new o(new P(2444239,43219,a.TAI),19),new o(new P(2444786,43220,a.TAI),20),new o(new P(2445151,43221,a.TAI),21),new o(new P(2445516,43222,a.TAI),22),new o(new P(2446247,43223,a.TAI),23),new o(new P(2447161,43224,a.TAI),24),new o(new P(2447892,43225,a.TAI),25),new o(new P(2448257,43226,a.TAI),26),new o(new P(2448804,43227,a.TAI),27),new o(new P(2449169,43228,a.TAI),28),new o(new P(2449534,43229,a.TAI),29),new o(new P(2450083,43230,a.TAI),30),new o(new P(2450630,43231,a.TAI),31),new o(new P(2451179,43232,a.TAI),32),new o(new P(2453736,43233,a.TAI),33),new o(new P(2454832,43234,a.TAI),34),new o(new P(2456109,43235,a.TAI),35)]),P}),r("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(n){n=r(n,r.EMPTY_OBJECT);var l=n.startTime,u=!i(l),c=n.stopTime,h=!i(c),d=n.currentTime,m=!i(d);u&&h&&m?(d=new s,l=s.clone(d),c=d.addDays(1)):u&&h?(l=s.clone(d),c=d.addDays(1)):u&&m?(l=c.addDays(-1),d=s.clone(l)):m&&h?(d=s.clone(l),c=l.addDays(1)):m?d=s.clone(l):h?c=d.addDays(1):u&&(l=s.clone(d)),this.startTime=l,this.stopTime=c,this.currentTime=d,this.multiplier=r(n.multiplier,1),this.clockStep=r(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=r(n.clockRange,e.UNBOUNDED),this.shouldAnimate=r(n.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=a()};return l.prototype.tick=function(){var r=a(),i=this.currentTime,n=this.startTime,o=this.stopTime,l=this.multiplier;if(this.shouldAnimate)if(this.clockStep===t.SYSTEM_CLOCK)i=new s;else{if(this.clockStep===t.TICK_DEPENDENT)i=i.addSeconds(l);else{var u=r-this._lastSystemTime;i=i.addSeconds(l*(u/1e3))}if(this.clockRange===e.CLAMPED)i.lessThan(n)?i=n:i.greaterThan(o)&&(i=o);else if(this.clockRange===e.LOOP_STOP)for(i.lessThan(n)&&(i=s.clone(n));i.greaterThan(o);)i=n.addSeconds(o.getSecondsDifference(i))}return this.currentTime=i,this._lastSystemTime=r,this.onTick.raiseEvent(this),i},l}),r("Core/Color",["./defaultValue","./defined","./freezeObject","./DeveloperError","./FeatureDetection","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var s=function(t,r,i,n){this.red=e(t,1),this.green=e(r,1),this.blue=e(i,1),this.alpha=e(n,1)};s.fromBytes=function(t,r,i,n){return t=s.byteToFloat(e(t,255)),r=s.byteToFloat(e(r,255)),i=s.byteToFloat(e(i,255)),n=s.byteToFloat(e(n,255)),new s(t,r,i,n)};var l,u,c;n.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(t,r,i,n){t=e(t,0)%1,r=e(r,0),i=e(i,0),n=e(n,1);var o=i,l=i,u=i;if(0!==r){var c;c=.5>i?i*(1+r):i+r-i*r;var h=2*i-c;o=a(h,c,t+1/3),l=a(h,c,t),u=a(h,c,t-1/3)}return new s(o,l,u,n)},s.fromRandom=function(r,i){r=e(r,e.EMPTY_OBJECT);var n=r.red;if(!t(n)){var a=e(r.minimumRed,0),l=e(r.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=r.green;if(!t(u)){var c=e(r.minimumGreen,0),h=e(r.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=r.blue;if(!t(d)){var m=e(r.minimumBlue,0),p=e(r.maximumBlue,1);d=m+o.nextRandomNumber()*(p-m)}var f=r.alpha;if(!t(f)){var v=e(r.minimumAlpha,0),g=e(r.maximumAlpha,1);f=v+o.nextRandomNumber()*(g-v)}return t(i)?(i.red=n,i.green=u,i.blue=d,i.alpha=f,i):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,m=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,p=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){var i=s[r.toUpperCase()];if(t(i))return s.clone(i);var n=h.exec(r);return null!==n?new s(parseInt(n[1],16)/15,parseInt(n[2],16)/15,parseInt(n[3],16)/15):(n=d.exec(r),null!==n?new s(parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255):(n=m.exec(r),null!==n?new s(parseFloat(n[1])/("%"===n[1].substr(-1)?100:255),parseFloat(n[2])/("%"===n[2].substr(-1)?100:255),parseFloat(n[3])/("%"===n[3].substr(-1)?100:255),parseFloat(e(n[4],"1.0"))):(n=p.exec(r),null!==n?s.fromHsl(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(e(n[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,r,i){i=e(i,0),r[i++]=t.red,r[i++]=t.green,r[i++]=t.blue,r[i]=t.alpha},s.unpack=function(r,i,n){return i=e(i,0),t(n)||(n=new s),n.red=r[i++],n.green=r[i++],n.blue=r[i++],n.alpha=r[i],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:0|256*e},s.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new s(e.red,e.green,e.blue,e.alpha):void 0},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var r=s.floatToByte(this.red),i=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=i,e[2]=n,e[3]=o,e):[r,i,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.ALICEBLUE=r(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=r(s.fromCssColorString("#FAEBD7")),s.AQUA=r(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=r(s.fromCssColorString("#7FFFD4")),s.AZURE=r(s.fromCssColorString("#F0FFFF")),s.BEIGE=r(s.fromCssColorString("#F5F5DC")),s.BISQUE=r(s.fromCssColorString("#FFE4C4")),s.BLACK=r(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=r(s.fromCssColorString("#FFEBCD")),s.BLUE=r(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=r(s.fromCssColorString("#8A2BE2")),s.BROWN=r(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=r(s.fromCssColorString("#DEB887")),s.CADETBLUE=r(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=r(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=r(s.fromCssColorString("#D2691E")),s.CORAL=r(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=r(s.fromCssColorString("#6495ED")),s.CORNSILK=r(s.fromCssColorString("#FFF8DC")),s.CRIMSON=r(s.fromCssColorString("#DC143C")),s.CYAN=r(s.fromCssColorString("#00FFFF")),s.DARKBLUE=r(s.fromCssColorString("#00008B")),s.DARKCYAN=r(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=r(s.fromCssColorString("#B8860B")),s.DARKGRAY=r(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=r(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=r(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=r(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=r(s.fromCssColorString("#556B2F")),s.DARKORANGE=r(s.fromCssColorString("#FF8C00")),s.DARKORCHID=r(s.fromCssColorString("#9932CC")),s.DARKRED=r(s.fromCssColorString("#8B0000")),s.DARKSALMON=r(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=r(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=r(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=r(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=r(s.fromCssColorString("#00CED1")),s.DARKVIOLET=r(s.fromCssColorString("#9400D3")),s.DEEPPINK=r(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=r(s.fromCssColorString("#00BFFF")),s.DIMGRAY=r(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=r(s.fromCssColorString("#1E90FF")),s.FIREBRICK=r(s.fromCssColorString("#B22222")),s.FLORALWHITE=r(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=r(s.fromCssColorString("#228B22")),s.FUSCHIA=r(s.fromCssColorString("#FF00FF")),s.GAINSBORO=r(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=r(s.fromCssColorString("#F8F8FF")),s.GOLD=r(s.fromCssColorString("#FFD700")),s.GOLDENROD=r(s.fromCssColorString("#DAA520")),s.GRAY=r(s.fromCssColorString("#808080")),s.GREEN=r(s.fromCssColorString("#008000")),s.GREENYELLOW=r(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=r(s.fromCssColorString("#F0FFF0")),s.HOTPINK=r(s.fromCssColorString("#FF69B4")),s.INDIANRED=r(s.fromCssColorString("#CD5C5C")),s.INDIGO=r(s.fromCssColorString("#4B0082")),s.IVORY=r(s.fromCssColorString("#FFFFF0")),s.KHAKI=r(s.fromCssColorString("#F0E68C")),s.LAVENDER=r(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=r(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=r(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=r(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=r(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=r(s.fromCssColorString("#F08080")),s.LIGHTCYAN=r(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=r(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=r(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=r(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=r(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=r(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=r(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=r(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=r(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=r(s.fromCssColorString("#FFFFE0")),s.LIME=r(s.fromCssColorString("#00FF00")),s.LIMEGREEN=r(s.fromCssColorString("#32CD32")),s.LINEN=r(s.fromCssColorString("#FAF0E6")),s.MAGENTA=r(s.fromCssColorString("#FF00FF")),s.MAROON=r(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=r(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=r(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=r(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=r(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=r(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=r(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=r(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=r(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=r(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=r(s.fromCssColorString("#191970")),s.MINTCREAM=r(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=r(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=r(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=r(s.fromCssColorString("#FFDEAD")),s.NAVY=r(s.fromCssColorString("#000080")),s.OLDLACE=r(s.fromCssColorString("#FDF5E6")),s.OLIVE=r(s.fromCssColorString("#808000")),s.OLIVEDRAB=r(s.fromCssColorString("#6B8E23")),s.ORANGE=r(s.fromCssColorString("#FFA500")),s.ORANGERED=r(s.fromCssColorString("#FF4500")),s.ORCHID=r(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=r(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=r(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=r(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=r(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=r(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=r(s.fromCssColorString("#FFDAB9")),s.PERU=r(s.fromCssColorString("#CD853F")),s.PINK=r(s.fromCssColorString("#FFC0CB")),s.PLUM=r(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=r(s.fromCssColorString("#B0E0E6")),s.PURPLE=r(s.fromCssColorString("#800080")),s.RED=r(s.fromCssColorString("#FF0000")),s.ROSYBROWN=r(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=r(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=r(s.fromCssColorString("#8B4513")),s.SALMON=r(s.fromCssColorString("#FA8072")),s.SANDYBROWN=r(s.fromCssColorString("#F4A460")),s.SEAGREEN=r(s.fromCssColorString("#2E8B57")),s.SEASHELL=r(s.fromCssColorString("#FFF5EE")),s.SIENNA=r(s.fromCssColorString("#A0522D")),s.SILVER=r(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=r(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=r(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=r(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=r(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=r(s.fromCssColorString("#00FF7F")),s.STEELBLUE=r(s.fromCssColorString("#4682B4")),s.TAN=r(s.fromCssColorString("#D2B48C")),s.TEAL=r(s.fromCssColorString("#008080")),s.THISTLE=r(s.fromCssColorString("#D8BFD8")),s.TOMATO=r(s.fromCssColorString("#FF6347")),s.TURQUOISE=r(s.fromCssColorString("#40E0D0")),s.VIOLET=r(s.fromCssColorString("#EE82EE")),s.WHEAT=r(s.fromCssColorString("#F5DEB3")),s.WHITE=r(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=r(s.fromCssColorString("#F5F5F5")),s.YELLOW=r(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=r(s.fromCssColorString("#9ACD32")),s}),r("Core/ColorGeometryInstanceAttribute",["./defaultValue","./defined","./Color","./ComponentDatatype","./DeveloperError"],function(e,t,r,i){"use strict";var n=function(t,n,o,a){t=e(t,1),n=e(n,1),o=e(o,1),a=e(a,1),this.componentDatatype=i.UNSIGNED_BYTE,this.componentsPerAttribute=4,this.normalize=!0,this.value=new Uint8Array([r.floatToByte(t),r.floatToByte(n),r.floatToByte(o),r.floatToByte(a)])};return n.fromColor=function(e){return new n(e.red,e.green,e.blue,e.alpha)},n.toValue=function(e,r){return t(r)?e.toBytes(r):new Uint8Array(e.toBytes())},n}),r("Core/CornerType",["../Core/Enumeration"],function(e){"use strict";var t={ROUNDED:new e(0,"ROUNDED"),MITERED:new e(1,"MITERED"),BEVELED:new e(2,"BEVELED")};return t}),r("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,n=(r-i)/r,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,m=1-d,p=Math.sqrt(m),f=t/4,v=f*f,g=v*f,_=v*v,y=1+f-3*v/4+5*g/4-175*_/64,C=1-f+15*v/8-35*g/8,S=1-3*f+35*v/4,w=1-5*f,E=y*c-C*Math.sin(2*c)*f/2-S*Math.sin(4*c)*v/16-w*Math.sin(6*c)*g/48-5*Math.sin(8*c)*_/512,x=e._constants;x.a=r,x.b=i,x.f=n,x.cosineHeading=o,x.sineHeading=a,x.tanU=s,x.cosineU=l,x.sineU=u,x.sigma=c,x.sineAlpha=h,x.sineSquaredAlpha=d,x.cosineSquaredAlpha=m,x.cosineAlpha=p,x.u2Over4=f,x.u4Over16=v,x.u6Over64=g,x.u8Over256=_,x.a0=y,x.a1=C,x.a2=S,x.a3=w,x.distanceRatio=E}function l(e,t){return e*t*(4+e*(4-3*t))/16}function u(e,t,r,i,n,o,a){var s=l(e,r);return(1-s)*e*t*(i+s*n*(a+s*o*(2*a*a-1)))}function c(e,t,r,i,n,o,s){var l,c,h,d,m,p=(t-r)/t,f=o-i,v=Math.atan((1-p)*Math.tan(n)),g=Math.atan((1-p)*Math.tan(s)),_=Math.cos(v),y=Math.sin(v),C=Math.cos(g),S=Math.sin(g),w=_*C,E=_*S,x=y*S,b=y*C,T=f,A=a.TWO_PI,P=Math.cos(T),D=Math.sin(T);do{P=Math.cos(T),D=Math.sin(T);var M=E-b*P;h=Math.sqrt(C*C*D*D+M*M),c=x+w*P,l=Math.atan2(h,c);var I;0===h?(I=0,d=1):(I=w*D/h,d=1-I*I),A=T,m=c-2*x/d,isNaN(m)&&(m=0),T=f+u(p,I,d,l,h,c,m)}while(Math.abs(T-A)>a.EPSILON12);var O=d*(t*t-r*r)/(r*r),R=1+O*(4096+O*(O*(320-175*O)-768))/16384,L=O*(256+O*(O*(74-47*O)-128))/1024,N=m*m,B=L*h*(m+L*(c*(2*N-1)-L*m*(4*h*h-3)*(4*N-3)/6)/4),z=r*R*(l-B),F=Math.atan2(C*D,E-b*P),V=Math.atan2(_*D,E*P-b);e._distance=z,e._startHeading=F,e._endHeading=V,e._uSquared=O}function h(r,i,n,o){e.normalize(o.cartographicToCartesian(i,m),d),e.normalize(o.cartographicToCartesian(n,m),m),c(r,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),i.height=0,n.height=0,r._start=t.clone(i,r._start),r._end=t.clone(n,r._end),s(r)}var d=new e,m=new e,p=function(e,n,a){var s=r(a,o.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,i(e)&&i(n)&&h(this,e,n,s)};return p.prototype.getSurfaceDistance=function(){return this._distance},p.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},p.prototype.getStart=function(){return this._start},p.prototype.getEnd=function(){return this._end},p.prototype.getStartHeading=function(){return this._startHeading},p.prototype.getEndHeading=function(){return this._endHeading},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,r){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),c=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),m=Math.sin(8*o),p=o*o,f=o*p,v=n.u8Over256,g=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*f*v*a/3+o*(1-g+7*y/4-15*_/4+579*v/64-(y-15*_/4+187*v/16)*a-(5*_/4-115*v/16)*s-29*v*l/16)+(g/2-y+71*_/32-85*v/16)*c+(5*y/16-5*_/4+383*v/96)*h-p*((_-11*v/2)*c+5*v*h/2)+(29*_/96-29*v/16)*d+539*v*m/1536,S=Math.asin(Math.sin(C)*n.cosineAlpha),w=Math.atan(n.a/n.b*Math.tan(S));C-=n.sigma;var E=Math.cos(2*n.sigma+C),x=Math.sin(C),b=Math.cos(C),T=n.cosineU*b,A=n.sineU*x,P=Math.atan2(x*n.sineHeading,T-A*n.cosineHeading),D=P-u(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,x,b,E);return i(r)?(r.longitude=this._start.longitude+D,r.latitude=w,r.height=0,r):new t(this._start.longitude+D,w,0)},p}),r("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(t,r,i,n){var o=n.scaleToGeodeticSurface(t,T),a=n.scaleToGeodeticSurface(r,A),s=e.angleBetween(o,a),l=Math.ceil(s/i),u=new Array(3*l),c=n.cartesianToCartographic(o,E),h=n.cartesianToCartographic(a,x);P.setEndPoints(c,h);var d=P.getSurfaceDistance()/l,m=0;c.height=0;var p=n.cartographicToCartesian(c,b);u[m++]=p.x,u[m++]=p.y,u[m++]=p.z;for(var f=1;l>f;f++){var v=P.interpolateUsingSurfaceDistance(f*d,x);p=n.cartographicToCartesian(v,b),u[m++]=p.x,u[m++]=p.y,u[m++]=p.z}return u}function m(t,r,i){var n=D;return i.geodeticSurfaceNormal(t,n),e.multiplyByScalar(n,r,n),e.add(t,n,t),t}var p={},f=new c,v=new e,g=new e,_=new h(e.ZERO,0),y=new e,C=new h(e.ZERO,0),S=new e,w=new e,E=new t,x=new t,b=new e,T=new e,A=new e,P=new a,D=new e,M=new e;return p.wrapLongitude=function(t,n){var o=[],a=[];if(i(t)&&t.length>0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,f),u=c.multiplyByPoint(l,e.ZERO,v),d=c.multiplyByPointAsVector(l,e.UNIT_Y,g),m=h.fromPointNormal(u,d,_),p=c.multiplyByPointAsVector(l,e.UNIT_X,y),E=h.fromPointNormal(u,p,C),x=1;o.push(e.clone(t[0]));for(var b=o[0],T=t.length,A=1;T>A;++A){var P=t[A];if(h.getPointDistance(E,b)<0||h.getPointDistance(E,P)<0){var D=s.lineSegmentPlane(b,P,m,S);if(i(D)){var M=e.multiplyByScalar(d,5e-9,w);h.getPointDistance(m,b)<0&&e.negate(M,M),o.push(e.add(D,M)),a.push(x+1),e.negate(M,M),o.push(e.add(D,M)),x=1}}o.push(e.clone(t[A])),x++,b=P}a.push(x)}return{positions:o,lengths:a}},p.removeDuplicates=function(t){var r=t.length;if(2>r)return t.slice(0);var i=[];i.push(t[0]);for(var n=1;r>n;++n){var o=t[n-1],a=t[n];e.equals(o,a)||i.push(a)}return i},p.scaleToSurface=function(e,t,i){t=r(t,u.RADIANS_PER_DEGREE),i=r(i,o.WGS84);for(var n=e.length,a=[],s=0;n-1>s;s++){var l=e[s],c=e[s+1];a=a.concat(d(l,c,t,i))}var h=e[n-1],m=i.cartesianToCartographic(h,E);m.height=0;var p=i.cartographicToCartesian(m,b);return a.push(p.x,p.y,p.z),a},p.scaleToGeodeticHeight=function(t,a,s,u){s=r(s,o.WGS84);var c,h,d=t.length,p=M;if(i(u)){if(u.length!==t.length)throw new n("result.length must be equal to positions.length");h=u}else h=new Array(t.length);if(0===a){for(c=0;d>c;c+=3)p=s.scaleToGeodeticSurface(e.fromArray(t,c,p),p),h[c]=p.x,h[c+1]=p.y,h[c+2]=p.z;return h}var f;if(l(a)){if(a.length!==d/3)throw new n("height.length must be equal to positions.length");for(c=0;d>c;c+=3)f=a[c/3],p=e.fromArray(t,c,p),p=m(p,f,s),h[c]=p.x,h[c+1]=p.y,h[c+2]=p.z}else for(f=a,c=0;d>c;c+=3)p=e.fromArray(t,c,p),p=m(p,f,s),h[c]=p.x,h[c+1]=p.y,h[c+2]=p.z;return h},p}),r("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=i.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function r(e,t,r,i){return(t||"")+r.toLowerCase()+(i||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var i=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,r).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(r.path=t.authority&&""==t.path?"/"+this.path:t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],i=""==t[0];for(i&&t.shift(),""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);("."==e||".."==e)&&r.push(""),i&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),r("Core/buildModuleUrl",["require","./defined","./DeveloperError","../ThirdParty/Uri"],function(e,t,r,i){"use strict";function n(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var i=e[t].getAttribute("src"),n=h.exec(i);if(null!==n)return n[1]}return void 0}function o(){if(t(l))return l;var e;if(e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:n(),!t(e))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new i(e).resolve(new i(document.location.href))}function a(t){return e.toUrl("../"+t)}function s(e){return new i(e).resolve(o()).toString()}var l,u,c,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(r){t(u)||(u=t(e.toUrl)?a:s),t(c)||(c=document.createElement("a"));var i=u(r);return c.href=i,c.href=c.href,c.href};return d._cesiumScriptRegex=h,d}),r("Core/Iau2006XysSample",[],function(){"use strict";var e=function(e,t,r){this.x=e,this.y=t,this.s=r};return e}),r("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(r,i){if(null===r||"object"!=typeof r)return r;i=e(i,!1);var n=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i&&(a=t(a,i)),n[o]=a}return n};return t}),r("Core/parseResponseHeaders",[],function(){"use strict";var e=function(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),i=0;i0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t};return e}),r("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";var r=function(e,r,i){this.statusCode=e,this.response=r,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))};return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,i,n){return t(e).then(r,i,n)}function t(e){var t,r;return e instanceof i?t=e:s(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=n(e),t}function r(t){return e(t,o)}function i(e){this.then=e}function n(e){var r=new i(function(r){try{return t(r?r(e):e)}catch(i){return o(i)}});return r}function o(e){var r=new i(function(r,i){try{return i?t(i(e)):o(e)}catch(n){return o(n)}});return r}function a(){function e(e,t,r){return d(e,t,r)
+}function r(e){return p(e)}function n(e){return p(o(e))}function s(e){return m(e)}var l,u,c,h,d,m,p;return u=new i(e),l={then:e,resolve:r,reject:n,progress:s,promise:u,resolver:{resolve:r,reject:n,progress:s}},c=[],h=[],d=function(e,t,r){var i,n;return i=a(),n="function"==typeof r?function(e){try{i.progress(r(e))}catch(t){i.progress(t)}}:function(e){i.progress(e)},c.push(function(r){r.then(e,t).then(i.resolve,i.reject,n)}),h.push(n),i.promise},m=function(e){return f(h,e),e},p=function(e){return e=t(e),d=e.then,p=t,m=g,f(c,e),h=c=S,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,r,i,n,o){return v(2,arguments),e(t,function(t){function s(e){f(e)}function l(e){p(e)}var u,c,h,d,m,p,f,v,_,y;if(_=t.length>>>0,u=Math.max(0,Math.min(r,_)),h=[],c=_-u+1,d=[],m=a(),u)for(v=m.progress,f=function(e){d.push(e),--c||(p=f=g,m.reject(d))},p=function(e){h.push(e),--u||(p=f=g,m.resolve(h))},y=0;_>y;++y)y in t&&e(t[y],l,s,v);else m.resolve(h);return m.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return v(1,arguments),d(e,_).then(t,r,i)}function h(){return d(arguments,_)}function d(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;n>l;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function m(t,r){var i=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},y.apply(t,i)})}function p(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function f(e,t){for(var r,i=0;r=e[i++];)r(t)}function v(e,t){for(var r,i=t.length;i>e;)if(r=t[--i],null!=r&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function g(){}function _(e){return e}var y,C,S;return e.defer=a,e.resolve=t,e.reject=r,e.join=h,e.all=c,e.map=d,e.reduce=m,e.any=u,e.some=l,e.chain=p,e.isPromise=s,i.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(S,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(S,t)})})}},C=[].slice,y=[].reduce||function(e){var t,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;n>o;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof r&&r.amd?r:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),r("Core/loadWithXhr",["./defined","./defaultValue","./DeveloperError","./RequestErrorEvent","../ThirdParty/when"],function(e,t,r,i,n){"use strict";var o=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.responseType,i=t(e.method,"GET"),a=e.data,s=e.headers;return n(e.url,function(e){var t=n.defer();return o.load(e,r,i,a,s,t),t.promise})};return o.load=function(t,r,n,o,a,s){var l=new XMLHttpRequest;if(l.open(n,t,!0),e(a))for(var u in a)a.hasOwnProperty(u)&&l.setRequestHeader(u,a[u]);e(r)&&(l.responseType=r),l.onload=function(){200===l.status?s.resolve(l.response):s.reject(new i(l.status,l.response,l.getAllResponseHeaders()))},l.onerror=function(){s.reject(new i)},l.send(o)},o.defaultLoad=o.load,o}),r("Core/loadText",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,headers:r})};return t}),r("Core/loadJson",["./clone","./defined","./loadText","./DeveloperError"],function(e,t,r){"use strict";var i={Accept:"application/json,*/*;q=0.01"},n=function(n,o){return t(o)?t(o.Accept)||(o=e(o),o.Accept=i.Accept):o=i,r(n,o).then(function(e){return JSON.parse(e)})};return n}),r("Core/Iau2006XysData",["./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard","../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=h;return i._julianDayNumber=t,i._secondsOfDay=r,e._sampleZeroDateTT.getDaysDifference(i)}function u(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];var n=s.defer();t._chunkDownloadsInProgress[i]=n;var a,l=t._xysFileUrlTemplate;return a=r(l)?l.replace("{0}",i):e("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),s(o(a),function(e){t._chunkDownloadsInProgress[i]=!1;for(var r=t._samples,o=e.samples,a=3*i*t._samplesPerXysFile,s=0,l=o.length;l>s;++s)r[a+s]=o[s];n.resolve()}),n.promise}var c=function(e){e=t(e,t.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=t(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=t(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new n(this._sampleZeroJulianEphemerisDate,0,a.TAI),this._stepSizeDays=t(e.stepSizeDays,1),this._samplesPerXysFile=t(e.samplesPerXysFile,1e3),this._totalSamples=t(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var r=this._interpolationOrder,i=this._denominators=new Array(r+1),o=this._xTable=new Array(r+1),s=Math.pow(this._stepSizeDays,r),l=0;r>=l;++l){i[l]=s,o[l]=l*this._stepSizeDays;for(var u=0;r>=u;++u)u!==l&&(i[l]*=l-u);i[l]=1/i[l]}this._work=new Array(r+1),this._coef=new Array(r+1)},h=new n(0,0,a.TAI);return c.prototype.preload=function(e,t,r,i){var n=l(this,e,t),o=l(this,r,i),a=0|n/this._stepSizeDays-this._interpolationOrder/2;0>a&&(a=0);var c=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);for(var h=0|a/this._samplesPerXysFile,d=0|c/this._samplesPerXysFile,m=[],p=h;d>=p;++p)m.push(u(this,p));return s.all(m)},c.prototype.computeXysRadians=function(e,t,n){var o=l(this,e,t);if(0>o)return void 0;var a=0|o/this._stepSizeDays;if(a>=this._totalSamples)return void 0;var s=this._interpolationOrder,c=a-(0|s/2);0>c&&(c=0);var h=c+s;h>=this._totalSamples&&(h=this._totalSamples-1,c=h-s,0>c&&(c=0));var d=!1,m=this._samples;if(r(m[3*c])||(u(this,0|c/this._samplesPerXysFile),d=!0),r(m[3*h])||(u(this,0|h/this._samplesPerXysFile),d=!0),d)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var p,f,v=o-c*this._stepSizeDays,g=this._work,_=this._denominators,y=this._coef,C=this._xTable;for(p=0;s>=p;++p)g[p]=v-C[p];for(p=0;s>=p;++p){for(y[p]=1,f=0;s>=f;++f)f!==p&&(y[p]*=g[f]);y[p]*=_[p];var S=3*(c+p);n.x+=y[p]*m[S++],n.y+=y[p]*m[S++],n.s+=y[p]*m[S]}return n},c}),r("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(e,t,r,i,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=i,this.ut1MinusUtc=n};return e}),r("Core/EarthOrientationParameters",["./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./loadJson","./JulianDate","./LeapSecond","./RuntimeError","./TimeConstants","./TimeStandard","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){return a.compare(e.julianDate,t)}function m(t,i){if(!r(i.columnNames))return t._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(i.samples))return t._dataError="Error in loaded EOP data: The samples property is required.",void 0;var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),h=i.columnNames.indexOf("ut1MinusUtcSeconds"),m=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>h||0>m||0>p||0>f)return t._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var v=t._samples=i.samples,g=t._dates=[];t._dateColumn=n,t._xPoleWanderRadiansColumn=o,t._yPoleWanderRadiansColumn=l,t._ut1MinusUtcSecondsColumn=h,t._xCelestialPoleOffsetRadiansColumn=m,t._yCelestialPoleOffsetRadiansColumn=p,t._taiMinusUtcSecondsColumn=f,t._columnCount=i.columnNames.length,t._lastIndex=void 0;for(var _,y=t._addNewLeapSeconds,C=0,S=v.length;S>C;C+=t._columnCount){var w=v[C+n],E=v[C+f],x=w+u.MODIFIED_JULIAN_DATE_DIFFERENCE,b=new a(x,E,c.TAI);if(g.push(b),y){if(E!==_&&r(_)){var T=s.getLeapSeconds(),A=e(T,b,d);if(0>A){var P=new s(b,E);T.splice(~A,0,P)}}_=E}}}function p(e,t,r,i,n){var o=r*i;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function f(e,t,r){return t+e*(r-t)}function v(e,t,r,i,n,o,a){var s=e._columnCount;if(o>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;var l=t[n],u=t[o];if(l.equals(u)||i.equals(l))return p(e,r,n,s,a),a;if(i.equals(u))return p(e,r,o,s,a),a;var c=l.getSecondsDifference(i)/l.getSecondsDifference(u),h=n*s,d=o*s,m=r[h+e._ut1MinusUtcSecondsColumn],v=r[d+e._ut1MinusUtcSecondsColumn],g=v-m;if(g>.5||-.5>g){var _=r[h+e._taiMinusUtcSecondsColumn],y=r[d+e._taiMinusUtcSecondsColumn];_!==y&&(u.equals(i)?m=v:v-=y-_)}return a.xPoleWander=f(c,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),a.yPoleWander=f(c,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),a.xPoleOffset=f(c,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=f(c,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=f(c,m,v),a}var g=function(e){if(e=t(e,t.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=t(e.addNewLeapSeconds,!0),r(e.data))m(this,e.data);else if(r(e.url)){var i=this;this._downloadPromise=h(o(e.url),function(e){m(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+e.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return g.NONE=n({getPromiseToLoad:function(){return h()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),g.prototype.getPromiseToLoad=function(){return h(this._downloadPromise)},g.prototype.compute=function(t,n){if(!r(this._samples)){if(r(this._dataError))throw new l(this._dataError);return void 0}if(r(n)||(n=new i(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var o=this._dates,s=this._lastIndex,u=0,c=0;if(r(s)){var h=o[s],d=o[s+1],m=h.lessThanOrEquals(t),p=!r(d),f=p||d.greaterThanOrEquals(t);if(m&&f)return u=s,!p&&d.equals(t)&&++u,c=u+1,v(this,o,this._samples,t,u,c,n),n}var g=e(o,t,a.compare,this._dateColumn);return g>=0?(gu&&(u=0)),this._lastIndex=u,v(this,o,this._samples,t,u,c,n),n},g}),r("Core/Transforms",["./defaultValue","./defined","./DeveloperError","./Iau2006XysData","./Iau2006XysSample","./Math","./Matrix3","./Matrix4","./Cartesian2","./Cartesian3","./Cartesian4","./TimeConstants","./Ellipsoid","./EarthOrientationParameters","./EarthOrientationParametersSample","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";var v={},g=new u,_=new u,y=new u;v.eastNorthUpToFixedFrame=function(r,i,n){if(o.equalsEpsilon(r.x,0,o.EPSILON14)&&o.equalsEpsilon(r.y,0,o.EPSILON14)){var a=o.sign(r.z);return t(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-a,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(0,-a,0,r.x,1,0,0,r.y,0,0,a,r.z,0,0,0,1)}var l=g,c=_,h=y;return i=e(i,d.WGS84),i.geodeticSurfaceNormal(r,l),c.x=-r.y,c.y=r.x,c.z=0,u.normalize(c,c),u.cross(l,c,h),t(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=h.x,n[5]=h.y,n[6]=h.z,n[7]=0,n[8]=l.x,n[9]=l.y,n[10]=l.z,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(c.x,h.x,l.x,r.x,c.y,h.y,l.y,r.y,c.z,h.z,l.z,r.z,0,0,0,1)};var C=new u,S=new u,w=new u;v.northEastDownToFixedFrame=function(r,i,n){if(o.equalsEpsilon(r.x,0,o.EPSILON14)&&o.equalsEpsilon(r.y,0,o.EPSILON14)){var a=o.sign(r.z);return t(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-a,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(-a,0,0,r.x,0,1,0,r.y,0,0,-a,r.z,0,0,0,1)}var l=C,c=S,h=w;return i=e(i,d.WGS84),i.geodeticSurfaceNormal(r,l),c.x=-r.y,c.y=r.x,c.z=0,u.normalize(c,c),u.cross(l,c,h),t(n)?(n[0]=h.x,n[1]=h.y,n[2]=h.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=-l.x,n[9]=-l.y,n[10]=-l.z,n[11]=0,n[12]=r.x,n[13]=r.y,n[14]=r.z,n[15]=1,n):new s(h.x,c.x,-l.x,r.x,h.y,c.y,-l.y,r.y,h.z,c.z,-l.z,r.z,0,0,0,1)};var E=24110.54841,x=8640184.812866,b=.093104,T=-62e-7,A=1.1772758384668e-19,P=72921158553e-15,D=o.TWO_PI/86400;v.computeTemeToPseudoFixedMatrix=function(e,r){var i,n=e.addSeconds(-e.getTaiMinusUtc()),s=n.getJulianDayNumber(),l=n.getSecondsOfDay(),u=s-2451545;i=l>=43200?(u+.5)/h.DAYS_PER_JULIAN_CENTURY:(u-.5)/h.DAYS_PER_JULIAN_CENTURY;var c=E+i*(x+i*(b+i*T)),d=c*D%o.TWO_PI,m=P+A*(s-2451545.5),p=(l+.5*h.SECONDS_PER_DAY)%h.SECONDS_PER_DAY,f=d+m*p,v=Math.cos(f),g=Math.sin(f);return t(r)?(r[0]=v,r[1]=-g,r[2]=0,r[3]=g,r[4]=v,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new a(v,g,0,-g,v,0,0,0,1)},v.iau2006XysData=new i,v.earthOrientationParameters=m.NONE;var M=32.184,I=2451545;v.preloadIcrfFixed=function(e){var t=e.start.getJulianDayNumber(),r=e.start.getSecondsOfDay()+M,i=e.stop.getJulianDayNumber(),n=e.stop.getSecondsOfDay()+M,o=v.iau2006XysData.preload(t,r,i,n),a=v.earthOrientationParameters.getPromiseToLoad();return f.all([o,a])},v.computeIcrfToFixedMatrix=function(e,r){var i=v.computeFixedToIcrfMatrix(e,r);return t(i)?a.transpose(i,r):void 0};var O=new n(0,0,0),R=new p(0,0,0,0,0,0),L=new a,N=new a;v.computeFixedToIcrfMatrix=function(e,r){var i=v.earthOrientationParameters.compute(e,R);if(!t(i))return void 0;var n=e.getJulianDayNumber(),s=e.getSecondsOfDay()+M,l=v.iau2006XysData.computeXysRadians(n,s,O);if(!t(l))return void 0;var u=l.x+i.xPoleOffset,c=l.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-u*u-c*c)),m=L;m[0]=1-d*u*u,m[3]=-d*u*c,m[6]=u,m[1]=-d*u*c,m[4]=1-d*c*c,m[7]=c,m[2]=-u,m[5]=-c,m[8]=1-d*(u*u+c*c);var p=a.fromRotationZ(-l.s,N),f=a.multiply(m,p,L),g=e.getJulianDayNumber(),_=e.getSecondsOfDay()-e.getTaiMinusUtc()+i.ut1MinusUtc,y=g-2451545,C=_/h.SECONDS_PER_DAY,S=.779057273264+C+.00273781191135448*(y+C);S=S%1*o.TWO_PI;var w=a.fromRotationZ(S,N),E=a.multiply(f,w,L),x=Math.cos(i.xPoleWander),b=Math.cos(i.yPoleWander),T=Math.sin(i.xPoleWander),A=Math.sin(i.yPoleWander),P=n-I+s/h.SECONDS_PER_DAY;P/=36525;var D=-47e-6*P*o.RADIANS_PER_DEGREE/3600,B=Math.cos(D),z=Math.sin(D),F=N;return F[0]=x*B,F[1]=x*z,F[2]=T,F[3]=-b*z+A*T*B,F[4]=b*B+A*T*z,F[5]=-A*x,F[6]=-A*z-b*T*B,F[7]=A*B-b*T*z,F[8]=b*x,a.multiply(E,F,r)};var B=new c;return v.pointToWindowCoordinates=function(e,t,r,i){var n=B;return s.multiplyByVector(e,c.fromElements(r.x,r.y,r.z,1,n),n),c.multiplyByScalar(n,1/n.w,n),s.multiplyByVector(t,n,n),l.fromCartesian4(n,i)},v}),r("Core/Ray",["./DeveloperError","./defaultValue","./Cartesian3"],function(e,t,r){"use strict";var i=function(e,i){i=r.clone(t(i,r.ZERO)),r.equals(i,r.ZERO)||r.normalize(i,i),this.origin=r.clone(t(e,r.ZERO)),this.direction=i};return i.prototype.getPoint=function(e,t){return t=r.multiplyByScalar(this.direction,e,t),r.add(this.origin,t,t)},i}),r("Core/EllipsoidTangentPlane",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Transforms","./AxisAlignedBoundingBox","./IntersectionTests","./Cartesian2","./Cartesian3","./Ellipsoid","./Matrix4","./Ray","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(t,r){r=e(r,u.WGS84),t=r.scaleToGeodeticSurface(t);var i=n.eastNorthUpToFixedFrame(t,r);this._ellipsoid=r,this._origin=l.clone(t),this._xAxis=l.fromCartesian4(c.getColumn(i,0)),this._yAxis=l.fromCartesian4(c.getColumn(i,1));var o=l.fromCartesian4(c.getColumn(i,2));this._plane=d.fromPointNormal(t,o)};r(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new o;m.fromPoints=function(e,t){var r=o.fromPoints(e,p);return new m(r.center,t)};var f=new h,v=new l;m.prototype.projectPointOntoPlane=function(e,r){var i=f;i.origin=e,l.normalize(e,i.direction);var n=a.rayPlane(i,this._plane,v);if(t(n)||(l.negate(i.direction,i.direction),n=a.rayPlane(i,this._plane,v)),t(n)){var o=l.subtract(n,this._origin,n),u=l.dot(this._xAxis,o),c=l.dot(this._yAxis,o);return t(r)?(r.x=u,r.y=c,r):new s(u,c)}return void 0},m.prototype.projectPointsOntoPlane=function(e,r){t(r)||(r=[]);for(var i=0,n=e.length,o=0;n>o;o++){var a=this.projectPointOntoPlane(e[o],r[i]);t(a)&&(r[i]=a,i++)}return r.length=i,r};var g=new l;return m.prototype.projectPointsOntoEllipsoid=function(e,r){var i=e.length;t(r)?r.length=i:r=new Array(i);for(var n=this._ellipsoid,o=this._origin,a=this._xAxis,s=this._yAxis,u=g,c=0;i>c;++c){var h=e[c];l.multiplyByScalar(a,h.x,u);var d=r[c]=l.add(o,u,r[c]);l.multiplyByScalar(s,h.y,u),l.add(d,u,d),n.scaleToGeocentricSurface(d,d)}return r},m}),r("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){for(var r=new Array(e.length),i=0;io;o++)c[o]=r;return c.push(i),c}var h=i-r,d=h/u;for(o=1;u>o;o++){var m=r+o*d;c[o]=m}return c[0]=r,c.push(i),c}function p(r,i,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,r,Y),Y),u=s.projectPointOntoPlane(t.add(n,i,X),X),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function f(e,r,i,n,o,a,u,c){var d=k,m=U;B=h.eastNorthUpToFixedFrame(e,o,B),d=l.multiplyByPointAsVector(B,N,d),d=t.normalize(d,d);var f=p(d,r,e,o);F=s.fromRotationZ(f,F),W.z=a,B=l.multiplyTransformation(B,l.fromRotationTranslation(F,W,z),B);var v=V;v[0]=u;for(var g=0;c>g;g++)for(var _=0;_l;l++){s=e[l];var u=s.x-o,c=s.y-a;i[n++]=u,i[n++]=0,i[n++]=c,i[n++]=u,i[n++]=0,i[n++]=c}return s=e[0],i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a,i}function _(e,t){for(var r=e.length,i=new Array(3*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;r>s;s++)i[n++]=e[s].x-o,i[n++]=0,i[n++]=e[s].y-a;return i}function y(e,r,i,o,l,u,h,d,m,p){var v,g=t.angleBetween(t.subtract(r,e,I),t.subtract(i,e,O)),_=o.value===n.BEVELED.value?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,I),g/(_+1),H),q):s.fromQuaternion(c.fromAxisAngle(e,g/(_+1),H),q);var y,C;if(r=t.clone(r,j),_>0)for(var S=p?2:1,w=0;_>w;w++)r=s.multiplyByVector(v,r,r),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,m,1,S);else y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,m,1,1),i=t.clone(i,j),y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,O),h=f(C,y,d,h,u,m,1,1);return h}function C(e,t){return a.equalsEpsilon(e.latitude,t.latitude,a.EPSILON6)&&a.equalsEpsilon(e.longitude,t.longitude,a.EPSILON6)}var S=[new t,new t],w=new t,E=new t,x=new t,b=new t,T=new t,A=new t,P=new t,D=new t,M=new t,I=new t,O=new t,R={},L=new i,N=new t(-1,0,0),B=new l,z=new l,F=new s,V=s.IDENTITY.clone(),k=new t,U=new r,W=new t,G=new t,H=new c,j=new t,q=new s;R.removeDuplicatesFromShape=function(t){for(var r=t.length,i=[],n=r-1,o=0;r>o;n=o++){var a=t[n],s=t[o];e.equals(a,s)||i.push(s)}return i};var Y=new t,X=new t;R.angleIsGreaterThanPi=function(e,r,i,n){var a=new o(i,n),s=a.projectPointOntoPlane(t.add(i,e,Y),Y),l=a.projectPointOntoPlane(t.add(i,r,X),X);return l.x*s.y-l.y*s.x>=0};var Z=new i,J=new i;return R.removeDuplicatesFromPositions=function(e,t){var r=e.length;if(2>r)return e.slice(0);var i=[];i.push(e[0]);for(var n=1;r>n;++n){var o=e[n-1],a=e[n],s=t.cartesianToCartographic(o,Z),l=t.cartesianToCartographic(a,J);C(s,l)||i.push(a)}return i},R.computePositions=function(e,r,i,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,p=o._cornerType,C=s?g(r,i):_(r,i),O=s?_(r,i):void 0,L=i.height/2,N=i.width/2,B=e.length,z=[],F=s?[]:void 0,V=w,k=E,U=x,W=b,G=T,H=A,j=P,q=D,Y=M,X=e[0],Z=e[1];W=l.geodeticSurfaceNormal(X,W),V=t.subtract(Z,X,V),V=t.normalize(V,V),q=t.cross(W,V,q),q=t.normalize(q,q);var J=c[0],Q=c[1];s&&(F=f(X,q,O,F,l,J+L,1,1)),Y=t.clone(X,Y),X=Z,k=t.negate(V,k);for(var K,$,et=1;B-1>et;et++){var tt=s?2:1;Z=e[et+1],V=t.subtract(Z,X,V),V=t.normalize(V,V),U=t.add(V,k,U),U=t.normalize(U,U),W=l.geodeticSurfaceNormal(X,W);var rt=!t.equalsEpsilon(t.negate(U,I),W,a.EPSILON2);if(rt){U=t.cross(U,W,U),U=t.cross(W,U,U),U=t.normalize(U,U);var it=1/Math.max(.25,t.magnitude(t.cross(U,k,I))),nt=R.angleIsGreaterThanPi(V,k,X,l);nt?(G=t.add(X,t.multiplyByScalar(U,it*N,U),G),H=t.add(G,t.multiplyByScalar(q,N,H),H),S[0]=t.clone(Y,S[0]),S[1]=t.clone(H,S[1]),K=m(S,J+L,Q+L,h),$=u.scaleToSurface(S),z=v($,q,C,z,l,K,1),q=t.cross(W,V,q),q=t.normalize(q,q),j=t.add(G,t.multiplyByScalar(q,N,j),j),p.value===n.ROUNDED.value||p.value===n.BEVELED.value?y(G,H,j,p,nt,l,z,C,Q+L,s):(U=t.negate(U,U),z=f(X,U,C,z,l,Q+L,it,tt)),Y=t.clone(j,Y)):(G=t.add(X,t.multiplyByScalar(U,it*N,U),G),H=t.add(G,t.multiplyByScalar(q,-N,H),H),S[0]=t.clone(Y,S[0]),S[1]=t.clone(H,S[1]),K=m(S,J+L,Q+L,h),$=u.scaleToSurface(S,h,l),z=v($,q,C,z,l,K,1),q=t.cross(W,V,q),q=t.normalize(q,q),j=t.add(G,t.multiplyByScalar(q,-N,j),j),p.value===n.ROUNDED.value||p.value===n.BEVELED.value?y(G,H,j,p,nt,l,z,C,Q+L,s):z=f(X,U,C,z,l,Q+L,it,tt),Y=t.clone(j,Y)),k=t.negate(V,k)}else z=f(Y,q,C,z,l,J+L,1,1),Y=X;J=Q,Q=c[et+1],X=Z}S[0]=t.clone(Y,S[0]),S[1]=t.clone(X,S[1]),K=m(S,J+L,Q+L,h),$=u.scaleToSurface(S,h,l),z=v($,q,C,z,l,K,1),s&&(F=f(X,q,O,F,l,Q+L,1,1)),B=z.length;var ot=s?B+F.length:B,at=new Float64Array(ot);return at.set(z),s&&at.set(F,B),at},R}),r("Core/CorridorGeometryLibrary",["./defined","./Cartesian3","./CornerType","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Matrix3","./Quaternion","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,i,n,l,u){var c=t.angleBetween(t.subtract(i,e,p),t.subtract(n,e,f)),h=l.value===r.BEVELED.value?1:Math.ceil(c/s.toRadians(5))+1,d=3*h,m=new Array(d);m[d-3]=n.x,m[d-2]=n.y,m[d-1]=n.z;var v;v=u?o.fromQuaternion(a.fromAxisAngle(t.negate(e,p),c/h,D),M):o.fromQuaternion(a.fromAxisAngle(e,c/h,D),M);var g=0;i=t.clone(i,p);for(var _=0;h>_;_++)i=o.multiplyByVector(v,i,i),m[g++]=i.x,m[g++]=i.y,m[g++]=i.z;return m}function u(e){var i=y,n=C,o=S,a=e[1];n=t.fromArray(e[1],a.length-3,n),o=t.fromArray(e[0],0,o),i=t.multiplyByScalar(t.add(n,o,i),.5,i);var s=l(i,n,o,r.ROUNDED,!1),u=e.length-1,c=e[u-1];a=e[u],n=t.fromArray(c,c.length-3,n),o=t.fromArray(a,0,o),i=t.multiplyByScalar(t.add(n,o,i),.5,i);var h=l(i,n,o,r.ROUNDED,!1);return[s,h]}function c(e,r,i,n){var o=p;return n?o=t.add(e,r,o):(r=t.negate(r,r),o=t.add(e,r,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function h(e,r,i,n){for(var o=new Array(e.length),a=new Array(e.length),s=t.multiplyByScalar(r,i,p),l=t.negate(s,f),u=0,c=e.length-1,h=0;hj;j++){D=m.geodeticSurfaceNormal(W,D),G=a[j+1],M=t.normalize(t.subtract(G,W,M),M),R=t.normalize(t.add(M,I,R),R);var X=!t.equalsEpsilon(t.negate(R,p),D,s.EPSILON2);if(X){R=t.cross(R,D,R),R=t.cross(D,R,R);var Z=f/Math.max(.25,t.magnitude(t.cross(R,I,p))),J=n.angleIsGreaterThanPi(M,I,W,m);R=t.multiplyByScalar(R,Z,R),J?(B=t.add(W,R,B),F=t.add(B,t.multiplyByScalar(O,f,F),F),z=t.add(B,t.multiplyByScalar(O,2*f,z),z),_[0]=t.clone(N,_[0]),_[1]=t.clone(F,_[1]),H=i.scaleToSurface(_,o,m),V=h(H,O,f,V),g&&(k.push(O.x,O.y,O.z),U.push(D.x,D.y,D.z)),L=t.clone(z,L),O=t.normalize(t.cross(D,M,O),O),z=t.add(B,t.multiplyByScalar(O,2*f,z),z),N=t.add(B,t.multiplyByScalar(O,f,N),N),v.value===r.ROUNDED.value||v.value===r.BEVELED.value?q.push({leftPositions:l(B,L,z,v,J)}):q.push({leftPositions:c(W,t.negate(R,R),z,J)})):(z=t.add(W,R,z),F=t.add(z,t.negate(t.multiplyByScalar(O,f,F),F),F),B=t.add(z,t.negate(t.multiplyByScalar(O,2*f,B),B),B),_[0]=t.clone(N,_[0]),_[1]=t.clone(F,_[1]),H=i.scaleToSurface(_,o,m),V=h(H,O,f,V),g&&(k.push(O.x,O.y,O.z),U.push(D.x,D.y,D.z)),L=t.clone(B,L),O=t.normalize(t.cross(D,M,O),O),B=t.add(z,t.negate(t.multiplyByScalar(O,2*f,B),B),B),N=t.add(z,t.negate(t.multiplyByScalar(O,f,N),N),N),v.value===r.ROUNDED.value||v.value===r.BEVELED.value?q.push({rightPositions:l(z,L,B,v,J)}):q.push({rightPositions:c(W,R,B,J)})),I=t.negate(M,I)}W=G}D=m.geodeticSurfaceNormal(W,D),_[0]=t.clone(N,_[0]),_[1]=t.clone(W,_[1]),H=i.scaleToSurface(_,o,m),V=h(H,O,f,V),g&&(k.push(O.x,O.y,O.z),U.push(D.x,D.y,D.z));var Q;return v.value===r.ROUNDED.value&&(Q=u(V)),{positions:V,corners:q,lefts:k,normals:U,endPositions:Q}},m}),r("Core/CorridorGeometry",["./defaultValue","./defined","./DeveloperError","./Cartesian3","./CornerType","./CorridorGeometryLibrary","./ComponentDatatype","./Ellipsoid","./Geometry","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./BoundingSphere","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,t,r,n,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=i.normalize(i.cross(r,t,P),P);s.normal&&o.addAttribute(l,t,n,a),s.binormal&&o.addAttribute(c,r,n,a),s.tangent&&o.addAttribute(u,h,n,a)}function _(e,r,n){var s,l,h,d=e.positions,m=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,C=new f,S=0,T=0,M=0;for(l=0;ll;l++)V=i.fromArray($,3*(J-1-l),V),F=i.fromArray($,3*(J+l),F),o.addAttribute(U,F,q),o.addAttribute(U,V,void 0,Y),g(j,X,Z,q,Y,r),N=q/3,z=N+1,L=(Y-2)/3,B=L-1,Q[K++]=L,Q[K++]=N,Q[K++]=B,Q[K++]=B,Q[K++]=N,Q[K++]=z,q+=3,Y-=3}var et=0,tt=0,rt=d[et++],it=d[et++];U.set(rt,q),U.set(it,Y-it.length+1),Z=i.fromArray(_,tt,Z);var nt,ot;for(h=it.length-3,l=0;h>l;l+=3)nt=n.geodeticSurfaceNormal(i.fromArray(rt,l,P),P),ot=n.geodeticSurfaceNormal(i.fromArray(it,h-l,D),D),X=i.normalize(i.add(nt,ot,X),X),g(j,X,Z,q,Y,r),N=q/3,z=N+1,L=(Y-2)/3,B=L-1,Q[K++]=L,Q[K++]=N,Q[K++]=B,Q[K++]=B,Q[K++]=N,Q[K++]=z,q+=3,Y-=3;for(nt=n.geodeticSurfaceNormal(i.fromArray(rt,h,P),P),ot=n.geodeticSurfaceNormal(i.fromArray(it,h,D),D),X=i.normalize(i.add(nt,ot,X),X),tt+=3,l=0;ll;l++)V=i.fromArray(pt,3*(O-l-1),V),F=i.fromArray(pt,3*l,F),o.addAttribute(U,V,void 0,Y),o.addAttribute(U,F,q),g(j,X,Z,q,Y,r),z=q/3,N=z-1,B=(Y-2)/3,L=B+1,Q[K++]=L,Q[K++]=N,Q[K++]=B,Q[K++]=B,Q[K++]=N,Q[K++]=z,q+=3,Y-=3}if(C.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:U}),r.st){var ft,vt,gt=new Float32Array(2*(k/3)),_t=0;if(R){S/=3,T/=3;var yt=Math.PI/(O+1);vt=1/(S-O+1),ft=1/(T-O+1);var Ct,St=O/2;for(l=St+1;O+1>l;l++)Ct=c.PI_OVER_TWO+yt*l,gt[_t++]=ft*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=1;T-O+1>l;l++)gt[_t++]=l*ft,gt[_t++]=0;for(l=O;l>St;l--)Ct=c.PI_OVER_TWO-l*yt,gt[_t++]=1-ft*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=St;l>0;l--)Ct=c.PI_OVER_TWO-yt*l,gt[_t++]=1-vt*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=S-O;l>0;l--)gt[_t++]=l*vt,gt[_t++]=1;for(l=1;St+1>l;l++)Ct=c.PI_OVER_TWO+yt*l,gt[_t++]=vt*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct))}else{for(S/=3,T/=3,vt=1/(S-1),ft=1/(T-1),l=0;T>l;l++)gt[_t++]=l*ft,gt[_t++]=0;for(l=S;l>0;l--)gt[_t++]=(l-1)*vt,gt[_t++]=1}C.st=new p({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:gt})}return r.normal&&(C.normal=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:j.normals})),r.tangent&&(C.tangent=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:j.tangents})),r.binormal&&(C.binormal=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:j.binormals})),{attributes:C,indices:Q}}function y(e,t){if(!(t.normal||t.binormal||t.tangent||t.st))return e;var r,n,a=e.position.values;(t.normal||t.binormal)&&(r=e.normal.values,n=e.binormal.values);
+var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(t.normal||t.binormal||t.tangent){var d=t.normal?new Float32Array(6*u):void 0,m=t.binormal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=w,v=E,g=x,_=b,y=T,C=A,S=h;for(s=0;u>s;s+=3){var P=S+h;f=i.fromArray(a,s,f),v=i.fromArray(a,s+u,v),g=i.fromArray(a,(s+3)%u,g),v=i.subtract(v,f,v),g=i.subtract(g,f,g),_=i.normalize(i.cross(v,g,_),_),t.normal&&(o.addAttribute(d,_,P),o.addAttribute(d,_,P+3),o.addAttribute(d,_,S),o.addAttribute(d,_,S+3)),(t.tangent||t.binormal)&&(C=i.fromArray(r,s,C),t.binormal&&(o.addAttribute(m,C,P),o.addAttribute(m,C,P+3),o.addAttribute(m,C,S),o.addAttribute(m,C,S+3)),t.tangent&&(y=i.normalize(i.cross(C,_,y),y),o.addAttribute(p,y,P),o.addAttribute(p,y,P+3),o.addAttribute(p,y,S),o.addAttribute(p,y,S+3))),S+=6}if(t.normal){for(d.set(r),s=0;u>s;s+=3)d[s+u]=-r[s],d[s+u+1]=-r[s+1],d[s+u+2]=-r[s+2];e.normal.values=d}else e.normal=void 0;if(t.binormal?(m.set(n),m.set(n,u),e.binormal.values=m):e.binormal=void 0,t.tangent){var D=e.tangent.values;p.set(D),p.set(D,u),e.tangent.values=p}}if(t.st){var M=e.st.values,I=new Float32Array(6*c);I.set(M),I.set(M,c);for(var O=2*c,R=0;2>R;R++){for(I[O++]=M[0],I[O++]=M[1],s=2;c>s;s+=2){var L=M[s],N=M[s+1];I[O++]=L,I[O++]=N,I[O++]=L,I[O++]=N}I[O++]=M[0],I[O++]=M[1]}e.st.values=I}return e}function C(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;iw;w+=3){var A=d[w],P=d[w+1],D=d[w+2];b[T++]=D+p,b[T++]=P+p,b[T++]=A+p}c=y(c,t);var M,I,O,R;for(w=0;x>w;w+=2)M=w+x,I=M+x,O=M+1,R=I+1,b[T++]=M,b[T++]=I,b[T++]=O,b[T++]=O,b[T++]=I,b[T++]=R;return{attributes:c,indices:b}}var w=new i,E=new i,x=new i,b=new i,T=new i,A=new i,P=new i,D=new i,M=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.positions,i=t.width;this._positions=r,this._width=i,this._ellipsoid=e(t.ellipsoid,s.WGS84),this._height=e(t.height,0),this._extrudedHeight=e(t.extrudedHeight,this._height),this._cornerType=e(t.cornerType,n.ROUNDED),this._vertexFormat=e(t.vertexFormat,v.DEFAULT),this._granularity=e(t.granularity,c.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry"};return M.createGeometry=function(e){var t,r=e._positions,i=e._height,n=e._extrudedHeight,a=i!==n,s=h.removeDuplicates(r),u=e._ellipsoid,c=e._vertexFormat,p={ellipsoid:u,positions:s,width:e._width,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};if(a){var f=Math.max(i,n);n=Math.min(i,n),i=f,p.height=i,p.extrudedHeight=n,t=S(p,c)}else{var v=o.computePositions(p);t=_(v,c,u),t.attributes.position.values=h.scaleToGeodeticHeight(t.attributes.position.values,i,u,t.attributes.position.values)}var g=t.attributes,y=m.fromVertices(g.position.values,void 0,3);return c.position||(t.attributes.position.values=void 0),new l({attributes:g,indices:t.indices,primitiveType:d.TRIANGLES,boundingSphere:y})},M}),r("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,o){var s,l,u,m=[],p=e.positions,f=e.corners,v=e.endPositions,g=new h,S=0,w=0,E=0;for(l=0;ll;l++)O=t.fromArray(k,3*(z-1-l),O),I=t.fromArray(k,3*(z+l),I),n.addAttribute(L,I,N),n.addAttribute(L,O,void 0,B),P=N/3,M=P+1,A=(B-2)/3,D=A-1,F[V++]=A,F[V++]=D,F[V++]=P,F[V++]=M,N+=3,B-=3}var U=0,W=p[U++],G=p[U++];for(L.set(W,N),L.set(G,B-G.length+1),u=G.length-3,m.push(N/3,(B-2)/3),l=0;u>l;l+=3)P=N/3,M=P+1,A=(B-2)/3,D=A-1,F[V++]=A,F[V++]=D,F[V++]=P,F[V++]=M,N+=3,B-=3;for(l=0;ll;l++)O=t.fromArray(Z,3*(b-l-1),O),I=t.fromArray(Z,3*l,I),n.addAttribute(L,O,void 0,B),n.addAttribute(L,I,N),M=N/3,P=M-1,D=(B-2)/3,A=D+1,F[V++]=A,F[V++]=D,F[V++]=P,F[V++]=M,N+=3,B-=3;m.push(N/3)}else m.push(N/3,(B-2)/3);return F[V++]=N/3,F[V++]=(B-2)/3,g.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:L}),{attributes:g,indices:F,wallIndices:m}}function g(e){var t=e.ellipsoid,r=n.computePositions(e),i=v(r,e.cornerType),o=i.wallIndices,a=e.height,s=e.extrudedHeight,l=i.attributes,u=i.indices,c=l.position.values,h=c.length,m=new Float64Array(h);m.set(c);var f=new Float64Array(2*h);c=p.scaleToGeodeticHeight(c,a,t,c),m=p.scaleToGeodeticHeight(m,s,t,m),f.set(c),f.set(m,h),l.position.values=f,h/=3;var g,_=u.length,y=d.createTypedArray(f.length/3,2*(_+o.length));y.set(u);var C=_;for(g=0;_>g;g+=2){var S=u[g],w=u[g+1];y[C++]=S+h,y[C++]=w+h}var E,x;for(g=0;ga;a++){var v=a/n*e.TWO_PI,g=Math.cos(v),_=Math.sin(v),y=g*i,C=_*i,S=g*r,w=_*r;h[m+p]=y,h[m+p+1]=C,h[m+p+2]=l,h[m+f]=S,h[m+f+1]=w,h[m+f+2]=s,m+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=S,h[d++]=w,h[d++]=s)}return h},t}),r("Core/CylinderGeometry",["./defaultValue","./defined","./DeveloperError","./Cartesian2","./Cartesian3","./CylinderGeometryLibrary","./Math","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new i,v=new n,g=new n,_=new n,y=new n,C=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.length,i=t.topRadius,n=t.bottomRadius,o=e(t.vertexFormat,p.DEFAULT),a=e(t.slices,128);this._length=r,this._topRadius=i,this._bottomRadius=n,this._vertexFormat=o,this._slices=a,this._workerName="createCylinderGeometry"};return C.createGeometry=function(e){var t,r=e._length,p=e._topRadius,C=e._bottomRadius,S=e._vertexFormat,w=e._slices,E=w+w,x=w+E,b=E+E,T=o.computePositions(r,p,C,w,!0),A=S.st?new Float32Array(2*b):void 0,P=S.normal?new Float32Array(3*b):void 0,D=S.tangent?new Float32Array(3*b):void 0,M=S.binormal?new Float32Array(3*b):void 0,I=S.normal||S.tangent||S.binormal;if(I){var O=S.tangent||S.binormal,R=0,L=0,N=0,B=v;B.z=0;var z=_,F=g;for(t=0;w>t;t++){var V=t/w*a.TWO_PI,k=Math.cos(V),U=Math.sin(V);I&&(B.x=k,B.y=U,O&&(z=n.normalize(n.cross(n.UNIT_Z,B,z),z)),S.normal&&(P[R++]=k,P[R++]=U,P[R++]=0,P[R++]=k,P[R++]=U,P[R++]=0),S.tangent&&(D[L++]=z.x,D[L++]=z.y,D[L++]=z.z,D[L++]=z.x,D[L++]=z.y,D[L++]=z.z),S.binormal&&(F=n.normalize(n.cross(B,z,F),F),M[N++]=F.x,M[N++]=F.y,M[N++]=F.z,M[N++]=F.x,M[N++]=F.y,M[N++]=F.z))}for(t=0;w>t;t++)S.normal&&(P[R++]=0,P[R++]=0,P[R++]=-1),S.tangent&&(D[L++]=1,D[L++]=0,D[L++]=0),S.binormal&&(M[N++]=0,M[N++]=-1,M[N++]=0);for(t=0;w>t;t++)S.normal&&(P[R++]=0,P[R++]=0,P[R++]=1),S.tangent&&(D[L++]=1,D[L++]=0,D[L++]=0),S.binormal&&(M[N++]=0,M[N++]=1,M[N++]=0)}var W=12*w-12,G=l.createTypedArray(b,W),H=0,j=0;for(t=0;w-1>t;t++)G[H++]=j,G[H++]=j+2,G[H++]=j+3,G[H++]=j,G[H++]=j+3,G[H++]=j+1,j+=2;for(G[H++]=E-2,G[H++]=0,G[H++]=1,G[H++]=E-2,G[H++]=1,G[H++]=E-1,t=1;w-1>t;t++)G[H++]=E+t+1,G[H++]=E+t,G[H++]=E;for(t=1;w-1>t;t++)G[H++]=x,G[H++]=x+t,G[H++]=x+t+1;var q=0;if(S.st){var Y=Math.max(p,C);for(t=0;b>t;t++){var X=n.fromArray(T,3*t,y);A[q++]=(X.x+Y)/(2*Y),A[q++]=(X.y+Y)/(2*Y)}}var Z=new m;S.position&&(Z.position=new d({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:T})),S.normal&&(Z.normal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:P})),S.tangent&&(Z.tangent=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:D})),S.binormal&&(Z.binormal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:M})),S.st&&(Z.st=new d({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:A})),f.x=.5*r,f.y=Math.max(C,p);var J=new c(n.ZERO,i.magnitude(f));return new h({attributes:Z,indices:G,primitiveType:u.TRIANGLES,boundingSphere:J})},C}),r("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=new t,p=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=r,this._bottomRadius=i,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"};return p.createGeometry=function(o){var a,s=o._length,p=o._topRadius,f=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,p,f,v,!1),C=2*v;if(g>0){var S=Math.min(g,v);a=Math.round(v/S),C+=S}for(var w=h.createTypedArray(_,2*C),E=0,x=0;v-1>x;x++)w[E++]=x,w[E++]=x+1,w[E++]=x+v,w[E++]=x+1+v;if(w[E++]=v-1,w[E++]=0,w[E++]=v+v-1,w[E++]=v,g>0)for(x=0;v>x;x+=a)w[E++]=x,w[E++]=x+v;var b=new c;b.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*s,m.y=Math.max(f,p);var T=new e(r.ZERO,t.magnitude(m));return new l({attributes:b,indices:w,primitiveType:d.LINES,boundingSphere:T})},p}),r("Core/DefaultProxy",[],function(){"use strict";var e=function(e){this.proxy=e};return e.prototype.getURL=function(e){return this.proxy+"?"+encodeURIComponent(e)},e}),r("Core/EllipsoidGeometry",["./defaultValue","./DeveloperError","./Cartesian2","./Cartesian3","./Math","./Ellipsoid","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new i,f=new i,v=new i,g=new i,_=new i,y=new i(1,1,1),C=Math.cos,S=Math.sin,w=function(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.radii,y),n=e(t.stackPartitions,64),o=e(t.slicePartitions,64),a=e(t.vertexFormat,m.DEFAULT);this._radii=i.clone(r),this._stackPartitions=n,this._slicePartitions=o,this._vertexFormat=a,this._workerName="createEllipsoidGeometry"};return w.createGeometry=function(e){var t,m,y=e._radii,w=o.fromCartesian3(y),E=e._vertexFormat,x=e._slicePartitions+1,b=e._stackPartitions+1,T=b*x,A=new Float64Array(3*T),P=6*(x-1)*(b-1),D=s.createTypedArray(T,P),M=E.normal?new Float32Array(3*T):void 0,I=E.tangent?new Float32Array(3*T):void 0,O=E.binormal?new Float32Array(3*T):void 0,R=E.st?new Float32Array(2*T):void 0,L=new Array(x),N=new Array(x),B=0;for(t=0;x>t;t++){var z=n.TWO_PI*t/(x-1);L[t]=C(z),N[t]=S(z),A[B++]=0,A[B++]=0,A[B++]=y.z}for(t=1;b-1>t;t++){var F=Math.PI*t/(b-1),V=S(F),k=y.x*V,U=y.y*V,W=y.z*C(F);for(m=0;x>m;m++)A[B++]=L[m]*k,A[B++]=N[m]*U,A[B++]=W}for(t=0;x>t;t++)A[B++]=0,A[B++]=0,A[B++]=-y.z;var G=new d;E.position&&(G.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:A}));var H=0,j=0,q=0,Y=0;if(E.st||E.normal||E.tangent||E.binormal){for(t=0;T>t;t++){var X=i.fromArray(A,3*t,p),Z=w.geodeticSurfaceNormal(X,f);if(E.st){var J=r.negate(Z,_);r.magnitude(J)A.length&&(B=3*(t-x*Math.floor(.5*b))),i.fromArray(A,B,J),w.geodeticSurfaceNormal(J,J),r.negate(J,J)),R[H++]=Math.atan2(J.y,J.x)/n.TWO_PI+.5,R[H++]=Math.asin(Z.z)/Math.PI+.5}if(E.normal&&(M[j++]=Z.x,M[j++]=Z.y,M[j++]=Z.z),E.tangent||E.binormal){var Q=v;if(x>t||t>T-x-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),E.tangent&&(I[q++]=Q.x,I[q++]=Q.y,I[q++]=Q.z),E.binormal){var K=i.cross(Z,Q,g);i.normalize(K,K),O[Y++]=K.x,O[Y++]=K.y,O[Y++]=K.z}}}E.st&&(G.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:R})),E.normal&&(G.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:M})),E.tangent&&(G.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:I})),E.binormal&&(G.binormal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:O}))}for(B=0,t=0;b>t;t++){var $=t*x,et=(t+1)*x;for(m=0;x-1>m;m++)D[B++]=et+m,D[B++]=et+m+1,D[B++]=$+m+1,D[B++]=et+m,D[B++]=$+m+1,D[B++]=$+m}return new c({attributes:G,indices:D,primitiveType:l.TRIANGLES,boundingSphere:u.fromEllipsoid(w)})},w}),r("Core/EllipsoidOutlineGeometry",["./defaultValue","./DeveloperError","./Cartesian3","./Math","./Ellipsoid","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=new r(1,1,1),m=Math.cos,p=Math.sin,f=function(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.radii,d),n=e(t.stackPartitions,10),o=e(t.slicePartitions,8),a=e(t.subdivisions,128);this._radii=r.clone(i),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"};return f.createGeometry=function(e){var t,r,d,f,v,g,_=e._radii,y=n.fromCartesian3(_),C=e._stackPartitions,S=e._slicePartitions,w=e._subdivisions,E=w*(C+S-1),x=E-S+2,b=new Float64Array(3*x),T=a.createTypedArray(x,2*E),A=0,P=new Array(w),D=new Array(w);for(t=0;w>t;t++)d=i.TWO_PI*t/w,P[t]=m(d),D[t]=p(d);for(t=1;C>t;t++)for(f=Math.PI*t/C,v=m(f),g=p(f),r=0;w>r;r++)b[A++]=_.x*P[r]*g,b[A++]=_.y*D[r]*g,b[A++]=_.z*v;for(P.length=S,D.length=S,t=0;S>t;t++)d=i.TWO_PI*t/S,P[t]=m(d),D[t]=p(d);for(b[A++]=0,b[A++]=0,b[A++]=_.z,t=1;w>t;t++)for(f=Math.PI*t/w,v=m(f),g=p(f),r=0;S>r;r++)b[A++]=_.x*P[r]*g,b[A++]=_.y*D[r]*g,b[A++]=_.z*v;for(b[A++]=0,b[A++]=0,b[A++]=-_.z,A=0,t=0;C-1>t;++t){var M=t*w;for(r=0;w-1>r;++r)T[A++]=M+r,T[A++]=M+r+1;T[A++]=M+w-1,T[A++]=M}var I=w*(C-1);for(r=1;S+1>r;++r)T[A++]=I,T[A++]=I+r;for(t=0;w-2>t;++t){var O=t*S+1+I,R=(t+1)*S+1+I;for(r=0;S-1>r;++r)T[A++]=R+r,T[A++]=O+r;T[A++]=R+S-1,T[A++]=O+S-1}var L=b.length/3-1;for(r=L-1;r>L-S-1;--r)T[A++]=L,T[A++]=r;var N=new h({position:new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:b})});return new u({attributes:N,indices:T,primitiveType:s.LINES,boundingSphere:l.fromEllipsoid(y)})},f}),r("Core/EllipsoidalOccluder",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Cartesian3","./BoundingSphere"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){var i=e.transformPositionToScaledSpace(t,m),o=n.magnitudeSquared(i),a=Math.sqrt(o),s=n.divideByScalar(i,a,p);o=Math.max(1,o),a=Math.max(1,a);var l=n.dot(s,r),u=n.magnitude(n.cross(s,r)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function s(e,t,r){return 0>=t||t===1/0||t!==t?void 0:n.multiplyByScalar(e,t,r)}function l(e,t){return e.transformPositionToScaledSpace(t,f),n.normalize(f,f)}var u=function(e,r){this._ellipsoid=e,this._cameraPosition=new n,this._cameraPositionInScaledSpace=new n,this._distanceToLimbInScaledSpaceSquared=0,t(r)&&(this.cameraPosition=r)};r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=n.magnitudeSquared(r)-1;n.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=i}}});var c=new n;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,c);return this.isScaledSpacePointVisible(r)},u.prototype.isScaledSpacePointVisible=function(e){var t=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,i=n.subtract(e,t,c),o=-n.dot(i,t),a=o>r&&o*o/n.magnitudeSquared(i)>r;return!a},u.prototype.computeHorizonCullingPoint=function(e,t,r){for(var i=this._ellipsoid,n=l(i,e),o=0,u=0,c=t.length;c>u;++u){var h=t[u],d=a(i,h,n);o=Math.max(o,d)}return s(n,o,r)};var h=new n;u.prototype.computeHorizonCullingPointFromVertices=function(t,r,i,o,u){o=e(o,n.ZERO);for(var c=this._ellipsoid,d=l(c,t),m=0,p=0,f=r.length;f>p;p+=i){h.x=r[p]+o.x,h.y=r[p+1]+o.y,h.z=r[p+2]+o.z;var v=a(c,h,d);m=Math.max(m,v)}return s(d,m,u)};var d=[];u.prototype.computeHorizonCullingPointFromExtent=function(e,t,r){var i=e.subsample(t,0,d),a=o.fromPoints(i);return n.magnitude(a.center)<.1*t.minimumRadius?void 0:this.computeHorizonCullingPoint(a.center,i,r)};var m=new n,p=new n,f=new n;return u}),r("Core/EventHelper",["./defined","./DeveloperError"],function(){"use strict";var e=function(){this._removalFunctions=[]};return e.prototype.add=function(e,t,r){var i=e.addEventListener(t,r);this._removalFunctions.push(i);var n=this;return function(){i();var e=n._removalFunctions;e.splice(e.indexOf(i),1)}},e.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,r=e.length;r>t;++t)e[t]();e.length=0},e}),r("Core/Extent",["./freezeObject","./defaultValue","./defined","./Ellipsoid","./Cartographic","./DeveloperError","./Math"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,i,n){this.west=t(e,0),this.south=t(r,0),this.east=t(i,0),this.north=t(n,0)};s.fromDegrees=function(e,i,n,o,l){return e=a.toRadians(t(e,0)),i=a.toRadians(t(i,0)),n=a.toRadians(t(n,0)),o=a.toRadians(t(o,0)),r(l)?(l.west=e,l.south=i,l.east=n,l.north=o,l):new s(e,i,n,o)},s.fromCartographicArray=function(e,t){for(var i=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=0,u=e.length;u>l;l++){var c=e[l];i=Math.min(i,c.longitude),n=Math.max(n,c.longitude),o=Math.min(o,c.latitude),a=Math.max(a,c.latitude)}return r(t)?(t.west=i,t.south=o,t.east=n,t.north=a,t):new s(i,o,n,a)},s.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.prototype.validate=function(){},s.prototype.getSouthwest=function(e){return r(e)?(e.longitude=this.west,e.latitude=this.south,e.height=0,e):new n(this.west,this.south)},s.prototype.getNorthwest=function(e){return r(e)?(e.longitude=this.west,e.latitude=this.north,e.height=0,e):new n(this.west,this.north)},s.prototype.getNortheast=function(e){return r(e)?(e.longitude=this.east,e.latitude=this.north,e.height=0,e):new n(this.east,this.north)},s.prototype.getSoutheast=function(e){return r(e)?(e.longitude=this.east,e.latitude=this.south,e.height=0,e):new n(this.east,this.south)},s.prototype.getCenter=function(e){return r(e)?(e.longitude=.5*(this.west+this.east),e.latitude=.5*(this.south+this.north),e.height=0,e):new n(.5*(this.west+this.east),.5*(this.south+this.north))},s.prototype.intersectWith=function(e,t){var i=Math.max(this.west,e.west),n=Math.max(this.south,e.south),o=Math.min(this.east,e.east),a=Math.min(this.north,e.north);return r(t)?(t.west=i,t.south=n,t.east=o,t.north=a,t):new s(i,n,o,a)},s.prototype.contains=function(e){return e.longitude>=this.west&&e.longitude<=this.east&&e.latitude>=this.south&&e.latitude<=this.north},s.prototype.isEmpty=function(){return this.west>=this.east||this.south>=this.north};var l=new n;return s.prototype.subsample=function(e,n,o){e=t(e,i.WGS84),n=t(n,0),r(o)||(o=[]);var s=0,u=this.north,c=this.south,h=this.east,d=this.west,m=l;m.height=n,m.longitude=d,m.latitude=u,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=h,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.latitude=c,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=d,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.latitude=0>u?u:c>0?c:0;for(var p=1;8>p;++p){var f=-Math.PI+p*a.PI_OVER_TWO;f>d&&h>f&&(m.longitude=f,o[s]=e.cartographicToCartesian(m,o[s]),s++)}return 0===m.latitude&&(m.longitude=d,o[s]=e.cartographicToCartesian(m,o[s]),s++,m.longitude=h,o[s]=e.cartographicToCartesian(m,o[s]),s++),o.length=s,o},s.MAX_VALUE=e(new s(-Math.PI,-a.PI_OVER_TWO,Math.PI,a.PI_OVER_TWO)),s}),r("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i,n){"use strict";var o=function(e,r,i,n){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(r,0),this[3]=t(n,0)};return o.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3]):void 0},o.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new o),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t):new o(i,-n,n,i)},o.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(t,i,n){var o=2*i,a=t[o],s=t[o+1];return r(n)?(n.x=a,n.y=s,n):new e(a,s)},o.setColumn=function(e,t,r,i){i=o.clone(e,i);var n=2*t;return i[n]=r.x,i[n+1]=r.y,i},o.getRow=function(t,i,n){var o=t[i],a=t[i+2];return r(n)?(n.x=o,n.y=a,n):new e(o,a)},o.setRow=function(e,t,r,i){return i=o.clone(e,i),i[t]=r.x,i[t+2]=r.y,i},o.multiply=function(e,t,i){var n=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],s=e[1]*t[0]+e[3]*t[1],l=e[1]*t[2]+e[3]*t[3];return r(i)?(i[0]=n,i[1]=s,i[2]=a,i[3]=l,i):new o(n,a,s,l)},o.multiplyByVector=function(t,i,n){var o=t[0]*i.x+t[2]*i.y,a=t[1]*i.x+t[3]*i.y;return r(n)?(n.x=o,n.y=a,n):new e(o,a)},o.multiplyByScalar=function(e,t,i){return r(i)?(i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i):new o(e[0]*t,e[2]*t,e[1]*t,e[3]*t)},o.negate=function(e,t){return r(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t):new o(-e[0],-e[2],-e[1],-e[3])},o.transpose=function(e,t){var i=e[0],n=e[2],a=e[1],s=e[3];return r(t)?(t[0]=i,t[1]=n,t[2]=a,t[3]=s,t):new o(i,a,n,s)},o.abs=function(e,t){return r(t)?(t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t):new o(Math.abs(e[0]),Math.abs(e[2]),Math.abs(e[1]),Math.abs(e[3]))},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},o.IDENTITY=n(new o(1,0,0,1)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n"+"("+this[1]+", "+this[3]+")"},o}),r("Core/ExtentGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./Extent","./Geometry","./GeometryInstance","./GeometryPipeline","./GeographicProjection","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix2","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w){"use strict";function E(e,t){return e<-g.PI_OVER_TWO||e>g.PI_OVER_TWO?!1:t>g.PI||t<-g.PI?!1:!0}function x(e,r,i,n,o){var a=e.radiiSquared;O=N.latitude-e.granYCos*r+i*e.granXSin;var s=et(O),l=tt(O),u=a.z*l;R=N.longitude+r*e.granYSin+i*e.granXCos;var c=s*et(R),h=s*tt(R),d=a.x*c,m=a.y*h,p=rt(d*c+m*h+u*l),f=d/p,v=m/p,g=u/p;t(n)&&(G.x=f+c*n,G.y=v+h*n,G.z=g+l*n),t(o)&&(Y.x=f+c*o,Y.y=v+h*o,Y.z=g+l*o)}function b(e,t){var r=new h({attributes:new v,primitiveType:C.TRIANGLES});return e.position&&(r.attributes.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:t.positions})),e.normal&&(r.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(r.attributes.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.binormals})),r}function T(e,t,r,i,o){var a=e.length,s=t.normal?new Float32Array(a):void 0,l=t.tangent?new Float32Array(a):void 0,u=t.binormal?new Float32Array(a):void 0,c=0,h=i?a/2:0;a=i&&o?a/2:a;for(var d=0;a>d;d+=3){var m=n.fromArray(e,d,G),p=c+1,f=c+2;(t.normal||t.tangent||t.binormal)&&(H=r.geodeticSurfaceNormal(m,H),(t.tangent||t.binormal)&&(n.cross(n.UNIT_Z,H,j),y.multiplyByVector(U,j,j),n.normalize(j,j),t.binormal&&n.normalize(n.cross(H,j,q),q)),i&&(t.normal&&(s[c]=H.x,s[p]=H.y,s[f]=H.z),t.tangent&&(l[c]=j.x,l[p]=j.y,l[f]=j.z),t.binormal&&(u[c]=q.x,u[p]=q.y,u[f]=q.z)),o&&(t.normal&&(s[c+h]=-H.x,s[p+h]=-H.y,s[f+h]=-H.z),t.tangent&&(l[c+h]=-j.x,l[p+h]=-j.y,l[f+h]=-j.z),t.binormal&&(u[c+h]=q.x,u[p+h]=q.y,u[f+h]=q.z))),c+=3}return b(t,{positions:e,normals:s,tangents:l,binormals:u})}function A(e,t,r){for(var i=e.length,o=t.normal?new Float32Array(i):void 0,a=t.tangent?new Float32Array(i):void 0,s=t.binormal?new Float32Array(i):void 0,l=0,u=!0,c=i/2,h=0;c>h;h+=3){var d=n.fromArray(e,h,G),m=l+1,p=l+2;if(t.normal||t.tangent||t.binormal){var f=n.fromArray(e,h+3,J);if(u){var v=n.fromArray(e,h+c,Q);n.subtract(f,d,f),n.subtract(v,d,v),H=n.normalize(n.cross(v,f,H),H),u=!1}n.equalsEpsilon(f,d,g.EPSILON10)&&(u=!0),(t.tangent||t.binormal)&&(q=r.geodeticSurfaceNormal(d,q),t.tangent&&(j=n.normalize(n.cross(q,H,j),j))),t.normal&&(o[l]=H.x,o[m]=H.y,o[p]=H.z,o[l+c]=H.x,o[m+c]=H.y,o[p+c]=H.z),t.tangent&&(a[l]=j.x,a[m]=j.y,a[p]=j.z,a[l+c]=j.x,a[m+c]=j.y,a[p+c]=j.z),t.binormal&&(s[l]=q.x,s[m]=q.y,s[p]=q.z,s[l+c]=q.x,s[m+c]=q.y,s[p+c]=q.z)}l+=3}return b(t,{positions:e,normals:o,tangents:a,binormals:s})}function P(e,r,i,n,o){return K.x=(R-F.west)*n.lonScalar-.5,K.y=(O-F.south)*n.latScalar-.5,_.multiplyByVector(V,K,K),K.x+=.5,K.y+=.5,t(o)&&(i[r+o]=K.x,i[r+1+o]=K.y),i[r++]=K.x,i[r++]=K.y,r}function D(e,t,r){return e[t+r]=Y.x,e[t++]=G.x,e[t+r]=Y.y,e[t++]=G.y,e[t+r]=Y.z,e[t++]=G.z,e}function M(e,t){for(var i=t.ellipsoid,n=t.size,o=t.height,l=t.width,u=t.surfaceHeight,c=0,h=e.position?new Float64Array(3*n):void 0,d=e.st?new Float32Array(2*n):void 0,m=0,p=0;o>p;++p)for(var v=0;l>v;++v)x(t,p,v,u),h[m++]=G.x,h[m++]=G.y,h[m++]=G.z,e.st&&(K.x=(R-F.west)*t.lonScalar-.5,K.y=(O-F.south)*t.latScalar-.5,_.multiplyByVector(V,K,K),K.x+=.5,K.y+=.5,d[c++]=K.x,d[c++]=K.y);for(var g=T(h,e,i,!0,!1),y=6*(l-1)*(o-1),C=s.createTypedArray(n,y),S=0,w=0,E=0;o-1>E;++E){for(var b=0;l-1>b;++b){var A=S,P=A+l,D=P+1,M=A+1;C[w++]=A,C[w++]=P,C[w++]=M,C[w++]=M,C[w++]=P,C[w++]=D,++S}++S}return g.indices=C,e.st&&(g.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:d})),{boundingSphere:r.fromExtent3D(t.extent,i,u),geometry:g}}function I(t,i){var o=i.surfaceHeight,l=i.extrudedHeight,u=Math.min(l,o),c=Math.max(l,o);if(g.equalsEpsilon(u,c,.1))return M(t,i);var h,p=i.height,v=i.width,_=i.size,y=i.ellipsoid,C=e(i.closeTop,!0),S=e(i.closeBottom,!0),w=2*v+2*p-4,E=2*(w+4),b=new Float64Array(3*E),I=t.st?new Float32Array(2*E):void 0,O=0,R=0,L=0,N=3*(E/2);for(h=0;p>h;h++)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));for(h=p-1,O=0;v>O;O++)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));for(O=v-1,h=p-1;h>=0;h--)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));for(h=0,O=v-1;O>=0;O--)x(i,h,O,c,u),b=D(b,R,N),R+=3,t.st&&(L=P(t,L,I,i,E));var B=A(b,t,y);t.st&&(B.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:I}));var z,F,V,k,U,W=s.createTypedArray(E,6*w),H=b.length/6,j=0;for(U=0;H-1>U;U++){z=U,k=z+1;var q=n.fromArray(b,3*z,J),K=n.fromArray(b,3*k,Q);n.equalsEpsilon(q,K,g.EPSILON10)||(F=z+H,V=F+1,W[j++]=z,W[j++]=F,W[j++]=k,W[j++]=k,W[j++]=F,W[j++]=V)}if(B.indices=W,S||C){var $,et,tt=0,rt=0;C&&(tt+=_,rt+=6*(v-1)*(p-1),$=c),S&&(tt+=_,rt+=6*(v-1)*(p-1),et=u);var it=new Float64Array(3*tt),nt=t.st?new Float32Array(2*tt):void 0,ot=s.createTypedArray(tt,rt);for(R=0,L=0,N=S&&C?3*_:0,h=0;p>h;++h)for(O=0;v>O;++O)x(i,h,O,$,et),S&&(it[R+N]=Y.x,it[R+1+N]=Y.y,it[R+2+N]=Y.z),C&&(it[R]=G.x,it[R+1]=G.y,it[R+2]=G.z),t.st&&(L=P(t,L,nt,i,2*_)),R+=3;var at=T(it,t,y,C,S);t.st&&(at.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:nt}));var st=0;for(j=0,N/=3,U=0;p-1>U;++U){for(var lt=0;v-1>lt;++lt)z=j,F=z+v,V=F+1,k=z+1,S&&(ot[st++]=k+N,ot[st++]=F+N,ot[st++]=z+N,ot[st++]=V+N,ot[st++]=F+N,ot[st++]=k+N),C&&(ot[st++]=z,ot[st++]=F,ot[st++]=k,ot[st++]=k,ot[st++]=F,ot[st++]=V),++j;++j}at.indices=ot,B=m.combine([new d({geometry:at}),new d({geometry:B})])}var ut=r.fromExtent3D(i.extent,y,c,Z),ct=r.fromExtent3D(i.extent,y,u,X),ht=r.union(ut,ct);return{boundingSphere:ht,geometry:B}}var O,R,L=new n,N=new o,B=new o,z=new n,F=new c,V=new _,k=new _,U=new y,W=new p,G=new n,H=new n,j=new n,q=new n,Y=new n,X=new r,Z=new r,J=new n,Q=new n,K=new i,$=new S,et=Math.cos,tt=Math.sin,rt=Math.sqrt,it=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.extent,i=e(t.granularity,g.RADIANS_PER_DEGREE),n=e(t.ellipsoid,u.WGS84),o=e(t.height,0),a=t.rotation,s=t.stRotation,l=e(t.vertexFormat,w.DEFAULT);this._extent=r,this._granularity=i,this._ellipsoid=n,this._surfaceHeight=o,this._rotation=a,this._stRotation=s,this._vertexFormat=l,this._extrudedHeight=t.extrudedHeight,this._closeTop=t.closeTop,this._closeBottom=t.closeBottom,this._workerName="createExtentGeometry"
+};return it.createGeometry=function(e){var r=e._extent,i=e._granularity,o=e._ellipsoid,a=e._surfaceHeight,s=e._rotation,u=e._stRotation,d=e._vertexFormat,m=e._extrudedHeight,p=e._closeTop,f=e._closeBottom,g=Math.ceil((r.east-r.west)/i)+1,C=Math.ceil((r.north-r.south)/i)+1,w=(r.east-r.west)/(g-1),x=(r.north-r.south)/(C-1),b=o.radiiSquared;c.clone(r,F),r.getNorthwest(N),r.getCenter(B);var T=x,A=w,P=0,D=0;if(t(s)){var O=et(s);T*=O,A*=O;var R=tt(s);P=x*R,D=w*R,W.project(N,L),W.project(B,z),n.subtract(L,z,L),_.fromRotation(s,k),_.multiplyByVector(k,L,L),n.add(L,z,L),W.unproject(L,N);var G=N.latitude,H=G+(g-1)*D,j=G-T*(C-1),q=G-T*(C-1)+(g-1)*D,Y=Math.max(G,H,j,q),X=Math.min(G,H,j,q),Z=N.longitude,Q=Z+(g-1)*A,K=Z+(C-1)*P,rt=Z+(C-1)*P+(g-1)*A,it=Math.max(Z,Q,K,rt),nt=Math.min(Z,Q,K,rt);if(!(E(Y,nt)&&E(Y,it)&&E(X,nt)&&E(X,it)))throw new l("Rotated extent is invalid.");F.north=Y,F.south=X,F.east=it,F.west=nt}var ot=1/(F.east-F.west),at=1/(F.north-F.south),st=g*C;if(t(u)){_.fromRotation(-u,V);var lt=o.cartographicToCartesian(B,J);n.normalize(lt,lt),S.fromAxisAngle(lt,-u,$),y.fromQuaternion($,U)}else _.clone(_.IDENTITY,V),y.clone(y.IDENTITY,U);var ut,ct={granYCos:T,granYSin:P,granXCos:A,granXSin:D,radiiSquared:b,ellipsoid:o,lonScalar:ot,latScalar:at,extent:r,width:g,height:C,surfaceHeight:a,size:st,extrudedHeight:m,closeTop:p,closeBottom:f};ut=t(m)?I(d,ct):M(d,ct);var ht=ut.boundingSphere;return ut=ut.geometry,new h({attributes:new v(ut.attributes),indices:ut.indices,primitiveType:ut.primitiveType,boundingSphere:ht})},it}),r("Core/ExtentOutlineGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./Matrix2","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,t){return e<-m.PI_OVER_TWO||e>m.PI_OVER_TWO?!1:t>m.PI||t<-m.PI?!1:!0}function g(e,r,i,n,o){var a=e.radiiSquared;C=E.latitude-e.granYCos*r+i*e.granXSin;var s=O(C),l=R(C),u=a.z*l;S=E.longitude+r*e.granYSin+i*e.granXCos;var c=s*O(S),h=s*R(S),d=a.x*c,m=a.y*h,p=L(d*c+m*h+u*l),f=d/p,v=m/p,g=u/p;t(n)&&(P.x=f+c*n,P.y=v+h*n,P.z=g+l*n),t(o)&&(D.x=f+c*o,D.y=v+h*o,D.z=g+l*o)}function _(e){var t,i=e.extent,n=e.ellipsoid,o=e.size,s=e.height,l=e.width,u=e.surfaceHeight,c=new Float64Array(3*o),h=0,d=0;for(t=0;l>t;t++)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(t=l-1,d=1;s>d;d++)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(d=s-1,t=l-2;t>=0;t--)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(t=0,d=s-2;d>0;d--)g(e,d,t,u),c[h++]=P.x,c[h++]=P.y,c[h++]=P.z;for(var m=2*(c.length/3),p=a.createTypedArray(c.length/3,m),f=0,v=0;vs;s++)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(s=c-1,f=1;u>f;f++)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(f=u-1,s=c-2;s>=0;s--)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(s=0,f=u-2;f>0;f--)g(e,f,s,o,n),v[p+h]=D.x,v[p+h+1]=D.y,v[p+h+2]=D.z,v[p++]=P.x,v[p++]=P.y,v[p++]=P.z;for(var y=2*(v.length/3)+8,C=a.createTypedArray(v.length/3,y),S=v.length/6,w=0,E=0;S-1>E;E++)C[w++]=E,C[w++]=E+1,C[w++]=E+S,C[w++]=E+S+1;C[w++]=S-1,C[w++]=0,C[w++]=S+S-1,C[w++]=S,C[w++]=0,C[w++]=S,C[w++]=c-1,C[w++]=S+c-1,C[w++]=c+u-2,C[w++]=c+u-2+S,C[w++]=2*c+u-3,C[w++]=2*c+u-3+S;var x=r.fromExtent3D(l,d,o,I),b=r.fromExtent3D(l,d,n,M),T=r.union(x,b);return{boundingSphere:T,positions:v,indices:C}}var C,S,w=new i,E=new n,x=new n,b=new i,T=new p,A=new u,P=new i,D=new i,M=new r,I=new r,O=Math.cos,R=Math.sin,L=Math.sqrt,N=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.extent,i=e(t.granularity,m.RADIANS_PER_DEGREE),n=e(t.ellipsoid,l.WGS84),o=e(t.height,0),a=t.rotation;this._extent=r,this._granularity=i,this._ellipsoid=n,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=t.extrudedHeight,this._workerName="createExtentOutlineGeometry"};return N.createGeometry=function(e){var r=e._extent,n=e._granularity,a=e._ellipsoid,l=e._surfaceHeight,u=e._rotation,m=e._extrudedHeight,g=Math.ceil((r.east-r.west)/n)+1,C=Math.ceil((r.north-r.south)/n)+1,S=(r.east-r.west)/(g-1),P=(r.north-r.south)/(C-1),D=a.radiiSquared;r.getNorthwest(E),r.getCenter(x);var M=P,I=S,L=0,N=0;if(t(u)){var B=O(u);M*=B,I*=B;var z=R(u);L=P*z,N=S*z,A.project(E,w),A.project(x,b),i.subtract(w,b,w),p.fromRotation(u,T),p.multiplyByVector(T,w,w),i.add(w,b,w),A.unproject(w,E);var F=E.latitude,V=F+(g-1)*N,k=F-M*(C-1),U=F-M*(C-1)+(g-1)*N,W=Math.max(F,V,k,U),G=Math.min(F,V,k,U),H=E.longitude,j=H+(g-1)*I,q=H+(C-1)*L,Y=H+(C-1)*L+(g-1)*I,X=Math.max(H,j,q,Y),Z=Math.min(H,j,q,Y);if(!(v(W,Z)&&v(W,X)&&v(G,Z)&&v(G,X)))throw new s("Rotated extent is invalid.")}var J,Q=2*g+2*C-4,K={granYCos:M,granYSin:L,granXCos:I,granXSin:N,radiiSquared:D,ellipsoid:a,extent:r,width:g,height:C,surfaceHeight:l,size:Q};J=t(m)?y(K,m):_(K);var $=new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:J.positions})});return new c({attributes:$,indices:J.indices,primitiveType:f.LINES,boundingSphere:J.boundingSphere})},N}),r("Core/FAR",[],function(){"use strict";var e=5906376272e3;return e}),r("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value};return t}),r("Core/HeightmapTessellator",["./defaultValue","./defined","./freezeObject","./DeveloperError","./Cartesian3","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a){"use strict";var s={};return s.DEFAULT_STRUCTURE=r({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1}),s.computeVertices=function(r){var i,l,u,c,h=Math.cos,d=Math.sin,m=Math.sqrt,p=Math.atan,f=Math.exp,v=a.PI_OVER_TWO,g=a.toRadians,_=r.vertices,y=r.heightmap,C=r.width,S=r.height,w=r.skirtHeight,E=e(r.isGeographic,!0),x=e(r.ellipsoid,o.WGS84),b=1/x.maximumRadius,T=r.nativeExtent,A=r.extent;t(A)?(i=A.west,l=A.south,u=A.east,c=A.north):E?(i=g(T.west),l=g(T.south),u=g(T.east),c=g(T.north)):(i=T.west*b,l=v-2*p(f(-T.south*b)),u=T.east*b,c=v-2*p(f(-T.north*b)));var P=e(r.relativeToCenter,n.ZERO),D=e(r.structure,s.DEFAULT_STRUCTURE),M=e(D.heightScale,s.DEFAULT_STRUCTURE.heightScale),I=e(D.heightOffset,s.DEFAULT_STRUCTURE.heightOffset),O=e(D.elementsPerHeight,s.DEFAULT_STRUCTURE.elementsPerHeight),R=e(D.stride,s.DEFAULT_STRUCTURE.stride),L=e(D.elementMultiplier,s.DEFAULT_STRUCTURE.elementMultiplier),N=e(D.isBigEndian,s.DEFAULT_STRUCTURE.isBigEndian),B=(T.east-T.west)/(C-1),z=(T.north-T.south)/(S-1),F=x.radiiSquared,V=F.x,k=F.y,U=F.z,W=0,G=65536,H=-65536,j=0,q=S,Y=0,X=C;w>0&&(--j,++q,--Y,++X);for(var Z=j;q>Z;++Z){var J=Z;0>J&&(J=0),J>=S&&(J=S-1);var Q=T.north-z*J;Q=E?g(Q):v-2*p(f(-Q*b));for(var K=h(Q),$=d(Q),et=U*$,tt=(Q-l)/(c-l),rt=Y;X>rt;++rt){var it=rt;0>it&&(it=0),it>=C&&(it=C-1);var nt=T.west+B*it;E?nt=g(nt):nt*=b;var ot,at=J*C*R+it*R;if(1===O)ot=y[at];else{ot=0;var st;if(N)for(st=0;O>st;++st)ot=ot*L+y[at+st];else for(st=O-1;st>=0;--st)ot=ot*L+y[at+st]}ot=ot*M+I,H=Math.max(H,ot),G=Math.min(G,ot),(rt!==it||Z!==J)&&(ot-=w);var lt=K*h(nt),ut=K*d(nt),ct=V*lt,ht=k*ut,dt=m(ct*lt+ht*ut+et*$),mt=1/dt,pt=ct*mt,ft=ht*mt,vt=et*mt;_[W++]=pt+lt*ot-P.x,_[W++]=ft+ut*ot-P.y,_[W++]=vt+$*ot-P.z,_[W++]=ot;var gt=(nt-i)/(u-i);_[W++]=gt,_[W++]=tt}}return{maximumHeight:H,minimumHeight:G}},s}),r("Core/HermitePolynomialApproximation",["./defined","./Math"],function(e,t){"use strict";function r(e,t,i,n,o,a){var s,l,u,c=0;if(n>0){for(l=0;o>l;l++){for(s=!1,u=0;ul;l++){for(s=!1,u=0;ul;l++){s[l]=0;var v=new Array(p);for(f[l]=v,u=0;p>u;u++)v[u]=[]}var g=p,_=new Array(g);for(l=0;g>l;l++)_[l]=l;var y=p-1;for(h=0;a>h;h++){for(u=0;g>u;u++)m=_[u]*a+h,f[h][0].push(o[m]);for(l=1;g>l;l++){var C=!1;for(u=0;g-l>u;u++){var S,w=n[_[u]],E=n[_[u+l]];0>=E-w?(m=_[u]*a+a*l+h,S=o[m],f[h][l].push(S/i(l))):(S=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(S/(E-w))),C=C||0!==S}C||(y=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;y>=l;l++){var x=r(t,_,n,c,l,[]);for(h=0;a>h;h++){var b=f[h][l][0];s[h+c*a]+=b*x}}return s},n}),r("Core/IauOrientationParameters",[],function(){"use strict";var e=function(e,t,r,i){this.rightAscension=e,this.declination=t,this.rotation=r,this.rotationRate=i};return e}),r("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,r,i,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,m=26.4057084,p=13.064993,f=.3287146,v=1.7484877,g=-.1589763,_=.0036096,y=.1643573,C=12.9590088;return o.ComputeMoon=function(o,S){e(o)||(o=new r);var w=o.addSeconds(a),E=w.getTotalDays()-s,x=E/n.DAYS_PER_JULIAN_CENTURY,b=(125.045+l*E)*i.RADIANS_PER_DEGREE,T=(250.089+u*E)*i.RADIANS_PER_DEGREE,A=(260.008+c*E)*i.RADIANS_PER_DEGREE,P=(176.625+h*E)*i.RADIANS_PER_DEGREE,D=(357.529+d*E)*i.RADIANS_PER_DEGREE,M=(311.589+m*E)*i.RADIANS_PER_DEGREE,I=(134.963+p*E)*i.RADIANS_PER_DEGREE,O=(276.617+f*E)*i.RADIANS_PER_DEGREE,R=(34.226+v*E)*i.RADIANS_PER_DEGREE,L=(15.134+g*E)*i.RADIANS_PER_DEGREE,N=(119.743+_*E)*i.RADIANS_PER_DEGREE,B=(239.961+y*E)*i.RADIANS_PER_DEGREE,z=(25.053+C*E)*i.RADIANS_PER_DEGREE,F=Math.sin(b),V=Math.sin(T),k=Math.sin(A),U=Math.sin(P),W=Math.sin(D),G=Math.sin(M),H=Math.sin(I),j=Math.sin(O),q=Math.sin(R),Y=Math.sin(L),X=Math.sin(N),Z=Math.sin(B),J=Math.sin(z),Q=Math.cos(b),K=Math.cos(T),$=Math.cos(A),et=Math.cos(P),tt=Math.cos(D),rt=Math.cos(M),it=Math.cos(I),nt=Math.cos(O),ot=Math.cos(R),at=Math.cos(L),st=Math.cos(N),lt=Math.cos(B),ut=Math.cos(z),ct=(269.9949+.0031*x-3.8787*F-.1204*V+.07*k-.0172*U+.0072*G-.0052*Y+.0043*J)*i.RADIANS_PER_DEGREE,ht=(66.5392+.013*x+1.5419*Q+.0239*K-.0278*$+.0068*et-.0029*rt+9e-4*it+8e-4*at-9e-4*ut)*i.RADIANS_PER_DEGREE,dt=(38.3213+13.17635815*E-1.4e-12*E*E+3.561*F+.1208*V-.0642*k+.0158*U+.0252*W-.0066*G-.0047*H-.0046*j+.0028*q+.0052*Y+.004*X+.0019*Z-.0044*J)*i.RADIANS_PER_DEGREE,mt=(13.17635815-1.4e-12*2*E+3.561*Q*l+.1208*K*u-.0642*$*c+.0158*et*h+.0252*tt*d-.0066*rt*m-.0047*it*p-.0046*nt*f+.0028*ot*v+.0052*at*g+.004*st*_+.0019*lt*y-.0044*ut*C)/86400*i.RADIANS_PER_DEGREE;return e(S)||(S=new t),S.rightAscension=ct,S.declination=ht,S.rotation=dt,S.rotationRate=mt,S},o}),r("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,r,i,n,o,a){"use strict";function s(r,i,a){var s=u;s.x=Math.cos(r+n.PI_OVER_TWO),s.y=Math.sin(r+n.PI_OVER_TWO),s.z=0;var l=Math.cos(i),d=h;d.x=l*Math.cos(r),d.y=l*Math.sin(r),d.z=Math.sin(i);var m=e.cross(d,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=m.x,a[2]=d.x,a[3]=s.y,a[4]=m.y,a[5]=d.y,a[6]=s.z,a[7]=m.z,a[8]=d.z,a}var l=function(e){t(e)&&"function"==typeof e||(e=r.ComputeMoon),this._computeFunction=e},u=new e,c=new e,h=new e,d=new o,m=new a;return l.prototype.evaluate=function(r,l){t(r)||(r=new i);var u=this._computeFunction(r),c=s(u.rightAscension,u.declination,l),h=n.zeroToTwoPi(u.rotation),p=a.fromAxisAngle(e.UNIT_Z,h,m),f=o.fromQuaternion(a.conjugate(p,p),d),v=o.multiply(f,c,c);return v},l}),r("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t}),r("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,r,i,n,o,a){t(a)?a.length=0:a=[];var s,l,u;r?(s=e>i,l=e>n,u=e>o):(s=i>e,l=n>e,u=o>e);var c,h,d,m,p,f,v=s+l+u;return 1===v?s?(c=(e-i)/(n-i),h=(e-i)/(o-i),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),m=(e-n)/(i-n),a.push(2),a.push(0),1!==m&&(a.push(-1),a.push(1),a.push(0),a.push(m)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(p=(e-o)/(i-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==p&&(a.push(-1),a.push(2),a.push(0),a.push(p))):2===v?s||i===e?l||n===e?u||o===e||(h=(e-i)/(o-i),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-i)/(n-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(m=(e-n)/(i-n),p=(e-o)/(i-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(m),a.push(-1),a.push(2),a.push(0),a.push(p)):3===v||(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(r,i,n,o,a,s,l,u,c){var h=n-l,d=l-a,m=s-u,p=o-u,f=1/(m*h+d*p),v=i-u,g=r-l,_=(m*g+d*v)*f,y=(-p*g+h*v)*f,C=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=C,c):new e(_,y,C)},r}),r("Core/TimeInterval",["./defined","./DeveloperError","./freezeObject","./JulianDate","./TimeStandard"],function(e,t,r,i,n){"use strict";var o=function(t,r,n,o,a){e(n)||(n=!0),e(o)||(o=!0);var s=i.compare(r,t);this.start=t,this.stop=r,this.data=a,this.isStartIncluded=n,this.isStopIncluded=o,this.isEmpty=0>s||0===s&&(!n||!o)};return o.fromIso8601=function(e,t,r,n){var a=e.split("/"),s=i.fromIso8601(a[0]),l=i.fromIso8601(a[1]);return new o(s,l,t,r,n)},o.equals=function(t,r,n){return t===r||e(t)&&e(r)&&(t.isEmpty&&r.isEmpty||t.isStartIncluded===r.isStartIncluded&&t.isStopIncluded===r.isStopIncluded&&i.equals(t.start,r.start)&&i.equals(t.stop,r.stop)&&(t.data===r.data||e(n)&&n(t.data,r.data)))},o.equalsEpsilon=function(t,r,n,o){return t===r||e(t)&&e(r)&&(t.isEmpty&&r.isEmpty||t.isStartIncluded===r.isStartIncluded&&t.isStopIncluded===r.isStopIncluded&&i.equalsEpsilon(t.start,r.start,n)&&i.equalsEpsilon(t.stop,r.stop,n)&&(t.data===r.data||e(o)&&o(t.data,r.data)))},o.prototype.clone=function(){return new o(this.start,this.stop,this.isStartIncluded,this.isStopIncluded,this.data)},o.EMPTY=r(new o(new i(0,0,n.TAI),new i(0,0,n.TAI),!1,!1)),o.prototype.intersect=function(t,r){if(!e(t))return o.EMPTY;var n,a,s,l=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded,d=this.start,m=this.stop,p=this.isStartIncluded,f=this.isStopIncluded;return l.greaterThanOrEquals(d)&&m.greaterThanOrEquals(l)?(a=!i.equals(l,d)&&c||p&&c,s=f&&h,n=e(r)?r(this.data,t.data):this.data,m.greaterThanOrEquals(u)?(s=s||!i.equals(u,m)&&h,new o(l,u,a,s,n)):(s=s||f,new o(l,m,a,s,n))):l.lessThanOrEquals(d)&&d.lessThanOrEquals(u)?(a=i.equals(l,d)===!1&&p||p&&c,s=f&&h,n=e(r)?r(this.data,t.data):this.data,m.greaterThanOrEquals(u)?(s=s||i.equals(u,m)===!1&&h,new o(d,u,a,s,n)):(s=s||f,new o(d,m,a,s,n))):o.EMPTY},o.prototype.contains=function(e){if(this.isEmpty)return!1;var t=i.compare(this.start,e);if(0===t)return this.isStartIncluded;var r=i.compare(e,this.stop);return 0===r?this.isStopIncluded:0>t&&0>r},o.prototype.equals=function(e,t){return o.equals(this,e,t)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o}),r("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,r){"use strict";var i=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new r(i,n,!0,!0)),a={MINIMUM_VALUE:i,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),r("Core/KeyboardEventModifier",["./Enumeration"],function(e){"use strict";var t={SHIFT:new e(0,"SHIFT"),CTRL:new e(1,"CTRL"),ALT:new e(2,"ALT")};return t}),r("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l=r.length;for(a=0;n>a;a++)o[a]=0;for(a=0;l>a;a++){var u=1;for(s=0;l>s;s++)if(s!==a){var c=r[a]-r[s];u*=(t-r[s])/c}for(s=0;n>s;s++)o[s]+=u*i[a*n+s]}return o},t}),r("Core/LinearApproximation",["./defined","./DeveloperError"],function(e){"use strict";var t={type:"Linear"};return t.getRequiredDataPoints=function(){return 2},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l,u=r[0],c=r[1];for(a=0;n>a;a++)s=i[a],l=i[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},t}),r("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)};return r.clone=function(e,i){return t(e)?t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue):void 0},r.packedLength=4,r.pack=function(t,r,i){i=e(i,0),r[i++]=t.near,r[i++]=t.nearValue,r[i++]=t.far,r[i]=t.farValue},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),r("Core/ObjectOrientedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Matrix3"],function(e,t,r,i,n){"use strict";function o(e,t,r,i,o){var a=t[e]+r[0]*i[n.getElementIndex(0,e)]+r[1]*i[n.getElementIndex(1,e)]+r[2]*i[n.getElementIndex(2,e)];return Math.abs(o[e])>a?!0:!1}function a(e,t,r,i,o){var a=o[0]*i[n.getElementIndex(0,e)]+o[1]*i[n.getElementIndex(1,e)]+o[2]*i[n.getElementIndex(2,e)],s=r[e]+t[0]*i[n.getElementIndex(0,e)]+t[1]*i[n.getElementIndex(1,e)]+t[2]*i[n.getElementIndex(2,e)];return Math.abs(a)>s?!0:!1}function s(e,t,r,i,o,a){var s=a[(e+2)%3]*o[n.getElementIndex((e+1)%3,t)]-a[(e+1)%3]*o[n.getElementIndex((e+2)%3,t)],l=r[(e+1)%3]*o[n.getElementIndex((e+2)%3,t)]+r[(e+2)%3]*o[n.getElementIndex((e+1)%3,t)];return l+=i[(t+1)%3]*o[n.getElementIndex(e,(t+2)%3)]+i[(t+2)%3]*o[n.getElementIndex(e,(t+1)%3)],Math.abs(s)>l?!0:!1}var l=function(r,i,o){this.rotation=n.clone(t(r,n.IDENTITY)),this.translation=e.clone(t(i,e.ZERO)),this.scale=e.clone(t(o,e.ZERO))},u=new e,c=new e,h=new e,d=new e,m=new e,p=new n,f={unitary:new n,diagonal:new n};l.fromPoints=function(t,i){if(r(i)||(i=new l),!r(t)||0===t.length)return i.tranformMatrix=n.IDENTITY,i.translation=e.ZERO,i.scale=e.ZERO,i;var o,a=t.length,s=e.clone(t[0],u);for(o=1;a>o;o++)e.add(s,t[o],s);var v=1/a;e.multiplyByScalar(s,v,s);var g,_=0,y=0,C=0,S=0,w=0,E=0;for(o=0;a>o;o++)g=e.subtract(t[o],s,c),_+=g.x*g.x,y+=g.x*g.y,C+=g.x*g.z,S+=g.y*g.y,w+=g.y*g.z,E+=g.z*g.z;_*=v,y*=v,C*=v,S*=v,w*=v,E*=v;var x=p;x[0]=_,x[1]=y,x[2]=C,x[3]=y,x[4]=S,x[5]=w,x[6]=C,x[7]=w,x[8]=E;var b=n.getEigenDecomposition(x,f),T=n.transpose(b.unitary,i.rotation);g=e.subtract(t[0],s,c);var A=n.multiplyByVector(T,g,h),P=e.clone(A,d),D=e.clone(A,m);for(o=1;a>o;o++)g=e.subtract(t[o],s,g),n.multiplyByVector(T,g,A),e.getMinimumByComponent(D,A,D),e.getMaximumByComponent(P,A,P);var M=e.add(D,P,h);e.multiplyByScalar(M,.5,M),n.multiplyByVector(T,M,M),e.add(s,M,i.translation);var I=e.subtract(P,D,h);return e.multiplyByScalar(I,.5,i.scale),i},l.fromBoundingRectangle=function(e,t,i){r(i)||(i=new l),r(t)?n.fromRotationZ(t,i.rotation):n.clone(n.IDENTITY,i.rotation);var o=i.scale;o.x=.5*e.width,o.y=.5*e.height,o.z=0;var a=n.multiplyByVector(i.rotation,o,i.translation);return a.x+=e.x,a.y+=e.y,i},l.clone=function(t,i){return r(t)?r(i)?(n.clone(t.rotation,i.rotation),e.clone(t.translation,i.translation),e.clone(t.scale,i.scale),i):new l(t.rotation,t.translation,t.scale):void 0};var v=new n,g=new n,_=new e,y=new Array(3),C=new Array(3),S=new Array(3);return l.intersect=function(t,r){var i=n.transpose(t.rotation,v),l=n.multiply(i,r.rotation,g);n.abs(l,l);var u=y,c=C,h=S;return e.subtract(t.translation,r.translation,_),n.multiplyByVector(i,_,_),e.pack(_,u),e.pack(t.scale,c),e.pack(r.scale,h),o(0,c,h,l,u)?!1:o(1,c,h,l,u)?!1:o(2,c,h,l,u)?!1:a(0,c,h,l,u)?!1:a(1,c,h,l,u)?!1:a(2,c,h,l,u)?!1:s(0,0,c,h,l,u)?!1:s(1,0,c,h,l,u)?!1:s(2,0,c,h,l,u)?!1:s(0,1,c,h,l,u)?!1:s(1,1,c,h,l,u)?!1:s(2,1,c,h,l,u)?!1:s(0,2,c,h,l,u)?!1:s(1,2,c,h,l,u)?!1:s(2,2,c,h,l,u)?!1:!0},l.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.transformedPosition,i.transformedPosition)&&n.equals(t.transformMatrix,i.transformMatrix)&&e.equals(t.extent,i.extent)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),r("Core/Visibility",["./Enumeration"],function(e){"use strict";var t={NONE:new e(-1,"NONE"),PARTIAL:new e(0,"PARTIAL"),FULL:new e(1,"FULL")};return t}),r("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Math","./Visibility"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,r){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.setCameraPosition(r)};l.fromBoundingSphere=function(e,r,o){if(!i(e))throw new n("occluderBoundingSphere is required.");if(!i(r))throw new n("camera position is required.");return i(o)?(t.clone(e.center,o._occluderPosition),o._occluderRadius=e.radius,o.setCameraPosition(r),o):new l(e,r)},l.prototype.getPosition=function(){return this._occluderPosition},l.prototype.getRadius=function(){return this._occluderRadius};var u=new t;l.prototype.setCameraPosition=function(e){if(!i(e))throw new n("cameraPosition is required.");e=t.clone(e,this._cameraPosition);var r,o,a,s=t.subtract(this._occluderPosition,e,u),l=t.magnitudeSquared(s),c=this._occluderRadius*this._occluderRadius;if(l>c){r=Math.sqrt(l-c),l=1/Math.sqrt(l),o=t.multiplyByScalar(s,l,u);var h=r*r*l;a=t.add(e,t.multiplyByScalar(o,h,u),u)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=a,this._cameraPosition=e};var c=new t;l.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var r=t.subtract(e,this._occluderPosition,c),i=this._occluderRadius;if(i=t.magnitudeSquared(r)-i*i,i>0)return i=Math.sqrt(i)+this._horizonDistance,r=t.subtract(e,this._cameraPosition,r),i*i>t.magnitudeSquared(r)}return!1};var h=new t;l.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,h),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,c),o=this._occluderRadius-i;if(o=t.magnitudeSquared(n)-o*o,i0?(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n),o*o+i*i>t.magnitudeSquared(n)):!1;if(o>0){n=t.subtract(r,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=i*i;return(this._horizonDistance*this._horizonDistance+s)*l>a*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1},l.prototype.getVisibility=function(e){if(!i(e))throw new n("occludeeBS is required.");var r=t.clone(e.center),o=e.radius;if(o>this._occluderRadius)return s.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var a=t.subtract(r,this._occluderPosition),l=this._occluderRadius-o,u=t.magnitudeSquared(a);if(l=u-l*l,l>0){l=Math.sqrt(l)+this._horizonDistance,a=t.subtract(r,this._cameraPosition);var c=t.magnitudeSquared(a);return c>l*l+o*o?s.NONE:(l=this._occluderRadius+o,l=u-l*l,l>0?(l=Math.sqrt(l)+this._horizonDistance,l*l+o*o>c?s.FULL:s.PARTIAL):(a=t.subtract(r,this._horizonPlanePosition),t.dot(a,this._horizonPlaneNormal)>-o?s.PARTIAL:s.FULL))}}return s.NONE},l.getOccludeePoint=function(e,r,i){var o=t.clone(r),a=t.clone(e.center),s=e.radius,u=i.length;if(t.equals(a,r))throw new n("occludeePosition must be different than occluderBoundingSphere.center");var c=t.normalize(t.subtract(o,a)),h=-t.dot(c,a),d=l._anyRotationVector(a,c,h),m=l._horizonToPlaneNormalDotProduct(e,c,h,d,i[0]);if(!m)return void 0;for(var p,f=1;u>f;++f){if(p=l._horizonToPlaneNormalDotProduct(e,c,h,d,i[f]),!p)return void 0;m>p&&(m=p)}if(.0017453283658983088>m)return void 0;var v=s/m;return t.add(a,t.multiplyByScalar(c,v))};var d=[];return l.computeOccludeePointFromExtent=function(i,n){n=r(n,o.WGS84);var a=i.subsample(n,0,d),s=e.fromPoints(a),u=t.ZERO;return t.equals(u,s.center)?void 0:l.getOccludeePoint(new e(u,n.minimumRadius),s.center,a)},l._anyRotationVector=function(e,r,i){var n=t.abs(r),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var s=(t.dot(r,n)+i)/-t.dot(r,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,s)),e))},l._rotationVector=function(e,r,i,n,o){var s=t.subtract(n,e);if(s=t.normalize(s),t.dot(r,s)<.9999999847691291){var l=t.cross(r,s),u=t.magnitude(l);if(u>a.EPSILON13)return t.normalize(l)}return o},l._horizonToPlaneNormalDotProduct=function(e,r,i,n,o){var a=t.clone(o),s=t.clone(e.center),l=e.radius,u=t.subtract(s,a),c=t.magnitudeSquared(u),h=l*l;if(h>c)return!1;var d=c-h,m=Math.sqrt(d),p=Math.sqrt(c),f=1/p,v=m*f,g=v*m;u=t.normalize(u);var _=t.add(a,t.multiplyByScalar(u,g)),y=Math.sqrt(d-g*g),C=this._rotationVector(s,r,i,a,n),S=new t(C.x*C.x*u.x+(C.x*C.y-C.z)*u.y+(C.x*C.z+C.y)*u.z,(C.x*C.y+C.z)*u.x+C.y*C.y*u.y+(C.y*C.z-C.x)*u.z,(C.x*C.z-C.y)*u.x+(C.y*C.z+C.x)*u.y+C.z*C.z*u.z);S=t.normalize(S);var w=t.multiplyByScalar(S,y);C=t.normalize(t.subtract(t.add(_,w),s));var E=t.dot(r,C);C=t.normalize(t.subtract(t.subtract(_,w),s));var x=t.dot(r,C);return x>E?E:x},l}),r("Core/Packable",["../Core/DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),r("Core/PackableForInterpolation",["../Core/DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),r("Core/PolygonGeometryLibrary",["./defaultValue","./defined","./Cartesian3","./Ellipsoid"],function(e,t,r,i){"use strict";function n(e,t,i,n){return r.subtract(t,e,a),r.multiplyByScalar(a,i/n,a),r.add(e,a,a),[a.x,a.y,a.z]}var o={},a=new r;o.subdivideLine=function(e,t,i){var o=r.distance(e,t),a=r.angleBetween(e,t),s=a/i,l=Math.ceil(Math.log(s)/Math.log(2));1>l&&(l=0);var u=Math.pow(2,l),c=o/u,h=new Array(3*u),d=0;h[d++]=e.x,h[d++]=e.y,h[d++]=e.z;for(var m=1;u>m;m++){var p=n(e,t,m*c,o);h[d++]=p[0],h[d++]=p[1],h[d++]=p[2]}return h};var s=new r,l=new r,u=new r,c=new r;return o.scaleToGeodeticHeightExtruded=function(n,o,a,h,d){h=e(h,i.WGS84);var m=s,p=l,f=u,v=c;if(t(n)&&t(n.attributes)&&t(n.attributes.position))for(var g=n.attributes.position.values,_=g.length/2,y=0;_>y;y+=3)r.fromArray(g,y,f),h.geodeticSurfaceNormal(f,m),v=h.scaleToGeodeticSurface(f,v),p=r.multiplyByScalar(m,a,p),p=r.add(v,p,p),g[y+_]=p.x,g[y+1+_]=p.y,g[y+2+_]=p.z,d&&(v=r.clone(f,v)),p=r.multiplyByScalar(m,o,p),p=r.add(v,p,p),g[y]=p.x,g[y+1]=p.y,g[y+2]=p.z;return n},o}),r("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var r=new t,i=function(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0};return i}),r("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this.length--,r},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),r("Core/WindingOrder",["./Enumeration"],function(e){"use strict";var t={CLOCKWISE:new e(2304,"CLOCKWISE"),COUNTER_CLOCKWISE:new e(2305,"COUNTER_CLOCKWISE"),validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return t}),r("Core/PolygonPipeline",["./DeveloperError","./Math","./Cartesian2","./Cartesian3","./defined","./Geometry","./GeometryAttribute","./Ellipsoid","./EllipsoidTangentPlane","./defaultValue","./pointInsideTriangle","./ComponentDatatype","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t,i){var n=r.subtract(t,e),o=r.subtract(i,t);return n.x*o.y-n.y*o.x>=0}function v(e){for(var t=e[0].x,r=0,i=0;it&&(t=e[i].x,r=i);return r}function g(e){for(var t=e[0][0].x,r=0,i=0;it&&(t=n,r=i)}return r}function _(e){for(var t=[],r=0;rc&&(c=t[h].x);c+=c-l;var d=new i(c,e.y,0);for(h=0;h=e.x||p.x>=e.x)&&(m.y>=e.y&&p.y<=e.y||m.y<=e.y&&p.y>=e.y)){var f=(p.y-m.y)*(d.x-e.x)-(p.x-m.x)*(d.y-e.y);if(0!==f){f=1/f;var g=((p.x-m.x)*(e.y-m.y)-(p.y-m.y)*(e.x-m.x))*f,_=((d.x-e.x)*(e.y-m.y)-(d.y-e.y)*(e.x-m.x))*f;if(g>=0&&1>=g&&_>=0&&1>=_){var y=new r(e.x+g*(d.x-e.x),e.y+g*(d.y-e.y)),C=r.subtract(y,e);f=r.magnitudeSquared(C),o>f&&(s=y,o=f,n[0]=h,n[1]=(h+1)%t.length)}}}}return s}function S(e,t){var i=g(t),n=t[i],o=v(n),a=n[o],s=[],l=C(a,e,s),u=y(e,l);if(-1!==u)return u;var h=r.magnitudeSquared(r.subtract(e[s[0]],a)),d=r.magnitudeSquared(r.subtract(e[s[1]],a)),m=d>h?e[s[0]]:e[s[1]],p=_(e),f=p.indexOf(m);-1!==f&&p.splice(f,1);for(var S=[],w=0;w0){var b=new r(1,0);for(w=0;wP&&(x=P,m=S[w])}}}return e.indexOf(m)}function w(e,t,r){for(var n=G.computeWindingOrder2D(e),o=0;oi&&(i=t.length-1),i===t.length&&(i=0),P(i,t),i
+}function P(t,n){var o=t-1,a=t+1;0>o&&(o=n.length-1),a===n.length&&(a=0);var s=r.subtract(n[o].position,n[t].position),l=r.subtract(n[a].position,n[t].position);if(s=new i(s.x,s.y,0),l=new i(l.x,l.y,0),D(s,l)){var u=new e("Superfluous vertex found.");throw u.vertexIndex=t,u}}function D(e,t){return 0===i.cross(e,t).z}function M(e,t){return i.cross(e,t).z<0}function I(e,t){return i.cross(e,t).z>0}function O(e,t,r){return i.cross(e,r).z>0&&i.cross(r,t).z>0}function R(e,t,r){return i.cross(e,r).z<0&&i.cross(r,t).z<0}function L(e,t,i){for(var n=0;nt||e>r)&&(t>e||r>e)||t===r&&t===e}function z(t){var r=t.length;if(3===r)return N(t)?[]:[t[0].index,t[1].index,t[2].index];if(t.length<3)throw new e("Invalid polygon: must have at least three vertices.");for(var i=!1,n=0;!i;){var o=10*t.length;if(n>o)return[];n++;for(var a=E(t.length),s=a+1;Math.abs(a-s)<2||Math.abs(a-s)>t.length-2;)s=E(t.length);if(a>s){var l=a;a=s,s=l}try{if(x(a,s,t)){var u=t.splice(a,s-a+1,t[a],t[s]);return z(t).concat(z(u))}}catch(c){if(c.hasOwnProperty("vertexIndex"))return t.splice(c.vertexIndex,1),z(t);throw c}}}var F=0,V=-1,k=1,U=new i,W=new i,G={removeDuplicates:function(e){for(var t=e.length,r=[],n=t-1,o=0;t>o;n=o++){var a=e[n],s=e[o];i.equals(a,s)||r.push(s)}return r},computeArea2D:function(e){for(var t=e.length,r=0,i=t-1,n=0;t>n;i=n++){var o=e[i],a=e[n];r+=o.x*a.y-a.x*o.y}return.5*r},computeWindingOrder2D:function(e){var t=G.computeArea2D(e);return t>=0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},triangulate:function(e){for(var t=e.length,r=[],i=0;t>i;++i)r[i]={position:e[i],index:i};return z(r)},resetSeed:function(e){F=u(e,0)},computeSubdivision:function(e,r,n){n=u(n,t.RADIANS_PER_DEGREE);for(var s=new m,l=r.length,c=0;l>c;c+=3)s.enqueue({i0:r[c],i1:r[c+1],i2:r[c+2]});for(var p,f=e.slice(0),v=[],g={};s.length>0;){var _,y,C=s.dequeue(),S=f[C.i0],w=f[C.i1],E=f[C.i2],x=i.angleBetween(S,w),b=i.angleBetween(w,E),T=i.angleBetween(E,S),A=Math.max(x,Math.max(b,T));A>n?x===A?(_=Math.min(C.i0,C.i1).toString()+" "+Math.max(C.i0,C.i1).toString(),p=g[_],p||(y=i.add(S,w),i.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),s.enqueue({i0:C.i0,i1:p,i2:C.i2}),s.enqueue({i0:p,i1:C.i1,i2:C.i2})):b===A?(_=Math.min(C.i1,C.i2).toString()+" "+Math.max(C.i1,C.i2).toString(),p=g[_],p||(y=i.add(w,E),i.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),s.enqueue({i0:C.i1,i1:p,i2:C.i0}),s.enqueue({i0:p,i1:C.i2,i2:C.i0})):T===A&&(_=Math.min(C.i2,C.i0).toString()+" "+Math.max(C.i2,C.i0).toString(),p=g[_],p||(y=i.add(E,S),i.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),s.enqueue({i0:C.i2,i1:p,i2:C.i1}),s.enqueue({i0:p,i1:C.i0,i2:C.i1})):(v.push(C.i0),v.push(C.i1),v.push(C.i2))}var P=f.length,D=new Array(3*P),M=0;for(p=0;P>p;p++){var I=f[p];D[M++]=I.x,D[M++]=I.y,D[M++]=I.z}return new o({attributes:{position:new a({componentDatatype:h.DOUBLE,componentsPerAttribute:3,values:D})},indices:v,primitiveType:d.TRIANGLES})},scaleToGeodeticHeight:function(e,t,r,o){r=u(r,s.WGS84);var a=U,l=W;if(t=u(t,0),o=u(o,!0),n(e)&&n(e.attributes)&&n(e.attributes.position))for(var c=e.attributes.position.values,h=c.length,d=0;h>d;d+=3)i.fromArray(c,d,l),o&&(l=r.scaleToGeodeticSurface(l,l)),a=r.geodeticSurfaceNormal(l,a),i.multiplyByScalar(a,t,a),i.add(l,a,l),c[d]=l.x,c[d+1]=l.y,c[d+2]=l.z;return e},eliminateHoles:function(e,t,r){r=u(r,s.WGS84);for(var n=[],o=0;o0;)c=w(c,n,r);return c}};return G}),r("Core/PolygonGeometry",["./defaultValue","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Quaternion","./Queue","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x){"use strict";function b(e,t,r,i){for(var o=S.fromAxisAngle(e._plane.normal,r,O),s=g.fromQuaternion(o,R),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,m=0;d>m;++m){var p=n.clone(t[m],I);g.multiplyByVector(s,p,p);var f=e.projectPointOntoPlane(p,M);a(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return i.x=l,i.y=c,i.width=u-l,i.height=h-c,i}function T(e,t,r,i){var n=u.fromPoints(t,e),a=n.projectPointsOntoPlane(t,L),s=y.computeWindingOrder2D(a);s===x.CLOCKWISE&&(a.reverse(),t.reverse());var l=y.triangulate(a);l.length<3&&(l=[0,1,2]);var d;if(i){for(var p=t.length,f=new Array(3*p),v=0,g=0;p>g;g++){var _=t[g];f[v++]=_.x,f[v++]=_.y,f[v++]=_.z}d=new c({attributes:{position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:C.TRIANGLES})}else d=y.computeSubdivision(t,l,r);return new m({geometry:d})}function A(e,t,r,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(r,a),m=b(d,r,s,N),p=G;p.x=m.x,p.y=m.y;var f=t.attributes.position.values,_=f.length,y=e.st?new Float32Array(2*(_/3)):void 0,C=e.normal?new Float32Array(_):void 0,w=e.tangent?new Float32Array(_):void 0,E=e.binormal?new Float32Array(_):void 0,x=0,T=0,A=z,P=F,D=V,M=!0,I=S.fromAxisAngle(d._plane.normal,s,q),O=g.fromQuaternion(I,Y),R=_/2,L=_/3;l&&(_/=2);for(var k=0;_>k;k+=3){var X=n.fromArray(f,k,j);if(e.st){var Z=g.multiplyByVector(O,X,B),J=d.projectPointOntoPlane(Z,H);i.subtract(J,p,J),l&&(y[x+L]=J.x/m.width,y[x+1+L]=J.y/m.height),y[x]=J.x/m.width,y[x+1]=J.y/m.height,x+=2}if(e.normal||e.tangent||e.binormal){var Q=T+1,K=T+2;if(c){if(_>k+3){var $=n.fromArray(f,k+3,U);if(M){var et=n.fromArray(f,k+_,W);n.subtract($,X,$),n.subtract(et,X,et),A=n.normalize(n.cross(et,$,A),A),M=!1}n.equalsEpsilon($,X,v.EPSILON10)&&(M=!0)}(e.tangent||e.binormal)&&(D=a.geodeticSurfaceNormal(X,D),e.tangent&&(P=n.normalize(n.cross(D,A,P),P)))}else A=a.geodeticSurfaceNormal(X,A),(e.tangent||e.binormal)&&(P=n.cross(n.UNIT_Z,A,P),P=n.normalize(g.multiplyByVector(O,P,P),P),e.binormal&&(D=n.normalize(n.cross(A,P,D),D)));e.normal&&(l&&!c?(C[T+R]=-A.x,C[Q+R]=-A.y,C[K+R]=-A.z):(C[T+R]=A.x,C[Q+R]=A.y,C[K+R]=A.z),C[T]=A.x,C[Q]=A.y,C[K]=A.z),e.tangent&&(l&&!c?(w[T+R]=-P.x,w[Q+R]=-P.y,w[K+R]=-P.z):(w[T+R]=P.x,w[Q+R]=P.y,w[K+R]=P.z),w[T]=P.x,w[Q]=P.y,w[K]=P.z),e.binormal&&(l&&(E[T+R]=D.x,E[Q+R]=D.y,E[K+R]=D.z),E[T]=D.x,E[Q]=D.y,E[K]=D.z),T+=3}}e.st&&(t.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:y})),e.normal&&(t.attributes.normal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:C})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:w})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:E}))}return t}function P(e,t,r){var i,a,s,l,u,m,p,g,y,S=[],w=e.length;if(r)for(p=0;w>p;p++)g=e[p],y=e[(p+1)%w],S.push(g.x,g.y,g.z,y.x,y.y,y.z);else for(p=0;w>p;p++)g=e[p],y=e[(p+1)%w],i=_.subdivideLine(g,y,t),i.push(y.x,y.y,y.z),S=S.concat(i);S=S.concat(S),w=S.length;var E=f.createTypedArray(w/3,w-6*e.length);for(a=0,w/=6,p=0;w>p;p++)s=p,l=s+1,g=n.fromArray(S,3*s,U),y=n.fromArray(S,3*l,W),n.equalsEpsilon(g,y,v.EPSILON6)||(u=s+w,m=u+1,E[a++]=s,E[a++]=u,E[a++]=l,E[a++]=l,E[a++]=u,E[a++]=m);return new c({attributes:new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:S})}),indices:E,primitiveType:C.TRIANGLES})}function D(e,t,r,i,n){var a=T(e,t,r,n).geometry,s=a.attributes.position.values,l=a.indices,u=s.concat(s),p=u.length/3,v=f.createTypedArray(p,2*l.length);v.set(l);var g,_=l.length,C=p/2;for(g=0;_>g;g+=3){var S=v[g]+C,w=v[g+1]+C,E=v[g+2]+C;v[g+_]=E,v[g+1+_]=w,v[g+2+_]=S}var b=new c({attributes:new d({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:u})}),indices:v,primitiveType:a.primitiveType}),A={topAndBottom:new m({geometry:b})};A.walls=[];var D=i.outerRing,M=y.computeWindingOrder2D(D);M===x.CLOCKWISE&&(D=D.reverse());var I=P(D,r,n);A.walls.push(new m({geometry:I}));var O=i.holes;for(g=0;gP;P++){var N=O[P];if(N.positions=y.removeDuplicates(N.positions),N.positions.length<3)throw new s("At least three positions are required.");L.push(N.positions);var F=0;a(N.holes)&&(F=N.holes.length);for(var V=0;F>V;V++)b.enqueue(N.holes[V])}S.push({outerRing:I,holes:L});var U=y.eliminateHoles(I,L);x.push(U)}}l=x[0],t=r.fromPoints(l);var W,G=[];if(C){for(P=0;P_;_++){var E=o[_],x=o[(_+1)%S];C.push(E.x,E.y,E.z,x.x,x.y,x.z)}else for(_=0;S>_;_++)C=C.concat(f.subdivideLine(o[_],o[(_+1)%S],r));S=C.length/3;var b=2*S,T=m.createTypedArray(C.length/3,b),A=0;for(_=0;S-1>_;_++)T[A++]=_,T[A++]=_+1;return T[A++]=S-1,T[A++]=0,new h({geometry:new l({attributes:new c({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:new Float64Array(C)})}),indices:T,primitiveType:g.LINES})})}function S(e,t,r,i){var o=v.removeDuplicates(t),a=s.fromPoints(o,e),d=a.projectPointsOntoPlane(o,w),p=v.computeWindingOrder2D(d);p===y.CLOCKWISE&&(d.reverse(),o.reverse());var _,C=[],S=o.length,E=new Array(S);if(E[0]=0,i){var x,b;for(_=0;S-1>_;_++)x=o[_],b=o[(_+1)%S],C.push(x.x,x.y,x.z,b.x,b.y,b.z),E[_+1]=C.length/3;x=o[S-1],b=o[0],C.push(x.x,x.y,x.z,b.x,b.y,b.z)}else{for(_=0;S-1>_;_++)C=C.concat(f.subdivideLine(o[_],o[_+1],r)),E[_+1]=C.length/3;C=C.concat(f.subdivideLine(o[S-1],o[0],r))}S=C.length/3;var T=2*(2*S+E.length),A=m.createTypedArray(C.length/3,T),P=0;for(_=0;S-1>_;_++)A[P++]=_,A[P++]=_+1,A[P++]=_+S,A[P++]=_+1+S;for(A[P++]=S-1,A[P++]=0,A[P++]=S+S-1,A[P++]=S,_=0;_T;T++){var M=A.holes[T];y.push(M.positions);var I=0;t(M.holes)&&(I=M.holes.length);for(var O=0;I>O;O++)w.enqueue(M.holes[O])}y.push(P)}a=y[0],n=r.fromPoints(a);var R,L=[];if(m)for(T=0;To;++o)T+=4*b[o]-4;var P,D,M=new Float64Array(3*T),I=new Float64Array(3*T),O=new Float64Array(3*T),R=new Float32Array(2*T),L=C.st?new Float32Array(2*T):void 0,N=e(S)?new Uint8Array(4*T):void 0,B=0,z=0,F=0,V=0,k=0,U=0,W=x.length;for(u=0;W>u;++u){0===u?(D=f,s.subtract(x[0],x[1],D),s.add(x[0],D,D)):D=x[u-1],s.clone(D,g),s.clone(x[u],v),u===W-1?(D=f,s.subtract(x[W-1],x[W-2],D),s.add(x[W-1],D,D)):D=x[u+1],s.clone(D,_),P=b[k],u===U+P&&(U+=P,++k);var G,H,j=0===u-U,q=u===U+b[k]-1,Y=j?2:0,X=q?2:4;if(e(N)){var Z=u-k;G=j||w?S[Z]:S[Z-1],q||(H=S[Z])}for(p=Y;X>p;++p){s.pack(v,M,B),s.pack(g,I,B),s.pack(_,O,B),B+=3;var J=0>p-2?-1:1;if(R[z++]=2*(p%2)-1,R[z++]=J*y,C.st&&(L[F++]=u/(W-1),L[F++]=Math.max(R[z-2],0)),e(N)){var Q=2>p?G:H;N[V++]=m.floatToByte(Q.red),N[V++]=m.floatToByte(Q.green),N[V++]=m.floatToByte(Q.blue),N[V++]=m.floatToByte(Q.alpha)}}}var K=new d;K.position=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:M}),K.prevPosition=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:I}),K.nextPosition=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:O}),K.expandAndWidth=new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:R}),C.st&&(K.st=new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:L})),e(N)&&(K.color=new h({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:N,normalize:!0})),A=b.length;var $=i.createTypedArray(T,6*x.length-6*A),et=0,tt=0;for(o=0;A>o;++o)for(P=b[o]-1,u=0;P>u;++u)$[tt++]=et,$[tt++]=et+2,$[tt++]=et+1,$[tt++]=et+1,$[tt++]=et+2,$[tt++]=et+3,et+=4;return new c({attributes:K,indices:$,primitiveType:n.TRIANGLES,boundingSphere:a.fromPoints(x)})},p}),r("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";function y(e,i,n,o){var a=new c;o.position&&(a.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:e}));var s,m,f,g,_,y,C=i.length,S=e.length/3,w=(S-2*C)/(2*C),E=p.triangulate(i),x=6*(w-1)*C+2*E.length,b=d.createTypedArray(S,x),T=2*C,A=0;for(s=0;w-1>s;s++){for(m=0;C-1>m;m++)f=2*m+2*s*C,y=f+T,g=f+1,_=g+T,b[A++]=g,b[A++]=f,b[A++]=_,b[A++]=_,b[A++]=f,b[A++]=y;f=2*C-2+2*s*C,g=f+1,_=g+T,y=f+T,b[A++]=g,b[A++]=f,b[A++]=_,b[A++]=_,b[A++]=f,b[A++]=y}if(o.st||o.tangent||o.binormal){var P,D,M=new Float32Array(2*S),I=1/(w-1),O=1/n.height,R=n.height/2,L=0;for(s=0;w>s;s++){for(P=s*I,D=O*(i[0].y+R),M[L++]=P,M[L++]=D,m=1;C>m;m++)D=O*(i[m].y+R),M[L++]=P,M[L++]=D,M[L++]=P,M[L++]=D;D=O*(i[0].y+R),M[L++]=P,M[L++]=D}for(m=0;C>m;m++)P=0,D=O*(i[m].y+R),M[L++]=P,M[L++]=D;for(m=0;C>m;m++)P=(w-1)*I,D=O*(i[m].y+R),M[L++]=P,M[L++]=D;a.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var N=S-2*C;for(s=0;sa;a++)v[g++]=a+_,v[g++]=a+_+1;for(v[g++]=s-1+_,v[g++]=_,o=p-1,_=o*s,a=0;s-1>a;a++)v[g++]=a+_,v[g++]=a+_+1;for(v[g++]=s-1+_,v[g++]=_,o=0;p-1>o;o++){var y=s*o,C=y+s;for(a=0;s>a;a++)v[g++]=a+y,v[g++]=a+C}var S=new l({attributes:n,indices:h.createTypedArray(d,v),boundingSphere:t.fromVertices(e),primitiveType:f.LINES});return S}var _=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=n(e.ellipsoid,s.WGS84),this._cornerType=n(e.cornerType,i.ROUNDED),this._granularity=n(e.granularity,d.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry"},y=new e;return _.createGeometry=function(t){var r=t._positions,i=p.removeDuplicatesFromPositions(r,t._ellipsoid),n=t._shape;n=p.removeDuplicatesFromShape(n),m.computeWindingOrder2D(n).value===v.CLOCKWISE.value&&n.reverse();var o=e.fromPoints(n,y),a=p.computePositions(i,n,o,t,!1);return g(a,n)},_}),r("Core/QuaternionSpline",["./defaultValue","./defined","./DeveloperError","./Spline","./Quaternion"],function(e,t,r,i,n){"use strict";function o(e,r,i){var o=e.length,a=new Array(o);a[0]=t(r)?r:e[0],a[o-1]=t(i)?i:e[o-1];for(var s=1;o-1>s;++s)a[s]=n.innerQuadrangle(e[s-1],e[s],e[s+1]);return a}function a(e){var t=e.points,r=e.innerQuadrangles,i=e.times;if(t.length<3){var o=i[0],a=1/(i[1]-o),s=t[0],l=t[1];return function(e,t){var r=(e-o)*a;return n.fastSlerp(s,l,r,t)}}return function(o,a){var s=e._lastTimeIndex=e.findTimeInterval(o,e._lastTimeIndex),l=(o-i[s])/(i[s+1]-i[s]),u=t[s],c=t[s+1],h=r[s],d=r[s+1];return n.fastSquad(u,c,h,d,l,a)}}var s=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.points,i=t.times,n=t.firstInnerQuadrangle,s=t.lastInnerQuadrangle,l=o(r,n,s);this.times=i,this.points=r,this.innerQuadrangles=l,this._evaluateFunction=a(this),this._lastTimeIndex=0};return s.prototype.findTimeInterval=i.prototype.findTimeInterval,s.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},s}),r("Core/ReferenceFrame",["./Enumeration"],function(e){"use strict";var t={FIXED:new e(0,"FIXED"),INERTIAL:new e(1,"INERTIAL")};return t}),r("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function r(){return!0}var i=function(i,n){function o(){throw new t(n)}n=e(n,"This object was destroyed, i.e., destroy() was called.");for(var a in i)"function"==typeof i[a]&&(i[a]=o);return i.isDestroyed=r,void 0};return i}),r("Core/ScreenSpaceEventType",["./Enumeration"],function(e){"use strict";var t={LEFT_DOWN:new e(0,"LEFT_DOWN"),LEFT_UP:new e(1,"LEFT_UP"),LEFT_CLICK:new e(2,"LEFT_CLICK"),LEFT_DOUBLE_CLICK:new e(3,"LEFT_DOUBLE_CLICK"),RIGHT_DOWN:new e(5,"RIGHT_DOWN"),RIGHT_UP:new e(6,"RIGHT_UP"),RIGHT_CLICK:new e(7,"RIGHT_CLICK"),RIGHT_DOUBLE_CLICK:new e(8,"RIGHT_DOUBLE_CLICK"),MIDDLE_DOWN:new e(10,"MIDDLE_DOWN"),MIDDLE_UP:new e(11,"MIDDLE_UP"),MIDDLE_CLICK:new e(12,"MIDDLE_CLICK"),MIDDLE_DOUBLE_CLICK:new e(13,"MIDDLE_DOUBLE_CLICK"),MOUSE_MOVE:new e(15,"MOUSE_MOVE"),WHEEL:new e(16,"WHEEL"),PINCH_START:new e(17,"PINCH_START"),PINCH_END:new e(18,"PINCH_END"),PINCH_MOVE:new e(19,"PINCH_MOVE")};return t}),r("Core/ScreenSpaceEventHandler",["./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./ScreenSpaceEventType","./KeyboardEventModifier"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){if(e._element===document)return r.x=t.clientX,r.y=t.clientY,r;var i=e._element.getBoundingClientRect();return r.x=t.clientX-i.left,r.y=t.clientY-i.top,r}function l(e,t){var i=e.name;return r(t)&&(i+="+"+t.name),i}function u(e){return e.shiftKey?a.SHIFT:e.ctrlKey?a.CTRL:e.altKey?a.ALT:void 0}function c(e,t){var i=s(e,t,C.position);if(e._lastMousePosition.x=i.x,e._lastMousePosition.y=i.y,e._totalPixels=0,!e._seenAnyTouchEvents){var n,a=u(t);0===t.button?(e._leftMouseButtonDown=!0,n=e.getInputAction(o.LEFT_DOWN,a)):1===t.button?(e._middleMouseButtonDown=!0,n=e.getInputAction(o.MIDDLE_DOWN,a)):2===t.button&&(e._rightMouseButtonDown=!0,n=e.getInputAction(o.RIGHT_DOWN,a)),r(n)&&n(C),t.preventDefault()}}function h(e,t){var i,n,a=u(t);if(!e._seenAnyTouchEvents){0===t.button?(e._leftMouseButtonDown=!1,i=e.getInputAction(o.LEFT_UP,a),n=e.getInputAction(o.LEFT_CLICK,a)):1===t.button?(e._middleMouseButtonDown=!1,i=e.getInputAction(o.MIDDLE_UP,a),n=e.getInputAction(o.MIDDLE_CLICK,a)):2===t.button&&(e._rightMouseButtonDown=!1,i=e.getInputAction(o.RIGHT_UP,a),n=e.getInputAction(o.RIGHT_CLICK,a));var l=s(e,t,S.position),c=e._lastMousePosition.x-l.x,h=e._lastMousePosition.y-l.y;e._totalPixels+=Math.sqrt(c*c+h*h),r(i)&&i(S),r(n)&&e._totalPixels0)){var h=s(e,t.changedTouches[0],b.position),d=e._lastMousePosition.x-h.x,p=e._lastMousePosition.y-h.y;e._totalPixels+=Math.sqrt(d*d+p*p),r(i)&&i(b),r(n)&&e._totalPixelsP;P++,p+=v,++_){S=v>0?m[p]+f:f-m[p],E=S+d,x=-Math.cos(E),T=o.multiplyByScalar(c,x),x=Math.sin(E),A=o.multiplyByScalar(h,x),T=o.add(T,A,T),x=Math.cos(S),x*=x,b=Math.sin(S),b*=b,w=n/Math.sqrt(i*x+r*b),C=w/t,x=Math.sin(C/2);var D=a.normalize(new a(T.x*x,T.y*x,T.z*x,Math.cos(C/2))),M=s.fromQuaternion(D),I=s.multiplyByVector(M,u),O=o.normalize(I);I=o.multiplyByScalar(O,t),g[_]=I}}var u={computeCircleBoundary:function(t,r,n,o){return o=e(o,i.RADIANS_PER_DEGREE),this.computeEllipseBoundary(t,r,n,n,0,o)
+},computeEllipseBoundary:function(t,r,n,a,s,u){if(s=e(s,0),u=e(u,i.RADIANS_PER_DEGREE),a>n){var c=n;n=a,a=c}for(var h=2.31,d=n*n,m=a*a,p=n*a,f=1-m/d,v=Math.sqrt(f),g=o.clone(r),_=o.magnitude(g),y=new o(0,0,1),C=1/_,S=o.multiplyByScalar(g,C),w=o.normalize(o.cross(y,g)),E=o.cross(S,w),x=1+Math.ceil(i.PI_OVER_TWO/u),b=h/(x-1),T=[],A=0,P=0,D=0;x>D;D++,P+=b,++A)if(T[A]=P-v*Math.sin(P),T[A]>=i.PI_OVER_TWO){T[A]=i.PI_OVER_TWO,x=D+1;break}var M=[];return l(t,_,d,m,p,v,S,w,E,s,T,0,0,1,M,0,x-1),l(t,_,d,m,p,v,S,w,E,s,T,x-1,Math.PI,-1,M,x-1,x-1),l(t,_,d,m,p,v,S,w,E,s,T,0,Math.PI,1,M,2*x-2,x-1),l(t,_,d,m,p,v,S,w,E,s,T,x-1,i.TWO_PI,-1,M,3*x-3,x),M.push(o.clone(M[0])),M},compute2DCircle:function(t,r){t=e(t,1),r=e(r,2*i.RADIANS_PER_DEGREE);for(var o=[],a=i.toRadians(1),s=2*Math.PI/a,l=0;s>l;l++)o.push(new n(t*Math.cos(a*l),t*Math.sin(a*l)));return o}};return u}),r("Core/ShowGeometryInstanceAttribute",["./defaultValue","./defined","./ComponentDatatype","./DeveloperError"],function(e,t,r){"use strict";var i=function(t){t=e(t,!0),this.componentDatatype=r.UNSIGNED_BYTE,this.componentsPerAttribute=1,this.normalize=!0,this.value=i.toValue(t)};return i.toValue=function(e,r){return t(r)?(r[0]=e,r):new Uint8Array([e])},i}),r("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=e.addSeconds(C,t);var r=t.getTotalDays()-S;return t=t.addSeconds(l(r),t)}function c(i,a,s,l,u,c,m,p){if(0>s&&(s=-s,u+=n.PI),0>s||s>n.PI)throw new r("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var v=i*(1-a),g=l-u,_=u,y=d(c-l,a),C=h(a,0);if("Hyperbolic"===C&&Math.abs(n.NegativePiToPi(y))>=Math.acos(-1/a))throw new r("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");f(g,s,_,D);var S=v*(1+a),w=Math.cos(y),E=Math.sin(y),x=1+a*w;if(x<=n.Epsilon10)throw new r("elements cannot be converted to cartesian");var b=S/x;return t(p)?(p.x=b*w,p.y=b*E,p.z=0):p=new e(b*w,b*E,0),o.multiplyByVector(D,p,p)}function h(e,t){if(0>e)throw new r("eccentricity cannot be negative.");return t>=e?"Circular":1-t>e?"Elliptical":1+t>=e?"Parabolic":"Hyperbolic"}function d(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=m(e,t);return p(i,t)}function m(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;M>o&&Math.abs(s-a)>I;++o){s=a;var l=s-t*Math.sin(s)-e,u=1-t*Math.cos(s);a=s-l/u}if(o>=M)throw new r("Kepler equation did not converge");return s=a+i*n.TWO_PI}function p(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o=Math.cos(e)-t,a=Math.sin(e)*Math.sqrt(1-t*t),s=Math.atan2(a,o);return s=n.zeroToTwoPi(s),0>e&&(s-=n.TWO_PI),s+=i*n.TWO_PI}function f(e,i,a,s){if(0>i||i>n.PI)throw new r("inclination out of range");var l=Math.cos(e),u=Math.sin(e),c=Math.cos(i),h=Math.sin(i),d=Math.cos(a),m=Math.sin(a);return t(s)?(s[0]=d*l-m*u*c,s[1]=m*l+d*u*c,s[2]=u*h,s[3]=-d*u-m*l*c,s[4]=-m*u+d*l*c,s[5]=l*h,s[6]=m*h,s[7]=-d*h,s[8]=c):s=new o(d*l-m*u*c,-d*u-m*l*c,m*h,m*l+d*u*c,-m*u+d*l*c,-d*h,u*h,l*h,c),s}function v(e,t){u(e,Dt);var r=Dt.getJulianDayNumber()-w.getJulianDayNumber()+(Dt.getSecondsOfDay()-w.getSecondsOfDay())/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=O+G*Math.cos(N*n)+Q*Math.sin(N*n)+H*Math.cos(B*n)+K*Math.sin(B*n)+j*Math.cos(z*n)+$*Math.sin(z*n)+q*Math.cos(F*n)+et*Math.sin(F*n)+Y*Math.cos(V*n)+tt*Math.sin(V*n)+X*Math.cos(k*n)+rt*Math.sin(k*n)+Z*Math.cos(U*n)+it*Math.sin(U*n)+J*Math.cos(W*n)+nt*Math.sin(W*n),s=R+L*i+mt*Math.cos(ot*n)+St*Math.sin(ot*n)+pt*Math.cos(at*n)+wt*Math.sin(at*n)+ft*Math.cos(st*n)+Et*Math.sin(st*n)+vt*Math.cos(lt*n)+xt*Math.sin(lt*n)+gt*Math.cos(ut*n)+bt*Math.sin(ut*n)+_t*Math.cos(ct*n)+Tt*Math.sin(ct*n)+yt*Math.cos(ht*n)+At*Math.sin(ht*n)+Ct*Math.cos(dt*n)+Pt*Math.sin(dt*n),l=.0167086342-.0004203654*i,h=102.93734808*T+11612.3529*A*i,d=469.97289*A*i,m=174.87317577*T-8679.27034*A*i;return c(o,l,d,h,m,s,x,t)}function g(e,t){u(e,Dt);var r=Dt.getJulianDayNumber()-w.getJulianDayNumber()+(Dt.getSecondsOfDay()-w.getSecondsOfDay())/a.SECONDS_PER_DAY,i=r/a.DAYS_PER_JULIAN_CENTURY,n=i*i,o=n*i,s=o*i,l=383397.7725+.004*i,h=.055545526-1.6e-8*i,d=5.15668983*T,m=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,p=83.35324312*T,f=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,v=125.04455501*T,g=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*T,y=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,C=297.85019547*T+A*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),S=93.27209062*T+A*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),x=134.96340251*T+A*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),P=357.52910918*T+A*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),D=310.17137918*T-A*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),M=2*C,I=4*C,O=6*C,R=2*x,L=3*x,N=4*x,B=2*S;l+=3400.4*Math.cos(M)-635.6*Math.cos(M-x)-235.6*Math.cos(x)+218.1*Math.cos(M-P)+181*Math.cos(M+x),h+=.014216*Math.cos(M-x)+.008551*Math.cos(M-R)-.001383*Math.cos(x)+.001356*Math.cos(M+x)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-R)+869e-6*Math.cos(M-P-x)-627e-6*Math.cos(M)-394e-6*Math.cos(I-N)+282e-6*Math.cos(M-P-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(I)+229e-6*Math.cos(O-N)-201e-6*Math.cos(R-B),m+=486.26*Math.cos(M-B)-40.13*Math.cos(M)+37.51*Math.cos(B)+25.73*Math.cos(R-B)+19.97*Math.cos(M-P-B),f+=-55609*Math.sin(M-x)-34711*Math.sin(M-R)-9792*Math.sin(x)+9385*Math.sin(I-L)+7505*Math.sin(I-R)+5318*Math.sin(M+x)+3484*Math.sin(I-N)-3417*Math.sin(M-P-x)-2530*Math.sin(O-N)-2376*Math.sin(M)-2075*Math.sin(M-L)-1883*Math.sin(R)-1736*Math.sin(O-5*x)+1626*Math.sin(P)-1370*Math.sin(O-L),g+=-5392*Math.sin(M-B)-540*Math.sin(P)-441*Math.sin(M)+423*Math.sin(B)-288*Math.sin(R-B),y+=-3332.9*Math.sin(M)+1197.4*Math.sin(M-x)-662.5*Math.sin(P)+396.3*Math.sin(x)-218*Math.sin(M-P);var z=2*D,F=3*D;m+=46.997*Math.cos(D)*i-.614*Math.cos(M-B+D)*i+.614*Math.cos(M-B-D)*i-.0297*Math.cos(z)*n-.0335*Math.cos(D)*n+.0012*Math.cos(M-B+z)*n-16e-5*Math.cos(D)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(z)*o;var V=2.116*Math.sin(D)*i-.111*Math.sin(M-B-D)*i-.0015*Math.sin(D)*n;f+=V,y+=V,g+=-520.77*Math.sin(D)*i+13.66*Math.sin(M-B+D)*i+1.12*Math.sin(M-D)*i-1.06*Math.sin(B-D)*i+.66*Math.sin(z)*n+.371*Math.sin(D)*n-.035*Math.sin(M-B+z)*n-.015*Math.sin(M-B+D)*n+.0014*Math.sin(D)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(z)*o,l*=b;var k=d+m*A,U=p+f*A,W=_+y*A,G=v+g*A;return c(l,h,k,U,G,W,E,t)}function _(t,r){return r=g(t,r),e.multiplyByScalar(r,It,r)}var y={},C=32.184,S=2451545,w=i.fromTotalDays(2451545,s.TAI),E=398600435e6,x=328900.56*1.012300034*E,b=1e3,T=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,P=14959787e4,D=new o,M=50,I=n.EPSILON8,O=1.0000010178*P,R=100.46645683*T,L=1295977422.83429*A,N=16002,B=21863,z=32004,F=10931,V=14529,k=16368,U=15318,W=32794,G=64e-7*P,H=-152*1e-7*P,j=62e-7*P,q=-8e-7*P,Y=32e-7*P,X=-41*1e-7*P,Z=19e-7*P,J=-11*1e-7*P,Q=-150*1e-7*P,K=-46*1e-7*P,$=68*1e-7*P,et=54e-7*P,tt=14e-7*P,rt=24e-7*P,it=-28*1e-7*P,nt=22e-7*P,ot=10,at=16002,st=21863,lt=10931,ut=1473,ct=32004,ht=4387,dt=73,mt=-325*1e-7,pt=-322*1e-7,ft=-79*1e-7,vt=232*1e-7,gt=-52*1e-7,_t=97e-7,yt=55e-7,Ct=-41*1e-7,St=-105*1e-7,wt=-137*1e-7,Et=258e-7,xt=35e-7,bt=-116*1e-7,Tt=-88*1e-7,At=-112*1e-7,Pt=-80*1e-7,Dt=new i,Mt=.012300034,It=-1*(Mt/(Mt+1)),Ot=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Rt=new e;return y.ComputeSunPositionInEarthInertialFrame=function(r,n){return t(r)||(r=new i),Rt=v(r,Rt),n=e.negate(Rt,n),_(r,Rt),e.subtract(n,Rt,n),o.multiplyByVector(Ot,n,n),n},y.ComputeMoonPositionInEarthInertialFrame=function(e,r){return t(e)||(e=new i),r=g(e,r),o.multiplyByVector(Ot,r,r),r},y}),r("Core/SimplePolylineGeometry",["./defined","./DeveloperError","./ComponentDatatype","./IndexDatatype","./PrimitiveType","./defaultValue","./BoundingSphere","./Geometry","./GeometryAttribute","./GeometryAttributes","./Color","./Cartesian3"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.colors,i=o(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._perVertex=i,this._workerName="createSimplePolylineGeometry"};return d.createGeometry=function(t){var o,d=t._positions,m=t._colors,p=t._perVertex,f=e(m)&&!p,v=0,g=0,_=d.length,y=f?2*d.length-2:d.length,C=new Float64Array(3*y),S=e(m)?new Uint8Array(4*y):void 0;for(o=0;_>o;++o){var w,E=d[o];if(f&&o>0&&(h.pack(E,C,v),v+=3,w=m[o-1],S[g++]=c.floatToByte(w.red),S[g++]=c.floatToByte(w.green),S[g++]=c.floatToByte(w.blue),S[g++]=c.floatToByte(w.alpha)),f&&o===_-1)break;h.pack(E,C,v),v+=3,e(m)&&(w=m[o],S[g++]=c.floatToByte(w.red),S[g++]=c.floatToByte(w.green),S[g++]=c.floatToByte(w.blue),S[g++]=c.floatToByte(w.alpha))}var x=new u;x.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}),e(m)&&(x.color=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));var b=f?y:2*(y-1),T=i.createTypedArray(y,b),A=f?2:1;for(v=0,o=0;y-1>o;o+=A)T[v++]=o,T[v++]=o+1;return new s({attributes:x,indices:T,primitiveType:n.LINES,boundingSphere:a.fromPoints(d)})},d}),r("Core/SphereGeometry",["./defaultValue","./Cartesian3","./EllipsoidGeometry"],function(e,t,r){"use strict";var i=function(i){var n=e(i.radius,1),o=new t(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new r(a),this._workerName="createSphereGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/SphereOutlineGeometry",["./defaultValue","./Cartesian3","./EllipsoidOutlineGeometry"],function(e,t,r){"use strict";var i=function(i){var n=e(i.radius,1),o=new t(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new r(a),this._workerName="createSphereOutlineGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/Spherical",["./DeveloperError","./defaultValue","./defined"],function(e,t,r){"use strict";var i=function(e,r,i){this.clock=t(e,0),this.cone=t(r,0),this.magnitude=t(i,1)};return i.fromCartesian3=function(e,t){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return r(t)||(t=new i),t.clock=Math.atan2(o,n),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},i.clone=function(e,t){return r(e)?r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new i(e.clock,e.cone,e.magnitude):void 0},i.normalize=function(e,t){return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new i(e.clock,e.cone,1)},i.equals=function(e,t){return e===t||r(e)&&r(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},i.equalsEpsilon=function(e,i,n){return n=t(n,0),e===i||r(e)&&r(i)&&Math.abs(e.clock-i.clock)<=n&&Math.abs(e.cone-i.cone)<=n&&Math.abs(e.magnitude-i.magnitude)<=n},i.toString=function(e){return"("+e.clock+", "+e.cone+", "+e.magnitude+")"},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.normalize=function(e){return i.normalize(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return i.toString(this)},i}),r("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";var t,r=function(r){e(t)||(t=document.createElement("a")),t.href=window.location.href;var i=t.host,n=t.protocol;return t.href=r,t.href=t.href,n!==t.protocol||i!==t.host};return r}),r("Core/TaskProcessor",["require","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./isCrossOriginUrl","../ThirdParty/when","../ThirdParty/Uri"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){--e._activeTasks;var r=t.data,n=r.id;if(i(n)){var o=e._deferreds,a=o[n];i(r.error)?a.reject(r.error):a.resolve(r.result),delete o[n]}}function u(){if(i(h))return h;if(h=t("Workers/cesiumWorkerBootstrapper.js"),o(h)){var e,r='importScripts("'+h+'");';try{e=new Blob([r],{type:"application/javascript"})}catch(n){var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new a;s.append(r),e=s.getBlob("application/javascript")}var l=window.URL||window.webkitURL;h=l.createObjectURL(e)}return h}function c(n){var o=u(),a=new Worker(o);a.postMessage=r(a.webkitPostMessage,a.postMessage);var c={loaderConfig:{},workerModule:d._workerModulePrefix+n._workerName};if(i(d._loaderConfig))c.loaderConfig=d._loaderConfig;else if(i(e.toUrl)){var h=new s("..").resolve(new s(t("Workers/cesiumWorkerBootstrapper.js"))).toString();c.loaderConfig.baseUrl=h}else c.loaderConfig.paths={Workers:t("Workers")};a.postMessage(c),a.onmessage=function(e){l(n,e)},n._worker=a}var h,d=function(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0},m=[];return d.prototype.scheduleTask=function(e,t){if(i(this._worker)||c(this),this._activeTasks>=this._maximumActiveTasks)return void 0;++this._activeTasks,i(t)||(t=m);var r=this._nextID++,n=a.defer();return this._deferreds[r]=n,this._worker.postMessage({id:r,parameters:e},t),n.promise},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return i(this._worker)&&this._worker.terminate(),n(this)},d._defaultWorkerModulePrefix="Workers/",d._workerModulePrefix=d._defaultWorkerModulePrefix,d._loaderConfig=void 0,d}),r("Core/TimeIntervalCollection",["./defined","./defineProperties","./DeveloperError","./Event","./binarySearch","./TimeInterval","./JulianDate"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){return a.compare(e.start,t.start)}function l(t,r,i,n){for(var o=0,a=0,s=new u,l=t._intervals,c=r._intervals;oa;a++)if(!o.equals(r[a],i[a],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.clear=function(){this._intervals.length>0&&(this._intervals.length=0,this._intervalsChanged.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0},u.prototype.indexOf=function(e){var t=this._intervals,r=n(t,new o(e,e,!0,!0),s);return r>=0?t[r].isStartIncluded?r:r>0&&t[r-1].stop.equals(e)&&t[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-1s;s++)if(o=a[s],!(e(t)&&!o.start.equals(t)||e(r)&&!o.stop.equals(r)||e(i)&&o.isStartIncluded!==i||e(n)&&o.isStopIncluded!==n))return a[s];return void 0},u.prototype.addInterval=function(t,r){if(!t.isEmpty){var i,l,u=this._intervals;if(0===u.length||t.start.greaterThan(u[u.length-1].stop))return u.push(t),this._intervalsChanged.raiseEvent(this),void 0;for(l=n(u,t,s),0>l?l=~l:l>0&&t.isStartIncluded&&u[l-1].isStartIncluded&&u[l-1].start.equals(t.start)?--l:l0&&(i=a.compare(u[l-1].stop,t.start),(i>0||0===i&&(u[l-1].isStopIncluded||t.isStartIncluded))&&((e(r)?r(u[l-1].data,t.data):u[l-1].data===t.data)?(t=t.stop.greaterThan(u[l-1].stop)?new o(u[l-1].start,t.stop,u[l-1].isStartIncluded,t.isStopIncluded,t.data):new o(u[l-1].start,u[l-1].stop,u[l-1].isStartIncluded,u[l-1].isStopIncluded||t.stop.equals(u[l-1].stop)&&t.isStopIncluded,t.data),u.splice(l-1,1),--l):(i=a.compare(u[l-1].stop,t.stop),i>0||0===i&&u[l-1].isStopIncluded&&!t.isStopIncluded?u.splice(l-1,1,new o(u[l-1].start,t.start,u[l-1].isStartIncluded,!t.isStartIncluded,u[l-1].data),new o(t.stop,u[l-1].stop,!t.isStopIncluded,u[l-1].isStopIncluded,u[l-1].data)):u[l-1]=new o(u[l-1].start,t.start,u[l-1].isStartIncluded,!t.isStartIncluded,u[l-1].data))));l0||0===i&&(t.isStopIncluded||u[l].isStartIncluded));)if(e(r)?r(u[l].data,t.data):u[l].data===t.data)t=new o(t.start,u[l].stop.greaterThan(t.stop)?u[l].stop:t.stop,t.isStartIncluded,u[l].stop.greaterThan(t.stop)?u[l].isStopIncluded:t.isStopIncluded,t.data),u.splice(l,1);else{if(u[l]=new o(t.stop,u[l].stop,!t.isStopIncluded,u[l].isStopIncluded,u[l].data),!u[l].isEmpty)break;u.splice(l,1)}u.splice(l,0,t),this._intervalsChanged.raiseEvent(this)}},u.prototype.removeInterval=function(e){if(e.isEmpty)return!1;var t=!1,r=this._intervals,i=n(r,e,s);0>i&&(i=~i);var a=e.start,l=e.stop,u=e.isStartIncluded,c=e.isStopIncluded;if(i>0){var h=r[i-1],d=h.stop;(d.greaterThan(a)||d.equals(a)&&h.isStopIncluded&&u)&&(t=!0,(d.greaterThan(l)||h.isStopIncluded&&!c&&d.equals(l))&&r.splice(i,0,new o(l,d,!c,h.isStopIncluded,h.data)),r[i-1]=new o(h.start,a,h.isStartIncluded,!u,h.data))}var m=r[i];for(ia;a++)u[a]=i;return u}var c=n-i,h=c/l;for(a=1;l>a;a++){var d=i+a*h;u[a]=d}return u[0]=i,u}function c(e,t){return s.equalsEpsilon(e.latitude,t.latitude,s.EPSILON14)&&s.equalsEpsilon(e.longitude,t.longitude,s.EPSILON14)}function h(r,i,n,o){var a=e(o),s=e(n),l=[],u=[],h=a?[]:void 0,d=i.length;if(2>d)return{positions:i};var f=i[0];l.push(f);var v=r.cartesianToCartographic(f,m);s&&(v.height=n[0]),u.push(v.height),a&&h.push(o[0]);for(var g=1;d>g;++g){var _=i[g],y=r.cartesianToCartographic(_,p);s&&(y.height=n[g]),c(v,y)?v.height=3){var f=n.fromPoints(r,t),v=f.projectPointsOntoPlane(r);o.computeWindingOrder2D(v)===l.CLOCKWISE&&(r.reverse(),i.reverse(),p&&s.reverse())}var g,_=r.length,y=[],C=p?[]:void 0,S=[];for(g=0;_-1>g;g++){var w=r[g],E=r[g+1],x=i[g],b=i[g+1];y=y.concat(u(w,E,x,b,c)),d&&y.push(b),p&&(w=r[g],E=r[g+1],x=s[g],b=s[g+1],C=C.concat(u(w,E,x,b,c)),d&&C.push(b)),d&&(S=S.concat(a.scaleToSurface([w,E],c,t)))}d||(S=a.scaleToSurface(r,c,t),y.push(i[_-1]),p&&C.push(s[_-1]));var T=p?a.scaleToGeodeticHeight(S,C,t):S.slice(0),A=a.scaleToGeodeticHeight(S,y,t);return{newWallPositions:S,bottomPositions:T,topPositions:A}},d}),r("Core/WallGeometry",["./defaultValue","./defined","./BoundingSphere","./Cartesian3","./ComponentDatatype","./IndexDatatype","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new i,v=new i,g=new i,_=new i,y=new i,C=new i,S=new i,w=new i,E=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.positions,i=t.maximumHeights,n=t.minimumHeights,o=e(t.vertexFormat,m.DEFAULT),a=e(t.granularity,h.RADIANS_PER_DEGREE),l=e(t.ellipsoid,s.WGS84);this._positions=r,this._minimumHeights=n,this._maximumHeights=i,this._vertexFormat=o,this._granularity=a,this._ellipsoid=l,this._workerName="createWallGeometry"};return E.fromConstantHeights=function(r){r=e(r,e.EMPTY_OBJECT);var i,n,o=r.positions,a=r.minimumHeight,s=r.maximumHeight,l=t(a),u=t(s);if(l||u){var c=o.length;i=l?new Array(c):void 0,n=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(i[h]=a),u&&(n[h]=s)}var d={positions:o,maximumHeights:n,minimumHeights:i,ellipsoid:r.ellipsoid,vertexFormat:r.vertexFormat};return new E(d)},E.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,s=e._maximumHeights,m=e._vertexFormat,E=e._granularity,x=e._ellipsoid,b=p.computePositions(x,t,s,a,E,!0),T=b.newWallPositions,A=b.bottomPositions,P=b.topPositions,D=T.length,M=2*D,I=m.position?new Float64Array(M):void 0,O=m.normal?new Float32Array(M):void 0,R=m.tangent?new Float32Array(M):void 0,L=m.binormal?new Float32Array(M):void 0,N=m.st?new Float32Array(2*(M/3)):void 0,B=0,z=0,F=0,V=0,k=0,U=w,W=S,G=C,H=!0;D/=3;var j;for(j=0;D>j;++j){var q=3*j,Y=i.fromArray(P,q,f),X=i.fromArray(A,q,v);if(m.position&&(I[B++]=X.x,I[B++]=X.y,I[B++]=X.z,I[B++]=Y.x,I[B++]=Y.y,I[B++]=Y.z),m.normal||m.tangent||m.binormal){var Z,J=new i,Q=i.fromArray(T,q,v);if(D>j+1&&(Z=i.fromArray(T,q+3,g),J=i.fromArray(P,q+3,y)),H){var K=i.subtract(J,Y,_),$=i.subtract(Q,Y,f);U=i.normalize(i.cross($,K,U),U),H=!1}i.equalsEpsilon(Z,Q,h.EPSILON6)?H=!0:(m.tangent&&(W=i.normalize(i.subtract(Z,Q,W),W)),m.binormal&&(G=i.normalize(i.cross(U,W,G),G))),m.normal&&(O[z++]=U.x,O[z++]=U.y,O[z++]=U.z,O[z++]=U.x,O[z++]=U.y,O[z++]=U.z),m.tangent&&(R[V++]=W.x,R[V++]=W.y,R[V++]=W.z,R[V++]=W.x,R[V++]=W.y,R[V++]=W.z),m.binormal&&(L[F++]=G.x,L[F++]=G.y,L[F++]=G.z,L[F++]=G.x,L[F++]=G.y,L[F++]=G.z)}if(m.st){var et=j/(D-1);N[k++]=et,N[k++]=0,N[k++]=et,N[k++]=1}}var tt=new c;m.position&&(tt.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:I})),m.normal&&(tt.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:O})),m.tangent&&(tt.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:R})),m.binormal&&(tt.binormal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(tt.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:N}));var rt=M/3;M-=6;var it=o.createTypedArray(rt,M),nt=0;for(j=0;rt-2>j;j+=2){var ot=j,at=j+2,st=i.fromArray(I,3*ot,f),lt=i.fromArray(I,3*at,v);if(!i.equalsEpsilon(st,lt,h.EPSILON6)){var ut=j+1,ct=j+3;it[nt++]=ut,it[nt++]=ot,it[nt++]=ct,it[nt++]=ct,it[nt++]=ot,it[nt++]=at}}return new l({attributes:tt,indices:it,primitiveType:d.TRIANGLES,boundingSphere:new r.fromVertices(I)})},E}),r("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new t,f=new t,v=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,r=e.maximumHeights,n=e.minimumHeights,o=i(e.granularity,h.RADIANS_PER_DEGREE),s=i(e.ellipsoid,a.WGS84);this._positions=t,this._minimumHeights=n,this._maximumHeights=r,this._granularity=o,this._ellipsoid=s,this._workerName="createWallOutlineGeometry"};return v.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,r=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(r[h]=s)}var d={positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid};return new v(d)},v.createGeometry=function(i){var n=i._positions,o=i._minimumHeights,a=i._maximumHeights,v=i._granularity,g=i._ellipsoid,_=m.computePositions(g,n,a,o,v,!1),y=_.newWallPositions,C=_.bottomPositions,S=_.topPositions,w=y.length,E=2*w,x=new Float64Array(E),b=0;w/=3;var T;for(T=0;w>T;++T){var A=3*T,P=t.fromArray(S,A,p),D=t.fromArray(C,A,f);x[b++]=D.x,x[b++]=D.y,x[b++]=D.z,x[b++]=P.x,x[b++]=P.y,x[b++]=P.z}var M=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x})}),I=E/3;E=2*I-4+I;var O=c.createTypedArray(I,E),R=0;for(T=0;I-2>T;T+=2){var L=T,N=T+2,B=t.fromArray(x,3*L,p),z=t.fromArray(x,3*N,f);if(!t.equalsEpsilon(B,z,h.EPSILON6)){var F=T+1,V=T+3;O[R++]=F,O[R++]=L,O[R++]=F,O[R++]=V,O[R++]=L,O[R++]=N}}return O[R++]=I-2,O[R++]=I-1,new s({attributes:M,indices:O,primitiveType:d.LINES,boundingSphere:new e.fromVertices(x)})},v}),r("Core/WebMercatorProjection",["./defaultValue","./defined","./defineProperties","./Cartesian3","./Cartographic","./Math","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){this._ellipsoid=e(t,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return r(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return o.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(e,r){var n=this._semimajorAxis,o=e.longitude*n,a=s.geodeticLatitudeToMercatorAngle(e.latitude)*n,l=e.height;return t(r)?(r.x=o,r.y=a,r.z=l,r):new i(o,a,l)},s.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,o=e.x*i,a=s.mercatorAngleToGeodeticLatitude(e.y*i),l=e.z;return t(r)?(r.longitude=o,r.latitude=a,r.height=l,r):new n(o,a,l)},s}),r("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";var t=window.cancelAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"CancelAnimationFrame"],e(t)||(t=window[r[i]+"CancelRequestAnimationFrame"]),++i;e(t)||(t=clearTimeout)}();var r=function(e){t(e)};return r}),r("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";var r=function(i,n,o){o=e(o,!1);var a,s,l,u={},c=t(i),h=t(n);if(c)for(a in i)i.hasOwnProperty(a)&&(s=i[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],u[a]="object"==typeof l?r(s,l,o):s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u};return r}),r("Core/createGuid",[],function(){"use strict";var e=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=0|16*Math.random(),r="x"===e?t:8|3&t;return r.toString(16)})};return e}),r("Core/formatError",["./defined"],function(e){"use strict";var t=function(t){var r,i=t.name,n=t.message;r=e(i)&&e(n)?i+": "+n:t.toString();var o=t.stack;return e(o)&&(r+="\n"+o),r};return t}),r("Core/getFilenameFromUri",["./defined","./DeveloperError","../ThirdParty/Uri"],function(e,t,r){"use strict";var i=function(e){var t=new r(e);t.normalize();var i=t.path,n=i.lastIndexOf("/");return-1!==n&&(i=i.substr(n+1)),i};return i}),r("Core/getImagePixels",["./defined"],function(e){"use strict";var t={},r=function(r,i,n){e(i)||(i=r.width),e(n)||(n=r.height);var o=t[i];e(o)||(o={},t[i]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=i,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(r,0,0,i,n),a.getImageData(0,0,i,n).data};return r}),r("Core/jsonp",["./defaultValue","./defined","./DeveloperError","../ThirdParty/when"],function(e,t,r,i){"use strict";function n(e,t,r){e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}var o=function(r,a){a=e(a,e.EMPTY_OBJECT);var s,l=i.defer();do s="jsonp"+Math.random().toString().substring(2,8);while(t(window[s]));window[s]=function(e){l.resolve(e);try{delete window[s]}catch(t){window[s]=void 0}};var u=e(a.callbackParameterName,"callback"),c=[];n(c,u,s);var h=e(a.parameters,e.EMPTY_OBJECT);for(var d in h)h.hasOwnProperty(d)&&n(c,d,h[d]);c.length>0&&(r+=-1===r.indexOf("?")?"?":"&",r+=c.join("&"));var m=a.proxy;return t(m)&&(r=m.getURL(r)),o.loadAndExecuteScript(r,s,l),l.promise};return o.loadAndExecuteScript=function(e,t,r){var i=document.createElement("script");i.async=!0,i.src=e;var n=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,n.removeChild(i)},i.onerror=function(e){r.reject(e)},n.appendChild(i)},o.defaultLoadAndExecuteScript=o.loadAndExecuteScript,o}),r("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"arraybuffer",headers:r})};return t}),r("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"blob",headers:r})};return t}),r("Core/loadImage",["./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","../ThirdParty/when"],function(e,t,r,i,n){"use strict";var o=/^data:/,a=function(t,r){return r=e(r,!0),n(t,function(e){var t;t=o.test(e)||!r?!1:i(e);var s=n.defer();return a.createImage(e,t,s),s.promise})};return a.createImage=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(i)},i.onerror=function(e){r.reject(e)},t&&(i.crossOrigin=""),i.src=e},a.defaultCreateImage=a.createImage,a}),r("Core/loadImageViaBlob",["./loadBlob","./loadImage","../ThirdParty/when"],function(e,t,r){"use strict";var i=/^data:/,n=function(n){return i.test(n)?t(n):e(n).then(function(e){var i=window.URL.createObjectURL(e);return t(i,!1).then(function(t){return t.blob=e,window.URL.revokeObjectURL(i),t},function(e){return window.URL.revokeObjectURL(i),r.reject(e)})})},o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(t){return!1}}();return o?n:t}),r("Core/loadXML",["./defined","./DeveloperError","./RequestErrorEvent","../ThirdParty/when"],function(e,t,r,i){"use strict";var n=function(e,t){return i(e,function(e){var r=i.defer();return n.loadXML(e,t,r),r.promise})};return n.loadXML=function(t,i,n){var o=new XMLHttpRequest;if(o.overrideMimeType("text/xml"),o.open("GET",t,!0),e(i))for(var a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a,i[a]);o.onload=function(){200===o.status?n.resolve(o.responseXML):n.reject(new r(o.status,o.response))},o.onerror=function(){n.reject(new r)},o.send()},n.defaultLoadXML=n.loadXML,n}),r("Core/requestAnimationFrame",["./defined"],function(e){"use strict";var t=window.requestAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"RequestAnimationFrame"],++i;if(!e(t)){var o=0;t=function(e){var t=Date.now(),r=Math.max(16-(t-o),0);return o=t+r,setTimeout(function(){e(o)},r)}}}();var r=function(e){return t(e)};return r}),r("Core/throttleRequestByServer",["./defaultValue","./defined","../ThirdParty/when"],function(e,t,r){"use strict";function i(e){return t(o)||(o=document.createElement("a")),o.href=e,o.hostname+"%"+o.port
+}function n(t,n){var o=i(t),l=e(s[o],0);return l>a?void 0:(s[o]=l+1,r(n(t),function(e){return s[o]--,e},function(e){return s[o]--,r.reject(e)}))}var o,a=6,s={};return n}),r("Core/wrapFunction",["./DeveloperError"],function(){"use strict";var e=function(e,t,r){return function(){r.apply(e,arguments),t.apply(e,arguments)}};return e}),r("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,r,i,n){var o=t.measureText(r),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=!/\S/.test(r);o.fontsize=s;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+"px "+a,u.innerHTML=r+"
"+r,document.body.appendChild(u),o.leading=1.2*s;var c=e(u,"height");if(c=c.replace("px",""),c>=2*s&&(o.leading=0|c/2),document.body.removeChild(u),l)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var h=document.createElement("canvas"),d=100;h.width=o.width+d,h.height=3*s,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=s;var m=h.getContext("2d");m.font=s+"px "+a;var p=h.width,f=h.height,v=f/2;m.fillStyle="white",m.fillRect(-1,-1,p+2,f+2),i&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(r,d/2,v)),n&&(m.fillStyle="black",m.fillText(r,d/2,v));for(var g=m.getImageData(0,0,p,f).data,_=0,y=4*p,C=g.length;++_0&&255===g[_];);var w=0|_/y;for(_=0;C>_&&255===g[_];)_+=y,_>=C&&(_=_-C+4);var E=0|_%y/4,x=1;for(_=C-3;_>=0&&255===g[_];)_-=y,0>_&&(_=C-3-4*x++);var b=0|_%y/4+1;o.ascent=v-S,o.descent=w-v,o.bounds={minx:E-d/2,maxx:b-d/2,miny:0,maxy:w-S},o.height=1+(w-S)}return o};return t}),r("Core/writeTextToCanvas",["./defaultValue","./defined","./DeveloperError","./Color","../ThirdParty/measureText"],function(e,t,r,i,n){"use strict";var o=function(t,r){if(""===t)return void 0;r=e(r,e.EMPTY_OBJECT);var o=e(r.font,"10px sans-serif"),a=document.createElement("canvas");a.width=a.height=1,a.style.font=o;var s=a.getContext("2d");s.font=o,s.textBaseline=e(r.textBaseline,"bottom"),a.style.visibility="hidden",document.body.appendChild(a);var l=e(r.stroke,!1),u=e(r.fill,!0),c=2*e(r.strokeWidth,1);s.lineWidth=c;var h=n(s,t,l,u);a.dimensions=h,document.body.removeChild(a),a.style.visibility="";var d=h.height-h.ascent;a.width=h.width,a.height=h.height;var m=a.height-d;if(s.font=o,l){var p=e(r.strokeColor,i.BLACK);s.strokeStyle=p.toCssColorString(),s.lineWidth=c,s.strokeText(t,0,m)}if(u){var f=e(r.fillColor,i.WHITE);s.fillStyle=f.toCssColorString(),s.fillText(t,0,m)}return a};return o}),r("DynamicScene/createDynamicPropertyDescriptor",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";function r(e,r,i,n){return{configurable:n,get:function(){return this[r]},set:function(n){var o=this[r],a=this[i];t(a)&&(a(),this[i]=void 0),o!==n&&(this[r]=n,this._definitionChanged.raiseEvent(this,e,n,o)),t(n)&&t(n.definitionChanged)&&(this[i]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function i(t,i){return r(t,"_"+t,"_"+t+"Subscription",e(i,!1))}return i}),r("DynamicScene/ConstantProperty",["../Core/defineProperties","../Core/DeveloperError","../Core/Enumeration","../Core/Event","../Core/isArray"],function(e,t,r,i,n){"use strict";var o=function(e){this._value=void 0,this._simple=!0,this._definitionChanged=new i,this.setValue(e)};return e(o.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getValue=function(e,t){return this._simple?this._value:this._value.clone(t)},o.prototype.setValue=function(e){var t=this._value,i=this._simple;(i&&t!==e||!i&&!t.equals(e))&&(i="object"!=typeof e||n(e)||e instanceof r,this._value=i?e:e.clone(),this._simple=i,this._definitionChanged.raiseEvent(this))},o.prototype.equals=function(e){return this===e||e instanceof o&&(this._simple&&this._value===e._value||!this._simple&&this._value.equals(e._value))},o}),r("DynamicScene/Property",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(){r.throwInstantiationError()};return t(i.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),i.prototype.getValue=r.throwInstantiationError,i.prototype.equals=r.throwInstantiationError,i.equals=function(t,r){return t===r||e(t)&&t.equals(r)},i.arrayEquals=function(t,r){if(t===r)return!0;if(!e(t)||!e(r)||t.length!==r.length)return!1;for(var n=t.length,o=0;n>o;o++)if(!i.equals(t[o],r[o]))return!1;return!0},i.isConstant=function(t){return!e(t)||t.isConstant},i}),r("DynamicScene/ColorMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r){this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=t(r,new s(e.WHITE))};return u.fromColor=function(e){return new u(new s(e))},i(u.prototype,{isConstant:{get:function(){return l.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),u.prototype.getType=function(){return"Color"},u.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=r(this._color)?this._color.getValue(e,t.color):void 0,t},u.prototype.equals=function(e){return this===e||e instanceof u&&l.equals(this._color,e._color)},u.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},u}),r("DynamicScene/DynamicObject",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){this._cachedAvailabilityDate=void 0,this._cachedAvailabilityValue=void 0,r(t)||(t=e()),this._id=t,this._availability=void 0,this._parent=void 0,this._name=void 0,this._definitionChanged=new o,this._position=void 0,this._positionSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._billboard=void 0,this._billboardSubscription=void 0,this._cone=void 0,this._coneSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._pyramid=void 0,this._pyramidSubscription=void 0,this._vertexPositions=void 0,this._vertexPositionsSubscription=void 0,this._vector=void 0,this._vectorSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._propertyNames=["parent","position","orientation","billboard","cone","ellipsoid","ellipse","label","path","point","polygon","polyline","pyramid","vertexPositions","vector","viewFrom","description"]};return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},propertyNames:{get:function(){return this._propertyNames}},id:{get:function(){return this._id}},name:{configurable:!1,get:function(){return this._name},set:function(e){var t=this._name;t!==e&&(this._name=e,this._definitionChanged.raiseEvent(this,"name",e,t))}},availability:a("availability"),position:a("position"),orientation:a("orientation"),viewFrom:a("viewFrom"),billboard:a("billboard"),cone:a("cone"),ellipsoid:a("ellipsoid"),ellipse:a("ellipse"),label:a("label"),model:a("model","_model"),parent:a("parent"),path:a("path"),point:a("point"),polygon:a("polygon"),polyline:a("polyline"),pyramid:a("pyramid"),vertexPositions:a("vertexPositions"),vector:a("vector"),description:a("description")}),s.prototype.isAvailable=function(e){var t=this._availability;return!r(t)||t.contains(e)},s.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,a(e,!0))},s.prototype.removeProperty=function(e){this._propertyNames,this._propertyNames.push(e),delete this[e]},s.prototype.merge=function(e){this.name=t(this.name,e.name),this.availability=t(e.availability,this.availability);for(var i=this._propertyNames,n=i.length,o=0;n>o;o++){var a=i[o],s=this[a],l=e[a];r(l)&&(r(s)?r(s.merge)&&s.merge(l):this[a]=r(l.merge)&&r(l.clone)?l.clone():l)}},s}),r("DynamicScene/DynamicObjectCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TimeInterval","../Core/Iso8601","../Core/DeveloperError","../Core/RuntimeError","./DynamicObject"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){if(0===e._suspendCount){var t=e._addedObjects,r=e._removedObjects;(0!==t.length||0!==r.length)&&(e._collectionChanged.raiseEvent(e,t.values,r.values),t.removeAll(),r.removeAll())}}var h=function(){this._objects=new e,this._addedObjects=new e,this._removedObjects=new e,this._suspendCount=0,this._collectionChanged=new n,this._id=t()};return h.prototype.suspendEvents=function(){this._suspendCount++},h.prototype.resumeEvents=function(){this._suspendCount--,c(this)},h.collectionChangedEventCallback=void 0,i(h.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}}}),h.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,i=this._objects.values,n=0,s=i.length;s>n;n++){var l=i[n],u=l.availability;if(r(u)){var c=u.start,h=u.stop;c.lessThan(e)&&!c.equals(a.MINIMUM_VALUE)&&(e=c),h.greaterThan(t)&&!h.equals(a.MAXIMUM_VALUE)&&(t=h)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new o(e,t,!0,!0)},h.prototype.add=function(e){var t=e.id,i=this._objects;if(r(i.get(t)))throw new l("An object with id "+t+" already exists in this collection.");i.set(t,e),this._removedObjects,this._removedObjects.remove(t)||this._addedObjects.set(t,e),c(this)},h.prototype.remove=function(e){return this.removeById(e.id)},h.prototype.removeById=function(e){var t=this._objects,r=t.get(e);return this._objects.remove(e)?(this._addedObjects.remove(e)||this._removedObjects.set(e,r),c(this),!0):!1},h.prototype.removeAll=function(){for(var e=this._objects,t=e.length,i=e.values,n=this._addedObjects,o=this._removedObjects,a=0;t>a;a++){var s=i[a],l=s.id,u=n.get(l);r(u)||o.set(l,s)}e.removeAll(),n.removeAll(),c(this)},h.prototype.getById=function(e){return this._objects.get(e)},h.prototype.getObjects=function(){return this._objects.values},h.prototype.getOrCreateObject=function(e){var t=this._objects.get(e);return r(t)||(t=new u(e),this.add(t)),t},h}),r("DynamicScene/CompositeDynamicObjectCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./DynamicObject","./DynamicObjectCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,r=t.length,i=0;r>i;i++)e[t[i]]=void 0}function l(e,r,i){return function(n,o){for(var a=r.id,s=e._composite,l=s.getById(a),u=l[i],c=e._collections,h=c.length,d=h-1;d>=0;d--){var m=c[d].getById(r.id);if(t(m)){var p=m[i];if(t(p)){var f=p[o];if(t(f))return u[o]=f,void 0}}}u[o]=void 0}}function u(e,r){var i=e._composite,n=e._eventHash;return function(o,a){var s=o.id,l=i.getById(s),u=l[a];h(n,r,o,a),c(e,n,r,o,a,o[a]);for(var d=e._collections,m=d.length,p=!0,f=m-1;f>=0;f--){var v=d[f].getById(o.id);if(t(v)){var g=v[a];if(t(g)){if(p){if(p=!1,!t(g.merge)||!t(g.clone)){u=g;break}u=g.clone(u)}u.merge(g)}}}l[a]=u}}function c(e,r,i,n,o,a){if(t(a)&&t(a.definitionChanged)){var s=l(e,n,o);g[0]=i,g[1]=n.id,g[2]=o,r[JSON.stringify(g)]=a.definitionChanged.addEventListener(s)}}function h(e,r,i,n){g[0]=r,g[1]=i.id,g[2]=n;var o=JSON.stringify(g),a=e[o];t(a)&&(a(),e[o]=void 0)}function d(e,t,r,i){_[0]=r,_[1]=i.id,t[JSON.stringify(_)]=i.definitionChanged.addEventListener(u(e,r));for(var n=i.propertyNames,o=n.length,a=0;o>a;a++){var s=n[a];c(e,t,r,i,s,i[s])}}function m(e,t,r,i){_[0]=r,_[1]=i.id;var n=JSON.stringify(_);t[n](),t[n]=void 0;for(var o=i.propertyNames,a=o.length,s=0;a>s;s++){var l=o[s];h(t,r,i,l)}}function p(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var r,i,n,l,u,c,h=e._collections,p=h.length,f=e._collectionsCopy,v=f.length,g=e._composite,_=new a,C=e._eventHash;for(r=0;v>r;r++)for(u=f[r],u.collectionChanged.removeEventListener(y.prototype._onCollectionChanged,e),n=u.getObjects(),c=u.id,l=n.length-1;l>-1;l--)i=n[l],m(e,C,c,i);for(r=p-1;r>=0;r--)for(u=h[r],u.collectionChanged.addEventListener(y.prototype._onCollectionChanged,e),n=u.getObjects(),c=u.id,l=n.length-1;l>-1;l--){i=n[l],d(e,C,c,i);var S=_.getById(i.id);t(S)||(S=g.getById(i.id),t(S)?s(S):S=new o(i.id),_.add(S)),S.merge(i)}e._collectionsCopy=h.slice(0),g.suspendEvents(),g.removeAll();var w=_.getObjects();for(r=0;ru;u++){var _=i[u];m(this,v,g,_);var y=_.id;for(c=a-1;c>=0;c--)h=n[c].getById(y),t(h)&&(t(p)||(p=l.getById(y),s(p)),p.merge(h));t(p)||l.removeById(y)}var C=r.length;for(u=0;C>u;u++){var S=r[u];d(this,v,g,S);var w=S.id;for(c=a-1;c>=0;c--)h=n[c].getById(w),t(h)&&(t(p)||(p=l.getById(w),t(p)?s(p):(p=new o(w),l.add(p))),p.merge(h))}l.resumeEvents()},y}),r("DynamicScene/CompositeProperty",["./Property","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,i,n){var o=function(){i.raiseEvent(e)},a=[];r.removeAll();for(var s=n.length,l=0;s>l;l++){var u=n.get(l);t(u.data)&&-1===a.indexOf(u.data)&&r.add(u.data.definitionChanged,o)}}var l=function(){this._eventHelper=new o,this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)};return r(l.prototype,{isConstant:{get:function(){return this._intervals.empty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(e,r){var i=this._intervals.findDataForIntervalContainingDate(e);return t(i)?i.getValue(e,r):void 0},l.prototype.equals=function(t){return this===t||t instanceof l&&this._intervals.equals(t._intervals,e.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,r,i,n,o){"use strict";var a=function(){this._definitionChanged=new i,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)};return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var r=this._composite._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getType(t):void 0},a.prototype.getValue=function(t,r){var i=this._composite._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getValue(t,r):void 0},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),r("DynamicScene/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)};return r(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._composite._intervals.findDataForIntervalContainingDate(e);return t(n)?n.getValueInReferenceFrame(e,r,i):void 0},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,r,i,n,o,a){"use strict";var s=function(){i.throwInstantiationError()};r(s.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError},referenceFrame:{get:i.throwInstantiationError}}),s.prototype.getValue=i.throwInstantiationError,s.prototype.getValueInReferenceFrame=i.throwInstantiationError,s.prototype.equals=i.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(r,i,s,u,c){if(!t(i))return i;if(s===u)return e.clone(i,c);var h=a.computeIcrfToFixedMatrix(r,l);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(r,l)),s===o.INERTIAL?n.multiplyByVector(h,i,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,l),i,c):void 0},s}),r("DynamicScene/ConstantPositionProperty",["./PositionProperty","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,i){this._definitionChanged=new a,this._value=t.clone(e),this._referenceFrame=r(i,s.FIXED)};return n(l.prototype,{isConstant:{get:function(){return!i(this._value)||this._referenceFrame===s.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,s.FIXED,t)},l.prototype.setValue=function(e,r){var n=!1;t.equals(this._value,e)||(n=!0,this._value=t.clone(e)),i(r)&&this._referenceFrame!==r&&(n=!0,this._referenceFrame=r),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(t,r,i){return e.convertToReferenceFrame(t,this._value,this._referenceFrame,r,i)},l.prototype.equals=function(e){return this===e||e instanceof l&&t.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame},l}),r("Scene/HorizontalOrigin",["../Core/Enumeration"],function(e){"use strict";var t={CENTER:new e(0,"CENTER"),LEFT:new e(1,"LEFT"),RIGHT:new e(-1,"RIGHT")};return t}),r("Scene/LabelStyle",["../Core/Enumeration"],function(e){"use strict";var t={FILL:new e(0,"FILL"),OUTLINE:new e(1,"OUTLINE"),FILL_AND_OUTLINE:new e(2,"FILL_AND_OUTLINE")};return t}),r("Scene/VerticalOrigin",["../Core/Enumeration"],function(e){"use strict";var t={CENTER:new e(0,"CENTER"),BOTTOM:new e(1,"BOTTOM"),TOP:new e(-1,"TOP")};return t}),r("DynamicScene/DynamicBillboard",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._image=void 0,this._imageSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this._color,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e},a.prototype.merge=function(t){this.color=e(this._color,t._color),this.eyeOffset=e(this._eyeOffset,t._eyeOffset),this.horizontalOrigin=e(this._horizontalOrigin,t._horizontalOrigin),this.image=e(this._image,t._image),this.pixelOffset=e(this._pixelOffset,t._pixelOffset),this.scale=e(this._scale,t._scale),this.rotation=e(this._rotation,t._rotation),this.alignedAxis=e(this._alignedAxis,t._alignedAxis),this.show=e(this._show,t._show),this.verticalOrigin=e(this._verticalOrigin,t._verticalOrigin),this.width=e(this._width,t._width),this.height=e(this._height,t._height),this.scaleByDistance=e(this._scaleByDistance,t._scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t._translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t._pixelOffsetScaleByDistance)},a}),r("DynamicScene/DynamicClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o};return i(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return r(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||r(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(t){return r(t)||(t=new e),t.startTime=this.startTime,t.stopTime=this.stopTime,t.clockRange=this.clockRange,t.clockStep=this.clockStep,t.multiplier=this.multiplier,t.currentTime=this.currentTime,t},l}),r("DynamicScene/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=new o(e.WHITE),this.outlineColor=new o(e.BLACK),this.outlineWidth=new o(0)};return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color"),outlineColor:n("outlineColor"),outlineWidth:n("outlineWidth")}),s.prototype.getType=function(){return"PolylineOutline"},s.prototype.getValue=function(e,r){return t(r)||(r={}),r.color=t(this._color)?this._color.getValue(e,r.color):void 0,r.outlineColor=t(this._outlineColor)?this._outlineColor.getValue(e,r.outlineColor):void 0,r.outlineWidth=t(this._outlineWidth)?this._outlineWidth.getValue(e):void 0,r},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),r("DynamicScene/DynamicCone",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._minimumClockAngle=void 0,this._minimumClockAngleSubscription=void 0,this._maximumClockAngle=void 0,this._maximumClockAngleSubscription=void 0,this._innerHalfAngle=void 0,this._innerHalfAngleSubscription=void 0,this._outerHalfAngle=void 0,this._outerHalfAngleSubscription=void 0,this._capMaterial=void 0,this._capMaterialSubscription=void 0,this._innerMaterial=void 0,this._innerMaterialSubscription=void 0,this._outerMaterial=void 0,this._outerMaterialSubscription=void 0,this._silhouetteMaterial=void 0,this._silhouetteMaterialSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},minimumClockAngle:o("minimumClockAngle"),maximumClockAngle:o("maximumClockAngle"),innerHalfAngle:o("innerHalfAngle"),outerHalfAngle:o("outerHalfAngle"),capMaterial:o("capMaterial"),innerMaterial:o("innerMaterial"),outerMaterial:o("outerMaterial"),silhouetteMaterial:o("silhouetteMaterial"),intersectionColor:o("intersectionColor"),intersectionWidth:o("intersectionWidth"),showIntersection:o("showIntersection"),radius:o("radius"),show:o("show")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.innerHalfAngle=this.innerHalfAngle,e.outerHalfAngle=this.outerHalfAngle,e.minimumClockAngle=this.minimumClockAngle,e.maximumClockAngle=this.maximumClockAngle,e.radius=this.radius,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.capMaterial=this.capMaterial,e.innerMaterial=this.innerMaterial,e.outerMaterial=this.outerMaterial,e.silhouetteMaterial=this.silhouetteMaterial,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.innerHalfAngle=e(this.innerHalfAngle,t.innerHalfAngle),this.outerHalfAngle=e(this.outerHalfAngle,t.outerHalfAngle),this.minimumClockAngle=e(this.minimumClockAngle,t.minimumClockAngle),this.maximumClockAngle=e(this.maximumClockAngle,t.maximumClockAngle),this.radius=e(this.radius,t.radius),this.showIntersection=e(this.showIntersection,t.showIntersection),this.intersectionColor=e(this.intersectionColor,t.intersectionColor),this.intersectionWidth=e(this.intersectionWidth,t.intersectionWidth),this.capMaterial=e(this.capMaterial,t.capMaterial),this.innerMaterial=e(this.innerMaterial,t.innerMaterial),this.outerMaterial=e(this.outerMaterial,t.outerMaterial),this.silhouetteMaterial=e(this.silhouetteMaterial,t.silhouetteMaterial)},a}),r("DynamicScene/DynamicLabel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._definitionChanged=new n
+};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t._translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t._pixelOffsetScaleByDistance)},a}),r("DynamicScene/DynamicEllipse",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:o("semiMajorAxis"),semiMinorAxis:o("semiMinorAxis"),rotation:o("rotation"),show:o("show"),material:o("material"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),numberOfVerticalLines:o("numberOfVerticalLines")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.numberOfVerticalLines=this.numberOfVerticalLines,e},a.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines)},a}),r("DynamicScene/DynamicEllipsoid",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),radii:o("radii"),material:o("material"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),stackPartitions:o("stackPartitions"),slicePartitions:o("slicePartitions"),subdivisions:o("subdivisions")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions)},a}),r("DynamicScene/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this.color=new a(t.WHITE),this.cellAlpha=new a(.1),this.lineCount=new a(new e(8,8)),this.lineThickness=new a(new e(1,1))};return i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),cellAlpha:o("cellAlpha"),lineCount:o("lineCount"),lineThickness:o("lineThickness")}),l.prototype.getType=function(){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=r(this._color)?this._color.getValue(e,t.color):void 0,t.cellAlpha=r(this._cellAlpha)?this._cellAlpha.getValue(e):void 0,t.lineCount=r(this._lineCount)?this._lineCount.getValue(e,t.lineCount):void 0,t.lineThickness=r(this._lineThickness)?this._lineThickness.getValue(e,t.lineThickness):void 0,t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/ImageMaterialProperty",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/Event","./createDynamicPropertyDescriptor","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._definitionChanged=new i,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.repeat=new o(new e(1,1))};return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._image)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:n("image"),repeat:n("repeat")}),s.prototype.getType=function(){return"Image"},s.prototype.getValue=function(e,r){return t(r)||(r={}),r.image=t(this._image)?this._image.getValue(e):void 0,r.repeat=t(this._repeat)?this._repeat.getValue(e,r.repeat):void 0,r},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._image,e._image)&&a.equals(this._repeat,e._repeat)},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),r("DynamicScene/DynamicModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),uri:o("uri")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.scale=this.scale,e.uri=this.uri,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.scale=e(this.scale,t.scale),this.uri=e(this.uri,t.uri)},a}),r("DynamicScene/DynamicPath",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),width:o("width"),resolution:o("resolution"),leadTime:o("leadTime"),trailTime:o("trailTime")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.width=this.width,e.resolution=this.resolution,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime)},a}),r("DynamicScene/DynamicPoint",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance)},a}),r("DynamicScene/DynamicPolyline",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),width:o("width")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.material=this.material,e.width=this.width,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.width=e(this.width,t.width)},a}),r("DynamicScene/DynamicPolygon",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),perPositionHeight:o("perPositionHeight")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.perPositionHeight=this.perPositionHeight,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight)},a}),r("DynamicScene/DynamicPyramid",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._show=void 0,this._showSubscription=void 0,this._directions=void 0,this._directionsSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),directions:o("directions"),radius:o("radius"),showIntersection:o("showIntersection"),intersectionColor:o("intersectionColor"),intersectionWidth:o("intersectionWidth"),material:o("material")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.directions=this.directions,e.radius=this.radius,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.material=this.material,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.directions=e(this.directions,t.directions),this.radius=e(this.radius,t.radius),this.showIntersection=e(this.showIntersection,t.showIntersection),this.intersectionColor=e(this.intersectionColor,t.intersectionColor),this.intersectionWidth=e(this.intersectionWidth,t.intersectionWidth),this.material=e(this.material,t.material)},a}),r("DynamicScene/DynamicVector",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createDynamicPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._color=void 0,this._colorSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._direction=void 0,this._directionSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),show:o("show"),width:o("width"),direction:o("direction"),length:o("length")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this.color,e.width=this.width,e.direction=this.direction,e.length=this.length,e.show=this.show,e},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.width=e(this.width,t.width),this.direction=e(this.direction,t.direction),this.length=e(this.length,t.length),this.show=e(this.show,t.show)},a}),r("DynamicScene/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t,r){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(r,a.FIXED),this.setValue(t)};return r(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var r=e.length,i=0;r>i;i++)if(!s.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._value;if(!t(n))return void 0;var o=n.length;t(i)||(i=new Array(o));for(var a=0,s=0;o>a;){var l=n[a],u=l.getValueInReferenceFrame(e,r,i[a]);t(u)&&(i[s]=u,s++),a++}return i.length=s,i},l.prototype.setValue=function(e){var r=this._eventHelper;if(r.removeAll(),t(e)){this._value=e.slice();for(var i=e.length,n=0;i>n;n++){var o=e[n];t(o)&&r.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../DynamicScene/Property"],function(e,t,r,i,n){"use strict";function o(t){var r=t._targetProperty;if(!e(r)){var i=t._dynamicObjectCollection,n=i.getById(t._targetObjectId);e(n)&&(r=n[t._targetPropertyName],t._targetProperty=r,t._targetObject=n)}return r}var a=function(e,t,r){this._targetProperty=void 0,this._dynamicObjectCollection=e,this._targetObjectId=t,this._targetObject=void 0,this._targetPropertyName=r,this._definitionChanged=new i};return t(a.prototype,{isConstant:{get:function(){return n.isConstant(o(this))}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.fromString=function(e,t){var r=t.split(".");return new a(e,r[0],r[1])},a.prototype.getValue=function(t,r){var i=o(this);return e(i)&&this._targetObject.isAvailable(t)?i.getValue(t,r):void 0},a.prototype.getValueInReferenceFrame=function(t,r,i){var n=o(this);return e(n)&&this._targetObject.isAvailable(t)?n.getValueInReferenceFrame(t,r,i):void 0},a.prototype.equals=function(e){return this===e||this._dynamicObjectCollection===e._dynamicObjectCollection&&this._targetObjectId===e._targetObjectId&&this._targetPropertyName===e._targetPropertyName},a}),r("DynamicScene/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i,n=e.length,o=r.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;o>i;i++)e[t++]=r[i]}function u(e,t){return e instanceof a?e:"string"==typeof e?a.fromIso8601(e):t.addSeconds(e)}var c={packedLength:1,pack:function(e,r,i){i=t(i,0),r[i]=e},unpack:function(e,r){return r=t(r,0),e[r]}},h=[],d=[],m=function(t,i,n,o,s){for(var c,m,p,f,v,g,_=0;_p){for(p=~p,f=p*s,m=void 0,g=i[p];_=0||r(g)&&a.compare(v,g)>=0));){for(h[y++]=v,_+=1,c=0;s>c;c++)d[C++]=o[_],_+=1;m=v}y>0&&(d.length=C,l(n,f,d),h.length=y,l(i,p,h))}else{for(c=0;s>c;c++)_++,n[p*s+c]=o[_];_++}}},p=function(e){var r=e;r===Number&&(r=c);var i=t(r.packedInterpolationLength,r.packedLength);this._type=e,this._innerType=r,this._interpolationDegree=1,this._interpolationAlgorithm=s,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedInterpolationLength=i,this._updateTableLength=!0,this._interpolationResult=new Array(i),this._definitionChanged=new o};return i(p.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}}}),p.prototype.getValue=function(t,i){var n=this._innerType,o=this._times,s=this._values,l=e(o,t,a.compare);if(0>l){var u=this._xTable,c=this._yTable,h=this._interpolationAlgorithm,d=this._packedInterpolationLength;if(this._updateTableLength){this._updateTableLength=!1;var m=Math.min(h.getRequiredDataPoints(this._interpolationDegree),o.length);m!==this._numberOfPoints&&(this._numberOfPoints=m,u.length=m,c.length=m*d)}var p=this._numberOfPoints-1;if(1>p)return void 0;l=~l,l>=o.length&&(l=o.length-1);var f=0,v=o.length-1,g=v-f+1;if(p+1>g);else{var _=l-(0|p/2)-1;f>_&&(_=f);var y=_+p;y>v&&(y=v,_=y-p,f>_&&(_=f)),f=_,v=y}for(var C=v-f+1,S=0;C>S;++S)u[S]=o[v].getSecondsDifference(o[f+S]);if(r(n.convertPackedArrayForInterpolation))n.convertPackedArrayForInterpolation(s,f,v,c);else for(var w=0,E=n.packedLength,x=f*E,b=(v+1)*E;b>x;)c[w]=s[x],x++,w++;var T=o[v].getSecondsDifference(t),A=h.interpolateOrderZero(T,u,c,d,this._interpolationResult);return r(n.unpackInterpolationResult)?n.unpackInterpolationResult(A,s,f,v,i):n.unpack(A,0,i)}return n.unpack(this._values,l*n.packedLength,i)},p.prototype.setInterpolationOptions=function(e){var t=!1,r=e.interpolationAlgorithm,i=e.interpolationDegree;this._interpolationAlgorithm!==r&&(this._interpolationAlgorithm=r,t=!0),this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},p.prototype.addSample=function(e,t){var r=this._innerType,i=[e];r.pack(t,i,1),m(void 0,this._times,this._values,i,r.packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.addSamples=function(e,t){for(var r=this._innerType,i=e.length,n=[],o=0;i>o;o++)n.push(e[o]),r.pack(t[o],n,n.length);m(void 0,this._times,this._values,n,r.packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.addSamplesPackedArray=function(e,t){m(t,this._times,this._values,e,this._innerType.packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;var t=this._times,i=e._times,n=t.length;if(n!==i.length)return!1;var o;for(o=0;n>o;o++)if(!a.equals(t[o],i[o]))return!1;var s=this._values,l=e._values;for(o=0;n>o;o++)if(s[o]!==l[o])return!1;return this._type===e._type&&this._interpolationDegree===e._interpolationDegree&&this._interpolationAlgorithm===e._interpolationAlgorithm},p._mergeNewSamples=m,p}),r("DynamicScene/SampledPositionProperty",["./PositionProperty","./Property","./SampledProperty","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(e){this._property=new r(i),this._definitionChanged=new l,this._referenceFrame=n(e,u.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)};return a(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,u.FIXED,t)},c.prototype.getValueInReferenceFrame=function(t,r,i){return i=this._property.getValue(t,i),o(i)?e.convertToReferenceFrame(t,i,this._referenceFrame,r,i):i},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t){this._property.addSample(e,t)},c.prototype.addSamples=function(e,t){this._property.addSamples(e,t)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||t.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),r("DynamicScene/TimeIntervalCollectionPositionProperty",["./PositionProperty","./Property","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(e){this._definitionChanged=new a,this._intervals=new l,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=r(e,s.FIXED)};return n(u.prototype,{isConstant:{get:function(){return this._intervals.empty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,s.FIXED,t)},u.prototype.getValueInReferenceFrame=function(t,r,n){var o=this._intervals.findDataForIntervalContainingDate(t);return i(o)?e.convertToReferenceFrame(t,o,this._referenceFrame,r,n):void 0},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,t.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),r("DynamicScene/TimeIntervalCollectionProperty",["./Property","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Enumeration","../Core/Event","../Core/isArray","../Core/TimeIntervalCollection"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){this._definitionChanged=new o,this._intervals=new s,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)};return r(l.prototype,{isConstant:{get:function(){return this._intervals.empty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(e,r){var i=this._intervals.findDataForIntervalContainingDate(e);return!t(i)||"object"!=typeof i||a(i)||i instanceof n?i:i.clone(r)},l.prototype.equals=function(t){return this===t||t instanceof l&&this._intervals.equals(t._intervals,e.equals)},l.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DynamicScene/CzmlDataSource",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Color","../Core/ClockRange","../Core/ClockStep","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/Quaternion","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./createDynamicPropertyDescriptor","./DynamicBillboard","./DynamicClock","./ColorMaterialProperty","./PolylineOutlineMaterialProperty","./DynamicCone","./DynamicLabel","./DynamicEllipse","./DynamicEllipsoid","./GridMaterialProperty","./ImageMaterialProperty","./DynamicModel","./DynamicObject","./DynamicObjectCollection","./DynamicPath","./DynamicPoint","./DynamicPolyline","./DynamicPolygon","./DynamicPyramid","./DynamicVector","./PositionPropertyArray","./ReferenceProperty","./SampledPositionProperty","./SampledProperty","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","../ThirdParty/Uri","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N,B,z,F,V,k,U,W,G,H,j,q,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut){"use strict";function ct(e,t,r){return l(t)||l(r)?(e instanceof Yt||(e=new Yt),_t(Number,e,"x",t),_t(Number,e,"y",r),e):e}function ht(e){var t=e.rgbaf;if(l(t))return t;var r=e.rgba;if(!l(r))return void 0;if(r.length===i.length)return[i.byteToFloat(r[0]),i.byteToFloat(r[1]),i.byteToFloat(r[2]),i.byteToFloat(r[3])];var n=r.length;t=new Array(n);for(var o=0;n>o;o+=5)t[o]=r[o],t[o+1]=i.byteToFloat(r[o+1]),t[o+2]=i.byteToFloat(r[o+2]),t[o+3]=i.byteToFloat(r[o+3]),t[o+4]=i.byteToFloat(r[o+4]);return t}function dt(e,t){var r=s(e.image,e);if(l(t)){var i=new lt(document.location.href);t=new lt(t),r=new lt(r).resolve(t.resolve(i)).toString()}return r}function mt(e,t){var r=s(e.uri,e);if(l(t)){var i=new lt(document.location.href);t=new lt(t),r=new lt(r).resolve(t.resolve(i)).toString()}return r}function pt(e){if(l(e.cartesian))return e.cartesian;if(l(e.unitCartesian))return e.unitCartesian;var r,i,n,o=e.unitSpherical;if(l(o)){if(i=o.length,2===i)Zt.clock=o[0],Zt.cone=o[1],t.fromSpherical(Zt,Xt),n=[Xt.x,Xt.y,Xt.z];else{var a=0;for(n=new Array(4*(i/3)),r=0;i>r;r+=4)n[r]=o[a++],Zt.clock=o[a++],Zt.cone=o[a++],t.fromSpherical(Zt,Xt),n[r+1]=Xt.x,n[r+2]=Xt.y,n[r+3]=Xt.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)Jt.longitude=s[0],Jt.latitude=s[1],Jt.height=s[2],h.WGS84.cartographicToCartesian(Jt,Xt),n=[Xt.x,Xt.y,Xt.z];else for(i=s.length,n=new Array(i),r=0;i>r;r+=4)Jt.longitude=s[r+1],Jt.latitude=s[r+2],Jt.height=s[r+3],h.WGS84.cartographicToCartesian(Jt,Xt),n[r]=s[r],n[r+1]=Xt.x,n[r+2]=Xt.y,n[r+3]=Xt.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new x(JSON.stringify(e)+" is not a valid CZML interval.");
+if(3===u.length)Jt.longitude=S.toRadians(u[0]),Jt.latitude=S.toRadians(u[1]),Jt.height=u[2],h.WGS84.cartographicToCartesian(Jt,Xt),n=[Xt.x,Xt.y,Xt.z];else for(i=u.length,n=new Array(i),r=0;i>r;r+=4)Jt.longitude=S.toRadians(u[r+1]),Jt.latitude=S.toRadians(u[r+2]),Jt.height=u[r+3],h.WGS84.cartographicToCartesian(Jt,Xt),n[r]=u[r],n[r+1]=Xt.x,n[r+2]=Xt.y,n[r+3]=Xt.z;return n}function ft(r,n,o){switch(r){case Boolean:return s(n["boolean"],n);case e:return n.cartesian2;case t:return pt(n);case i:return ht(n);case P:return P[s(n.horizontalOrigin,n)];case Image:return dt(n,o);case g:return g.fromIso8601(s(n.date,n));case D:return D[s(n.labelStyle,n)];case Number:return s(n.number,n);case String:return s(n.string,n);case Array:return n.array;case w:var a=n.unitQuaternion;if(l(a)){if(4===a.length)return[-a[0],-a[1],-a[2],a[3]];a=a.slice(0);for(var u=0;ud;if(!p&&!h)return t[r]=l(e.unpack)?new N(e.unpack(c,0)):new N(c),!0;var f,_=!1,y=t[r],C=i.epoch;if(l(C)&&(f=g.fromIso8601(C)),p&&!h)return y instanceof ot||(y=new ot(e),t[r]=y,_=!0),y.addSamplesPackedArray(c,f),vt(i,y),_;var S;if(!p&&h)return a=a.clone(),a.data=l(e.unpack)?e.unpack(c,0):c,l(y)||(y=new st,t[r]=y,_=!0),y instanceof st?y.intervals.addInterval(a):y instanceof R?(a.data=new N(a.data),y.intervals.addInterval(a)):(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new R,t[r]=y,y.intervals.addInterval(S),a.data=new N(a.data),y.intervals.addInterval(a)),_;l(y)||(_=!0,y=new R,t[r]=y),y instanceof R||(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new R,t[r]=y,y.intervals.addInterval(S));var w=y.intervals;return S=w.findInterval(a.start,a.stop,a.isStartIncluded,a.isStopIncluded),l(S)&&S.data instanceof ot||(S=a.clone(),S.data=new ot(e),w.addInterval(S)),S.data.addSamplesPackedArray(c,f),vt(i,S.data),_}function _t(e,t,r,i,n,o){if(l(i))if(f(i))for(var a=0,s=i.length;s>a;a++)gt(e,t,r,i[a],n,o);else gt(e,t,r,i,n,o)}function yt(e,r,i,n){var o,a=i.interval;l(a)?(o=T.fromIso8601(a),l(n)&&(o=o.intersect(n))):l(n)&&(o=n);var u=s(E[i.referenceFrame],void 0),c=pt(i),h=l(o)&&!o.equals(v.MAXIMUM_INTERVAL),d=t.packedLength,m=s(c.length,1),p="string"!=typeof c&&m>d;if(!p&&!h)return e[r]=new L(t.unpack(c),u),!0;var f,_=!1,y=e[r],C=i.epoch;if(l(C)&&(f=g.fromIso8601(C)),p&&!h)return(!(y instanceof nt)||l(u)&&y.referenceFrame!==u)&&(y=new nt(u),e[r]=y,_=!0),y.addSamplesPackedArray(c,f),vt(i,y),_;var S;if(!p&&h)return o=o.clone(),o.data=t.unpack(c),l(y)||(y=new at(u),e[r]=y,_=!0),y instanceof at&&l(u)&&y.referenceFrame===u?y.intervals.addInterval(o):y instanceof O?(o.data=new L(o.data,u),y.intervals.addInterval(o)):(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new O(y.referenceFrame),e[r]=y,y.intervals.addInterval(S),o.data=new L(o.data,u),y.intervals.addInterval(o)),_;l(y)?y instanceof O||(S=v.MAXIMUM_INTERVAL.clone(),S.data=y,_=!0,y=new O(y.referenceFrame),e[r]=y,y.intervals.addInterval(S)):(_=!0,y=new O(u),e[r]=y);var w=y.intervals;return S=w.findInterval(o.start,o.stop,o.isStartIncluded,o.isStopIncluded),l(S)&&S.data instanceof nt&&(!l(u)||S.data.referenceFrame===u)||(S=o.clone(),S.data=new nt(u),w.addInterval(S)),S.data.addSamplesPackedArray(c,f),vt(i,S.data),_}function Ct(e,t,r,i,n){if(l(r))if(f(r))for(var o=0,a=r.length;a>o;o++)yt(e,t,r[o],i,n);else yt(e,t,r,i,n)}function St(e,t,r,n,o){var a,s=r.interval;l(s)?(a=T.fromIso8601(s),l(n)&&(a=a.intersect(n))):l(n)&&(a=n);var u,c,h=e[t];if(l(a)){h instanceof I||(h=new I,e[t]=h);var d=h.intervals;c=d.findInterval(a.start,a.stop),l(c)?u=c.data:(c=a.clone(),d.addInterval(c))}else u=h;var m;l(r.solidColor)?(u instanceof V||(u=new V),m=r.solidColor,_t(i,u,"color",m.color)):l(r.grid)?(u instanceof j||(u=new j),m=r.grid,_t(i,u,"color",m.color,void 0,o),_t(Number,u,"cellAlpha",m.cellAlpha,void 0,o),u.lineThickness=ct(u.lineThickness,m.rowThickness,m.columnThickness),u.lineCount=ct(u.lineCount,m.rowCount,m.columnCount)):l(r.image)&&(u instanceof q||(u=new q),m=r.image,_t(Image,u,"image",m.image,void 0,o),u.repeat=ct(u.repeat,m.horizontalRepeat,m.verticalRepeat)),l(c)?c.data=u:e[t]=u}function wt(e,t,r,i,n){if(l(r))if(f(r))for(var o=0,a=r.length;a>o;o++)St(e,t,r[o],i,n);else St(e,t,r,i,n)}function Et(e,t){e.name=s(t.name,e.name)}function xt(e,t,r,i){var n=t.description;l(n)&&_t(String,e,"description",n,void 0,i)}function bt(e,t,r,i){var n=t.position;l(n)&&Ct(e,"position",n,void 0,i)}function Tt(e,r,i,n){var o=r.viewFrom;l(o)&&_t(t,e,"viewFrom",o,void 0,n)}function At(e,t,r,i){var n=t.orientation;l(n)&&_t(w,e,"orientation",n,void 0,i)}function Pt(e,i,n){var o,a,s=i.references;if(l(s)){var u=[];for(o=0,a=s.length;a>o;o++)u.push(it.fromString(n,s[o]));var c=i.interval;l(c)?(c=T.fromIso8601(c),e.vertexPositions instanceof O||(e.vertexPositions=new O,c.data=new rt(u),e.vertexPositions.intervals.addInterval(c))):e.vertexPositions=new rt(u)}else{var d=[],m=i.cartesian;if(l(m)){for(o=0,a=m.length;a>o;o+=3)d.push(new t(m[o],m[o+1],m[o+2]));i.array=d}else if(m=i.cartographicRadians,l(m)){for(o=0,a=m.length;a>o;o+=3)d.push(h.WGS84.cartographicToCartesian(new r(m[o],m[o+1],m[o+2])));i.array=d}else if(m=i.cartographicDegrees,l(m)){for(o=0,a=m.length;a>o;o+=3)d.push(h.WGS84.cartographicToCartesian(r.fromDegrees(m[o],m[o+1],m[o+2])));i.array=d}l(i.array)&&_t(Array,e,"vertexPositions",i)}}function Dt(e,t,r){var i=t.vertexPositions;if(l(i))if(f(i))for(var n=i.length,o=0;n>o;o++)Pt(e,i[o],r);else Pt(e,i,r)}function Mt(e,t){var r,i=t.availability;if(l(i)){var n;if(f(i))for(var o=i.length,a=0;o>a;a++)l(n)||(n=new A),r=T.fromIso8601(i[a]),n.addInterval(r);else r=T.fromIso8601(i),n=new A,n.addInterval(r);e.availability=n}}function It(r,n,o,a){var s=n.billboard;if(l(s)){var u=s.interval;l(u)&&(u=T.fromIso8601(u));var c=r.billboard;l(c)||(r.billboard=c=new z),_t(i,c,"color",s.color,u,a),_t(t,c,"eyeOffset",s.eyeOffset,u,a),_t(P,c,"horizontalOrigin",s.horizontalOrigin,u,a),_t(Image,c,"image",s.image,u,a),_t(e,c,"pixelOffset",s.pixelOffset,u,a),_t(Number,c,"scale",s.scale,u,a),_t(Number,c,"rotation",s.rotation,u,a),_t(t,c,"alignedAxis",s.alignedAxis,u,a),_t(Boolean,c,"show",s.show,u,a),_t(M,c,"verticalOrigin",s.verticalOrigin,u,a)}}function Ot(e,t){var r=t.clock;if(l(r)&&"document"===e.id){var i=e.clock;if(l(i)||(i=new F,i.startTime=v.MAXIMUM_INTERVAL.start,i.stopTime=v.MAXIMUM_INTERVAL.stop,i.clockRange=n.LOOP_STOP,i.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,i.multiplier=1,e.clock=i),l(r.interval)){var a=T.fromIso8601(r.interval);i.startTime=a.start,i.stopTime=a.stop}l(r.currentTime)&&(i.currentTime=g.fromIso8601(r.currentTime)),l(r.range)&&(i.clockRange=n[r.range]),l(r.step)&&(i.clockStep=o[r.step]),l(r.multiplier)&&(i.multiplier=r.multiplier)}}function Rt(e,t,r,n){var o=t.cone;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.cone;l(s)||(e.cone=s=new U),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"radius",o.radius,a,n),_t(Boolean,s,"showIntersection",o.showIntersection,a,n),_t(i,s,"intersectionColor",o.intersectionColor,a,n),_t(Number,s,"intersectionWidth",o.intersectionWidth,a,n),_t(Number,s,"innerHalfAngle",o.innerHalfAngle,a,n),_t(Number,s,"outerHalfAngle",o.outerHalfAngle,a,n),_t(Number,s,"minimumClockAngle",o.minimumClockAngle,a,n),_t(Number,s,"maximumClockAngle",o.maximumClockAngle,a,n),wt(s,"capMaterial",o.capMaterial,a,n),wt(s,"innerMaterial",o.innerMaterial,a,n),wt(s,"outerMaterial",o.outerMaterial,a,n),wt(s,"silhouetteMaterial",o.silhouetteMaterial,a,n)}}function Lt(e,t,r,n){var o=t.ellipse;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.ellipse;l(s)||(e.ellipse=s=new G),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"rotation",o.rotation,a,n),_t(Number,s,"semiMajorAxis",o.semiMajorAxis,a,n),_t(Number,s,"semiMinorAxis",o.semiMinorAxis,a,n),_t(Number,s,"height",o.height,a,n),_t(Number,s,"extrudedHeight",o.extrudedHeight,a,n),_t(Number,s,"granularity",o.granularity,a,n),_t(Number,s,"stRotation",o.stRotation,a,n),wt(s,"material",o.material,a,n),_t(Boolean,s,"fill",o.fill,a,n),_t(Boolean,s,"outline",o.outline,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,a,n)}}function Nt(e,r,n,o){var a=r.ellipsoid;if(l(a)){var s=a.interval;l(s)&&(s=T.fromIso8601(s));var u=e.ellipsoid;l(u)||(e.ellipsoid=u=new H),_t(Boolean,u,"show",a.show,s,o),_t(t,u,"radii",a.radii,s,o),wt(u,"material",a.material,s,o),_t(Boolean,u,"fill",a.fill,s,o),_t(Boolean,u,"outline",a.outline,s,o),_t(i,u,"outlineColor",a.outlineColor,s,o)}}function Bt(r,n,o,a){var s=n.label;if(l(s)){var u=s.interval;l(u)&&(u=T.fromIso8601(u));var c=r.label;l(c)||(r.label=c=new W),_t(i,c,"fillColor",s.fillColor,u,a),_t(i,c,"outlineColor",s.outlineColor,u,a),_t(Number,c,"outlineWidth",s.outlineWidth,u,a),_t(t,c,"eyeOffset",s.eyeOffset,u,a),_t(P,c,"horizontalOrigin",s.horizontalOrigin,u,a),_t(String,c,"text",s.text,u,a),_t(e,c,"pixelOffset",s.pixelOffset,u,a),_t(Number,c,"scale",s.scale,u,a),_t(Boolean,c,"show",s.show,u,a),_t(M,c,"verticalOrigin",s.verticalOrigin,u,a),_t(String,c,"font",s.font,u,a),_t(D,c,"style",s.style,u,a)}}function zt(e,t,r,i){var n=t.model;if("undefined"!=typeof n){var o=n.interval;l(o)&&(o=T.fromIso8601(o));var a=e.model;l(a)||(e.model=a=new Y),_t(Boolean,a,"show",n.show,o,i),_t(Number,a,"scale",n.scale,o,i),_t(lt,a,"uri",n.gltf,o,i)}}function Ft(e,t,r,n){var o=t.path;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.path;l(s)||(e.path=s=new J),_t(i,s,"color",o.color,a,n),_t(Number,s,"width",o.width,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Number,s,"outlineWidth",o.outlineWidth,a,n),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"resolution",o.resolution,a,n),_t(Number,s,"leadTime",o.leadTime,a,n),_t(Number,s,"trailTime",o.trailTime,a,n)}}function Vt(e,t,r,n){var o=t.point;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.point;l(s)||(e.point=s=new Q),_t(i,s,"color",o.color,a,n),_t(Number,s,"pixelSize",o.pixelSize,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Number,s,"outlineWidth",o.outlineWidth,a,n),_t(Boolean,s,"show",o.show,a,n)}}function kt(e,t,r,n){var o=t.polygon;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.polygon;l(s)||(e.polygon=s=new $),_t(Boolean,s,"show",o.show,a,n),wt(s,"material",o.material,a,n),_t(Number,s,"height",o.height,a,n),_t(Number,s,"extrudedHeight",o.extrudedHeight,a,n),_t(Number,s,"granularity",o.granularity,a,n),_t(Number,s,"stRotation",o.stRotation,a,n),_t(Boolean,s,"fill",o.fill,a,n),_t(Boolean,s,"outline",o.outline,a,n),_t(i,s,"outlineColor",o.outlineColor,a,n),_t(Boolean,s,"perPositionHeight",o.perPositionHeight,a,n)}}function Ut(e,t,r,n){var o=t.polyline;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.polyline;l(s)||(e.polyline=s=new K);var u=s.material;if(l(a)){var c,h=u;h instanceof I||(h=new I,s.material=h,l(u)&&(c=v.MAXIMUM_INTERVAL.clone(),c.data=u,h.intervals.addInterval(c))),c=h.intervals.findInterval(a.start,a.stop,a.isStartIncluded,a.isStopIncluded),l(c)?u=c.data:(u=new k,c=a.clone(),c.data=u,h.intervals.addInterval(c))}else u instanceof k||(u=new k,s.material=u);_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"width",o.width,a,n),_t(i,u,"color",o.color,a,n),_t(i,u,"outlineColor",o.outlineColor,a,n),_t(Number,u,"outlineWidth",o.outlineWidth,a,n)}}function Wt(e,r,i,n){var o,a,s=[],u=r.unitSpherical;if(l(u)){for(o=0,a=u.length;a>o;o+=2)s.push(new b(u[o],u[o+1]));r.array=s}if(u=r.unitCartesian,l(u)){for(o=0,a=u.length;a>o;o+=3)s.push(b.fromCartesian3(new t(u[o],u[o+1],u[o+2])));r.array=s}_t(Array,e,"directions",r,i,n)}function Gt(e,t,r,n){var o=t.pyramid;if(l(o)){var a=o.interval;l(a)&&(a=T.fromIso8601(a));var s=e.pyramid;l(s)||(e.pyramid=s=new et),_t(Boolean,s,"show",o.show,a,n),_t(Number,s,"radius",o.radius,a,n),_t(Boolean,s,"showIntersection",o.showIntersection,a,n),_t(i,s,"intersectionColor",o.intersectionColor,a,n),_t(Number,s,"intersectionWidth",o.intersectionWidth,a,n),wt(s,"material",o.material,a,n);var u=o.directions;if(l(u))if(f(u))for(var c=u.length,h=0;c>h;h++)Wt(s,u[h],a,n);else Wt(s,u,a,n)}}function Ht(e,r,n,o){var a=r.vector;if(l(a)){var s=a.interval;l(s)&&(s=T.fromIso8601(s));var u=e.vector;l(u)||(e.vector=u=new tt),_t(i,u,"color",a.color,s,o),_t(Boolean,u,"show",a.show,s,o),_t(Number,u,"width",a.width,s,o),_t(t,u,"direction",a.direction,s,o),_t(Number,u,"length",a.length,s,o)}}function jt(e,t,r,i,n){var o=e.id;if(l(o)||(o=a()),e["delete"]===!0)t.removeById(o);else{var s;s="document"===o?n._document:t.getOrCreateObject(o);var u=e.parent;l(u)&&(s.parent=t.getOrCreateObject(u));for(var c=r.length-1;c>-1;c--)r[c](s,e,t,i)}}function qt(e,t,r){var i=e._dynamicObjectCollection;i.suspendEvents(),Kt._processCzml(t,i,r,void 0,e);var a,s=e._document,u=!1;if(l(s.clock))a=s.clock;else{var c=i.computeAvailability();if(!c.start.equals(v.MINIMUM_VALUE)){var h=c.start,d=c.stop,p=h.getSecondsDifference(d),f=Math.round(p/120);a=new F,a.startTime=h,a.stopTime=d,a.clockRange=n.LOOP_STOP,a.multiplier=f,a.currentTime=h,a.clockStep=o.SYSTEM_CLOCK_MULTIPLIER}}l(a)&&(l(e._clock)||(e._clock=new F,u=!0),a.equals(e._clock)||(a.clone(e._clock),u=!0));var g;l(s.name)?g=s.name:l(r)&&(g=m(r)),e._name!==g&&(e._name=g,u=!0),i.resumeEvents(),u&&e._changed.raiseEvent(e)}var Yt=function(){this._definitionChanged=new d,this._x=void 0,this._xSubscription=void 0,this._y=void 0,this._ySubscription=void 0,this.x=new N(0),this.y=new N(.1)};u(Yt.prototype,{isConstant:{get:function(){return this._x.isConstant&&this._y.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},x:B("x"),y:B("y")}),Yt.prototype.getValue=function(t,r){return l(r)||(r=new e),r.x=this._x.getValue(t),r.y=this._y.getValue(t),r},Yt.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Xt=new t,Zt=new b,Jt=new r,Qt={HERMITE:p,LAGRANGE:_,LINEAR:y},Kt=function(e){this._name=e,this._changed=new d,this._error=new d,this._clock=void 0,this._dynamicObjectCollection=new Z,this._timeVarying=!0,this._document=new X};return Kt.updaters=[Ot,It,Lt,Nt,Rt,Bt,zt,Et,xt,Ft,Vt,kt,Ut,Gt,Ht,bt,Tt,At,Dt,Mt],Kt.prototype.getChangedEvent=function(){return this._changed},Kt.prototype.getErrorEvent=function(){return this._error},Kt.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},Kt.prototype.getName=function(){return this._name},Kt.prototype.getClock=function(){return this._clock},Kt.prototype.getIsTimeVarying=function(){return this._timeVarying},Kt.prototype.process=function(e,t){qt(this,e,t)},Kt.prototype.load=function(e,t){this._document=new X("document"),this._dynamicObjectCollection.removeAll(),qt(this,e,t)},Kt.prototype.processUrl=function(e){var t=this;return ut(C(e),function(r){t.process(r,e)},function(e){return t._error.raiseEvent(t,e),ut.reject(e)})},Kt.prototype.loadUrl=function(e){var t=this;return ut(C(e),function(r){t.load(r,e)},function(e){return t._error.raiseEvent(t,e),ut.reject(e)})},Kt.processPacketData=_t,Kt.processPositionPacketData=Ct,Kt.processMaterialPacketData=wt,Kt._processCzml=function(e,t,r,i,n){if(i=l(i)?i:Kt.updaters,f(e))for(var o=0,a=e.length;a>o;o++)jt(e[o],t,i,r,n);else jt(e,t,i,r,n)},Kt}),r("DynamicScene/DataSource",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.getChangedEvent=e.throwInstantiationError,t.prototype.getErrorEvent=e.throwInstantiationError,t.prototype.getDynamicObjectCollection=e.throwInstantiationError,t.prototype.getName=e.throwInstantiationError,t.prototype.getClock=e.throwInstantiationError,t.prototype.getIsTimeVarying=e.throwInstantiationError,t}),r("DynamicScene/DataSourceCollection",["../Core/DeveloperError","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Event"],function(e,t,r,i,n){"use strict";var o=function(){this._dataSources=[],this.dataSourceAdded=new n,this.dataSourceRemoved=new n};return r(o.prototype,{length:{get:function(){return this._dataSources.length}}}),o.prototype.add=function(e){this._dataSources.push(e),this.dataSourceAdded.raiseEvent(this,e)},o.prototype.remove=function(e,t){var r=this._dataSources.indexOf(e);return-1!==r?(this._dataSources.splice(r,1),this.dataSourceRemoved.raiseEvent(this,e),"function"==typeof e.destroy&&t&&e.destroy(),!0):!1},o.prototype.removeAll=function(e){for(var t=this._dataSources,r=t.length-1;r>=0;r--)this.remove(t[r],e)},o.prototype.contains=function(e){return-1!==this.indexOf(e)},o.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},o.prototype.get=function(e){return this._dataSources[e]},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return this.removeAll(!0),i(this)},o}),r("Renderer/BlendEquation",["../Core/Enumeration"],function(e){"use strict";var t={ADD:new e(32774,"ADD"),SUBTRACT:new e(32778,"SUBTRACT"),REVERSE_SUBTRACT:new e(32779,"REVERSE_SUBTRACT"),validate:function(e){return e===t.ADD||e===t.SUBTRACT||e===t.REVERSE_SUBTRACT}};return t}),r("Renderer/BlendFunction",["../Core/Enumeration"],function(e){"use strict";var t={ZERO:new e(0,"ZERO"),ONE:new e(1,"ONE"),SOURCE_COLOR:new e(768,"SOURCE_COLOR"),ONE_MINUS_SOURCE_COLOR:new e(769,"ONE_MINUS_SOURCE_COLOR"),DESTINATION_COLOR:new e(774,"DESTINATION_COLOR"),ONE_MINUS_DESTINATION_COLOR:new e(775,"ONE_MINUS_DESTINATION_COLOR"),SOURCE_ALPHA:new e(770,"SOURCE_ALPHA"),ONE_MINUS_SOURCE_ALPHA:new e(771,"ONE_MINUS_SOURCE_ALPHA"),DESTINATION_ALPHA:new e(772,"DESTINATION_ALPHA"),ONE_MINUS_DESTINATION_ALPHA:new e(773,"ONE_MINUS_DESTINATION_ALPHA"),CONSTANT_COLOR:new e(32769,"CONSTANT_COLOR"),ONE_MINUS_CONSTANT_COLOR:new e(32770,"ONE_MINUS_CONSTANT_COLOR"),CONSTANT_ALPHA:new e(32771,"CONSTANT_ALPHA"),ONE_MINUS_CONSTANT_ALPHA:new e(32772,"ONE_MINUS_CONSTANT_ALPHA"),SOURCE_ALPHA_SATURATE:new e(776,"SOURCE_ALPHA_SATURATE"),validate:function(e){return e===t.ZERO||e===t.ONE||e===t.SOURCE_COLOR||e===t.ONE_MINUS_SOURCE_COLOR||e===t.DESTINATION_COLOR||e===t.ONE_MINUS_DESTINATION_COLOR||e===t.SOURCE_ALPHA||e===t.ONE_MINUS_SOURCE_ALPHA||e===t.DESTINATION_ALPHA||e===t.ONE_MINUS_DESTINATION_ALPHA||e===t.CONSTANT_COLOR||e===t.ONE_MINUS_CONSTANT_COLOR||e===t.CONSTANT_ALPHA||e===t.ONE_MINUS_CONSTANT_ALPHA||e===t.SOURCE_ALPHA_SATURATE}};return t}),r("Renderer/BlendingState",["./BlendEquation","./BlendFunction"],function(e,t){"use strict";var r={DISABLED:{enabled:!1},ALPHA_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.SOURCE_ALPHA,functionSourceAlpha:t.SOURCE_ALPHA,functionDestinationRgb:t.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:t.ONE_MINUS_SOURCE_ALPHA},PRE_MULTIPLIED_ALPHA_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.ONE,functionSourceAlpha:t.ONE,functionDestinationRgb:t.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:t.ONE_MINUS_SOURCE_ALPHA},ADDITIVE_BLEND:{enabled:!0,equationRgb:e.ADD,equationAlpha:e.ADD,functionSourceRgb:t.SOURCE_ALPHA,functionSourceAlpha:t.SOURCE_ALPHA,functionDestinationRgb:t.ONE,functionDestinationAlpha:t.ONE}};return r}),r("Renderer/BufferUsage",["../Core/Enumeration"],function(e){"use strict";var t={STREAM_DRAW:new e(35040,"STREAM_DRAW"),STATIC_DRAW:new e(35044,"STATIC_DRAW"),DYNAMIC_DRAW:new e(35048,"DYNAMIC_DRAW"),validate:function(e){return e===t.STREAM_DRAW||e===t.STATIC_DRAW||e===t.DYNAMIC_DRAW}};return t}),r("Renderer/DrawCommand",[],function(){"use strict";var e=function(){this.boundingVolume=void 0,this.cull=!0,this.modelMatrix=void 0,this.primitiveType=void 0,this.vertexArray=void 0,this.count=void 0,this.offset=0,this.shaderProgram=void 0,this.uniformMap=void 0,this.renderState=void 0,this.framebuffer=void 0,this.pass=void 0,this.executeInClosestFrustum=!1,this.owner=void 0,this.debugShowBoundingVolume=!1,this.debugOverlappingFrustums=0};return e.prototype.execute=function(e,t){e.draw(this,t)},e}),r("Renderer/Pass",[],function(){"use strict";var e={OPAQUE:0,TRANSLUCENT:1,OVERLAY:2};return e}),r("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./BufferUsage"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var i=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=r(i);if(!o||i.getSizeInBytes()0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function u(e){var t=e.vaByPurpose;if(r(t)){for(var i in t)if(t.hasOwnProperty(i))for(var n=t[i],o=n.length,a=0;o>a;++a)n[a].va.destroy();e.vaByPurpose=void 0}}var c=function(e,t,i){function n(e,t){return t.componentDatatype.sizeInBytes-e.componentDatatype.sizeInBytes}var o=c._verifyAttributes(t);i=i||0;for(var s,l,u,h,d={},m=[],p=o.length,f=0;p>f;++f){var v=o[f];v.vertexBuffer?m.push(v):(u=v.purpose,s=d[u],r(s)||(s=d[u]={}),h=v.usage.toString(),l=s[h],r(l)||(l=s[h]=[]),l.push(v))}this._buffersByPurposeAndUsage={},this._allBuffers=[];for(u in d)if(d.hasOwnProperty(u)){s=d[u];var g=this._buffersByPurposeAndUsage[u];r(g)||(g=this._buffersByPurposeAndUsage[u]={});for(h in s)if(s.hasOwnProperty(h)){l=s[h],l.sort(n);var _,y=c._vertexSizeInBytes(l);switch(h){case a.STATIC_DRAW.toString():_=a.STATIC_DRAW;break;case a.STREAM_DRAW.toString():_=a.STREAM_DRAW;break;case a.DYNAMIC_DRAW.toString():_=a.DYNAMIC_DRAW}var C={purpose:u,vertexSizeInBytes:y,vertexBuffer:void 0,usage:_,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(l,y)};g[h]=C,this._allBuffers.push(C)}}this._size=0,this._precreated=m,this._context=e,this.writers=void 0,this.vaByPurpose=void 0,this.resize(i)};c._verifyAttributes=function(i){for(var o=[],s=0;si;++i){var n=e[i];t+=n.componentsPerAttribute*n.componentDatatype.sizeInBytes}var o=r>0?e[0].componentDatatype.sizeInBytes:0,a=o>0?t%o:0,s=0===a?0:o-a;return t+=s},c._createArrayViews=function(e,t){for(var r=[],i=0,n=e.length,o=0;n>o;++o){var a=e[o],s=a.componentDatatype;r.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/s.sizeInBytes,view:void 0}),i+=a.componentsPerAttribute*s.sizeInBytes}return r},c.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers={};for(var i=0,n=t.length;n>i;++i){var o=t[i];c._resize(o,this._size);var a=this.writers[o.purpose];r(a)||(a=this.writers[o.purpose]=[]),c._appendWriters(a,o)}u(this)},c._resize=function(t,r){if(t.vertexSizeInBytes>0){var i=new ArrayBuffer(r*t.vertexSizeInBytes);if(t.arrayBuffer)for(var n=new Uint8Array(i),o=new Uint8Array(t.arrayBuffer),a=o.length,s=0;a>s;++s)n[s]=o[s];for(var l=t.arrayViews,u=l.length,c=0;u>c;++c){var h=l[c];h.view=e.createArrayBufferView(h.componentDatatype,i,h.offsetInBytes)}t.arrayBuffer=i}};var h=[function(e,t,r){return function(i,n){t[i*r]=n,e.needsCommit=!0}},function(e,t,r){return function(i,n,o){var a=i*r;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a){var s=i*r;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a,s){var l=i*r;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return c._appendWriters=function(e,t){for(var r=t.arrayViews,i=r.length,n=0;i>n;++n){var o=r[n];e[o.index]=h[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},c.prototype.commit=function(e){for(var t,i=!1,n=this._allBuffers,a=0,l=n.length;l>a;++a)t=n[a],i=s(this,t)||i;if(i||!r(this.vaByPurpose)){var h=this._buffersByPurposeAndUsage;u(this),this.vaByPurpose={};for(var d in h)if(h.hasOwnProperty(d)){for(var m=h[d],p=[],f=Math.ceil(this._size/o.SIXTY_FOUR_KILOBYTES),v=0;f>v;++v){var g=[],_=h.all;if(_!==m)for(var y in _)if(_.hasOwnProperty(y)){var C=_[y];c._appendAttributes(g,C,v*C.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES)}for(var S in m)m.hasOwnProperty(S)&&(t=m[S],c._appendAttributes(g,t,v*t.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES));g=g.concat(this._precreated),p.push({va:this._context.createVertexArray(g,e),indicesCount:1.5*(v!==f-1?o.SIXTY_FOUR_KILOBYTES:this._size%o.SIXTY_FOUR_KILOBYTES)})}this.vaByPurpose[d]=p}}},c._appendAttributes=function(e,t,r){for(var i=t.arrayViews,n=i.length,o=0;n>o;++o){var a=i[o];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:r+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes})}},c.prototype.subCommit=function(e,t){for(var r=this._allBuffers,i=0,n=r.length;n>i;++i)l(r[i],e,t)},c.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t)e[t].needsCommit=!1},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return u(this),i(this)},c}),r("Renderer/createShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError"],function(e,t,r){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT);var n=i.defines,o=i.sources,a=i.pickColorQualifier;if(t(a)&&"uniform"!==a&&"varying"!==a)throw new r("options.pickColorQualifier must be 'uniform' or 'varying'.");var s,l,u="";if(t(n)&&n.length>0)for(l=n.length,s=0;l>s;++s)0!==n[s].length&&(u+="#define "+n[s]+"\n");if(t(o)&&o.length>0)for(l=o.length,s=0;l>s;++s)u+="\n#line 0\n"+o[s];if(t(a)){var c=u.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),h=a+" vec4 czm_pickColor; \n"+"void main() \n"+"{ \n"+" czm_old_main(); \n"+" if (gl_FragColor.a == 0.0) { \n"+" discard; \n"+" } \n"+" gl_FragColor = czm_pickColor; \n"+"}";u=c+"\n"+h}return u}return i}),r("Scene/SceneMode",["../Core/Enumeration"],function(e){"use strict";var t={SCENE2D:new e(0,"SCENE2D",{morphTime:0}),COLUMBUS_VIEW:new e(1,"COLUMBUS_VIEW",{morphTime:0}),SCENE3D:new e(2,"SCENE3D",{morphTime:1}),MORPHING:new e(3,"MORPHING")};return t}),r("Scene/SceneTransforms",["../Core/defined","../Core/DeveloperError","../Core/Cartographic","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Matrix4","../Core/BoundingRectangle","../Core/Math","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c,h={},d=new o(0,0,0,1),m=new o;h.wgs84ToWindowCoordinates=function(t,r,i){if(h.computeActualWgs84Position(t.frameState,r,d),!e(d))return i=void 0,void 0;var n=t.camera;return c=a.multiply(n.frustum.projectionMatrix,n.viewMatrix,c),a.multiplyByVector(c,d,m),h.clipToWindowCoordinates(t.context,m,i)},h.wgs84ToDrawingBufferCoordinates=function(t,r,i){if(h.computeActualWgs84Position(t.frameState,r,d),!e(d))return void 0;var n=t.context.getUniformState().getViewProjection();return a.multiplyByVector(n,o.fromElements(d.x,d.y,d.z,1,m),m),h.clipToDrawingBufferCoordinates(t.context,m,i)};var p=new n,f=new r;h.computeActualWgs84Position=function(t,r,i){var o=t.mode;if(o===u.SCENE3D)return n.clone(r,i);var a=t.scene2D.projection;if(a.ellipsoid.cartesianToCartographic(r,f),!e(f))return i=void 0;if(a.project(f,p),o===u.COLUMBUS_VIEW)return n.fromElements(p.z,p.x,p.y,i);if(o===u.SCENE2D)return n.fromElements(0,p.x,p.y,i);var s=t.morphTime;return n.fromElements(l.lerp(p.z,r.x,s),l.lerp(p.x,r.y,s),l.lerp(p.y,r.z,s),i)};var v=new n,g=new n,_=new s,y=new a;return h.clipToWindowCoordinates=function(e,t,r){var o=e.getCanvas();return n.divideByScalar(t,t.w,v),_.width=o.clientWidth,_.height=o.clientHeight,a.computeViewportTransformation(_,0,1,y),a.multiplyByPoint(y,v,g),i.fromCartesian3(g,r)},h.clipToDrawingBufferCoordinates=function(e,t,r){return n.divideByScalar(t,t.w,v),_.width=e.getDrawingBufferWidth(),_.height=e.getDrawingBufferHeight(),a.computeViewportTransformation(_,0,1,y),a.multiplyByPoint(y,v,g),i.fromCartesian3(g,r)},h.transformWindowToDrawingBuffer=function(e,t,r){var n=e.getCanvas(),o=e.getDrawingBufferWidth()/n.clientWidth,a=e.getDrawingBufferHeight()/n.clientHeight;return i.fromElements(t.x*o,t.y*a,r)},h}),r("Scene/Billboard",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/NearFarScalar","../Core/Matrix4","./HorizontalOrigin","./VerticalOrigin","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,r){var i=e._billboardCollection;t(i)&&(i._updateBillboard(e,r),e._dirty=!0)}var p=function(t,r){t=e(t,e.EMPTY_OBJECT),this._show=e(t.show,!0),this._position=o.clone(e(t.position,o.ZERO)),this._actualPosition=o.clone(this._position),this._pixelOffset=n.clone(e(t.pixelOffset,n.ZERO)),this._translate=new n(0,0),this._eyeOffset=o.clone(e(t.eyeOffset,o.ZERO)),this._verticalOrigin=e(t.verticalOrigin,c.CENTER),this._horizontalOrigin=e(t.horizontalOrigin,u.CENTER),this._scale=e(t.scale,1),this._imageIndex=e(t.imageIndex,-1),this._color=i.clone(e(t.color,i.WHITE)),this._rotation=e(t.rotation,0),this._alignedAxis=o.clone(e(t.alignedAxis,o.ZERO)),this._width=t.width,this._height=t.height,this._scaleByDistance=t.scaleByDistance,this._translucencyByDistance=t.translucencyByDistance,this._pixelOffsetScaleByDistance=t.pixelOffsetScaleByDistance,this._id=t.id,this._collection=e(t.collection,r),this._pickId=void 0,this._pickIdThis=t._pickIdThis,this._billboardCollection=r,this._dirty=!1,this._index=-1},f=p.SHOW_INDEX=0,v=p.POSITION_INDEX=1,g=p.PIXEL_OFFSET_INDEX=2,_=p.EYE_OFFSET_INDEX=3,y=p.HORIZONTAL_ORIGIN_INDEX=4,C=p.VERTICAL_ORIGIN_INDEX=5,S=p.SCALE_INDEX=6,w=p.IMAGE_INDEX_INDEX=7,E=p.COLOR_INDEX=8,x=p.ROTATION_INDEX=9,b=p.ALIGNED_AXIS_INDEX=10,T=p.SCALE_BY_DISTANCE_INDEX=11,A=p.TRANSLUCENCY_BY_DISTANCE_INDEX=12,P=p.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;p.NUMBER_OF_PROPERTIES=14,p.prototype.getPickId=function(r){return t(this._pickId)||(this._pickId=r.createPickId({primitive:e(this._pickIdThis,this),collection:this._collection,id:this._id})),this._pickId},p.prototype.getShow=function(){return this._show},p.prototype.setShow=function(e){e!==this._show&&(this._show=e,m(this,f))},p.prototype.getPosition=function(){return this._position},p.prototype.setPosition=function(e){var t=this._position;o.equals(t,e)||(o.clone(e,t),o.clone(e,this._actualPosition),m(this,v))},p.prototype._getActualPosition=function(){return this._actualPosition
+},p.prototype._setActualPosition=function(e){o.clone(e,this._actualPosition),m(this,v)},p.prototype.getPixelOffset=function(){return this._pixelOffset},p.prototype.setPixelOffset=function(e){var t=this._pixelOffset;n.equals(t,e)||(n.clone(e,t),m(this,g))},p.prototype._setTranslate=function(e){var t=this._translate;n.equals(t,e)||(n.clone(e,t),m(this,g))},p.prototype.getScaleByDistance=function(){return this._scaleByDistance},p.prototype.setScaleByDistance=function(e){s.equals(this._scaleByDistance,e)||(m(this,T),this._scaleByDistance=s.clone(e,this._scaleByDistance))},p.prototype.getTranslucencyByDistance=function(){return this._translucencyByDistance},p.prototype.setTranslucencyByDistance=function(e){s.equals(this._translucencyByDistance,e)||(m(this,A),this._translucencyByDistance=s.clone(e,this._translucencyByDistance))},p.prototype.getPixelOffsetScaleByDistance=function(){return this._pixelOffsetScaleByDistance},p.prototype.setPixelOffsetScaleByDistance=function(e){s.equals(this._pixelOffsetScaleByDistance,e)||(m(this,P),this._pixelOffsetScaleByDistance=s.clone(e,this._pixelOffsetScaleByDistance))},p.prototype.getEyeOffset=function(){return this._eyeOffset},p.prototype.setEyeOffset=function(e){var t=this._eyeOffset;o.equals(t,e)||(o.clone(e,t),m(this,_))},p.prototype.getHorizontalOrigin=function(){return this._horizontalOrigin},p.prototype.setHorizontalOrigin=function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,m(this,y))},p.prototype.getVerticalOrigin=function(){return this._verticalOrigin},p.prototype.setVerticalOrigin=function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,m(this,C))},p.prototype.getScale=function(){return this._scale},p.prototype.setScale=function(e){this._scale!==e&&(this._scale=e,m(this,S))},p.prototype.getImageIndex=function(){return this._imageIndex},p.prototype.setImageIndex=function(e){this._imageIndex!==e&&(this._imageIndex=e,m(this,w))},p.prototype.getColor=function(){return this._color},p.prototype.setColor=function(e){var t=this._color;i.equals(t,e)||(i.clone(e,t),m(this,E))},p.prototype.getRotation=function(){return this._rotation},p.prototype.setRotation=function(e){this._rotation!==e&&(this._rotation=e,m(this,x))},p.prototype.getAlignedAxis=function(){return this._alignedAxis},p.prototype.setAlignedAxis=function(e){var t=this._alignedAxis;o.equals(t,e)||(o.clone(e,t),m(this,b))},p.prototype.getWidth=function(){return this._width},p.prototype.setWidth=function(e){this._width!==e&&(this._width=e,m(this,w))},p.prototype.getHeight=function(){return this._height},p.prototype.setHeight=function(e){this._height!==e&&(this._height=e,m(this,w))},p.prototype.getId=function(){return this._id};var D=new a;p._computeActualPosition=function(e,t,r){return t.mode===h.SCENE3D?e:(l.multiplyByPoint(r,e,D),d.computeActualWgs84Position(t,D))};var M=new l,I=new a,O=new o,R=new n;p._computeScreenSpacePosition=function(e,t,r,i,s,u){var c=u.camera,h=c.viewMatrix,m=c.frustum.projectionMatrix,p=l.multiplyTransformation(h,e,M),f=l.multiplyByVector(p,a.fromElements(t.x,t.y,t.z,1,I),I),v=o.multiplyComponents(r,o.normalize(f,O),O);f.x+=r.x+v.x,f.y+=r.y+v.y,f.z+=v.z;var g=l.multiplyByVector(m,f,I),_=d.clipToWindowCoordinates(s,g,new n),y=s.getUniformState(),C=n.multiplyByScalar(i,y.getHighResolutionSnapScale(),R);return _.x+=C.x,_.y+=C.y,_};var L=new n(0,0);return p.prototype.computeScreenSpacePosition=function(e,t){var r=this._billboardCollection;n.clone(this._pixelOffset,L),n.add(L,this._translate,L);var i=r.modelMatrix;return p._computeScreenSpacePosition(i,this._actualPosition,this._eyeOffset,L,e,t)},p.prototype.equals=function(e){return this===e||t(e)&&this._show===e._show&&this._imageIndex===e._imageIndex&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&o.equals(this._position,e._position)&&i.equals(this._color,e._color)&&n.equals(this._pixelOffset,e._pixelOffset)&&n.equals(this._translate,e._translate)&&o.equals(this._eyeOffset,e._eyeOffset)&&s.equals(this._scaleByDistance,e._scaleByDistance)&&s.equals(this._translucencyByDistance,e._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&this._id===e._id},p.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},p}),r("Shaders/BillboardCollectionVS",[],function(){"use strict";return"attribute vec3 positionHigh;\nattribute vec3 positionLow;\nattribute vec2 direction;\nattribute vec4 textureCoordinatesAndImageSize;\nattribute vec3 originAndShow;\nattribute vec4 pixelOffsetAndTranslate;\nattribute vec4 eyeOffsetAndScale;\nattribute vec4 rotationAndAlignedAxis;\nattribute vec4 scaleByDistance;\nattribute vec4 translucencyByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\n#ifdef RENDER_FOR_PICK\nattribute vec4 pickColor;\n#else\nattribute vec4 color;\n#endif\nconst vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nfloat getNearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\ncameraDistSq = clamp(cameraDistSq, nearDistanceSq, farDistanceSq);\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(t, 0.15);\nreturn mix(valueAtMin, valueAtMax, t);\n}\nvoid main()\n{\nvec3 eyeOffset = eyeOffsetAndScale.xyz;\nfloat scale = eyeOffsetAndScale.w;\nvec2 textureCoordinates = textureCoordinatesAndImageSize.xy;\nvec2 imageSize = textureCoordinatesAndImageSize.zw;\nvec2 origin = originAndShow.xy;\nfloat show = originAndShow.z;\nvec2 pixelOffset = pixelOffsetAndTranslate.xy;\nvec2 translate = pixelOffsetAndTranslate.zw;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= getNearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = getNearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = getNearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = imageSize * scale * czm_highResolutionSnapScale;\nhalfSize *= ((direction * 2.0) - 1.0);\npositionWC.xy += (origin * abs(halfSize));\n#ifdef ROTATION\nfloat rotation = rotationAndAlignedAxis.x;\nvec3 alignedAxis = rotationAndAlignedAxis.yzw;\nif (!all(equal(rotationAndAlignedAxis, vec4(0.0))))\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\npositionWC.xy += halfSize;\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_highResolutionSnapScale);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),r("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),r("Scene/BillboardCollection",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Color","../Core/defaultValue","../Core/destroyObject","../Core/Cartesian2","../Core/Cartesian3","../Core/EncodedCartesian3","../Core/Matrix4","../Core/ComponentDatatype","../Core/IndexDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/VertexArrayFacade","../Renderer/createShaderSource","./SceneMode","./Billboard","./HorizontalOrigin","../Shaders/BillboardCollectionVS","../Shaders/BillboardCollectionFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x){"use strict";function b(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],r=e._billboards,i=r.length,n=0,o=0;i>n;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function T(t){var r=16384,i=t.cache.billboardCollection_directionsVertexBuffer;if(e(i))return i;for(var n=new Uint8Array(2*4*r),o=0,a=0;r>o;++o)n[a++]=0,n[a++]=0,n[a++]=255,n[a++]=0,n[a++]=255,n[a++]=255,n[a++]=0,n[a++]=255;return i=t.createVertexBuffer(n,f.STATIC_DRAW),i.setVertexArrayDestroyable(!1),t.cache.billboardCollection_directionsVertexBuffer=i,i}function A(t){var r=16384,i=t.cache.billboardCollection_indexBuffer;if(e(i))return i;for(var n=6*r,o=new Uint16Array(n),a=0,s=0;n>a;a+=6,s+=4)o[a]=s,o[a+1]=s+1,o[a+2]=s+2,o[a+3]=s+0,o[a+4]=s+2,o[a+5]=s+3;return i=t.createIndexBuffer(o,f.STATIC_DRAW,h.UNSIGNED_SHORT),i.setVertexArrayDestroyable(!1),t.cache.billboardCollection_indexBuffer=i,i}function P(e,t,r){var i=T(e);return new _(e,[{index:ot.positionHigh,componentsPerAttribute:3,componentDatatype:c.FLOAT,usage:r[j]},{index:ot.positionLow,componentsPerAttribute:3,componentDatatype:c.FLOAT,usage:r[j]},{index:ot.pixelOffsetAndTranslate,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[q]},{index:ot.eyeOffsetAndScale,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[J]},{index:ot.textureCoordinatesAndImageSize,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[Q]},{index:ot.pickColor,componentsPerAttribute:4,normalize:!0,componentDatatype:c.UNSIGNED_BYTE,usage:f.STATIC_DRAW,purpose:lt},{index:ot.color,componentsPerAttribute:4,normalize:!0,componentDatatype:c.UNSIGNED_BYTE,usage:r[K],purpose:st},{index:ot.originAndShow,componentsPerAttribute:3,componentDatatype:c.BYTE,usage:r[H]},{index:ot.direction,vertexBuffer:i,componentsPerAttribute:2,normalize:!0,componentDatatype:c.UNSIGNED_BYTE},{index:ot.rotationAndAlignedAxis,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[$]},{index:ot.scaleByDistance,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[tt]},{index:ot.translucencyByDistance,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[rt]},{index:ot.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:c.FLOAT,usage:r[it]}],4*t)}function D(e,t,r,i,n){var o=4*n._index,a=n._getActualPosition();e._mode===C.SCENE3D&&(e._baseVolume.expand(a,e._baseVolume),e._boundingVolumeDirty=!0),l.fromCartesian(a,ct);var s=i[at],u=s[ot.positionHigh],c=ct.high;u(o+0,c.x,c.y,c.z),u(o+1,c.x,c.y,c.z),u(o+2,c.x,c.y,c.z),u(o+3,c.x,c.y,c.z);var h=s[ot.positionLow],d=ct.low;h(o+0,d.x,d.y,d.z),h(o+1,d.x,d.y,d.z),h(o+2,d.x,d.y,d.z),h(o+3,d.x,d.y,d.z)}function M(e,t,r,i,n){var o=4*n._index,a=n.getPixelOffset(),s=n._translate;e._maxPixelOffset=Math.max(e._maxPixelOffset,a.x+s.x,a.y+s.y);var l=i[at],u=l[ot.pixelOffsetAndTranslate];u(o+0,a.x,a.y,s.x,s.y),u(o+1,a.x,a.y,s.x,s.y),u(o+2,a.x,a.y,s.x,s.y),u(o+3,a.x,a.y,s.x,s.y)}function I(e,t,r,i,n){var o=4*n._index,a=n.getEyeOffset(),s=n.getScale();e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(a.z)),e._maxScale=Math.max(e._maxScale,s);var l=i[at],u=l[ot.eyeOffsetAndScale];u(o+0,a.x,a.y,a.z,s),u(o+1,a.x,a.y,a.z,s),u(o+2,a.x,a.y,a.z,s),u(o+3,a.x,a.y,a.z,s)}function O(e,t,r,n,o){var a=4*o._index,s=n[lt],l=s[ot.pickColor],u=o.getPickId(t).color,c=i.floatToByte(u.red),h=i.floatToByte(u.green),d=i.floatToByte(u.blue),m=i.floatToByte(u.alpha);l(a+0,c,h,d,m),l(a+1,c,h,d,m),l(a+2,c,h,d,m),l(a+3,c,h,d,m)}function R(e,t,r,n,o){var a=4*o._index,s=n[st],l=s[ot.color],u=o.getColor(),c=i.floatToByte(u.red),h=i.floatToByte(u.green),d=i.floatToByte(u.blue),m=i.floatToByte(u.alpha);l(a+0,c,h,d,m),l(a+1,c,h,d,m),l(a+2,c,h,d,m),l(a+3,c,h,d,m)}function L(e,t,r,i,n){var o=4*n._index,a=n.getHorizontalOrigin().value,s=n.getVerticalOrigin().value,l=n.getShow();0===n.getColor().alpha&&(l=!1),e._allHorizontalCenter=e._allHorizontalCenter&&a===w.CENTER.value;var u=i[at],c=u[ot.originAndShow];c(o+0,a,s,l),c(o+1,a,s,l),c(o+2,a,s,l),c(o+3,a,s,l)}function N(e,t,r,i,o){var a=4*o._index,s=0,l=0,u=0,c=0,h=o.getImageIndex();if(-1!==h){var d=r[h];s=d.x,l=d.y,u=d.width,c=d.height}var m=s+u,p=l+c,f=e._textureAtlas.getTexture().getDimensions(),v=.5*n(o.getWidth(),f.x*u),g=.5*n(o.getHeight(),f.y*c);e._maxSize=Math.max(e._maxSize,v,g);var _=i[at],y=_[ot.textureCoordinatesAndImageSize];y(a+0,s,l,v,g),y(a+1,m,l,v,g),y(a+2,m,p,v,g),y(a+3,s,p,v,g)}function B(e,t,r,i,n){var o=4*n._index,a=n.getRotation(),l=n.getAlignedAxis();0===a&&s.equals(l,s.ZERO)||(e._shaderRotation=!0);var u=l.x,c=l.y,h=l.z,d=i[at],m=d[ot.rotationAndAlignedAxis];m(o+0,a,u,c,h),m(o+1,a,u,c,h),m(o+2,a,u,c,h),m(o+3,a,u,c,h)}function z(t,r,i,n,o){var a=4*o._index,s=n[at],l=s[ot.scaleByDistance],u=0,c=1,h=1,d=1,m=o.getScaleByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderScaleByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function F(t,r,i,n,o){var a=4*o._index,s=n[at],l=s[ot.translucencyByDistance],u=0,c=1,h=1,d=1,m=o.getTranslucencyByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderTranslucencyByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function V(t,r,i,n,o){var a=4*o._index,s=n[at],l=s[ot.pixelOffsetScaleByDistance],u=0,c=1,h=1,d=1,m=o.getPixelOffsetScaleByDistance();e(m)&&(u=m.near,c=m.nearValue,h=m.far,d=m.farValue,(1!==c||1!==d)&&(t._shaderPixelOffsetScaleByDistance=!0)),l(a+0,u,c,h,d),l(a+1,u,c,h,d),l(a+2,u,c,h,d),l(a+3,u,c,h,d)}function k(e,t,r,i,n){D(e,t,r,i,n),M(e,t,r,i,n),I(e,t,r,i,n),O(e,t,r,i,n),R(e,t,r,i,n),L(e,t,r,i,n),N(e,t,r,i,n),B(e,t,r,i,n),z(e,t,r,i,n),F(e,t,r,i,n),V(e,t,r,i,n)}function U(t,r,i,n,o,a){var s;n.mode===C.SCENE3D?(s=t._baseVolume,t._boundingVolumeDirty=!0):s=t._baseVolume2D;for(var l=[],u=0;i>u;++u){var c=r[u],h=c.getPosition(),d=S._computeActualPosition(h,n,o);e(d)&&(c._setActualPosition(d),a?l.push(d):s.expand(d,s))}a&&m.fromPoints(l,s)}function W(e,t){var r=t.mode,i=t.scene2D.projection,n=e._billboards,o=e._billboardsToUpdate,a=e._modelMatrix;e._mode!==r||e._projection!==i||r!==C.SCENE3D&&!u.equals(a,e.modelMatrix)?(e._mode=r,e._projection=i,u.clone(e.modelMatrix,a),e._createVertexArray=!0,(r===C.SCENE3D||r===C.SCENE2D||r===C.COLUMBUS_VIEW)&&U(e,n,n.length,t,a,!0)):r===C.MORPHING?U(e,n,n.length,t,a,!0):(r===C.SCENE2D||r===C.COLUMBUS_VIEW)&&U(e,o,e._billboardsToUpdateIndex,t,a,!1)}function G(e,t,r,i){var n,o,a,l=r.camera,u=l.frustum,c=s.subtract(l.positionWC,i.center,dt),h=s.multiplyByScalar(l.directionWC,s.dot(c,l.directionWC),mt),d=Math.max(0,s.magnitude(h)-i.radius);ht.x=t.getDrawingBufferWidth(),ht.y=t.getDrawingBufferHeight();var m=u.getPixelSize(ht,d);n=Math.max(m.x,m.y),o=2*n*e._maxScale*e._maxSize,e._allHorizontalCenter&&(o*=.5),a=n*e._maxPixelOffset+e._maxEyeOffset,i.radius+=o+a}var H=S.SHOW_INDEX,j=S.POSITION_INDEX,q=S.PIXEL_OFFSET_INDEX,Y=S.EYE_OFFSET_INDEX,X=S.HORIZONTAL_ORIGIN_INDEX,Z=S.VERTICAL_ORIGIN_INDEX,J=S.SCALE_INDEX,Q=S.IMAGE_INDEX_INDEX,K=S.COLOR_INDEX,$=S.ROTATION_INDEX,et=S.ALIGNED_AXIS_INDEX,tt=S.SCALE_BY_DISTANCE_INDEX,rt=S.TRANSLUCENCY_BY_DISTANCE_INDEX,it=S.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,nt=S.NUMBER_OF_PROPERTIES,ot={positionHigh:0,positionLow:1,pixelOffsetAndTranslate:2,eyeOffsetAndScale:3,textureCoordinatesAndImageSize:4,originAndShow:5,direction:6,pickColor:7,color:7,rotationAndAlignedAxis:8,scaleByDistance:9,translucencyByDistance:10,pixelOffsetScaleByDistance:11},at="all",st="color",lt="pick",ut=function(e){e=n(e,n.EMPTY_OBJECT),this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._propertiesChanged=new Uint32Array(nt),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._baseVolume=new m,this._baseVolumeWC=new m,this._baseVolume2D=new m,this._boundingVolume=new m,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=u.clone(n(e.modelMatrix,u.IDENTITY)),this._modelMatrix=u.clone(u.IDENTITY),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!1),this._mode=C.SCENE3D,this._projection=void 0,this._buffersUsage=[f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW];var t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.getTexture()}}};t(ut.prototype,{length:{get:function(){return b(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),ut.prototype.add=function(e){var t=new S(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},ut.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},ut.prototype.removeAll=function(){this._destroyBillboards(),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},ut.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},ut.prototype.contains=function(t){return e(t)&&t._billboardCollection===this},ut.prototype.get=function(e){return b(this),this._billboards[e]},ut.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;nt>i;++i){var n=0===r[i]?f.STATIC_DRAW:f.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var ct=new l,ht=new a,dt=new s,mt=new s;return ut.prototype.update=function(t,r,i){var n=this._textureAtlas;if(e(n)){var o=n.getTextureCoordinates();if(0!==o.length){b(this),W(this,r);var a=this._billboards,s=a.length,l=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,f=n.getGUID(),_=this._createVertexArray||this._textureAtlasGUID!==f;this._textureAtlasGUID=f;var S,w=r.passes,T=w.pick;if(_||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var O=0;nt>O;++O)h[O]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),s>0){this._vaf=P(t,s,this._buffersUsage),S=this._vaf.writers;for(var U=0;s>U;++U){var at=this._billboards[U];at._dirty=!1,k(this,t,o,S,at)}this._vaf.commit(A(t))}this._billboardsToUpdateIndex=0}else if(c>0){var ut=[];if(h[j]&&ut.push(D),h[q]&&ut.push(M),(h[Y]||h[J])&&ut.push(I),h[Q]&&ut.push(N),h[K]&&ut.push(R),(h[X]||h[Z]||h[H])&&ut.push(L),(h[$]||h[et])&&ut.push(B),h[tt]&&ut.push(z),h[rt]&&ut.push(F),h[it]&&ut.push(V),S=this._vaf.writers,c/s>.1){for(var ct=0;c>ct;++ct){var ht=l[ct];ht._dirty=!1;for(var dt=0;dtmt;++mt){var pt=l[mt];pt._dirty=!1;for(var ft=0;ft1.5*s&&(l.length=s),e(this._vaf)&&e(this._vaf.vaByPurpose)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,m.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var vt,gt=u.IDENTITY;r.mode===C.SCENE3D?(gt=this.modelMatrix,vt=m.clone(this._baseVolumeWC,this._boundingVolume)):vt=m.clone(this._baseVolume2D,this._boundingVolume),G(this,t,r,vt);var _t,yt,Ct,St;if(w.render){var wt=this._colorCommands;for(e(this._rs)||(this._rs=t.createRenderState({depthTest:{enabled:!0},blending:p.ALPHA_BLEND})),(!e(this._sp)||this._shaderRotation&&!this._compiledShaderRotation||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistance)&&(this._sp=t.getShaderCache().replaceShaderProgram(this._sp,y({defines:[this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[E]}),x,ot),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),_t=this._vaf.vaByPurpose[st],yt=_t.length,wt.length=yt,St=0;yt>St;++St)Ct=wt[St],e(Ct)||(Ct=wt[St]=new v),Ct.boundingVolume=vt,Ct.modelMatrix=gt,Ct.primitiveType=d.TRIANGLES,Ct.count=_t[St].indicesCount,Ct.shaderProgram=this._sp,Ct.uniformMap=this._uniforms,Ct.vertexArray=_t[St].va,Ct.renderState=this._rs,Ct.pass=g.OPAQUE,Ct.owner=this,Ct.debugShowBoundingVolume=this.debugShowBoundingVolume,i.push(Ct)}if(T){var Et=this._pickCommands;for((!e(this._spPick)||this._shaderRotation&&!this._compiledShaderRotationPick||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistancePick)&&(this._spPick=t.getShaderCache().replaceShaderProgram(this._spPick,y({defines:["RENDER_FOR_PICK",this._shaderRotation?"ROTATION":"",this._shaderScaleByDistance?"EYE_DISTANCE_SCALING":"",this._shaderTranslucencyByDistance?"EYE_DISTANCE_TRANSLUCENCY":"",this._shaderPixelOffsetScaleByDistance?"EYE_DISTANCE_PIXEL_OFFSET":""],sources:[E]}),y({defines:["RENDER_FOR_PICK"],sources:[x]}),ot),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),_t=this._vaf.vaByPurpose[lt],yt=_t.length,Et.length=yt,St=0;yt>St;++St)Ct=Et[St],e(Ct)||(Ct=Et[St]=new v),Ct.boundingVolume=vt,Ct.modelMatrix=gt,Ct.primitiveType=d.TRIANGLES,Ct.count=_t[St].indicesCount,Ct.shaderProgram=this._spPick,Ct.uniformMap=this._uniforms,Ct.vertexArray=_t[St].va,Ct.renderState=this._rs,Ct.pass=g.OPAQUE,Ct.owner=this,i.push(Ct)}}}}},ut.prototype.isDestroyed=function(){return!1},ut.prototype.destroy=function(){return this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.release(),this._spPick=this._spPick&&this._spPick.release(),this._vaf=this._vaf&&this._vaf.destroy(),this._destroyBillboards(),o(this)},ut.prototype._destroyBillboards=function(){for(var e=this._billboards,t=e.length,r=0;t>r;++r)e[r]&&e[r]._destroy()},ut}),r("Renderer/TextureAtlasBuilder",["../Core/Event","../Core/defined","../Core/DeveloperError","../Core/loadImage"],function(e,t,r,i){"use strict";function n(){this.imageLoaded=new e,this.index=-1,this.loaded=!1}var o=function(e){this.textureAtlas=e,this._idHash={}};return o.prototype.addTextureFromUrl=function(e,t){this.addTextureFromFunction(e,function(e,t){i(e).then(t)},t)},o.prototype.addTextureFromFunction=function(e,r,i){var o=this._idHash[e];if(t(o))return o.loaded?i(o.index):o.imageLoaded.addEventListener(i),void 0;this._idHash[e]=o=new n,o.imageLoaded.addEventListener(i);var a=this;r(e,function(t){if(!a.textureAtlas.isDestroyed()){var r=o.index=a.textureAtlas.addImage(t);o.loaded=!0,o.imageLoaded.raiseEvent(r,e),o.imageLoaded=void 0}})},o}),r("DynamicScene/DynamicBillboardVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","../Renderer/TextureAtlasBuilder"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r,i){return function(n){var o=e._billboardVisualizerIndex;if(t(o)){var a=r.get(o);a._visualizerUrl===i&&(a._visualizerTextureAvailable=!0,a.setImageIndex(n))}}}function h(e,r,a){var u=a._billboard;if(t(u)){var h=a._position;if(t(h)){var d=u._image;if(t(d)){var g,_=u._show,y=a._billboardVisualizerIndex,C=a.isAvailable(r)&&(!t(_)||_.getValue(r));if(!C)return t(y)&&(g=e._billboardCollection.get(y),g.setShow(!1),g.setImageIndex(-1),g._visualizerUrl=void 0,g._visualizerTextureAvailable=!1,a._billboardVisualizerIndex=void 0,e._unusedIndexes.push(y)),void 0;if(t(y))g=e._billboardCollection.get(y);else{var S=e._unusedIndexes,w=S.length;w>0?(y=S.pop(),g=e._billboardCollection.get(y)):(y=e._billboardCollection.length,g=e._billboardCollection.add()),a._billboardVisualizerIndex=y,g.id=a,g._visualizerUrl=void 0,g._visualizerTextureAvailable=!1,g.setColor(i.WHITE),g.setEyeOffset(o.ZERO),g.setPixelOffset(n.ZERO),g.setScale(1),g.setHorizontalOrigin(s.CENTER),g.setVerticalOrigin(l.CENTER)}var E=d.getValue(r);if(E!==g._visualizerUrl&&(g._visualizerUrl=E,g._visualizerTextureAvailable=!1,e._textureAtlasBuilder.addTextureFromUrl(E,c(a,e._billboardCollection,E))),g.setShow(g._visualizerTextureAvailable),g._visualizerTextureAvailable){m=h.getValue(r,m),t(m)&&g.setPosition(m);var x=u._color;if(t(x)&&(p=x.getValue(r,p),t(p)&&g.setColor(p)),x=u._eyeOffset,t(x)&&(f=x.getValue(r,f),t(f)&&g.setEyeOffset(f)),x=u._pixelOffset,t(x)&&(v=x.getValue(r,v),t(v)&&g.setPixelOffset(v)),x=u._scale,t(x)){var b=x.getValue(r);t(b)&&g.setScale(b)}if(x=u._rotation,t(x)){var T=x.getValue(r);t(T)&&g.setRotation(T)}if(x=u._alignedAxis,t(x)){var A=x.getValue(r);t(A)&&g.setAlignedAxis(A)}if(x=u._horizontalOrigin,t(x)){var P=x.getValue(r);t(P)&&g.setHorizontalOrigin(P)}if(x=u._verticalOrigin,t(x)){var D=x.getValue(r);t(D)&&g.setVerticalOrigin(D)}x=u._width,t(x)&&g.setWidth(x.getValue(r)),x=u._height,t(x)&&g.setHeight(x.getValue(r)),x=u._scaleByDistance,t(x)&&g.setScaleByDistance(x.getValue(r)),x=u._translucencyByDistance,t(x)&&g.setTranslucencyByDistance(x.getValue(r)),x=u._pixelOffsetScaleByDistance,t(x)&&g.setPixelOffsetScaleByDistance(x.getValue(r))}}}}}var d=function(e,t){this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;var r=this._billboardCollection=new a,i=this._textureAtlas=e.context.createTextureAtlas();this._textureAtlasBuilder=new u(i),r.textureAtlas=i,e.primitives.add(r),this.setDynamicObjectCollection(t)};d.prototype.getScene=function(){return this._scene},d.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},d.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(d.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(d.prototype._onObjectsRemoved,this))},d.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)h(this,e,r[i])},d.prototype.removeAllPrimitives=function(){if(t(this._dynamicObjectCollection)){this._unusedIndexes=[],this._billboardCollection.removeAll();for(var e=this._dynamicObjectCollection.getObjects(),r=e.length-1;r>-1;r--)e[r]._billboardVisualizerIndex=void 0}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._billboardCollection),r(this)};var m,p,f,v;return d.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._billboardCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._billboardVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),u.setImageIndex(-1),u._visualizerUrl=void 0,u._visualizerTextureAvailable=!1,s._billboardVisualizerIndex=void 0,o.push(l)}}},d}),r("Renderer/CullFace",["../Core/Enumeration"],function(e){"use strict";var t={FRONT:new e(1028,"FRONT"),BACK:new e(1029,"BACK"),FRONT_AND_BACK:new e(1032,"FRONT_AND_BACK"),validate:function(e){return e===t.FRONT||e===t.BACK||e===t.FRONT_AND_BACK}};return t}),r("Renderer/MipmapHint",["../Core/Enumeration"],function(e){"use strict";var t={DONT_CARE:new e(4352,"DONT_CARE"),FASTEST:new e(4353,"FASTEST"),NICEST:new e(4354,"NICEST"),validate:function(e){return e===t.DONT_CARE||e===t.FASTEST||e===t.NICEST}};return t}),r("Renderer/PixelDatatype",[],function(){"use strict";var e={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,UNSIGNED_INT_24_8_WEBGL:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,validate:function(t){return t===e.UNSIGNED_BYTE||t===e.UNSIGNED_SHORT||t===e.UNSIGNED_INT||t===e.FLOAT||t===e.UNSIGNED_INT_24_8_WEBGL||t===e.UNSIGNED_SHORT_4_4_4_4||t===e.UNSIGNED_SHORT_5_5_5_1||t===e.UNSIGNED_SHORT_5_6_5}};return e}),r("Renderer/PixelFormat",[],function(){"use strict";var e={DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,validate:function(t){return t===e.DEPTH_COMPONENT||t===e.DEPTH_STENCIL||t===e.ALPHA||t===e.RGB||t===e.RGBA||t===e.LUMINANCE||t===e.LUMINANCE_ALPHA},isColorFormat:function(t){return t===e.ALPHA||t===e.RGB||t===e.RGBA||t===e.LUMINANCE||t===e.LUMINANCE_ALPHA},isDepthFormat:function(t){return t===e.DEPTH_COMPONENT||t===e.DEPTH_STENCIL}};return e}),r("Renderer/TextureMagnificationFilter",[],function(){"use strict";var e={NEAREST:9728,LINEAR:9729,validate:function(t){return t===e.NEAREST||t===e.LINEAR}};return e}),r("Renderer/TextureMinificationFilter",[],function(){"use strict";var e={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,validate:function(t){return t===e.NEAREST||t===e.LINEAR||t===e.NEAREST_MIPMAP_NEAREST||t===e.LINEAR_MIPMAP_NEAREST||t===e.NEAREST_MIPMAP_LINEAR||t===e.LINEAR_MIPMAP_LINEAR
+}};return e}),r("Renderer/TextureWrap",[],function(){"use strict";var e={CLAMP_TO_EDGE:33071,REPEAT:10497,MIRRORED_REPEAT:33648,validate:function(t){return t===e.CLAMP_TO_EDGE||t===e.REPEAT||t===e.MIRRORED_REPEAT}};return e}),r("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./MipmapHint","./PixelDatatype","./PixelFormat","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(t,r,i,n,o,a,s,l,u,c){this._gl=t,this._textureFilterAnisotropic=r,this._textureTarget=i,this._texture=n,this._pixelFormat=o,this._pixelDatatype=a,this._width=s,this._height=l,this._dimensions=new e(s,l),this._preMultiplyAlpha=u,this._flipY=c,this._sampler=void 0,this.setSampler()};return d.prototype.copyFrom=function(e,r,i){r=t(r,0),i=t(i,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,r,i,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,r,i,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},d.prototype.copyFromFramebuffer=function(e,r,i,n,o,a){e=t(e,0),r=t(r,0),i=t(i,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,r,i,n,o,a),s.bindTexture(l,null)},d.prototype.generateMipmap=function(e){e=t(e,a.DONT_CARE);var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},d.prototype.getSampler=function(){return this._sampler},d.prototype.setSampler=function(e){if(!r(e)){var t=c.LINEAR,i=u.LINEAR;this._pixelDatatype===s.FLOAT&&(t=c.NEAREST,i=u.NEAREST),e={wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i,maximumAnisotropy:1}}if(this._pixelDatatype===s.FLOAT){if(e.minificationFilter!==c.NEAREST&&e.minificationFilter!==c.NEAREST_MIPMAP_NEAREST)throw new n("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(e.magnificationFilter!==u.NEAREST)throw new n("Only the NEAREST magnification filter is supported for floating point textures.")}var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,e.minificationFilter),o.texParameteri(a,o.TEXTURE_MAG_FILTER,e.magnificationFilter),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),r(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler={wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy}},d.prototype.getPixelFormat=function(){return this._pixelFormat},d.prototype.getPixelDatatype=function(){return this._pixelDatatype},d.prototype.getDimensions=function(){return this._dimensions},d.prototype.getPreMultiplyAlpha=function(){return this._preMultiplyAlpha},d.prototype.getFlipY=function(){return this._flipY},d.prototype.getWidth=function(){return this._width},d.prototype.getHeight=function(){return this._height},d.prototype._getTexture=function(){return this._texture},d.prototype._getTarget=function(){return this._textureTarget},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),i(this)},d}),r("Renderer/CubeMapFace",["../Core/defaultValue","../Core/DeveloperError","./PixelDatatype"],function(e){"use strict";var t=function(e,t,r,i,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=r,this._targetFace=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l};return t.prototype.copyFrom=function(t,r,i){r=e(r,0),i=e(i,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,r,i,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,r,i,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},t.prototype.copyFromFramebuffer=function(t,r,i,n,o,a){t=e(t,0),r=e(r,0),i=e(i,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,r,i,n,o,a),s.bindTexture(l,null)},t.prototype.getPixelFormat=function(){return this._pixelFormat},t.prototype.getPixelDatatype=function(){return this._pixelDatatype},t.prototype._getTexture=function(){return this._texture},t.prototype._getTarget=function(){return this._targetFace},t}),r("Renderer/CubeMap",["../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/defaultValue","../Core/Math","./MipmapHint","./PixelDatatype","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap","./CubeMapFace"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(e,t,r,i,n,o,a,s,l){this._gl=e,this._textureFilterAnisotropic=t,this._textureTarget=r,this._texture=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l,this._sampler=void 0,this._positiveX=new c(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_X,n,o,a,s,l),this._negativeX=new c(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_X,n,o,a,s,l),this._positiveY=new c(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Y,n,o,a,s,l),this._negativeY=new c(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,n,o,a,s,l),this._positiveZ=new c(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Z,n,o,a,s,l),this._negativeZ=new c(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Z,n,o,a,s,l),this.setSampler()};return h.prototype.getPositiveX=function(){return this._positiveX},h.prototype.getNegativeX=function(){return this._negativeX},h.prototype.getPositiveY=function(){return this._positiveY},h.prototype.getNegativeY=function(){return this._negativeY},h.prototype.getPositiveZ=function(){return this._positiveZ},h.prototype.getNegativeZ=function(){return this._negativeZ},h.prototype.generateMipmap=function(e){e=i(e,o.DONT_CARE);var t=this._gl,r=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(r,this._texture),t.generateMipmap(r),t.bindTexture(r,null)},h.prototype.setSampler=function(r){if(!e(r)){var i=l.LINEAR,n=s.LINEAR;this._pixelDatatype===a.FLOAT&&(i=l.NEAREST,n=s.NEAREST),r={wrapS:u.CLAMP_TO_EDGE,wrapT:u.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:n,maximumAnisotropy:1}}if(this._pixelDatatype===a.FLOAT){if(r.minificationFilter!==l.NEAREST&&r.minificationFilter!==l.NEAREST_MIPMAP_NEAREST)throw new t("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(r.magnificationFilter!==s.NEAREST)throw new t("Only the NEAREST magnification filter is supported for floating point textures.")}var o=this._gl,c=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(c,this._texture),o.texParameteri(c,o.TEXTURE_MIN_FILTER,r.minificationFilter),o.texParameteri(c,o.TEXTURE_MAG_FILTER,r.magnificationFilter),o.texParameteri(c,o.TEXTURE_WRAP_S,r.wrapS),o.texParameteri(c,o.TEXTURE_WRAP_T,r.wrapT),e(this._textureFilterAnisotropic)&&o.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.maximumAnisotropy),o.bindTexture(c,null),this._sampler={wrapS:r.wrapS,wrapT:r.wrapT,minificationFilter:r.minificationFilter,magnificationFilter:r.magnificationFilter,maximumAnisotropy:r.maximumAnisotropy}},h.prototype.getSampler=function(){return this._sampler},h.prototype.getPixelFormat=function(){return this._pixelFormat},h.prototype.getPixelDatatype=function(){return this._pixelDatatype},h.prototype.getWidth=function(){return this._size},h.prototype.getHeight=function(){return this._size},h.prototype.getPreMultiplyAlpha=function(){return this._preMultiplyAlpha},h.prototype.getFlipY=function(){return this._flipY},h.prototype._getTexture=function(){return this._texture},h.prototype._getTarget=function(){return this._textureTarget},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},h}),r("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),r("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/FresnelMaterial",[],function(){"use strict";return"czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nfloat cosAngIncidence = max(dot(normalWC, positionWC), 0.0);\nmaterial.diffuse = mix(reflection.diffuse, refraction.diffuse, cosAngIncidence);\nreturn material;\n}\n"}),r("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = lineThickness - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),r("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),r("Shaders/Materials/ReflectionMaterial",[],function(){"use strict";return"uniform samplerCube cubeMap;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 reflectedWC = reflect(positionWC, normalWC);\nmaterial.diffuse = textureCube(cubeMap, reflectedWC).channels;\nreturn material;\n}\n"}),r("Shaders/Materials/RefractionMaterial",[],function(){"use strict";return"uniform samplerCube cubeMap;\nuniform float indexOfRefractionRatio;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 refractedWC = refract(positionWC, -normalWC, indexOfRefractionRatio);\nmaterial.diffuse = textureCube(cubeMap, refractedWC).channels;\nreturn material;\n}\n"}),r("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(lightColor, darkColor, step(0.5, value));\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),r("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),r("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),r("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),r("Scene/Material",["../ThirdParty/when","../Core/loadImage","../Core/DeveloperError","../Core/createGuid","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Cartesian2","../Core/isArray","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/Texture","../Renderer/CubeMap","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FresnelMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/ReflectionMaterial","../Shaders/Materials/RefractionMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O){"use strict";function R(e,t){e=s(e,s.EMPTY_OBJECT),t._strict=s(e.strict,!1),t._count=s(e.count,0),t._template=n(s(e.fabric,s.EMPTY_OBJECT)),t._template.uniforms=n(s(t._template.uniforms,s.EMPTY_OBJECT)),t._template.materials=n(s(t._template.materials,s.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:i(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];var r,o=Y._materialCache.getMaterial(t.type);if(l(o)){var u=n(o.fabric,!0);t._template=a(t._template,u,!0),r=o.translucent}z(t),l(o)||Y._materialCache.addMaterial(t.type,t),F(t),U(t),H(t);var c=0===t._translucentFunctions.length?!0:void 0;if(r=s(r,c),r=s(e.translucent,r),l(r))if("function"==typeof r){var h=function(){return r(t)};t._translucentFunctions.push(h)}else t._translucentFunctions.push(r)}function L(e,t,r,i){if(l(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(i&&!o||!i&&o)&&r(n,t)}}function N(e,t){for(var i="fabric: property name '"+e+"' is not valid. It should be ",n=0;n0&&(n[s]={type:"ivec3",x:1,y:1},W(e,s))}var u="uniform "+a+" "+t+";\n";-1===e.shaderSource.indexOf(u)&&(e.shaderSource=u+e.shaderSource);var c=t+"_"+e._count++;if(1===j(e,t,c)&&i)throw new r("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=o,"sampler2D"===a)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if("samplerCube"===a)e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(k(t));else if(-1!==a.indexOf("mat")){var h=new J[a];e._uniforms[c]=function(){return J[a].fromColumnMajorArray(e.uniforms[t],h)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function G(e){var t=e.type;if(!l(t)){var r=typeof e;if("number"===r)t="float";else if("boolean"===r)t="bool";else if("string"===r)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===Y.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===r)if(d(e))(4===e.length||9===e.length||16===e.length)&&(t="mat"+Math.sqrt(e.length));else{var i=0;for(var n in e)e.hasOwnProperty(n)&&(i+=1);i>=2&&4>=i?t="vec"+i:6===i&&(t="samplerCube")}}return t}function H(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new Y({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=a(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var s="czm_getMaterial",l=s+"_"+e._count++;j(o,s,l),e.shaderSource=o.shaderSource+e.shaderSource;var u=l+"(materialInput)";if(0===j(e,n,u)&&t)throw new r("strict: shader source does not use material '"+n+"'.")}}function j(e,t,r,i){i=s(i,!0);var n=0,o="a-zA-Z0-9_",a="(["+o+"])?",l="(["+o+(i?".":"")+"])?",u=new RegExp(l+t+a,"g");return e.shaderSource=e.shaderSource.replace(u,function(e,t,i){return t||i?e:(n+=1,r)}),n}function q(e,t,r){return j(e,t,t,r)}var Y=function(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],R(e,this),u(this,{type:{value:this.type,writable:!1}}),l(Y._uniformList[this.type])||(Y._uniformList[this.type]=Object.keys(this._uniforms))};Y._uniformList={},Y.fromType=function(e,t){var r=new Y({fabric:{type:e}});if(l(t))for(var i in t)t.hasOwnProperty(i)&&(r.uniforms[i]=t[i]);return r},Y.prototype.isTranslucent=function(){if(l(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,r=t.length,i=0;r>i;++i){var n=t[i];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},Y.prototype.update=function(e){var t,r,i=this._loadedImages,n=i.length;for(t=0;n>t;++t){var o=i[t];r=o.id;var a=o.image,s=Y._textureCache.getTexture(this._texturePaths[r]);l(s)||(s=e.createTexture2D({source:a}),Y._textureCache.addTexture(this._texturePaths[r],s)),this._textures[r]=s;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=s._width,c.y=s._height}}i.length=0;var h=this._loadedCubeMaps;for(n=h.length,t=0;n>t;++t){var d=h[t];r=d.id;var m=d.images,p=Y._textureCache.getTexture(this._texturePaths[r]);l(p)||(p=e.createCubeMap({source:{positiveX:m[0],negativeX:m[1],positiveY:m[2],negativeY:m[3],positiveZ:m[4],negativeZ:m[5]}}),Y._textureCache.addTexture(this._texturePaths[r],p)),this._textures[r]=p}h.length=0;var f=this._updateFunctions;for(n=f.length,t=0;n>t;++t)f[t](this,e);var v=this.materials;for(var g in v)v.hasOwnProperty(g)&&v[g].update(e)},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e=this.materials,t=this.uniforms;for(var r in t)if(t.hasOwnProperty(r)){var i=this._texturePaths[r];Y._textureCache.releaseTexture(i)}for(var n in e)e.hasOwnProperty(n)&&e[n].destroy();return c(this)};var X=["type","materials","uniforms","components","source"],Z=["diffuse","specular","shininess","normal","emission","alpha"],J={mat2:m,mat3:p,mat4:f};return Y._textureCache={_textures:{},addTexture:function(e,t){this._textures[e]={texture:t,count:1}},getTexture:function(e){var t=this._textures[e];return l(t)?(t.count++,t.texture):void 0},releaseTexture:function(e){var t=this._textures[e];l(t)&&0===--t.count&&(t.texture=t.texture&&t.texture.destroy(),this._textures[e]=void 0)}},Y._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},Y.DefaultImageId="czm_defaultImage",Y.DefaultCubeMapId="czm_defaultCubeMap",Y.ColorType="Color",Y._materialCache.addMaterial(Y.ColorType,{fabric:{type:Y.ColorType,uniforms:{color:new o(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Y.ImageType="Image",Y._materialCache.addMaterial(Y.ImageType,{fabric:{type:Y.ImageType,uniforms:{image:Y.DefaultImageId,repeat:new h(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a"}},translucent:!0}),Y.DiffuseMapType="DiffuseMap",Y._materialCache.addMaterial(Y.DiffuseMapType,{fabric:{type:Y.DiffuseMapType,uniforms:{image:Y.DefaultImageId,channels:"rgb",repeat:new h(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Y.AlphaMapType="AlphaMap",Y._materialCache.addMaterial(Y.AlphaMapType,{fabric:{type:Y.AlphaMapType,uniforms:{image:Y.DefaultImageId,channel:"a",repeat:new h(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),Y.SpecularMapType="SpecularMap",Y._materialCache.addMaterial(Y.SpecularMapType,{fabric:{type:Y.SpecularMapType,uniforms:{image:Y.DefaultImageId,channel:"r",repeat:new h(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),Y.EmissionMapType="EmissionMap",Y._materialCache.addMaterial(Y.EmissionMapType,{fabric:{type:Y.EmissionMapType,uniforms:{image:Y.DefaultImageId,channels:"rgb",repeat:new h(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Y.BumpMapType="BumpMap",Y._materialCache.addMaterial(Y.BumpMapType,{fabric:{type:Y.BumpMapType,uniforms:{image:Y.DefaultImageId,channel:"r",strength:.8,repeat:new h(1,1)},source:_},translucent:!1}),Y.NormalMapType="NormalMap",Y._materialCache.addMaterial(Y.NormalMapType,{fabric:{type:Y.NormalMapType,uniforms:{image:Y.DefaultImageId,channels:"rgb",strength:.8,repeat:new h(1,1)},source:E},translucent:!1}),Y.ReflectionType="Reflection",Y._materialCache.addMaterial(Y.ReflectionType,{fabric:{type:Y.ReflectionType,uniforms:{cubeMap:Y.DefaultCubeMapId,channels:"rgb"},source:x},translucent:!1}),Y.RefractionType="Refraction",Y._materialCache.addMaterial(Y.RefractionType,{fabric:{type:Y.RefractionType,uniforms:{cubeMap:Y.DefaultCubeMapId,channels:"rgb",indexOfRefractionRatio:.9},source:b},translucent:!1}),Y.FresnelType="Fresnel",Y._materialCache.addMaterial(Y.FresnelType,{fabric:{type:Y.FresnelType,materials:{reflection:{type:Y.ReflectionType},refraction:{type:Y.RefractionType}},source:S},translucent:!1}),Y.GridType="Grid",Y._materialCache.addMaterial(Y.GridType,{fabric:{type:Y.GridType,uniforms:{color:new o(0,1,0,1),cellAlpha:.1,lineCount:new h(8,8),lineThickness:new h(1,1)},source:w},translucent:function(e){var t=e.uniforms;
+return t.color.alpha<1||t.cellAlpha<1}}),Y.StripeType="Stripe",Y._materialCache.addMaterial(Y.StripeType,{fabric:{type:Y.StripeType,uniforms:{horizontal:!0,lightColor:new o(1,1,1,.5),darkColor:new o(0,0,1,.5),offset:0,repeat:5},source:T},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),Y.CheckerboardType="Checkerboard",Y._materialCache.addMaterial(Y.CheckerboardType,{fabric:{type:Y.CheckerboardType,uniforms:{lightColor:new o(1,1,1,.5),darkColor:new o(0,0,0,.5),repeat:new h(5,5)},source:y},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),Y.DotType="Dot",Y._materialCache.addMaterial(Y.DotType,{fabric:{type:Y.DotType,uniforms:{lightColor:new o(1,1,0,.75),darkColor:new o(0,1,1,.75),repeat:new h(5,5)},source:C},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),Y.WaterType="Water",Y._materialCache.addMaterial(Y.WaterType,{fabric:{type:Y.WaterType,uniforms:{baseWaterColor:new o(.2,.3,.6,1),blendColor:new o(0,1,.699,1),specularMap:Y.DefaultImageId,normalMap:Y.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:A},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),Y.RimLightingType="RimLighting",Y._materialCache.addMaterial(Y.RimLightingType,{fabric:{type:Y.RimLightingType,uniforms:{color:new o(1,0,0,.7),rimColor:new o(1,1,1,.4),width:.3},source:P},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),Y.FadeType="Fade",Y._materialCache.addMaterial(Y.FadeType,{fabric:{type:Y.FadeType,uniforms:{fadeInColor:new o(1,0,0,1),fadeOutColor:new o(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new h(.5,.5)},source:D},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<0}}),Y.PolylineArrowType="PolylineArrow",Y._materialCache.addMaterial(Y.PolylineArrowType,{fabric:{type:Y.PolylineArrowType,uniforms:{color:new o(1,1,1,1)},source:M},translucent:!0}),Y.PolylineGlowType="PolylineGlow",Y._materialCache.addMaterial(Y.PolylineGlowType,{fabric:{type:Y.PolylineGlowType,uniforms:{color:new o(0,.5,1,1),glowPower:.1},source:I},translucent:!0}),Y.PolylineOutlineType="PolylineOutline",Y._materialCache.addMaterial(Y.PolylineOutlineType,{fabric:{type:Y.PolylineOutlineType,uniforms:{color:new o(1,1,1,1),outlineColor:new o(1,0,0,1),outlineWidth:1},source:O},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),Y}),r("Shaders/SensorVolume",[],function(){"use strict";return"uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nbool inSensorShadow(vec3 coneVertexWC, czm_ellipsoid ellipsoidEC, vec3 pointWC)\n{\nvec3 D = ellipsoidEC.inverseRadii;\nvec3 q = D * coneVertexWC;\nfloat qMagnitudeSquared = dot(q, q);\nfloat test = qMagnitudeSquared - 1.0;\nvec3 temp = D * pointWC - q;\nfloat d = dot(temp, q);\nreturn (d < -test) && (d / length(temp) < -sqrt(test));\n}\nvec4 getIntersectionColor()\n{\nreturn u_intersectionColor;\n}\nfloat getIntersectionWidth()\n{\nreturn u_intersectionWidth;\n}\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC)\n{\nfloat t = pointMC.z / sensorRadius;\nfloat s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\ns = s - floor(s);\nreturn vec2(s, t);\n}\n"}),r("Shaders/CustomSensorVolumeVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec3 normal;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\ngl_Position = czm_modelViewProjection * position;\nv_positionWC = (czm_model * position).xyz;\nv_positionEC = (czm_modelView * position).xyz;\nv_normalEC = czm_normal * normal;\n}\n"}),r("Shaders/CustomSensorVolumeFS",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_sensorRadius;\nuniform float u_normalDirection;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{\nczm_materialInput materialInput;\nvec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\nmaterialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\nmaterialInput.str = pointMC / sensorRadius;\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nvec3 normalEC = normalize(v_normalEC);\nmaterialInput.normalEC = u_normalDirection * normalEC;\nczm_material material = czm_getMaterial(materialInput);\nreturn mix(czm_phong(normalize(positionToEyeEC), material), vec4(material.diffuse, material.alpha), 0.4);\n}\nbool isOnBoundary(float value, float epsilon)\n{\nfloat width = getIntersectionWidth();\nfloat tolerance = width * epsilon;\n#ifdef GL_OES_standard_derivatives\nfloat delta = max(abs(dFdx(value)), abs(dFdy(value)));\nfloat pixels = width * delta;\nfloat temp = abs(value);\nreturn temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n#else\nreturn abs(value) < tolerance;\n#endif\n}\nvec4 shade(bool isOnBoundary)\n{\nif (u_showIntersection && isOnBoundary)\n{\nreturn getIntersectionColor();\n}\nreturn getColor(u_sensorRadius, v_positionEC);\n}\nfloat ellipsoidSurfaceFunction(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * point;\nreturn dot(scaled, scaled) - 1.0;\n}\nvoid main()\n{\nvec3 sensorVertexWC = czm_model[3].xyz;\nvec3 sensorVertexEC = czm_modelView[3].xyz;\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nfloat ellipsoidValue = ellipsoidSurfaceFunction(ellipsoid, v_positionWC);\nif (!u_showThroughEllipsoid)\n{\nif (ellipsoidValue < 0.0)\n{\ndiscard;\n}\nif (inSensorShadow(sensorVertexWC, ellipsoid, v_positionWC))\n{\ndiscard;\n}\n}\nif (distance(v_positionEC, sensorVertexEC) > u_sensorRadius)\n{\ndiscard;\n}\nbool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\ngl_FragColor = shade(isOnEllipsoid);\n}\n"}),r("Scene/CustomSensorVolume",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Color","../Core/combine","../Core/destroyObject","../Core/FAR","../Core/Cartesian3","../Core/Matrix4","../Core/ComponentDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Renderer/BufferUsage","../Renderer/BlendingState","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/CullFace","../Renderer/Pass","./Material","../Shaders/SensorVolume","../Shaders/CustomSensorVolumeVS","../Shaders/CustomSensorVolumeFS","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w){"use strict";function E(e){for(var t=e._directions,r=t.length,i=new Float32Array(3*r),n=isFinite(e.radius)?e.radius:a,o=[s.ZERO],l=r-2,u=r-1,c=0;r>c;l=u++,u=c++){var d=s.fromSpherical(t[l]),m=s.fromSpherical(t[u]),p=s.fromSpherical(t[c]),f=Math.max(s.angleBetween(d,m),s.angleBetween(m,p)),v=n/Math.cos(.5*f),g=s.multiplyByScalar(m,v);i[3*u]=g.x,i[3*u+1]=g.y,i[3*u+2]=g.z,o.push(g)}return h.fromPoints(o,e._boundingSphere),i}function x(e,t){for(var r=E(e),i=e._directions.length,n=new Float32Array(18*i),o=0,a=i-1,l=0;i>l;a=l++){var c=new s(r[3*a],r[3*a+1],r[3*a+2]),h=new s(r[3*l],r[3*l+1],r[3*l+2]),d=s.normalize(s.cross(h,c));n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z,n[o++]=h.x,n[o++]=h.y,n[o++]=h.z,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z,n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,n[o++]=d.x,n[o++]=d.y,n[o++]=d.z}var m=t.createVertexBuffer(new Float32Array(n),e.bufferUsage),p=6*Float32Array.BYTES_PER_ELEMENT,f=[{index:b.position,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:u.FLOAT,offsetInBytes:0,strideInBytes:p},{index:b.normal,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:u.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p}];return t.createVertexArray(f)}var b={position:0,normal:1},T=function(r){r=e(r,e.EMPTY_OBJECT),this._pickId=void 0,this._pickIdThis=e(r._pickIdThis,this),this._frontFaceColorCommand=new p,this._backFaceColorCommand=new p,this._pickCommand=new p,this._boundingSphere=new h,this._boundingSphereWC=new h,this._frontFaceColorCommand.primitiveType=c.TRIANGLES,this._frontFaceColorCommand.boundingVolume=this._boundingSphereWC,this._frontFaceColorCommand.owner=this,this._backFaceColorCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._backFaceColorCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._backFaceColorCommand.owner=this,this._pickCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._pickCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._pickCommand.owner=this,this.show=e(r.show,!0),this.showIntersection=e(r.showIntersection,!0),this.showThroughEllipsoid=e(r.showThroughEllipsoid,!1),this._showThroughEllipsoid=this.showThroughEllipsoid,this.modelMatrix=l.clone(e(r.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this.bufferUsage=e(r.bufferUsage,d.STATIC_DRAW),this._bufferUsage=this.bufferUsage,this.radius=e(r.radius,Number.POSITIVE_INFINITY),this._directions=void 0,this._directionsDirty=!1,this.setDirections(r.directions),this.material=t(r.material)?r.material:_.fromType(_.ColorType),this._material=void 0,this._translucent=void 0,this.intersectionColor=i.clone(e(r.intersectionColor,i.WHITE)),this.intersectionWidth=e(r.intersectionWidth,5),this.id=r.id,this._id=void 0;var n=this;this._uniforms={u_showThroughEllipsoid:function(){return n.showThroughEllipsoid},u_showIntersection:function(){return n.showIntersection},u_sensorRadius:function(){return isFinite(n.radius)?n.radius:a},u_intersectionColor:function(){return n.intersectionColor},u_intersectionWidth:function(){return n.intersectionWidth},u_normalDirection:function(){return 1}},this._mode=w.SCENE3D};return T.prototype.setDirections=function(e){this._directions=e,this._directionsDirty=!0},T.prototype.getDirections=function(){return this._directions},T.prototype.update=function(e,r,i){if(this._mode=r.mode,this.show&&this._mode===w.SCENE3D){var o=this.material.isTranslucent();if(this._showThroughEllipsoid!==this.showThroughEllipsoid||!t(this._frontFaceColorCommand.renderState)||this._translucent!==o){this._showThroughEllipsoid=this.showThroughEllipsoid,this._translucent=o;var a;o?(a=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND,cull:{enabled:!0,face:v.BACK}}),this._frontFaceColorCommand.renderState=a,this._frontFaceColorCommand.pass=g.TRANSLUCENT,a=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND,cull:{enabled:!0,face:v.FRONT}}),this._backFaceColorCommand.renderState=a,this._backFaceColorCommand.pass=g.TRANSLUCENT,a=e.createRenderState({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:m.ALPHA_BLEND}),this._pickCommand.renderState=a):(a=e.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._frontFaceColorCommand.renderState=a,this._frontFaceColorCommand.pass=g.OPAQUE,a=e.createRenderState({depthTest:{enabled:!0},depthMask:!0}),this._pickCommand.renderState=a)}var s=this._directionsDirty||this._bufferUsage!==this.bufferUsage;if(s){this._directionsDirty=!1,this._bufferUsage=this.bufferUsage,this._va=this._va&&this._va.destroy();var u=this._directions;u&&u.length>=3&&(this._frontFaceColorCommand.vertexArray=x(this,e),this._backFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray,this._pickCommand.vertexArray=this._frontFaceColorCommand.vertexArray)}if(t(this._frontFaceColorCommand.vertexArray)){var c=r.passes,d=!l.equals(this.modelMatrix,this._modelMatrix);d&&l.clone(this.modelMatrix,this._modelMatrix),(s||d)&&h.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC),this._frontFaceColorCommand.modelMatrix=this.modelMatrix,this._backFaceColorCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix,this._pickCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix;var p=this._material!==this.material;if(this._material=this.material,this._material.update(e),c.render){var _=this._frontFaceColorCommand,E=this._backFaceColorCommand;if(p||!t(_.shaderProgram)){var T=f({sources:[y,this._material.shaderSource,S]});_.shaderProgram=e.getShaderCache().replaceShaderProgram(_.shaderProgram,C,T,b),_.uniformMap=n(this._uniforms,this._material._uniforms),E.shaderProgram=_.shaderProgram,E.uniformMap=n(this._uniforms,this._material._uniforms),E.uniformMap.u_normalDirection=function(){return-1}}o?i.push(this._backFaceColorCommand,this._frontFaceColorCommand):i.push(this._frontFaceColorCommand)}if(c.pick){var A=this._pickCommand;if(t(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=e.createPickId({primitive:this._pickIdThis,id:this.id})),p||!t(A.shaderProgram)){var P=f({sources:[y,this._material.shaderSource,S],pickColorQualifier:"uniform"});A.shaderProgram=e.getShaderCache().replaceShaderProgram(A.shaderProgram,C,P,b);var D=this,M={czm_pickColor:function(){return D._pickId.color}};A.uniformMap=n(n(this._uniforms,this._material._uniforms),M)}A.pass=o?g.TRANSLUCENT:g.OPAQUE,i.push(A)}}}},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._frontFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray&&this._frontFaceColorCommand.vertexArray.destroy(),this._frontFaceColorCommand.shaderProgram=this._frontFaceColorCommand.shaderProgram&&this._frontFaceColorCommand.shaderProgram.release(),this._pickCommand.shaderProgram=this._pickCommand.shaderProgram&&this._pickCommand.shaderProgram.release(),this._pickId=this._pickId&&this._pickId.destroy(),o(this)},T}),r("DynamicScene/MaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,r,i){"use strict";var n=function(){r.throwInstantiationError()};return t(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),n.prototype.getType=r.throwInstantiationError,n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.getValue=function(t,r,n){if(e(r)){var o=r.getType(t);e(o)&&(e(n)&&n.type===o||(n=i.fromType(o)),r.getValue(t,n.uniforms))}return n},n}),r("DynamicScene/DynamicConeVisualizerUsingCustomSensor",["../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Quaternion","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Spherical","../Scene/CustomSensorVolume","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(e,t,i,n){var o=t[e];r(o)||(t[e]=o=new u),o.clock=i,o.cone=n,o.magnitude=1}function p(e,t,r,i,n){var o,s=0,l=a.toRadians(2);if(0===e&&t===a.TWO_PI)for(o=0;oo;o+=l)m(s++,n,o,i);if(m(s++,n,t,i),r){for(o=t;o>e;o-=l)m(s++,n,o,r);m(s++,n,e,r)}else m(s++,n,t,0)}return n.length=s,n}function f(i,n,u){var m=u._cone;if(r(m)){var f=u._position;if(r(f)){var g=u._orientation;if(r(g)){var C,S=m._show,w=u._coneVisualizerIndex,E=u.isAvailable(n)&&(!r(S)||S.getValue(n));if(!E)return r(w)&&(C=i._coneCollection[w],C.show=!1,u._coneVisualizerIndex=void 0,i._unusedIndexes.push(w)),void 0;if(r(w))C=i._coneCollection[w];else{var x=i._unusedIndexes,b=x.length;b>0?(w=x.pop(),C=i._coneCollection[w]):(w=i._coneCollection.length,C=new c,C._directionsScratch=[],i._coneCollection.push(C),i._primitives.add(C)),u._coneVisualizerIndex=w,C.id=u,C.material=h.fromType(h.ColorType),C.intersectionColor=t.clone(t.YELLOW),C.intersectionWidth=5,C.radius=Number.POSITIVE_INFINITY,C.showIntersection=!0}C.show=!0;var T,A=m._minimumClockAngle;r(A)&&(T=A.getValue(n)),r(T)||(T=0);var P;A=m._maximumClockAngle,r(A)&&(P=A.getValue(n)),r(P)||(P=a.TWO_PI);var D;A=m._innerHalfAngle,r(A)&&(D=A.getValue(n)),r(D)||(D=0);var M;if(A=m._outerHalfAngle,r(A)&&(M=A.getValue(n)),r(M)||(M=Math.PI),(T!==C.minimumClockAngle||P!==C.maximumClockAngle||D!==C.innerHalfAngle||M!==C.outerHalfAngle)&&(C.setDirections(p(T,P,D,M,C._directionsScratch)),C.innerHalfAngle=D,C.maximumClockAngle=P,C.outerHalfAngle=M,C.minimumClockAngle=T),A=m._radius,r(A)){var I=A.getValue(n);r(I)&&(C.radius=I)}var O=f.getValue(n,_),R=g.getValue(n,y);if(!r(O)||!r(R)||e.equals(O,C._visualizerPosition)&&o.equals(R,C._visualizerOrientation)||(l.fromRotationTranslation(s.fromQuaternion(R,v),O,C.modelMatrix),C._visualizerPosition=e.clone(O,C._visualizerPosition),C._visualizerOrientation=o.clone(R,C._visualizerOrientation)),C.material=d.getValue(n,m._outerMaterial,C.material),A=m._intersectionColor,r(A)&&A.getValue(n,C.intersectionColor),A=m._intersectionWidth,r(A)){var L=A.getValue(n);r(L)&&(C.intersectionWidth=L)}}}}}var v=new s,g=function(e,t){this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives,this._coneCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};g.prototype.getScene=function(){return this._scene},g.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},g.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(g.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(g.prototype._onObjectsRemoved,this))},g.prototype.update=function(e){if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,n=t.length;n>i;i++)f(this,e,t[i])},g.prototype.removeAllPrimitives=function(){var e,t;for(e=0,t=this._coneCollection.length;t>e;e++)this._primitives.remove(this._coneCollection[e]);if(r(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._coneVisualizerIndex=void 0}this._unusedIndexes=[],this._coneCollection=[]},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),i(this)};var _=new e,y=new o;return g.prototype._onObjectsRemoved=function(e,t,i){for(var n=this._coneCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._coneVisualizerIndex;if(r(l)){var u=n[l];u.show=!1,o.push(l),s._coneVisualizerIndex=void 0}}},g}),r("Scene/Label",["../Core/defaultValue","../Core/DeveloperError","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/NearFarScalar","./Billboard","./LabelStyle","./HorizontalOrigin","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function d(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}var m=function(t,o){t=e(t,e.EMPTY_OBJECT),this._text=e(t.text,""),this._show=e(t.show,!0),this._font=e(t.font,"30px sans-serif"),this._fillColor=n.clone(e(t.fillColor,n.WHITE)),this._outlineColor=n.clone(e(t.outlineColor,n.BLACK)),this._outlineWidth=e(t.outlineWidth,1),this._style=e(t.style,l.FILL),this._verticalOrigin=e(t.verticalOrigin,c.BOTTOM),this._horizontalOrigin=e(t.horizontalOrigin,u.LEFT),this._pixelOffset=r.clone(e(t.pixelOffset,r.ZERO)),this._eyeOffset=i.clone(e(t.eyeOffset,i.ZERO)),this._position=i.clone(e(t.position,i.ZERO)),this._scale=e(t.scale,1),this._id=t.id,this._translucencyByDistance=t.translucencyByDistance,this._pixelOffsetScaleByDistance=t.pixelOffsetScaleByDistance,this._labelCollection=o,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0};return m.prototype.getShow=function(){return this._show},m.prototype.setShow=function(e){if(e!==this._show){this._show=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var n=t[r];o(n.billboard)&&n.billboard.setShow(e)}}},m.prototype.getPosition=function(){return this._position},m.prototype.setPosition=function(e){var t=this._position;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;a>n;n++){var s=r[n];o(s.billboard)&&s.billboard.setPosition(e)}}},m.prototype.getText=function(){return this._text},m.prototype.setText=function(e){e!==this._text&&(this._text=e,h(this))},m.prototype.getFont=function(){return this._font},m.prototype.setFont=function(e){this._font!==e&&(this._font=e,h(this))},m.prototype.getFillColor=function(){return this._fillColor},m.prototype.setFillColor=function(e){var t=this._fillColor;n.equals(t,e)||(n.clone(e,t),h(this))},m.prototype.getOutlineColor=function(){return this._outlineColor},m.prototype.setOutlineColor=function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),h(this))},m.prototype.getOutlineWidth=function(){return this._outlineWidth},m.prototype.setOutlineWidth=function(e){this._outlineWidth!==e&&(this._outlineWidth=e,h(this))},m.prototype.getStyle=function(){return this._style},m.prototype.setStyle=function(e){this._style!==e&&(this._style=e,h(this))},m.prototype.getPixelOffset=function(){return this._pixelOffset},m.prototype.setPixelOffset=function(e){var t=this._pixelOffset;r.equals(t,e)||(r.clone(e,t),d(this))},m.prototype.getTranslucencyByDistance=function(){return this._translucencyByDistance},m.prototype.setTranslucencyByDistance=function(e){a.equals(this._translucencyByDistance,e)||(this._translucencyByDistance=a.clone(e,this._translucencyByDistance),h(this))},m.prototype.getPixelOffsetScaleByDistance=function(){return this._pixelOffsetScaleByDistance},m.prototype.setPixelOffsetScaleByDistance=function(e){a.equals(this._pixelOffsetScaleByDistance,e)||(this._pixelOffsetScaleByDistance=a.clone(e,this._pixelOffsetScaleByDistance),h(this))},m.prototype.getEyeOffset=function(){return this._eyeOffset},m.prototype.setEyeOffset=function(e){var t=this._eyeOffset;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;a>n;n++){var s=r[n];o(s.billboard)&&s.billboard.setEyeOffset(e)}}},m.prototype.getHorizontalOrigin=function(){return this._horizontalOrigin},m.prototype.setHorizontalOrigin=function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,d(this))},m.prototype.getVerticalOrigin=function(){return this._verticalOrigin},m.prototype.setVerticalOrigin=function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,d(this))},m.prototype.getScale=function(){return this._scale},m.prototype.getId=function(){return this._id},m.prototype.setScale=function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var n=t[r];o(n.billboard)&&n.billboard.setScale(e)}d(this)}},m.prototype.computeScreenSpacePosition=function(e,t){var r=this._labelCollection,i=r.modelMatrix,n=s._computeActualPosition(this._position,t,i);return s._computeScreenSpacePosition(i,n,this._eyeOffset,this._pixelOffset,e,t)},m.prototype.equals=function(e){return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._text===e._text&&this._font===e._font&&i.equals(this._position,e._position)&&n.equals(this._fillColor,e._fillColor)&&n.equals(this._outlineColor,e._outlineColor)&&r.equals(this._pixelOffset,e._pixelOffset)&&i.equals(this._eyeOffset,e._eyeOffset)&&a.equals(this._translucencyByDistance,e._translucencyByDistance)&&a.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&this._id===e._id},m.prototype.isDestroyed=function(){return!1},m}),r("Scene/LabelCollection",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Cartesian2","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./Label","./LabelStyle","./HorizontalOrigin","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";function m(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function p(e,t,r){this.labelCollection=e,this.index=t,this.dimensions=r}function f(e,t,r,i,n,o,a){return C.font=t,C.fillColor=r,C.strokeColor=i,C.strokeWidth=n,C.textBaseline=a===d.BOTTOM?"bottom":a===d.TOP?"top":"middle",C.fill=o===c.FILL||o===c.FILL_AND_OUTLINE,C.stroke=o===c.OUTLINE||o===c.FILL_AND_OUTLINE,s(e,C)}function v(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;i(r)&&(r.setShow(!1),r.setImageIndex(-1),r._pickId=r._pickId&&r._pickId.destroy(),e._spareBillboards.push(r),t.billboard=void 0)}function g(e,t){var r,n,o,a=t._text,s=a.length,l=t._glyphs,u=l.length;if(u>s)for(n=s;u>n;++n)v(e,l[n]);l.length=s;var c=e._glyphTextureCache,d=e._textureAtlas;for(o=0;s>o;++o){var g=a.charAt(o),_=t._font,y=t._fillColor,C=t._outlineColor,S=t._outlineWidth,w=t._style,E=t._verticalOrigin,x=JSON.stringify([g,_,y.toRgba(),C.toRgba(),S,+w,+E]),b=c[x];if(!i(b)){var T=f(g,_,y,C,S,w,E),A=-1;T.width>0&&T.height>0&&(A=d.addImage(T)),b=new p(e,A,T.dimensions),c[x]=b}if(r=l[o],i(r)?-1===b.index?v(e,r):i(r.textureInfo)&&(r.textureInfo=void 0):(r=new m,l[o]=r),r.textureInfo=b,r.dimensions=b.dimensions,-1!==b.index){var P=r.billboard;i(P)||(r.billboard=P=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add(),P.setShow(t._show),P.setPosition(t._position),P.setEyeOffset(t._eyeOffset),P.setPixelOffset(t._pixelOffset),P.setHorizontalOrigin(h.LEFT),P.setVerticalOrigin(t._verticalOrigin),P.setScale(t._scale),P._pickIdThis=t,P._id=t._id,P._collection=t._labelCollection),r.billboard.setImageIndex(b.index),r.billboard.setTranslucencyByDistance(t._translucencyByDistance),r.billboard.setPixelOffsetScaleByDistance(t._pixelOffsetScaleByDistance)}}t._repositionAllGlyphs=!0}function _(e){var t,r,n=e._glyphs,o=0,a=0,s=0,l=n.length;for(s=0;l>s;++s)t=n[s],r=t.dimensions,o+=r.width,a=Math.max(a,r.height);var u=e._scale,c=e._horizontalOrigin,m=0;c===h.CENTER?m-=o/2*u:c===h.RIGHT&&(m-=o*u),S.x=m,S.y=0;var p=e._verticalOrigin;for(s=0;l>s;++s)t=n[s],r=t.dimensions,p===d.BOTTOM||r.height===a?S.y=-r.descent*u:p===d.TOP?S.y=-(a-r.height)*u-r.descent*u:p===d.CENTER&&(S.y=-(a-r.height)/2*u-r.descent*u),i(t.billboard)&&t.billboard._setTranslate(S),S.x+=r.width*u}function y(e,t){for(var r=t._glyphs,i=0,o=r.length;o>i;++i)v(e,r[i]);t._labelCollection=void 0,n(t)}var C={},S=new o,w=function(t){t=e(t,e.EMPTY_OBJECT),this._textureAtlas=void 0,this._billboardCollection=new l,this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this.modelMatrix=a.clone(e(t.modelMatrix,a.IDENTITY)),this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1)};return t(w.prototype,{length:{get:function(){return this._labels.length}}}),w.prototype.add=function(e){var t=new u(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},w.prototype.remove=function(e){if(i(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),y(this,e),!0}return!1},w.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;r>t;++t)y(this,e[t]);e.length=0},w.prototype.contains=function(e){return i(e)&&e._labelCollection===this},w.prototype.get=function(e){return this._labels[e]},w.prototype.update=function(e,t,r){var n=this._billboardCollection;n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume,i(this._textureAtlas)||(this._textureAtlas=e.createTextureAtlas(),n.textureAtlas=this._textureAtlas);for(var o=this._labelsToUpdate,a=0,s=o.length;s>a;++a){var l=o[a];if(!l.isDestroyed()){var u=l._glyphs.length;l._rebindAllGlyphs&&(g(this,l),l._rebindAllGlyphs=!1),l._repositionAllGlyphs&&(_(l),l._repositionAllGlyphs=!1);var c=l._glyphs.length-u;this._totalGlyphCount+=c}}o.length=0,n.update(e,t,r)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),n(this)},w}),r("DynamicScene/DynamicLabelVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Color","../Core/Cartesian2","../Core/Cartesian3","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/HorizontalOrigin","../Scene/VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r,a){var c=a._label;if(t(c)){var h=c._text;if(t(h)){var g=a._position;if(t(g)){var _,y=c._show,C=a._labelVisualizerIndex,S=a.isAvailable(r)&&(!t(y)||y.getValue(r));if(!S)return t(C)&&(_=e._labelCollection.get(C),_.setShow(!1),e._unusedIndexes.push(C),a._labelVisualizerIndex=void 0),void 0;if(t(C))_=e._labelCollection.get(C);else{var w=e._unusedIndexes,E=w.length;E>0?(C=w.pop(),_=e._labelCollection.get(C)):(C=e._labelCollection.length,_=e._labelCollection.add()),a._labelVisualizerIndex=C,_.id=a,_.setText(""),_.setScale(1),_.setFont("30px sans-serif"),_.setFillColor(i.WHITE),_.setOutlineColor(i.BLACK),_.setOutlineWidth(1),_.setStyle(s.FILL),_.setPixelOffset(n.ZERO),_.setEyeOffset(o.ZERO),_.setHorizontalOrigin(l.CENTER),_.setVerticalOrigin(u.CENTER)}_.setShow(S);var x=h.getValue(r);t(x)&&_.setText(x),d=g.getValue(r,d),t(d)&&_.setPosition(d);var b=c._scale;if(t(b)){var T=b.getValue(r);t(T)&&_.setScale(T)}if(b=c._font,t(b)){var A=b.getValue(r);t(A)&&_.setFont(A)}if(b=c._fillColor,t(b)&&(m=b.getValue(r,m),t(m)&&_.setFillColor(m)),b=c._outlineColor,t(b)&&(p=b.getValue(r,p),t(p)&&_.setOutlineColor(p)),b=c._outlineWidth,t(b)){var P=b.getValue(r);t(P)&&_.setOutlineWidth(P)}if(b=c._style,t(b)){var D=b.getValue(r);t(D)&&_.setStyle(D)}if(b=c._pixelOffset,t(b)&&(v=b.getValue(r,v),t(v)&&_.setPixelOffset(v)),b=c._eyeOffset,t(b)&&(f=b.getValue(r,f),t(f)&&_.setEyeOffset(f)),b=c._horizontalOrigin,t(b)){var M=b.getValue(r);t(M)&&_.setHorizontalOrigin(M)}if(b=c._verticalOrigin,t(b)){var I=b.getValue(r);t(I)&&_.setVerticalOrigin(I)}b=c._translucencyByDistance,t(b)&&_.setTranslucencyByDistance(b.getValue(r)),b=c._pixelOffsetScaleByDistance,t(b)&&_.setPixelOffsetScaleByDistance(b.getValue(r))}}}}var h=function(e,t){this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;var r=this._labelCollection=new a;e.primitives.add(r),this.setDynamicObjectCollection(t)};h.prototype.getScene=function(){return this._scene},h.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},h.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(h.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(h.prototype._onObjectsRemoved,this))},h.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)c(this,e,r[i])},h.prototype.removeAllPrimitives=function(){if(this._unusedIndexes=[],this._labelCollection.removeAll(),t(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),r=e.length-1;r>-1;r--)e[r]._labelVisualizerIndex=void 0},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._labelCollection),r(this)};var d,m,p,f,v;return h.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._labelCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._labelVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),o.push(l),s._labelVisualizerIndex=void 0}}},h}),r("Scene/ModelTypes",["../Core/ComponentDatatype"],function(e){"use strict";var t={};return"undefined"==typeof WebGLRenderingContext?t:(t[WebGLRenderingContext.FLOAT]={componentsPerAttribute:1,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,r)}},t[WebGLRenderingContext.FLOAT_VEC2]={componentsPerAttribute:2,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)
+}},t[WebGLRenderingContext.FLOAT_VEC3]={componentsPerAttribute:3,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_VEC4]={componentsPerAttribute:4,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_MAT2]={componentsPerAttribute:4,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_MAT3]={componentsPerAttribute:9,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t[WebGLRenderingContext.FLOAT_MAT4]={componentsPerAttribute:16,componentDatatype:e.FLOAT,createArrayBufferView:function(e,t,r){return new Float32Array(e,t,this.componentsPerAttribute*r)}},t)}),r("Scene/ModelAnimationCache",["../Core/defined","../Core/Cartesian3","../Core/Quaternion","../Core/LinearSpline","../Core/QuaternionSpline","./ModelTypes"],function(e,t,r,i,n,o){"use strict";function a(e,t){var r=e.gltf,i=r.buffers,n=r.bufferViews,a=n[t.bufferView],s=i[a.buffer],l=a.byteOffset+t.byteOffset,u=t.count*o[t.type].componentsPerAttribute;return e.basePath+s.path+":"+l+":"+u}function s(e,t,r){return e.basePath+":"+t+":"+r}var l=function(){},u={},c=new t;l.getAnimationParameterValues=function(i,n){var s=a(i,n),l=u[s];if(!e(l)){var h,d=i._loadResources.buffers,m=i.gltf,p=m.bufferViews,f=p[n.bufferView],v=n.type,g=n.count,_=o[v].createArrayBufferView(d[f.buffer],f.byteOffset+n.byteOffset,n.count);if(v===WebGLRenderingContext.FLOAT)l=_;else if(v===WebGLRenderingContext.FLOAT_VEC3)for(l=new Array(g),h=0;g>h;++h)l[h]=t.fromArray(_,3*h);else if(v===WebGLRenderingContext.FLOAT_VEC4)for(l=new Array(g),h=0;g>h;++h){var y=4*h;l[h]=r.fromAxisAngle(t.fromArray(_,y,c),_[y+3])}u[s]=l}return l};var h={},d=function(e){this._value=e};return d.prototype.evaluate=function(){return this._value},l.getAnimationSpline=function(t,r,o,a,l,u){var c=s(t,r,a),m=h[c];if(!e(m)){var p=u[l.input],f=t.gltf.accessors[o.parameters[l.output]],v=u[l.output];1===p.length&&1===v.length?m=new d(v[0]):"LINEAR"===l.interpolation&&(f.type===WebGLRenderingContext.FLOAT_VEC3?m=new i({times:p,points:v}):f.type===WebGLRenderingContext.FLOAT_VEC4&&(m=new n({times:p,points:v}))),h[c]=m}return m},l}),r("Scene/ModelAnimationLoop",[],function(){"use strict";var e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e}),r("Scene/ModelAnimationState",[],function(){"use strict";return{STOPPED:0,ANIMATING:1}}),r("Scene/ModelAnimation",["../Core/defaultValue","../Core/Event","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i){"use strict";var n=function(n,o,a){this.name=n.name,this.startTime=n.startTime,this.startOffset=e(n.startOffset,0),this.stopTime=n.stopTime,this.removeOnStop=e(n.removeOnStop,!1),this.speedup=e(n.speedup,1),this.reverse=e(n.reverse,!1),this.loop=e(n.loop,r.NONE),this.start=new t,this.update=new t,this.stop=new t,this._state=i.STOPPED,this._runtimeAnimation=a,this._startTime=void 0,this._duration=void 0;var s=this;this._raiseStartEvent=function(){s.start.raiseEvent(o,s)},this._updateEventTime=0,this._raiseUpdateEvent=function(){s.update.raiseEvent(o,s,s._updateEventTime)},this._raiseStopEvent=function(){s.stop.raiseEvent(o,s)}};return n}),r("Scene/ModelAnimationCollection",["../Core/clone","../Core/defined","../Core/defineProperties","../Core/defaultValue","../Core/DeveloperError","../Core/Math","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState","./ModelAnimation"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t){for(var r=e.channelEvaluators,i=r.length,n=0;i>n;++n)r[n](t)}function d(e,t,r){return function(){e.animationRemoved.raiseEvent(t,r)}}var m=function(e){this.animationAdded=new a,this.animationRemoved=new a,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0};r(m.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),m.prototype.add=function(e){e=i(e,i.EMPTY_OBJECT);var t=this._model,r=t._runtime.animations,n=r[e.name],o=new c(e,t,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(t,o),o},m.prototype.addAll=function(t){t=i(t,i.EMPTY_OBJECT),t=e(t);var r=[],n=this._model.gltf.animations;for(var o in n)n.hasOwnProperty(o)&&(t.name=o,r.push(this.add(t)));return r},m.prototype.remove=function(e){if(t(e)){var r=this._scheduledAnimations,i=r.indexOf(e);if(-1!==i)return r.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},m.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,r=t.length;this._scheduledAnimations=[];for(var i=0;r>i;++i)this.animationRemoved.raiseEvent(e,t[i])},m.prototype.contains=function(e){return t(e)?-1!==this._scheduledAnimations.indexOf(e):!1},m.prototype.get=function(e){return this._scheduledAnimations[e]};var p=[];return m.prototype.update=function(e){if(s.equals(e.time,this._previousTime))return!1;this._previousTime=s.clone(e.time,this._previousTime);for(var r=!1,n=e.time,a=this._model,c=this._scheduledAnimations,m=c.length,f=0;m>f;++f){var v=c[f],g=v._runtimeAnimation;t(v._startTime)||(v._startTime=i(v.startTime,n).addSeconds(v.startOffset)),t(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._startTime,y=v._duration,C=v.stopTime,S=0!==y?_.getSecondsDifference(n)/y:0,w=S>=0,E=w&&(1>=S||v.loop===l.REPEAT||v.loop===l.MIRRORED_REPEAT)&&(!t(C)||n.lessThanOrEquals(C));if(E){if(v._state===u.STOPPED&&(v._state=u.ANIMATING,v.start.getNumberOfListeners()>0&&e.afterRender.push(v._raiseStartEvent)),v.loop===l.REPEAT)S-=Math.floor(S);else if(v.loop===l.MIRRORED_REPEAT){var x=Math.floor(S),b=S-x;S=1===x%2?1-b:b}v.reverse&&(S=1-S);var T=S*y*v.speedup;T=o.clamp(T,g.startTime,g.stopTime),h(g,T),v.update.getNumberOfListeners()>0&&(v._updateEventTime=T,e.afterRender.push(v._raiseUpdateEvent)),r=!0}else w&&v._state===u.ANIMATING&&(v._state=u.STOPPED,v.stop.getNumberOfListeners()>0&&e.afterRender.push(v._raiseStopEvent),v.removeOnStop&&p.push(v))}m=p.length;for(var A=0;m>A;++A){var P=p[A];c.splice(c.indexOf(P),1),e.afterRender.push(d(this,a,P))}return p.length=0,r},m}),r("Scene/ModelMesh",[],function(){"use strict";var e=function(e){this.name=e};return e}),r("Scene/ModelNode",["../Core/defaultValue","../Core/defineProperties","../Core/Matrix4"],function(e,t,r){"use strict";var i=function(t,i,n){this._model=t,this._runtimeNode=n,this.name=i.name,this.useMatrix=!1,this._matrix=r.clone(e(i.matrix,r.IDENTITY))};return t(i.prototype,{matrix:{get:function(){return this._matrix},set:function(e){this._matrix=r.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}}}),i}),r("ThirdParty/gltfDefaults",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";function r(e){if(t(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];t(i.matrix)||(t(i.translation)&&t(i.rotation)&&t(i.scale)?(t(i.translation)||(i.translation=[0,0,0]),t(i.rotation)||(i.rotation=[1,0,0,0]),t(i.scale)||(i.scale=[1,1,1])):i.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function i(r){if(t(r))for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];n.type=e(n.type,WebGLRenderingContext.UNSIGNED_BYTE)}}var n=function(e){return t(e)?(r(e.nodes),i(e.textures),e):void 0};return n}),r("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/defined","../Core/defaultValue","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadImage","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ModelAnimationCache","./ModelAnimationCollection","./ModelMesh","./ModelNode","./ModelTypes","./SceneMode","../ThirdParty/gltfDefaults"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T,A,P,D,M,I,O,R,L,N){"use strict";function B(){this.buffersToCreate=new C,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new C,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new C,this.pendingTextureLoads=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.skinnedNodesNames=[]}function z(e,t,r){return function(){e._loadError=new S("Failed to load external "+t+": "+r),e._state=Mt.FAILED}}function F(e,t){return function(r){var i=e._loadResources;i.buffers[t]=r,--i.pendingBufferLoads}}function V(e){var t=e.gltf.buffers;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingBufferLoads;var i=e.basePath+t[r].path;h(i).then(F(e,r),z(e,"buffer",i))}}function k(e){var t=e.gltf.bufferViews;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.buffersToCreate.enqueue(r)}function U(e,t){return function(r){var i=e._loadResources;i.shaders[t]=r,--i.pendingShaderLoads}}function W(e){var t=e.gltf.shaders;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingShaderLoads;var i=e.basePath+t[r].path;m(i).then(U(e,r),z(e,"shader",i))}}function G(e){var t=e.gltf.programs;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.programsToCreate.enqueue(r)}function H(e,t){return function(r){var i=e._loadResources;--i.pendingTextureLoads,i.texturesToCreate.enqueue({name:t,image:r})}}function j(e){var t=e.gltf.images,r=e.gltf.textures;for(var i in r)if(r.hasOwnProperty(i)){++e._loadResources.pendingTextureLoads;var n=e.basePath+t[r[i].source].path;d(n).then(H(e,i),z(e,"image",n))}}function q(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesNames,a=e.gltf.nodes;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,transformToRoot:new g,computedMatrix:new g,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointId:l.jointId,children:[],parents:[],publicNode:void 0};u.publicNode=new O(e,l,u),t[s]=u,r[l.name]=u,o(l.instanceSkin)&&(n.push(s),i.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function Y(e){var t={},r=e.gltf.meshes;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];t[n.name]=new I(n.name)}e._runtime.meshesByName=t}function X(e){V(e),k(e),W(e),G(e),j(e),Y(e),q(e)}function Z(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){for(var i,n,a=e.gltf.bufferViews,s=r.buffers,l=e._rendererResources.buffers;r.buffersToCreate.length>0;){var u=r.buffersToCreate.dequeue();if(n=a[u],n.target===WebGLRenderingContext.ARRAY_BUFFER){i=new Uint8Array(s[n.buffer],n.byteOffset,n.byteLength);var c=t.createVertexBuffer(i,E.STATIC_DRAW);c.setVertexArrayDestroyable(!1),l[u]=c}}var h=e.gltf.accessors;for(var d in h)if(h.hasOwnProperty(d)){var m=h[d];if(n=a[m.bufferView],n.target===WebGLRenderingContext.ELEMENT_ARRAY_BUFFER&&!o(l[m.bufferView])){i=new Uint8Array(s[n.buffer],n.byteOffset,n.byteLength);var p=t.createIndexBuffer(i,E.STATIC_DRAW,m.type);p.setVertexArrayDestroyable(!1),l[m.bufferView]=p}}}}function J(e){for(var t={},r=e.length,i=0;r>i;++i)t[e[i]]=i;return t}function Q(e,t){var r=e._loadResources;if(0===r.pendingShaderLoads){var i=e.gltf.programs,n=r.shaders;if(r.programsToCreate.length>0){var o=r.programsToCreate.dequeue(),a=i[o],s=J(a.attributes),l=n[a.vertexShader],u=n[a.fragmentShader];if(e._rendererResources.programs[o]=t.getShaderCache().getShaderProgram(l,u,s),e.allowPicking){var c=x({sources:[u],pickColorQualifier:"uniform"});e._rendererResources.pickPrograms[o]=t.getShaderCache().getShaderProgram(l,c,s)}}}}function K(e,t){var r=e._loadResources;if(r.createSamplers){r.createSamplers=!1;var i=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];i[o]=t.createSampler({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function $(e,t){var r=e._loadResources,i=e.gltf.textures,n=e._rendererResources.samplers;if(r.texturesToCreate.length>0){var o=r.texturesToCreate.dequeue(),a=i[o.name],s=n[a.sampler],l=s.minificationFilter===A.NEAREST_MIPMAP_NEAREST||s.minificationFilter===A.NEAREST_MIPMAP_LINEAR||s.minificationFilter===A.LINEAR_MIPMAP_NEAREST||s.minificationFilter===A.LINEAR_MIPMAP_LINEAR,u=l||s.wrapS===P.REPEAT||s.wrapS===P.MIRRORED_REPEAT||s.wrapT===P.REPEAT||s.wrapT===P.MIRRORED_REPEAT,c=o.image,h=!p.isPowerOfTwo(c.width)||!p.isPowerOfTwo(c.height);if(u&&h){var d=document.createElement("canvas");d.width=p.nextPowerOfTwo(c.width),d.height=p.nextPowerOfTwo(c.height);var m=d.getContext("2d");m.drawImage(c,0,0,c.width,c.height,0,0,d.width,d.height),c=d}var f;a.target===WebGLRenderingContext.TEXTURE_2D&&(f=t.createTexture2D({source:c,pixelFormat:a.internalFormat,pixelDatatype:a.type,flipY:!1})),l&&f.generateMipmap(),f.setSampler(s),e._rendererResources.textures[o.name]=f}}function et(e,t){var r=e.gltf;r.programs;var i=r.techniques,n=r.materials,o={},a=i[n[t.material].instanceTechnique.technique],s=a.parameters,l=a.passes[a.pass],u=l.instanceProgram,c=u.attributes,h=e._rendererResources.programs[u.program].getVertexAttributes();for(var d in c)if(c.hasOwnProperty(d)){var m=s[c[d]];o[m.semantic]=h[d].index}return o}function tt(e,t){for(var r=e.length,i=0;r>i;++i)for(var n=[e[i]];n.length>0;){var o=n.pop();if(o.jointId===t)return o;for(var a=o.children,s=a.length,l=0;s>l;++l)n.push(a[l])}return void 0}function rt(e,t){for(var r=e.gltf,i=r.skins,n=r.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesNames,s=a.length,l=0;s>l;++l){var u=a[l],c=o[u],h=n[u].instanceSkin,d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var m=[],p=h.skeletons,f=p.length,v=0;f>v;++v)m.push(o[p[v]]);for(var g=i[h.skin].joints,_=g.length,y=0;_>y;++y){var C=g[y];c.joints.push(tt(m,C))}}}function it(e){var t=e._loadResources;if(t.finishedBuffersCreation()&&t.createSkins){t.createSkins=!1;var r=e.gltf,i=t.buffers,n=r.bufferViews,o=r.skins,a={};for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],u=l.inverseBindMatrices,c=n[u.bufferView],h=u.type,d=u.count,m=R[h].createArrayBufferView(i[c.buffer],c.byteOffset+u.byteOffset,d),p=new Array(d);if(h===WebGLRenderingContext.FLOAT_MAT4)for(var f=0;d>f;++f)p[f]=g.fromArray(m,16*f);var v;g.equals(l.bindShapeMatrix,g.IDENTITY)||(v=g.clone(l.bindShapeMatrix)),a[s]={inverseBindMatrices:p,bindShapeMatrix:v}}rt(e,a)}}function nt(e,t,r,i){return function(n){t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber}}function ot(e){var t=e._loadResources;if(t.finishedPendingLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var r,i=e._runtime.nodes,n=e.gltf.animations,o=e.gltf.accessors;for(var a in n)if(n.hasOwnProperty(a)){var s=n[a],l=s.channels,u=s.parameters,c=s.samplers,h={};for(r in u)u.hasOwnProperty(r)&&(h[r]=D.getAnimationParameterValues(e,o[u[r]]));for(var d=Number.MAX_VALUE,m=-Number.MAX_VALUE,p=l.length,f=new Array(p),v=0;p>v;++v){var g=l[v],_=g.target,y=c[g.sampler],C=h[y.input];d=Math.min(d,C[0]),m=Math.max(m,C[C.length-1]);var S=D.getAnimationSpline(e,a,s,g.sampler,y,h);f[v]=nt(e,i[_.id],_.path,S)}e._runtime.animations[a]={startTime:d,stopTime:m,channelEvaluators:f}}}}function at(e,t){var r=e._loadResources;if(r.finishedBuffersCreation()&&r.finishedProgramCreation()&&r.createVertexArrays){r.createVertexArrays=!1;var i=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,a=e.gltf,s=a.accessors,l=a.meshes;for(var u in l)if(l.hasOwnProperty(u))for(var c=l[u].primitives,h=c.length,d=0;h>d;++d){var m=c[d],p=et(e,m),f=[],v=m.attributes;for(var g in v)if(v.hasOwnProperty(g)){var _=p[g];if(o(_)){var y=s[v[g]],C=R[y.type];f.push({index:_,vertexBuffer:i[y.bufferView],componentsPerAttribute:C.componentsPerAttribute,componentDatatype:C.componentDatatype,normalize:!1,offsetInBytes:y.byteOffset,strideInBytes:y.byteStride})}}var S=s[m.indices],w=i[S.bufferView];n[u+".primitive."+d]=t.createVertexArray(f,w)}}}function st(e,t){var r=e._loadResources;if(r.createRenderStates){r.createRenderStates=!1;var i=e._rendererResources.renderStates,n=e.gltf.techniques;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],s=a.passes[a.pass],l=s.states;i[o]=t.createRenderState({cull:{enabled:!!l.cullFaceEnable},depthTest:{enabled:!!l.depthTestEnable},depthMask:!!l.depthMask,blending:l.blendEnable?w.ALPHA_BLEND:w.DISABLED})}}}function lt(e){return function(){return e}}function ut(e){var r=t.fromArray(e);return function(){return r}}function ct(e){var t=r.fromArray(e);return function(){return t}}function ht(e){var t=i.fromArray(e);return function(){return t}}function dt(e){var t=f.fromColumnMajorArray(e);return function(){return t}}function mt(e){var t=v.fromColumnMajorArray(e);return function(){return t}}function pt(e){var t=g.fromColumnMajorArray(e);return function(){return t}}function ft(e,t){var r=t._rendererResources.textures[e];return function(){return r}}function vt(e,t){var r=t._runtime.nodes[e];return function(){return r.computedMatrix}}function gt(e,t){var r=e._loadResources;if(r.finishedTextureCreation()&&r.finishedProgramCreation()&&r.createUniformMaps){r.createUniformMaps=!1;var i=e.gltf,n=i.materials,a=i.techniques;i.programs;var s=e._rendererResources.uniformMaps;for(var l in n)if(n.hasOwnProperty(l)){var u,c=n[l],h=c.instanceTechnique,d=h.values,m=a[h.technique],p=m.parameters,f=m.passes[m.pass],v=f.instanceProgram,g=v.uniforms,_=e._rendererResources.programs[v.program].getAllUniforms(),y={};for(var C in g)if(g.hasOwnProperty(C)&&o(_[C])){var S,w=g[C],E=p[w];o(d[w])?S=Bt[E.type](d[w],e):o(E.semantic)?"JOINT_MATRIX"!==E.semantic?S=Nt[E.semantic](t.getUniformState()):(S=void 0,u=C):o(E.source)?S=vt(E.source,e):o(E.value)&&(S=Bt[E.type](E.value,e)),o(S)&&(y[w]={uniformName:C,func:S})}var x={};for(C in y)if(y.hasOwnProperty(C)){var b=y[C];x[b.uniformName]=b.func}s[l]={uniformMap:x,jointMatrixUniformName:u}}}}function _t(e){return function(){return e}}function yt(e){return function(){return e.computedJointMatrices}}function Ct(t,i,a,s){for(var l=t._renderCommands,u=t._pickCommands,h=t._pickIds,d=t.allowPicking,m=t._runtime.meshesByName,p=t.debugShowBoundingVolume,f=t._rendererResources,v=f.vertexArrays,_=f.programs,y=f.pickPrograms,C=f.renderStates,S=f.uniformMaps,w=t.gltf,E=w.accessors,x=w.meshes,A=w.techniques,P=w.materials,D=o(i.meshes)?i.meshes:i.instanceSkin.sources,M=D.length,I=0;M>I;++I)for(var O=D[I],R=x[O],L=R.primitives,N=L.length,B=0;N>B;++B){var z,F=L[B],V=E[F.indices],k=P[F.material].instanceTechnique,U=A[k.technique],W=U.passes[U.pass],G=W.instanceProgram,H=F.attributes.POSITION;if(o(H)){var j=E[H];z=e.fromCornerPoints(r.fromArray(j.min),r.fromArray(j.max))}var q=v[O+".primitive."+B],Y=V.count,X=V.byteOffset/c.getSizeInBytes(V.type),Z=S[F.material],J=Z.uniformMap;if(o(Z.jointMatrixUniformName)){var Q={};Q[Z.jointMatrixUniformName]=yt(a),J=n(J,Q)}var K=W.states.blendEnable,$=C[k.technique],et={primitive:t,id:t.id,node:a.publicNode,mesh:m[R.name]},tt=new b;tt.boundingVolume=new e,tt.modelMatrix=new g,tt.primitiveType=F.primitive,tt.vertexArray=q,tt.count=Y,tt.offset=X,tt.shaderProgram=_[G.program],tt.uniformMap=J,tt.renderState=$,tt.owner=et,tt.debugShowBoundingVolume=p,tt.pass=K?T.TRANSLUCENT:T.OPAQUE,l.push(tt);var rt;if(d){var it=s.createPickId(et);h.push(it);var nt=n(J,{czm_pickColor:_t(it.color)});rt=new b,rt.boundingVolume=new e,rt.modelMatrix=new g,rt.primitiveType=F.primitive,rt.vertexArray=q,rt.count=Y,rt.offset=X,rt.shaderProgram=y[G.program],rt.uniformMap=nt,rt.renderState=$,rt.owner=et,rt.pass=K?T.TRANSLUCENT:T.OPAQUE,u.push(rt)}a.commands.push({command:tt,pickCommand:rt,boundingSphere:z})}}function St(e,t){var i=e._loadResources;if(i.finishedPendingLoads()&&i.finishedResourceCreation()&&i.createRuntimeNodes){i.createRuntimeNodes=!1;for(var n=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,u=s.scenes[s.scene],c=u.nodes,h=c.length,d=[],m=new r,p=0;h>p;++p)for(d.push({parentRuntimeNode:void 0,gltfNode:l[c[p]],id:c[p]});d.length>0;){var f=d.pop(),v=f.parentRuntimeNode,_=f.gltfNode,C=a[f.id];0===C.parents.length&&(o(_.matrix)?C.matrix=g.fromColumnMajorArray(_.matrix):(m=r.fromArray(_.rotation,0,m),C.translation=r.fromArray(_.translation),C.rotation=y.fromAxisAngle(m,_.rotation[3]),C.scale=r.fromArray(_.scale))),o(v)?(v.children.push(C),C.parents.push(v)):n.push(C),(o(_.meshes)||o(_.instanceSkin))&&Ct(e,_,C,t);for(var S=_.children,w=S.length,E=0;w>E;++E)d.push({parentRuntimeNode:C,gltfNode:l[S[E]],id:S[E]})}e._runtime.rootNodes=n,e._runtime.nodes=a}}function wt(e,t){Z(e,t),Q(e,t),K(e,t),$(e,t),it(e),ot(e),at(e,t),st(e,t),gt(e,t),St(e,t)}function Et(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&o(i)?g.clone(i,t):o(e.matrix)?g.clone(e.matrix,t):g.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)}function xt(t,r,i){for(var n=t._maxDirtyNumber,o=t.allowPicking,a=t._runtime.rootNodes,s=a.length,l=zt,u=t._computedModelMatrix,c=0;s>c;++c){var h=a[c];for(Et(h,h.transformToRoot),l.push(h);l.length>0;){h=l.pop();var d=h.transformToRoot,m=h.commands;if(h.dirtyNumber===n||r||i){var p=m.length;if(p>0)for(var f=0;p>f;++f){var v=m[f],_=v.command;if(g.multiplyTransformation(u,d,_.modelMatrix),e.transform(v.boundingSphere,_.modelMatrix,_.boundingVolume),o){var y=v.pickCommand;g.clone(_.modelMatrix,y.modelMatrix),e.clone(_.boundingVolume,y.boundingVolume)}}else h.computedMatrix=g.multiplyTransformation(u,d,h.computedMatrix)}for(var C=h.children,S=C.length,w=0;S>w;++w){var E=C[w];E.dirtyNumber=Math.max(E.dirtyNumber,h.dirtyNumber),(E.dirtyNumber===n||i)&&(Et(E,E.transformToRoot),g.multiplyTransformation(d,E.transformToRoot,E.transformToRoot)),l.push(E)}}}++t._maxDirtyNumber}function bt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;r>i;++i){var n=t[i];Ft=g.inverseTransformation(n.transformToRoot,Ft);for(var a=n.computedJointMatrices,s=n.joints,l=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)a[h]=g.multiplyTransformation(Ft,s[h].transformToRoot,a[h]),a[h]=g.multiplyTransformation(a[h],u[h],a[h]),o(l)&&(a[h]=g.multiplyTransformation(a[h],l,a[h]))}}function Tt(e,t){var r=e.id;if(e._id!==r){e._id=r;for(var i=e._pickIds,n=i.length,o=0;n>o;++o)t.getObjectByPickColor(i[o].color).id=r}}function At(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?_.LINES:_.TRIANGLES,r=e._renderCommands,i=r.length,n=0;i>n;++n)r[n].primitiveType=t}}function Pt(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function Dt(e){for(var t in e)e.hasOwnProperty(t)&&e[t].release()}var Mt={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};B.prototype.finishedPendingLoads=function(){return 0===this.pendingBufferLoads&&0===this.pendingShaderLoads&&0===this.pendingTextureLoads},B.prototype.finishedResourceCreation=function(){return 0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.texturesToCreate.length},B.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},B.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},B.prototype.finishedTextureCreation=function(){return 0===this.pendingTextureLoads&&0===this.texturesToCreate.length};var It=function(e){e=a(e,a.EMPTY_OBJECT),this.gltf=N(e.gltf),this.basePath=a(e.basePath,""),this.show=a(e.show,!0),this.modelMatrix=g.clone(a(e.modelMatrix,g.IDENTITY)),this._modelMatrix=g.clone(this.modelMatrix),this.scale=a(e.scale,1),this._scale=this.scale,this.id=e.id,this._id=e.id,this.allowPicking=a(e.allowPicking,!0),this.readyToRender=new u,this.activeAnimations=new M(this),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.debugWireframe=a(e.debugWireframe,!1),this._debugWireframe=!1,this._computedModelMatrix=new g,this._state=Mt.NEEDS_LOAD,this._loadError=void 0,this._loadResources=void 0,this._cesiumAnimationsDirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},textures:{},samplers:{},renderStates:{},uniformMaps:{}},this._renderCommands=[],this._pickCommands=[],this._pickIds=[]};It.fromGltf=function(e){var t=e.url,r="",i=t.lastIndexOf("/");-1!==i&&(r=t.substring(0,i+1));var n=new It(e);return m(t,e.headers).then(function(e){n.gltf=N(JSON.parse(e)),n.basePath=r}),n},It.prototype.getNode=function(e){var t=this._runtime.nodesByName[e];return o(t)?t.publicNode:void 0},It.prototype.getMesh=function(e){return this._runtime.meshesByName[e]};var Ot=new r,Rt=[],Lt=new r;It.prototype.computeWorldBoundingSphere=function(t){o(t)||(t=new e),r.clone(r.ZERO,Ot),Rt.length=0;for(var i=Rt,n=this._renderCommands,a=n.length,s=0;a>s;++s){var l=n[s];r.add(l.boundingVolume.center,Ot,Ot),i.push(l.boundingVolume)}if(i.length>0){var u=0;for(a=i.length,r.divideByScalar(Ot,a,Ot),s=0;a>s;++s){var c=i[s],h=r.magnitudeSquared(r.subtract(c.center,Ot,Lt))+c.radius*c.radius;h>u&&(u=h)}r.clone(Ot,t.center),t.radius=Math.sqrt(u)}return t};var Nt={MODEL:function(e){return function(){return e.getModel()}},VIEW:function(e){return function(){return e.getView()}},PROJECTION:function(e){return function(){return e.getProjection()}},MODELVIEW:function(e){return function(){return e.getModelView()}},MODELVIEWPROJECTION:function(e){return function(){return e.getModelViewProjection()}},MODELINVERSE:function(e){return function(){return e.getInverseModel()}},VIEWINVERSE:function(e){return function(){return e.getInverseView()}},PROJECTIONINVERSE:function(e){return function(){return e.getInverseProjection()}},MODELVIEWINVERSE:function(e){return function(){return e.getInverseModelView()}},MODELVIEWPROJECTIONINVERSE:function(e){return function(){return e.getInverseModelViewProjection()}},MODELINVERSETRANSPOSE:function(e){return function(){return e.getInverseTranposeModel()}},MODELVIEWINVERSETRANSPOSE:function(e){return function(){return e.getNormal()}},VIEWPORT:function(e){return function(){return e.getViewportCartesian4()}}},Bt={};"undefined"!=typeof WebGLRenderingContext&&(Bt[WebGLRenderingContext.FLOAT]=lt,Bt[WebGLRenderingContext.FLOAT_VEC2]=ut,Bt[WebGLRenderingContext.FLOAT_VEC3]=ct,Bt[WebGLRenderingContext.FLOAT_VEC4]=ht,Bt[WebGLRenderingContext.INT]=lt,Bt[WebGLRenderingContext.INT_VEC2]=ut,Bt[WebGLRenderingContext.INT_VEC3]=ct,Bt[WebGLRenderingContext.INT_VEC4]=ht,Bt[WebGLRenderingContext.BOOL]=lt,Bt[WebGLRenderingContext.BOOL_VEC2]=ut,Bt[WebGLRenderingContext.BOOL_VEC3]=ct,Bt[WebGLRenderingContext.BOOL_VEC4]=ht,Bt[WebGLRenderingContext.FLOAT_MAT2]=dt,Bt[WebGLRenderingContext.FLOAT_MAT3]=mt,Bt[WebGLRenderingContext.FLOAT_MAT4]=pt,Bt[WebGLRenderingContext.SAMPLER_2D]=ft);var zt=[],Ft=new g;return It.prototype.update=function(e,t,r){if(t.mode===L.SCENE3D){this._state===Mt.NEEDS_LOAD&&o(this.gltf)&&(this._state=Mt.LOADING,this._loadResources=new B,X(this));var i=!1;if(this._state===Mt.FAILED)throw this._loadError;if(this._state===Mt.LOADING){wt(this,e);var n=this._loadResources;n.finishedPendingLoads()&&n.finishedResourceCreation()&&(this._state=Mt.LOADED,this._loadResources=void 0,i=!0)}if(this.show&&this._state===Mt.LOADED||i){var a=this.activeAnimations.update(t)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1;var s=!g.equals(this._modelMatrix,this.modelMatrix)||this._scale!==this.scale;(s||i)&&(g.clone(this.modelMatrix,this._modelMatrix),this._scale=this.scale,g.multiplyByUniformScale(this.modelMatrix,this.scale,this._computedModelMatrix)),(a||s||i)&&(xt(this,s,i),(a||i)&&bt(this)),Tt(this,e),At(this)}if(i){var l=this;return t.afterRender.push(function(){l.readyToRender.raiseEvent(l)}),void 0}if(this.show){var u,c,h,d=t.passes;if(d.render)for(h=this._renderCommands,c=h.length,u=0;c>u;++u)r.push(h[u]);if(d.pick)for(h=this._pickCommands,c=h.length,u=0;c>u;++u)r.push(h[u])}}},It.prototype.isDestroyed=function(){return!1},It.prototype.destroy=function(){var e=this._rendererResources;Pt(e.buffers),Pt(e.vertexArrays),Dt(e.programs),Dt(e.pickPrograms),Pt(e.textures),e=void 0,this._rendererResources=void 0;for(var t=this._pickIds,r=t.length,i=0;r>i;++i)t[i].destroy();return s(this)},It}),r("DynamicScene/DynamicModelVisualizer",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Scene/Model"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=new o,c=function(e,t){this._scene=e,this._primitives=e.primitives,this._modelCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};return c.prototype.getScene=function(){return this._scene},c.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},c.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(c.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(c.prototype._onObjectsRemoved,this))},c.prototype.update=function(e){if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,n=t.length;n>i;i++)this._updateObject(e,t[i])},c.prototype.removeAllPrimitives=function(){if(r(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),t=e.length-1;t>-1;t--){var i=e[t]._modelPrimitive;r(i)&&(this._primitives.remove(i),i.isDestroyed()||i.destroy(),i=void 0)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAllPrimitives(),i(this)},c.prototype._updateObject=function(i,n){var c=this._scene.context,h=n.model;if(r(h)){var d=h._uri;if(r(d)){var m=n.position;if(r(m)){var p=n._modelPrimitive,f=h._show,v=n.isAvailable(i)&&(!r(f)||f.getValue(i)),g=d.getValue(i,c);if(!v||!r(g))return r(p)&&(p.show=!1),void 0;r(p)&&g===n._modelPrimitiveUri||(r(p)&&(this._primitives.remove(p),p.isDestroyed()||p.destroy()),p=l.fromGltf({url:g}),n._modelPrimitiveUri=g,p.id=n,p.scale=1,p._visualizerOrientation=s.clone(s.IDENTITY),this._primitives.add(p),n._modelPrimitive=p),p.show=!0;var _,y=t(m.getValue(i,y),p._visualizerPosition),C=n.orientation;_=r(C)?t(C.getValue(i,_),p._visualizerOrientation):p._visualizerOrientation,!r(y)||!r(_)||e.equals(y,p._visualizerPosition)&&s.equals(_,p._visualizerOrientation)||(a.fromRotationTranslation(o.fromQuaternion(_,u),y,p.modelMatrix),p._visualizerPosition=e.clone(y,p._visualizerPosition),p._visualizerOrientation=s.clone(_,p._visualizerOrientation));var S=h._scale;if(r(S)){var w=S.getValue(i);r(w)&&(p.scale=w)}}}}},c.prototype._onObjectsRemoved=function(e,t,i){for(var n=i.length-1;n>-1;n--){var o=i[n],a=o._modelPrimitive;r(a)&&(this._primitives.remove(a),a.isDestroyed()||a.destroy(),o._modelPrimitive=void 0)}},c}),r("Scene/Polyline",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/BoundingSphere","../Core/Color","../Core/PolylinePipeline","../Core/Matrix4","../Core/Cartesian3","./Material"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,r){++e._propertiesChanged[r];var i=e._polylineCollection;t(i)&&(i._updatePolyline(e,r),e._dirty=!0)}var c=function(r,u){r=e(r,e.EMPTY_OBJECT),this._show=e(r.show,!0),this._width=e(r.width,1),this._loop=e(r.loop,!1),this._material=r.material,t(this._material)||(this._material=l.fromType(l.ColorType,{color:new n(1,1,1,1)}));var c=r.positions;t(c)||(c=[]),this._positions=c,this._loop&&c.length>2&&!s.equals(c[0],c[c.length-1])&&c.push(s.clone(c[0])),this._length=c.length,this._id=r.id;var h;t(u)&&(h=a.clone(u.modelMatrix)),this._modelMatrix=h,this._segments=o.wrapLongitude(c,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(v),this._polylineCollection=u,this._dirty=!1,this._pickId=void 0,this._pickIdThis=r._pickIdThis,this._boundingVolume=i.fromPoints(this._positions),this._boundingVolumeWC=i.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new i
+},h=c.SHOW_INDEX=0,d=c.WIDTH_INDEX=1,m=c.POSITION_INDEX=2,p=c.MATERIAL_INDEX=3,f=c.POSITION_SIZE_INDEX=4,v=c.NUMBER_OF_PROPERTIES=5;return c.prototype.getShow=function(){return this._show},c.prototype.setShow=function(e){e!==this._show&&(this._show=e,u(this,h))},c.prototype.getPositions=function(){return this._positions},c.prototype.setPositions=function(e){this._loop&&e.length>2&&!s.equals(e[0],e[e.length-1])&&e.push(s.clone(e[0])),(this._positions.length!==e.length||this._positions.length!==this._length)&&u(this,f),this._positions=e,this._length=e.length,this._boundingVolume=i.fromPoints(this._positions,this._boundingVolume),this._boundingVolumeWC=i.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),u(this,m),this.update()},c.prototype.update=function(){var e=a.IDENTITY;t(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,n=this._segments.lengths,s=this._propertiesChanged[m]>0||this._propertiesChanged[f]>0;if((!a.equals(e,this._modelMatrix)||s)&&(this._segments=o.wrapLongitude(this._positions,e),this._boundingVolumeWC=i.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==r)u(this,f);else for(var l=n.length,c=0;l>c;++c)if(n[c]!==this._segments.lengths[c]){u(this,f);break}},c.prototype.getMaterial=function(){return this._material},c.prototype.setMaterial=function(e){this._material!==e&&(this._material=e,u(this,p))},c.prototype.getWidth=function(){return this._width},c.prototype.setWidth=function(e){var t=this._width;e!==t&&(this._width=e,u(this,d))},c.prototype.getLoop=function(){return this._loop},c.prototype.setLoop=function(e){if(e!==this._loop){var t=this._positions;e?t.length>2&&!s.equals(t[0],t[t.length-1])&&t.push(s.clone(t[0])):t.length>2&&s.equals(t[0],t[t.length-1])&&t.pop(),this._loop=e,u(this,f)}},c.prototype.getId=function(){return this._id},c.prototype.getPickId=function(r){return t(this._pickId)||(this._pickId=r.createPickId({primitive:e(this._pickIdThis,this),collection:this._polylineCollection,id:this._id})),this._pickId},c.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;v-1>t;++t)e[t]=0},c.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},c}),r("Shaders/PolylineCommon",[],function(){"use strict";return"const vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvoid clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(normalize(previous.xyz - position.xyz), vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(normalize(next.xyz - position.xyz), vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_highResolutionSnapScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),r("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),r("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),r("Scene/PolylineCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Color","../Core/destroyObject","../Core/Cartesian3","../Core/Cartesian4","../Core/EncodedCartesian3","../Core/Matrix4","../Core/Math","../Core/ComponentDatatype","../Core/IndexDatatype","../Core/PrimitiveType","../Core/BoundingSphere","../Core/Intersect","../Renderer/BlendingState","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/createShaderSource","../Renderer/Pass","./Material","./SceneMode","./Polyline","../Shaders/PolylineCommon","../Shaders/PolylineVS","../Shaders/PolylineFS"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T){"use strict";function A(e,r,i,n,o,a,s){for(var l=n.length,u=0,c=!0,h=e._vertexArrays,d=e.debugShowBoundingVolume,f=h.length,v=0;f>v;++v)for(var g=h[v],y=g.buckets,S=y.length,E=0;S>E;++E){for(var x,b,T,A=y[E],P=A.offset,D=s?A.bucket.shaderProgram:A.bucket.pickShaderProgram,I=A.bucket.polylines,O=I.length,R=0,L=0;O>L;++L){var N=I[L],B=M(N._material);if(B!==x){if(t(x)&&R>0){var z=b.isTranslucent();u>=l?(T=new _,T.owner=e,n.push(T)):T=n[u],++u,T.boundingVolume=p.clone(Y,T.boundingVolume),T.modelMatrix=a,T.primitiveType=m.TRIANGLES,T.shaderProgram=D,T.vertexArray=g.va,T.renderState=z?e._translucentRS:e._opaqueRS,T.pass=z?C.TRANSLUCENT:C.OPAQUE,T.debugShowBoundingVolume=s?d:!1,T.uniformMap=b._uniforms,T.count=R,T.offset=P,P+=R,R=0,c=!0,o.push(T)}b=N._material,b.update(r),x=B}for(var F=N._locatorBuckets,V=F.length,k=0;V>k;++k){var U=F[k];U.locator===A&&(R+=U.count)}var W;i.mode===w.SCENE3D?W=N._boundingVolumeWC:i.mode===w.COLUMBUS_VIEW?W=N._boundingVolume2D:i.mode===w.SCENE2D?t(N._boundingVolume2D)&&(W=p.clone(N._boundingVolume2D,X),W.center.x=0):t(N._boundingVolumeWC)&&t(N._boundingVolume2D)&&(W=p.union(N._boundingVolumeWC,N._boundingVolume2D,X)),c?(c=!1,p.clone(W,Y)):p.union(W,Y,Y)}t(x)&&R>0&&(u>=l?(T=new _,T.owner=e,n.push(T)):T=n[u],++u,T.boundingVolume=p.clone(Y,T.boundingVolume),T.modelMatrix=a,T.primitiveType=m.TRIANGLES,T.shaderProgram=D,T.vertexArray=g.va,T.renderState=b.isTranslucent()?e._translucentRS:e._opaqueRS,T.pass=b.isTranslucent()?C.TRANSLUCENT:C.OPAQUE,T.debugShowBoundingVolume=s?d:!1,T.uniformMap=b._uniforms,T.count=R,T.offset=P,c=!0,o.push(T)),x=void 0}n.length=u}function P(e){for(var t=e._buffersUsage,r=!1,i=e._propertiesChanged,n=0;H-2>n;++n){var o=t[n];i[n]?o.bufferUsage!==g.STREAM_DRAW?(r=!0,o.bufferUsage=g.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==g.STATIC_DRAW&&(0===o.frameCount?(r=!0,o.bufferUsage=g.STATIC_DRAW):o.frameCount--)}return r}function D(e,r){e._createVertexArray=!1,L(e),N(e),I(e);var i,n,o=[[]],a=o[0],s=[0],l=0,u=[[]],m=0,p=e._polylineBuckets;for(i in p)p.hasOwnProperty(i)&&(n=p[i],n.updateShader(r),m+=n.lengthOfPositions);if(m>0){var f,v=e._mode,_=new Float32Array(3*6*m),y=new Uint8Array(4*m),C=new Float32Array(4*m),S=0,E=0,x=0;for(i in p)if(p.hasOwnProperty(i)){n=p[i],n.write(_,y,C,S,E,x,r),v===w.MORPHING&&(t(f)||(f=new Float32Array(3*6*m)),n.writeForMorph(f,S));var b=n.lengthOfPositions;S+=3*6*b,E+=4*b,x+=4*b,l=n.updateIndices(o,s,u,l)}var T=e._buffersUsage[U].bufferUsage,A=e._buffersUsage[V].bufferUsage,P=e._buffersUsage[k].bufferUsage,D=A===g.STREAM_DRAW||P===g.STREAM_DRAW?g.STREAM_DRAW:g.STATIC_DRAW;e._positionBuffer=r.createVertexBuffer(_,T);var M;t(f)&&(M=r.createVertexBuffer(f,T)),e._pickColorBuffer=r.createVertexBuffer(y,g.STATIC_DRAW),e._texCoordExpandWidthAndShowBuffer=r.createVertexBuffer(C,D);for(var O=4*Uint8Array.BYTES_PER_ELEMENT,R=3*Float32Array.BYTES_PER_ELEMENT,B=4*Float32Array.BYTES_PER_ELEMENT,z=0,F=o.length,W=0;F>W;++W)if(a=o[W],a.length>0){var G=new Uint16Array(a),H=r.createIndexBuffer(G,g.STATIC_DRAW,d.UNSIGNED_SHORT);z+=s[W];var q,Y,X,J,Q=6*(W*R*c.SIXTY_FOUR_KILOBYTES-z*R),K=R+Q,$=R+K,et=R+$,tt=R+et,rt=R+tt,it=W*O*c.SIXTY_FOUR_KILOBYTES-z*O,nt=W*B*c.SIXTY_FOUR_KILOBYTES-z*B,ot=[{index:j.position3DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:Q,strideInBytes:6*R},{index:j.position3DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:K,strideInBytes:6*R},{index:j.position2DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:Q,strideInBytes:6*R},{index:j.position2DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:K,strideInBytes:6*R},{index:j.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:$,strideInBytes:6*R},{index:j.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:et,strideInBytes:6*R},{index:j.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:$,strideInBytes:6*R},{index:j.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:et,strideInBytes:6*R},{index:j.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:tt,strideInBytes:6*R},{index:j.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:rt,strideInBytes:6*R},{index:j.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:tt,strideInBytes:6*R},{index:j.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:h.FLOAT,offsetInBytes:rt,strideInBytes:6*R},{index:j.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:h.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:nt},{index:j.pickColor,componentsPerAttribute:4,componentDatatype:h.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:it,normalize:!0}];v===w.SCENE3D?(q=e._positionBuffer,Y="vertexBuffer",X=Z,J="value"):v===w.SCENE2D||v===w.COLUMBUS_VIEW?(q=Z,Y="value",X=e._positionBuffer,J="vertexBuffer"):(q=M,Y="vertexBuffer",X=e._positionBuffer,J="vertexBuffer"),ot[0][Y]=q,ot[1][Y]=q,ot[2][J]=X,ot[3][J]=X,ot[4][Y]=q,ot[5][Y]=q,ot[6][J]=X,ot[7][J]=X,ot[8][Y]=q,ot[9][Y]=q,ot[10][J]=X,ot[11][J]=X;var at=r.createVertexArray(ot,H);e._vertexArrays.push({va:at,buckets:u[W]})}}}function M(e){var t=S._uniformList[e.type],r=t.length;J.length=2*r;for(var i=0,n=0;r>n;++n){var o=t[n];J[i]=o,J[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(J)}function I(e){for(var r=e._mode,i=e._projection,n=e._modelMatrix,o=e._polylineBuckets={},a=e._polylines,s=a.length,l=0;s>l;++l){var u=a[l];if(u.getPositions().length>1){u.update();var c=u.getMaterial(),h=o[c.type];t(h)||(h=o[c.type]=new Q(c,r,i,n)),h.addPolyline(u)}}}function O(e,t){var r=t.mode,i=t.scene2D.projection;e._mode===r&&e._projection===i&&u.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._projection=i,e._modelMatrix=u.clone(e.modelMatrix),e._createVertexArray=!0)}function R(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var r=[],i=e._polylines.length,n=0,o=0;i>n;++n){var a=e._polylines[n];t(a)&&(a._index=o++,r.push(a))}e._polylines=r}}function L(e){for(var r=e._polylines,i=r.length,n=0;i>n;++n)if(t(r[n])){var o=r[n]._bucket;t(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.release())}}function N(e){for(var t=e._vertexArrays.length,r=0;t>r;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function B(e){for(var r=e._polylines,i=r.length,n=0;i>n;++n)t(r[n])&&r[n]._destroy()}function z(e,t,r){this.count=e,this.offset=t,this.bucket=r}function F(e){return a.dot(a.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersect(s.UNIT_Y)===f.INTERSECTING}var V=E.SHOW_INDEX,k=E.WIDTH_INDEX,U=E.POSITION_INDEX,W=E.MATERIAL_INDEX,G=E.POSITION_SIZE_INDEX,H=E.NUMBER_OF_PROPERTIES,j={texCoordExpandWidthAndShow:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12,pickColor:13},q=function(t){t=e(t,e.EMPTY_OBJECT),this.modelMatrix=u.clone(e(t.modelMatrix,u.IDENTITY)),this._modelMatrix=u.clone(u.IDENTITY),this.debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(H),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:g.STATIC_DRAW,frameCount:0},{bufferUsage:g.STATIC_DRAW,frameCount:0},{bufferUsage:g.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0};r(q.prototype,{length:{get:function(){return R(this),this._polylines.length}}}),q.prototype.add=function(e){var t=new E(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},q.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,t(e._bucket)){var r=e._bucket;r.shaderProgram=r.shaderProgram&&r.shaderProgram.release(),r.pickShaderProgram=r.pickShaderProgram&&r.pickShaderProgram.release()}return e._destroy(),!0}return!1},q.prototype.removeAll=function(){L(this),B(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},q.prototype.contains=function(e){return t(e)&&e._polylineCollection===this},q.prototype.get=function(e){return R(this),this._polylines[e]},q.prototype.update=function(e,r,i){if(R(this),0!==this._polylines.length){O(this,r);var n,o=this._propertiesChanged;if(this._createVertexArray||P(this))D(this,e);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==w.SCENE3D)for(var s=a.length,l=0;s>l;++l)n=a[l],n.update();if(o[G]||o[W])D(this,e);else for(var c=a.length,h=this._polylineBuckets,d=0;c>d;++d){n=a[d],o=n._propertiesChanged;var m=n._bucket,p=0;for(var f in h)if(h.hasOwnProperty(f)){if(h[f]===m){(o[U]||o[V]||o[k])&&m.writeUpdate(p,n,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer);break}p+=h[f].lengthOfPositions}n._clean()}a.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var g=0;H>g;++g)o[g]=0;var _=u.IDENTITY;r.mode===w.SCENE3D&&(_=this.modelMatrix);var y=r.passes,C=0!==r.morphTime;if(t(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===C||(this._opaqueRS=e.createRenderState({depthMask:C,depthTest:{enabled:C}})),t(this._translucentRS)&&this._translucentRS.depthTest.enabled===C||(this._translucentRS=e.createRenderState({blending:v.ALPHA_BLEND,depthMask:!C,depthTest:{enabled:C}})),y.render){var S=this._colorCommands;A(this,e,r,S,i,_,!0)}if(y.pick){var E=this._pickCommands;A(this,e,r,E,i,_,!1)}}};var Y=new p,X=new p;q.prototype.isDestroyed=function(){return!1},q.prototype.destroy=function(){return N(this),L(this),B(this),o(this)};var Z=[0,0,0],J=[];q.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};var Q=function(e,t,r,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.projection=r,this.ellipsoid=r.ellipsoid,this.modelMatrix=i};Q.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Q.prototype.updateShader=function(e){if(!t(this.shaderProgram)){var r=y({sources:[x,b]}),i=y({sources:[this.material.shaderSource,T]}),n=y({sources:[i],pickColorQualifier:"varying"});this.shaderProgram=e.getShaderCache().getShaderProgram(r,i,j),this.pickShaderProgram=e.getShaderCache().getShaderProgram(r,n,j)}},Q.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===w.SCENE3D||!F(e))return t=e.getPositions().length,4*t-4;var r=0,i=e._segments.lengths;t=i.length;for(var n=0;t>n;++n)r+=4*i[n]-4;return r};var K=new a,$=new a,et=new a,tt=new a;Q.prototype.write=function(e,t,r,i,o,s,u){for(var c=this.mode,h=this.polylines,d=h.length,m=0;d>m;++m)for(var p,f=h[m],v=f.getWidth(),g=f.getShow()&&v>0,_=this.getSegments(f),y=_.positions,C=_.lengths,S=y.length,E=f.getPickId(u).color,x=0,b=0,T=0;S>T;++T){0===T?f._loop?p=y[S-2]:(p=tt,a.subtract(y[0],y[1],p),a.add(y[0],p,p)):p=y[T-1],$.x=p.x,$.y=p.y,$.z=c!==w.SCENE2D?p.z:0,p=y[T],K.x=p.x,K.y=p.y,K.z=c!==w.SCENE2D?p.z:0,T===S-1?f._loop?p=y[1]:(p=tt,a.subtract(y[S-1],y[S-2],p),a.add(y[S-1],p,p)):p=y[T+1],et.x=p.x,et.y=p.y,et.z=c!==w.SCENE2D?p.z:0;var A=C[x];T===b+A&&(b+=A,++x);for(var P=0===T-b,D=T===b+C[x]-1,M=P?2:0,I=D?2:4,O=M;I>O;++O){l.writeElements(K,e,i),l.writeElements($,e,i+6),l.writeElements(et,e,i+12),t[o]=n.floatToByte(E.red),t[o+1]=n.floatToByte(E.green),t[o+2]=n.floatToByte(E.blue),t[o+3]=n.floatToByte(E.alpha);var R=0>O-2?-1:1;r[s]=T/(S-1),r[s+1]=2*(O%2)-1,r[s+2]=R*v,r[s+3]=g,i+=18,o+=4,s+=4}}};var rt=new a,it=new a,nt=new a,ot=new a;Q.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,i=this.polylines,n=i.length,o=0;n>o;++o)for(var s=i[o],c=s._segments.positions,h=s._segments.lengths,d=c.length,m=0,p=0,f=0;d>f;++f){var v;0===f?s._loop?v=c[d-2]:(v=ot,a.subtract(c[0],c[1],v),a.add(c[0],v,v)):v=c[f-1],v=u.multiplyByPoint(r,v,it);var g,_=u.multiplyByPoint(r,c[f],rt);f===d-1?s._loop?g=c[1]:(g=ot,a.subtract(c[d-1],c[d-2],g),a.add(c[d-1],g,g)):g=c[f+1],g=u.multiplyByPoint(r,g,nt);var y=h[m];f===p+y&&(p+=y,++m);for(var C=0===f-p,S=f===p+h[m]-1,w=C?2:0,E=S?2:4,x=w;E>x;++x)l.writeElements(_,e,t),l.writeElements(v,e,t+6),l.writeElements(g,e,t+12),t+=18}};var at=new Array(1);Q.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new z(0,i,this);r[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,h=u.length,d=0;h>d;++d){var m=u[d];m._locatorBuckets=[];var p;if(this.mode===w.SCENE3D){p=at;var f=m.getPositions().length;if(!(f>0))continue;p[0]=f}else p=m._segments.lengths;var v=p.length;if(v>0){for(var g=0,_=0;v>_;++_)for(var y=p[_]-1,C=0;y>C;++C)l+4>=c.SIXTY_FOUR_KILOBYTES-1&&(m._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,i=0,o=new z(0,0,this),r[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,i+=6,l+=4;m._locatorBuckets.push({locator:o,count:g}),l+4>=c.SIXTY_FOUR_KILOBYTES-1&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new z(0,0,this),r[++n]=[o])}m._clean()}return o.count=a,i},Q.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,r=0,i=t.length,n=0;i>n;++n){var o=t[n];if(o===e)break;r+=o._actualLength}return r};var st={positions:void 0,lengths:void 0},lt=new Array(1);Q.prototype.getSegments=function(e){var t=e.getPositions();if(this.mode===w.SCENE3D)return lt[0]=t.length,st.positions=t,st.lengths=lt,st;F(e)&&(t=e._segments.positions);for(var r,i,n=this.ellipsoid,o=this.projection,s=[],l=this.modelMatrix,c=t.length,h=0;c>h;++h)r=t[h],i=u.multiplyByPoint(l,r),s.push(o.project(n.cartesianToCartographic(i)));if(s.length>0){e._boundingVolume2D=p.fromPoints(s,e._boundingVolume2D);var d=e._boundingVolume2D.center;e._boundingVolume2D.center=new a(d.z,d.x,d.y)}return st.positions=s,st.lengths=e._segments.lengths,st};var ut,ct;return Q.prototype.writeUpdate=function(e,r,i,n){var o=this.mode,s=r._actualLength;if(s){e+=this.getPolylineStartIndex(r);var u=ut,c=ct,h=3*6*s;!t(u)||u.lengthh&&(u=new Float32Array(u.buffer,0,h),c=new Float32Array(c.buffer,0,4*s));var d,m=0,p=0,f=this.getSegments(r),v=f.positions,g=f.lengths,_=0,y=0,C=r.getWidth(),S=r.getShow()&&C>0;s=v.length;for(var E=0;s>E;++E){0===E?r._loop?d=v[s-2]:(d=tt,a.subtract(v[0],v[1],d),a.add(v[0],d,d)):d=v[E-1],$.x=d.x,$.y=d.y,$.z=o!==w.SCENE2D?d.z:0,d=v[E],K.x=d.x,K.y=d.y,K.z=o!==w.SCENE2D?d.z:0,E===s-1?r._loop?d=v[1]:(d=tt,a.subtract(v[s-1],v[s-2],d),a.add(v[s-1],d,d)):d=v[E+1],et.x=d.x,et.y=d.y,et.z=o!==w.SCENE2D?d.z:0;var x=g[_];E===y+x&&(y+=x,++_);for(var b=0===E-y,T=E===y+g[_]-1,A=b?2:0,P=T?2:4,D=A;P>D;++D){l.writeElements(K,u,m),l.writeElements($,u,m+6),l.writeElements(et,u,m+12);var M=0>D-2?-1:1;c[p]=E/(s-1),c[p+1]=2*(D%2)-1,c[p+2]=M*C,c[p+3]=S,m+=18,p+=4}}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(c,4*Float32Array.BYTES_PER_ELEMENT*e)}},q}),r("DynamicScene/DynamicPathVisualizer",["../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Cartesian3","../Core/Matrix3","../Core/Matrix4","../Core/Color","../Core/Transforms","../Core/ReferenceFrame","./SampledPositionProperty","./CompositePositionProperty","./TimeIntervalCollectionPositionProperty","../Scene/Material","../Scene/SceneMode","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(t,r,i,n,o,a,s,l){var u,c=t._property._times,h=s;u=t.getValueInReferenceFrame(r,o,l[h]),e(u)&&(l[h++]=u);for(var d,m,p,f=!e(n)||n.lessThanOrEquals(r)||n.greaterThanOrEquals(i),v=0,g=c.length,_=c[v],y=i,C=!1;g>v;){if(!f&&_.greaterThanOrEquals(n)&&(u=t.getValueInReferenceFrame(n,o,l[h]),e(u)&&(l[h++]=u),f=!0),_.greaterThan(r)&&_.lessThan(y)&&!_.equals(n)&&(u=t.getValueInReferenceFrame(_,o,l[h]),e(u)&&(l[h++]=u)),g-1>v){if(!C){var S=c[v+1],w=_.getSecondsDifference(S);C=w>a,C&&(d=Math.floor(w/a),m=0,p=w/Math.max(d,2),d=Math.max(d-2,1))}if(C&&d>m){_=_.addSeconds(p),m++;continue}}C=!1,v++,_=c[v]}return u=t.getValueInReferenceFrame(i,o,l[h]),e(u)&&(l[h++]=u),h}function v(t,r,i,n,o,a,s,l){for(var u,c=0,h=s,d=r,m=!e(n)||n.lessThanOrEquals(r)||n.greaterThanOrEquals(i);d.lessThan(i);)!m&&d.greaterThanOrEquals(n)&&(m=!0,u=t.getValueInReferenceFrame(n,o,l[h]),e(u)&&(l[h]=u,h++)),u=t.getValueInReferenceFrame(d,o,l[h]),e(u)&&(l[h]=u,h++),c++,d=r.addSeconds(a*c);return u=t.getValueInReferenceFrame(i,o,l[h]),e(u)&&(l[h]=u,h++),h}function g(t,r,i,n,o,a,s,l){for(var u=s,c=t.getIntervals(),h=0;h0?(h=x.pop(),o=this._polylineCollection.get(h)):(h=this._polylineCollection.length,o=this._polylineCollection.add()),r._pathVisualizerIndex=h,o.id=r,o.setWidth(1);var T=o.getMaterial();e(T)&&T.type===d.PolylineOutlineType||(T=d.fromType(d.PolylineOutlineType),o.setMaterial(T)),E=T.uniforms,a.clone(a.WHITE,E.color),a.clone(a.BLACK,E.outlineColor),E.outlineWidth=0}o.setShow(!0);var A=60;if(s=i._resolution,e(s)&&(A=s.getValue(t)),o.setPositions(y(n,l,u,t,this._referenceFrame,A,o.getPositions())),s=i._color,e(s)&&(E.color=s.getValue(t,E.color)),s=i._outlineColor,e(s)&&(E.outlineColor=s.getValue(t,E.outlineColor)),s=i._outlineWidth,e(s)&&(E.outlineWidth=s.getValue(t)),s=i._width,e(s)){var P=s.getValue(t);e(P)&&o.setWidth(P)}}}},S.prototype.removeObject=function(t){var r=t._pathVisualizerIndex;if(e(r)){var i=this._polylineCollection.get(r);i.setShow(!1),this._unusedIndexes.push(r),t._pathVisualizerIndex=void 0}},S.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)};var w=function(e,t){this._scene=e,this._updaters={},this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};return w.prototype.getScene=function(){return this._scene},w.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},w.prototype.setDynamicObjectCollection=function(t){var r=this._dynamicObjectCollection;r!==t&&(e(r)&&(r.collectionChanged.removeEventListener(w.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=t,e(t)&&t.collectionChanged.addEventListener(w.prototype._onObjectsRemoved,this))},w.prototype.update=function(t){if(e(this._dynamicObjectCollection)){var r=this._updaters;for(var i in r)r.hasOwnProperty(i)&&r[i].update(t);for(var n=this._dynamicObjectCollection.getObjects(),o=0,a=n.length;a>o;o++){var s=n[o];if(e(s._path)){var u=s._position;if(e(u)){var c=s._pathUpdater,h=l.FIXED;this._scene.mode===m.SCENE3D&&(h=u._referenceFrame);var d=this._updaters[h];c===d&&e(d)?d.updateObject(t,s):(e(c)&&c.removeObject(s),e(d)||(d=new S(this._scene,h),d.update(t),this._updaters[h]=d),s._pathUpdater=d,e(d)&&d.updateObject(t,s))}}}}},w.prototype.removeAllPrimitives=function(){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].destroy();if(this._updaters={},e(this._dynamicObjectCollection))for(var i=this._dynamicObjectCollection.getObjects(),n=i.length-1;n>-1;n--)i[n]._pathUpdater=void 0,i[n]._pathVisualizerIndex=void 0},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),r(this)},w.prototype._onObjectsRemoved=function(t,r,i){for(var n=i.length-1;n>-1;n--){var o=i[n],a=o._pathUpdater;e(a)&&a.removeObject(o)}},w}),r("DynamicScene/DynamicPointVisualizer",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/BillboardCollection","../Renderer/TextureAtlasBuilder"],function(e,t,r,i,n,o,a){"use strict";function s(i,n,o){var a=o._point;if(r(a)){var s=o._position;if(r(s)){var l,m=a._show,p=o._pointVisualizerIndex,f=o.isAvailable(n)&&(!r(m)||m.getValue(n));if(!f)return r(p)&&(l=i._billboardCollection.get(p),l.setShow(!1),l.setImageIndex(-1),o._pointVisualizerIndex=void 0,i._unusedIndexes.push(p)),void 0;var v=!1;if(r(p))l=i._billboardCollection.get(p);else{var g=i._unusedIndexes,_=g.length;_>0?(p=g.pop(),l=i._billboardCollection.get(p)):(p=i._billboardCollection.length,l=i._billboardCollection.add()),o._pointVisualizerIndex=p,l.id=o,l._visualizerColor=e.clone(e.WHITE,l._visualizerColor),l._visualizerOutlineColor=e.clone(e.BLACK,l._visualizerOutlineColor),l._visualizerOutlineWidth=0,l._visualizerPixelSize=1,v=!0}l.setShow(!0),c=s.getValue(n,c),r(c)&&l.setPosition(c);var y=a._color;if(r(y)&&(u=y.getValue(n,u),e.equals(l._visualizerColor,u)||(e.clone(u,l._visualizerColor),v=!0)),y=a._outlineColor,r(y)&&(h=y.getValue(n,h),e.equals(l._visualizerOutlineColor,h)||(e.clone(h,l._visualizerOutlineColor),v=!0)),y=a._outlineWidth,r(y)){var C=y.getValue(n);l._visualizerOutlineWidth!==C&&(l._visualizerOutlineWidth=C,v=!0)}if(y=a._pixelSize,r(y)){var S=y.getValue(n);l._visualizerPixelSize!==S&&(l._visualizerPixelSize=S,v=!0)}if(y=a._scaleByDistance,r(y)&&(d=y.getValue(n,d),r(d)&&l.setScaleByDistance(d)),v){var w=t(l._visualizerColor,e.WHITE).toCssColorString(),E=t(l._visualizerOutlineColor,e.BLACK).toCssColorString(),x=t(l._visualizerPixelSize,3),b=t(l._visualizerOutlineWidth,2),T=JSON.stringify([w,x,E,b]);i._textureAtlasBuilder.addTextureFromFunction(T,function(e,t){var r=document.createElement("canvas"),i=x+2*b;r.height=r.width=i;var n=r.getContext("2d");n.clearRect(0,0,i,i),0!==b&&(n.beginPath(),n.arc(i/2,i/2,i/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=E,n.fill()),n.beginPath(),n.arc(i/2,i/2,x/2,0,2*Math.PI,!0),n.closePath(),n.fillStyle=w,n.fill(),t(r)},function(e){l.setImageIndex(e)})}}}}var l=function(e,t){this._scene=e,this._unusedIndexes=[],this._dynamicObjectCollection=void 0;
+var r=this._billboardCollection=new o,i=this._textureAtlas=e.context.createTextureAtlas();this._textureAtlasBuilder=new a(i),r.textureAtlas=i,e.primitives.add(r),this.setDynamicObjectCollection(t)};l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var t=this._dynamicObjectCollection;t!==e&&(r(t)&&(t.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,r(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(e){if(r(this._dynamicObjectCollection))for(var t=this._dynamicObjectCollection.getObjects(),i=0,n=t.length;n>i;i++)s(this,e,t[i])},l.prototype.removeAllPrimitives=function(){if(this._unusedIndexes=[],this._billboardCollection.removeAll(),r(this._dynamicObjectCollection))for(var e=this._dynamicObjectCollection.getObjects(),t=e.length-1;t>-1;t--)e[t]._pointVisualizerIndex=void 0},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._billboardCollection),i(this)};var u,c,h,d;return l.prototype._onObjectsRemoved=function(e,t,i){for(var n=this._billboardCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._pointVisualizerIndex;if(r(l)){var u=n.get(l);u.setShow(!1),u.setImageIndex(-1),s._pointVisualizerIndex=void 0,o.push(l)}}},l}),r("DynamicScene/DynamicPyramidVisualizer",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/destroyObject","../Core/Cartesian3","../Core/Color","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Scene/CustomSensorVolume","../Scene/Material","./MaterialProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(r,i,d){var p=d._pyramid;if(t(p)){var g=p._directions;if(t(g)){var _=d._position;if(t(_)){var y=d._orientation;if(t(y)){var C,S=p._show,w=d._pyramidVisualizerIndex,E=d.isAvailable(i)&&(!t(S)||S.getValue(i));if(!E)return t(w)&&(C=r._pyramidCollection[w],C.show=!1,d._pyramidVisualizerIndex=void 0,r._unusedIndexes.push(w)),void 0;if(t(w))C=r._pyramidCollection[w];else{var x=r._unusedIndexes,b=x.length;b>0?(w=x.pop(),C=r._pyramidCollection[w]):(w=r._pyramidCollection.length,C=new u,r._pyramidCollection.push(C),r._primitives.add(C)),d._pyramidVisualizerIndex=w,C.id=d,C.radius=Number.POSITIVE_INFINITY,C.showIntersection=!0,C.intersectionColor=o.YELLOW,C.intersectionWidth=5,C.material=c.fromType(c.ColorType)}C.show=!0;var T=g.getValue(i);t(T)&&C._visualizerDirections!==T&&(C.setDirections(T),C._visualizerDirections=T),f=e(_.getValue(i,f),C._visualizerPosition),v=e(y.getValue(i,v),C._visualizerOrientation),!t(f)||!t(v)||n.equals(f,C._visualizerPosition)&&l.equals(v,C._visualizerOrientation)||(s.fromRotationTranslation(a.fromQuaternion(v,m),f,C.modelMatrix),n.clone(f,C._visualizerPosition),l.clone(v,C._visualizerOrientation)),C.material=h.getValue(i,p._material,C.material);var A=p._intersectionColor;if(t(A)){var P=A.getValue(i,P);t(P)&&(C.intersectionColor=P)}if(A=p._intersectionWidth,t(A)){var D=A.getValue(i,D);t(D)&&(C.intersectionWidth=D)}if(A=p._radius,t(A)){var M=A.getValue(i,M);t(M)&&(C.radius=M)}}}}}}var m=new a,p=function(e,t){this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives,this._pyramidCollection=[],this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};p.prototype.getScene=function(){return this._scene},p.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},p.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(p.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(p.prototype._onObjectsRemoved,this))},p.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)d(this,e,r[i])},p.prototype.removeAllPrimitives=function(){var e,r;for(e=0,r=this._pyramidCollection.length;r>e;e++)this._primitives.remove(this._pyramidCollection[e]);if(t(this._dynamicObjectCollection)){var i=this._dynamicObjectCollection.getObjects();for(e=i.length-1;e>-1;e--)i[e]._pyramidVisualizerIndex=void 0}this._unusedIndexes=[],this._pyramidCollection=[]},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),i(this)};var f,v;return p.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._pyramidCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._pyramidVisualizerIndex;if(t(l)){var u=n[l];u.show=!1,o.push(l),s._pyramidVisualizerIndex=void 0}}},p}),r("DynamicScene/DynamicVectorVisualizer",["../Core/DeveloperError","../Core/defined","../Core/destroyObject","../Core/Cartesian3","../Core/Color","../Scene/Material","../Scene/PolylineCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,a){var s=a._vector;if(t(s)){var l,u=s._show,c=a._position,h=s._direction,d=s._length,m=a._vectorVisualizerIndex,p=a.isAvailable(r)&&(!t(u)||u.getValue(r));if(!(p&&t(h)&&t(c)&&t(d)))return t(m)&&(l=e._polylineCollection.get(m),l.setShow(!1),a._vectorVisualizerIndex=void 0,e._unusedIndexes.push(m)),void 0;var f;if(t(m))l=e._polylineCollection.get(m),f=l.getMaterial().uniforms;else{var v=e._unusedIndexes;v.length>0?(m=v.pop(),l=e._polylineCollection.get(m)):(m=e._polylineCollection.length,l=e._polylineCollection.add(),l._visualizerPositions=[new i,new i]),a._vectorVisualizerIndex=m,l.id=a,l.setWidth(1);var g=l.getMaterial();t(g)&&g.type===o.PolylineArrowType||(g=o.fromType(o.PolylineArrowType),l.setMaterial(g)),f=g.uniforms,n.clone(n.WHITE,f.color)}l.setShow(!0);var _=l._visualizerPositions,y=c.getValue(r,_[0]),C=h.getValue(r,_[1]),S=d.getValue(r);t(y)&&t(C)&&t(S)&&(i.add(y,i.multiplyByScalar(i.normalize(C,C),S,C),C),l.setPositions(_));var w=s._color;if(t(w)&&(f.color=w.getValue(r,f.color)),w=s._width,t(w)){var E=w.getValue(r);t(E)&&l.setWidth(E)}}}var l=function(e,t){this._scene=e,this._unusedIndexes=[],this._primitives=e.primitives;var r=this._polylineCollection=new a;e.primitives.add(r),this._dynamicObjectCollection=void 0,this.setDynamicObjectCollection(t)};return l.prototype.getScene=function(){return this._scene},l.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},l.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(l.prototype._onObjectsRemoved,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&e.collectionChanged.addEventListener(l.prototype._onObjectsRemoved,this))},l.prototype.update=function(e){if(t(this._dynamicObjectCollection))for(var r=this._dynamicObjectCollection.getObjects(),i=0,n=r.length;n>i;i++)s(this,e,r[i])},l.prototype.removeAllPrimitives=function(){var e;if(this._polylineCollection.removeAll(),t(this._dynamicObjectCollection)){var r=this._dynamicObjectCollection.getObjects();for(e=r.length-1;e>-1;e--)r[e]._vectorVisualizerIndex=void 0}this._unusedIndexes=[]},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.setDynamicObjectCollection(void 0),this._scene.primitives.remove(this._polylineCollection),r(this)},l.prototype._onObjectsRemoved=function(e,r,i){for(var n=this._polylineCollection,o=this._unusedIndexes,a=i.length-1;a>-1;a--){var s=i[a],l=s._vectorVisualizerIndex;if(t(l)){var u=n.get(l);u.setShow(!1),o.push(l),s._vectorVisualizerIndex=void 0}}},l}),r("Scene/Appearance",["../Core/clone","../Core/defaultValue","../Core/defined","../Renderer/BlendingState","../Renderer/CullFace","../Renderer/createShaderSource"],function(e,t,r,i,n,o){"use strict";var a=function(e){e=t(e,t.EMPTY_OBJECT),this.material=e.material,this.vertexShaderSource=e.vertexShaderSource,this.fragmentShaderSource=e.fragmentShaderSource,this.renderState=e.renderState,this.translucent=t(e.translucent,!0),this.closed=t(e.closed,!1)};return a.prototype.getFragmentShaderSource=function(){return o({defines:[this.flat?"FLAT":"",this.faceForward?"FACE_FORWARD":""],sources:[r(this.material)?this.material.shaderSource:"",this.fragmentShaderSource]})},a.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},a.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=i.ALPHA_BLEND):r.depthMask=!0,r},a.getDefaultRenderState=function(e,t){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=i.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:n.BACK}),r},a}),r("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),r("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/freezeObject","../Core/VertexFormat","./Material","./Appearance","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/AllMaterialAppearanceFS"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),a=e(r.closed,!1),s=e(r.materialSupport,d.MaterialSupport.TEXTURED);this.material=t(r.material)?r.material:n.fromType(n.ColorType),this.vertexShaderSource=e(r.vertexShaderSource,s.vertexShaderSource),this.fragmentShaderSource=e(r.fragmentShaderSource,s.fragmentShaderSource),this.renderState=e(r.renderState,o.getDefaultRenderState(i,a)),this.materialSupport=s,this.vertexFormat=s.vertexFormat,this.flat=e(r.flat,!1),this.faceForward=e(r.faceForward,!a),this.translucent=i,this.closed=a};return d.prototype.getFragmentShaderSource=o.prototype.getFragmentShaderSource,d.prototype.isTranslucent=o.prototype.isTranslucent,d.prototype.getRenderState=o.prototype.getRenderState,d.MaterialSupport={BASIC:r({vertexFormat:i.POSITION_AND_NORMAL,vertexShaderSource:a,fragmentShaderSource:s}),TEXTURED:r({vertexFormat:i.POSITION_NORMAL_AND_ST,vertexShaderSource:l,fragmentShaderSource:u}),ALL:r({vertexFormat:i.ALL,vertexShaderSource:c,fragmentShaderSource:h})},d}),r("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),r("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),r("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/VertexFormat","./Appearance","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){t=e(t,e.EMPTY_OBJECT);var l=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?o:i,d=c?a:n,m=c?s.FLAT_VERTEX_FORMAT:s.VERTEX_FORMAT;this.material=void 0,this.vertexShaderSource=e(t.vertexShaderSource,h),this.fragmentShaderSource=e(t.fragmentShaderSource,d),this.renderState=e(t.renderState,r.getDefaultRenderState(l,u)),this.vertexFormat=m,this.flat=c,this.faceForward=e(t.faceForward,!u),this.translucent=l,this.closed=u};return s.VERTEX_FORMAT=t.POSITION_AND_NORMAL,s.FLAT_VERTEX_FORMAT=t.POSITION_ONLY,s.prototype.getFragmentShaderSource=r.prototype.getFragmentShaderSource,s.prototype.isTranslucent=r.prototype.isTranslucent,s.prototype.getRenderState=r.prototype.getRenderState,s}),r("Renderer/VertexLayout",["../Core/Enumeration"],function(e){"use strict";var t={SEPARATE:new e(0,"SEPARATE"),INTERLEAVED:new e(1,"INTERLEAVED"),validate:function(e){return e===t.SEPARATE||e===t.INTERLEAVED}};return t}),r("Scene/PrimitivePipeline",["../Core/defined","../Core/defaultValue","../Core/Color","../Core/ComponentDatatype","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/Matrix4"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r){var i,n=!r,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(i=1;o>i;++i)if(!u.equals(a,e[i].modelMatrix)){n=!0;break}}if(n)for(i=0;o>i;++i)l.transformToWorldCoordinates(e[i]);else u.clone(e[0].modelMatrix,t)}function h(e,t){for(var n=e.length,o=0;n>o;++o){var a=e[o],l=a.geometry,u=l.attributes,c=u.position,h=4*(c.values.length/c.componentsPerAttribute);u.pickColor=new s({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(h)});for(var d=t[o],m=r.floatToByte(d.red),p=r.floatToByte(d.green),f=r.floatToByte(d.blue),v=r.floatToByte(d.alpha),g=u.pickColor.values,_=0;h>_;_+=4)g[_]=m,g[_+1]=p,g[_+2]=f,g[_+3]=v}}function d(t){var r,i=t.length,n=[],o=t[0].attributes;for(r in o)if(o.hasOwnProperty(r)){for(var a=o[r],s=!0,l=1;i>l;++l){var u=t[l].attributes[r];if(!e(u)||a.componentDatatype.value!==u.componentDatatype.value||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&n.push(r)}return n}function m(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],l=o.attributes,u=o.geometry,c=a.computeNumberOfVertices(u),h=t.length,d=0;h>d;++d){for(var m=t[d],p=l[m],f=p.componentDatatype,v=p.value,g=v.length,_=i.createTypedArray(f,c*g),y=0;c>y;++y)_.set(v,y*g);u.attributes[m]=new s({componentDatatype:f,componentsPerAttribute:g,normalize:p.normalize,values:_})}}function p(e){var t,r=e.instances,n=e.pickIds,o=e.projection,a=e.elementIndexUintSupported,s=e.allow3DOnly,u=e.allowPicking,p=e.vertexCacheOptimize,f=e.modelMatrix,v=r.length;if(r[0].geometry.primitiveType,c(r,f,s),!s)for(t=0;v>t;++t)l.wrapLongitude(r[t].geometry);u&&h(r,n);var g=d(r);if(m(r,g),p)for(t=0;v>t;++t)l.reorderForPostVertexCache(r[t].geometry),l.reorderForPreVertexCache(r[t].geometry);var _,y=l.combine(r),C=y.attributes;if(s)for(_ in C)C.hasOwnProperty(_)&&C[_].componentDatatype.value===i.DOUBLE.value&&l.encodeAttribute(y,_,_+"3DHigh",_+"3DLow");else for(_ in C)if(C.hasOwnProperty(_)&&C[_].componentDatatype.value===i.DOUBLE.value){var S=_+"3D",w=_+"2D";l.projectTo2D(y,_,S,w,o),l.encodeAttribute(y,S,S+"High",S+"Low"),l.encodeAttribute(y,w,w+"High",w+"Low")}return a?[y]:l.fitToUnsignedShortIndices(y)}function f(e,t,r){for(var n=[],o=e.attributes,a=r.length,s=0;a>s;++s){var l=r[s],u=o[l],c=u.componentDatatype;c.value===i.DOUBLE.value&&(c=i.FLOAT);var h=i.createTypedArray(c,u.values);n.push({index:t[l],componentDatatype:c,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:h}),delete o[l]}return n}function v(r,i,n){for(var o=[],s=d(r),l=r.length,u={},c={},h=0;l>h;++h)for(var m=r[h],p=a.computeNumberOfVertices(m.geometry),f=s.length,v=0;f>v;++v)for(var g=s[v],_=n[g],y=p;y>0;){for(var C,S=t(c[g],0),w=i[S],E=w.length,x=0;E>x&&(C=w[x],C.index!==_);++x);e(o[h])||(o[h]={}),e(o[h][g])||(o[h][g]={dirty:!1,value:m.attributes[g].value,indices:[]});var b,T=C.values.length/C.componentsPerAttribute,A=t(u[g],0);T>A+y?(b=y,o[h][g].indices.push({attribute:C,offset:A,count:b}),u[g]=A+y):(b=T-A,o[h][g].indices.push({attribute:C,offset:A,count:b}),u[g]=0,c[g]=S+1),y-=b}return o}function g(t){return e(t.constructor.name)?{type:t.constructor.name,buffer:t.buffer}:t}function _(t){return e(t.type)?new C[t.type](t.buffer):t}if(!o.supportsTypedArrays())return{};var y={};y.combineGeometry=function(e){for(var t={instances:e.instances,pickIds:e.pickIds,ellipsoid:e.ellipsoid,projection:e.projection,elementIndexUintSupported:e.elementIndexUintSupported,allow3DOnly:e.allow3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:u.clone(e.modelMatrix)},r=p(t),i=l.createAttributeLocations(r[0]),n=t.instances,o=d(n),a=[],s=r.length,c=0;s>c;++c){var h=r[c];a.push(f(h,i,o))}var m=v(n,a,i);return{geometries:r,modelMatrix:t.modelMatrix,attributeLocations:i,vaAttributes:a,vaAttributeLocations:m}};var C={Int8Array:Int8Array,Uint8Array:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};return y.transferGeometry=function(t,r){var i,n=t.attributes;for(var a in n)n.hasOwnProperty(a)&&e(n[a])&&e(n[a].values)&&(i=n[a].values,o.supportsTransferringArrayBuffers()&&r.indexOf(n[a].values.buffer)<0&&r.push(i.buffer),e(i.type)||(n[a].values=g(i)));e(t.indices)&&(i=t.indices,o.supportsTransferringArrayBuffers()&&r.push(i.buffer),e(i.type)||(t.indices=g(t.indices)))},y.transferGeometries=function(e,t){for(var r=e.length,i=0;r>i;++i)y.transferGeometry(e[i],t)},y.transferPerInstanceAttributes=function(e,t){for(var r=e.length,i=0;r>i;++i)for(var n=e[i],a=n.length,s=0;a>s;++s){var l=n[s].values;o.supportsTransferringArrayBuffers()&&t.push(l.buffer),n[s].values=g(l)}},y.transferInstances=function(e,t){for(var r=e.length,i=0;r>i;++i){var n=e[i];y.transferGeometry(n.geometry,t)}},y.receiveGeometry=function(t){var r=t.attributes;for(var i in r)r.hasOwnProperty(i)&&e(r[i])&&e(r[i].values)&&(r[i].values=_(r[i].values));e(t.indices)&&(t.indices=_(t.indices))},y.receiveGeometries=function(e){for(var t=e.length,r=0;t>r;++r)y.receiveGeometry(e[r])},y.receivePerInstanceAttributes=function(e){for(var t=e.length,r=0;t>r;++r)for(var i=e[r],n=i.length,o=0;n>o;++o)i[o].values=_(i[o].values)},y.receiveInstances=function(e){for(var t=e.length,r=0;t>r;++r){var i=e[r];y.receiveGeometry(i.geometry)}},y}),r("Scene/PrimitiveState",["../Core/Enumeration"],function(e){"use strict";var t={READY:new e(0,"READY"),CREATING:new e(1,"CREATING"),CREATED:new e(2,"CREATED"),COMBINING:new e(3,"COMBINING"),COMBINED:new e(4,"COMBINED"),COMPLETE:new e(5,"COMPLETE"),FAILED:new e(6,"FAILED")};return t}),r("Scene/Primitive",["../Core/BoundingSphere","../Core/clone","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/Matrix4","../Core/TaskProcessor","../Core/GeographicProjection","../Renderer/BufferUsage","../Renderer/createShaderSource","../Renderer/CullFace","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/VertexLayout","./PrimitivePipeline","./PrimitiveState","./SceneMode","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x,b,T){"use strict";function A(e){return new c({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function P(t){var r=t.attributes,i=new h;for(var o in r)r.hasOwnProperty(o)&&n(r[o])&&(i[o]=A(r[o]));var a;if(n(t.indices)){var s=t.indices;a=new s.constructor(s)}return new u({attributes:i,indices:a,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function D(e){return new m({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function M(e,t){var r=e.attributes,i={};for(var n in r)r.hasOwnProperty(n)&&(i[n]=D(r[n]));return new d({geometry:t,modelMatrix:p.clone(e.modelMatrix),attributes:i})}function I(e,t){for(var r,i="",n="",o="";null!==(r=V.exec(t));){var a=r[1],s="vec4 czm_compute"+a[0].toUpperCase()+a.substr(1)+"()";"vec4 czm_computePosition()"!==s&&(i+=s+";\n"),e.allow3DOnly?o+=s+"\n"+"{\n"+" return czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow);\n"+"}\n\n":(n+="attribute vec3 "+a+"2DHigh;\n"+"attribute vec3 "+a+"2DLow;\n",o+=s+"\n"+"{\n"+" vec4 p;\n"+" if (czm_morphTime == 1.0)\n"+" {\n"+" p = czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow);\n"+" }\n"+" else if (czm_morphTime == 0.0)\n"+" {\n"+" p = czm_translateRelativeToEye("+a+"2DHigh.zxy, "+a+"2DLow.zxy);\n"+" }\n"+" else\n"+" {\n"+" p = czm_columbusViewMorph(\n"+" czm_translateRelativeToEye("+a+"2DHigh.zxy, "+a+"2DLow.zxy),\n"+" czm_translateRelativeToEye("+a+"3DHigh, "+a+"3DLow),\n"+" czm_morphTime);\n"+" }\n"+" return p;\n"+"}\n\n")}return _({sources:[i,n,t,o]})}function O(e){var t=e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),r="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+r}function R(e,t){if(!n(e._attributeLocations.show))return t;var r=t.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_non_show_main()"),i="attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}";return r+"\n"+i}function L(e){e.getVertexAttributes()}function N(e,t,r){for(var o=[],a=r.length,s=0;a>s;++s){var l={primitive:i(r[s].pickPrimitive,t)};n(r[s].id)&&(l.id=r[s].id);var u=e.createPickId(l);t._pickIds.push(u),o.push(u.color)}return o}function B(e,t){return function(){return t[e].value}}function z(e,t,r){return function(i){var n=t[e];n.value=i,n.dirty||(r.push(n),n.dirty=!0)}}var F=function(e){e=i(e,i.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=p.clone(p.IDENTITY),this._modelMatrix=new p,this.show=i(e.show,!0),this.vertexCacheOptimize=i(e.vertexCacheOptimize,!1),this.releaseGeometryInstances=i(e.releaseGeometryInstances,!0),this.allow3DOnly=i(e.allow3DOnly,!1),this.allowPicking=i(e.allowPicking,!0),this.asynchronous=i(e.asynchronous,!0),this.debugShowBoundingVolume=i(e.debugShowBoundingVolume,!1),this._translucent=void 0,this._state=x.READY,this._createdGeometries=[],this._geometries=[],this._vaAttributes=void 0,this._error=void 0,this._boundingSphere=void 0,this._boundingSphereWC=void 0,this._boundingSphereCV=void 0,this._boundingSphere2D=void 0,this._perInstanceAttributeLocations=void 0,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._dirtyAttributes=[],this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[]},V=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g,k=new f("taskDispatcher",Number.POSITIVE_INFINITY);return F.prototype.update=function(i,o,a){if(!(!this.show||!n(this.geometryInstances)&&0===this._va.length||n(this.geometryInstances)&&l(this.geometryInstances)&&0===this.geometryInstances.length||!n(this.appearance)||o.mode!==b.SCENE3D&&this.allow3DOnly||!o.passes.render&&!o.passes.pick)){var s,u,c,h,d,m,f,A,D,B,z,F,V,U=o.scene2D.projection,W=this.allowPicking,G=this;if(this._state!==x.COMPLETE&&this._state!==x.COMBINED)if(this.asynchronous){if(this._state===x.FAILED)throw this._error;if(this._state===x.READY){z=l(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],m=z.length;var H=[];for(f=0;m>f;++f)c=z[f].geometry,this._instanceIds.push(z[f].id),n(c.attributes)&&n(c.primitiveType)?this._createdGeometries.push({geometry:P(c),index:f}):H.push(k.scheduleTask({task:c._workerName,geometry:c,index:f}));this._state=x.CREATING,T.all(H,function(e){G._geometries=e,G._state=x.CREATED},function(e){G._error=e,G._state=x.FAILED})}else if(this._state===x.CREATED){for(z=l(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],F=new Array(z.length),V=this._geometries.concat(this._createdGeometries),m=V.length,f=0;m>f;++f)c=V[f],D=c.index,F[D]=M(z[D],c.geometry);m=F.length;var j=[];E.transferInstances(F,j),B=k.scheduleTask({task:"combineGeometry",instances:F,pickIds:W?N(i,this,z):void 0,ellipsoid:U.ellipsoid,isGeographic:U instanceof v,elementIndexUintSupported:i.getElementIndexUint(),allow3DOnly:this.allow3DOnly,allowPicking:W,vertexCacheOptimize:this.vertexCacheOptimize,modelMatrix:this.modelMatrix},j),this._state=x.COMBINING,T(B,function(e){E.receiveGeometries(e.geometries),E.receivePerInstanceAttributes(e.vaAttributes),G._geometries=e.geometries,G._attributeLocations=e.attributeLocations,G._vaAttributes=e.vaAttributes,G._perInstanceAttributeLocations=e.vaAttributeLocations,p.clone(e.modelMatrix,G.modelMatrix),G._state=x.COMBINED},function(e){G._error=e,G._state=x.FAILED})}}else{for(z=l(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],m=z.length,V=this._createdGeometries,f=0;m>f;++f)c=z[f].geometry,this._instanceIds.push(z[f].id),n(c.attributes)&&n(c.primitiveType)?V.push({geometry:P(c),index:f}):V.push({geometry:c.constructor.createGeometry(c),index:f});for(F=new Array(z.length),m=V.length,f=0;m>f;++f)c=V[f],D=c.index,F[D]=M(z[D],c.geometry);var q=E.combineGeometry({instances:F,pickIds:W?N(i,this,z):void 0,ellipsoid:U.ellipsoid,projection:U,elementIndexUintSupported:i.getElementIndexUint(),allow3DOnly:this.allow3DOnly,allowPicking:W,vertexCacheOptimize:this.vertexCacheOptimize,modelMatrix:this.modelMatrix});this._geometries=q.geometries,this._attributeLocations=q.attributeLocations,this._vaAttributes=q.vaAttributes,this._perInstanceAttributeLocations=q.vaAttributeLocations,p.clone(q.modelMatrix,this.modelMatrix),this._state=x.COMBINED}var Y=this._attributeLocations;if(this._state===x.COMBINED){V=this._geometries;var X=this._vaAttributes;this._boundingSphere=e.clone(V[0].boundingSphere);var Z=[];for(m=V.length,f=0;m>f;++f){c=V[f],h=X[f];var J=h.length;for(A=0;J>A;++A)d=h[A],d.vertexBuffer=i.createVertexBuffer(d.values,g.DYNAMIC_DRAW),delete d.values;Z.push(i.createVertexArrayFromGeometry({geometry:c,attributeLocations:Y,bufferUsage:g.STATIC_DRAW,vertexLayout:w.INTERLEAVED,vertexArrayAttributes:h}))}this._va=Z,this._primitiveType=V[0].primitiveType,this.releaseGeometryInstances&&(this.geometryInstances=void 0),this._geometries=void 0,this._createdGeometries=void 0,this._state=x.COMPLETE}if(this._state===x.COMPLETE){var Q=this.appearance,K=Q.material,$=!1,et=!1;this._appearance!==Q?(this._appearance=Q,this._material=K,$=!0,et=!0):this._material!==K&&(this._material=K,et=!0);var tt=this._appearance.isTranslucent();this._translucent!==tt&&(this._translucent=tt,$=!0),n(this._material)&&this._material.update(i);var rt=Q.closed&&tt;if($){var it=Q.getRenderState();if(rt){var nt=t(it,!1);nt.cull={enabled:!0,face:y.BACK},this._frontFaceRS=i.createRenderState(nt),nt.cull.face=y.FRONT,this._backFaceRS=i.createRenderState(nt)}else this._frontFaceRS=i.createRenderState(it),this._backFaceRS=this._frontFaceRS;
+if(W)this._pickRS=this._backFaceRS;else{var ot=t(it,!1);ot.colorMask={red:!1,green:!1,blue:!1,alpha:!1},this._pickRS=i.createRenderState(ot)}}if(et){var at=i.getShaderCache(),st=I(this,Q.vertexShaderSource);st=R(this,st);var lt=Q.getFragmentShaderSource();if(this._sp=at.replaceShaderProgram(this._sp,st,lt,Y),L(this._sp,Y),W){var ut=_({sources:[lt],pickColorQualifier:"varying"});this._pickSP=at.replaceShaderProgram(this._pickSP,O(st),ut,Y)}else this._pickSP=at.getShaderProgram(st,lt,Y);L(this._pickSP,Y)}var ct=this._colorCommands,ht=this._pickCommands;if($||et){var dt=n(K)?K._uniforms:void 0,mt=tt?S.TRANSLUCENT:S.OPAQUE;ct.length=this._va.length*(rt?2:1),ht.length=this._va.length,m=ct.length;var pt=0,ft=0;for(f=0;m>f;++f)rt&&(s=ct[f],n(s)||(s=ct[f]=new C),s.owner=this,s.primitiveType=this._primitiveType,s.vertexArray=this._va[pt],s.renderState=this._backFaceRS,s.shaderProgram=this._sp,s.uniformMap=dt,s.pass=mt,++f),s=ct[f],n(s)||(s=ct[f]=new C),s.owner=this,s.primitiveType=this._primitiveType,s.vertexArray=this._va[pt],s.renderState=this._frontFaceRS,s.shaderProgram=this._sp,s.uniformMap=dt,s.pass=mt,u=ht[ft],n(u)||(u=ht[ft]=new C),u.owner=this,u.primitiveType=this._primitiveType,u.vertexArray=this._va[pt],u.renderState=this._pickRS,u.shaderProgram=this._pickSP,u.uniformMap=dt,u.pass=mt,++ft,++pt}if(this._dirtyAttributes.length>0){for(h=this._dirtyAttributes,m=h.length,f=0;m>f;++f){d=h[f];var vt=d.value,gt=d.indices,_t=gt.length;for(A=0;_t>A;++A){D=gt[A];for(var yt=D.offset,Ct=D.count,St=D.attribute,wt=St.componentDatatype,Et=St.componentsPerAttribute,xt=r.createTypedArray(wt,Ct*Et),bt=0;Ct>bt;++bt)xt.set(vt,bt*Et);var Tt=yt*Et*wt.sizeInBytes;St.vertexBuffer.copyFromArrayView(xt,Tt)}d.dirty=!1}h.length=0}p.equals(this.modelMatrix,this._modelMatrix)||(p.clone(this.modelMatrix,this._modelMatrix),this._boundingSphereWC=e.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC),!this.allow3DOnly&&n(this._boundingSphere)&&(this._boundingSphereCV=e.projectTo2D(this._boundingSphereWC,U,this._boundingSphereCV),this._boundingSphere2D=e.clone(this._boundingSphereCV,this._boundingSphere2D),this._boundingSphere2D.center.x=0));var At;o.mode===b.SCENE3D?At=this._boundingSphereWC:o.mode===b.COLUMBUS_VIEW?At=this._boundingSphereCV:o.mode===b.SCENE2D&&n(this._boundingSphere2D)?At=this._boundingSphere2D:n(this._boundingSphereWC)&&n(this._boundingSphereCV)&&(At=e.union(this._boundingSphereWC,this._boundingSphereCV));var Pt=o.passes;if(Pt.render)for(m=ct.length,f=0;m>f;++f)ct[f].modelMatrix=this.modelMatrix,ct[f].boundingVolume=At,ct[f].debugShowBoundingVolume=this.debugShowBoundingVolume,a.push(ct[f]);if(Pt.pick)for(m=ht.length,f=0;m>f;++f)ht[f].modelMatrix=this.modelMatrix,ht[f].boundingVolume=At,a.push(ht[f])}}},F.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,n=i.length,a=0;n>a;++a){var s=(r+a)%n;if(e===i[s]){t=s;break}}if(-1===t)return void 0;var l=this._perInstanceAttributeLocations[t],u={},c={},h=!1;for(var d in l)l.hasOwnProperty(d)&&(h=!0,c[d]={get:B(d,l),set:z(d,l,this._dirtyAttributes)});return h&&o(u,c),this._lastPerInstanceAttributeIndex=t,u},F.prototype.isDestroyed=function(){return!1},F.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.release(),this._pickSP=this._pickSP&&this._pickSP.release();var r=this._va;for(e=r.length,t=0;e>t;++t)r[t].destroy();this._va=void 0;var i=this._pickIds;for(e=i.length,t=0;e>t;++t)i[t].destroy();return this._pickIds=void 0,a(this)},F}),r("DynamicScene/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=m.fromColor(e.WHITE),S=new p(!0),w=new p(!0),E=new p(!1),x=new p(e.BLACK),b=function(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0},T=function(e){this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(T.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new b(e),this._onDynamicObjectPropertyChanged(e,"ellipse",e.ellipse,void 0)};n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:g}}),n(T.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._dynamicObject;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,o,a=this._dynamicObject,l=a.isAvailable(r),u=new d(l&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof m){var h=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){var i=this._dynamicObject,n=i.isAvailable(r);return new c({id:i,geometry:new l(this._options),attributes:{show:new d(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._dynamicObjectSubscription(),o(this)},T.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"position"===t||"ellipse"===t){var n=this._dynamicObject.ellipse;if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(h.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(h.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._dynamicObject.position,c=n.semiMajorAxis,d=n.semiMinorAxis,p=n.show;if(i(p)&&p.isConstant&&!p.getValue(h.MINIMUM_VALUE)||!i(u)||!i(c)||!i(d))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var f=r(n.material,C),y=f instanceof m;this._materialProperty=f,this._fillProperty=r(o,w),this._showProperty=r(p,S),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var b=n.rotation,T=n.height,A=n.extrudedHeight,P=n.granularity,D=n.stRotation,M=n.numberOfVerticalLines;if(this._isClosed=i(A),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&c.isConstant&&d.isConstant&&v.isConstant(b)&&v.isConstant(T)&&v.isConstant(A)&&v.isConstant(P)&&v.isConstant(D)&&v.isConstant(M)){var I=this._options;I.vertexFormat=y?_.VERTEX_FORMAT:g.VERTEX_FORMAT,I.center=u.getValue(h.MINIMUM_VALUE,I.center),I.semiMajorAxis=c.getValue(h.MINIMUM_VALUE,I.semiMajorAxis),I.semiMinorAxis=d.getValue(h.MINIMUM_VALUE,I.semiMinorAxis),I.rotation=i(b)?b.getValue(h.MINIMUM_VALUE):void 0,I.height=i(T)?T.getValue(h.MINIMUM_VALUE):void 0,I.extrudedHeight=i(A)?A.getValue(h.MINIMUM_VALUE):void 0,I.granularity=i(P)?P.getValue(h.MINIMUM_VALUE):void 0,I.stRotation=i(D)?D.getValue(h.MINIMUM_VALUE):void 0,I.numberOfVerticalLines=i(M)?M.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new A(e,this)};var A=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._dynamicObject)};return A.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,a=o.ellipse,u=a.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var h=this._options,d=o.position,m=a.semiMajorAxis,p=a.semiMinorAxis,v=a.rotation,C=a.height,S=a.extrudedHeight,w=a.granularity,E=a.stRotation,x=a.numberOfVerticalLines;if(h.center=d.getValue(r,h.center),h.semiMajorAxis=m.getValue(r,h.semiMajorAxis),h.semiMinorAxis=p.getValue(r,h.semiMinorAxis),h.rotation=i(v)?v.getValue(r,h):void 0,h.height=i(C)?C.getValue(r,h):void 0,h.extrudedHeight=i(S)?S.getValue(r,h):void 0,h.granularity=i(w)?w.getValue(r):void 0,h.stRotation=i(E)?E.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){this._material=f.getValue(r,n.fillMaterialProperty,this._material);var b=this._material,T=new g({material:b,translucent:b.isTranslucent(),closed:i(h.extrudedHeight)});h.vertexFormat=T.vertexFormat,this._primitive=new y({geometryInstances:new c({id:o,geometry:new s(h)}),appearance:T,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){h.vertexFormat=_.VERTEX_FORMAT,h.numberOfVerticalLines=i(x)?x.getValue(r):void 0;var A=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new y({geometryInstances:new c({id:o,geometry:new l(h),attributes:{color:t.fromColor(A)}}),appearance:new _({flat:!0,translucent:1!==A.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},T}),r("DynamicScene/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix3","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/PrimitiveState","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,S,w,E,x){"use strict";var b,T,A,P,D=v.fromColor(t.WHITE),M=new g(!0),I=new g(!0),O=new g(!1),R=new g(t.BLACK),L=new e(1,1,1),N=function(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0},B=function(e,t){this._scene=t,this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(B.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new N(e),this._onDynamicObjectPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)};o(B,{perInstanceColorAppearanceType:{value:S},materialAppearanceType:{value:C}}),o(B.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._dynamicObject.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),B.prototype.isOutlineVisible=function(e){var t=this._dynamicObject;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},B.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},B.prototype.createFillGeometryInstance=function(e){var i,o,a=this._dynamicObject,s=a.isAvailable(e),u=new f(s&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof v){var c=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(e)),o=r.fromColor(c),i={show:u,color:o}}else i={show:u};return b=a.position.getValue(d.MINIMUM_VALUE,b),T=a.orientation.getValue(d.MINIMUM_VALUE,T),P=m.fromQuaternion(T,P),new h({id:a,geometry:new l(this._options),modelMatrix:p.fromRotationTranslation(P,b),attributes:i})},B.prototype.createOutlineGeometryInstance=function(e){var i=this._dynamicObject,n=i.isAvailable(e);return b=i.position.getValue(d.MINIMUM_VALUE,b),T=i.orientation.getValue(d.MINIMUM_VALUE,T),P=m.fromQuaternion(T,P),new h({id:i,geometry:new u(this._options),modelMatrix:p.fromRotationTranslation(P,b),attributes:{show:new f(n&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(n?this._outlineColorProperty.getValue(e):t.BLACK)}})},B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){this._dynamicObjectSubscription(),a(this)},B.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var r=this._dynamicObject.ellipsoid;if(!n(r))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=r.fill,a=n(o)&&o.isConstant?o.getValue(d.MINIMUM_VALUE):!0,s=r.outline,l=n(s);if(l&&s.isConstant&&(l=s.getValue(d.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._dynamicObject.position,c=this._dynamicObject.orientation,h=r.radii,m=r.show;if(n(m)&&m.isConstant&&!m.getValue(d.MINIMUM_VALUE)||!n(u)||!n(c)||!n(h))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var p=i(r.material,D),f=p instanceof v;this._materialProperty=p,this._fillProperty=i(o,I),this._showProperty=i(m,M),this._showOutlineProperty=i(r.outline,O),this._outlineColorProperty=l?i(r.outlineColor,R):void 0,this._fillEnabled=a,this._outlineEnabled=l;var g=r.stackPartitions,_=r.slicePartitions,w=r.subdivisions;if(u.isConstant&&c.isConstant&&h.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(w)){var E=this._options;E.vertexFormat=f?S.VERTEX_FORMAT:C.VERTEX_FORMAT,E.radii=h.getValue(d.MINIMUM_VALUE,E.radii),E.stackPartitions=n(g)?g.getValue(d.MINIMUM_VALUE):void 0,E.slicePartitions=n(_)?_.getValue(d.MINIMUM_VALUE):void 0,E.subdivisions=n(w)?w.getValue(d.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},B.prototype.createDynamicUpdater=function(e){return new z(e,this)};var z=function(e,t){this._dynamicObject=t._dynamicObject,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new N(t._dynamicObject),this._modelMatrix=new p,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0};return z.prototype.update=function(e){var o=this._dynamicObject,a=o.ellipsoid,s=a.show;if(!o.isAvailable(e)||n(s)&&!s.getValue(e))return n(this._primitive)&&(this._primitive.show=!1),n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1),void 0;var c,d=!n(a.fill)||a.fill.getValue(e),v=n(a.outline)&&a.outline.getValue(e),g=n(a.outlineColor)?a.outlineColor.getValue(e):t.BLACK,y=_.getValue(e,i(a.material,D),this._material);this._material=y;var M=a.stackPartitions,I=a.slicePartitions,O=a.subdivisions,R=n(M)?M.getValue(e):void 0,N=n(I)?I.getValue(e):void 0,B=n(O)?O.getValue(e):void 0,z=this._options,F=this._scene.mode,V=F===x.SCENE3D,k=this._modelMatrix,U=o.position,W=o.orientation,G=a.radii;b=U.getValue(e,b),T=W.getValue(e,T),P=m.fromQuaternion(T,P),A=G.getValue(e,A),k=p.fromRotationTranslation(P,b,k);var H=!V||this._lastSceneMode!==F||!n(this._primitive)||z.stackPartitions!==R||z.slicePartitions!==N||z.subdivisions!==B;if(H)this._removePrimitives(),this._lastSceneMode=F,z.stackPartitions=R,z.slicePartitions=N,z.subdivisions=B,z.radii=V?L:A,this._material=y,y=this._material,c=new C({material:y,translucent:y.isTranslucent(),closed:!0}),z.vertexFormat=c.vertexFormat,this._primitive=new w({geometryInstances:new h({id:o,geometry:new l(z),modelMatrix:V?void 0:k}),appearance:c,asynchronous:!1,attributes:{show:new f(d)}}),this._primitives.add(this._primitive),z.vertexFormat=S.VERTEX_FORMAT,this._outlinePrimitive=new w({geometryInstances:new h({id:o,geometry:new u(z),modelMatrix:V?void 0:k,attributes:{show:new f(v),color:r.fromColor(g)}}),appearance:new S({flat:!0,translucent:1!==g.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive);else if(this._primitive._state===E.COMPLETE){var j=this._primitive;c=j.appearance,c.material=y;var q=this._attributes;n(q)||(q=j.getGeometryInstanceAttributes(o),this._attributes=q),q.show=f.toValue(d,q.show);var Y=this._outlinePrimitive,X=this._outlineAttributes;n(X)||(X=Y.getGeometryInstanceAttributes(o),this._outlineAttributes=X),X.show=f.toValue(v,X.show),X.color=r.toValue(g,X.color)}V&&(A.x=Math.max(A.x,.001),A.y=Math.max(A.y,.001),A.z=Math.max(A.z,.001),k=p.multiplyByScale(k,A,k),this._primitive.modelMatrix=k,this._outlinePrimitive.modelMatrix=k)},z.prototype.isDestroyed=function(){return!1},z.prototype._removePrimitives=function(){n(this._primitive)&&this._primitives.remove(this._primitive),n(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive)},z.prototype.destroy=function(){this._removePrimitives(),a(this)},B}),r("DynamicScene/StaticGeometryColorBatch",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/AssociativeArray","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","../Scene/PrimitiveState"],function(e,t,r,i,n,o,a){"use strict";var s=new e,l=function(e,t,r,n){this.translucent=t,this.appearanceType=r,this.closed=n,this.primitives=e,this.createPrimitive=!1,this.primitive=void 0,this.geometry=new i,this.updaters=new i,this.updatersWithAttributes=new i,this.attributes=new i,this.itemsToRemove=[]};l.prototype.add=function(e,t){var r=e.dynamicObject.id;this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant||this.updatersWithAttributes.set(r,e)},l.prototype.remove=function(e){var t=e.dynamicObject.id;this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t),this.updatersWithAttributes.remove(t)},l.prototype.update=function(e){var i=0,l=this.primitive,u=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),r(l)&&u.remove(l);var c=this.geometry.values;c.length>0&&(l=new o({asynchronous:!1,geometryInstances:c,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),u.add(l)),this.primitive=l,this.createPrimitive=!1}else if(r(l)&&l._state===a.COMPLETE)for(var h=this.updatersWithAttributes.values,d=h.length,m=0;d>m;m++){var p=h[m],f=this.geometry.get(p.dynamicObject.id),v=this.attributes.get(f.id.id);if(r(v)||(v=l.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,v)),!p.fillMaterialProperty.isConstant){var g=p.fillMaterialProperty.color;g.getValue(e,s),v.color=t.toValue(s,v.color),(this.translucent&&255===v.color[3]||!this.translucent&&255!==v.color[3])&&(this.itemsToRemove[i++]=p)}p.hasConstantFill||(v.show=n.toValue(p.isFilled(e),v.show))}this.itemsToRemove.length=i},l.prototype.removeAllPrimitives=function(){var e=this.primitive;r(e)&&(this.primitives.remove(e),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll())};var u=function(e,t,r){this._solidBatch=new l(e,!1,t,r),this._translucentBatch=new l(e,!0,t,r)};return u.prototype.add=function(e,t){var r=t.createFillGeometryInstance(e);255===r.attributes.color.value[3]?this._solidBatch.add(t,r):this._translucentBatch.add(t,r)},u.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},u.prototype.update=function(e){var t,r;this._solidBatch.update(e),this._translucentBatch.update(e);var i=this._solidBatch.itemsToRemove,n=i.length;if(n>0)for(t=0;n>t;t++)r=i[t],this._solidBatch.remove(r),this._translucentBatch.add(r,r.createFillGeometryInstance(e));i=this._translucentBatch.itemsToRemove;var o=i.length;if(o>0)for(t=0;o>t;t++)r=i[t],this._translucentBatch.remove(r),this._solidBatch.add(r,r.createFillGeometryInstance(e));(n>0||o>0)&&(this._solidBatch.update(e),this._translucentBatch.update(e))},u.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},u}),r("DynamicScene/StaticGeometryPerMaterialBatch",["../Core/defined","../Core/AssociativeArray","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","../Scene/Material","../Scene/PrimitiveState","./MaterialProperty"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,i,o){this.primitives=e,this.appearanceType=r,this.materialProperty=i,this.closed=o,this.updaters=new t,this.createPrimitive=!0,this.primitive=void 0,this.geometry=new t,this.material=n.fromType("Color"),this.updatersWithAttributes=new t,this.attributes=new t,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(s.prototype.onMaterialChanged,this)};s.prototype.onMaterialChanged=function(){this.invalidated=!0},s.prototype.isMaterial=function(t){var r=this.materialProperty,i=t.fillMaterialProperty;return i===r?!0:e(r)?r.equals(i):!1},s.prototype.add=function(e,t){var r=t.dynamicObject.id;this.updaters.set(r,t),this.geometry.set(r,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant||this.updatersWithAttributes.set(r,t),this.createPrimitive=!0},s.prototype.remove=function(e){var t=e.dynamicObject.id;return this.createPrimitive=this.updaters.remove(t),this.geometry.remove(t),this.updatersWithAttributes.remove(t),this.createPrimitive},s.prototype.update=function(t){var n=this.primitive,s=this.primitives,l=this.geometry.values;if(this.createPrimitive)e(n)&&s.remove(n),l.length>0&&(n=new i({asynchronous:!1,geometryInstances:l,appearance:new this.appearanceType({material:a.getValue(t,this.materialProperty,this.material),translucent:this.material.isTranslucent(),closed:this.closed})}),s.add(n)),this.primitive=n,this.createPrimitive=!1;else if(e(n)&&n._state===o.COMPLETE){this.primitive.appearance.material=a.getValue(t,this.materialProperty,this.material);for(var u=this.updatersWithAttributes.values,c=u.length,h=0;c>h;h++){var d=u[h],m=this.geometry.get(d.dynamicObject.id),p=this.attributes.get(m.id.id);e(p)||(p=n.getGeometryInstanceAttributes(m.id),this.attributes.set(m.id.id,p)),d.hasConstantFill||(p.show=r.toValue(d.isFilled(t),p.show))}}},s.prototype.destroy=function(){var t=this.primitive,r=this.primitives;e(t)&&r.remove(t),this.removeMaterialSubscription()};var l=function(e,t,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=r};return l.prototype.add=function(e,t){for(var r=this._items,i=r.length,n=0;i>n;n++){var o=r[n];if(o.isMaterial(t))return o.add(e,t),void 0}var a=new s(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);a.add(e,t),r.push(a)},l.prototype.remove=function(e){for(var t=this._items,r=t.length,i=r-1;i>=0;i--){var n=t[i];if(n.remove(e)){0===n.updaters.length&&(t.splice(i,1),n.destroy());break}}},l.prototype.update=function(e){var t,r=this._items,i=r.length;for(t=i-1;t>=0;t--){var n=r[t];if(n.invalidated){r.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;a>s;t++)this.add(o[s]);n.destroy()}}for(t=0;i>t;t++)r[t].update(e)},l.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,r=0;t>r;r++)e[r].destroy();this._items.length=0},l}),r("DynamicScene/StaticOutlineGeometryBatch",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/AssociativeArray","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/PrimitiveState"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,t,r){this.translucent=t,this.appearanceType=r,this.primitives=e,this.createPrimitive=!1,this.primitive=void 0,this.geometry=new i,this.updaters=new i,this.updatersWithAttributes=new i,this.attributes=new i,this.itemsToRemove=[]};l.prototype.add=function(e,t){var r=e.dynamicObject.id;this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant||this.updatersWithAttributes.set(r,e)},l.prototype.remove=function(e){var t=e.dynamicObject.id;this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t),this.updatersWithAttributes.remove(t)};var u=new e;l.prototype.update=function(e){var i=0,l=this.primitive,c=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),r(l)&&c.remove(l);var h=this.geometry.values;h.length>0&&(l=new a({asynchronous:!1,geometryInstances:h,appearance:new o({flat:!0,translucent:this.translucent})}),c.add(l)),this.primitive=l,this.createPrimitive=!1}else if(r(l)&&l._state===s.COMPLETE)for(var d=this.updatersWithAttributes.values,m=d.length,p=0;m>p;p++){var f=d[p],v=this.geometry.get(f.dynamicObject.id),g=this.attributes.get(v.id.id);r(g)||(g=l.getGeometryInstanceAttributes(v.id),this.attributes.set(v.id.id,g));var _=f.outlineColorProperty;_.getValue(e,u),g.color=t.toValue(u,g.color),(this.translucent&&255===g.color[3]||!this.translucent&&255!==g.color[3])&&(this.itemsToRemove[i++]=f),g.show=n.toValue(f.isOutlineVisible(e),g.show)}this.itemsToRemove.length=i},l.prototype.removeAllPrimitives=function(){var e=this.primitive;r(e)&&(this.primitives.remove(e),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll())};var c=function(e,t){this._solidBatch=new l(e,!1,t),this._translucentBatch=new l(e,!0,t)};return c.prototype.add=function(e,t){var r=t.createOutlineGeometryInstance(e);255===r.attributes.color.value[3]?this._solidBatch.add(t,r):this._translucentBatch.add(t,r)},c.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},c.prototype.update=function(e){var t,r;this._solidBatch.update(e),this._translucentBatch.update(e);var i=this._solidBatch.itemsToRemove,n=i.length;if(n>0)for(t=0;n>t;t++)r=i[t],this._solidBatch.remove(r),this._translucentBatch.add(r,r.createOutlineGeometryInstance(e));i=this._translucentBatch.itemsToRemove;var o=i.length;if(o>0)for(t=0;o>t;t++)r=i[t],this._translucentBatch.remove(r),this._solidBatch.add(r,r.createOutlineGeometryInstance(e));(n>0||o>0)&&(this._solidBatch.update(e),this._translucentBatch.update(e))},c.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},c}),r("DynamicScene/GeometryVisualizer",["../Core/AssociativeArray","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticOutlineGeometryBatch"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e._outlineBatch.remove(t),e._closedColorBatch.remove(t),e._closedMaterialBatch.remove(t),e._openColorBatch.remove(t),e._openMaterialBatch.remove(t),e._dynamicBatch.remove(t)}function u(e,t,r){return r.isDynamic?(e._dynamicBatch.add(t,r),void 0):(r.outlineEnabled&&e._outlineBatch.add(t,r),r.fillEnabled&&(r.isClosed?r.fillMaterialProperty instanceof n?e._closedColorBatch.add(t,r):e._closedMaterialBatch.add(t,r):r.fillMaterialProperty instanceof n?e._openColorBatch.add(t,r):e._openMaterialBatch.add(t,r)),void 0)}var c=[],h=function(t){this._primitives=t,this._dynamicUpdaters=new e};h.prototype.add=function(e,t){this._dynamicUpdaters.set(t.dynamicObject.id,t.createDynamicUpdater(this._primitives))},h.prototype.remove=function(e){var r=e.dynamicObject.id,i=this._dynamicUpdaters.get(r);t(i)&&(this._dynamicUpdaters.remove(r),i.destroy())},h.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,r=0,i=t.length;i>r;r++)t[r].update(e)},h.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,r=e.length;r>t;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};var d=function(t,r,i){this._type=t;var n=r.primitives;this._scene=r,this._primitives=n,this._dynamicObjectCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new s(n),this._closedColorBatch=new o(n,t.perInstanceColorAppearanceType,!0),this._closedMaterialBatch=new a(n,t.materialAppearanceType,!0),this._openColorBatch=new o(n,t.perInstanceColorAppearanceType,!1),this._openMaterialBatch=new a(n,t.materialAppearanceType,!1),this._dynamicBatch=new h(n),this._subscriptions=new e,this._updaters=new e,this.setDynamicObjectCollection(i)};return d.prototype.getScene=function(){return this._scene},d.prototype.getDynamicObjectCollection=function(){return this._dynamicObjectCollection},d.prototype.setDynamicObjectCollection=function(e){var r=this._dynamicObjectCollection;r!==e&&(t(r)&&(r.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,this),this.removeAllPrimitives()),this._dynamicObjectCollection=e,t(e)&&(e.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._onCollectionChanged(e,e.getObjects(),c)))},d.prototype.update=function(e){var t,r,i,n,o=this._addedObjects,a=o.values,s=this._removedObjects,c=s.values,h=this._changedObjects,m=h.values;for(t=c.length-1;t>-1;t--)r=c[t],i=r.id,n=this._updaters.get(i),l(this,n),n.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);
+for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new this._type(r,this._scene),this._updaters.set(i,n),u(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(d._onGeometryChanged,this));for(t=m.length-1;t>-1;t--)r=m[t],i=r.id,n=this._updaters.get(i),l(this,n),u(this,e,n);o.removeAll(),s.removeAll(),h.removeAll(),this._outlineBatch.update(e),this._closedColorBatch.update(e),this._closedMaterialBatch.update(e),this._openColorBatch.update(e),this._openMaterialBatch.update(e),this._dynamicBatch.update(e)},d.prototype.removeAllPrimitives=function(){this._addedObjects.removeAll(),this._removedObjects.removeAll(),this._outlineBatch.removeAllPrimitives(),this._closedColorBatch.removeAllPrimitives(),this._closedMaterialBatch.removeAllPrimitives(),this._openColorBatch.removeAllPrimitives(),this._openMaterialBatch.removeAllPrimitives(),this._dynamicBatch.removeAllPrimitives();for(var e=this._subscriptions.values,t=e.length,r=0;t>r;r++)e[r]();this._subscriptions.removeAll()},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this.removeAllPrimitives(),r(this)},d._onGeometryChanged=function(e){var r=this._removedObjects,i=this._changedObjects,n=e.dynamicObject,o=n.id;t(r.get(o))||t(i.get(o))||i.set(o,n)},d.prototype._onCollectionChanged=function(e,t,r){var i,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(i=r.length-1;i>-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},d}),r("DynamicScene/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PolygonGeometry","../Core/PolygonOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=m.fromColor(e.WHITE),S=new p(!0),w=new p(!0),E=new p(!1),x=new p(e.BLACK),b=function(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy={positions:void 0},this.perPositionHeight=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0},T=function(e){this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(T.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._options=new b(e),this._onDynamicObjectPropertyChanged(e,"polygon",e.polygon,void 0)};n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:g}}),n(T.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._dynamicObject.availability)&&v.isConstant(this._showProperty)&&v.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._dynamicObject;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,o,a=this._dynamicObject,l=a.isAvailable(r),u=new d(l&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof m){var h=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){var i=this._dynamicObject,n=i.isAvailable(r);return new c({id:i,geometry:new l(this._options),attributes:{show:new d(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._dynamicObjectSubscription(),o(this)},T.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"vertexPositions"===t||"polygon"===t){var n=this._dynamicObject.polygon;if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(h.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(h.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._dynamicObject.vertexPositions,c=n.show;if(i(c)&&c.isConstant&&!c.getValue(h.MINIMUM_VALUE)||!i(u))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,C),p=d instanceof m;this._materialProperty=d,this._fillProperty=r(o,w),this._showProperty=r(c,S),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var f=n.height,y=n.extrudedHeight,b=n.granularity,T=n.stRotation,A=n.perPositionHeight;if(this._isClosed=i(y),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&v.isConstant(f)&&v.isConstant(y)&&v.isConstant(b)&&v.isConstant(T)&&v.isConstant(A)){var P=this._options;P.vertexFormat=p?_.VERTEX_FORMAT:g.VERTEX_FORMAT,P.polygonHierarchy.positions=u.getValue(h.MINIMUM_VALUE,P.polygonHierarchy.positions),P.height=i(f)?f.getValue(h.MINIMUM_VALUE):void 0,P.extrudedHeight=i(y)?y.getValue(h.MINIMUM_VALUE):void 0,P.granularity=i(b)?b.getValue(h.MINIMUM_VALUE):void 0,P.stRotation=i(T)?T.getValue(h.MINIMUM_VALUE):void 0,P.perPositionHeight=i(A)?A.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new A(e,this)};var A=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._dynamicObject)};return A.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._dynamicObject,a=o.polygon,u=a.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var h=this._options,d=o.vertexPositions,m=a.perPositionHeight,p=a.height,v=a.extrudedHeight,C=a.granularity,S=a.stRotation;if(h.polygonHierarchy.positions=d.getValue(r,h.polygonHierarchy.positions),h.height=i(p)?p.getValue(r,h):void 0,h.extrudedHeight=i(v)?v.getValue(r,h):void 0,h.granularity=i(C)?C.getValue(r):void 0,h.stRotation=i(S)?S.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){h.perPositionHeight=i(m)?m.getValue(r):void 0,this._material=f.getValue(r,n.fillMaterialProperty,this._material);var w=this._material,E=new g({material:w,translucent:w.isTranslucent(),closed:i(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=new y({geometryInstances:new c({id:o,geometry:new s(h)}),appearance:E,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){h.vertexFormat=_.VERTEX_FORMAT;var x=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK;this._outlinePrimitive=new y({geometryInstances:new c({id:o,geometry:new l(h),attributes:{color:t.fromColor(x)}}),appearance:new _({flat:!0,translucent:1!==x.alpha}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},T}),r("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),r("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/VertexFormat","./Material","./Appearance","../Renderer/createShaderSource","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineFS","../Shaders/PolylineCommon"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r){r=e(r,e.EMPTY_OBJECT);var c=e(r.translucent,!0),h=!1,d=o({sources:[l,a]}),m=s,p=u.VERTEX_FORMAT;this.material=t(r.material)?r.material:i.fromType(i.ColorType),this.vertexShaderSource=e(r.vertexShaderSource,d),this.fragmentShaderSource=e(r.fragmentShaderSource,m),this.renderState=e(r.renderState,n.getDefaultRenderState(c,h)),this.vertexFormat=p,this.translucent=c,this.closed=h};return u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,u.prototype.isTranslucent=n.prototype.isTranslucent,u.prototype.getRenderState=n.prototype.getRenderState,u}),r("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),r("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/VertexFormat","./Appearance","../Renderer/createShaderSource","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/PolylineCommon"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){t=e(t,e.EMPTY_OBJECT);var l=e(t.translucent,!0),u=!1,c=i({sources:[a,n]}),h=o,d=s.VERTEX_FORMAT;this.material=void 0,this.vertexShaderSource=e(t.vertexShaderSource,c),this.fragmentShaderSource=e(t.fragmentShaderSource,h),this.renderState=e(t.renderState,r.getDefaultRenderState(l,u)),this.vertexFormat=d,this.translucent=l,this.closed=u};return s.VERTEX_FORMAT=t.POSITION_ONLY,s.prototype.getFragmentShaderSource=r.prototype.getFragmentShaderSource,s.prototype.isTranslucent=r.prototype.isTranslucent,s.prototype.getRenderState=r.prototype.getRenderState,s}),r("DynamicScene/PolylineGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PolylineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../DynamicScene/ColorMaterialProperty","../DynamicScene/ConstantProperty","../DynamicScene/MaterialProperty","../DynamicScene/Property","../Scene/PolylineMaterialAppearance","../Scene/PolylineColorAppearance","../Scene/Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";var y=d.fromColor(e.WHITE),C=new m(!0),S=function(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0},w=function(e){this._dynamicObject=e,this._dynamicObjectSubscription=e.definitionChanged.addEventListener(w.prototype._onDynamicObjectPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new l,this._showProperty=void 0,this._materialProperty=void 0,this._options=new S(e),this._onDynamicObjectPropertyChanged(e,"polyline",e.polyline,void 0)};n(w,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),n(w.prototype,{dynamicObject:{get:function(){return this._dynamicObject}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._dynamicObject.availability)&&f.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),w.prototype.isOutlineVisible=function(){return!1},w.prototype.isFilled=function(e){var t=this._dynamicObject;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},w.prototype.createFillGeometryInstance=function(r){var n,o,a=this._dynamicObject,l=a.isAvailable(r),c=new h(l&&this._showProperty.getValue(r));if(this._materialProperty instanceof d){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(m=this._materialProperty.color.getValue(r)),n=t.fromColor(m),o={show:c,color:n}}else o={show:c};return new u({id:a,geometry:new s(this._options),attributes:o})},w.prototype.createOutlineGeometryInstance=function(){},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){this._dynamicObjectSubscription(),o(this)},w.prototype._onDynamicObjectPropertyChanged=function(e,t){if("availability"===t||"vertexPositions"===t||"polyline"===t){var n=this._dynamicObject.polyline;if(!i(n))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=this._dynamicObject.vertexPositions,a=n.show;if(i(a)&&a.isConstant&&!a.getValue(c.MINIMUM_VALUE)||!i(o))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var s=r(n.material,y),l=s instanceof d;this._materialProperty=s,this._showProperty=r(a,C),this._fillEnabled=!0;var u=n.width;if(o.isConstant&&f.isConstant(u)){var h=this._options,m=o.getValue(c.MINIMUM_VALUE,h.positions);if(!i(m)||m.length<2)return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;h.vertexFormat=l?g.VERTEX_FORMAT:v.VERTEX_FORMAT,h.positions=m,h.width=i(u)?u.getValue(c.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},w.prototype.createDynamicUpdater=function(e){return new E(e,this)};var E=function(e,t){this._primitives=e,this._primitive=void 0,this._geometryUpdater=t,this._options=new S(t._dynamicObject)};return E.prototype.update=function(e){var t=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive);var r=t._dynamicObject,n=r.polyline,o=n.show;if(r.isAvailable(e)&&(!i(o)||o.getValue(e))){var a=this._options,l=r.vertexPositions,c=l.getValue(e,a.positions);if(i(c)&&!(c.length<2)){a.positions=c;var h=n.width;a.width=i(h)?h.getValue(e):void 0,this._material=p.getValue(e,t.fillMaterialProperty,this._material);var d=this._material,m=new v({material:d,translucent:d.isTranslucent(),closed:!1});a.vertexFormat=m.vertexFormat,this._primitive=new _({geometryInstances:new u({id:r,geometry:new s(a)}),appearance:m,asynchronous:!1}),this._primitives.add(this._primitive)}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),o(this)},w}),r("DynamicScene/DataSourceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","./DynamicBillboardVisualizer","./DynamicConeVisualizerUsingCustomSensor","./DynamicLabelVisualizer","./DynamicModelVisualizer","./DynamicPathVisualizer","./DynamicPointVisualizer","./DynamicPyramidVisualizer","./DynamicVectorVisualizer","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";var _=function(e,t){var r=t.getDynamicObjectCollection();return[new o(e,r),new f(m,e,r),new f(p,e,r),new f(v,e,r),new f(g,e,r),new a(e,r),new s(e,r),new l(e,r),new c(e,r),new d(e,r),new h(e,r),new u(e,r)]},y=function(t,r,i){this._eventHelper=new n,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=t,this._timeVaryingSources=[],this._staticSourcesToUpdate=[],this._visualizersCallback=e(i,_);for(var o=0,a=r.length;a>o;o++)this._onDataSourceAdded(r,r.get(o))};return y.prototype.getScene=function(){return this._scene},y.prototype.getDataSources=function(){return this._dataSourceCollection},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;i>t;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return r(this)},y.prototype.update=function(e){var t,r,i,n,o=this._timeVaryingSources,a=o.length;for(t=0;a>t;t++)for(i=o[t]._visualizers,n=i.length,r=0;n>r;r++)i[r].update(e);var s=this._staticSourcesToUpdate;for(a=s.length,t=0;a>t;t++)for(i=s[t]._visualizers,n=i.length,r=0;n>r;r++)i[r].update(e);s.length=0},y.prototype._onDataSourceAdded=function(e,t){var r=this._visualizersCallback(this._scene,t);t._visualizers=r,t.getChangedEvent().addEventListener(this._onDataSourceChanged,this),this._onDataSourceChanged(t)},y.prototype._onDataSourceRemoved=function(e,t){t.getChangedEvent().removeEventListener(this._onDataSourceChanged,this);var r=this._timeVaryingSources.indexOf(t);-1!==r&&this._timeVaryingSources.splice(r,1);var i=this._staticSourcesToUpdate.indexOf(t);-1!==i&&this._staticSourcesToUpdate.splice(i,1);for(var n=t._visualizers,o=n.length,a=0;o>a;a++)n[a].destroy(),t._visualizers=void 0},y.prototype._onDataSourceChanged=function(e){var t=this._timeVaryingSources.indexOf(e),r=this._staticSourcesToUpdate.indexOf(e);e.getIsTimeVarying()?(-1===t&&this._timeVaryingSources.push(e),-1!==r&&this._staticSourcesToUpdate.splice(r,1)):(-1===r&&this._staticSourcesToUpdate.push(e),-1!==t&&this._timeVaryingSources.splice(r,1))},y}),r("DynamicScene/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.update=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),r("Scene/CameraColumbusViewMode",["../Core/Enumeration"],function(e){"use strict";var t={FREE:new e(0,"FREE"),LOCKED:new e(1,"LOCKED")};return t}),r("DynamicScene/DynamicObjectView",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Quaternion","../Core/Matrix3","../Core/Matrix4","../Core/Ellipsoid","../Core/Transforms","../Scene/CameraColumbusViewMode","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,r,i,a,s,l,u,c){var h,d=e.scene,m=d.mode!==e._mode;m?(e._mode=d.mode,e._screenSpaceCameraController.enableTranslate=!1,h=o.magnitude(a)):h=i?o.magnitude(a):r.position.z;var p=s.getValue(l,e._lastCartesian);if(t(p)){var f=u.cartesianToCartographic(p,e._lastCartographic);f.height=h,i||m?(r.controller.setPositionCartographic(f),r.up.z=0,o.normalize(r.up,r.up),r.right.z=0,o.normalize(r.right,r.right),n.clone(r.right,e._first2dUp)):r.position=c.project(f),e._lastDistance=r.frustum.right-r.frustum.left,n.clone(r.right,e._last2dUp)}}function v(e,r,n,a,s,l,c){_(e,r,n,a);var m=s.getValue(l,e._lastCartesian);if(t(m)){var p=!1,f=l.addSeconds(.01),v=s.getValue(f,E);if(t(v)&&!o.equalsEpsilon(m,v,i.EPSILON6)){var g,T=d.computeFixedToIcrfMatrix(l,C),A=d.computeFixedToIcrfMatrix(f,S);t(T)&&t(A)?g=u.transpose(T,w):(g=d.computeTemeToPseudoFixedMatrix(l,w),T=u.transpose(g,C),A=d.computeTemeToPseudoFixedMatrix(f,S),u.transpose(A,A));var P=x;o.normalize(m,P),o.normalize(v,v),u.multiplyByVector(T,P,P),u.multiplyByVector(A,v,v);var D=o.cross(P,v,b);if(!o.equalsEpsilon(D,o.ZERO,i.EPSILON6)){var M=o.cross(D,P,E);u.multiplyByVector(g,M,M),u.multiplyByVector(g,D,D),u.multiplyByVector(g,P,P),o.normalize(M,M),o.normalize(D,D),o.normalize(P,P);var I=y;I[0]=M.x,I[1]=M.y,I[2]=M.z,I[3]=0,I[4]=D.x,I[5]=D.y,I[6]=D.z,I[7]=0,I[8]=P.x,I[9]=P.y,I[10]=P.z,I[11]=0,I[12]=m.x,I[13]=m.y,I[14]=m.z,I[15]=0,r.transform=I,p=!0}}p||(r.transform=d.eastNorthUpToFixedFrame(m,c,y)),e._screenSpaceCameraController.ellipsoid=h.UNIT_SPHERE;var O=r.position;o.clone(O,e._lastOffset),e._lastDistance=o.magnitude(O)}}function g(e,r,i,n,a,s,l,u){_(e,r,i,n);var d=a.getValue(s,e._lastCartesian);if(t(d)){var p=l.cartesianToCartographic(d,e._lastCartographic),f=u.project(p);T.x=f.z,T.y=f.x,T.z=f.y;var v=r.transform;c.setColumn(v,3,T,v);var g=e._screenSpaceCameraController;g.enableTranslate=!1,g.ellipsoid=h.UNIT_SPHERE,g.columbusViewMode=m.LOCKED;var y=r.position;o.clone(y,e._lastOffset),e._lastDistance=o.magnitude(y)}}function _(e,t,r,a){var s=e.scene;if(r)t.controller.lookAt(a,o.ZERO,o.UNIT_Z);else if(s.mode!==e._mode){e._mode=s.mode;var c=e._first2dUp,h=e._last2dUp;if(!n.equals(c,h)){var d=Math.acos(c.x);c.y<0&&(d=i.TWO_PI-d);var m=Math.acos(h.x);h.y<0&&(m=i.TWO_PI-m),h.x=0,h.y=0,c.x=0,c.y=0;var p=m-d,f=l.fromAxisAngle(o.UNIT_Z,p,A);u.multiplyByVector(u.fromQuaternion(f,P),a,a)}o.multiplyByScalar(o.normalize(a,a),e._lastDistance,a),t.controller.lookAt(a,o.ZERO,o.UNIT_Z)}}var y=new c,C=new u,S=new u,w=new u,E=new o,x=new o,b=new o,T=new a(0,0,0,1),A=new l,P=new u,D=new o(1e4,-1e4,1e4),M=new o,I=function(t,r,i){this.dynamicObject=t,this.scene=r,this._lastScene=void 0,this.ellipsoid=e(i,h.WGS84),this._lastDynamicObject=void 0,this._mode=void 0,this._lastCartesian=new o,this._lastCartographic=new s,this._lastDistance=void 0,this._lastOffset=new o,this._offsetScratch=new o,this._first2dUp=new n,this._last2dUp=new n};return I.prototype.update=function(e){var r=this.scene,i=this.dynamicObject,n=this.ellipsoid;r!==this._lastScene&&(this._lastScene=r,this._screenSpaceCameraController=r.screenSpaceCameraController);var a=i.position,s=i!==this._lastDynamicObject,l=this._offsetScratch;if(s){this._lastDynamicObject=i;var u=this.dynamicObject.viewFrom;t(u)&&t(u.getValue(e,l))||o.clone(D,l);var c=this._first2dUp,h=this._last2dUp;c.x=c.y=0,h.x=h.y=0,o.clone(l,this._lastOffset),this._lastDistance=o.magnitude(l),o.equals(o.normalize(l,M),o.UNIT_Z)&&(l.y-=.01)}else t(this._lastOffset)?l=this._lastOffset:o.clone(D,l);var d=r.mode;d===p.SCENE2D?f(this,r.camera,s,l,a,e,n,r.scene2D.projection):d===p.SCENE3D?v(this,r.camera,s,l,a,e,n):d===p.COLUMBUS_VIEW&&g(this,r.camera,s,l,a,e,n,r.scene2D.projection)},I}),r("ThirdParty/topojson",[],function(){var e=function(){function e(e,t){function r(t){var r=e.arcs[t],i=r[0],n=[0,0];return r.forEach(function(e){n[0]+=e[0],n[1]+=e[1]}),[i,n]}var i={},n={},o={};t.forEach(function(e){var t=r(e);(i[t[0]]||(i[t[0]]=[])).push(e),(i[t[1]]||(i[t[1]]=[])).push(~e)}),t.forEach(function(e){var t,i,a=r(e),s=a[0],l=a[1];if(t=o[s])if(delete o[t.end],t.push(e),t.end=l,i=n[l]){delete n[i.start];var u=i===t?t:t.concat(i);n[u.start=t.start]=o[u.end=i.end]=u}else if(i=o[l]){delete n[i.start],delete o[i.end];var u=t.concat(i.map(function(e){return~e}).reverse());n[u.start=t.start]=o[u.end=i.start]=u}else n[t.start]=o[t.end]=t;else if(t=n[l])if(delete n[t.start],t.unshift(e),t.start=s,i=o[s]){delete o[i.end];var c=i===t?t:i.concat(t);n[c.start=i.start]=o[c.end=t.end]=c}else if(i=n[s]){delete n[i.start],delete o[i.end];var c=i.map(function(e){return~e}).reverse().concat(t);n[c.start=i.end]=o[c.end=t.end]=c}else n[t.start]=o[t.end]=t;else if(t=n[s])if(delete n[t.start],t.unshift(~e),t.start=l,i=o[l]){delete o[i.end];var c=i===t?t:i.concat(t);n[c.start=i.start]=o[c.end=t.end]=c}else if(i=n[l]){delete n[i.start],delete o[i.end];var c=i.map(function(e){return~e}).reverse().concat(t);n[c.start=i.end]=o[c.end=t.end]=c}else n[t.start]=o[t.end]=t;else if(t=o[l])if(delete o[t.end],t.push(~e),t.end=s,i=o[s]){delete n[i.start];var u=i===t?t:t.concat(i);n[u.start=t.start]=o[u.end=i.end]=u}else if(i=n[s]){delete n[i.start],delete o[i.end];var u=t.concat(i.map(function(e){return~e}).reverse());n[u.start=t.start]=o[u.end=i.start]=u}else n[t.start]=o[t.end]=t;else t=[e],n[t.start=s]=o[t.end=l]=t});var a=[];for(var s in o)a.push(o[s]);return a}function t(t,r,i){function o(e){0>e&&(e=~e),(h[e]||(h[e]=[])).push(c)}function a(e){e.forEach(o)}function s(e){e.forEach(a)}function l(e){"GeometryCollection"===e.type?e.geometries.forEach(l):e.type in d&&(c=e,d[e.type](e.arcs))}var u=[];if(arguments.length>1){var c,h=[],d={LineString:a,MultiLineString:s,Polygon:s,MultiPolygon:function(e){e.forEach(s)}};l(r),h.forEach(arguments.length<3?function(e,t){u.push(t)}:function(e,t){i(e[0],e[e.length-1])&&u.push(t)})}else for(var m=0,p=t.arcs.length;p>m;++m)u.push(m);return n(t,{type:"MultiLineString",arcs:e(t,u)})}function r(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return i(e,t)})}:i(e,t)}function i(e,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:n(e,t)};return null==t.id&&delete r.id,r}function n(e,t){function r(e,t){t.length&&t.pop();for(var r,i=p[0>e?~e:e],n=0,a=i.length,s=0,l=0;a>n;++n)t.push([(s+=(r=i[n])[0])*c+d,(l+=r[1])*h+m]);0>e&&o(t,a)}function i(e){return[e[0]*c+d,e[1]*h+m]}function n(e){for(var t=[],i=0,n=e.length;n>i;++i)r(e[i],t);return t.length<2&&t.push(t[0]),t}function a(e){for(var t=n(e);t.length<4;)t.push(t[0]);return t}function s(e){return e.map(a)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in f?{type:t,coordinates:f[t](e)}:null}var u=e.transform,c=u.scale[0],h=u.scale[1],d=u.translate[0],m=u.translate[1],p=e.arcs,f={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return s(e.arcs)},MultiPolygon:function(e){return e.arcs.map(s)}};return l(t)}function o(e,t){for(var r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function a(e,t){for(var r=0,i=e.length;i>r;){var n=r+i>>>1;e[n]e&&(e=~e);var r=n[e];r?r.push(t):n[e]=[t]})}function r(e,r){e.forEach(function(e){t(e,r)})}function i(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){i(e,t)}):e.type in s&&s[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),s={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var l in n)for(var u=n[l],c=u.length,h=0;c>h;++h)for(var d=h+1;c>d;++d){var m,p=u[h],f=u[d];(m=o[p])[l=a(m,f)]!==f&&m.splice(l,0,f),(m=o[f])[l=a(m,p)]!==p&&m.splice(l,0,p)}return o}return{version:"1.1.4",mesh:t,feature:r,neighbors:s}}();return e}),r("DynamicScene/GeoJsonDataSource",["../Core/createGuid","../Core/Cartographic","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/getFilenameFromUri","../Core/RuntimeError","../Core/Ellipsoid","../Core/Event","../Core/loadJson","./ConstantProperty","./DynamicObject","./DynamicPoint","./DynamicPolyline","./DynamicPolygon","./ColorMaterialProperty","./DynamicObjectCollection","../ThirdParty/when","../ThirdParty/topojson"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";function y(e,t){var r='';for(var n in e)if(e.hasOwnProperty(n)){if(n===t)continue;var o=e[n];i(o)&&(r+="object"==typeof o?"|