function _createForOfIteratorHelper(e,t){var a,o,n,i,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return n=!(o=!0),{s:function(){s=s.call(e)},n:function(){var e=s.next();return o=e.done,e},e:function(e){n=!0,a=e},f:function(){try{o||null==s.return||s.return()}finally{if(n)throw a}}};if(Array.isArray(e)||(s=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),i=0,{s:t=function(){},n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var a;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(a="Object"===(a={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:a)||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,o=Array(t);a a[href="#"]'));try{for(a.s();!(t=a.n()).done;){var o=t.value;o.addEventListener("touchstart",v),o.addEventListener("click",v),o.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),o.parentNode.parentNode.getElementsByClassName("sub-menu")[0].classList.toggle("toggled"))})}}catch(e){a.e(e)}finally{a.f()}s.focus()}),n.querySelectorAll('a[href*="#"]'));if(e.length){var o,r=_createForOfIteratorHelper(e);try{for(r.s();!(o=r.n()).done;)o.value.addEventListener("click",function(e){e.target.hash&&null!==document.querySelector(e.target.hash)&&!e.target.classList.contains("botiga-tabs-nav-link")&&(i.classList.remove("open"),n.classList.remove("toggled"),document.body.classList.remove("mobile-menu-visible"))})}catch(e){r.e(e)}finally{r.f()}}var c,s=(e=n.querySelectorAll("a[href]:not([disabled])"))[0],e=(e[e.length-1].addEventListener("keydown",function(e){"Tab"!==e.key&&9!==e.keyCode||e.shiftKey||s.focus()}),t.addEventListener("click",function(e){e.preventDefault();e=i.getBoundingClientRect();0 a, .page_item_has_children > a"),l=_createForOfIteratorHelper(e);try{for(l.s();!(c=l.n()).done;){var d=c.value;d.addEventListener("focus",g,!0),d.addEventListener("blur",g,!0)}}catch(e){l.e(e)}finally{l.f()}var u,m=_createForOfIteratorHelper(t);try{for(m.s();!(u=m.n()).done;)u.value.addEventListener("touchstart",g,!1)}catch(e){m.e(e)}finally{m.f()}this.mobileAccordionNavigation(),this.initHoverClass(),this.checkMenuReverse()}}}function v(e){e.cancelable&&e.preventDefault();var t=e.target.closest("li");if(t.querySelector(".sub-menu").classList.contains("toggling"))return!1;t.querySelector(".sub-menu").classList.toggle("toggling"),t.querySelector(".sub-menu").classList.toggle("toggled"),setTimeout(function(){t.querySelector(".sub-menu").classList.remove("toggling")},300)}function g(){if("focus"===event.type||"blur"===event.type)for(var e=this;!e.classList.contains("nav-menu");)"li"===e.tagName.toLowerCase()&&e.classList.toggle("focus"),e=e.parentNode;if("touchstart"===event.type){var t,a=this.parentNode,o=(event.preventDefault(),_createForOfIteratorHelper(a.parentNode.children));try{for(o.s();!(t=o.n()).done;){var n=t.value;a!==n&&n.classList.remove("focus")}}catch(e){o.e(e)}finally{o.f()}a.classList.toggle("focus")}}},initHoverClass:function(){var e=this;if(void 0!==botiga.settings&&"no"===botiga.settings.misc.dropdowns_hover_delay)return!1;for(var t=!1,a=0,o=[{name:"scroll",selector:window},{name:"mouseenter",selector:document},{name:"mouseover",selector:document},{name:"touchstart",selector:document}];a{var a,o,e=s.value,n=e;e.addEventListener("mouseover",function(e){var t=this;clearTimeout(a),o=setTimeout(function(){t.classList.add("hovered")},300)});var t,i=_createForOfIteratorHelper(e.querySelectorAll(".botiga-dropdown-ul > .botiga-dropdown-li"));try{for(i.s();!(t=i.n()).done;)t.value.addEventListener("mouseover",function(e){clearTimeout(a),setTimeout(function(){n.classList.add("hovered")},300)})}catch(e){i.e(e)}finally{i.f()}e.addEventListener("mouseout",function(e){var t=this;if(clearTimeout(o),n.contains(e.relatedTarget))return!1;a=setTimeout(function(){t.classList.remove("hovered")},300)})})()}catch(e){t.e(e)}finally{t.f()}},mobileAccordionNavigation:function(){var e=document.querySelectorAll(".botiga-dropdown-mobile-accordion");if(!e.length)return!1;var t,a=_createForOfIteratorHelper(e);try{for(a.s();!(t=a.n()).done;){var o=t.value.querySelectorAll(".menu-item-has-children");if(!o.length)return!1;var n,i=_createForOfIteratorHelper(o);try{for(i.s();!(n=i.n()).done;)n.value.querySelectorAll(".dropdown-symbol")[0].addEventListener("click",function(e){e.stopPropagation();e=this.parentNode;e.classList.contains("expand")?e.classList.remove("expand"):e.classList.add("expand")})}catch(e){i.e(e)}finally{i.f()}}}catch(e){a.e(e)}finally{a.f()}},checkMenuReverse:function(){var e,t=_createForOfIteratorHelper(document.querySelectorAll(".header-login-register, .top-bar-login-register, .botiga-dropdown .menu li"));try{for(t.s();!(e=t.n()).done;){var a=e.value;a.removeEventListener("mouseover",this.menuReverseEventHandler),a.addEventListener("mouseover",this.menuReverseEventHandler,{passive:!0}),a.removeEventListener("touchstart",this.menuReverseEventHandler),a.addEventListener("touchstart",this.menuReverseEventHandler,{passive:!0})}}catch(e){t.e(e)}finally{t.f()}},menuReverseEventHandler:function(){var e="rtl"===document.querySelector("html").getAttribute("dir"),t=(event.stopPropagation(),event.currentTarget.querySelector(".header-login-register>nav, .top-bar-login-register>nav, .sub-menu"));return null!==t&&(t.classList.remove("sub-menu-reverse"),!e&&(0!=botiga.helpers.isInHorizontalViewport(t)||t.closest(".menu-item").classList.contains("botiga-mega-menu"))?t.classList.remove("sub-menu-reverse"):t.classList.add("sub-menu-reverse"),!(t.closest(".site-header")||t.closest(".bottom-header-row")||t.closest(".bhfb-header")))&&(t.classList.remove("sub-menu-reverse-vertically"),void(0!=botiga.helpers.isInVerticalViewport(t)||t.closest(".menu-item").classList.contains("botiga-mega-menu")?t.classList.remove("sub-menu-reverse-vertically"):t.classList.add("sub-menu-reverse-vertically")))}},botiga.autoSelectVariations={init:function(){var e;null!=(e=botiga.settings)&&null!=(e=e.misc)&&e.auto_select_variations&&(document.addEventListener("wc_variation_form",function(e){var a,o=e.target;o&&o.matches(".variations_form")&&1===(e=(o.dataset.product_variations?JSON.parse(o.dataset.product_variations):[]).filter(function(e){return e.is_in_stock&&e.is_purchasable})).length&&(a=e[0].attributes,Object.keys(a).forEach(function(e){var t=a[e],e=o.querySelector('select[name="'.concat(e,'"]'));e&&(e.value=t)}),e=o.querySelector("select"))&&e.dispatchEvent(new Event("change",{bubbles:!0}))},!0),document.querySelectorAll(".variations_form").forEach(function(e){var t;e.dataset.product_variations&&(t=new CustomEvent("wc_variation_form",{bubbles:!0,cancelable:!0}),e.dispatchEvent(t))}))}},botiga.desktopOffCanvasToggleNav={init:function(){var e=document.getElementById("site-navigation"),t=document.getElementsByClassName("botiga-desktop-offcanvas-menu")[0];if(e&&void 0!==t){var a,o=_createForOfIteratorHelper(t.querySelectorAll('.dropdown-symbol, .menu-item-has-children > a[href="#"]'));try{for(o.s();!(a=o.n()).done;){var n=a.value;n.addEventListener("touchstart",i),n.addEventListener("click",i),n.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),n.parentNode.parentNode.getElementsByClassName("sub-menu")[0].classList.toggle("toggled"))})}}catch(e){o.e(e)}finally{o.f()}}function i(e){e.preventDefault(),e.target.closest("li").querySelector(".sub-menu").classList.toggle("toggled")}}},botiga.desktopOffcanvasNav={init:function(){var e=document.querySelectorAll(".desktop-menu-toggle"),t=document.getElementsByClassName("desktop-menu-close")[0],a=document.getElementsByClassName("botiga-desktop-offcanvas")[0];if(!e.length)return!1;for(var o=0;o{var e=o[t].getAttribute("data-botiga-collapse"),a=JSON.parse(e.replace(/'/g,'"').replace(";",""));if(!a.enable)return{v:!1};n.expand(o[t],a,!0),o[t].addEventListener("click",function(e){e.preventDefault(),this.dispatchEvent(new Event("botiga.collapse.before.expand")),o[t].classList.contains("active")?n.collapse(o[t],a):n.expand(o[t],a),this.dispatchEvent(new Event("botiga.collapse.after.collapse"))}),a.options.oneAtTime&&o[t].addEventListener("botiga.collapse.before.expand",function(){for(var e=document.querySelectorAll(a.options.oneAtTimeParentSelector+" [data-botiga-collapse]"),t=0;t{var a,e=t.value;e.closest(".botiga-tabs-nav").classList.contains("botiga-tabs-nav-click-on-mouseover")&&(e.addEventListener("mouseover",function(e){e.preventDefault();var t=this;a=setTimeout(function(){t.dispatchEvent(new Event("click"))},500)}),e.addEventListener("mouseout",function(e){clearTimeout(a)})),e.addEventListener("click",function(e){e.preventDefault();var t=this,e=this.querySelector(".botiga-tabs-nav-link").getAttribute("href"),a=this.closest(".botiga-tabs-nav").querySelector(".botiga-tabs-nav-item.is-active .botiga-tabs-nav-link").getAttribute("href"),o=document.querySelector(a),n=document.querySelector(e),a=n.parentNode.querySelectorAll(".botiga-tab-content.is-active").length;if(null===n)return!1;if(0===a||1 td")&&document.querySelector("#order_review .woocommerce-shipping-totals > td").setAttribute("colspan",2)})},customizer:function(){if("undefined"==typeof wp||void 0===wp.customize)return!1;wp.customize.bind("preview-ready",function(){document.querySelectorAll(".cart-count").length&&jQuery(document.body).trigger("wc_fragment_refresh")})}},botiga.helpers.botigaDomReady(function(){botiga.navigation.init(),botiga.autoSelectVariations.init(),botiga.desktopOffcanvasNav.init(),botiga.desktopOffCanvasToggleNav.init(),botiga.headerSearch.init(),botiga.customAddToCartButton.init(),botiga.stickyHeader.init(),botiga.scrollDirection.init(),botiga.backToTop.init(),botiga.qtyButton.init(),botiga.carousel.init(),botiga.collapse.init(),botiga.tabsNav.init(),botiga.misc.init()});