//>>built
define("dijit/Menu","require dojo/_base/array dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-geometry dojo/dom-style dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/_base/window dojo/window ./popup ./DropDownMenu dojo/ready".split(" "),function(A,v,B,p,n,q,w,x,y,r,g,t,C,u,D,E){g("dijit-legacy-requires")&&E(0,function(){A(["dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"])});return B("dijit.Menu",D,{constructor:function(){this._bindings=[]},targetNodeIds:[],
selector:"",contextMenuForWindow:!1,leftClickToOpen:!1,refocus:!0,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(this.ownerDocumentBody):v.forEach(this.targetNodeIds,this.bindDomNode,this);this.inherited(arguments)},_iframeContentWindow:function(a){return C.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&document.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&
document.frames[a.name]&&document.frames[a.name].document||null},bindDomNode:function(a){a=p.byId(a,this.ownerDocument);if("iframe"==a.tagName.toLowerCase()){var e=a;var f=this._iframeContentWindow(e);f=t.body(f.document)}else f=a==t.body(this.ownerDocument)?this.ownerDocument.documentElement:a;var b={node:a,iframe:e};n.set(a,"_dijitMenu"+this.id,this._bindings.push(b));var c=y.hitch(this,function(h){var k=this.selector,l=k?function(d){return r.selector(k,d)}:function(d){return d},m=this;return[r(h,
l(this.leftClickToOpen?"click":"contextmenu"),function(d){d.stopPropagation();d.preventDefault();(new Date).getTime()<m._lastKeyDown+500||m._scheduleOpen(this,e,{x:d.pageX,y:d.pageY},d.target)}),r(h,l("keydown"),function(d){if(93==d.keyCode||d.shiftKey&&d.keyCode==x.F10||m.leftClickToOpen&&d.keyCode==x.SPACE)d.stopPropagation(),d.preventDefault(),m._scheduleOpen(this,e,null,d.target),m._lastKeyDown=(new Date).getTime()})]});b.connects=f?c(f):[];e&&(b.onloadHandler=y.hitch(this,function(){var h=this._iframeContentWindow(e);
h=t.body(h.document);b.connects=c(h)}),e.addEventListener?e.addEventListener("load",b.onloadHandler,!1):e.attachEvent("onload",b.onloadHandler))},unBindDomNode:function(a){try{var e=p.byId(a,this.ownerDocument)}catch(h){return}a="_dijitMenu"+this.id;if(e&&n.has(e,a)){for(var f=n.get(e,a)-1,b=this._bindings[f],c;c=b.connects.pop();)c.remove();(c=b.iframe)&&(c.removeEventListener?c.removeEventListener("load",b.onloadHandler,!1):c.detachEvent("onload",b.onloadHandler));n.remove(e,a);delete this._bindings[f]}},
_scheduleOpen:function(a,e,f,b){this._openTimer||(this._openTimer=this.defer(function(){delete this._openTimer;this._openMyself({target:b,delegatedTarget:a,iframe:e,coords:f})},1))},_openMyself:function(a){function e(){d.refocus&&z&&z.focus();u.close(d)}var f=a.target,b=a.iframe,c=a.coords,h=!c;this.currentTarget=a.delegatedTarget;if(c){if(b){a=q.position(b,!0);f=this._iframeContentWindow(b);f=q.docScroll(f.document);var k=w.getComputedStyle(b),l=w.toPixelValue,m=(g("ie")&&g("quirks")?0:l(b,k.paddingLeft))+
(g("ie")&&g("quirks")?l(b,k.borderLeftWidth):0);b=(g("ie")&&g("quirks")?0:l(b,k.paddingTop))+(g("ie")&&g("quirks")?l(b,k.borderTopWidth):0);c.x+=a.x+m-f.x;c.y+=a.y+b-f.y}}else c=q.position(f,!0),c.x+=10,c.y+=10;var d=this;b=this._focusManager.get("prevNode");a=this._focusManager.get("curNode");var z=!a||p.isDescendant(a,this.domNode)?b:a;u.open({popup:this,x:c.x,y:c.y,onExecute:e,onCancel:e,orient:this.isLeftToRight()?"L":"R"});this.focus();h||this.defer(function(){this._cleanUp(!0)});this._onBlur=
function(){this.inherited("_onBlur",arguments);u.close(this)}},destroy:function(){v.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}})});