define(["jquery"],function(){var e,i;e=jQuery,i=function(i,t){var s=e(i);e(".navigation.sol-megamenu li.classic .submenu, .navigation.sol-megamenu li.staticwidth .submenu, .navigation.sol-megamenu li.classic .subchildmenu .subchildmenu").each(function(){e(this).css("left","-9999px"),e(this).css("right","auto")}),s.find("li.classic .subchildmenu > li.parent").mouseover(function(){var i=e(this),t=i.children("ul.subchildmenu"),s=e(window).innerWidth();if(t){var n=i.offset(),a=e(t).outerWidth();s<=n.left+i.outerWidth()+a?(e(t).css("left","auto"),e(t).css("right","100%")):(e(t).css("left","100%"),e(t).css("right","auto"))}}),s.find("li.staticwidth.parent,li.classic.parent").mouseover(function(){var i=e(this),t=i.children(".submenu"),s=e(window).innerWidth();if(t){var n=i.offset(),a=e(t).outerWidth();s<=n.left+i.outerWidth()+a?(e(t).css("left","auto"),e(t).css("right","0")):(e(t).css("left","0"),e(t).css("right","auto"))}}),e(window).resize(function(){e(".navigation.sol-megamenu li.classic .submenu, .navigation.sol-megamenu li.staticwidth .submenu, .navigation.sol-megamenu li.classic .subchildmenu .subchildmenu").each(function(){e(this).css("left","-9999px"),e(this).css("right","auto")})}),e(".nav-toggle").click(function(i){e("html").hasClass("nav-open")?(e("html").removeClass("nav-open"),setTimeout(function(){e("html").removeClass("nav-before-open")},300)):(e("html").addClass("nav-before-open"),setTimeout(function(){e("html").addClass("nav-open")},300))}),e("li.ui-menu-item > .open-children-toggle").click(function(){e(this).parent().children(".submenu").hasClass("opened")?(e(this).parent().children(".submenu").removeClass("opened"),e(this).parent().children("a").removeClass("ui-state-active")):(e(this).parent().children(".submenu").addClass("opened"),e(this).parent().children("a").addClass("ui-state-active"))}),e("li.ui-menu-item > a").hover(function(){e(this).addClass("ui-state-focus")},function(){e(this).removeClass("ui-state-focus")}),e(".submenu").hover(function(){e(this).parent().children("a").addClass("ui-state-active")},function(){e(this).parent().children("a").removeClass("ui-state-active")}),e(".subchildmenu").hover(function(){e(this).parent().children("a").addClass("ui-state-active")},function(){e(this).parent().children("a").removeClass("ui-state-active")})},e.fn.solMegamenu=function(t){var s=e.extend({sticky:!0},t);return this.each(function(){new i(this,s)})}});