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