/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import{createTask as r}from"../../../core/asyncUtils.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import{updateDirectionalNodesGeneric as h,updateDirectionalNodesWithSameView as c}from"./imageNavigationUtils.js";import n from"./NavigationUIPanoramicViewModel.js";let d=class extends n{constructor(e){super(e),this.cameraHeadingThreshold=0,this.cameraPitchThreshold=0,this.preserveAngle="none"}initialize(){this.addHandles(i(()=>({nodes:this.nodes,currenNode:this.currentNode,length:this.nodes.length,currentHeading:this.currentNode?.currentHeading,currentPitch:this.currentNode?.currentPitch,preserveAngle:this.preserveAngle,cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold}),()=>{this._compileTask?.abort(),this._compileTask=r(async e=>{t(e),this.compile()})},s))}compile(){const{currentNode:e,nodes:r}=this;if(e)if(r.length)switch(this.preserveAngle){case"heading":return c(e,r,this.cameraHeadingThreshold,null);case"pitch":return c(e,r,null,this.cameraPitchThreshold);case"both":return c(e,r,this.cameraHeadingThreshold,this.cameraPitchThreshold);default:return h(e,r)}else e.reset()}};e([o()],d.prototype,"cameraHeadingThreshold",void 0),e([o()],d.prototype,"cameraPitchThreshold",void 0),e([o()],d.prototype,"preserveAngle",void 0),d=e([a("esri.widgets.OrientedImageryViewer.components.NavigationUIViewModel")],d);const l=d;export{l as default};
