/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../core/handleUtils","../../../core/maybe","../../../core/promiseUtils","../../../core/reactiveUtils","../../../support/elevationInfoUtils","../../../views/3d/interactive/editingTools/settings","../../../views/3d/interactive/visualElements/OutlineVisualElement","../../../views/3d/layers/graphics/GraphicState","../../../views/3d/webgl-engine/lib/Material","../../../views/support/layerViewUtils"],(function(e,t,i,n,l,a,s,r,h,o,u,c){"use strict";let g=function(){function e(e){this._params=e,this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null}var g=e.prototype;return g.destroy=function(){this.remove()},g.remove=function(){this._highlightTask=n.abortMaybe(this._highlightTask),this._highlightHandle=n.removeMaybe(this._highlightHandle),this._visualElementHandle=n.removeMaybe(this._visualElementHandle)},g.showHighlight=function(e){var i=this;if(this.remove(),n.isNone(e)||!d(e))return;const a=e.layer;this._highlightTask=l.createTask(function(){var n=t._asyncToGenerator((function*(t){const n=yield i._params.view.whenLayerView(a);l.throwIfAborted(t),c.highlightsSupported(n)&&(i._highlightHandle=n.highlight(e))}));return function(e){return n.apply(this,arguments)}}())},g.showReshaping=function(e){if(this.remove(),n.isNone(e))return;const t=this._params.view,l=new h.OutlineVisualElement({view:t,geometry:d(e)?e.geometry:null,attached:!1,elevationInfo:s.getGraphicEffectiveElevationInfo(e),renderOccluded:u.RenderOccludedFlag.OccludeAndTransparentStencil}),c=new o.GraphicState({graphic:e}),g=[a.watch((()=>c.isDraped),(e=>{l.isDraped=e})),c.on("changed",(()=>{l.geometry=d(e)?e.geometry:null})),t.trackGraphicState(c),t.maskOccludee(e),i.destroyHandle(l)];r.settings.visualElements.lineGraphics.outline.apply(l),l.attached=!0,this._visualElementHandle=i.handlesGroup(g)},e}();function d(e){return n.isSome(e.geometry)&&"polyline"===e.geometry.type}e.InputRepresentation3D=g,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
