/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{createTask as i}from"../../../core/asyncUtils.js";import{abortMaybe as t,removeMaybe as h}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{highlightsSupported as e}from"../../../views/support/layerViewUtils.js";class r{get updating(){return!(this._highlightTask?.finished??1)}constructor(i){this._params=i,this._highlightTask=null,this._highlightHandle=null}destroy(){this.remove()}remove(){this._highlightTask=t(this._highlightTask),this._highlightHandle=h(this._highlightHandle)}update(t){if(this.remove(),null==t||!l(t))return;const h=t.layer;this._highlightTask=i(async i=>{const r=await this._params.view.whenLayerView(h);s(i);const l=e(r)?r:null;l&&(this._highlightHandle=l.highlight(t))})}}function l(i){return null!=i.geometry&&"polyline"===i.geometry.type}export{r as InputRepresentation2D};
