/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import"../../../core/has.js";import{abortMaybe as e,destroyMaybe as i}from"../../../core/maybe.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as l}from"../../../support/getDefaultUnitForView.js";import n from"./AnalysisView3D.js";import{DirectLineMeasurementController as o}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as r}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import u from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as p,removeAnalysisViewTool as y,startPlaceOperation as h}from"../../analysis/analysisViewUtils.js";let d=class extends n{constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.analysis=null,this.tool=null,this.result=null,this.measurementMode=0,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){const{analysis:t,view:e}=this;this._analysisVisualization=new r({view:e,analysis:t,analysisView:this}),this._analysisController=new o({view:e,analysis:t,viewData:this}),this.addHandles(p(this,u))}destroy(){y(this),this.userOperation=e(this.userOperation),this._analysisController=i(this._analysisController),this._analysisVisualization=i(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages||!!this._analysisController?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){return this._analysisVisualization.labels.direct?.text??""}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??""}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??""}get unit(){return this.analysis.unit??l(this.view)}get testData(){}place(t){return h(this,{placementOptions:t})}};t([a()],d.prototype,"_analysisVisualization",void 0),t([a()],d.prototype,"_analysisController",void 0),t([a()],d.prototype,"updating",null),t([a({readOnly:!0})],d.prototype,"type",void 0),t([a({constructOnly:!0,nonNullable:!0})],d.prototype,"analysis",void 0),t([a()],d.prototype,"tool",void 0),t([a()],d.prototype,"result",void 0),t([a()],d.prototype,"measurementMode",void 0),t([a()],d.prototype,"elevationAlignedStartPoint",void 0),t([a()],d.prototype,"elevationAlignedEndPoint",void 0),t([a({readOnly:!0})],d.prototype,"viewMode",null),t([a({readOnly:!0})],d.prototype,"actualVisualizedMeasurement",null),t([a()],d.prototype,"visualElementOrientation",null),t([a()],d.prototype,"allowVisualElementsOrientationChange",null),t([a()],d.prototype,"triangleCollapseRatioThreshold",null),t([a({readOnly:!0})],d.prototype,"directLabelText",null),t([a({readOnly:!0})],d.prototype,"horizontalLabelText",null),t([a({readOnly:!0})],d.prototype,"verticalLabelText",null),t([a()],d.prototype,"unit",null),t([a()],d.prototype,"userOperation",void 0),d=t([s("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],d);const m=d;export{m as default};
