//>>built
define("dojox/gfx/Moveable","dojo/_base/lang,dojo/_base/declare,dojo/_base/array,dojo/_base/event,dojo/topic,dojo/has,dojo/dom-class,dojo/_base/window,./Mover".split(","),function(k,h,i,e,d,c,f,g,j){return h("dojox.gfx.Moveable",null,{constructor:function(a,b){this.shape=a;this.delay=b&&0<b.delay?b.delay:0;this.mover=b&&b.mover?b.mover:j;this.events=[this.shape.connect(c("touch")?"touchstart":"mousedown",this,"onMouseDown")]},destroy:function(){i.forEach(this.events,this.shape.disconnect,this.shape);
this.events=this.shape=null},onMouseDown:function(a){this.delay?(this.events.push(this.shape.connect(c("touch")?"touchmove":"mousemove",this,"onMouseMove"),this.shape.connect(c("touch")?"touchend":"mouseup",this,"onMouseUp")),this._lastX=c("touch")?(a.changedTouches?a.changedTouches[0]:a).clientX:a.clientX,this._lastY=c("touch")?(a.changedTouches?a.changedTouches[0]:a).clientY:a.clientY):new this.mover(this.shape,a,this);e.stop(a)},onMouseMove:function(a){var b=c("touch")?(a.changedTouches?a.changedTouches[0]:
a).clientX:a.clientX,d=c("touch")?(a.changedTouches?a.changedTouches[0]:a).clientY:a.clientY;if(Math.abs(b-this._lastX)>this.delay||Math.abs(d-this._lastY)>this.delay)this.onMouseUp(a),new this.mover(this.shape,a,this);e.stop(a)},onMouseUp:function(){this.shape.disconnect(this.events.pop())},onMoveStart:function(a){d.publish("/gfx/move/start",a);f.add(g.body(),"dojoMove")},onMoveStop:function(a){d.publish("/gfx/move/stop",a);f.remove(g.body(),"dojoMove")},onFirstMove:function(){},onMove:function(a,
b){this.onMoving(a,b);this.shape.applyLeftTransform(b);this.onMoved(a,b)},onMoving:function(){},onMoved:function(){}})});