"use strict";var woostifyToggleVerticalMenu=function(){var e=document.querySelectorAll(".toggle-vertical-menu-button");e.length&&e.forEach(function(e){var t=1;e.onclick=function(){var e=this,n=e.closest(".vertical-menu-wrapper");n.querySelector(".site-vertical-menu"),n.classList.add("active"),t=1==t?2:1,document.addEventListener("click",function(i){var o=i.target.closest(".site-vertical-menu");e===i.target&&1==t?n.classList.remove("active"):e==i.target||o||(n.classList.remove("active"),t=1)})}})},woostifyMegaMenuContentWidth=function(){var e=document.querySelectorAll(".has-mega-menu-content-width"),t=window.innerWidth;e.length&&e.forEach(function(e){var n=e.querySelector(".mega-menu-wrapper"),i=n?n.offsetWidth:0,o=(n&&n.getBoundingClientRect(),e.offsetWidth),r=t-e.getBoundingClientRect().right-o/2-i/2;if(n){if(t0?(n.style.left=-(i/2-o/2)+"px",n.style.right="auto"):(n.style.left="auto",n.style.right="0px")}})},woostifyMegaMenuContainerWidth=function(){var e=document.querySelectorAll(".has-mega-menu-container-width");e.length&&e.forEach(function(e){if(!e.closest(".sidebar-menu")){var t=e.closest(".woostify-nav-menu-widget"),n=e.closest(".site-header-inner")||e.closest(".elementor-section"),i=!!n&&n.querySelector(".woostify-container");i||(i=!!n&&n.querySelector(".elementor-container"));var o=i?parseInt(window.getComputedStyle(i).paddingLeft):0,r=i?parseInt(window.getComputedStyle(i).paddingRight):0,l=i?i.offsetWidth:1170,s=e.querySelector(".mega-menu-wrapper"),a=window.innerWidth;if(s){if(a=r?l.style.right="0px":l.style.right=-(r-a)+"px"}})};document.addEventListener("DOMContentLoaded",function(){woostifyToggleVerticalMenu(),window.addEventListener("load",function(){woostifyMegaMenuContentWidth(),woostifyMegaMenuContainerWidth(),woostifyMegaMenuFullWidth()}),window.addEventListener("resize",function(){woostifyMegaMenuContentWidth(),woostifyMegaMenuContainerWidth(),woostifyMegaMenuFullWidth()})});