/*
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 t from"../../../../../core/Accessor.js";import{watch as a,sync as s}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{MeasurementDataManager as o}from"./MeasurementData.js";let n=class extends t{constructor(e){super(e)}initialize(){this._measurementDataManager=new o(this.view,this.geodesicAreaMeasurementUtils,this.geodesicLengthMeasurementUtils),this.addHandles([this.analysisViewData.path.on("change",()=>this._update()),a(()=>this.analysisViewData.stagedPoint,()=>this._update(),s),a(()=>this.analysisViewData.mode,()=>this._update(),s)]),this._update()}_update(e=!1){const{analysisViewData:t,view:a}=this,s={maxRelativeErrorCoplanar:.005,maxRelativeErrorAlmostCoplanar:.01,verticalAngleThreshold:80};this._measurementDataManager.update(t.path,t.stagedPoint,a,s,t.mode,e)&&(t.measurementData=this._measurementDataManager.getData())}};e([r({constructOnly:!0})],n.prototype,"view",void 0),e([r({constructOnly:!0})],n.prototype,"analysis",void 0),e([r({constructOnly:!0})],n.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],n.prototype,"geodesicAreaMeasurementUtils",void 0),e([r({constructOnly:!0})],n.prototype,"geodesicLengthMeasurementUtils",void 0),n=e([i("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementController")],n);export{n as AreaMeasurementController};
