text: /**
   * Hilo 1.4.1 for amd
   * Copyright 2016 alibaba.com
   * Licensed under the MIT License
   */
  define("hilo/util/drag",["hilo/core/Hilo"],function(t){var e={_isDragStart:!1,dragNeedTransform:!1,startDrag:function(e){function r(e){e.stopPropagation(),o(e),g.off(t.event.POINTER_START,r),E.x=g.x,E.y=g.y,g.dragNeedTransform&&g.parent&&g.parent.getConcatenatedMatrix().transformPoint(E),g.__dragX=E.x-d.x,g.__dragY=E.y-d.y,f||(f=g.getStage()),f.on(t.event.POINTER_MOVE,a),document.addEventListener(t.event.POINTER_END,n),g.fire("dragStart",d)}function n(e){document.removeEventListener(t.event.POINTER_END,n),f&&f.off(t.event.POINTER_MOVE,a),g.on(t.event.POINTER_START,r),g.fire("dragEnd",d)}function a(t){o(t),E.x=d.x+g.__dragX,E.y=d.y+g.__dragY,g.dragNeedTransform&&g.parent&&g.parent.getConcatenatedMatrix().invert().transformPoint(E),g.x=Math.max(_,Math.min(v,E.x)),g.y=Math.max(s,Math.min(T,E.y)),g.fire("dragMove",d)}function o(t){d.preX=d.x,d.preY=d.y,d.x=t.stageX,d.y=t.stageY}function i(){g._isDragStart=!1,document.removeEventListener(t.event.POINTER_END,n),f&&f.off(t.event.POINTER_MOVE,a),g.off(t.event.POINTER_START,r)}var g=this;g._isDragStart&&g.stopDrag(),g._isDragStart=!0;var f;e=e||[-(1/0),-(1/0),1/0,1/0];var d={x:0,y:0,preX:0,preY:0},_=e[0],s=e[1],v=e[2]==1/0?1/0:_+e[2],T=e[3]==1/0?1/0:s+e[3],E={x:0,y:0};g.on(t.event.POINTER_START,r),g.stopDrag=i},stopDrag:function(){this._isDragStart=!1}};return e});