/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../core/Accessor","../../../core/Collection","../../../core/Evented","../../../core/maybe","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../../../chunks/vec3f64","./AnalysisView3D","./LineOfSight/LineOfSightConfiguration","./LineOfSight/LineOfSightController","./LineOfSight/LineOfSightTool","./LineOfSight/LineOfSightVisualization","../../analysis/analysisViewUtils"],(function(t,e,o,i,r,n,s,a,l,p,y,c,u,d,_,h,g,f){"use strict";let v=function(e){function o(t){var o;return(o=e.call(this,t)||this).type="line-of-sight-view-3d",o.analysis=null,o.tool=null,o.computations=new i,o.elevationAlignedObserver=null,o.configuration=new d.LineOfSightConfiguration,o.observerEngineLocation=c.create(),o.cursorTarget=null,o.editable=!0,o}t._inheritsLoose(o,e);var r=o.prototype;return r.initialize=function(){const t=this.view,e=this.analysis;this._analysisController=new _.LineOfSightController({analysis:e,analysisViewData:this,view:t}),this._analysisVisualization=new g.LineOfSightVisualization({analysis:e,analysisViewData:this,view:t}),this.own([this._analysisController.on("result-changed",(t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)})),f.connectAnalysisViewToTool(this,h.LineOfSightTool)])},r.destroy=function(){f.removeAnalysisViewTool(this),this._analysisController=n.destroyMaybe(this._analysisController),this._analysisVisualization=n.destroyMaybe(this._analysisVisualization)},r.getResultForTarget=function(t){const e=this.computations.find((e=>e.target===t));return n.applySome(e,(t=>t.result))},t._createClass(o,[{key:"results",get:function(){return this.computations.map((t=>t.result))}},{key:"priority",get:function(){return this._analysisController.priority},set:function(t){this._analysisController.priority=t}},{key:"updating",get:function(){return n.isSome(this._analysisController)&&this._analysisController.updating}},{key:"testInfo",get:function(){return{visualization:this._analysisVisualization,controller:this._analysisController}}}]),o}(u.AnalysisView3D(r.EventedMixin(o)));e.__decorate([s.property({readOnly:!0})],v.prototype,"type",void 0),e.__decorate([s.property({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",void 0),e.__decorate([s.property()],v.prototype,"tool",void 0),e.__decorate([s.property({readOnly:!0})],v.prototype,"results",null),e.__decorate([s.property()],v.prototype,"priority",null),e.__decorate([s.property()],v.prototype,"computations",void 0),e.__decorate([s.property()],v.prototype,"elevationAlignedObserver",void 0),e.__decorate([s.property()],v.prototype,"configuration",void 0),e.__decorate([s.property()],v.prototype,"observerEngineLocation",void 0),e.__decorate([s.property()],v.prototype,"cursorTarget",void 0),e.__decorate([s.property()],v.prototype,"updating",null),e.__decorate([s.property()],v.prototype,"editable",void 0),e.__decorate([s.property()],v.prototype,"_analysisController",void 0),e.__decorate([s.property()],v.prototype,"_analysisVisualization",void 0),v=e.__decorate([y.subclass("esri.views.3d.analysis.LineOfSightAnalysisView3D")],v);return v}));
