importdefinedfrom"../../Core/defined.js";importdestroyObjectfrom"../../Core/destroyObject.js";importDeveloperErrorfrom"../../Core/DeveloperError.js";importknockoutfrom"../../ThirdParty/knockout.js";importgetElementfrom"../getElement.js";importPerformanceWatchdogViewModelfrom"./PerformanceWatchdogViewModel.js";functionPerformanceWatchdog(e){if(!defined(e)||!defined(e.container))thrownewDeveloperError("options.container is required.");if(!defined(e.scene))thrownewDeveloperError("options.scene is required.");constt=getElement(e.container),o=newPerformanceWatchdogViewModel(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");constn=document.createElement("button");n.setAttribute("type","button"),n.className="cesium-performance-watchdog-message-dismiss",n.innerHTML="×",n.setAttribute("data-bind","click: dismissMessage"),r.appendChild(n);consti=document.createElement("div");i.className="cesium-performance-watchdog-message",i.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(i),t.appendChild(r),knockout.applyBindings(o,r),this._container=t,this._viewModel=o,this._element=r}Object.defineProperties(PerformanceWatchdog.prototype,{container:{get:function(){returnthis._container}},viewModel:{get:function(){returnthis._viewModel}}}),PerformanceWatchdog.prototype.isDestroyed=function(){return!1},PerformanceWatchdog.prototype.destroy=function(){returnthis._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};exportdefaultPerformanceWatchdog;
importdefaultValuefrom"../../Core/defaultValue.js";importdefinedfrom"../../Core/defined.js";importdestroyObjectfrom"../../Core/destroyObject.js";importDeveloperErrorfrom"../../Core/DeveloperError.js";importFrameRateMonitorfrom"../../Scene/FrameRateMonitor.js";importknockoutfrom"../../ThirdParty/knockout.js";importcreateCommandfrom"../createCommand.js";functionPerformanceWatchdogViewModel(e){if(!defined(e)||!defined(e.scene))thrownewDeveloperError("options.scene is required.");this._scene=e.scene,this.lowFrameRateMessage=defaultValue(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,knockout.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);consts=this;this._dismissMessage=createCommand((function(){s.showingLowFrameRateMessage=!1,s.lowFrameRateMessageDismissed=!0}));consto=FrameRateMonitor.fromScene(e.scene);this._unsubscribeLowFrameRate=o.lowFrameRate.addEventListener((function(){s.lowFrameRateMessageDismissed||(s.showingLowFrameRateMessage=!0)})),this._unsubscribeNominalFrameRate=o.nominalFrameRate.addEventListener((function(){s.showingLowFrameRateMessage=!1}))}Object.defineProperties(PerformanceWatchdogViewModel.prototype,{scene:{get:function(){returnthis._scene}},dismissMessage:{get:function(){returnthis._dismissMessage}}}),PerformanceWatchdogViewModel.prototype.destroy=function(){returnthis._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),destroyObject(this)};exportdefaultPerformanceWatchdogViewModel;
importdefinedfrom"../../Core/defined.js";importdestroyObjectfrom"../../Core/destroyObject.js";importDeveloperErrorfrom"../../Core/DeveloperError.js";importEventHelperfrom"../../Core/EventHelper.js";importOrthographicFrustumfrom"../../Core/OrthographicFrustum.js";importSceneModefrom"../../Scene/SceneMode.js";importknockoutfrom"../../ThirdParty/knockout.js";importcreateCommandfrom"../createCommand.js";functionProjectionPickerViewModel(e){if(!defined(e))thrownewDeveloperError("scene is required.");this._scene=e,this._orthographic=e.camera.frustuminstanceofOrthographicFrustum,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void0,this.sceneMode=e.mode,knockout.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);consto=this;knockout.defineProperty(this,"selectedTooltip",(function(){returno._orthographic?o.tooltipOrthographic:o.tooltipPerspective})),this._toggleDropDown=createCommand((function(){o.sceneMode===SceneMode.SCENE2D||o._flightInProgress||(o.dropDownVisible=!o.dropDownVisible)})),this._eventHelper=newEventHelper,this._eventHelper.add(e.morphComplete,(function(e,t,r,i){o.sceneMode=r,o._orthographic=r===SceneMode.SCENE2D||o._scene.camera.frustuminstanceofOrthographicFrustum})),this._eventHelper.add(e.preRender,(function(){o._flightInProgress=defined(e.camera._currentFlight)})),this._switchToPerspective=createCommand((function(){o.sceneMode!==SceneMode.SCENE2D&&(o._scene.camera.switchToPerspectiveFrustum(),o._orthographic=!1,o.dropDownVisible=!1)})),this._switchToOrthographic=createCommand((function(){o.sceneMode!==SceneMode.SCENE2D&&(o._scene.camera.switchToOrthographicFrustum(),o._orthographic=!0,o.dropDownVisible=!1)})),this._sceneMode=SceneMode}Object.defineProperties(ProjectionPickerViewModel.prototype,{scene:{get:function(){returnthis._scene}},toggleDropDown:{get:function(){returnthis._toggleDropDown}},switchToPerspective:{get:function(){returnthis._switchToPerspective}},switchToOrthographic:{get:function(){returnthis._switchToOrthographic}},isOrthographicProjection:{get:function(){returnthis._orthographic}}}),ProjectionPickerViewModel.prototype.isDestroyed=function(){return!1},ProjectionPickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};exportdefaultProjectionPickerViewModel;
importdefaultValuefrom"../../Core/defaultValue.js";importdefinedfrom"../../Core/defined.js";importdestroyObjectfrom"../../Core/destroyObject.js";importDeveloperErrorfrom"../../Core/DeveloperError.js";importEventHelperfrom"../../Core/EventHelper.js";importSceneModefrom"../../Scene/SceneMode.js";importknockoutfrom"../../ThirdParty/knockout.js";importcreateCommandfrom"../createCommand.js";functionSceneModePickerViewModel(e,o){if(!defined(e))thrownewDeveloperError("scene is required.");this._scene=e;constt=this,r=function(e,o,r,i){t.sceneMode=r,t.dropDownVisible=!1};this._eventHelper=newEventHelper,this._eventHelper.add(e.morphStart,r),this._duration=defaultValue(o,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",knockout.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void0,knockout.defineProperty(this,"selectedTooltip",(function(){conste=t.sceneMode;returne===SceneMode.SCENE2D?t.tooltip2D:e===SceneMode.SCENE3D?t.tooltip3D:t.tooltipColumbusView})),this._toggleDropDown=createCommand((function(){t.dropDownVisible=!t.dropDownVisible})),this._morphTo2D=createCommand((function(){e.morphTo2D(t._duration)})),this._morphTo3D=createCommand((function(){e.morphTo3D(t._duration)})),this._morphToColumbusView=createCommand((function(){e.morphToColumbusView(t._duration)})),this._sceneMode=SceneMode}Object.defineProperties(SceneModePickerViewModel.prototype,{scene:{get:function(){returnthis._scene}},duration:{get:function(){returnthis._duration},set:function(e){if(e<0)thrownewDeveloperError("duration value must be positive.");this._duration=e}},toggleDropDown:{get:function(){returnthis._toggleDropDown}},morphTo2D:{get:function(){returnthis._morphTo2D}},morphTo3D:{get:function(){returnthis._morphTo3D}},morphToColumbusView:{get:function(){returnthis._morphToColumbusView}}}),SceneModePickerViewModel.prototype.isDestroyed=function(){return!1},SceneModePickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};exportdefaultSceneModePickerViewModel;
importdefinedfrom"../../Core/defined.js";importdestroyObjectfrom"../../Core/destroyObject.js";importDeveloperErrorfrom"../../Core/DeveloperError.js";importknockoutfrom"../../ThirdParty/knockout.js";importgetElementfrom"../getElement.js";importSelectionIndicatorViewModelfrom"./SelectionIndicatorViewModel.js";functionSelectionIndicator(e,t){if(!defined(e))thrownewDeveloperError("container is required.");e=getElement(e),this._container=e;consto=document.createElement("div");o.className="cesium-selection-wrapper",o.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(o),this._element=o;consti="http://www.w3.org/2000/svg",n="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");consts=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);constc=document.createElementNS(i,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",n),s.appendChild(c),o.appendChild(r);constd=newSelectionIndicatorViewModel(t,this._element,this._container);this._viewModel=d,knockout.applyBindings(this._viewModel,this._element)}Object.defineProperties(SelectionIndicator.prototype,{container:{get:function(){returnthis._container}},viewModel:{get:function(){returnthis._viewModel}}}),SelectionIndicator.prototype.isDestroyed=function(){return!1},SelectionIndicator.prototype.destroy=function(){conste=this._container;returnknockout.cleanNode(this._element),e.removeChild(this._element),destroyObject(this)};exportdefaultSelectionIndicator;
importCartesian2from"../../Core/Cartesian2.js";importdefaultValuefrom"../../Core/defaultValue.js";importdefinedfrom"../../Core/defined.js";importDeveloperErrorfrom"../../Core/DeveloperError.js";importEasingFunctionfrom"../../Core/EasingFunction.js";importSceneTransformsfrom"../../Scene/SceneTransforms.js";importknockoutfrom"../../ThirdParty/knockout.js";constscreenSpacePos=newCartesian2,offScreen="-1000px";functionSelectionIndicatorViewModel(e,t,o){if(!defined(e))thrownewDeveloperError("scene is required.");if(!defined(t))thrownewDeveloperError("selectionIndicatorElement is required.");if(!defined(o))thrownewDeveloperError("container is required.");this._scene=e,this._screenPositionX=offScreen,this._screenPositionY=offScreen,this._tweens=e.tweens,this._container=defaultValue(o,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void0,this.showSelection=!1,knockout.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void0,knockout.defineProperty(this,"isVisible",{get:function(){returnthis.showSelection&&defined(this.position)}}),knockout.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(t,o){returnSceneTransforms.wgs84ToWindowCoordinates(e,t,o)}}SelectionIndicatorViewModel.prototype.update=function(){if(this.showSelection&&defined(this.position)){conste=this.computeScreenSpacePosition(this.position,screenSpacePos);if(defined(e)){constt=this._container,o=t.parentNode.clientWidth,i=t.parentNode.clientHeight,n=this._selectionIndicatorElement.clientWidth,r=.5*n;e.x=Math.min(Math.max(e.x,-n),o+n)-r,e.y=Math.min(Math.max(e.y,-n),i+n)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}elsethis._screenPositionX=offScreen,this._screenPositionY=offScreen}},SelectionIndicatorViewModel.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:EasingFunction.EXPONENTIAL_OUT})},SelectionIndicatorViewModel.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:EasingFunction.EXPONENTIAL_OUT})},Object.defineProperties(SelectionIndicatorViewModel.prototype,{container:{get:function(){returnthis._container}},selectionIndicatorElement:{get:function(){returnthis._selectionIndicatorElement}},scene:{get:function(){returnthis._scene}}});exportdefaultSelectionIndicatorViewModel;
importdefaultValuefrom"../Core/defaultValue.js";importdefinedfrom"../Core/defined.js";importDeveloperErrorfrom"../Core/DeveloperError.js";importknockoutfrom"../ThirdParty/knockout.js";functionToggleButtonViewModel(e,o){if(!defined(e))thrownewDeveloperError("command is required.");this._command=e,o=defaultValue(o,defaultValue.EMPTY_OBJECT),this.toggled=defaultValue(o.toggled,!1),this.tooltip=defaultValue(o.tooltip,""),knockout.track(this,["toggled","tooltip"])}Object.defineProperties(ToggleButtonViewModel.prototype,{command:{get:function(){returnthis._command}}});exportdefaultToggleButtonViewModel;