//>>built
define("dojox/layout/ResizeHandle","dojo/_base/kernel,dojo/_base/lang,dojo/_base/connect,dojo/_base/array,dojo/_base/event,dojo/_base/fx,dojo/_base/window,dojo/fx,dojo/dom,dojo/dom-class,dojo/dom-geometry,dojo/dom-style,dojo/_base/declare,dojo/touch,dijit/_base/manager,dijit/_Widget,dijit/_TemplatedMixin".split(","),function(q,h,g,r,s,k,i,t,u,l,e,f,m,j,n,o,v){q.experimental("dojox.layout.ResizeHandle");var w=m("dojox.layout._ResizeHelper",o,{show:function(){f.set(this.domNode,"display","")},hide:function(){f.set(this.domNode,
"display","none")},resize:function(a){e.setMarginBox(this.domNode,a)}});return m("dojox.layout.ResizeHandle",[o,v],{targetId:"",targetContainer:null,resizeAxis:"xy",activeResize:!1,activeResizeClass:"dojoxResizeHandleClone",animateSizing:!0,animateMethod:"chain",animateDuration:225,minHeight:100,minWidth:100,constrainMax:!1,maxHeight:0,maxWidth:0,fixedAspect:!1,intermediateChanges:!1,startTopic:"/dojo/resize/start",endTopic:"/dojo/resize/stop",templateString:'<div dojoAttachPoint="resizeHandle" class="dojoxResizeHandle"><div></div></div>',
postCreate:function(){this.connect(this.resizeHandle,j.press,"_beginSizing");if(this.activeResize)this.animateSizing=!1;else if(this._resizeHelper=n.byId("dojoxGlobalResizeHelper"),!this._resizeHelper)this._resizeHelper=(new w({id:"dojoxGlobalResizeHelper"})).placeAt(i.body()),l.add(this._resizeHelper.domNode,this.activeResizeClass);if(!this.minSize)this.minSize={w:this.minWidth,h:this.minHeight};if(this.constrainMax)this.maxSize={w:this.maxWidth,h:this.maxHeight};this._resizeX=this._resizeY=!1;var a=
h.partial(l.add,this.resizeHandle);switch(this.resizeAxis.toLowerCase()){case "xy":this._resizeX=this._resizeY=!0;a("dojoxResizeNW");break;case "x":this._resizeX=!0;a("dojoxResizeW");break;case "y":this._resizeY=!0,a("dojoxResizeN")}},_beginSizing:function(a){if(!this._isSizing){g.publish(this.startTopic,[this]);this.targetDomNode=(this.targetWidget=n.byId(this.targetId))?this.targetWidget.domNode:u.byId(this.targetId);if(this.targetContainer)this.targetDomNode=this.targetContainer;if(this.targetDomNode){if(!this.activeResize){var b=
e.position(this.targetDomNode,!0);this._resizeHelper.resize({l:b.x,t:b.y,w:b.w,h:b.h});this._resizeHelper.show();if(!this.isLeftToRight())this._resizeHelper.startPosition={l:b.x,t:b.y}}this._isSizing=!0;this.startPoint={x:a.clientX,y:a.clientY};var b=f.getComputedStyle(this.targetDomNode),c="border-model"===e.boxModel?{w:0,h:0}:e.getPadBorderExtents(this.targetDomNode,b),p=e.getMarginExtents(this.targetDomNode,b);this.startSize={w:f.get(this.targetDomNode,"width",b),h:f.get(this.targetDomNode,"height",
b),pbw:c.w,pbh:c.h,mw:p.w,mh:p.h};if(!this.isLeftToRight()&&"absolute"==f.get(this.targetDomNode,"position"))b=e.position(this.targetDomNode,!0),this.startPosition={l:b.x,t:b.y};this._pconnects=[g.connect(i.doc,j.move,this,"_updateSizing"),g.connect(i.doc,j.release,this,"_endSizing")];s.stop(a)}}},_updateSizing:function(a){if(this.activeResize)this._changeSizing(a);else{var b=this._getNewCoords(a,"border",this._resizeHelper.startPosition);if(!1===b)return;this._resizeHelper.resize(b)}a.preventDefault()},
_getNewCoords:function(a,b,c){try{if(!a.clientX||!a.clientY)return!1}catch(f){return!1}this._activeResizeLastEvent=a;var e=(this.isLeftToRight()?1:-1)*(this.startPoint.x-a.clientX),d=this.startPoint.y-a.clientY,a=this.startSize.w-(this._resizeX?e:0),d=this._checkConstraints(a,this.startSize.h-(this._resizeY?d:0));if((c=c||this.startPosition)&&this._resizeX)d.l=c.l+e,d.w!=a&&(d.l+=a-d.w),d.t=c.t;switch(b){case "margin":d.w+=this.startSize.mw,d.h+=this.startSize.mh;case "border":d.w+=this.startSize.pbw,
d.h+=this.startSize.pbh}return d},_checkConstraints:function(a,b){if(this.minSize){var c=this.minSize;if(a<c.w)a=c.w;if(b<c.h)b=c.h}if(this.constrainMax&&this.maxSize){c=this.maxSize;if(a>c.w)a=c.w;if(b>c.h)b=c.h}if(this.fixedAspect){var c=this.startSize.w,e=this.startSize.h,f=c*b-e*a;0>f?a=b*c/e:0<f&&(b=a*e/c)}return{w:a,h:b}},_changeSizing:function(a){var b=this.targetWidget&&h.isFunction(this.targetWidget.resize),c=this._getNewCoords(a,b&&"margin");if(!1!==c&&(b?this.targetWidget.resize(c):this.animateSizing?
t[this.animateMethod]([k.animateProperty({node:this.targetDomNode,properties:{width:{start:this.startSize.w,end:c.w}},duration:this.animateDuration}),k.animateProperty({node:this.targetDomNode,properties:{height:{start:this.startSize.h,end:c.h}},duration:this.animateDuration})]).play():f.set(this.targetDomNode,{width:c.w+"px",height:c.h+"px"}),this.intermediateChanges))this.onResize(a)},_endSizing:function(a){r.forEach(this._pconnects,g.disconnect);var b=h.partial(g.publish,this.endTopic,[this]);
this.activeResize?b():(this._resizeHelper.hide(),this._changeSizing(a),setTimeout(b,this.animateDuration+15));this._isSizing=!1;this.onResize(a)},onResize:function(){}})});