!function(e){"use strict";var t=t||{};function a(){for(var e=this;!e.classList.contains("main-navigation")&&!e.classList.contains("header-category__menu");)"li"===e.tagName.toLowerCase()&&(e.classList.contains("hovered")?e.classList.remove("hovered"):e.classList.add("hovered")),e=e.parentElement}function o(t){let a="input, a, button, [tabindex]",o=e(this).find(a),s=o[0],n=o[o.length-1],i=9===t.keyCode,r=t.shiftKey;if(o.parent().hasClass("shopwell-open")&&!o.hasClass("header-category__title")){let o=e(this).find(".panel__header .header-category__top").find(a),s=o[0],n=o[o.length-1],l=e(this).find("li.menu-item-has-children.shopwell-open ul.sub-menu, li.page_item_has_children.shopwell-open ul.children").find(a),c=l[0],d=l[l.length-1];"BUTTON"===t.target.tagName?setTimeout((()=>{s.focus()}),10):i&&(r||n!==document.activeElement?r||d!==document.activeElement?r&&s===document.activeElement?(t.preventDefault(),d.focus()):r&&c===document.activeElement&&(t.preventDefault(),n.focus()):(t.preventDefault(),s.focus()):(t.preventDefault(),c.focus()))}else!r&&i&&n===document.activeElement?(t.preventDefault(),s.focus()):r&&i&&s===document.activeElement&&(t.preventDefault(),n.focus())}t.init=function(){t.$body=e(document.body),t.$window=e(window),t.$header=e("#site-header"),this.toggleOffCanvas(),this.toggleModals(),this.shopwellMore(),this.focusSearchField(),this.clickCategorySearch(),this.clickSearchAdaptive(),this.clickHamburgerMenu(),this.clickCategoryMenu(),this.hoverPrimaryMenu(),this.clickHeaderDropdown(),this.recentlyViewedProducts(),this.stickyHeader(),this.instanceSearch(),this.tabMegaMenu(),this.setOverflowMenu(),this.postsSliderWidget(),this.trendingPosts(),this.featuredPosts(),this.loadMorePosts(),this.postFound(),this.showEntryMetaShare(),this.entryGallerySlider(),this.addedToWishlistNotice(),this.addedToCompareNotice(),this.productQuantityNumber(),this.updateQuantityAuto(),this.openMiniCartPanel(),this.productPopupATC(),this.productCardHoverSlider(),this.productCardHoverZoom(),this.productAttribute(),this.productQuickView(),this.addCompare(),this.loginTabs(),this.productLoaded(),this.preferences(),this.addToCartSingleAjax(),this.CrossSellsProductCarousel(),this.backToTop(),this.storeCategories(),this.fiboSearch(),this.buttonPrint(),this.copyLink(),this.historyBack(),this.productVariation(),e(".shopwell-preferences").find('input[name="trp-form-language"]').remove(),this.menuAccessibility(),t.$window.on("resize",function(e,t){let a;return function(){clearTimeout(a),a=setTimeout((()=>e.apply(this,arguments)),t)}}((function(){t.setOverflowMenu()}),250))},t.setOverflowMenu=function(){const{navigation_cutoff:a,navigation_cutoff_upto:o,header_breakpoint:s,navigation_cutoff_text:n}=shopwellData,i=(t,a)=>{const o=t.children(`li:nth-child(n+${a+1})`);let s=t.find(".menu-item-custom-more");if(!s.length&&o.length){const a=t.find(".sub-menu").length>0;o.remove(),s=(t=>e(`<li class="${t?"menu-item-has-children":"page_item_has_children"} menu-item-custom-more">\n                <a href="#">${n} <span class="shopwell-svg-icon shopwell-svg-icon--ellipsis-vertical">\n            <svg width="24" height="24" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n                <path fill="currentColor" d="M14.25 19.5a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm0-7.5a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm0-7.5a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"/>\n            </svg>\n        </span></a>\n                <ul class="${t?"sub-menu":"children"}"></ul>\n            </li>`))(a),t.append(s),s.find(".sub-menu, .children").append(o)}};if(a&&o>0&&e(window).width()>=s){const a=o-1;t.$header.find(".main-navigation.primary-navigation .menu").each((function(){i(e(this),a)}))}else{e(".main-navigation.primary-navigation .menu .menu-item-custom-more").each((function(){(e=>{const t=e.find(".sub-menu > li, .children > li"),a=e.closest(".menu");e.remove(),a.append(t)})(e(this))}))}},t.menuAccessibility=function(){document.querySelectorAll(".main-navigation, .header-category-menu:not(.header-category--hamburger)").forEach((e=>{e.querySelectorAll("ul").forEach((e=>{e.parentNode.setAttribute("aria-haspopup","true")})),e.querySelectorAll("a").forEach((e=>{e.addEventListener("focus",a,!0),e.addEventListener("blur",a,!0)}))}))},t.toggleOffCanvas=function(){e(document.body).on("click keydown",'[data-toggle="off-canvas"]',(function(a){if("click"===a.type||"Enter"===a.key||" "===a.key){var s="#"+e(this).data("target");e(s).hasClass("offscreen-panel--open")?t.closeOffCanvas(s):t.openOffCanvas(s)&&(a.preventDefault(),e(".panel__container").find(".panel__button-close").focus(),e(".panel__container").on("keydown",o))}})).on("click keydown",".offscreen-panel .panel__button-close, .offscreen-panel .panel__backdrop, .offscreen-panel .sidebar__backdrop",(function(a){"click"!==a.type&&"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),t.closeOffCanvas(this),e(".panel__container").off("keydown",o),e(".hamburger-menu").focus())})).on("keyup",(function(a){27===a.keyCode&&(t.closeOffCanvas(),e(".panel__container").off("keydown",o),e(".hamburger-menu").focus())}))},t.openOffCanvas=function(t){var a=e(t);if(!(a=a.length?a:e('.offscreen-panel[data-id="'+t+'"]')).length){t=t.replace("#","");a=e('.offscreen-panel[data-id="'+t+'"]')}if(!a.length)return!1;var o=window.innerWidth-e("#page").width();return e("#page").width()<767&&(o=0),e(document.body).css({"padding-right":o,overflow:"hidden"}),a.fadeIn(),a.addClass("offscreen-panel--open"),e(document.body).addClass("offcanvas-opened "+a.attr("id")+"-opened").trigger("shopwell_off_canvas_opened",[a]),!0},t.closeOffCanvas=function(t){t?((t=e(t).closest(".offscreen-panel")).removeClass("offscreen-panel--open").fadeOut(),e(document.body).removeClass(t.attr("id")+"-opened")):e(".offscreen-panel").each((function(){var t=e(this);t.hasClass("offscreen-panel--open")&&(t.removeClass("offscreen-panel--open").fadeOut(),e(document.body).removeClass(t.attr("id")+"-opened"))})),e(document.body).removeAttr("style"),e(document.body).removeClass("offcanvas-opened").trigger("shopwell_off_canvas_closed",[t])},t.toggleModals=function(){e(document.body).on("click keydown",'[data-toggle="modal"]',(function(a){if("click"===a.type||"Enter"===a.key||" "===a.key){var s="#"+e(this).data("target");e(s).hasClass("modal--open")?t.closeModal(s):t.openModal(s)&&a.preventDefault(),e(".search-modal").length&&e(".search-modal").hasClass("modal--open")&&(e(".search-modal").find(".search-modal__field").focus(),e(".search-modal").on("keydown",o))}})).on("click",".modal .modal__button-close, .modal .modal__backdrop",(function(a){a.preventDefault(),t.closeModal(this),e(".search-modal").length&&e(".search-modal").off("keydown",o)})).on("keyup",(function(a){27===a.keyCode&&(t.closeModal(),e(".search-modal").length&&e(".search-modal").off("keydown",o))}))},t.openModal=function(t){var a=e(t);if(!(a=a.length?a:e('.modal[data-id="'+t+'"]')).length){t=t.replace("#","");a=e('.modal[data-id="'+t+'"]')}if(!a.length)return!1;var o=window.innerWidth-e("#page").width();return e("#page").width()<767&&(o=0),e(document.body).css({"padding-right":o,overflow:"hidden"}),a.fadeIn(),a.addClass("modal--open"),e(document.body).addClass("modal-opened "+a.attr("id")+"-opened").trigger("shopwell_modal_opened",[a]),!0},t.closeModal=function(t){t?((t=e(t).closest(".modal")).removeClass("modal--open").fadeOut(),e(document.body).removeClass(t.attr("id")+"-opened")):(e(".modal").removeClass("modal--open").fadeOut(),e(".modal").each((function(){var t=e(this);t.hasClass("modal--open")&&(t.removeClass("modal--open").fadeOut(),e(document.body).removeClass(t.attr("id")+"-opened"))}))),e(document.body).removeAttr("style"),e(document.body).removeClass("modal-opened").trigger("shopwell_modal_closed",[t])},t.shopwellMore=function(){e(document.body).on("click",".shopwell-more__button",(function(t){t.preventDefault();var a=e(this).closest(".shopwell-more").data("settings"),o=a.more,s=a.less;e(this).hasClass("less")?(e(this).removeClass("less"),e(this).siblings(".shopwell-more__content").slideUp().removeClass("show"),e(this).text(o)):(e(this).addClass("less"),e(this).siblings(".shopwell-more__content").slideDown().addClass("show"),e(this).text(s))}))},t.focusSearchField=function(){e(document.body).on("shopwell_modal_opened",(function(e,t){t.hasClass("search-modal")&&t.find(".search-modal__field").focus()})),e(".header-search .header-search__field").on("focus",(function(){var t=e(this),a=t.closest(".header-search").find(".header-search__trending--outside");t.closest(".header-search__form").addClass("header-search__form--focused"),t.closest(".header-search__form").hasClass("searched")||a.addClass("header-search__trending--open"),t.addClass("header-search--focused"),t.closest(".header-search__form").find(".header-search__results").removeClass("hidden"),e(window).one("scroll",(function(){t.trigger("blur")}))})),e("#search-modal .search-modal__field").on("focus",(function(){e("#search-modal").find(".header-search__results").removeClass("hidden"),e(this).closest(".search-modal__form").hasClass("searched")||e("#search-modal").find(".header-search__trending").addClass("header-search__trending--open")})),e(document.body).on("click",".header-search__trending-label, .header-search__categories-label",(function(){e(".header-search__trending--outside").removeClass("header-search__trending--open"),e(".header-search__form").removeClass("header-search__form--focused")})).on("click","div",(function(t){var a=e(t.target);a.is(".header-search")||a.closest(".header-search").length||a.closest(".search-modal__form").length||(e(".header-search__trending--outside").removeClass("header-search__trending--open"),e(".header-search").removeClass("header-search--focused"),e(".header-search__form").removeClass("header-search__form--focused"),e(".header-search").find(".header-search__results").addClass("hidden"))}));var a=e(".header-search--form").data("width");a&&t.$window.on("resize",(function(){t.$window.width()>1300?e(".header-search--form").css("max-width",a):e(".header-search--form").removeAttr("style")})).trigger("resize")},t.clickCategorySearch=function(){shopwellData.header_search_type&&("adaptive"==shopwellData.header_search_type&&"post"==shopwellData.post_type||(e(".header-search__categories-label").on("click keydown",(function(){"click"!==event.type&&"Enter"!==event.key&&" "!==event.key||(e(this).closest(".header-search__form").find(".header-search__categories").addClass("header-search__categories--open"),e(this).closest(".header-search__form").addClass("categories--open"))})),e(document.body).on("click",".header-search__categories-close",(function(){e(this).closest(".header-search__categories").removeClass("header-search__categories--open"),e(".header-search__form").removeClass("categories--open")})).on("click","div",(function(t){var a=e(t.target);a.is(".header-search")||a.closest(".header-search").length||(e(".header-search__categories").removeClass("header-search__categories--open"),e(".header-search__form").removeClass("categories--open"))})),e(".header-search__categories a").on("click",(function(a){a.preventDefault(),e(".header-search__categories a").removeClass("active"),e(this).addClass("active");var o=e(this).attr("data-slug"),s=e(this).text();e(this).closest(".header-search__form").find("input.category-name").val(o),e(this).closest(".header-search__categories").removeClass("header-search__categories--open"),e(".header-search__form").removeClass("categories--open"),e(".header-search__form").find(".header-search__categories-label").find(".header-search__categories-text").text(s);var n=e(".header-search__categories-label").is(":visible")?e(".header-search__categories-label").outerWidth(!0):0,i=e(".header-search__divider").is(":visible")?e(".header-search__divider").outerWidth(!0):0;t.$body.hasClass("rtl")?e(this).closest(".header-search__form").find(".close-search-results").css("left",n+i+10):e(this).closest(".header-search__form").find(".close-search-results").css("right",n+i+10)})),e(window).on("load",(function(){var t=e(".header-search__form").find("input.category-name").val();if(t){var a=e(".header-search__categories").find('a[data-slug="'+t+'"]');e(".header-search__categories a").removeClass("active"),a.addClass("active")}}))))},t.clickSearchAdaptive=function(){e(".header-search__icon").on("click keydown",(function(t){if("click"===t.type||"Enter"===t.key||" "===t.key){var a=e(this),s="true"===a.attr("aria-expanded");a.closest(".header-search--icon").toggleClass("header-search--icon-open"),a.attr("aria-expanded",!s);var n=a.siblings(".header-search__container");s?n.off("keydown",o):(setTimeout((function(){n.find(".header-search__field").focus()}),50),n.on("keydown",o))}})),e(".header-search__close").on("click keydown",(function(t){"click"!==t.type&&"Enter"!==t.key&&" "!==t.key||(e(this).closest(".header-search--icon").removeClass("header-search--icon-open"),e(".header-search__icon").attr("aria-expanded","false"),e(".header-search__icon").focus())})),e(document).on("click",(function(t){e(t.target).closest(".header-search--icon").length||(e(".header-search--icon").removeClass("header-search--icon-open"),e(".header-search__icon").attr("aria-expanded","false"))}))},t.postsSliderWidget=function(){if("undefined"!=typeof Swiper){var t=e(".posts-slider-widget .swiper-container"),a={pagination:{el:".swiper-pagination",clickable:!0,renderBullet:function(e,t){return'<span class="'+t+'"></span>'}},watchOverflow:!0,navigation:{nextEl:t.find(".shopwell-swiper-button-next").get(0),prevEl:t.find(".shopwell-swiper-button-prev").get(0)},on:{init:function(){this.$el.css("opacity",1)}},breakpoints:{0:{slidesPerView:1,slidesPerGroup:1,spaceBetween:60},600:{slidesPerView:2,spaceBetween:40},992:{slidesPerView:1,slidesPerGroup:1,spaceBetween:60}}};new Swiper(t.get(0),a)}},t.showEntryMetaShare=function(){t.$body.on("click",".entry-meta__share",(function(){e(this).hasClass("active")?e(this).removeClass("active"):e(this).addClass("active")})),e(document).on("click",(function(t){!1===e(t.target).is(".entry-meta__share")&&e(".entry-meta__share").removeClass("active")}))},t.entryGallerySlider=function(){if("undefined"!=typeof Swiper){var t=e(".single-post .entry-gallery.swiper-container"),a={slidesPerView:1,slidesPerGroup:1,pagination:{el:".shopwell-swiper-pagination",clickable:!0,renderBullet:function(e,t){return'<span class="'+t+'"></span>'}},navigation:{nextEl:t.find(".shopwell-swiper-button-next").get(0),prevEl:t.find(".shopwell-swiper-button-prev").get(0)},on:{init:function(){this.$el.css("opacity",1)}}};new Swiper(t.get(0),a)}},t.trendingPosts=function(){if("undefined"!=typeof Swiper&&e("#trending-posts").hasClass("trending-posts--layout-2")){e(".trending-posts__items").find(".hentry").addClass("swiper-slide");var t=e(".trending-posts__items .swiper-container"),a={navigation:{nextEl:t.parent().find(".shopwell-swiper-button-next").get(0),prevEl:t.parent().find(".shopwell-swiper-button-prev").get(0)},watchOverflow:!0,on:{init:function(){this.$el.css("opacity",1)}}};new Swiper(t.get(0),a)}},t.featuredPosts=function(){if("undefined"!=typeof Swiper){var t=null,a=e(window),o=e(".featured-posts__container");if(0!=o.length){var s=e("#shopwell-featured-posts").data("columns"),n={navigation:{nextEl:o.parent().find(".shopwell-swiper-button-next"),prevEl:o.parent().find(".shopwell-swiper-button-prev")},watchOverflow:!0,on:{init:function(){this.$el.css("opacity",1)}},breakpoints:{0:{slidesPerView:2,slidesPerGroup:1,spaceBetween:24},600:{slidesPerView:3,spaceBetween:24},992:{slidesPerView:s,slidesPerGroup:1,spaceBetween:24}}};i(),a.on("load resize",(function(){i()}))}}function i(){a.width()>=768?(o.addClass("swiper-container"),o.find(".featured-posts__wrapper").addClass("swiper-wrapper"),t||(t=new Swiper(o.get(0),n))):t&&(t.destroy(),t=null,o.removeClass("swiper-container"),o.find(".featured-posts__wrapper").removeClass("swiper-wrapper"))}},t.loadMorePosts=function(){e(document.body).on("click",".navigation.next-posts-navigation a",(function(a){a.preventDefault();var o=e(this),s=o.closest("#main").children(".hentry").length,n=o.closest(".navigation"),i=o.attr("href"),r=e(".shopwell-posts-found");o.closest(".next-posts-navigation").hasClass("loading")||(o.closest(".next-posts-navigation").addClass("loading"),e.get(i,(function(a){var l=e("#main",a),c=e(".hentry",l),d=c.length+s,h=e(".next-posts-navigation",l);c.each((function(t,a){e(a).css("animation-delay",100*t+"ms")})),n.siblings(".shopwell-posts__list").length?c.appendTo(n.siblings(".shopwell-posts__list")):c.insertBefore(r),c.addClass("animated shopwellFadeInUp"),h.length?o.replaceWith(e("a",h)):n.fadeOut(),n.removeClass("loading"),r.find(".current-post").html(" "+d),t.postFound(),shopwellData.blog_nav_ajax_url_change&&window.history.pushState(null,"",i)})))}))},t.postFound=function(t){var a=e(".shopwell-posts-found__inner"),o=a.find(".count-bar"),s=a.find(".current-post").html()/a.find(".found-post").html()*100;o.css("width",s+"%")},t.addedToWishlistNotice=function(){void 0!==shopwellData.added_to_wishlist_notice&&e.fn.notify&&t.$body.on("added_to_wishlist",(function(t,a){return function(t){t+=" "+shopwellData.added_to_wishlist_notice.added_to_wishlist_text,t+='<a href="'+shopwellData.added_to_wishlist_notice.wishlist_view_link+'" class="btn-button">'+shopwellData.added_to_wishlist_notice.wishlist_view_text+"</a>";var a='<span class="shopwell-svg-icon message-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg></span>',o='<span class="shopwell-svg-icon svg-active"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 1L1 14M1 1L14 14" stroke="#A0A0A0" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path></svg></span>';e.notify.addStyle("shopwell",{html:"<div>"+a+t+o+"</div>"}),e.notify("&nbsp",{autoHideDelay:shopwellData.added_to_wishlist_notice.wishlist_notice_auto_hide,className:"success",style:"shopwell",showAnimation:"fadeIn",hideAnimation:"fadeOut"})}(a.data("product_title")),!1}))},t.addedToCompareNotice=function(){void 0!==shopwellData.added_to_compare_notice&&e.fn.notify&&t.$body.on("added_to_compare",(function(t,a){return function(t){t+=" "+shopwellData.added_to_compare_notice.added_to_compare_text,t+='<a href="'+shopwellData.added_to_compare_notice.compare_view_link+'" class="btn-button">'+shopwellData.added_to_compare_notice.compare_view_text+"</a>";var a='<span class="shopwell-svg-icon message-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg></span>',o='<span class="shopwell-svg-icon svg-active"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 1L1 14M1 1L14 14" stroke="#A0A0A0" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path></svg></span>';e.notify.addStyle("shopwell",{html:"<div>"+a+t+o+"</div>"}),e.notify("&nbsp",{autoHideDelay:shopwellData.added_to_compare_notice.compare_notice_auto_hide,className:"success",style:"shopwell",showAnimation:"fadeIn",hideAnimation:"fadeOut"})}(a.data("product_title")),!1}))},t.productQuantityNumber=function(){t.$body.on("click keydown",".shopwell-qty-button",(function(t){if("click"===t.type||"Enter"===t.key||" "===t.key){t.preventDefault();var a=e(this),o=a.siblings(".qty"),s=0,n=parseFloat(o.attr("min")),i=parseFloat(o.attr("max")),r=parseFloat(o.attr("step"));""!==o.val()?s=parseFloat(o.val()):""!==o.attr("placeholder")&&(s=parseFloat(o.attr("placeholder"))),n=n||0,i=i||s+1,a.hasClass("decrease")&&s>n&&(o.val(s-r),o.trigger("change")),a.hasClass("increase")&&s<i&&(o.val(s+r),o.trigger("change"))}}))},t.updateQuantityAuto=function(){var a=null;e(document.body).on("change",".woocommerce-mini-cart .qty",(function(){var o=e(this);a&&clearTimeout(a),a=setTimeout((function(){t.updateCartAJAX(o)}),500)}))},t.updateCartAJAX=function(t){var a=t.closest(".woocommerce-mini-cart-item"),o=a.find("a.remove").data("cart_item_key"),s=a.find(".woocommerce-mini-cart-item__qty").data("nonce"),n=wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","update_cart_item");e.fn.block&&a.block({message:null,overlayCSS:{opacity:.6,background:"#fff"}}),e.post(n,{cart_item_key:o,qty:t.val(),security:s},(function(t){t&&t.fragments&&(e.fn.unblock&&a.unblock(),e(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash]),e(".single-product div.product").find(".shopwell-free-shipping-bar").length&&e(t.fragments["div.widget_shopping_cart_content"]).length&&e(t.fragments["div.widget_shopping_cart_content"]).find(".shopwell-free-shipping-bar").length&&e(".single-product div.product").find(".shopwell-free-shipping-bar").replaceWith(e(t.fragments["div.widget_shopping_cart_content"]).find(".shopwell-free-shipping-bar")))})).fail((function(){e.fn.unblock&&a.unblock()}))},t.openMiniCartPanel=function(){if(void 0!==shopwellData.added_to_cart_notice&&"mini"===shopwellData.added_to_cart_notice.added_to_cart_notice_layout){var a="";e(document.body).on("adding_to_cart",(function(e,t){a="panel"===shopwellData.added_to_cart_notice.header_cart_icon_behaviour?"1":"2"})),e(document.body).on("added_to_cart wc_fragments_refreshed",(function(){"1"===a&&t.openOffCanvas("#cart-panel"),"2"===a&&(e("html, body").animate({scrollTop:0},800),setTimeout((function(){e(".header-cart .header-button-dropdown").trigger("click")}),900))}))}},t.productPopupATC=function(){if(void 0!==shopwellData.added_to_cart_notice&&"popup"==shopwellData.added_to_cart_notice.added_to_cart_notice_layout){var a=e("#shopwell-popup-add-to-cart"),o=a.find(".product-modal-content"),s=o.find(".shopwell-product-popup-atc__recommendation");if(!(a.length<1)){var n=0,i=0;e(document.body).on("adding_to_cart",(function(t,a){if(n=i=0,void 0!==a.data("product_id")&&(i=a.data("product_id"),n="0,"+i),0===(i=void 0===i?0:i)&&a.closest("form.cart").length){var o=a.closest("form.cart");i=o.find(".shopwell_product_id").val(),n=i,o.hasClass("variations_form")&&o.find(".single_variation_wrap .variation_id").length>0&&(n=o.find(".single_variation_wrap .variation_id").val()),o.hasClass("grouped_form")&&(n=0,o.find(".woocommerce-grouped-product-list-item").each((function(){if(e(this).find(".quantity .input-text").val()>0){var t=e(this).attr("id");t=t.replace("product-",""),n+=","+t}})))}})),e(document.body).on("wc_fragments_loaded",(function(){n&&i&&(r(i,n),n=0,i=0)})),e(document.body).on("wc_fragments_refreshed",(function(){n&&i&&(r(i,n),n=0,i=0)}))}}function r(n,i){for(var r=i.split(","),c=0;c<r.length;++c)o.find(".mini-cart-item-"+r[c]).addClass("active");o.find(".woocommerce-mini-cart-item").not(".active").remove(),o.find(".woocommerce-mini-cart-item").find(".woocommerce-mini-cart-item__qty, .woocommerce-mini-cart-item__remove").remove(),t.openModal(a),s.hasClass("loaded")?s.hasClass("has-carousel")||(l(s),s.addClass("has-carousel")):(s.removeClass("active").removeClass("hidden").addClass("loading"),e.ajax({url:shopwellData.ajax_url.toString().replace("%%endpoint%%","shopwell_product_popup_recommended"),type:"POST",data:{nonce:shopwellData.nonce,product_id:n},success:function(e){e&&""!==e.data?(s.html(e.data),l(s),s.removeClass("loading"),s.addClass("active")):s.addClass("hidden")}}))}function l(e){if(!(e.length<1)){var t=e.find("ul.products");t.length<1||(t.find("li.product").addClass("swiper-slide"),t.after('<div class="swiper-pagination"></div>'),new Swiper(e.find(".linked-products-carousel").get(0),{loop:!1,autoplay:!1,speed:800,watchSlidesVisibility:!0,slidesPerView:4,navigation:{nextEl:e.find(".shopwell-swiper-button-next").get(0),prevEl:e.find(".shopwell-swiper-button-prev").get(0)},pagination:{el:e.find(".swiper-pagination").get(0),type:"bullets",clickable:!0},on:{init:function(){this.$el.css("opacity",1)}},spaceBetween:20,breakpoints:{300:{slidesPerView:""==shopwellData.mobile_product_columns?2:parseInt(shopwellData.mobile_product_columns),slidesPerGroup:""==shopwellData.mobile_product_columns?2:parseInt(shopwellData.mobile_product_columns),spaceBetween:16},768:{slidesPerView:3},1200:{slidesPerView:4}}}))}}},t.clickHamburgerMenu=function(){var t=e("#hamburger-panel, #mobile-menu-panel, #category-menu-panel, #mobile-header-v11-menu-panel, #mobile-header-v12-menu-panel");t.find("ul.menu > li.menu-item-has-children > a, ul.menu > li.page_item_has_children > a").find(".shopwell-svg-icon--select-arrow").remove(),t.find("ul.menu > li.menu-item-has-children, ul.menu > li.page_item_has_children").append('<button class="shopwell-button shopwell-button--text shopwell-button--small toggle-submenu"><span class="shopwell-svg-icon icon-arrow"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span></button'),t.find("ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label h6").append('<span class="shopwell-svg-icon icon-minus" tabindex="0"><svg viewBox="0 0 32 32"><path d="M26.667 13.333v5.333h-21.333v-5.333h21.333z"></path></svg></span>'),t.find("ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label h6").append('<span class="shopwell-svg-icon icon-plus" tabindex="0"><svg viewBox="0 0 32 32"><path d="M26.667 13.333h-8v-8h-5.333v8h-8v5.333h8v8h5.333v-8h8z"></path></svg></span>'),t.find("ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item-has-children > a, ul.menu > li.page_item_has_children > ul.children li.page_item_has_children > a").after('<span class="shopwell-svg-icon" tabindex="0"><svg viewBox="0 0 32 32"><path class="icon-minus" d="M26.667 13.333v5.333h-21.333v-5.333h21.333z"></path><path class="icon-plus" d="M26.667 13.333h-8v-8h-5.333v8h-8v5.333h8v8h5.333v-8h8z"></path></svg></span>'),t.find("ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label").nextUntil(".menu-item--type-label").addClass("menu-sub-item"),e("#mobile-menu-panel").find(".panel__content.open-submenus-both").find(".menu-item-has-children > a, .page_item_has_children > a").addClass("open-submenus"),t.on("click","ul.menu > li.menu-item-has-children > .toggle-submenu, ul.menu > li.page_item_has_children > .toggle-submenu, ul.menu > li.menu-item-has-children > .open-submenus",(function(a){a.preventDefault();var o=e(this).parent().find("> a"),s=o.data("title"),n=o.data("image");o.closest(t).find(".header-category__sub-title").html(s),o.data("image")?(t.find(".header-category__box-image").css("background-image","url("+n+")"),t.find(".header-category__box").addClass("has-image")):t.find(".header-category__box-image").removeAttr("style"),o.closest(t).find(".panel__container").addClass("shopwell-open"),o.closest("li.menu-item-has-children, li.page_item_has_children").addClass("shopwell-open")})).on("click keydown",".header-category__back",(function(a){"click"!==a.type&&"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),e(this).closest(t).find(".panel__container").removeClass("shopwell-open"),e(this).closest(t).find("li.menu-item-has-children, li.page_item_has_children").removeClass("shopwell-open"),e(this).closest(t).find(".preferences-menu__item").removeClass("shopwell-open"),e(this).closest(t).find("li.menu-item-has-children > .toggle-submenu, li.page_item_has_children > .toggle-submenu").focus())})).on("click keydown","ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item-has-children > .shopwell-svg-icon, ul.menu > li.page_item_has_children > ul.children li.page_item_has_children > .shopwell-svg-icon",(function(t){if("click"===t.type||"Enter"===t.key||" "===t.key){var a=e(this).closest("li.menu-item-has-children, li.page_item_has_children");a.toggleClass("active").siblings().removeClass("active"),(a.closest("ul").hasClass("sub-menu")||a.closest("ul").hasClass("children"))&&(a.children("ul").slideToggle(),a.siblings().find("ul").slideUp())}})).on("click","ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label",(function(t){t.preventDefault(),e(this).toggleClass("active").siblings().removeClass("active"),e(this).nextAll().each((function(){if(e(this).filter(".menu-item--type-label").length)return!1;e(this).filter("li.menu-sub-item").slideToggle(200)}))})).on("click",".preferences-menu__item > a",(function(a){a.preventDefault(),e(this).closest(t).find(".header-category__sub-title").html(e(this).data("title")),e(this).closest(t).find(".panel__container").addClass("shopwell-open"),e(this).parent().addClass("shopwell-open")}))},t.clickCategoryMenu=function(){var t=e(".header-category-menu");if(t.hasClass("header-category--icon")&&t.find("ul.menu > li.menu-item-has-children > a").append('<span class="shopwell-svg-icon icon-arrow"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>'),t.hasClass("header-category--both")&&t.find(".shopwell-button--subtle + .header-category__content ul.menu > li.menu-item-has-children > a, .shopwell-button--text + .header-category__content ul.menu > li.menu-item-has-children > a").append('<span class="shopwell-svg-icon icon-arrow"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>'),t.find("ul.menu > li.menu-item-has-children").mouseenter((function(){t.find("ul.menu").addClass("shopwell-hover")})).mouseleave((function(){t.find("ul.menu").removeClass("shopwell-hover")})),t.on("click keydown",".header-category__title",(function(a){if("click"===event.type||"Enter"===event.key||" "===event.key){if(e(this).closest(t).hasClass("header-category--open"))return;e(this).closest(t).toggleClass("shopwell-open"),e(this).closest(".header-category-menu:not(.header-category--hamburger)").hasClass("shopwell-open")?e(this).closest(".header-category-menu:not(.header-category--hamburger)").on("keydown",o):e(this).closest(".header-category-menu:not(.header-category--hamburger)").off("keydown",o)}})),e(document.body).on("click","div",(function(a){if(!e(".header-category-menu").hasClass("header-category--open")){var s=e(a.target);s.is(t)||s.closest(t).length||(t.removeClass("shopwell-open"),e(this).closest(".header-category-menu:not(.header-category--hamburger)").off("keydown",o))}})),t.find(".header-category__content .mega-menu-container").hasClass("full-width")){e(".header-category__content .mega-menu-container.full-width").append('<div class="shopwell-container-full-width-hover"></div>');var a=t.find(".header-category__content"),s=-(a.offset().left-e(window).scrollLeft())-a.width();t.find(".shopwell-container-full-width-hover").css("left",s)}},t.hoverPrimaryMenu=function(){var a=e(".site-header .primary-navigation, .site-header .secondary-navigation"),o=e("#wpadminbar").is(":visible")?e("#wpadminbar").outerHeight(!0):0,s=e("#campaign-bar").is(":visible")?e("#campaign-bar").outerHeight(!0):0,n=e("#topbar").is(":visible")?e("#topbar").outerHeight(!0):0,i=e("#site-header").outerHeight(!0)+o+s+n;a.append('<div class="shopwell-primary-menu-overlay"></div>'),a.find(".shopwell-primary-menu-overlay").css("top",i),a.find("ul.menu > li.menu-item-has-children").mouseenter((function(){a.find(".shopwell-primary-menu-overlay").addClass("shopwell-hover")})).mouseleave((function(){a.find(".shopwell-primary-menu-overlay").removeClass("shopwell-hover")})),t.$window.scroll((function(){var e=t.$window.scrollTop();a.find(".shopwell-primary-menu-overlay").css("top",i-e)}))},t.recentlyViewedProducts=function(){t.$body.find(".header-view-history").each((function(){var a=e(this),o=!0;a.on("click",".header-view-history__title",(function(s){s.preventDefault(),a.toggleClass("shopwell-open"),o&&(!function(a){var o=a.find(".header-view-history__content-products"),s=shopwellData.ajax_url.toString().replace("%%endpoint%%","shopwell_recently_viewed_products");if(""==s)return;e.post(s,{nonce:shopwellData.nonce},(function(e){o.html(e),t.productCardHoverSlider(),o.addClass("swiper-container"),o.find(".products")&&a.find(".products").addClass("swiper-wrapper"),o.find("ul.products li").hasClass("no-products")||function(e){var t=e,a=t.find("ul.products");if(t.find("div").hasClass("no-products"))return;t.addClass("swiper-container"),t.find(".products").removeClass("product-card-layout-2"),t.find(".products").removeClass("product-card-layout-3"),t.find(".products").removeClass("product-card-layout-4"),t.find(".products").removeClass("product-card-layout-5"),t.find(".products")&&(t.find(".products").addClass("swiper-wrapper"),t.find(".products").addClass("product-card-layout-1 product-card-layout-recently"));t.parent().append('<span class="shopwell-svg-icon swiper-button shopwell-swiper-button-prev shopwell-swiper-button"><svg viewBox="0 0 32 32"><path d="M20.58 2.58l2.84 2.84-10.6 10.58 10.6 10.58-2.84 2.84-13.4-13.42z"></path></svg></span>'),t.parent().append('<span class="shopwell-svg-icon swiper-button shopwell-swiper-button-next shopwell-swiper-button"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>'),a.find("li.product").addClass("swiper-slide");var o={loop:!1,autoplay:!1,speed:800,watchOverflow:!0,lazy:!0,slidesPerView:7,breakpoints:{}};o.navigation={nextEl:t.parent().find(".shopwell-swiper-button-next").get(0),prevEl:t.parent().find(".shopwell-swiper-button-prev").get(0)},new Swiper(t.get(0),o)}(o),a.addClass("products-loaded"),a.find(".shopwell-pagination--loading").remove()}))}(a),o=!1)}))})),e(document.body).on("click","div",(function(a){var o=t.$body.find(".header-view-history"),s=e(a.target);s.is(o)||s.closest(o).length||o.removeClass("shopwell-open")}))},t.clickHeaderDropdown=function(){var t=e(".site-header"),a=e(".site-header").find(".header-cart a").width()/2-5;t.find(".dropdown-content").append('<div class="dropdown-after"></div>'),t.find(".dropdown-after").css("right",a+"px"),t.on("click",".header-button-dropdown",(function(t){t.preventDefault(),e(this).parent().find(".dropdown-content").hasClass("shopwell-open")||e(".dropdown-content").removeClass("shopwell-open"),e(this).parent().find(".dropdown-content").toggleClass("shopwell-open")})),e(document.body).on("click",(function(a){var o=e(a.target),s=e(".header-button-dropdown").parent();o.is(s)||o.closest(s).length||t.find(".dropdown-content").removeClass("shopwell-open")}))},t.stickyHeader=function(){if(shopwellData.sticky_header){var a=e("#site-header-minimized"),o=t.$header.find(".site-header__section.shopwell-header-sticky"),s=t.$header.find(".site-header__desktop").find(".header-sticky"),n=t.$header.find(".site-header__mobile").find(".header-mobile-sticky"),i=s.length?s.outerHeight():0,r=n.length?n.outerHeight():0,l=t.$header.outerHeight(!0),c=t.$body.outerHeight(!0),d=l+(e("#campaign-bar").is(":visible")?e("#campaign-bar").height():0)+(e("#topbar").is(":visible")?e("#topbar").height():0)+200;if("up"===shopwellData.sticky_header_on){if(s.length)new Headroom(s.get(0),{offset:d}).init();if(n.length)new Headroom(n.get(0),{offset:d}).init()}else t.$window.on("scroll",(function(){!function(s){var n=t.$window.scrollTop();if(c<=s+t.$window.height())return;n>s?(o.addClass("minimized"),t.$window.width()>992?a.css("height",i):a.css("height",r),e(".header-search__trending--outside").removeClass("header-search__trending--open"),e(".header-search").removeClass("header-search--focused"),e(".header-search__form").removeClass("header-search__form--focused"),e(".header-search__categories").removeClass("header-search__categories--open"),e(".header-search__form").removeClass("categories--open"),e(".header-search__results").addClass("hidden")):(o.removeClass("minimized"),a.removeAttr("style"))}(d)}));var h=t.$header.find(".header-sticky .header-category-menu");h.hasClass("header-category--open")&&h.removeClass("header-category--open shopwell-open"),e(document.body).on("click","div",(function(t){if(h.hasClass("shopwell-open")){var a=e(t.target);if(a.is(h)||a.closest(h).length)return;h.removeClass("shopwell-open")}}))}},t.instanceSearch=function(){if("1"==shopwellData.header_ajax_search){var a=e("#search-modal, .header-search"),o=null,s={},n=a.find("form"),i=null;a.on("keyup",".header-search__field, .search-modal__field",(function(s){var n=!1,l=e(this);if(void 0===s.which?n=!0:"number"==typeof s.which&&s.which>0&&(n=!s.ctrlKey&&!s.metaKey&&!s.altKey),n){o&&o.abort(),i&&clearTimeout(i);var c=(e(".header-search__categories-label").is(":visible")?e(".header-search__categories-label").outerWidth(!0):0)+(e(".header-search__divider").is(":visible")?e(".header-search__divider").outerWidth(!0):0)+10;e(".header-search__container > div:first-child").hasClass("header-search__categories-label")&&(c=10),l.parent().parent().parent().hasClass("header-search--inside")&&(c+=20),t.$body.hasClass("rtl")?a.find(".close-search-results").css("left",c):a.find(".close-search-results").css("right",c),a.find(".header-search__trending").removeClass("header-search__trending--open"),a.find(".result-list-found, .result-list-not-found").html("");var d=l.closest(".header-search__form, .search-modal__form");l.val().length<2?d.removeClass("searching searched actived found-products found-no-product invalid-length"):i=setTimeout((function(){r(d)}),600)}})).on("click",".header-search__categories-container a",(function(){o&&o.abort(),a.find(".result-list-found").html(""),r(e(this).closest(".header-search__form"))})).on("focusout",".header-search__field, .search-modal__field",(function(){var t=e(this),a=t.closest(".header-search__form, .search-modal__form");t.val().length<2&&a.removeClass("searching searched actived found-products found-no-product invalid-length")})),a.on("click",".close-search-results",(function(e){e.preventDefault(),a.find(".header-search__field, .search-modal__field").val(""),a.find(".header-search__form, .search-modal__form").removeClass("searching searched actived found-products found-no-product invalid-length"),a.find(".result-list-found").html("")})),e(".site-header .header-search__field").on("input",(function(){var t=e(this).val();e(".site-header .header-search__field").val(t)}))}function r(t){var a=t.find("input.header-search__field, input.search-modal__field").val(),i=0,r=t.find(".search-results");if(t.find("input.category-name").length>0&&(i=t.find("input.category-name").val()),a.trim().length<2)t.removeClass("searching found-products found-no-product").addClass("invalid-length");else{t.removeClass("found-products found-no-product").addClass("searching");var l=a+i;n.attr("action"),n.serialize();if(l in s){var c=s[l];t.removeClass("searching"),t.addClass("found-products"),r.html(c.products),e(document.body).trigger("shopwell_ajax_search_request_success",[r]),t.removeClass("invalid-length"),t.addClass("searched actived")}else{var d={term:a,cat:i,tax:t.find("input.category-name").attr("name"),ajax_search_number:shopwellData.header_search_number,search_type:t.find("input.header-search__post-type, input.search-modal__post-type").val()},h=shopwellData.ajax_url.toString().replace("%%endpoint%%","shopwell_instance_search_form");o=e.post(h,d,(function(a){var o=a.data;t.removeClass("searching"),t.addClass("found-products"),r.html(o),t.removeClass("invalid-length"),e(document.body).trigger("shopwell_ajax_search_request_success",[r]),s[l]={found:!0,products:o},t.addClass("searched actived")}))}}}},t.tabMegaMenu=function(){var t=e(".site-header .main-navigation, #hamburger-panel, #mobile-menu-panel, #mobile-header-v11-menu-panel, #mobile-header-v12-menu-panel");function a(e){var a=e.parent();if(!e.hasClass("active")){var o=a.data("tab");t.find(".mega-menu__tablist > li").removeClass("active"),a.addClass("active"),a.parent().siblings(".mega-menu__panellist").find(".mega-menu__tabpanel").removeClass("active"),a.parent().siblings(".mega-menu__panellist").find('[data-tabpanel="'+o+'"]').addClass("active")}}t.on("mouseover",".mega-menu--behavior-hover .mega-menu__tablist > li > a",(function(){a(e(this))})),t.on("click",".mega-menu--behavior-click .mega-menu__tablist > li > a",(function(t){t.preventDefault(),a(e(this))}))},t.productCardHoverSlider=function(){var a=t.$body.find("ul.products .product-thumbnails--slider"),o={observer:!0,observeParents:!0,loop:!1,autoplay:!1,speed:800,watchOverflow:!0,lazy:!0,breakpoints:{}};a.find(".woocommerce-loop-product__link").addClass("swiper-slide"),setTimeout((function(){a.each((function(){o.navigation={nextEl:e(this).find(".shopwell-product-card-swiper-next").get(0),prevEl:e(this).find(".shopwell-product-card-swiper-prev").get(0)},new Swiper(e(this).get(0),o)}))}),200)},t.productCardHoverZoom=function(){void 0!==shopwellData.product_card_hover&&e.fn.zoom&&("zoom"===shopwellData.product_card_hover&&t.$body.find("ul.products .product-thumbnail-zoom").each((function(){var t=e(this);t.zoom({url:t.attr("data-zoom_image")})})))},t.productAttribute=function(){t.$body.on("click",".product-variation-item--attrs",(function(t){t.preventDefault(),e(this).siblings(".product-variation-item--attrs").removeClass("selected"),e(this).addClass("selected");var a=e(this).data("product_variations"),o=e(this).closest(".product-inner").find(".woocommerce-LoopProduct-link").first(),s=o.find("img").first(),n=e(this).closest(".product-inner").find(".price");o.addClass("image-loading"),a.img_src&&"undefined"!=a.img_src&&s.attr("src",a.img_src),a.img_srcset&&"undefined"!=a.img_srcset&&s.attr("srcset",a.img_srcset),a.price&&"undefined"!=a.price&&n.replaceWith(a.price),a.img_zoom_src&&"undefined"!=a.img_zoom_src&&o.find(".zoomImg").attr("src",a.img_zoom_src),s.load((function(){o.removeClass("image-loading")}))})),t.$body.on("mouseover",".product-variation-items",(function(t){t.preventDefault(),e(this).closest(".product-inner").find(".product-thumbnail").addClass("hover-swatch")})).on("mouseout",".product-variation-items",(function(t){t.preventDefault(),e(this).closest(".product-inner").find(".product-thumbnail").removeClass("hover-swatch")}))},t.productQuickView=function(){e(document.body).on("click",".shopwell-button--quickview",(function(a){a.preventDefault();var o=e(this),s=o.data("id"),n=e("#"+o.data("target")),i=n.find(".woocommerce"),r=shopwellData.ajax_url.toString().replace("%%endpoint%%","product_quick_view");function l(){var e=i.find(".product-quickview"),t=e.find(".woocommerce-product-gallery");t.on("click",".woocommerce-product-gallery__image a",(function(e){e.preventDefault()})),t.find(".woocommerce-product-gallery__image").length>1?t.flexslider({selector:".woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image",animation:"slide",animationLoop:!1,animationSpeed:500,controlNav:!0,directionNav:!0,prevText:'<span class="shopwell-svg-icon shopwell-svg-icon--arrow-left-long"><svg width="24" height="24" aria-hidden="true" role="img" focusable="false" viewBox="0 0 32 32"><path d="M20.58 2.58l2.84 2.84-10.6 10.58 10.6 10.58-2.84 2.84-13.4-13.42z"></path></svg></span>',nextText:'<span class="shopwell-svg-icon shopwell-svg-icon--arrow-right-long"><svg width="24" height="24" aria-hidden="true" role="img" focusable="false" viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>',slideshow:!1,start:function(){t.css("opacity",1)}}):t.css("opacity",1),t.append('<a class="product-image__link" href="'+e.find(".product_title a").attr("href")+'"></a>')}n.removeClass("modal--open"),n.addClass("loading"),i.find(".product-quickview").html(""),e.post(r,{action:"shopwell_get_product_quickview",product_id:s,security:shopwellData.product_quickview_nonce},(function(a){i.find(".product-quickview").replaceWith(a.data),a.success&&function(){var t=i.find(".product-quickview"),a=t.find(".woocommerce-product-gallery"),o=t.find(".variations_form");l(),a.on("shopwell_update_product_gallery_on_quickview",(function(){l()})),"undefined"!=typeof wc_add_to_cart_variation_params&&o.each((function(){var t,a;t=e(".product-quickview .variations-attribute-change .price").html(),a=e(".product-quickview .variations-attribute-change .stock").html(),e(".product-quickview .variations_form").on("show_variation",(function(){var t=e(this).closest(".product-quickview").find(".variations-attribute-change"),a=e(this).find(".woocommerce-variation-price .price").html(),o=e(this).find(".woocommerce-variation-availability .stock").html();t.find(".price").html(a),t.find(".stock").html(o)})),e(".product-quickview .variations_form").on("hide_variation",(function(){var o=e(this).closest(".product-quickview").find(".variations-attribute-change");o.find(".price").html(t),o.find(".stock").html(a)})),e(this).wc_variation_form()}));e(document.body).trigger("init_variation_swatches")}(),n.removeClass("loading"),n.addClass("modal--open"),t.addToCartSingleAjax(),t.$body.trigger("shopwell_product_quick_view_loaded"),i.find(".deal-expire-countdown").length>0&&e(document.body).trigger("shopwell_countdown",[e(".deal-expire-countdown")])})).fail((function(){window.location.herf=o.attr("href")}))}))},t.addCompare=function(){t.$body.on("click","a.compare:not(.added)",(function(t){t.preventDefault();var a=e(this);a.addClass("loading"),a.closest(".product-inner").find(".compare:not(.loading)").trigger("click"),e(this).hasClass("added")?a.removeClass("loading"):setTimeout((function(){a.removeClass("loading")}),2e3)}))},t.loginTabs=function(){e(".woocommerce-account__heading").on("click","h2",(function(t){t.preventDefault();var a=e(this).parent();if(!e(this).hasClass("active")){var o=e(this).data("tab");a.find("h2").removeClass("active"),e(this).addClass("active"),a.siblings(".woocommerce-account__form").find(".woocommerce-form").removeClass("active"),a.siblings(".woocommerce-account__form").find("."+o).addClass("active")}})),e(".shopwell-create-account").on("click","a",(function(t){t.preventDefault(),e(this).closest(".woocommerce-account__summary").find('h2[data-tab="register"]').trigger("click")})),e(".shopwell-sign-in").on("click","a",(function(t){t.preventDefault(),e(this).closest(".woocommerce-account__summary").find('h2[data-tab="login"]').trigger("click")})),void 0!==shopwellData.show_text&&void 0!==shopwellData.hide_text&&(e(".woocommerce-account__summary .show-password-input").text(shopwellData.show_text),e(".woocommerce-account__summary .show-password-input").on("click",(function(t){t.preventDefault(),e(this).hasClass("display-password")?e(".woocommerce-account__summary .show-password-input").text(shopwellData.hide_text):e(".woocommerce-account__summary .show-password-input").text(shopwellData.show_text)})));var t=window.location.hash;"#register"===t&&(e(".woocommerce-account__heading .register").trigger("click"),e("html, body").animate({scrollTop:e(t).offset().top-300},300))},t.productLoaded=function(){t.$window.on("shopwell_products_loaded",(function(e,a){setTimeout((function(){a.removeClass("animated shopwellFadeInUp")}),1500),t.productCardHoverSlider()}))},t.preferences=function(){var t=e(".preferences-modal");e.fn.select2&&(t.find(".language_select").select2({width:"100%",minimumResultsForSearch:5,selectionCssClass:"shopwell-input--default",dropdownCssClass:"language-select",dropdownParent:t.find(".language_select").parent()}),t.find(".currency_select").select2({width:"100%",minimumResultsForSearch:5,selectionCssClass:"shopwell-input--default",dropdownCssClass:"currency-select",dropdownParent:t.find(".currency_select").parent()})),t.on("change",".preferences_select",(function(){e(this).hasClass("language_select")&&e(this).closest("form").attr("action",e(this).val())})),e(".update-preferences").on("click",(function(t){var a=e(this).closest("form"),o=a.attr("action");a.find(".language_select").prop("disabled",!0),-1!=o.indexOf("?")&&(t.preventDefault(),window.location.href=o+"&"+a.serialize())}))},t.addToCartSingleAjax=function(){var a=e("div.product, #shopwell-sticky-add-to-cart, .shopwell-elementor-add-to-cart");a.length<1||a.hasClass("product-add-to-cart-ajax")&&a.find("form.cart").on("click",".single_add_to_cart_button",(function(a){var o=e(this),s=o.closest("form.cart");o.closest(".product").hasClass("product-type-external")||s.hasClass("buy-now-clicked")||o.is(".disabled")||s.length>0&&(a.preventDefault(),t.addToCartFormAJAX(o,s,o))}))},t.addToCartFormAJAX=function(t,a,o){if(!t.data("requestRunning")){t.data("requestRunning",!0);var s=!1;if(o.addClass("loading"),!s){s=!0;var n=a.serializeArray(),i=a.attr("action");""!=t.val()&&n.push({name:t.attr("name"),value:t.val()}),e(document.body).trigger("adding_to_cart",[t,n]),e.ajax({url:i,method:"post",data:n,error:function(e){window.location=i},success:function(a){if(a||(window.location=i),"undefined"==typeof wc_add_to_cart_params||"yes"!==wc_add_to_cart_params.cart_redirect_after_add){var n="",r="info";if(e(a).find(".woocommerce-notices-wrapper .woocommerce-message").length||e(a).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner.is-success").length)e(document.body).trigger("wc_fragment_refresh"),e(".single-product div.product").find(".shopwell-free-shipping-bar").length&&e(a).find("div.product .shopwell-free-shipping-bar").length&&e(".single-product div.product").find(".shopwell-free-shipping-bar").replaceWith(e(a).find("div.product .shopwell-free-shipping-bar"));else{if(!e.fn.notify)return;var l='<span class="shopwell-svg-icon message-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" ><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg></span>';e(a).find(".woocommerce-notices-wrapper .woocommerce-error").length>0?(n=e(a).find(".woocommerce-notices-wrapper .woocommerce-error").html(),r="error",l='<span class="shopwell-svg-icon message-icon"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><g data-name="1" id="_1"><path d="M257,461.46c-114,0-206.73-92.74-206.73-206.73S143,48,257,48s206.73,92.74,206.73,206.73S371,461.46,257,461.46ZM257,78C159.55,78,80.27,157.28,80.27,254.73S159.55,431.46,257,431.46s176.73-79.28,176.73-176.73S354.45,78,257,78Z"/><path d="M342.92,358a15,15,0,0,1-10.61-4.39L160.47,181.76a15,15,0,1,1,21.21-21.21L353.53,332.4A15,15,0,0,1,342.92,358Z"/><path d="M171.07,358a15,15,0,0,1-10.6-25.6L332.31,160.55a15,15,0,0,1,21.22,21.21L181.68,353.61A15,15,0,0,1,171.07,358Z"/></g></svg></span>'):e(a).find(".woocommerce-notices-wrapper .woocommerce-info").length>0?n=e(a).find(".woocommerce-notices-wrapper .woocommerce-info").html():e(a).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner.is-error").length?(r="error",n=e(a).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner.is-error .wc-block-components-notice-banner__content").html(),l='<span class="shopwell-svg-icon message-icon"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><g data-name="1" id="_1"><path d="M257,461.46c-114,0-206.73-92.74-206.73-206.73S143,48,257,48s206.73,92.74,206.73,206.73S371,461.46,257,461.46ZM257,78C159.55,78,80.27,157.28,80.27,254.73S159.55,431.46,257,431.46s176.73-79.28,176.73-176.73S354.45,78,257,78Z"/><path d="M342.92,358a15,15,0,0,1-10.61-4.39L160.47,181.76a15,15,0,1,1,21.21-21.21L353.53,332.4A15,15,0,0,1,342.92,358Z"/><path d="M171.07,358a15,15,0,0,1-10.6-25.6L332.31,160.55a15,15,0,0,1,21.22,21.21L181.68,353.61A15,15,0,0,1,171.07,358Z"/></g></svg></span>'):e(a).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner").length>0&&(n=e(a).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner .wc-block-components-notice-banner__content").html()),e.notify.addStyle("shopwell",{html:"<div>"+l+'<ul class="message-box">'+n+'</ul><span class="shopwell-svg-icon svg-active"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 1L1 14M1 1L14 14" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></div>'}),e.notify("&nbsp",{autoHideDelay:5e3,className:r,style:"shopwell",showAnimation:"fadeIn",hideAnimation:"fadeOut"})}t.data("requestRunning",!1),t.removeClass("loading"),o.removeClass("loading"),s=!1}else window.location=wc_add_to_cart_params.cart_url}})}}},t.backToTop=function(){var a=e("#gotop");t.$window.on("scroll",(function(){t.$window.scrollTop()>t.$window.height()?a.addClass("show-scroll"):a.removeClass("show-scroll")})),t.$body.on("click","#gotop",(function(t){t.preventDefault(),e("html, body").animate({scrollTop:0},800)}))},t.CrossSellsProductCarousel=function(){var t=e(".woocommerce-cart .cross-sells");if(t.length){var a=t.find("ul.products");a.wrap('<div class="related-product__carousel"></div>'),a.after('<span class="shopwell-svg-icon swiper-button shopwell-swiper-button-prev shopwell-swiper-button"><svg viewBox="0 0 32 32"><path d="M20.58 2.58l2.84 2.84-10.6 10.58 10.6 10.58-2.84 2.84-13.4-13.42z"></path></svg></span>'),a.after('<span class="shopwell-svg-icon swiper-button shopwell-swiper-button-next shopwell-swiper-button"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>'),a.after('<div class="swiper-pagination"></div>'),a.wrap('<div class="swiper-container linked-products-carousel" style="opacity: 0;"></div>'),a.addClass("swiper-wrapper"),a.find("li.product").addClass("swiper-slide");var o=a.hasClass("product-card-layout-3")||a.hasClass("product-card-layout-5")?24:0,s={loop:!1,autoplay:!1,speed:800,watchSlidesVisibility:!0,watchOverflow:!0,slidesPerView:5,navigation:{nextEl:t.find(".shopwell-swiper-button-next").get(0),prevEl:t.find(".shopwell-swiper-button-prev").get(0)},pagination:{el:t.find(".swiper-pagination").get(0),type:"bullets",clickable:!0},on:{init:function(){this.$el.css("opacity",1)}},spaceBetween:0,breakpoints:{300:{slidesPerView:""==shopwellData.mobile_product_columns?2:parseInt(shopwellData.mobile_product_columns),slidesPerGroup:""==shopwellData.mobile_product_columns?2:parseInt(shopwellData.mobile_product_columns)},768:{slidesPerView:4,spaceBetween:o},1200:{slidesPerView:5,spaceBetween:o}}};new Swiper(t.find(".linked-products-carousel").get(0),s)}},t.storeCategories=function(){setTimeout((function(){e(".dokan-store-sidebar .cat-drop-stack ul .children").addClass("dropdown").removeAttr("style")}),300)},t.fiboSearch=function(){t.$header.on("click",".fibo-search-icon",(function(t){t.preventDefault();var a=e("#fibo-search-modal").find(".js-dgwt-wcas-enable-mobile-form");a.length&&a[0].click()}))},t.historyBack=function(){t.$body.find(".shopwell-button--history").length&&t.$body.on("click",".shopwell-button--history",(function(t){""!=document.referrer&&(t.preventDefault(),window.history.go(-1),e(window).on("popstate",(function(e){window.location.reload(!0)})))}))},t.buttonPrint=function(){e(".shopwell-button--product-print").on("click",(function(){window.print()}))},t.copyLink=function(){e(".shopwell-copylink__button").on("click",(function(t){t.preventDefault(),e(this).closest("form").find(".shopwell-copylink__link").select(),document.execCommand ("copy")}))},t.productVariation=function(){var t=e(".single-product div.product .entry-summary .variations_form"),a=[];e(".single-product div.product").hasClass("has-instock-notifier")||e(".single-product div.product .entry-summary .variations_form:not(.product-select__variation)").on("wc_variation_form woocommerce_update_variation_values",(function(){if(t.length>0&&1==t.find("table.variations tbody .label").length){var e=t.data("product_variations");if(e.length>0)for(var o=0;o<e.length;o++)if(!e[o].is_in_stock){var s=Object.values(e[o].attributes)?Object.values(e[o].attributes)[0]:null;s&&!t.find('li[data-value="'+s+'"]').hasClass("disabled")&&a.push(s)}}setTimeout((function(){a.forEach((function(e){t.find('li[data-value="'+e+'"]').addClass("disabled")}))}),20)}))},e((function(){t.init()}))}(jQuery);