/*
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/maybe","../dragEventPipeline3D","../ManipulatorType","./Manipulation","./moveUtils","../../../../interactive/dragEventPipeline","../../../../interactive/GraphicManipulator"],(function(e,t,i,a,r,n,o,l,p){"use strict";let c=function(e){function n(t){var i;return(i=e.call(this)||this)._view=t.view,i._tool=t.tool,i._graphicState=t.graphicState,i._createManipulator(),i.forEachManipulator((e=>i._tool.manipulators.add(e))),i}t._inheritsLoose(n,e);var c=n.prototype;return c.destroy=function(){this.forEachManipulator((e=>{this._tool.manipulators.remove(e),e.destroy()})),this._tool=null,this._view=null,this._manipulator=null,this._graphicState=null},c.forEachManipulator=function(e){e(this._manipulator,r.ManipulatorType.TRANSLATE_XY)},c.createGraphicDragPipeline=function(e){return o.createGraphicMoveDragPipeline(this._graphicState,e,(e=>this.createDragPipeline(e)),this._view.state.viewingMode)},c.createDragPipeline=function(e){const t=this._view,r=this._graphicState.graphic,n=i.isSome(r.geometry)?r.geometry.spatialReference:null;return l.createManipulatorDragEventPipeline(this._manipulator,((i,o,p,c,u)=>{const s=o.next(a.screenToMapXYForGraphic(u,t,r,n)).next(l.addMapDelta()).next(l.addScreenDelta());e(i,s,p,c,u)}))},c._createManipulator=function(){const e=this._view,t=this._graphicState.graphic;this._manipulator=new p.GraphicManipulator({graphic:t,view:e,selectable:!0,cursor:"move"})},n}(n.Manipulation);e.MoveXYGraphicManipulation=c,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
