var awbMegamenuPosition=function(t){var e,a,o=t.closest("nav"),i=o.hasClass("awb-menu_column")?"column":"row",r=o.hasClass("awb-menu_expand-right")?"right":"left",s="right"===r?"left":"right",u=t.attr("data-width"),l=jQuery(window).width(),n=t.closest("li"),w=t.outerWidth(),h=l-w,d={},c={};o.hasClass("awb-menu_flyout")||o.hasClass("collapse-enabled")||(w>=l&&(u="viewport"),e=jQuery("#icon-bar").length?jQuery("#icon-bar").outerWidth():jQuery("#wrapper").outerWidth(!0)-jQuery("#wrapper").width(),o.is(":visible")?a=n.offset().left-e:(o.css("display","block"),a=n.offset().left-e,o.css("display","")),"row"===i?"site_width"===u||"viewport"===u?t.css({left:-1*a+h/2,right:"auto"}):((c={right:l-a,left:a+n.outerWidth()})[r]>w?(d[s]=0,d[r]="auto"):c[s]>w?(d[r]=0,d[s]="auto"):(d[s]=-1*(w-c[r]),d[r]="auto"),t.css(d)):(c={right:l-(a+n.outerWidth(!0)),left:a},t[0].style.setProperty("--awb-megamenu-maxwidth",c[r]-(t.outerWidth(!0)-w)+"px"),d[s]="100%",d[r]="auto",t.css(d)))};jQuery(window).on("fusion-resize-horizontal awb-position-megamenus load",function(){var t=window.avadaGetScrollBarWidth()-1+"px";jQuery("body")[0].style.setProperty("--awb-scrollbar-width",t),jQuery(".awb-menu .awb-menu__mega-wrap").each(function(){awbMegamenuPosition(jQuery(this))})});