/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{watch as e,sync as i}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as s}from"../../../draw/plugins/PluginBase.js";var r;const a=Symbol("line-of-sight-observer-vertex"),p=Symbol("line-of-sight-observer-plugin-marker");let l=class extends s{constructor(){super(...arguments),this[r]=!0,this.observer=null,this.defaultCaptureMode="capture-always",this.inputMapPosition=null,this._interactiveHandle=null}static{r=p}start(t){super.start(t);const{session:o,positionOfLastUserInput:n}=t,s="grabbable-object"===this.defaultCaptureMode?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??n:this.inputMapPosition??n;!s||"grabbable-object"!==this.defaultCaptureMode&&this._interactiveHandle||o.appendOrReplacePoint(a,s),this._interactiveHandle||(this._interactiveHandle=t.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:"grabbable-object"===this.defaultCaptureMode?s??void 0:void 0}),this.addHandles(e(()=>this._interactiveHandle?.outputMapPosition,t=>{t&&!this._isComplete&&this._session?.appendOrReplacePoint(a,t)},i),this._ownHandlesKey))}};function u(t){return!!t&&p in t}function d(t={}){return{uniqueId:Symbol("line-of-sight-observer-plugin"),kind:["vertex"],geometryType:"point",hidden:!0,localizationKey:"leaf-point-segment",icon:"point",create:()=>new l(t)}}t([o({constructOnly:!0})],l.prototype,"observer",void 0),t([o()],l.prototype,"defaultCaptureMode",void 0),t([o()],l.prototype,"inputMapPosition",void 0),t([o()],l.prototype,"_interactiveHandle",void 0),l=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin")],l);export{l as LineOfSightObserverPlugin,d as createLineOfSightObserverPluginConfiguration,u as isLineOfSightObserverPlugin,p as lineOfSightObserverPluginMarker};
