/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/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 l{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||!r(t))return;const h=t.layer;this._highlightTask=i(async i=>{const l=await this._params.view.whenLayerView(h);s(i);const r=e(l)?l:null;r&&(this._highlightHandle=r.highlight(t))})}}function r(i){return null!=i.geometry&&"polyline"===i.geometry.type}export{l as InputRepresentation2D};
