(function(){function p(){n&&r&&(sj_be(_d.body,"click",w),sj_be(n,"click",k),sj_be(r,"keydown",b),i&&(sj_be(i,"click",d),sj_be(i,"keydown",g)),sj_evt.bind("PrimaryNavDropdownMenuShow",t),sj_evt.bind("scs_openflyout",t),sj_evt.bind("scope_moreItem_hide",t))}function e(){return typeof Lib.CssClass!="undefined"&&Lib.CssClass.contains(n,o)}function w(){e()&&t()}function b(n){n.shiftKey&&n.key==="Tab"&&e()&&t()}function k(n){n.stopPropagation();e()?t():nt()}function d(n){n.stopPropagation();var i=c(n.target);i!=null&&Log&&Log.Log&&Log.Log("Click",f,"ScopeDropdownMenuItemClick",!1,"ItemId",i.id);a.trigger(t,null)}function g(n){var u=AccessibilityHelpers.getFocusableElementWithin(i),f=AccessibilityHelpers.getFocusableElementWithin(i,!0);n.key==="Tab"&&n.shiftKey&&n.target===u?(n.preventDefault(),f.focus()):n.key!=="Tab"||n.shiftKey||n.target!==f?n.key==="Escape"&&(n.preventDefault(),t(),r.focus()):(n.preventDefault(),u.focus())}function c(n){return n===null?null:typeof Lib.CssClass!="undefined"&&Lib.CssClass.contains(n,s)||Lib.CssClass.contains(n,"b_sp_over_cont")?null:typeof Lib.CssClass!="undefined"&&Lib.CssClass.contains(n,y)?n:n.parentElement?c(n.parentElement):null}function nt(){sj_evt.fire("ScopeDropdownMenuShow");typeof Lib.CssClass!="undefined"&&Lib.CssClass.add(n,o);u&&typeof Lib.CssClass!="undefined"&&Lib.CssClass.add(u,h);Log&&Log.Log&&Log.Log("Show",f,"ScopeDropdownMenuShow");r.setAttribute("aria-expanded","true")}function t(){e()&&u&&(Lib.CssClass.remove(n,o),Lib.CssClass.remove(u,h));Log&&Log.Log&&Log.Log("Hide",f,"ScopeDropdownMenuHide");r.setAttribute("aria-expanded","false")}var s="b_sp_over_menu",v="."+s,y="b_sp_over_item",o="focusin",h="b_scope_dropdown_expanded",i,r,n=_ge("b-scopeListItem-menu"),u=_qs(".b_scopebar"),f,l,a;n&&(i=_qs(v,n),r=_qs("a",n));f="ScopeDropdownMenu";l=function(){function n(){}return n.debounce=function(n){var t=null;return{trigger:function(i,r){var u=function(){t=null;r?i(r):i()};clearTimeout(t);t=sb_st(u,n)},reset:function(){clearTimeout(t)}}},n}();a=l.debounce(500);p()})()