//>>built
define("dijit/layout/BorderContainer","dojo/_base/array,dojo/cookie,dojo/_base/declare,dojo/dom-class,dojo/dom-construct,dojo/dom-geometry,dojo/dom-style,dojo/_base/event,dojo/keys,dojo/_base/lang,dojo/on,dojo/touch,../_WidgetBase,../_Widget,../_TemplatedMixin,./_LayoutWidget,./utils".split(","),function(f,k,e,d,g,h,i,m,j,l,n,r,t,o,p,u,v){var q=e("dijit.layout._Splitter",[o,p],{live:!0,templateString:'<div class="dijitSplitter" data-dojo-attach-event="onkeypress:_onKeyPress,press:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
constructor:function(){this._handlers=[]},postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);d.add(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=k(this._cookieName);a&&(this.child.domNode.style[this.horizontal?"height":"width"]=a)}},_computeMaxSize:function(){var a=
this.horizontal?"h":"w",c=h.getMarginBox(this.child.domNode)[a],b=f.filter(this.container.getChildren(),function(a){return"center"==a.region})[0],a=h.getMarginBox(b.domNode)[a];return Math.min(this.child.maxSize,c+a)},_startDrag:function(a){if(!this.cover)this.cover=g.place("<div class=dijitSplitterCover></div>",this.child.domNode,"after");d.add(this.cover,"dijitSplitterCoverActive");this.fake&&g.destroy(this.fake);if(!(this._resize=this.live))(this.fake=this.domNode.cloneNode(!0)).removeAttribute("id"),
d.add(this.domNode,"dijitSplitterShadow"),g.place(this.fake,this.domNode,"after");d.add(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");this.fake&&d.remove(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var c=this._factor,b=this.horizontal,e=b?"pageY":"pageX",w=a[e],f=this.domNode.style,i=h.getMarginBox(this.child.domNode)[b?"h":"w"],j=this._computeMaxSize(),x=this.child.minSize||20,b=this.region,k="top"==b||"bottom"==b?"top":"left",
o=parseInt(f[k],10),p=this._resize,q=l.hitch(this.container,"_layoutChildren",this.child.id),b=this.ownerDocument;this._handlers=this._handlers.concat([n(b,r.move,this._drag=function(a,b){var d=a[e]-w,g=c*d+i,h=Math.max(Math.min(g,j),x);(p||b)&&q(h);f[k]=d+o+c*(h-g)+"px"}),n(b,"dragstart",m.stop),n(this.ownerDocumentBody,"selectstart",m.stop),n(b,r.release,l.hitch(this,"_stopDrag"))]);m.stop(a)},_onMouse:function(a){a="mouseover"==a.type||"mouseenter"==a.type;d.toggle(this.domNode,"dijitSplitterHover",
a);d.toggle(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&d.remove(this.cover,"dijitSplitterCoverActive"),this.fake&&g.destroy(this.fake),d.remove(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow"),this._drag(a),this._drag(a,!0)}finally{this._cleanupHandlers(),delete this._drag}this.container.persist&&k(this._cookieName,this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},
_cleanupHandlers:function(){for(var a;a=this._handlers.pop();)a.remove()},_onKeyPress:function(a){this._resize=!0;var c=this.horizontal,b=1;switch(a.charOrCode){case c?j.UP_ARROW:j.LEFT_ARROW:b*=-1;case c?j.DOWN_ARROW:j.RIGHT_ARROW:break;default:return}c=h.getMarginSize(this.child.domNode)[c?"h":"w"]+this._factor*b;this.container._layoutChildren(this.child.id,Math.max(Math.min(c,this._computeMaxSize()),this.child.minSize));m.stop(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;
delete this.cover;delete this.fake;this.inherited(arguments)}}),s=e("dijit.layout._Gutter",[o,p],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);d.add(this.domNode,"dijitGutter"+(this.horizontal?"H":"V"))}}),e=e("dijit.layout.BorderContainer",u,{design:"headline",gutters:!0,liveSplitters:!0,persist:!1,baseClass:"dijitBorderContainer",
_splitterClass:q,postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){this._started||(f.forEach(this.getChildren(),this._setupChild,this),this.inherited(arguments))},_setupChild:function(a){var c=a.region;if(c){this.inherited(arguments);d.add(a.domNode,this.baseClass+"Pane");var b=this.isLeftToRight();"leading"==c&&(c=b?"left":"right");"trailing"==c&&(c=b?"right":"left");if("center"!=c&&(a.splitter||this.gutters)&&!a._splitterWidget)b=
a.splitter?this._splitterClass:s,l.isString(b)&&(b=l.getObject(b)),b=new b({id:a.id+"_splitter",container:this,child:a,region:c,live:this.liveSplitters}),b.isSplitter=!0,a._splitterWidget=b,g.place(b.domNode,a.domNode,"after"),b.startup();a.region=c}},layout:function(){this._layoutChildren()},addChild:function(a,c){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var c=a.region,b=a._splitterWidget;b&&(b.destroy(),delete a._splitterWidget);this.inherited(arguments);this._started&&
this._layoutChildren();d.remove(a.domNode,this.baseClass+"Pane");i.set(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});i.set(a.domNode,"top"==c||"bottom"==c?"width":"height","auto")},getChildren:function(){return f.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return f.filter(this.getChildren(),function(c){return c.region==a})[0]._splitterWidget},resize:function(a,c){if(!this.cs||!this.pe){var b=this.domNode;this.cs=i.getComputedStyle(b);
this.pe=h.getPadExtents(b,this.cs);this.pe.r=i.toPixelValue(b,this.cs.paddingRight);this.pe.b=i.toPixelValue(b,this.cs.paddingBottom);i.set(b,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,c){if(this._borderBox&&this._borderBox.h){var b=f.map(this.getChildren(),function(a,b){return{pane:a,weight:["center"==a.region?Infinity:0,a.layoutPriority,("sidebar"==this.design?1:-1)*(/top|bottom/.test(a.region)?1:-1),b]}},this);b.sort(function(a,b){for(var c=a.weight,d=b.weight,e=0;e<
c.length;e++)if(c[e]!=d[e])return c[e]-d[e];return 0});var d=[];f.forEach(b,function(a){a=a.pane;d.push(a);a._splitterWidget&&d.push(a._splitterWidget)});v.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},d,a,c)}},destroyRecursive:function(){f.forEach(this.getChildren(),function(a){var c=a._splitterWidget;c&&c.destroy();delete a._splitterWidget});this.inherited(arguments)}});e.ChildWidgetProperties={region:"",layoutPriority:0,splitter:!1,
minSize:0,maxSize:Infinity};l.extend(t,e.ChildWidgetProperties);e._Splitter=q;e._Gutter=s;return e});