var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,e,d){c instanceof String&&(c=String(c));for(var g=c.length,f=0;f<g;f++){var a=c[f];if(e.call(d,a,f,c))return{i:f,v:a}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,e,d){if(c==Array.prototype||c==Object.prototype)return c;c[e]=d.value;return c};$jscomp.getGlobal=function(c){c=["object"==typeof globalThis&&globalThis,c,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var e=0;e<c.length;++e){var d=c[e];if(d&&d.Math==Math)return d}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(c,e){var d=$jscomp.propertyToPolyfillSymbol[e];if(null==d)return c[e];d=c[d];return void 0!==d?d:c[e]};
$jscomp.polyfill=function(c,e,d,g){e&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(c,e,d,g):$jscomp.polyfillUnisolated(c,e,d,g))};$jscomp.polyfillUnisolated=function(c,e,d,g){d=$jscomp.global;c=c.split(".");for(g=0;g<c.length-1;g++){var f=c[g];if(!(f in d))return;d=d[f]}c=c[c.length-1];g=d[c];e=e(g);e!=g&&null!=e&&$jscomp.defineProperty(d,c,{configurable:!0,writable:!0,value:e})};
$jscomp.polyfillIsolated=function(c,e,d,g){var f=c.split(".");c=1===f.length;g=f[0];g=!c&&g in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var a=0;a<f.length-1;a++){var b=f[a];if(!(b in g))return;g=g[b]}f=f[f.length-1];d=$jscomp.IS_SYMBOL_NATIVE&&"es6"===d?g[f]:null;e=e(d);null!=e&&(c?$jscomp.defineProperty($jscomp.polyfills,f,{configurable:!0,writable:!0,value:e}):e!==d&&(void 0===$jscomp.propertyToPolyfillSymbol[f]&&(d=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[f]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(f):$jscomp.POLYFILL_PREFIX+d+"$"+f),$jscomp.defineProperty(g,$jscomp.propertyToPolyfillSymbol[f],{configurable:!0,writable:!0,value:e})))};$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(e,d){return $jscomp.findInternal(this,e,d).v}},"es6","es3");
(function(){function c(a,b){if(a.isListen("onClick"))jq(a.$n())[b?"removeClass":"addClass"](a.$s("hover"))}function e(a,b){var h="onKeyDown"==b.name;if(a.isListen("onClick")){var k=a.$n(),l=jq(k).find("."+a.$s("separator"));l=zk(l).revisedOffset()[0];jq(k).hasClass("z-menu-clickable")&&b.pageX>l?(jq(k).addClass(a.$s("selected")),a.menupopup._shallClose=!1,a._togglePopup(h),b.stop()):a.fireX(new zk.Event(a,"onClick",b.data))}else jq(k).addClass(a.isTopmost()?a.$s("selected"):a.$s("hover")),a.menupopup._shallClose=
!1,a._togglePopup(h)}function d(a){return a.isVisible()&&a.$instanceof(zul.menu.Menu)&&!a.isDisabled()}function g(a){for(var b=a;b;b=b.nextSibling)if(d(b))return b;b=a.parent;return b.firstChild==a?a:g(b.firstChild)}function f(a){for(var b=a;b;b=b.previousSibling)if(d(b))return b;b=a.parent;return b.lastChild==a?a:f(b.lastChild)}zul.menu.Menu=zk.$extends(zul.LabelImageWidget,{$define:{content:function(a){if(a&&0!=a.length)if(this._contentHandler)this._contentHandler.setContent(a);else if(zk.feature.pe){var b=
this;zk.load("zkex.inp",null,function(){b._contentHandler=new zkex.inp.ContentHandler(b,a)})}else this._contentHandler=new zul.menu.ContentHandler(this,a)},disabled:function(a){this.desktop&&(a?jq(this.$n("a")).attr("disabled","disabled").attr("tabindex","-1"):jq(this.$n("a")).removeAttr("disabled").removeAttr("tabindex"))},image:function(a){a&&this._preloadImage&&zUtl.loadImage(a);this.rerender()}},open:function(){if(this.desktop&&this.isTopmost()){jq(this.$n()).addClass(this.$s("selected"));var a=
this.getMenubar();a._lastTarget&&this.$class._rmActive(a._lastTarget);a._lastTarget=this;this.menupopup._shallClose=!1;this._togglePopup()}},getAnchor_:function(){return this.$n("a")},domContent_:function(){var a='<span class="'+this.$s("text")+'">'+zUtl.encodeXML(this.getLabel())+"</span>",b=this.getImage(),h='<i class="'+this.$s("icon")+" z-icon-caret-"+(this.isTopmost()&&!this.isVertical_()?"down":"right")+'" aria-hidden="true"></i>',k='<div class="'+this.$s("separator")+'" aria-hidden="true"></div>',
l=this.domIcon_();b=b?'<img id="'+this.uuid+'-img" src="'+b+'" class="'+this.$s("image")+'" align="absmiddle" alt="" aria-hidden="true" />'+(l?" "+l:""):l?l:'<img id="'+this.uuid+'-img" '+(this.isTopmost()?'style="display:none"':"")+' src="data:image/png;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="'+this.$s("image")+'" align="absmiddle" alt="" aria-hidden="true" />';return b+a+k+h},isTopmost:function(){return this._topmost},beforeParentChanged_:function(a){this._topmost=
a&&!a.$instanceof(zul.menu.Menupopup);this.$supers("beforeParentChanged_",arguments)},onChildAdded_:function(a){this.$supers("onChildAdded_",arguments);a.$instanceof(zul.menu.Menupopup)&&(this.menupopup=a,this._contentHandler&&this._contentHandler.destroy())},onChildRemoved_:function(a){this.$supers("onChildRemoved_",arguments);a==this.menupopup&&(this.menupopup=null,this._contentHandler&&this._contentHandler.setContent(this._content))},getMenubar:function(){for(var a=this.parent;a;a=a.parent){if(a.$instanceof(zul.menu.Menubar))return a;
if(!a.$instanceof(zul.menu.Menupopup,zul.menu.Menu))break}return null},onShow:function(){if(this._contentHandler)this._contentHandler.onShow()},onFloatUp:function(a){if(this._contentHandler)this._contentHandler.onFloatUp(a)},onHide:function(){if(this._contentHandler)this._contentHandler.onHide()},focus_:function(a,b){return this.isTopmost()&&zk(this.getAnchor_()).focus(a)?(b&&(this._ignoreActive=!0),!0):this.$supers("focus_",arguments)},_getPrevVisibleMenu:function(){var a=this.previousSibling;if(!a){var b=
this.getMenubar();b&&(a=b.lastChild)}return a?f(a):this},_getNextVisibleMenu:function(){var a=this.nextSibling;if(!a){var b=this.getMenubar();b&&(a=b.firstChild)}return a?g(a):this},doKeyDown_:function(a){if(this.isTopmost()){var b=a.keyCode;if(this.isVertical_())switch(b){case 38:b=37;break;case 40:b=39;break;case 37:b=38;break;case 39:b=40}switch(b){case 38:(b=this.menupopup)&&b.isOpen()&&(jq(this.$n()).removeClass(this.$s("hover")).removeClass(this.$s("selected")),b.close());this.$class._addActive(this);
a.stop();break;case 40:this.menupopup&&!this._disabled&&(jq(this.$n()).addClass(this.$s("selected")).removeClass(this.$s("hover")),this.menupopup._shallClose=!1,this.menupopup.open(null,null,null,{focusFirst:!0,sendOnOpen:!0,disableMask:!0}));a.stop();break;case 13:case 32:this.menupopup&&e(this,a);a.stop();break;case 9:this.$class._rmActive(this)}}this.$supers("doKeyDown_",arguments)},doFocus_:function(){if(this.isTopmost()){var a=this.getMenubar(),b=this.$class;a&&a._lastTarget&&b._rmActive(a._lastTarget);
this._ignoreActive||b._addActive(this)}delete this._ignoreActive;this.$supers("doFocus_",arguments)},bind_:function(){this.$supers(zul.menu.Menu,"bind_",arguments);var a=this.getAnchor_();this.domListen_(a,"onFocus","doFocus_").domListen_(a,"onBlur","doBlur_").domListen_(a,"onMouseEnter").domListen_(a,"onMouseLeave");this.isTopmost()&&this.isListen("onClick")&&jq(this.$n()).addClass(this.$s("clickable"));this._contentHandler&&this._contentHandler.bind()},unbind_:function(){var a=this.getAnchor_();
this.domUnlisten_(a,"onFocus","doFocus_").domUnlisten_(a,"onBlur","doBlur_").domUnlisten_(a,"onMouseEnter").domUnlisten_(a,"onMouseLeave");this._contentHandler&&this._contentHandler.unbind();this.$supers(zul.menu.Menu,"unbind_",arguments)},_getArrowWidth:function(){return 20},_showContentHandler:function(){var a=this._contentHandler;if(a&&!a.isOpen())a.onShow()},_hideContentHandler:function(){var a=this._contentHandler;a&&a.isOpen()&&(a.onHide(),this.isTopmost()?this.focus():this.parent.focus())},
doClick_:function(a){this._disabled||(this.menupopup?(this.isTopmost()&&(this.getMenubar()._lastTarget=this),e(this,a)):this._showContentHandler());a.stop()},doMouseOver_:function(){this.isTopmost()||this._showContentHandler();this.$supers("doMouseOver_",arguments)},_togglePopup:function(a){!this.menupopup&&this._contentHandler?this._showContentHandler():this.menupopup.isOpen()?this.isTopmost()?this.menupopup.close({sendOnOpen:!0}):zk(this.menupopup.$n("a")).focus():(this.isTopmost()&&c(this),this.menupopup.open(null,
null,null,{focusFirst:a,sendOnOpen:!0,disableMask:!0}))},_doMouseEnter:function(a){var b=this.getMenubar();b&&(b._noFloatUp=!1);if(!this._disabled){var h=this.isTopmost();h&&c(this);h&&11>zk.ie&&!jq.isAncestor(this.getAnchor_(),a.domTarget)||(this.menupopup&&(this.menupopup._shallClose=!1),h?this.menupopup&&b._autodrop?(zWatch.fire("onFloatUp",this),this.menupopup.isOpen()||this.menupopup.open()):(a=b._lastTarget)&&a!=this&&(this.$class._rmActive(a),a.menupopup&&a.menupopup.isVisible()&&(a.menupopup.close({sendOnOpen:!0}),
this.menupopup&&this.menupopup.open())):(zWatch.fire("onFloatUp",this),this.menupopup&&!this.menupopup.isOpen()&&this.menupopup.open(),this.parent.removeActive_()),this.$class._addActive(this))}},_doMouseLeave:function(a){a=this.getMenubar();this._updateHoverImage();if(!this._disabled){var b=this.isTopmost(),h=this.menupopup;b?(this.$class._rmActive(this,!0),h&&a._autodrop&&h.isOpen()&&(h._shallClose=!0)):h&&h.isOpen()||this.$class._rmActive(this)}},getImageNode:function(){!this._eimg&&(this._image||
this._hoverImage)&&this.$n()&&(this._eimg=this.$n("a").firstChild);return this._eimg},ignoreDescendantFloatUp_:function(a){return a&&a.$instanceof(zul.menu.Menupopup)},isVertical_:function(){if(this.isTopmost()){var a=this.getMenubar();if(a)return a.isVertical()}return!1}},{_isActive:function(a){var b=a.isTopmost(),h=a.$n(),k=a.menupopup;a=b?k&&k.isOpen()?a.$s("selected"):a.$s("hover"):a.$s("hover");return jq(h).hasClass(a)},_addActive:function(a){var b=a.isTopmost(),h=a.$n(),k=a.menupopup;k=b?k&&
k.isOpen()?a.$s("selected"):a.$s("hover"):a.$s("hover");jq(h).addClass(k);b&&(h=a.getMenubar())&&(h._lastTarget=a);b||((b=a.parent)&&b.addActive_(a),b.parent.$instanceof(zul.menu.Menu)&&this._addActive(b.parent))},_rmActive:function(a,b){var h=a.isTopmost(),k=a.$n(),l=a.menupopup;b=h?!b&&l&&l.isOpen()?a.$s("selected"):a.$s("hover"):a.$s("hover");k=jq(k).removeClass(b);!h||k.hasClass(a.$s("selected"))||k.hasClass(a.$s("hover"))||c(a,!0)}});zul.menu.ContentHandler=zk.$extends(zk.Object,{$init:function(a,
b){this._wgt=a;this._content=b},setContent:function(a){this._content==a&&this._pp||(this._content=a,this._wgt.rerender())},redraw:function(a){var b=this._wgt;a.push('<div id="',b.uuid,'-cnt-pp" class="',b.$s("content-popup"),'" style=""><div class="',b.$s("content-body"),'">',this._content,"</div></div>")},bind:function(){var a=this._wgt;a.menupopup||(a.domListen_(a.$n(),"onClick","onShow"),zWatch.listen({onFloatUp:a,onHide:a}));this._pp=a.$n("cnt-pp");jq(this._pp,zk).on("mouseenter",this.proxy(this._doMouseEnter)).on("mouseleave",
this.proxy(this._doMouseLeave))},unbind:function(){var a=this._wgt;a.menupopup||(this._shadow&&(this._shadow.destroy(),this._shadow=null),a.domUnlisten_(a.$n(),"onClick","onShow"),zWatch.unlisten({onFloatUp:a,onHide:a}));jq(this._pp,zk).off("mouseenter",this.proxy(this._doMouseEnter)).off("mouseleave",this.proxy(this._doMouseLeave));this._pp=null},isOpen:function(){var a=this._pp;return a&&zk(a).isVisible()},_doMouseEnter:function(){var a=this._wgt.getMenubar();a&&(a._bOver=!0)},_doMouseLeave:function(){var a=
this._wgt.getMenubar();a&&(a._bOver=!1)},onShow:function(){var a=this._wgt,b=this._pp;b&&(b.style.display="block",jq(b).zk.makeVParent(),zWatch.fireDown("onVParent",this),zk(b).position(a.$n(),this.getPosition()),this.syncShadow())},onHide:function(){var a=this._pp;a&&zk(a).isVisible()&&(a.style.display="none",jq(a).zk.undoVParent(),zWatch.fireDown("onVParent",this),this.hideShadow())},onFloatUp:function(a){if(!zUtl.isAncestor(this._wgt,a.origin))this.onHide()},syncShadow:function(){this._shadow||
(this._shadow=new zk.eff.Shadow(this._wgt.$n("cnt-pp"),{stackup:zk.useStackup}));this._shadow.sync()},hideShadow:function(){this._shadow&&this._shadow.hide()},destroy:function(){this._wgt.rerender()},getPosition:function(){return this._wgt.isVertical_()?"end_before":"after_start"},deferRedrawHTML_:function(a){a.push("<li",this.domAttrs_({domClass:1}),' class="z-renderdefer"></li>')}})})();
