//>>built
define("dojox/calendar/Mouse","dojo/_base/array dojo/_base/declare dojo/_base/event dojo/_base/lang dojo/_base/window dojo/dom-geometry dojo/mouse dojo/on dojo/keys".split(" "),function(l,m,g,d,h,n,k,f,p){return m("dojox.calendar.Mouse",null,{triggerExtent:3,postMixInProperties:function(){this.inherited(arguments);this.on("rendererCreated",d.hitch(this,function(b){var a=b.renderer.renderer;this.own(f(a.domNode,"click",d.hitch(this,function(c){g.stop(c);this._onItemClick({triggerEvent:c,renderer:a,
item:a.item._item})})));this.own(f(a.domNode,"dblclick",d.hitch(this,function(c){g.stop(c);this._onItemDoubleClick({triggerEvent:c,renderer:a,item:a.item._item})})));this.own(f(a.domNode,"contextmenu",d.hitch(this,function(c){this._onItemContextMenu({triggerEvent:c,renderer:a,item:a.item._item})})));a.resizeStartHandle&&this.own(f(a.resizeStartHandle,"mousedown",d.hitch(this,function(c){this._onRendererHandleMouseDown(c,a,"resizeStart")})));a.moveHandle&&this.own(f(a.moveHandle,"mousedown",d.hitch(this,
function(c){this._onRendererHandleMouseDown(c,a,"move")})));a.resizeEndHandle&&this.own(f(a.resizeEndHandle,"mousedown",d.hitch(this,function(c){this._onRendererHandleMouseDown(c,a,"resizeEnd")})));this.own(f(a.domNode,"mousedown",d.hitch(this,function(c){this._rendererMouseDownHandler(c,a)})));this.own(f(b.renderer.container,k.enter,d.hitch(this,function(c){a.item&&!this._editingGesture&&(this._setHoveredItem(a.item.item,a),this._onItemRollOver(this.__fixEvt({item:a.item._item,renderer:a,triggerEvent:c})))})));
this.own(f(a.domNode,k.leave,d.hitch(this,function(c){a.item&&!this._editingGesture&&(this._setHoveredItem(null),this._onItemRollOut(this.__fixEvt({item:a.item._item,renderer:a,triggerEvent:c})))})))}))},_onItemRollOver:function(b){this._dispatchCalendarEvt(b,"onItemRollOver")},onItemRollOver:function(b){},_onItemRollOut:function(b){this._dispatchCalendarEvt(b,"onItemRollOut")},onItemRollOut:function(b){},_rendererMouseDownHandler:function(b,a){g.stop(b);this.selectFromEvent(b,a.item._item,a,!0);
this._setTabIndexAttr&&this[this._setTabIndexAttr].focus()},_onRendererHandleMouseDown:function(b,a,c){g.stop(b);this.showFocus=!1;var e=a.item.item;this.isItemBeingEdited(e)||(this._isEditing&&this._endItemEditing("mouse",!1),this.selectFromEvent(b,a.item._item,a,!0),this._setTabIndexAttr&&this[this._setTabIndexAttr].focus(),this._edProps={editKind:c,editedItem:e,rendererKind:a.rendererKind,tempEditedItem:e,liveLayout:this.liveLayout},this.set("focusedItem",this._edProps.editedItem));a=[];a.push(f(h.doc,
"mouseup",d.hitch(this,this._editingMouseUpHandler)));a.push(f(h.doc,"mousemove",d.hitch(this,this._editingMouseMoveHandler)));e=this._edProps;e.handles=a;e.eventSource="mouse";e.editKind=c;this._startPoint={x:b.screenX,y:b.screenY}},_editingMouseMoveHandler:function(b){var a=this._edProps;if(this._editingGesture)this._autoScroll(b.pageX,b.pageY,!0)||this._moveOrResizeItemGesture([this.getTime(b)],"mouse",b,this.getSubColumn(b));else if(Math.abs(this._startPoint.x-b.screenX)>=this.triggerExtent||
Math.abs(this._startPoint.y-b.screenY)>=this.triggerExtent)this._isEditing||this._startItemEditing(a.editedItem,"mouse"),a=this._edProps,this._startItemEditingGesture([this.getTime(b)],a.editKind,"mouse",b)},_editingMouseUpHandler:function(b){var a=this._edProps;this._stopAutoScroll();this._isEditing?(this._editingGesture&&this._endItemEditingGesture("mouse",b),this._endItemEditing("mouse",!1)):l.forEach(a.handles,function(c){c.remove()})},_autoScroll:function(b,a,c){if(!this.scrollable||!this.autoScroll)return!1;
var e=n.position(this.scrollContainer,!0);b=c?a-e.y:b-e.x;c=c?e.h:e.w;if(0>b||b>c)return this._startAutoScroll(Math.floor((0>b?b:b-c)/2)/3),!0;this._stopAutoScroll();return!1}})});