jQuery(document).ready(function(){
jQuery(document).on("click", ".cbr-country-widget", function(){
jQuery('.cbr-widget-popup').show();
});
jQuery(document).on("click", ".popup_close_icon, .popupclose", function(){
jQuery('.cbr-widget-popup').hide();
jQuery('.cbr-shortcode-popup').hide();
});
jQuery(document).on("click", ".cbr-country-shortcode", function(){
jQuery('.cbr-shortcode-popup').show();
});
jQuery(document).on("change", "#calc_shipping_country, #shipping_country", function(){
Cookies.set('country', jQuery(this).val());
set_customer_country_on_checkout_without_reload();
});
});
function setCountryCookie(cookieName, cookieValue, nDays){
var today=new Date();
var expire=new Date();
if(!nDays)
nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie=cookieName+"="+escape(cookieValue) + ";path=/;expires="+expire.toGMTString();
set_customer_country_on_checkout();
}
function set_customer_country_on_checkout(){
"use strict";
var country=jQuery(this).val();
var data={
action: 'set_widget_country',
country: country
};
jQuery.ajax({
url: cbr_ajax_object.cbr_ajax_url,
data: data,
type: 'POST',
dataType:"json",
success: function(response){
jQuery("#wp-admin-bar-cbr_item a.ab-item").text("CBR Country: "+response.country);
jQuery(".display-country-for-customer .country, .widget-country, .select-country-dropdown").val(response.countrycode);
jQuery(".cbr_shipping_country").text(response.country);
location.reload();
},
error: function(response){
console.log(response);
}});
return false;
}
function setCookie(cookieName, cookieValue, nDays){
var today=new Date();
var expire=new Date();
if(!nDays)
nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie=cookieName+"="+escape(cookieValue) + ";path=/;expires="+expire.toGMTString();
set_customer_country_on_checkout_without_reload();
}
function set_customer_country_on_checkout_without_reload(){
"use strict";
var country=jQuery(this).val();
var data={
action: 'set_widget_country',
country: country
};
jQuery.ajax({
url: cbr_ajax_object.cbr_ajax_url,
data: data,
type: 'POST',
dataType:"json",
success: function(response){
jQuery("#wp-admin-bar-cbr_item a.ab-item").text("CBR Country: "+response.country);
jQuery(".display-country-for-customer .country, .widget-country, .select-country-dropdown").val(response.countrycode);
jQuery(".cbr_shipping_country").text(response.country);
},
error: function(response){
}});
return false;
}
jQuery(document).on("submit", ".woocommerce-shipping-calculator", function(){
/*setTimeout(function(){
location.reload();
}, 3000);*/
var country=jQuery('#calc_shipping_country').val();
var data={
action: 'set_cart_page_country',
country: country
};
jQuery.ajax({
url: cbr_ajax_object.cbr_ajax_url,
data: data,
type: 'POST',
dataType:"json",
success: function(response){
jQuery("#wp-admin-bar-cbr_item a.ab-item").text("CBR Country: "+response.country);
jQuery(".display-country-for-customer .country, .widget-country, .select-country-dropdown").val(response.countrycode);
jQuery(".cbr_shipping_country").text(response.country);
},
error: function(response){
console.log(response);
}});
return false;
});
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(e){"use strict";var t,s={escapeRegExChars:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},formatHtml:function(e){return e.replace(/&/g,"&amp;").replace(/&amp;amp;/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/&lt;sup/g,"<sup").replace(/&lt;\/sup/g,"</sup").replace(/sup&gt;/g,"sup>").replace(/&lt;sub/g,"<sub").replace(/&lt;\/sub/g,"</sub").replace(/sub&gt;/g,"sub>").replace(/&lt;br\s?\/?&gt;/g,"<br/>").replace(/&lt;(\/?(strong|b|br|span|i))&gt;/g,"<$1>").replace(/&lt;(strong|span|i)\s+class\s*=\s*&quot;([^&]+)&quot;&gt;/g,'<$1 class="$2">')},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t.setAttribute("unselectable","on"),t},matchGreekAccents:function(e){if(!/[\u0370-\u03FF\u1F00-\u1FFF]+/.test(e))return e;for(let[t,s]of(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),Object.entries({Α:"Ά",α:"ά",Ε:"Έ",ε:"έ",Ι:"Ί",ι:"ί",ϊ:"ΐ",Υ:"Ύ",υ:"ύ",ϋ:"ΰ",Η:"Ή",η:"ή",Ο:"Ό",ο:"ό",Ω:"Ώ",ω:"ώ"})))e.indexOf(t)>-1&&(e=e.replaceAll(t,"["+t+s+"]"));return e},highlight:function(e,t){var a,o=t.split(/ /),i=!1,n="";if(o){for(a=0,n=o[o.length-1],o=o.sort(function(e,t){return t.length-e.length});a<o.length;a++)if(o[a]&&o[a].length>=1){var r=o[a].replace(/[\^\@]/g,"");if(r.length>0){if(1===r.trim().length&&o[a]!==n){var c="((\\s|^)"+s.escapeRegExChars(r.trim())+"\\s)";c=s.matchGreekAccents(c)}else if(1===r.trim().length&&o[a]===n){var c="((\\s|^)"+s.escapeRegExChars(r.trim())+")";c=s.matchGreekAccents(c)}else{var c="("+s.escapeRegExChars(r.trim())+")";c=s.matchGreekAccents(c)}e=e.replace(RegExp(c,"gi"),"^^$1@@"),i=!0}}}return i&&(e=(e=e.replace(/\^\^/g,"<strong>")).replace(/@@/g,"</strong>")),e},debounce:function(e,t){var s,o=new Date().getUTCMilliseconds();if(0===a.id.length){a.id=o,e();return}a.id=o,s=setTimeout(function(){if(o!==a.id){clearTimeout(s);return}e(),a.id=""},t)},mouseHoverDebounce:function(t,s,a){var o;o=setTimeout(function(){if(e(s+":hover").length>0)t();else{clearTimeout(o);return}},a)},isTextSelected:function(){var e=!1,t=document.getSelection();return"object"==typeof t&&t.toString().length>0&&(e=!0),e},getActiveInstance:function(){var t,s=e(".dgwt-wcas-search-wrapp.dgwt-wcas-active");return s.length>0&&s.each(function(){var s=e(this).find(".dgwt-wcas-search-input");if("object"==typeof s.data("autocomplete"))return t=s.data("autocomplete"),!1}),t},hashCode:function(e){for(var t=0,s=e.length;s>0;)t=(t<<5)-t+e.charCodeAt(--s)|0;return t<0?-1*t:t},isBrowser:function(e){return -1!==navigator.userAgent.indexOf(e)},isSafari:function(){return this.isBrowser("Safari")&&!this.isBrowser("Chrome")},isIOS:function(){var e=navigator?.userAgent||navigator?.platform||"unknown";return/iPhone|iPod|iPad/.test(e)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},isIE11:function(){return!!navigator.userAgent.match(/Trident\/7\./)},setLocalStorageItem:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(s){}},getLocalStorageItem:function(e,t){try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch(a){return t}},removeLocalStorageItem:function(e){try{window.localStorage.removeItem(e)}catch(t){}}},a={id:"",callback:null,ajaxSettings:null,object:null},o={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40},i=e.noop;function n(t,s){var a=this;a.element=t,a.el=e(t),a.suggestions=[],a.badQueries=[],a.selectedIndex=-1,a.currentValue=a.element.value,a.timeoutId=null,a.cachedResponse={},a.cachedDetails={},a.cachedPrices={},a.detailsRequestsSent=[],a.onChangeTimeout=null,a.onChange=null,a.isLocal=!1,a.suggestionsContainer=null,a.detailsContainer=null,a.autoAligmentprocess=null,a.noSuggestionsContainer=null,a.latestActivateSource="",a.actionTriggerSource="",a.options=e.extend(!0,{},n.defaults,s),a.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion",suggestionsContainerOrientTop:"dgwt-wcas-suggestions-wrapp--top",inputFilled:"dgwt-wcas-search-filled",darkenOverlayMounted:"js-dgwt-wcas-search-darkoverl-mounted",fixed:"dgwt-wcas-suggestions-wrapp-fixed",initialized:"dgwt-wcas-suggestions-wrapp-initialized"},a.hint=null,a.hintValue="",a.selection=null,a.overlayMobileState="off",a.overlayDarkenedState="off",a.isMouseDownOnSearchElements=!1,a.isPreSuggestionsMode=!1,a.voiceSearchRecognition=null,a.voiceSearchStarted=null,a.recentlyViewedProductsKey="fibosearch_recently_viewed_products",a.recentlySearchedPhrasesKey="fibosearch_recently_searched_phrases",a.initialize(),a.setOptions(s)}n.utils=s,e.DgwtWcasAutocompleteSearch=n,n.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,containerDetailsWidth:"auto",showDetailsPanel:!1,showImage:!1,showPrice:!1,showSKU:!1,showDescription:!1,showSaleBadge:!1,showFeaturedBadge:!1,dynamicPrices:!1,saleBadgeText:"sale",featuredBadgeText:"featured",minChars:3,maxHeight:600,dpusbBreakpoint:550,deferRequestBy:0,params:{},formatResult:function e(t,a,o){return a.length>0&&o&&(t=s.highlight(t,a)),s.formatHtml(t)},delimiter:null,zIndex:999999999,type:"GET",noCache:!1,isRtl:!1,onSearchStart:i,onSearchComplete:i,onSearchError:i,preserveInput:!1,searchFormClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",preSuggestionsWrappClass:"dgwt-wcas-pre-suggestions-wrapp",darkenedOverlayClass:"dgwt-wcas-darkened-overlay",searchInputClass:"dgwt-wcas-search-input",preloaderClass:"dgwt-wcas-preloader",closeTrigger:"dgwt-wcas-close",formClass:"dgwt-wcas-search-form",voiceSearchClass:"dgwt-wcas-voice-search",voiceSearchSupportedClass:"dgwt-wcas-voice-search-supported",voiceSearchActiveClass:"dgwt-wcas-voice-search-active",voiceSearchDisabledClass:"dgwt-wcas-voice-search-disabled",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,isPremium:!1,overlayMobile:!1,preventBadQueries:!0,lookupFilter:function e(t,s,a){return -1!==t.value.toLowerCase().indexOf(a)},paramName:"query",transformResult:function e(t){return"string"==typeof t?JSON.parse(t):t},noSuggestionNotice:"No results",forceFixPosition:!1,positionFixed:!1,debounceWaitMs:400,sendGAEvents:!0,enableGASiteSearchModule:!1,showProductVendor:!1,disableHits:!1,disableSubmit:!1,voiceSearchEnabled:!1,voiceSearchLang:"",showRecentlySearchedProducts:!1,showRecentlySearchedPhrases:!1,goToFirstVariationOnSubmit:!0},n.prototype={initialize:function(){var t=this;t.element.setAttribute("autocomplete","off"),t.options.params=t.applyCustomParams(t.options.params),t.createContainers(),t.registerEventsSearchBar(),t.registerEventsSuggestions(),t.registerEventsDetailsPanel(),t.registerIconHandler(),t.registerFlexibleLayout(),t.initVoiceSearch(),t.fixPosition=function(){t.adjustContainerWidth(),t.visible&&(t.fixPositionSuggestions(),t.canShowDetailsPanel()&&t.fixPositionDetailsPanel()),t.positionOverlayDarkened()},e(window).on("resize.autocomplete",function(){var e=s.getActiveInstance();clearTimeout(window.dgwt_wcas.resizeOnlyOnce),void 0!==e&&(window.dgwt_wcas.resizeOnlyOnce=setTimeout(function(){e.fixPosition()},100))}),e(window).on("scroll.autocomplete",function(){var e=s.getActiveInstance();clearTimeout(window.dgwt_wcas.scrollOnlyOnce),void 0!==e&&(window.dgwt_wcas.scrollOnlyOnce=setTimeout(function(){e.fixPosition()},100))});var a=e(window).width();e(window).on("resize.autocomplete",function(){var s=e(window).width();s!=a&&(t.toggleMobileOverlayMode(),a=s)}),t.isBreakpointReached("mobile-overlay")&&t.activateMobileOverlayMode(),t.hideAfterClickOutsideListener(),t.getFormWrapper().addClass(t.classes.initialized),t.suggestionsContainer.addClass("js-dgwt-wcas-initialized"),t.detailsContainer&&t.detailsContainer.length>0&&t.detailsContainer.addClass("js-dgwt-wcas-initialized")},createContainers:function(t){var s=this,a=s.options;0==e("."+a.containerClass).length?(s.suggestionsContainer=e(n.utils.createNode(a.containerClass)),s.suggestionsContainer.appendTo(a.appendTo||"body"),s.suggestionsContainer.addClass("woocommerce"),!0===a.showImage&&s.suggestionsContainer.addClass("dgwt-wcas-has-img"),!0===a.showPrice&&s.suggestionsContainer.addClass("dgwt-wcas-has-price"),!0===a.showDescription&&s.suggestionsContainer.addClass("dgwt-wcas-has-desc"),!0===a.showSKU&&s.suggestionsContainer.addClass("dgwt-wcas-has-sku"),!0===a.showHeadings&&s.suggestionsContainer.addClass("dgwt-wcas-has-headings")):s.suggestionsContainer=e("."+s.options.containerClass),s.canShowDetailsPanel()&&(0==e("."+a.containerDetailsClass).length?(s.detailsContainer=e(n.utils.createNode(a.containerDetailsClass)),s.detailsContainer.appendTo(a.appendTo||"body"),s.detailsContainer.addClass("woocommerce")):s.detailsContainer=e("."+a.containerDetailsClass))},registerEventsSearchBar:function(){var t=this;t.el.on("fibosearch/ping",function(){t.el.addClass("fibosearch-pong")}),t.getForm().on("submit.autocomplete",function(s){if(t.options.disableSubmit)return s.preventDefault(),!1;var a=e(this).find("."+t.options.searchInputClass);if(a.length&&0===a.val().length)return s.preventDefault(),!1;t.options.goToFirstVariationOnSubmit&&t.suggestions.length>0&&e.each(t.suggestions,function(e,a){if(void 0!==a.type&&"product_variation"==a.type)return t.select(e),s.preventDefault(),!1}),t.options.showRecentlySearchedPhrases&&t.saveHistorySearches(a.val()),t.closeOverlayMobile()}),t.positionPreloaderAndMic(),e(window).on("load",function(){t.positionPreloaderAndMic()}),t.el.on("keydown.autocomplete",function(e){t.onKeyPress(e)}),t.el.on("keyup.autocomplete",function(e){t.onKeyUp(e)}),t.el.on("blur.autocomplete",function(){t.onBlur()}),t.el.on("focus.autocomplete",function(e){t.onFocus(e)}),t.el.on("change.autocomplete",function(e){t.onKeyUp(e)}),t.el.on("input.autocomplete",function(e){t.onKeyUp(e)})},registerEventsSuggestions:function(){var t=this,a="."+t.classes.suggestion;if(!t.getSuggestionsContainer().hasClass("js-dgwt-wcas-initialized")){e(document).on("mouseenter.autocomplete",a,function(){var t=s.getActiveInstance();if(void 0!==t){var a=e(this).data("index"),o=t.canShowDetailsPanel()?100:1;if(t.selectedIndex!=a){if("headline"==t.suggestions[a].type||"headline-v2"==t.suggestions[a].type)return;s.mouseHoverDebounce(function(){t.selectedIndex!==a&&(t.latestActivateSource="mouse",t.getDetails(t.suggestions[a]),t.activate(a))},'.dgwt-wcas-suggestion[data-index="'+a+'"]',o)}}});var o=!1;e(document).on("click.autocomplete",a,function(t){if(o)t.preventDefault();else{var a=s.getActiveInstance();a.actionTriggerSource="click",o=!0,setTimeout(function(){o=!1},500),(void 0===t.ctrlKey||!1===t.ctrlKey)&&(a.select(e(this).data("index")),t.preventDefault())}}),e(document).on("mousedown.autocomplete",a,function(t){var a=this;0===t.button&&setTimeout(function(){!o&&s.getActiveInstance().select(e(a).data("index"))},250)}),e("."+t.options.containerClass).on("mousedown.autocomplete",function(e){s.getActiveInstance().isMouseDownOnSearchElements=!0}),e(document).on("click",".js-dgwt-wcas-sugg-hist-clear",function(){t.resetPreSuggestions()})}},registerEventsDetailsPanel:function(){var t=this.getDetailsContainer();!(!this.canShowDetailsPanel()||t.hasClass("js-dgwt-wcas-initialized"))&&(e(document).on("change.autocomplete",'[name="js-dgwt-wcas-quantity"]',function(t){e(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",e(this).val())}),e("."+this.options.containerDetailsClass).on("mousedown.autocomplete",function(e){s.getActiveInstance().isMouseDownOnSearchElements=!0}))},registerIconHandler:function(){var t=this,s=t.getFormWrapper(),a=t.getForm();s.on("click.autocomplete",".js-dgwt-wcas-search-icon-handler",function(e){var o=s.find("."+t.options.searchInputClass);if(s.hasClass("dgwt-wcas-layout-icon-open"))t.hide(),a.hide(!0),s.removeClass("dgwt-wcas-layout-icon-open");else{var i=s.find(".dgwt-wcas-search-icon-arrow");a.hide(),i.hide(),s.addClass("dgwt-wcas-layout-icon-open"),t.positionIconSearchMode(s),a.fadeIn(50,function(){i.show(),t.positionPreloaderAndMic(s);var e=t.currentValue.length;e>0&&o[0].setSelectionRange(e,e),o.trigger("focus")}),setTimeout(function(){t.fixPosition()},110)}return!1}),0==e(".js-dgwt-wcas-initialized").length&&e(".js-dgwt-wcas-search-icon-handler").length>0&&e(document).on("click.autocomplete",function(s){if(e(".dgwt-wcas-layout-icon-open").length){var a=e(s.target);a.closest("."+t.options.searchFormClass).length>0||a.closest("."+t.options.containerClass).length>0||a.closest("."+t.options.containerDetailsClass).length>0||a.hasClass("js-dgwt-wcas-sugg-hist-clear")||t.hideIconModeSearch()}})},registerFlexibleLayout:function(){var t=this,s=e(window).width();e(window).on("resize.autocomplete",function(){var a=e(window).width();a!=s&&(t.reloadFlexibleLayout(),s=a)}),t.reloadFlexibleLayout(),e(window).on("load.autocomplete",function(){t.reloadFlexibleLayout()})},activateMobileOverlayMode:function(){var e=this,t=e.getFormWrapper(),s=t.find(".js-dgwt-wcas-search-icon-handler");if(t.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&!t.find(".js-dgwt-wcas-enable-mobile-form").length){var a="string"==typeof dgwt_wcas.labels.mob_overlay_label?dgwt_wcas.labels.mob_overlay_label:"";t.prepend('<a href="#" aria-label="'+a+'" class="js-dgwt-wcas-enable-mobile-form dgwt-wcas-enable-mobile-form"></a>'),t.addClass("dgwt-wcas-mobile-overlay-trigger-active"),s.length&&s.attr("tabindex","-1"),t.find(".js-dgwt-wcas-enable-mobile-form").on("click.autocomplete",function(t){return e.options.mobileOverlayDelay>0?setTimeout(function(){e.showMobileOverlay()},e.options.mobileOverlayDelay):e.showMobileOverlay(),!1})}},deactivateMobileOverlayMode:function(){var e=this.getFormWrapper(),t=e.find(".js-dgwt-wcas-search-icon-handler"),s=e.find(".js-dgwt-wcas-enable-mobile-form");e.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&s.length&&(this.closeOverlayMobile(),s.remove(),e.removeClass("dgwt-wcas-mobile-overlay-trigger-active"),t.length&&t.removeAttr("tabindex"))},toggleMobileOverlayMode:function(){var e=this.getFormWrapper(),t=!1;if(e.hasClass("js-dgwt-wcas-mobile-overlay-enabled")){if(e.find(".js-dgwt-wcas-enable-mobile-form").length&&(t=!0),!t&&this.isBreakpointReached("mobile-overlay")||t&&!this.isBreakpointReached("mobile-overlay")){var s=this.getSuggestionsContainer();this.close(!1),s.length&&s.html(""),this.hideIconModeSearch()}!t&&this.isBreakpointReached("mobile-overlay")&&this.activateMobileOverlayMode(),t&&!this.isBreakpointReached("mobile-overlay")&&this.deactivateMobileOverlayMode()}},showMobileOverlay:function(){var t=this;if("on"!==t.overlayMobileState){t.overlayMobileState="on";var s,a=t.getFormWrapper(),o=t.getSuggestionsContainer(),i="";e("html").addClass("dgwt-wcas-overlay-mobile-on"),e("html").addClass("dgwt-wcas-open-"+t.getSearchStyle()),i+='<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">',i+='<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">',i+='<button class="dgwt-wcas-om-return js-dgwt-wcas-om-return">',"string"==typeof dgwt_wcas.back_icon&&(i+=dgwt_wcas.back_icon),i+="</button>",i+="</div>",i+="</div>",e(t.options.mobileOverlayWrapper).append(i),(s=e(".js-dgwt-wcas-overlay-mobile")).css("zIndex",99999999999),a.after('<span class="js-dgwt-wcas-om-hook"></span>'),a.appendTo(".js-dgwt-wcas-om-bar"),o.appendTo(".js-dgwt-wcas-om-bar"),a.addClass("dgwt-wcas-search-wrapp-mobile"),a.hasClass("dgwt-wcas-has-submit")&&(a.addClass("dgwt-wcas-has-submit-off"),a.removeClass("dgwt-wcas-has-submit")),a.find("."+t.options.searchInputClass).trigger("focus"),e(document).on("click.autocomplete",".js-dgwt-wcas-om-return",function(e){t.closeOverlayMobile(s)}),document.dispatchEvent(new CustomEvent("fibosearch/show-mobile-overlay",{detail:t}))}},closeOverlayMobile:function(t){var s=this;if(!e("html").hasClass("dgwt-wcas-overlay-mobile-on")){s.overlayMobileState="off";return}var a=s.getSuggestionsContainer(),o=e(".js-dgwt-wcas-om-bar").find("."+s.options.searchFormClass);o.hasClass("dgwt-wcas-has-submit-off")&&(o.removeClass("dgwt-wcas-has-submit-off"),o.addClass("dgwt-wcas-has-submit")),o.removeClass("dgwt-wcas-search-wrapp-mobile"),e("html").removeClass("dgwt-wcas-overlay-mobile-on"),e("html").removeClass("dgwt-wcas-open-"+s.getSearchStyle()),a.appendTo("body"),a.removeAttr("body-scroll-lock-ignore"),e(".js-dgwt-wcas-om-hook").after(o),e(".js-dgwt-wcas-overlay-mobile").remove(),e(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){o.find("."+s.options.searchInputClass).val("");var e=o.find(".dgwt-wcas-close");o.length>0&&(e.removeClass("dgwt-wcas-close"),e.html("")),s.hide()},150),s.overlayMobileState="off",document.dispatchEvent(new CustomEvent("fibosearch/hide-mobile-overlay",{detail:s}))},reloadFlexibleLayout:function(){var e=this.getFormWrapper(),t=0,s=e.find(".dgwt-wcas-icon-preloader");e.hasClass("js-dgwt-wcas-layout-icon-flexible")&&(t=1),e.hasClass("js-dgwt-wcas-layout-icon-flexible-inv")&&(t=2),t>0&&(1===t&&this.isBreakpointReached("search-layout")||2===t&&!this.isBreakpointReached("search-layout")?(e.addClass("js-dgwt-wcas-layout-icon"),e.addClass("dgwt-wcas-layout-icon")):(e.removeClass("js-dgwt-wcas-layout-icon"),e.removeClass("dgwt-wcas-layout-icon")),e.addClass("dgwt-wcas-layout-icon-flexible-loaded"),s.length&&s.remove())},onFocus:function(t){var s=this.getFormWrapper();e("."+this.options.searchFormClass).removeClass("dgwt-wcas-active"),s.addClass("dgwt-wcas-active"),e("body").addClass("dgwt-wcas-focused"),s.addClass("dgwt-wcas-search-focused"),0==e(t.target).closest(".dgwt-wcas-search-wrapp-mobile").length&&this.enableOverlayDarkened(),this.fixPosition(),0===this.el.val().length?this.canShowPreSuggestions()&&this.showPreSuggestions():this.el.val().length>=this.options.minChars&&this.onValueChange()},onBlur:function(){var t=this.options,a=this.el.val(),o=this.getQuery(a),i=!1;e("body").removeClass("dgwt-wcas-focused"),e("."+t.searchFormClass).removeClass("dgwt-wcas-search-focused"),s.isIOS()&&e("html").hasClass("dgwt-wcas-overlay-mobile-on")&&(i=!0),!(this.isMouseDownOnSearchElements||i)&&(this.hide(),this.selection&&this.currentValue!==o&&(t.onInvalidateSelection||e.noop).call(this.element)),document.dispatchEvent(new CustomEvent("fibosearch/close",{detail:this}))},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(t){var s=this,a=s.getSuggestionsContainer(),o=e.extend({},s.options,t);s.isLocal=Array.isArray(o.lookup),s.isLocal&&(o.lookup=s.verifySuggestionsFormat(o.lookup)),a.css({"max-height":s.canShowDetailsPanel()?"none":o.maxHeight+"px","z-index":o.zIndex}),s.canShowDetailsPanel()&&s.getDetailsContainer().css({"z-index":o.zIndex-1}),o.onSearchComplete=function(){s.getFormWrapper().removeClass("dgwt-wcas-processing"),s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.showCloseButton()},this.options=o},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},this.badQueries=[]},clear:function(e){e&&this.clearCache(),this.currentValue="",this.suggestions=[]},close:function(e){var t=this.el.closest("."+this.options.searchFormClass).find("."+this.options.searchInputClass),s=this.getFormWrapper();this.hide(),this.clear(!1),this.hideCloseButton(),t.val(""),s.removeClass(this.classes.inputFilled),e&&t.trigger("focus")},fixPositionSuggestions:function(){var e=this.getSuggestionsContainer(),t=this.getForm(),s=this.el,a=this.getElementInfo(t),o=this.getElementInfo(s),i={top:o.top+o.height,left:a.left};this.ancestorHasPositionFixed(t)?(i.top=o.topViewPort+o.height,e.addClass(this.classes.fixed)):e.removeClass(this.classes.fixed),this.getSuggestionsContainer().css(i)},fixPositionDetailsPanel:function(){var t=this.getFormWrapper(),s=this.getSuggestionsContainer(),a=this.getDetailsContainer(),o=this.getForm(),i=this.el,n=this.getElementInfo(o),r=this.getElementInfo(i),c={top:r.top+r.height,left:n.left+s.outerWidth(!1)};if(this.ancestorHasPositionFixed(t)?(c.top=r.topViewPort+r.height,a.addClass(this.classes.fixed)):a.removeClass(this.classes.fixed),a.css(c),e("body").removeClass("dgwt-wcas-full-width dgwt-wcas-details-outside dgwt-wcas-details-right dgwt-wcas-details-left dgwt-wcas-details-notfit"),t.outerWidth()>=this.options.dpusbBreakpoint){e("body").addClass("dgwt-wcas-full-width"),!0===this.options.isRtl&&(c.left=n.left+a.outerWidth(!1),s.css("left",c.left),a.css("left",n.left));return}var l=e(window).width(),d=a.outerWidth(),g=a.offset();e("body").addClass("dgwt-wcas-details-outside dgwt-wcas-details-right"),l<g.left+d&&(e("body").removeClass("dgwt-wcas-details-right"),e("body").addClass("dgwt-wcas-details-left"),c.left=s.offset().left-a.outerWidth(!1),a.css("left",c.left),g=a.offset()),g.left<1&&(e("body").removeClass("dgwt-wcas-details-left dgwt-wcas-details-right"),e("body").addClass("dgwt-wcas-details-notfit"))},fixHeight:function(){var e=this.getSuggestionsContainer(),t=this.getDetailsContainer();if(e.css("height","auto"),t.css("height","auto"),!this.canShowDetailsPanel())return e.css("height","auto"),!1;var s=e.outerHeight(!1),a=t.outerHeight(!1);return e.find(".dgwt-wcas-suggestion:last-child").removeClass("dgwt-wcas-suggestion-no-border-bottom"),(!(s<=340)||!(a<=340))&&(e.find(".dgwt-wcas-suggestion:last-child").addClass("dgwt-wcas-suggestion-no-border-bottom"),a<s&&t.css("height",s+"px"),s<a&&e.css("height",a+"px"),!1)},automaticAlignment:function(){var e=this,t=e.getFormWrapper().find(".dgwt-wcas-search-input"),s=e.getSuggestionsContainer(),a=e.getDetailsContainer();if(null==e.autoAligmentprocess){var o=[t.width(),s.height()];e.canShowDetailsPanel()&&(o[2]=a.height()),e.autoAligmentprocess=setInterval(function(){var i=[t.width(),s.height()];e.canShowDetailsPanel()&&(i[2]=a.height());for(var n=0;n<o.length;n++)if(o[n]!=i[n]){e.fixHeight(),e.fixPosition(),o=i;break}e.canShowDetailsPanel()&&a.find(".dgwt-wcas-details-inner").height()-a.height()>2&&e.fixHeight()},10)}},getElementInfo:function(e){var t,s,a={};return t=e[0].getBoundingClientRect(),s=e.offset(),a.left=s.left,a.top=s.top,a.width=e.outerWidth(!1),a.height=e.outerHeight(!1),a.right=a.left+a.width,a.bottom=a.top+a.height,a.topViewPort=t.top,a.bottomViewPort=t.top+a.height,a},getFormWrapper:function(){return this.el.closest("."+this.options.searchFormClass)},getForm:function(){return this.el.closest("."+this.options.formClass)},getSuggestionsContainer:function(){return e("."+this.options.containerClass)},getDetailsContainer:function(){return e("."+this.options.containerDetailsClass)},scrollDownSuggestions:function(){var e=this.getSuggestionsContainer();e[0].scrollTop=e[0].scrollHeight},isCursorAtEnd:function(){var e,t=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===t:!document.selection||((e=document.selection.createRange()).moveStart("character",-t),t===e.text.length)},onKeyPress:function(t){var s=this,a=s.getFormWrapper();if(s.addActiveClassIfMissing(),!s.visible&&t.keyCode===o.DOWN&&s.currentValue){s.suggest();return}if(!s.visible){t.keyCode===o.ESC&&a.hasClass("dgwt-wcas-layout-icon-open")&&s.hideIconModeSearch(),t.keyCode===o.ESC&&s.isMountedOverlayDarkened()&&(s.disableOverlayDarkened(),s.el.blur()),t.keyCode===o.ESC&&e("html").hasClass("dgwt-wcas-overlay-mobile-on")&&s.closeOverlayMobile();return}if((t.ctrlKey||t.metaKey)&&t.keyCode===o.RETURN){s.selectedIndex>-1&&s.openInNewTab(s.selectedIndex);return}switch(t.keyCode){case o.ESC:s.close();break;case o.RIGHT:if(s.hint&&s.options.onHint&&s.isCursorAtEnd()){s.selectHint();break}return;case o.TAB:break;case o.RETURN:if(-1===s.selectedIndex){if(s.options.disableSubmit)return!1;s.hide();return}s.actionTriggerSource="enter",s.select(s.selectedIndex);break;case o.UP:s.moveUp();break;case o.DOWN:s.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()},onKeyUp:function(e){var t=this;switch(e.keyCode){case o.UP:case o.DOWN:return}clearTimeout(t.onChangeTimeout),t.currentValue!==t.el.val()&&(t.options.deferRequestBy>0?t.onChangeTimeout=setTimeout(function(){t.onValueChange()},t.options.deferRequestBy):t.onValueChange())},onValueChange:function(){if(this.ignoreValueChange){this.ignoreValueChange=!1;return}var t=this,s=t.options,a=t.el.val(),o=t.getQuery(a),i=t.getFormWrapper();if(t.selection&&t.currentValue!==o&&(t.selection=null,(s.onInvalidateSelection||e.noop).call(t.element)),clearTimeout(t.onChangeTimeout),t.currentValue=a,t.selectedIndex=-1,s.triggerSelectOnValidInput&&t.isExactMatch(o)){t.select(0);return}o.length>0?i.hasClass(t.classes.inputFilled)||i.addClass(t.classes.inputFilled):i.removeClass(t.classes.inputFilled),o.length<s.minChars?(t.hideCloseButton(),t.hide(),t.canShowPreSuggestions()&&0===o.length&&t.showPreSuggestions()):(t.canShowPreSuggestions()&&t.hidePreSuggestions(),t.getSuggestions(o))},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},isNoResults:function(e){var t=!1;return void 0!==e&&1===e.length&&void 0!==e[0].type&&"no-results"===e[0].type&&(t=!0),t},canShowDetailsPanel:function(){var t=this.options.showDetailsPanel;return(768>e(window).width()||"ontouchend"in document||this.isPreSuggestionsMode||this.isNoResults(this.suggestions))&&(t=!1),t},isBreakpointReached:function(e){var t=0;switch(e){case"search-layout":t=this.options.layoutBreakpoint,this.isSetParam("layout_breakpoint")&&(t=Number.parseInt(this.getParam("layout_breakpoint")));break;case"mobile-overlay":t=this.options.mobileOverlayBreakpoint,this.isSetParam("mobile_overlay_breakpoint")&&(t=Number.parseInt(this.getParam("mobile_overlay_breakpoint")))}return window.innerWidth<=t},getQuery:function(t){var s,a=this.options.delimiter;return a?(s=t.split(a),e.trim(s[s.length-1])):t.trim()},getSuggestionsLocal:function(t){var s,a=this.options,o=t.toLowerCase(),i=a.lookupFilter,n=parseInt(a.lookupLimit,10);return s={suggestions:e.grep(a.lookup,function(e){return i(e,t,o)})},n&&s.suggestions.length>n&&(s.suggestions=s.suggestions.slice(0,n)),s},getSuggestions:function(t){var o,i,n,r,c=this,l=c.options,d=l.serviceUrl,g=c.getFormWrapper(),u=c.isActiveIconModeSearch();if(l.params[l.paramName]=t,void 0!==dgwt_wcas.current_lang&&(l.params.l=dgwt_wcas.current_lang),c.preloader("show","form","dgwt-wcas-inner-preloader"),g.addClass("dgwt-wcas-processing"),!1!==l.onSearchStart.call(c.element,l.params)){if(i=l.ignoreParams?null:l.params,"function"==typeof l.lookup){l.lookup(t,function(e){c.suggestions=e.suggestions,c.suggest(),c.selectFirstSuggestion(e.suggestions),l.onSearchComplete.call(c.element,t,e.suggestions)});return}e("body").hasClass("dgwt-wcas-open")||document.dispatchEvent(new CustomEvent("fibosearch/open",{detail:c})),c.isLocal?o=c.getSuggestionsLocal(t):("function"==typeof d&&(d=d.call(c.element,t)),n=d+"?"+e.param(i||{}),o=c.cachedResponse[n]),o&&Array.isArray(o.suggestions)?(c.suggestions=o.suggestions,c.suggest(),c.selectFirstSuggestion(o.suggestions),l.onSearchComplete.call(c.element,t,o.suggestions),c.isNoResults(o.suggestions)?document.dispatchEvent(new CustomEvent("fibosearch/no-results",{detail:c})):document.dispatchEvent(new CustomEvent("fibosearch/show-suggestions",{detail:c}))):c.isBadQuery(t)?l.onSearchComplete.call(c.element,t,[]):(c.abortAjax(),r={url:d,data:i,type:l.type,dataType:l.dataType},e.extend(r,l.ajaxSettings),a.object=c,a.ajaxSettings=r,s.debounce(function(){var s=a.object,o=a.ajaxSettings;s.currentRequest=e.ajax(o).done(function(e){var a;(!u||s.isActiveIconModeSearch())&&(s.currentRequest=null,void 0!==(a=s.options.transformResult(e,t)).suggestions&&(s.processResponse(a,t,n),s.selectFirstSuggestion(a.suggestions),s.isNoResults(a.suggestions)?s.gaEvent(t,"Autocomplete Search without results"):s.gaEvent(t,"Autocomplete Search with results")),s.fixPosition(),s.options.onSearchComplete.call(s.element,t,a.suggestions),s.updatePrices(),s.isNoResults(a.suggestions)?document.dispatchEvent(new CustomEvent("fibosearch/no-results",{detail:s})):document.dispatchEvent(new CustomEvent("fibosearch/show-suggestions",{detail:s})))}).fail(function(e,a,o){s.options.onSearchError.call(s.element,t,e,a,o)})},l.debounceWaitMs))}},getDetails:function(t){var s=this;if(!s.canShowDetailsPanel())return!1;if(null!=t&&void 0!==t.type&&("string"!=typeof t.type||"more_products"!==t.type)){s.fixHeight(),s.getDetailsContainer();var a,o=s.prepareSuggestionObjectID(t);if(null!=(a=s.cachedDetails[o]))s.detailsPanelSetScene(o),s.fixHeight(),s.fixPosition();else{var i={action:dgwt_wcas.action_result_details,items:[]};if(e.each(s.suggestions,function(e,t){if(void 0!==t.type&&"more_products"!=t.type&&"headline"!=t.type){var a={objectID:s.prepareSuggestionObjectID(t),value:null!=t.value?t.value:""};i.items.push(a)}}),s.detailsPanelClearScene(),s.preloader("show","details",""),-1!=e.inArray(o,s.detailsRequestsSent))return;s.detailsRequestsSent.push(o),e.ajax({data:i,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(e){var t="string"==typeof e?JSON.parse(e):e;if(void 0!==t.items)for(var a=0;a<t.items.length;a++){var o=t.items[a].objectID;s.cachedDetails[o]={html:t.items[a].html},s.detailsPanelAddToScene(o),void 0!==t.items[a].price&&t.items[a].price.length>0&&(s.cachedPrices[o]=t.items[a].price)}s.preloader("hide","details","");var i=s.prepareSuggestionObjectID(s.suggestions[s.selectedIndex]);null!=s.cachedDetails[i]?s.detailsPanelSetScene(i):s.detailsPanelClearScene(),s.fixPosition(),s.fixHeight(),s.updatePrices(!0)},error:function(e,t){s.preloader("hide","details",""),s.detailsPanelClearScene(),s.fixPosition(),s.fixHeight()}})}e(document).trigger("dgwtWcasDetailsPanelLoaded",s)}},updatePrices:function(t){var s,a=this,o=[];if(a.options.showPrice&&a.options.dynamicPrices&&0!=a.suggestions.length){for(s=0;s<a.suggestions.length;s++)if(void 0!==a.suggestions[s].type&&("product"==a.suggestions[s].type||"product_variation"==a.suggestions[s].type)){var i="";i=void 0!==a.suggestions[s].variation_id?"product__"+a.suggestions[s].variation_id:"product__"+a.suggestions[s].post_id,void 0!==a.cachedPrices[i]?a.updatePrice(s,a.cachedPrices[i]):(a.applyPreloaderForPrice(s),void 0!==a.suggestions[s].variation_id?o.push(a.suggestions[s].variation_id):o.push(a.suggestions[s].post_id))}if(!t&&o.length>0){var n={action:void 0===dgwt_wcas.action_get_prices?"dgwt_wcas_get_prices":dgwt_wcas.action_get_prices,items:o};e.ajax({data:n,type:"post",url:dgwt_wcas.ajax_prices_endpoint,success:function(e){if(void 0!==e.success&&e.success&&Object.keys(e.data).length>0&&a.suggestions.length>0)for(s=0;s<a.suggestions.length;s++)void 0!==a.suggestions[s].type&&"product"===a.suggestions[s].type&&"string"==typeof e.data[a.suggestions[s].post_id]?(i="product__"+a.suggestions[s].post_id,a.cachedPrices[i]=e.data[a.suggestions[s].post_id],a.updatePrice(s,e.data[a.suggestions[s].post_id])):void 0!==a.suggestions[s].type&&"product_variation"===a.suggestions[s].type&&void 0!==a.suggestions[s].variation_id&&"string"==typeof e.data[a.suggestions[s].variation_id]&&(i="product__"+a.suggestions[s].variation_id,a.cachedPrices[i]=e.data[a.suggestions[s].variation_id],a.updatePrice(s,e.data[a.suggestions[s].variation_id]))},error:function(e,t){}})}}},updatePrice:function(t,s){var a=this;if(void 0!==a.suggestions[t]){a.suggestions[t].price=s;var o=e(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+t+'"] .dgwt-wcas-sp');o.length&&o.html(s)}},applyCustomParams:function(e){if("object"==typeof dgwt_wcas.custom_params){var t=dgwt_wcas.custom_params;for(var s in t)e[s]=t[s]}var a=this.el.data("custom-params");if("object"==typeof a)for(var s in a)e[s]=a[s];return e},isSetParam:function(e){return void 0!==this.options.params[e]},getParam:function(e){return this.isSetParam(e)?this.options.params[e]:""},applyPreloaderForPrice:function(t){if(void 0!==this.suggestions[t]){var s=e(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+t+'"] .dgwt-wcas-sp');s.length&&s.html('<div class="dgwt-wcas-preloader-price"><div class="dgwt-wcas-preloader-price-inner"> <div></div><div></div><div></div></div></div>')}},prepareSuggestionObjectID:function(e){var t="";return void 0!==e&&void 0!==e.type&&(null!=e.post_id&&(t=e.type+"__"+e.post_id,"product_variation"===e.type&&(t+="__"+e.variation_id),void 0!==e.post_type&&(t=e.type+"__"+e.post_id+"__"+e.post_type)),null!=e.term_id&&null!=e.taxonomy&&(t=e.type+"__"+e.term_id+"__"+e.taxonomy)),t},detailsPanelSetScene:function(e){var t=this.getDetailsContainer(),a=s.hashCode(e),o=t.find('.dgwt-wcas-details-inner[data-object="'+a+'"]');document.dispatchEvent(new CustomEvent("fibosearch/show-details-panel",{detail:this})),o.length&&(this.preloader("hide","details",""),this.detailsPanelClearScene(),o.addClass("dgwt-wcas-details-inner-active"))},detailsPanelAddToScene:function(e){var t=this.getDetailsContainer(),a=this.cachedDetails[e],o=s.hashCode(e),i="";void 0!==a&&"string"==typeof a.html&&(i=a.html.replace("<div ",'<div data-object="'+o+'" ')),0==t.find('.dgwt-wcas-details-inner[data-object="'+o+'"]').length&&t.append(i)},detailsPanelClearScene:function(){var e=this.getDetailsContainer().find(".dgwt-wcas-details-inner");e.length&&e.removeClass("dgwt-wcas-details-inner-active")},selectFirstSuggestion:function(t){var s=this,a=0,o=!1;if(s.canShowDetailsPanel())"undefined"!=t&&t.length>0&&e.each(s.suggestions,function(e,t){if(void 0!==t.type&&"more_products"!=t.type&&"headline"!=t.type&&"headline-v2"!=t.type&&"no-results"!=t.type)return a=e,!1;(void 0===t.type||"no-results"===t.type)&&(o=!0)}),!o&&(s.latestActivateSource="system",s.getDetails(t[a]),s.activate(a))},isBadQuery:function(e){if(!this.options.preventBadQueries)return!1;for(var t=this.badQueries,s=t.length;s--;)if(0===e.indexOf(t[s]))return!0;return!1},hide:function(t){var s=this,a=s.getSuggestionsContainer(),o=s.getDetailsContainer();if("function"==typeof s.options.onHide&&s.visible&&s.options.onHide.call(s.element,container),s.visible=!1,s.selectedIndex=-1,clearTimeout(s.onChangeTimeout),a.hide(),a.removeClass(s.classes.suggestionsContainerOrientTop),a.removeClass(s.classes.fixed),s.canShowDetailsPanel()&&(o.hide(),o.removeClass(s.classes.fixed)),s.hidePreSuggestions(),e("body").removeClass("dgwt-wcas-open"),!e("html").hasClass("dgwt-wcas-overlay-mobile-on")){var i=s.getSearchStyle();e("html").removeClass("dgwt-wcas-open-"+i),"pirx"===i&&e("html").removeClass("dgwt-wcas-open-pirx-compact")}e("body").removeClass("dgwt-wcas-block-scroll"),e("body").removeClass("dgwt-wcas-is-details"),e("body").removeClass("dgwt-wcas-full-width"),e("body").removeClass("dgwt-wcas-nores"),e("body").removeClass("dgwt-wcas-details-outside"),e("body").removeClass("dgwt-wcas-details-right"),e("body").removeClass("dgwt-wcas-details-left"),null!=s.autoAligmentprocess&&(clearInterval(s.autoAligmentprocess),s.autoAligmentprocess=null),s.isMouseDownOnSearchElements=!1,"boolean"==typeof t&&t&&(s.hideCloseButton(),s.currentValue="",s.suggestions=[])},positionIconSearchMode:function(t){var s=-20,a=this.getForm(),o=a.width(),i=e(window).width(),n=t[0].getBoundingClientRect().left;s=Math.max(s=Math.floor(-1*(o*((n+10)/i))),-1*n),a.css({left:s+"px"})},isActiveIconModeSearch:function(){var t=!1;return e(".dgwt-wcas-layout-icon-open").length>0&&(t=!0),t},hideIconModeSearch:function(){this.isActiveIconModeSearch()&&!s.isTextSelected()&&e(".dgwt-wcas-layout-icon-open").removeClass("dgwt-wcas-layout-icon-open")},hideAfterClickOutsideListener:function(){var t=this;"ontouchend"in document||e(document).on("mouseup",function(s){if(t.visible){var a=!(e(s.target).closest("."+t.options.searchFormClass).length>0||e(s.target).hasClass(t.options.searchFormClass)),o=!(e(s.target).closest("."+t.options.containerClass).length>0||e(s.target).hasClass(t.options.containerClass));if(t.canShowDetailsPanel()){var i=!(e(s.target).closest("."+t.options.containerDetailsClass).length>0||e(s.target).hasClass(t.options.containerDetailsClass));a&&o&&i&&t.hide()}else a&&o&&t.hide()}})},suggest:function(){if(!this.suggestions.length){this.hide();return}var t,s=this,a=s.options,o=a.groupBy,i=a.formatResult,n=s.getQuery(s.currentValue),r=s.classes.suggestion,c=s.classes.selected,l=s.getSuggestionsContainer(),d=s.getDetailsContainer(),g=e(s.noSuggestionsContainer),u=a.beforeRender,h="",p=function(e,s){var a=e.data[o];return t===a?"":'<div class="autocomplete-group"><strong>'+(t=a)+"</strong></div>"};if(a.triggerSelectOnValidInput&&s.isExactMatch(n)){s.select(0);return}e("body").removeClass("dgwt-wcas-nores"),e.each(s.suggestions,function(t,c){var l="string"==typeof c.url&&c.url.length?c.url:"#";if(o&&(h+=p(c,n,t)),void 0===c.type||"product"!=c.type&&"product_variation"!=c.type){var g,u=r,w="dgwt-wcas-st",f="",v="",m="",y=!0;if("product_cat"===c.taxonomy?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",a.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>"),void 0!==c.breadcrumbs&&c.breadcrumbs&&(m=c.breadcrumbs+" &gt; "+c.value,v+='<span class="dgwt-wcas-st-breadcrumbs"><span class="dgwt-wcas-st-label-in">'+dgwt_wcas.labels.in+" </span>"+c.breadcrumbs+"</span>")):"product_tag"===c.taxonomy?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tag",a.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):a.isPremium&&c.taxonomy===a.taxonomyBrands?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-brand",a.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):a.isPremium&&"taxonomy"===c.type?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tax-"+c.taxonomy,a.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):a.isPremium&&"vendor"===c.type?(u+=" dgwt-wcas-suggestion-vendor dgwt-wcas-suggestion-vendor",a.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.vendor+"</span>")):a.isPremium&&"post"===c.type&&void 0!==c.post_type?(u+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-"+c.post_type,a.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["post_type_"+c.post_type]+"</span>")):"more_products"===c.type?(u+=" js-dgwt-wcas-suggestion-more dgwt-wcas-suggestion-more",w="dgwt-wcas-st-more",c.value=dgwt_wcas.labels.show_more+'<span class="dgwt-wcas-st-more-total"> ('+c.total+")</span>",y=!1):a.showHeadings&&"headline"===c.type&&(u+=" js-dgwt-wcas-suggestion-headline dgwt-wcas-suggestion-headline",void 0!==dgwt_wcas.labels[c.value+"_plu"]&&(c.value=dgwt_wcas.labels[c.value+"_plu"]),y=!1),"no-results"===c.type)e("body").addClass("dgwt-wcas-nores"),d.length&&(s.detailsPanelClearScene(),d.hide(),d.removeClass(s.classes.fixed),s.fixHeight()),c.value="",h+=s.createNoResultsContent();else{if((void 0!==c.image_src&&c.image_src||void 0!==c.image&&c.image)&&(g=!0),f+=s.apply3rdPartyPlaceholder("title_before",c),v+=s.apply3rdPartyPlaceholder("title_after",c),m=m.length>0?' title="'+m.replace(/>/g,"&gt;")+'"':"",h+='<a href="'+l+'" class="'+u+'" data-index="'+t+'">',g){let b=c.image_src?c.image_src:c.image;h+='<span class="dgwt-wcas-si"><img src="'+b+'" /></span>',h+='<div class="dgwt-wcas-content-wrapp">'}h+="<span"+m+' class="'+w+'">',"vendor"===c.type?(h+='<span class="dgwt-wcas-st-title">'+f+i(c.value,n,y,a)+v+"</span>",c.shop_city&&(h+='<span class="dgwt-wcas-vendor-city"><span> - </span>'+i(c.shop_city,n,!0,a)+"</span>"),void 0!==c.desc&&c.desc&&(h+='<span class="dgwt-wcas-sd">'+i(c.desc,n,!0,a)+"</span>")):h+=f+i(c.value,n,y,a)+v,h+="</span>",h+=g?"</div>":"",h+="</a>"}}else h+=s.createProductSuggestion(c,t)}),this.adjustContainerWidth(),g.detach(),l.html(h),"function"==typeof u&&u.call(s.element,l,s.suggestions),l.show(),e("body").addClass("dgwt-wcas-open");var w=s.getSearchStyle();e("html").addClass("dgwt-wcas-open-"+w),"pirx"===w&&e("html").addClass("dgwt-wcas-open-pirx-compact"),s.isMouseDownOnSearchElements=!1,s.automaticAlignment(),s.canShowDetailsPanel()&&(e("body").addClass("dgwt-wcas-is-details"),d.show(),s.fixHeight()),a.autoSelectFirst&&(s.selectedIndex=0,l.scrollTop(0),l.children("."+r).first().addClass(c)),s.visible=!0,s.fixPosition()},createNoResultsContent:function(){var e='<div class="dgwt-wcas-suggestion-nores">',t=void 0!==dgwt_wcas.labels.no_results_default?dgwt_wcas.labels.no_results_default:"";try{t=JSON.parse(dgwt_wcas.labels.no_results);var s=document.createElement("div");s.innerHTML=t,t=s.innerHTML}catch(a){}return e+=t,e+="</div>"},createProductSuggestion:function(e,t,s){var a="",o="",i=this.options,n=this.classes.suggestion,r=!1,c=this.getQuery(this.currentValue),l=i.formatResult,d="string"==typeof e.url&&e.url.length?e.url:"#";"string"==typeof s&&(n+=" "+s),!0===i.showImage&&void 0!==e.thumb_html&&(r=!0);var g="product_variation"===e.type?" dgwt-wcas-suggestion-product-var":"";if(o+=void 0!==e.post_id?'data-post-id="'+e.post_id+'" ':"",o+=void 0!==e.taxonomy?'data-taxonomy="'+e.taxonomy+'" ':"",o+=void 0!==e.term_id?'data-term-id="'+e.term_id+'" ':"",a+='<a href="'+d+'" class="'+n+" dgwt-wcas-suggestion-product"+g+'" data-index="'+t+'" '+o+">",r&&(a+='<span class="dgwt-wcas-si">'+e.thumb_html+"</span>"),a+=r?'<div class="dgwt-wcas-content-wrapp">':"",a+='<div class="dgwt-wcas-st">',a+=this.apply3rdPartyPlaceholder("title_before",e),a+='<span class="dgwt-wcas-st-title">'+l(e.value,c,!0,i)+"</span>",a+=this.apply3rdPartyPlaceholder("title_after",e),!0===i.showSKU&&void 0!==e.sku&&e.sku.length>0&&(a+='<span class="dgwt-wcas-sku">('+dgwt_wcas.labels.sku_label+" "+l(e.sku,c,!0,i)+")</span>"),!0===i.showDescription&&void 0!==e.desc&&e.desc&&(a+='<span class="dgwt-wcas-sd">'+l(e.desc,c,!0,i)+"</span>"),!0===i.showProductVendor&&void 0!==e.vendor&&e.vendor){var u='<span class="dgwt-wcas-product-vendor"><span class="dgwt-wcas-product-vendor-label">'+dgwt_wcas.labels.vendor_sold_by+" </span>"+e.vendor+"</span>";void 0!==e.vendor_url&&e.vendor_url?a+='<span class="dgwt-wcas-product-vendor-link" data-url="'+e.vendor_url+'">'+u+"</span>":a+=u}a+=this.apply3rdPartyPlaceholder("content_after",e),void 0!==e.score&&(a+='<div class="dgwt-wcas-score">Score: '+e.score+"</div>"),a+="</div>";var h=!0===i.showPrice&&void 0!==e.price,p=void 0!==e.meta_before,w=void 0!==e.meta_after,f=h||p||w;return a+=f?'<div class="dgwt-wcas-meta">':"",p&&(a+=this.apply3rdPartyPlaceholder("meta_before",e)),h&&(a+='<span class="dgwt-wcas-sp">'+e.price+"</span>"),w&&(a+=this.apply3rdPartyPlaceholder("meta_after",e)),a+=f?"</div>":"",a+=r?"</div>":"",a+="</a>"},apply3rdPartyPlaceholder:function(e,t){var s="";return void 0!==t[e]&&t[e]&&(s=t[e]),s},getSearchStyle:function(){var t=this.getFormWrapper(),s="solaris";return t&&0!==t.length&&(e(t?.attr("class")?.split(/\s+/)).each(function(e){/dgwt-wcas-style-/i.test(this)&&(s=this.replace(/dgwt-wcas-style-/i,""))}),"pirx-compact"===s&&(s="pirx")),s},adjustContainerWidth:function(){var e=this.getFormWrapper(),t=this.getSuggestionsContainer(),s=this.getDetailsContainer(),a=this.getForm().outerWidth();if(e.length&&(t.css("width",a+"px"),this.canShowDetailsPanel()&&a>=this.options.dpusbBreakpoint)){var o=0;t.css("width",a/2),s.css("width",a/2),0!=(o=a-(t.outerWidth()+s.outerWidth()))&&s.css("width",s.outerWidth()+o)}},positionPreloaderAndMic:function(t){var s=this,a="object"==typeof t?t.find(".dgwt-wcas-search-submit"):e(".dgwt-wcas-search-submit");a.length>0&&a.each(function(){var t=e(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader"),a=e(this).closest(".dgwt-wcas-search-wrapp").hasClass("dgwt-wcas-style-solaris"),o=e(this).closest(".dgwt-wcas-search-wrapp").hasClass(s.options.voiceSearchSupportedClass),i=e(this).closest(".dgwt-wcas-search-wrapp").find("."+s.options.voiceSearchClass);o&&a&&(1==dgwt_wcas.is_rtl?i.css("transform","translateX("+e(this).outerWidth()+"px)"):i.css("transform","translateX(-"+e(this).outerWidth()+"px)")),1==dgwt_wcas.is_rtl?t.css("left",e(this).outerWidth()+"px"):t.css("right",e(this).outerWidth()+"px")})},preloader:function(e,t,s){var a,o,i="dgwt-wcas-preloader-wrapp";if("form"===t){if(1!=dgwt_wcas.show_preloader)return;o=this.getFormWrapper().find(".dgwt-wcas-preloader")}else"details"===t&&(o=this.getDetailsContainer());if(0!=o.length){if("form"===t){"hide"===e?(o.removeClass(s),o.html("")):(o.addClass(s),"string"==typeof dgwt_wcas.preloader_icon&&o.html(dgwt_wcas.preloader_icon));return}var n=o.find("."+i);if("hide"===e){n.length&&n.remove();return}if("show"===e){var r=this.options.isRtl?"-rtl":"";a='<div class="'+(null==s?i:i+" "+s)+'"><img class="dgwt-wcas-placeholder-preloader" src="'+dgwt_wcas.img_url+"placeholder"+r+'.png" /></div>',this.detailsPanelClearScene(),n.length&&n.remove(),o.prepend(a)}}},verifySuggestionsFormat:function(t){return t.length&&"string"==typeof t[0]?e.map(t,function(e){return{value:e,data:null}}):t},processResponse:function(e,t,s){var a=this,o=a.options;e.suggestions=a.verifySuggestionsFormat(e.suggestions),o.noCache||(a.cachedResponse[s]=e,o.preventBadQueries&&!e.suggestions.length&&a.badQueries.push(t)),t===a.getQuery(a.currentValue)&&(a.suggestions=e.suggestions,a.suggest())},activate:function(t){var s,a=this,o=a.classes.selected,i=a.getSuggestionsContainer(),n=i.find("."+a.classes.suggestion);return(i.find("."+o).removeClass(o),a.selectedIndex=t,-1!==a.selectedIndex&&n.length>a.selectedIndex)?(e(s=n.get(a.selectedIndex)).addClass(o),s):null},selectHint:function(){var t=e.inArray(this.hint,this.suggestions);this.select(t)},select:function(e){!this.options.disableHits&&void 0!==this.suggestions[e]&&(void 0===this.suggestions[e]||"headline"!=this.suggestions[e].type&&"headline-v2"!=this.suggestions[e].type)&&(this.closeOverlayMobile(),this.hide(),this.onSelect(e))},moveUp:function(){var e=this;if(-1!==e.selectedIndex){if(e.latestActivateSource="key",0===e.selectedIndex){e.getSuggestionsContainer().children("."+e.classes.suggestion).first().removeClass(e.classes.selected),e.selectedIndex=-1,e.ignoreValueChange=!1,e.el.val(e.currentValue);return}e.adjustScroll(e.selectedIndex-1,"up")}},moveDown:function(){var e=this;e.selectedIndex!==e.suggestions.length-1&&(e.latestActivateSource="key",e.adjustScroll(e.selectedIndex+1,"down"))},adjustScroll:function(t,s){var a=this;if("headline"===a.suggestions[t].type&&(t="down"===s?t+1:t-1),void 0!==a.suggestions[t]){var o=a.activate(t);if(a.getDetails(a.suggestions[t]),!("more_products"===a.suggestions[t].type||!o||a.canShowDetailsPanel())){var i,n,r,c=a.getSuggestionsContainer(),l=e(o).outerHeight(!1);i=o.offsetTop,r=(n=c.scrollTop())+a.options.maxHeight-l,i<n?c.scrollTop(i):i>r&&c.scrollTop(i-a.options.maxHeight+l),a.options.preserveInput||(a.ignoreValueChange=!0)}}},onSelect:function(e){var t=this,s=t.options.onSelect,a=t.suggestions[e],o=!1;void 0!==a.type&&("more_products"!==a.type&&("enter"!==t.actionTriggerSource||"key"==t.latestActivateSource||"product_variation"==a.type)&&("enter"!==t.actionTriggerSource||"key"==t.latestActivateSource||"product_variation"!=a.type||t.options.goToFirstVariationOnSubmit)||(t.el.closest("form").trigger("submit"),o=!0),"history-search"===a.type&&(t.currentValue=t.getValue(a.value),t.currentValue===t.el.val()||t.options.preserveInput||t.el.val(t.currentValue.replace(/(<([^>]+)>)/gi," ").replace(/\s\s+/g," ")),t.el.closest("form").trigger("submit"),o=!0)),("product"===a.type||"product_variation"===a.type)&&t.options.showRecentlySearchedProducts&&t.saveHistoryProducts(a),o||(t.currentValue=t.getValue(a.value),t.currentValue===t.el.val()||t.options.preserveInput||t.el.val(t.currentValue.replace(/(<([^>]+)>)/gi," ").replace(/\s\s+/g," ")),a.url.length>0&&(window.location.href=a.url),t.suggestions=[],t.selection=a),"function"==typeof s&&s.call(t.element,a)},openInNewTab:function(e){var t=this.suggestions[e];t.url.length>0&&window.open(t.url,"_blank").trigger("focus")},getValue:function(e){var t,s,a=this.options.delimiter;return a&&1!==(s=(t=this.currentValue).split(a)).length?t.substr(0,t.length-s[s.length-1].length)+e:e},dispose:function(){var t=this.el,s=this.getFormWrapper(),a=this.getSuggestionsContainer(),o=s.find(".js-dgwt-wcas-enable-mobile-form");s.length&&s.find("*").each(function(){e(this).off(".autocomplete")}),t.off("fibosearch/ping"),s.off("click.autocomplete",".js-dgwt-wcas-search-icon-handler"),t.removeData("autocomplete"),e(window).off("resize.autocomplete",this.fixPosition),s.removeClass("dgwt-wcas-active"),this.close(!1),o.length&&o.remove(),a.length&&a.html("")},isMountedOverlayDarkened:function(){var e=this.getFormWrapper(),t=!1;return e.hasClass(this.classes.darkenOverlayMounted)&&(t=!0),t},enableOverlayDarkened:function(){var t,s=this,a=s.options;if(s.isMountedOverlayDarkened()){if((t=s.getFormWrapper()).addClass("dgwt-wcas-search-darkoverl-on"),e("body").addClass("dgwt-wcas-darkoverl-on"),0==e("."+a.darkenedOverlayClass).length){var o='<div class="'+a.darkenedOverlayClass+'"><div></div><div></div><div></div><div></div></div>';e("body").append(o);var i=e("."+s.options.darkenedOverlayClass);s.positionOverlayDarkened(),i.on("click.autocomplete",function(e){s.disableOverlayDarkened()})}s.overlayDarkenedState="on"}},disableOverlayDarkened:function(){var t,s=this,a=s.options;if(s.isMountedOverlayDarkened()){(t=e(".dgwt-wcas-search-darkoverl-on")).length&&t.removeClass("dgwt-wcas-search-darkoverl-on"),e("body").removeClass("dgwt-wcas-darkoverl-on");var o=e("."+a.darkenedOverlayClass);o.length>0&&(o.remove(),s.overlayDarkenedState="off")}},positionOverlayDarkened:function(){var t=this,s=!1,a=e("."+t.options.darkenedOverlayClass);a.length>0&&(t.ancestorHasPositionFixed(t.getFormWrapper())?(s=!0,a.addClass("dgwt-wcas-suggestions-wrapp-fixed")):a.removeClass("dgwt-wcas-suggestions-wrapp-fixed"),a.children("div").each(function(a){t.positionOverlayDarkenedDiv(e(this),a+1,s)}))},positionOverlayDarkenedDiv:function(t,s,a){var o,i,n=this.getFormWrapper();switch(n.hasClass("js-dgwt-wcas-layout-icon")&&(n=this.getForm()),o=this.getElementInfo(n),s){case 1:i={left:"-200px",top:"-200px",width:o.left+200+"px",height:e(document).outerHeight(!1)+200-1+"px"};break;case 2:var r=a?o.topViewPort:o.top;i={left:"-200px",top:"-200px",width:e(window).outerWidth(!1)+200+"px",height:r+200+"px"};break;case 3:i={left:o.left+o.width+"px",top:"-200px",width:e(window).outerWidth(!1)-o.right+"px",height:e(document).outerHeight(!1)+200-1+"px"};break;case 4:var r=a?o.topViewPort:o.top;i={left:"-200px",top:r+o.height+"px",width:e(window).outerWidth(!1)+200+"px",height:e(document).outerHeight(!1)-o.bottom-1+"px"}}i&&t.css(i)},showCloseButton:function(){var e=this,t=void 0!==dgwt_wcas.close_icon?dgwt_wcas.close_icon:"",s=e.getFormWrapper().find("."+e.options.preloaderClass);!(e.el.val().length<e.options.minChars)&&(s.hasClass(e.options.closeTrigger)||s.on("click.autocomplete",function(){e.close(!0)}),s.addClass(e.options.closeTrigger),s.html(t))},hideCloseButton:function(){var e=this.getFormWrapper().find("."+this.options.closeTrigger);e.length&&(e.removeClass(this.options.closeTrigger),e.html("")),e.off("click.autocomplete")},canShowPreSuggestions:function(){var e=!1;return(this.options.showRecentlySearchedProducts||this.options.showRecentlySearchedPhrases)&&(e=!0),e},showPreSuggestions:function(){var t,a=this,o=0,i="",n=a.getSuggestionsContainer(),r=a.getFormWrapper(),c=[],l=[],d=a.options.showImage;if(a.isPreSuggestionsMode=!0,a.suggestions=[],a.suggestionsContainer.addClass("dgwt-wcas-has-img"),d||a.suggestionsContainer.addClass("dgwt-wcas-has-img-forced"),a.options.showImage=!0,a.options.showRecentlySearchedProducts&&(c=s.getLocalStorageItem(a.recentlyViewedProductsKey,[])),a.options.showRecentlySearchedPhrases&&(l=s.getLocalStorageItem(a.recentlySearchedPhrasesKey,[])),0!==c.length||0!==l.length){if(a.suggestions.push({type:"headline-v2",value:""}),i+='<span class="dgwt-wcas-suggestion dgwt-wcas-suggestion-headline-v2" data-index="'+o+'">',void 0!==dgwt_wcas.labels.search_hist){var g=dgwt_wcas.labels.search_hist;g+=' <span class="js-dgwt-wcas-sugg-hist-clear dgwt-wcas-sugg-hist-clear">'+dgwt_wcas.labels.search_hist_clear+"</span>",i+='<span className="dgwt-wcas-st">'+g+"</span>"}if(i+="</span>",o++,c.length>0)for(t=0;t<c.length;t++)i+=a.createProductSuggestion(c[t],o,"dgwt-wcas-suggestion-history-product"),a.suggestions.push(c[t]),o++;if(l.length>0)for(t=0;t<l.length;t++){var u={type:"history-search",value:l[t],url:"#",thumb_html:dgwt_wcas.magnifier_icon};r.hasClass("dgwt-wcas-style-pirx")&&(u.thumb_html=dgwt_wcas.magnifier_icon_pirx),a.suggestions.push(u),i+='<a href="'+u.url+'" class="'+a.classes.suggestion+' dgwt-wcas-suggestion-history-search" data-index="'+o+'">',i+='<span class="dgwt-wcas-si">'+u.thumb_html+"</span>",i+='<div class="dgwt-wcas-content-wrapp">',i+='<div class="dgwt-wcas-st"><span class="dgwt-wcas-st-title">'+s.formatHtml(u.value)+"</span></div>",i+="</div>",i+="</a>",o++}n.html(i),n.show(),e("body").addClass("dgwt-wcas-open"),e("body").addClass("dgwt-wcas-open-pre-suggestions");var h=a.getSearchStyle();e("html").addClass("dgwt-wcas-open-"+a.getSearchStyle()),"pirx"===h&&e("html").addClass("dgwt-wcas-open-pirx-compact"),a.isMouseDownOnSearchElements=!1,a.visible=!0,a.fixPosition(),a.options.showImage=d,document.dispatchEvent(new CustomEvent("fibosearch/open",{detail:a})),document.dispatchEvent(new CustomEvent("fibosearch/show-pre-suggestions",{detail:a}))}},resetPreSuggestions:function(){var t=this,a=t.getSuggestionsContainer(),o=s.getActiveInstance();s.removeLocalStorageItem(t.recentlyViewedProductsKey),s.removeLocalStorageItem(t.recentlySearchedPhrasesKey),t.suggestions=[],a.html(""),e("body").removeClass("dgwt-wcas-open-pre-suggestions"),o.el.trigger("focus")},hidePreSuggestions:function(){var e=this;e.options.showImage||e.suggestionsContainer.removeClass("dgwt-wcas-has-img"),e.suggestionsContainer.removeClass("dgwt-wcas-has-img-forced"),e.isPreSuggestionsMode=!1},saveHistoryProducts:function(e){var t=this,a=s.getLocalStorageItem(t.recentlyViewedProductsKey,[]);a=[e,...a],a=[...new Map(a.map(e=>(void 0!==e.price&&delete e.price,t.options.showImage||(e.thumb_html=dgwt_wcas.history_icon),[e.post_id,e]))).values()],s.setLocalStorageItem(t.recentlyViewedProductsKey,a.slice(0,5))},saveHistorySearches:function(e){var t=s.getLocalStorageItem(this.recentlySearchedPhrasesKey,[]);t=[e,...t],t=[...new Set(t)],s.setLocalStorageItem(this.recentlySearchedPhrasesKey,t.slice(0,5))},addActiveClassIfMissing:function(){var t=document.activeElement;if("object"==typeof t&&e(t).length&&e(t).hasClass("dgwt-wcas-search-input")){var s=e(t).closest(".dgwt-wcas-search-wrapp");s.length&&!s.hasClass("dgwt-wcas-active")&&s.addClass("dgwt-wcas-active")}},ancestorHasPositionFixed:function(t){var s=t.add(t.parents()),a=!1;return s.each(function(){if("fixed"===e(this).css("position"))return a=!0,!1}),a},gaEvent:function(t,s){var a=!!(window.hasOwnProperty("GoogleAnalyticsObject")&&window.hasOwnProperty(window.GoogleAnalyticsObject))&&window[window.GoogleAnalyticsObject];if(this.options.sendGAEvents)try{if("undefined"!=typeof gtag)gtag("event","autocomplete_search",{event_label:t,event_category:s});else if(!1!==a){var o=a.getAll()[0];o&&o.send({hitType:"event",eventCategory:s,eventAction:"autocomplete_search",eventLabel:t})}}catch(i){}if(this.options.enableGASiteSearchModule)try{if("undefined"!=typeof gtag)gtag("event","page_view",{page_path:"/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"});else if(!1!==a){var n=a.getAll()[0];n&&(n.set("page","/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"),n.send("pageview"))}}catch(r){}e(document).trigger("dgwtWcasGAEvent",{term:t,category:s})},initVoiceSearch:function(){var t=this;if(!t.options.voiceSearchEnabled)return!1;var a=t.getFormWrapper(),o=a.find("."+t.options.searchInputClass),i=a.find("."+t.options.voiceSearchClass),n=!1;if("function"==typeof SpeechRecognition?n=SpeechRecognition:"function"==typeof webkitSpeechRecognition&&(n=webkitSpeechRecognition),!n||s.isBrowser("Chrome")&&s.isIOS()||s.isSafari())return!1;t.voiceSearchSetState("inactive",i),a.addClass(t.options.voiceSearchSupportedClass),t.voiceSearchRecognition=new n,t.voiceSearchRecognition.lang=t.options.voiceSearchLang,t.voiceSearchRecognition.continuous=!1,t.voiceSearchRecognition.interimResults=!0,t.voiceSearchRecognition.maxAlternatives=1,i.on("click",function(){if(a.hasClass("dgwt-wcas-mobile-overlay-trigger-active")&&!e("html").hasClass("dgwt-wcas-overlay-mobile-on")&&(a.find(".js-dgwt-wcas-enable-mobile-form").trigger("click"),a.find("."+t.options.searchInputClass).trigger("blur")),t.voiceSearchStarted){t.voiceSearchAbort();return}t.voiceSearchIsInitialized()&&t.voiceSearchAbort(),t.voiceSearchRecognition.start()}),t.voiceSearchRecognition.onstart=function(e){t.voiceSearchSetState("active",i)},t.voiceSearchRecognition.onresult=function(e){let s=e.results[0],a=s[0].transcript;o.val(a),s.isFinal&&(o.trigger("change"),"ontouchend"in document||o.trigger("focus"),t.voiceSearchSetState("inactive",i))},t.voiceSearchRecognition.onspeechend=function(){t.voiceSearchSetState("inactive",i),t.voiceSearchRecognition.stop()},t.voiceSearchRecognition.onnomatch=function(e){t.voiceSearchSetState("inactive",i)},t.voiceSearchRecognition.onerror=function(e){switch(e.error){case"aborted":case"no-speech":t.voiceSearchSetState("inactive",i);break;case"network":break;case"not-allowed":case"service-not-allowed":t.voiceSearchSetState("off",i)}}},voiceSearchAbort:function(){var e=this;e.voiceSearchIsInitialized()&&(e.voiceSearchRecognition.abort(),e.voiceSearchStarted=!1)},voiceSearchIsInitialized:function(){return null!==this.voiceSearchRecognition},voiceSearchSetState:function(e,t){var s=this;switch(e){case"active":s.voiceSearchStarted=!0,"string"==typeof dgwt_wcas.voice_search_active_icon&&t.html(dgwt_wcas.voice_search_active_icon);break;case"inactive":s.voiceSearchStarted=!1,"string"==typeof dgwt_wcas.voice_search_inactive_icon&&t.html(dgwt_wcas.voice_search_inactive_icon);break;case"off":s.voiceSearchStarted=!1,"string"==typeof dgwt_wcas.voice_search_disabled_icon&&t.html(dgwt_wcas.voice_search_disabled_icon)}}},e.fn.dgwtWcasAutocomplete=function(t,s){var a="autocomplete";return arguments.length?this.each(function(){var o=e(this),i=o.data(a);"string"==typeof t?i&&"function"==typeof i[t]&&i[t](s):(i&&i.dispose&&i.dispose(),i=new n(this,t),o.data(a,i))}):this.first().data(a)},e.fn.autocomplete||(e.fn.autocomplete=e.fn.dgwtWcasAutocomplete),s.isIE11()&&function(e,t){function s(e,t){var s=arguments.length>2?arguments[2]:[];if(!1===i(e))throw TypeError(Object.prototype.toString.call(e)+"is not a function.");return e.apply(t,s)}function a(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!1,configurable:!0})}function o(e,t){return e[t]}function i(e){return"function"==typeof e}function n(e,t){return e===t}function r(e){if(null===e||e===t)throw TypeError();return Object(e)}function c(t){switch(typeof t){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===t?"null":"Symbol"in e&&(t instanceof e.Symbol||t.constructor===e.Symbol)?"symbol":"object"}}function l(e,t){var s,a;return c(e)===c(t)&&("number"===c(e)?!(!isNaN(e)||!isNaN(t))||1/e==1/0&&1/t==-1/0||1/e==-1/0&&1/t==1/0||e===t:(s=e,s===(a=t)))}function d(e){if("symbol"===c(e))throw TypeError("Cannot convert a Symbol value to a number");var t=Number(e);return isNaN(t)?0:1/t==1/0||1/t==-1/0||t===1/0||t===-1/0?t:(t<0?-1:1)*Math.floor(Math.abs(t))}function g(a){switch(c(a)){case"symbol":throw TypeError("Cannot convert a Symbol value to a string");case"object":return g(function a(o){var n=arguments.length>1?arguments[1]:t;if("object"===c(o)){if(arguments.length<2)var l="default";else n===String?l="string":n===Number&&(l="number");var d="function"==typeof e.Symbol&&"symbol"==typeof e.Symbol.toPrimitive?function e(s,a){var o,n,c=(o=s,n=a,r(o)[n]);if(null!==c&&c!==t){if(!1===i(c))throw TypeError("Method not callable: "+a);return c}}(o,e.Symbol.toPrimitive):t;if(d!==t){var g=s(d,o,[l]);if("object"!==c(g))return g;throw TypeError("Cannot convert exotic object to primitive.")}return"default"===l&&(l="number"),function e(t,a){if("string"===a)var o=["toString","valueOf"];else o=["valueOf","toString"];for(var n=0;n<o.length;++n){var r,l,d=o[n],g=(r=t,r[l=d]);if(i(g)){var u=s(g,t);if("object"!==c(u))return u}}throw TypeError("Cannot convert to primitive.")}(o,l)}return o}(a,String));default:return String(a)}}a(Array.prototype,"includes",function e(t){var s,a,o,i,n,c=r(this),u=(i=(o=c).length,(n=d(i))<=0?0:Math.min(n,9007199254740991));if(0===u)return!1;var h=d(arguments[1]);if(h>=0)var p=h;else(p=u+h)<0&&(p=0);for(;p<u;){if(l(t,(s=c,s[a=g(p)])))return!0;p+=1}return!1}),a(String.prototype,"includes",function s(a){var o=arguments.length>1?arguments[1]:t,i=function e(s){if(null===s||s===t)throw TypeError(Object.prototype.toString.call(s)+" is not coercible to Object.");return s}(this),n=g(i);if(function s(a){if("object"!==c(a))return!1;var o,i,n,r="Symbol"in e&&"match"in e.Symbol?(i=a,i[n=e.Symbol.match]):t;if(r!==t)return Boolean(o=r);try{var l=a.lastIndex;return a.lastIndex=0,RegExp.prototype.exec.call(a),!0}catch(d){}finally{a.lastIndex=l}return!1}(a))throw TypeError("First argument to String.prototype.includes must not be a regular expression");var r=g(a),l=d(o),u=n.length;return -1!==String.prototype.indexOf.call(n,r,Math.min(Math.max(l,0),u))})}("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),e(document).ready(function(){s.isIOS()&&e("html").addClass("dgwt-wcas-is-ios"),window.dgwt_wcas.resizeOnlyOnce=null,window.dgwt_wcas.scrollOnlyOnce=null,window.dgwt_wcas.config={minChars:dgwt_wcas.min_chars,width:dgwt_wcas.sug_width,autoSelectFirst:!1,triggerSelectOnValidInput:!1,serviceUrl:dgwt_wcas.ajax_search_endpoint,paramName:"s",showDetailsPanel:1==dgwt_wcas.show_details_panel,showImage:1==dgwt_wcas.show_images,showPrice:1==dgwt_wcas.show_price,showDescription:1==dgwt_wcas.show_desc,showSKU:1==dgwt_wcas.show_sku,showSaleBadge:1==dgwt_wcas.show_sale_badge,showFeaturedBadge:1==dgwt_wcas.show_featured_badge,dynamicPrices:void 0!==dgwt_wcas.dynamic_prices&&!!dgwt_wcas.dynamic_prices,saleBadgeText:dgwt_wcas.labels.sale_badge,featuredBadgeText:dgwt_wcas.labels.featured_badge,isRtl:1==dgwt_wcas.is_rtl,showHeadings:1==dgwt_wcas.show_headings,isPremium:1==dgwt_wcas.is_premium,taxonomyBrands:dgwt_wcas.taxonomy_brands,layoutBreakpoint:dgwt_wcas.layout_breakpoint,mobileOverlayBreakpoint:dgwt_wcas.mobile_overlay_breakpoint,mobileOverlayWrapper:dgwt_wcas.mobile_overlay_wrapper,mobileOverlayDelay:dgwt_wcas.mobile_overlay_delay,debounceWaitMs:dgwt_wcas.debounce_wait_ms,sendGAEvents:dgwt_wcas.send_ga_events,enableGASiteSearchModule:dgwt_wcas.enable_ga_site_search_module,appendTo:void 0!==dgwt_wcas.suggestions_wrapper?dgwt_wcas.suggestions_wrapper:"body",showProductVendor:void 0!==dgwt_wcas.show_product_vendor&&!!dgwt_wcas.show_product_vendor,disableHits:void 0!==dgwt_wcas.disable_hits&&!!dgwt_wcas.disable_hits,disableSubmit:void 0!==dgwt_wcas.disable_submit&&!!dgwt_wcas.disable_submit,voiceSearchEnabled:void 0!==dgwt_wcas.voice_search_enabled&&!!dgwt_wcas.voice_search_enabled,voiceSearchLang:void 0!==dgwt_wcas.voice_search_lang?dgwt_wcas.voice_search_lang:"",showRecentlySearchedProducts:void 0!==dgwt_wcas.show_recently_searched_products&&dgwt_wcas.show_recently_searched_products,showRecentlySearchedPhrases:void 0!==dgwt_wcas.show_recently_searched_phrases&&dgwt_wcas.show_recently_searched_phrases,goToFirstVariationOnSubmit:void 0!==dgwt_wcas.go_to_first_variation_on_submit&&dgwt_wcas.go_to_first_variation_on_submit},e(".dgwt-wcas-search-input").dgwtWcasAutocomplete(window.dgwt_wcas.config);var t=e(document.activeElement);t.length&&(t.hasClass("dgwt-wcas-search-input")?t.trigger("focus"):t.hasClass("js-dgwt-wcas-search-icon-handler")&&t.trigger("click"))}),t={brokenSearchUi:void 0!==dgwt_wcas.fixer.broken_search_ui&&!!dgwt_wcas.fixer.broken_search_ui,brokenSearchUiAjax:void 0!==dgwt_wcas.fixer.broken_search_ui_ajax&&!!dgwt_wcas.fixer.broken_search_ui_ajax,brokenSearchUiHard:void 0!==dgwt_wcas.fixer.broken_search_ui_hard&&!!dgwt_wcas.fixer.broken_search_ui_hard,brokenSearchElementorPopups:void 0!==dgwt_wcas.fixer.broken_search_elementor_popups&&!!dgwt_wcas.fixer.broken_search_elementor_popups,brokenSearchJetMobileMenu:void 0!==dgwt_wcas.fixer.broken_search_jet_mobile_menu&&!!dgwt_wcas.fixer.broken_search_jet_mobile_menu,brokenSearchBrowserBackArrow:void 0!==dgwt_wcas.fixer.broken_search_browsers_back_arrow&&!!dgwt_wcas.fixer.broken_search_browsers_back_arrow,forceRefreshCheckout:void 0!==dgwt_wcas.fixer.force_refresh_checkout&&!!dgwt_wcas.fixer.force_refresh_checkout,searchBars:[],init:function(){var t=this;t.brokenSearchUi&&e(document).ready(function(){t.fixBrokenSearchUi()}),t.brokenSearchUiAjax&&t.fixBrokenSearchUiAjax(),t.brokenSearchUiHard&&t.fixBrokenSearchUiHard(),t.brokenSearchElementorPopups&&e(document).ready(function(){t.fixBrokenSearchOnElementorPopupsV1(),t.fixBrokenSearchOnElementorPopupsV2()}),t.brokenSearchJetMobileMenu&&e(window).on("load",function(){t.fixSearchInJetMobileMenu()}),t.brokenSearchBrowserBackArrow&&t.fixbrokenSearchBrowserBackArrow(),t.forceRefreshCheckout&&t.fixforceRefreshCheckout()},fixBrokenSearchUi:function(){var t=this;e(document).ready(function(){setTimeout(function(){t.pullAndReconditionSearchBars()},50)}),e(window).on("load",function(){setTimeout(function(){t.pullAndReconditionSearchBars()},500)})},fixBrokenSearchUiAjax:function(){var t=this;e(document).ajaxSuccess(function(e,s,a){!("string"==typeof a.url&&RegExp("search.php|wc-ajax").test(a.url))&&"string"==typeof s.responseText&&s.responseText.includes("dgwt-wcas-search-input")&&setTimeout(function(){t.pullAndReconditionSearchBars()},500)})},fixBrokenSearchUiHard:function(){var t=this;e(document).ready(function(){0===t.searchBars.length&&t.pullAndReconditionSearchBars(),setInterval(function(){t.pullAndReconditionSearchBars()},1e3)})},fixBrokenSearchOnElementorPopupsV1:function(){var t=this;e(document).on("elementor/popup/show",()=>{setTimeout(function(){t.pullAndReconditionSearchBars()},500)})},fixBrokenSearchOnElementorPopupsV2:function(){var t=this;e(document).ready(function(){void 0!==window.elementorFrontend&&void 0!==window.elementorFrontend.documentsManager&&void 0!==window.elementorFrontend.documentsManager.documents&&e.each(elementorFrontend.documentsManager.documents,function(e,s){void 0!==s.getModal&&s.getModal&&s.getModal().on("show",function(){setTimeout(function(){t.pullAndReconditionSearchBars()},500)})})})},fixSearchInJetMobileMenu:function(){var t=this;0!==e(".jet-mobile-menu__toggle").length&&e(document).ajaxSend(function(s){void 0!==s.currentTarget&&"object"==typeof s.currentTarget.activeElement&&e(s.currentTarget.activeElement).hasClass("jet-mobile-menu__toggle")&&setTimeout(function(){e(".jet-mobile-menu__container .dgwt-wcas-search-input").length>0&&t.pullAndReconditionSearchBars()},500)})},fixforceRefreshCheckout:function(){e(document.body).on("added_to_cart",function(){e(document.body).hasClass("woocommerce-checkout")&&e(".dgwt-wcas-search-input").length>0&&e(document.body).trigger("update_checkout")})},fixbrokenSearchBrowserBackArrow:function(){e(window).on("load",function(){var t=0,s=setInterval(function(){var a=document.activeElement;if("object"==typeof a&&e(a).length&&e(a).hasClass("dgwt-wcas-search-input")){var o=e(a).closest(".dgwt-wcas-search-wrapp");o.length&&!o.hasClass("dgwt-wcas-active")&&(o.addClass("dgwt-wcas-active"),clearInterval(s))}t>10&&clearInterval(s),t++},500)})},pullAndReconditionSearchBars:function(){var t=this,s=e(".dgwt-wcas-search-input"),a=0==t.searchBars.length;s.length>0&&s.each(function(){var s,o=e(this),i=!0;if(t.searchBars.length>0){for(s=0;s<t.searchBars.length;s++)if(o[0]===t.searchBars[s][0]){i=!1;break}}if(i){var n=!1;t.hasUniqueId(o)||(t.makeUniqueID(o),n=!0),a&&t.isInitialized(o)&&!n||t.reinitSearchBar(o),t.searchBars.push(o)}t.hasEvents(o)||t.reinitSearchBar(o)})},hasEvents:function(t){var s=!1;return t.trigger("fibosearch/ping"),t.hasClass("fibosearch-pong")&&(s=!0),e(".fibosearch-pong").removeClass("fibosearch-pong"),s},isInitialized:function(e){return"object"==typeof e.data("autocomplete")},hasUniqueId:function(e){var t=!0;if(this.searchBars.length>0)for(var s=0;s<this.searchBars.length;s++)e.attr("id")===this.searchBars[s].attr("id")&&(t=!1);return t},reinitSearchBar:function(e){"object"==typeof e.data("autocomplete")&&e.data("autocomplete").dispose(),e.dgwtWcasAutocomplete(window.dgwt_wcas.config)},makeUniqueID:function(e){var t=Math.random().toString(36).substring(2,6);t="dgwt-wcas-search-input-"+t,e.attr("id",t),e.closest("form").find("label").attr("for",t)}},void 0===dgwt_wcas.fixer.core&&(dgwt_wcas.fixer.core=t,dgwt_wcas.fixer.core.init())});
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
;(function($, window, document, undefined){
function Owl(element, options){
this.settings=null;
this.options=$.extend({}, Owl.Defaults, options);
this.$element=$(element);
this._handlers={};
this._plugins={};
this._supress={};
this._current=null;
this._speed=null;
this._coordinates=[];
this._breakpoint=null;
this._width=null;
this._items=[];
this._clones=[];
this._mergers=[];
this._widths=[];
this._invalidated={};
this._pipe=[];
this._drag={
time: null,
target: null,
pointer: null,
stage: {
start: null,
current: null
},
direction: null
};
this._states={
current: {},
tags: {
'initializing': [ 'busy' ],
'animating': [ 'busy' ],
'dragging': [ 'interacting' ]
}};
$.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler){
this._handlers[handler]=$.proxy(this[handler], this);
}, this));
$.each(Owl.Plugins, $.proxy(function(key, plugin){
this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
= new plugin(this);
}, this));
$.each(Owl.Workers, $.proxy(function(priority, worker){
this._pipe.push({
'filter': worker.filter,
'run': $.proxy(worker.run, this)
});
}, this));
this.setup();
this.initialize();
}
Owl.Defaults={
items: 3,
loop: false,
center: false,
rewind: false,
mouseDrag: true,
touchDrag: true,
pullDrag: true,
freeDrag: false,
margin: 0,
stagePadding: 0,
merge: false,
mergeFit: true,
autoWidth: false,
startPosition: 0,
rtl: false,
smartSpeed: 250,
fluidSpeed: false,
dragEndSpeed: false,
responsive: {},
responsiveRefreshRate: 200,
responsiveBaseElement: window,
fallbackEasing: 'swing',
info: false,
nestedItemSelector: false,
itemElement: 'div',
stageElement: 'div',
refreshClass: 'owl-refresh',
loadedClass: 'owl-loaded',
loadingClass: 'owl-loading',
rtlClass: 'owl-rtl',
responsiveClass: 'owl-responsive',
dragClass: 'owl-drag',
itemClass: 'owl-item',
stageClass: 'owl-stage',
stageOuterClass: 'owl-stage-outer',
grabClass: 'owl-grab'
};
Owl.Width={
Default: 'default',
Inner: 'inner',
Outer: 'outer'
};
Owl.Type={
Event: 'event',
State: 'state'
};
Owl.Plugins={};
Owl.Workers=[ {
filter: [ 'width', 'settings' ],
run: function(){
this._width=this.$element.width();
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
cache.current=this._items&&this._items[this.relative(this._current)];
}}, {
filter: [ 'items', 'settings' ],
run: function(){
this.$stage.children('.cloned').remove();
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
var margin=this.settings.margin||'',
grid = !this.settings.autoWidth,
rtl=this.settings.rtl,
css={
'width': 'auto',
'margin-left': rtl ? margin:'',
'margin-right': rtl ? '':margin
};
!grid&&this.$stage.children().css(css);
cache.css=css;
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
var width=(this.width() / this.settings.items).toFixed(3) - this.settings.margin,
merge=null,
iterator=this._items.length,
grid = !this.settings.autoWidth,
widths=[];
cache.items={
merge: false,
width: width
};
while (iterator--){
merge=this._mergers[iterator];
merge=this.settings.mergeFit&&Math.min(merge, this.settings.items)||merge;
cache.items.merge=merge > 1||cache.items.merge;
widths[iterator] = !grid ? this._items[iterator].width():width * merge;
}
this._widths=widths;
}}, {
filter: [ 'items', 'settings' ],
run: function(){
var clones=[],
items=this._items,
settings=this.settings,
view=Math.max(settings.items * 2, 4),
size=Math.ceil(items.length / 2) * 2,
repeat=settings.loop&&items.length ? settings.rewind ? view:Math.max(view, size):0,
append='',
prepend='';
repeat /=2;
while (repeat--){
clones.push(this.normalize(clones.length / 2, true));
append=append + items[clones[clones.length - 1]][0].outerHTML;
clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
prepend=items[clones[clones.length - 1]][0].outerHTML + prepend;
}
this._clones=clones;
$(append).addClass('cloned').appendTo(this.$stage);
$(prepend).addClass('cloned').prependTo(this.$stage);
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(){
var rtl=this.settings.rtl ? 1:-1,
size=this._clones.length + this._items.length,
iterator=-1,
previous=0,
current=0,
coordinates=[];
while (++iterator < size){
previous=coordinates[iterator - 1]||0;
current=this._widths[this.relative(iterator)] + this.settings.margin;
coordinates.push(previous + current * rtl);
}
this._coordinates=coordinates;
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(){
var padding=this.settings.stagePadding,
coordinates=this._coordinates,
css={
'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
'padding-left': padding||'',
'padding-right': padding||''
};
this.$stage.css(css);
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
var iterator=this._coordinates.length,
grid = !this.settings.autoWidth,
items=this.$stage.children();
if(grid&&cache.items.merge){
while (iterator--){
cache.css.width=this._widths[this.relative(iterator)];
items.eq(iterator).css(cache.css);
}}else if(grid){
cache.css.width=cache.items.width;
items.css(cache.css);
}}
}, {
filter: [ 'items' ],
run: function(){
this._coordinates.length < 1&&this.$stage.removeAttr('style');
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
cache.current=cache.current ? this.$stage.children().index(cache.current):0;
cache.current=Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
this.reset(cache.current);
}}, {
filter: [ 'position' ],
run: function(){
this.animate(this.coordinates(this._current));
}}, {
filter: [ 'width', 'position', 'items', 'settings' ],
run: function(){
var rtl=this.settings.rtl ? 1:-1,
padding=this.settings.stagePadding * 2,
begin=this.coordinates(this.current()) + padding,
end=begin + this.width() * rtl,
inner, outer, matches=[], i, n;
for (i=0, n=this._coordinates.length; i < n; i++){
inner=this._coordinates[i - 1]||0;
outer=Math.abs(this._coordinates[i]) + padding * rtl;
if((this.op(inner, '<=', begin)&&(this.op(inner, '>', end)))
|| (this.op(outer, '<', begin)&&this.op(outer, '>', end))){
matches.push(i);
}}
this.$stage.children('.active').removeClass('active');
this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
if(this.settings.center){
this.$stage.children('.center').removeClass('center');
this.$stage.children().eq(this.current()).addClass('center');
}}
} ];
Owl.prototype.initialize=function(){
this.enter('initializing');
this.trigger('initialize');
this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
if(this.settings.autoWidth&&!this.is('pre-loading')){
var imgs, nestedSelector, width;
imgs=this.$element.find('img');
nestedSelector=this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector:undefined;
width=this.$element.children(nestedSelector).width();
if(imgs.length&&width <=0){
this.preloadAutoWidthImages(imgs);
}}
this.$element.addClass(this.options.loadingClass);
this.$stage=$('<' + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>')
.wrap('<div class="' + this.settings.stageOuterClass + '"/>');
this.$element.append(this.$stage.parent());
this.replace(this.$element.children().not(this.$stage.parent()));
if(this.$element.is(':visible')){
this.refresh();
}else{
this.invalidate('width');
}
this.$element
.removeClass(this.options.loadingClass)
.addClass(this.options.loadedClass);
this.registerEventHandlers();
this.leave('initializing');
this.trigger('initialized');
};
Owl.prototype.setup=function(){
var viewport=this.viewport(),
overwrites=this.options.responsive,
match=-1,
settings=null;
if(!overwrites){
settings=$.extend({}, this.options);
}else{
$.each(overwrites, function(breakpoint){
if(breakpoint <=viewport&&breakpoint > match){
match=Number(breakpoint);
}});
settings=$.extend({}, this.options, overwrites[match]);
if(typeof settings.stagePadding==='function'){
settings.stagePadding=settings.stagePadding();
}
delete settings.responsive;
if(settings.responsiveClass){
this.$element.attr('class',
this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
);
}}
this.trigger('change', { property: { name: 'settings', value: settings }});
this._breakpoint=match;
this.settings=settings;
this.invalidate('settings');
this.trigger('changed', { property: { name: 'settings', value: this.settings }});
};
Owl.prototype.optionsLogic=function(){
if(this.settings.autoWidth){
this.settings.stagePadding=false;
this.settings.merge=false;
}};
Owl.prototype.prepare=function(item){
var event=this.trigger('prepare', { content: item });
if(!event.data){
event.data=$('<' + this.settings.itemElement + '/>')
.addClass(this.options.itemClass).append(item)
}
this.trigger('prepared', { content: event.data });
return event.data;
};
Owl.prototype.update=function(){
var i=0,
n=this._pipe.length,
filter=$.proxy(function(p){ return this[p] }, this._invalidated),
cache={};
while (i < n){
if(this._invalidated.all||$.grep(this._pipe[i].filter, filter).length > 0){
this._pipe[i].run(cache);
}
i++;
}
this._invalidated={};
!this.is('valid')&&this.enter('valid');
};
Owl.prototype.width=function(dimension){
dimension=dimension||Owl.Width.Default;
switch (dimension){
case Owl.Width.Inner:
case Owl.Width.Outer:
return this._width;
default:
return this._width - this.settings.stagePadding * 2 + this.settings.margin;
}};
Owl.prototype.refresh=function(){
this.enter('refreshing');
this.trigger('refresh');
this.setup();
this.optionsLogic();
this.$element.addClass(this.options.refreshClass);
this.update();
this.$element.removeClass(this.options.refreshClass);
this.leave('refreshing');
this.trigger('refreshed');
};
Owl.prototype.onThrottledResize=function(){
window.clearTimeout(this.resizeTimer);
this.resizeTimer=window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
};
Owl.prototype.onResize=function(){
if(!this._items.length){
return false;
}
if(this._width===this.$element.width()){
return false;
}
if(!this.$element.is(':visible')){
return false;
}
this.enter('resizing');
if(this.trigger('resize').isDefaultPrevented()){
this.leave('resizing');
return false;
}
this.invalidate('width');
this.refresh();
this.leave('resizing');
this.trigger('resized');
};
Owl.prototype.registerEventHandlers=function(){
if($.support.transition){
this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
}
if(this.settings.responsive!==false){
this.on(window, 'resize', this._handlers.onThrottledResize);
}
if(this.settings.mouseDrag){
this.$element.addClass(this.options.dragClass);
this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
this.$stage.on('dragstart.owl.core selectstart.owl.core', function(){ return false });
}
if(this.settings.touchDrag){
this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
}};
Owl.prototype.onDragStart=function(event){
var stage=null;
if(event.which===3){
return;
}
if($.support.transform){
stage=this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
stage={
x: stage[stage.length===16 ? 12:4],
y: stage[stage.length===16 ? 13:5]
};}else{
stage=this.$stage.position();
stage={
x: this.settings.rtl ?
stage.left + this.$stage.width() - this.width() + this.settings.margin :
stage.left,
y: stage.top
};}
if(this.is('animating')){
$.support.transform ? this.animate(stage.x):this.$stage.stop()
this.invalidate('position');
}
this.$element.toggleClass(this.options.grabClass, event.type==='mousedown');
this.speed(0);
this._drag.time=new Date().getTime();
this._drag.target=$(event.target);
this._drag.stage.start=stage;
this._drag.stage.current=stage;
this._drag.pointer=this.pointer(event);
$(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
$(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event){
var delta=this.difference(this._drag.pointer, this.pointer(event));
$(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
if(Math.abs(delta.x) < Math.abs(delta.y)&&this.is('valid')){
return;
}
event.preventDefault();
this.enter('dragging');
this.trigger('drag');
}, this));
};
Owl.prototype.onDragMove=function(event){
var minimum=null,
maximum=null,
pull=null,
delta=this.difference(this._drag.pointer, this.pointer(event)),
stage=this.difference(this._drag.stage.start, delta);
if(!this.is('dragging')){
return;
}
event.preventDefault();
if(this.settings.loop){
minimum=this.coordinates(this.minimum());
maximum=this.coordinates(this.maximum() + 1) - minimum;
stage.x=(((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
}else{
minimum=this.settings.rtl ? this.coordinates(this.maximum()):this.coordinates(this.minimum());
maximum=this.settings.rtl ? this.coordinates(this.minimum()):this.coordinates(this.maximum());
pull=this.settings.pullDrag ? -1 * delta.x / 5:0;
stage.x=Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
}
this._drag.stage.current=stage;
this.animate(stage.x);
};
Owl.prototype.onDragEnd=function(event){
var delta=this.difference(this._drag.pointer, this.pointer(event)),
stage=this._drag.stage.current,
direction=delta.x > 0 ^ this.settings.rtl ? 'left':'right';
$(document).off('.owl.core');
this.$element.removeClass(this.options.grabClass);
if(delta.x!==0&&this.is('dragging')||!this.is('valid')){
this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed);
this.current(this.closest(stage.x, delta.x!==0 ? direction:this._drag.direction));
this.invalidate('position');
this.update();
this._drag.direction=direction;
if(Math.abs(delta.x) > 3||new Date().getTime() - this._drag.time > 300){
this._drag.target.one('click.owl.core', function(){ return false; });
}}
if(!this.is('dragging')){
return;
}
this.leave('dragging');
this.trigger('dragged');
};
Owl.prototype.closest=function(coordinate, direction){
var position=-1,
pull=30,
width=this.width(),
coordinates=this.coordinates();
if(!this.settings.freeDrag){
$.each(coordinates, $.proxy(function(index, value){
if(direction==='left'&&coordinate > value - pull&&coordinate < value + pull){
position=index;
}else if(direction==='right'&&coordinate > value - width - pull&&coordinate < value - width + pull){
position=index + 1;
}else if(this.op(coordinate, '<', value)
&& this.op(coordinate, '>', coordinates[index + 1]||value - width)){
position=direction==='left' ? index + 1:index;
}
return position===-1;
}, this));
}
if(!this.settings.loop){
if(this.op(coordinate, '>', coordinates[this.minimum()])){
position=coordinate=this.minimum();
}else if(this.op(coordinate, '<', coordinates[this.maximum()])){
position=coordinate=this.maximum();
}}
return position;
};
Owl.prototype.animate=function(coordinate){
var animate=this.speed() > 0;
this.is('animating')&&this.onTransitionEnd();
if(animate){
this.enter('animating');
this.trigger('translate');
}
if($.support.transform3d&&$.support.transition){
this.$stage.css({
transform: 'translate3d(' + coordinate + 'px,0px,0px)',
transition: (this.speed() / 1000) + 's'
});
}else if(animate){
this.$stage.animate({
left: coordinate + 'px'
}, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
}else{
this.$stage.css({
left: coordinate + 'px'
});
}};
Owl.prototype.is=function(state){
return this._states.current[state]&&this._states.current[state] > 0;
};
Owl.prototype.current=function(position){
if(position===undefined){
return this._current;
}
if(this._items.length===0){
return undefined;
}
position=this.normalize(position);
if(this._current!==position){
var event=this.trigger('change', { property: { name: 'position', value: position }});
if(event.data!==undefined){
position=this.normalize(event.data);
}
this._current=position;
this.invalidate('position');
this.trigger('changed', { property: { name: 'position', value: this._current }});
}
return this._current;
};
Owl.prototype.invalidate=function(part){
if($.type(part)==='string'){
this._invalidated[part]=true;
this.is('valid')&&this.leave('valid');
}
return $.map(this._invalidated, function(v, i){ return i });
};
Owl.prototype.reset=function(position){
position=this.normalize(position);
if(position===undefined){
return;
}
this._speed=0;
this._current=position;
this.suppress([ 'translate', 'translated' ]);
this.animate(this.coordinates(position));
this.release([ 'translate', 'translated' ]);
};
Owl.prototype.normalize=function(position, relative){
var n=this._items.length,
m=relative ? 0:this._clones.length;
if(!this.isNumeric(position)||n < 1){
position=undefined;
}else if(position < 0||position >=n + m){
position=((position - m / 2) % n + n) % n + m / 2;
}
return position;
};
Owl.prototype.relative=function(position){
position -=this._clones.length / 2;
return this.normalize(position, true);
};
Owl.prototype.maximum=function(relative){
var settings=this.settings,
maximum=this._coordinates.length,
iterator,
reciprocalItemsWidth,
elementWidth;
if(settings.loop){
maximum=this._clones.length / 2 + this._items.length - 1;
}else if(settings.autoWidth||settings.merge){
iterator=this._items.length;
reciprocalItemsWidth=this._items[--iterator].width();
elementWidth=this.$element.width();
while (iterator--){
reciprocalItemsWidth +=this._items[iterator].width() + this.settings.margin;
if(reciprocalItemsWidth > elementWidth){
break;
}}
maximum=iterator + 1;
}else if(settings.center){
maximum=this._items.length - 1;
}else{
maximum=this._items.length - settings.items;
}
if(relative){
maximum -=this._clones.length / 2;
}
return Math.max(maximum, 0);
};
Owl.prototype.minimum=function(relative){
return relative ? 0:this._clones.length / 2;
};
Owl.prototype.items=function(position){
if(position===undefined){
return this._items.slice();
}
position=this.normalize(position, true);
return this._items[position];
};
Owl.prototype.mergers=function(position){
if(position===undefined){
return this._mergers.slice();
}
position=this.normalize(position, true);
return this._mergers[position];
};
Owl.prototype.clones=function(position){
var odd=this._clones.length / 2,
even=odd + this._items.length,
map=function(index){ return index % 2===0 ? even + index / 2:odd - (index + 1) / 2 };
if(position===undefined){
return $.map(this._clones, function(v, i){ return map(i) });
}
return $.map(this._clones, function(v, i){ return v===position ? map(i):null });
};
Owl.prototype.speed=function(speed){
if(speed!==undefined){
this._speed=speed;
}
return this._speed;
};
Owl.prototype.coordinates=function(position){
var multiplier=1,
newPosition=position - 1,
coordinate;
if(position===undefined){
return $.map(this._coordinates, $.proxy(function(coordinate, index){
return this.coordinates(index);
}, this));
}
if(this.settings.center){
if(this.settings.rtl){
multiplier=-1;
newPosition=position + 1;
}
coordinate=this._coordinates[position];
coordinate +=(this.width() - coordinate + (this._coordinates[newPosition]||0)) / 2 * multiplier;
}else{
coordinate=this._coordinates[newPosition]||0;
}
coordinate=Math.ceil(coordinate);
return coordinate;
};
Owl.prototype.duration=function(from, to, factor){
if(factor===0){
return 0;
}
return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor||this.settings.smartSpeed));
};
Owl.prototype.to=function(position, speed){
var current=this.current(),
revert=null,
distance=position - this.relative(current),
direction=(distance > 0) - (distance < 0),
items=this._items.length,
minimum=this.minimum(),
maximum=this.maximum();
if(this.settings.loop){
if(!this.settings.rewind&&Math.abs(distance) > items / 2){
distance +=direction * -1 * items;
}
position=current + distance;
revert=((position - minimum) % items + items) % items + minimum;
if(revert!==position&&revert - distance <=maximum&&revert - distance > 0){
current=revert - distance;
position=revert;
this.reset(current);
}}else if(this.settings.rewind){
maximum +=1;
position=(position % maximum + maximum) % maximum;
}else{
position=Math.max(minimum, Math.min(maximum, position));
}
this.speed(this.duration(current, position, speed));
this.current(position);
if(this.$element.is(':visible')){
this.update();
}};
Owl.prototype.next=function(speed){
speed=speed||false;
this.to(this.relative(this.current()) + 1, speed);
};
Owl.prototype.prev=function(speed){
speed=speed||false;
this.to(this.relative(this.current()) - 1, speed);
};
Owl.prototype.onTransitionEnd=function(event){
if(event!==undefined){
event.stopPropagation();
if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){
return false;
}}
this.leave('animating');
this.trigger('translated');
};
Owl.prototype.viewport=function(){
var width;
if(this.options.responsiveBaseElement!==window){
width=$(this.options.responsiveBaseElement).width();
}else if(window.innerWidth){
width=window.innerWidth;
}else if(document.documentElement&&document.documentElement.clientWidth){
width=document.documentElement.clientWidth;
}else{
console.warn('Can not detect viewport width.');
}
return width;
};
Owl.prototype.replace=function(content){
this.$stage.empty();
this._items=[];
if(content){
content=(content instanceof jQuery) ? content:$(content);
}
if(this.settings.nestedItemSelector){
content=content.find('.' + this.settings.nestedItemSelector);
}
content.filter(function(){
return this.nodeType===1;
}).each($.proxy(function(index, item){
item=this.prepare(item);
this.$stage.append(item);
this._items.push(item);
this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1);
}, this));
this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition:0);
this.invalidate('items');
};
Owl.prototype.add=function(content, position){
var current=this.relative(this._current);
position=position===undefined ? this._items.length:this.normalize(position, true);
content=content instanceof jQuery ? content:$(content);
this.trigger('add', { content: content, position: position });
content=this.prepare(content);
if(this._items.length===0||position===this._items.length){
this._items.length===0&&this.$stage.append(content);
this._items.length!==0&&this._items[position - 1].after(content);
this._items.push(content);
this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1);
}else{
this._items[position].before(content);
this._items.splice(position, 0, content);
this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1);
}
this._items[current]&&this.reset(this._items[current].index());
this.invalidate('items');
this.trigger('added', { content: content, position: position });
};
Owl.prototype.remove=function(position){
position=this.normalize(position, true);
if(position===undefined){
return;
}
this.trigger('remove', { content: this._items[position], position: position });
this._items[position].remove();
this._items.splice(position, 1);
this._mergers.splice(position, 1);
this.invalidate('items');
this.trigger('removed', { content: null, position: position });
};
Owl.prototype.preloadAutoWidthImages=function(images){
images.each($.proxy(function(i, element){
this.enter('pre-loading');
element=$(element);
$(new Image()).one('load', $.proxy(function(e){
element.attr('src', e.target.src);
element.css('opacity', 1);
this.leave('pre-loading');
!this.is('pre-loading')&&!this.is('initializing')&&this.refresh();
}, this)).attr('src', element.attr('src')||element.attr('data-src')||element.attr('data-src-retina'));
}, this));
};
Owl.prototype.destroy=function(){
this.$element.off('.owl.core');
this.$stage.off('.owl.core');
$(document).off('.owl.core');
if(this.settings.responsive!==false){
window.clearTimeout(this.resizeTimer);
this.off(window, 'resize', this._handlers.onThrottledResize);
}
for (var i in this._plugins){
this._plugins[i].destroy();
}
this.$stage.children('.cloned').remove();
this.$stage.unwrap();
this.$stage.children().contents().unwrap();
this.$stage.children().unwrap();
this.$element
.removeClass(this.options.refreshClass)
.removeClass(this.options.loadingClass)
.removeClass(this.options.loadedClass)
.removeClass(this.options.rtlClass)
.removeClass(this.options.dragClass)
.removeClass(this.options.grabClass)
.attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
.removeData('owl.carousel');
};
Owl.prototype.op=function(a, o, b){
var rtl=this.settings.rtl;
switch (o){
case '<':
return rtl ? a > b:a < b;
case '>':
return rtl ? a < b:a > b;
case '>=':
return rtl ? a <=b:a >=b;
case '<=':
return rtl ? a >=b:a <=b;
default:
break;
}};
Owl.prototype.on=function(element, event, listener, capture){
if(element.addEventListener){
element.addEventListener(event, listener, capture);
}else if(element.attachEvent){
element.attachEvent('on' + event, listener);
}};
Owl.prototype.off=function(element, event, listener, capture){
if(element.removeEventListener){
element.removeEventListener(event, listener, capture);
}else if(element.detachEvent){
element.detachEvent('on' + event, listener);
}};
Owl.prototype.trigger=function(name, data, namespace, state, enter){
var status={
item: { count: this._items.length, index: this.current() }}, handler=$.camelCase($.grep([ 'on', name, namespace ], function(v){ return v })
.join('-').toLowerCase()
), event=$.Event([ name, 'owl', namespace||'carousel' ].join('.').toLowerCase(),
$.extend({ relatedTarget: this }, status, data)
);
if(!this._supress[name]){
$.each(this._plugins, function(name, plugin){
if(plugin.onTrigger){
plugin.onTrigger(event);
}});
this.register({ type: Owl.Type.Event, name: name });
this.$element.trigger(event);
if(this.settings&&typeof this.settings[handler]==='function'){
this.settings[handler].call(this, event);
}}
return event;
};
Owl.prototype.enter=function(name){
$.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){
if(this._states.current[name]===undefined){
this._states.current[name]=0;
}
this._states.current[name]++;
}, this));
};
Owl.prototype.leave=function(name){
$.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){
this._states.current[name]--;
}, this));
};
Owl.prototype.register=function(object){
if(object.type===Owl.Type.Event){
if(!$.event.special[object.name]){
$.event.special[object.name]={};}
if(!$.event.special[object.name].owl){
var _default=$.event.special[object.name]._default;
$.event.special[object.name]._default=function(e){
if(_default&&_default.apply&&(!e.namespace||e.namespace.indexOf('owl')===-1)){
return _default.apply(this, arguments);
}
return e.namespace&&e.namespace.indexOf('owl') > -1;
};
$.event.special[object.name].owl=true;
}}else if(object.type===Owl.Type.State){
if(!this._states.tags[object.name]){
this._states.tags[object.name]=object.tags;
}else{
this._states.tags[object.name]=this._states.tags[object.name].concat(object.tags);
}
this._states.tags[object.name]=$.grep(this._states.tags[object.name], $.proxy(function(tag, i){
return $.inArray(tag, this._states.tags[object.name])===i;
}, this));
}};
Owl.prototype.suppress=function(events){
$.each(events, $.proxy(function(index, event){
this._supress[event]=true;
}, this));
};
Owl.prototype.release=function(events){
$.each(events, $.proxy(function(index, event){
delete this._supress[event];
}, this));
};
Owl.prototype.pointer=function(event){
var result={ x: null, y: null };
event=event.originalEvent||event||window.event;
event=event.touches&&event.touches.length ?
event.touches[0]:event.changedTouches&&event.changedTouches.length ?
event.changedTouches[0]:event;
if(event.pageX){
result.x=event.pageX;
result.y=event.pageY;
}else{
result.x=event.clientX;
result.y=event.clientY;
}
return result;
};
Owl.prototype.isNumeric=function(number){
return !isNaN(parseFloat(number));
};
Owl.prototype.difference=function(first, second){
return {
x: first.x - second.x,
y: first.y - second.y
};};
$.fn.owlCarousel=function(option){
var args=Array.prototype.slice.call(arguments, 1);
return this.each(function(){
var $this=$(this),
data=$this.data('owl.carousel');
if(!data){
data=new Owl(this, typeof option=='object'&&option);
$this.data('owl.carousel', data);
$.each([
'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
], function(i, event){
data.register({ type: Owl.Type.Event, name: event });
data.$element.on(event + '.owl.carousel.core', $.proxy(function(e){
if(e.namespace&&e.relatedTarget!==this){
this.suppress([ event ]);
data[event].apply(this, [].slice.call(arguments, 1));
this.release([ event ]);
}}, data));
});
}
if(typeof option=='string'&&option.charAt(0)!=='_'){
data[option].apply(data, args);
}});
};
$.fn.owlCarousel.Constructor=Owl;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var AutoRefresh=function(carousel){
this._core=carousel;
this._interval=null;
this._visible=null;
this._handlers={
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoRefresh){
this.watch();
}}, this)
};
this._core.options=$.extend({}, AutoRefresh.Defaults, this._core.options);
this._core.$element.on(this._handlers);
};
AutoRefresh.Defaults={
autoRefresh: true,
autoRefreshInterval: 500
};
AutoRefresh.prototype.watch=function(){
if(this._interval){
return;
}
this._visible=this._core.$element.is(':visible');
this._interval=window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
};
AutoRefresh.prototype.refresh=function(){
if(this._core.$element.is(':visible')===this._visible){
return;
}
this._visible = !this._visible;
this._core.$element.toggleClass('owl-hidden', !this._visible);
this._visible&&(this._core.invalidate('width')&&this._core.refresh());
};
AutoRefresh.prototype.destroy=function(){
var handler, property;
window.clearInterval(this._interval);
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.AutoRefresh=AutoRefresh;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Lazy=function(carousel){
this._core=carousel;
this._loaded=[];
this._handlers={
'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e){
if(!e.namespace){
return;
}
if(!this._core.settings||!this._core.settings.lazyLoad){
return;
}
if((e.property&&e.property.name=='position')||e.type=='initialized'){
var settings=this._core.settings,
n=(settings.center&&Math.ceil(settings.items / 2)||settings.items),
i=((settings.center&&n * -1)||0),
position=(e.property&&e.property.value!==undefined ? e.property.value:this._core.current()) + i,
clones=this._core.clones().length,
load=$.proxy(function(i, v){ this.load(v) }, this);
while (i++ < n){
this.load(clones / 2 + this._core.relative(position));
clones&&$.each(this._core.clones(this._core.relative(position)), load);
position++;
}}
}, this)
};
this._core.options=$.extend({}, Lazy.Defaults, this._core.options);
this._core.$element.on(this._handlers);
};
Lazy.Defaults={
lazyLoad: false
};
Lazy.prototype.load=function(position){
var $item=this._core.$stage.children().eq(position),
$elements=$item&&$item.find('.owl-lazy');
if(!$elements||$.inArray($item.get(0), this._loaded) > -1){
return;
}
$elements.each($.proxy(function(index, element){
var $element=$(element), image,
url=(window.devicePixelRatio > 1&&$element.attr('data-src-retina'))||$element.attr('data-src');
this._core.trigger('load', { element: $element, url: url }, 'lazy');
if($element.is('img')){
$element.one('load.owl.lazy', $.proxy(function(){
$element.css('opacity', 1);
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
}, this)).attr('src', url);
}else{
image=new Image();
image.onload=$.proxy(function(){
$element.css({
'background-image': 'url("' + url + '")',
'opacity': '1'
});
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
}, this);
image.src=url;
}}, this));
this._loaded.push($item.get(0));
};
Lazy.prototype.destroy=function(){
var handler, property;
for (handler in this.handlers){
this._core.$element.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Lazy=Lazy;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var AutoHeight=function(carousel){
this._core=carousel;
this._handlers={
'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoHeight){
this.update();
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoHeight&&e.property.name=='position'){
this.update();
}}, this),
'loaded.owl.lazy': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoHeight
&& e.element.closest('.' + this._core.settings.itemClass).index()===this._core.current()){
this.update();
}}, this)
};
this._core.options=$.extend({}, AutoHeight.Defaults, this._core.options);
this._core.$element.on(this._handlers);
};
AutoHeight.Defaults={
autoHeight: false,
autoHeightClass: 'owl-height'
};
AutoHeight.prototype.update=function(){
var start=this._core._current,
end=start + this._core.settings.items,
visible=this._core.$stage.children().toArray().slice(start, end),
heights=[],
maxheight=0;
$.each(visible, function(index, item){
heights.push($(item).height());
});
maxheight=Math.max.apply(null, heights);
this._core.$stage.parent()
.height(maxheight)
.addClass(this._core.settings.autoHeightClass);
};
AutoHeight.prototype.destroy=function(){
var handler, property;
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.AutoHeight=AutoHeight;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Video=function(carousel){
this._core=carousel;
this._videos={};
this._playing=null;
this._handlers={
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace){
this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
}}, this),
'resize.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.video&&this.isInFullScreen()){
e.preventDefault();
}}, this),
'refreshed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.is('resizing')){
this._core.$stage.find('.cloned .owl-video-frame').remove();
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name==='position'&&this._playing){
this.stop();
}}, this),
'prepared.owl.carousel': $.proxy(function(e){
if(!e.namespace){
return;
}
var $element=$(e.content).find('.owl-video');
if($element.length){
$element.css('display', 'none');
this.fetch($element, $(e.content));
}}, this)
};
this._core.options=$.extend({}, Video.Defaults, this._core.options);
this._core.$element.on(this._handlers);
this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e){
this.play(e);
}, this));
};
Video.Defaults={
video: false,
videoHeight: false,
videoWidth: false
};
Video.prototype.fetch=function(target, item){
var type=(function(){
if(target.attr('data-vimeo-id')){
return 'vimeo';
}else if(target.attr('data-vzaar-id')){
return 'vzaar'
}else{
return 'youtube';
}})(),
id=target.attr('data-vimeo-id')||target.attr('data-youtube-id')||target.attr('data-vzaar-id'),
width=target.attr('data-width')||this._core.settings.videoWidth,
height=target.attr('data-height')||this._core.settings.videoHeight,
url=target.attr('href');
if(url){
id=url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
if(id[3].indexOf('youtu') > -1){
type='youtube';
}else if(id[3].indexOf('vimeo') > -1){
type='vimeo';
}else if(id[3].indexOf('vzaar') > -1){
type='vzaar';
}else{
throw new Error('Video URL not supported.');
}
id=id[6];
}else{
throw new Error('Missing video URL.');
}
this._videos[url]={
type: type,
id: id,
width: width,
height: height
};
item.attr('data-video', url);
this.thumbnail(target, this._videos[url]);
};
Video.prototype.thumbnail=function(target, video){
var tnLink,
icon,
path,
dimensions=video.width&&video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"':'',
customTn=target.find('img'),
srcType='src',
lazyClass='',
settings=this._core.settings,
create=function(path){
icon='<div class="owl-video-play-icon"></div>';
if(settings.lazyLoad){
tnLink='<div class="owl-video-tn ' + lazyClass + '" ' + srcType + '="' + path + '"></div>';
}else{
tnLink='<div class="owl-video-tn" style="opacity:1;background-image:url(' + path + ')"></div>';
}
target.after(tnLink);
target.after(icon);
};
target.wrap('<div class="owl-video-wrapper"' + dimensions + '></div>');
if(this._core.settings.lazyLoad){
srcType='data-src';
lazyClass='owl-lazy';
}
if(customTn.length){
create(customTn.attr(srcType));
customTn.remove();
return false;
}
if(video.type==='youtube'){
path="//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
create(path);
}else if(video.type==='vimeo'){
$.ajax({
type: 'GET',
url: '//vimeo.com/api/v2/video/' + video.id + '.json',
jsonp: 'callback',
dataType: 'jsonp',
success: function(data){
path=data[0].thumbnail_large;
create(path);
}});
}else if(video.type==='vzaar'){
$.ajax({
type: 'GET',
url: '//vzaar.com/api/videos/' + video.id + '.json',
jsonp: 'callback',
dataType: 'jsonp',
success: function(data){
path=data.framegrab_url;
create(path);
}});
}};
Video.prototype.stop=function(){
this._core.trigger('stop', null, 'video');
this._playing.find('.owl-video-frame').remove();
this._playing.removeClass('owl-video-playing');
this._playing=null;
this._core.leave('playing');
this._core.trigger('stopped', null, 'video');
};
Video.prototype.play=function(event){
var target=$(event.target),
item=target.closest('.' + this._core.settings.itemClass),
video=this._videos[item.attr('data-video')],
width=video.width||'100%',
height=video.height||this._core.$stage.height(),
html;
if(this._playing){
return;
}
this._core.enter('playing');
this._core.trigger('play', null, 'video');
item=this._core.items(this._core.relative(item.index()));
this._core.reset(item.index());
if(video.type==='youtube'){
html='<iframe width="' + width + '" height="' + height + '" src="//www.youtube.com/embed/' +
video.id + '?autoplay=1&rel=0&v=' + video.id + '" frameborder="0" allowfullscreen></iframe>';
}else if(video.type==='vimeo'){
html='<iframe src="//player.vimeo.com/video/' + video.id +
'?autoplay=1" width="' + width + '" height="' + height +
'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
}else if(video.type==='vzaar'){
html='<iframe frameborder="0"' + 'height="' + height + '"' + 'width="' + width +
'" allowfullscreen mozallowfullscreen webkitAllowFullScreen ' +
'src="//view.vzaar.com/' + video.id + '/player?autoplay=true"></iframe>';
}
$('<div class="owl-video-frame">' + html + '</div>').insertAfter(item.find('.owl-video'));
this._playing=item.addClass('owl-video-playing');
};
Video.prototype.isInFullScreen=function(){
var element=document.fullscreenElement||document.mozFullScreenElement ||
document.webkitFullscreenElement;
return element&&$(element).parent().hasClass('owl-video-frame');
};
Video.prototype.destroy=function(){
var handler, property;
this._core.$element.off('click.owl.video');
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Video=Video;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Animate=function(scope){
this.core=scope;
this.core.options=$.extend({}, Animate.Defaults, this.core.options);
this.swapping=true;
this.previous=undefined;
this.next=undefined;
this.handlers={
'change.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name=='position'){
this.previous=this.core.current();
this.next=e.property.value;
}}, this),
'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e){
if(e.namespace){
this.swapping=e.type=='translated';
}}, this),
'translate.owl.carousel': $.proxy(function(e){
if(e.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){
this.swap();
}}, this)
};
this.core.$element.on(this.handlers);
};
Animate.Defaults={
animateOut: false,
animateIn: false
};
Animate.prototype.swap=function(){
if(this.core.settings.items!==1){
return;
}
if(!$.support.animation||!$.support.transition){
return;
}
this.core.speed(0);
var left,
clear=$.proxy(this.clear, this),
previous=this.core.$stage.children().eq(this.previous),
next=this.core.$stage.children().eq(this.next),
incoming=this.core.settings.animateIn,
outgoing=this.core.settings.animateOut;
if(this.core.current()===this.previous){
return;
}
if(outgoing){
left=this.core.coordinates(this.previous) - this.core.coordinates(this.next);
previous.one($.support.animation.end, clear)
.css({ 'left': left + 'px' })
.addClass('animated owl-animated-out')
.addClass(outgoing);
}
if(incoming){
next.one($.support.animation.end, clear)
.addClass('animated owl-animated-in')
.addClass(incoming);
}};
Animate.prototype.clear=function(e){
$(e.target).css({ 'left': '' })
.removeClass('animated owl-animated-out owl-animated-in')
.removeClass(this.core.settings.animateIn)
.removeClass(this.core.settings.animateOut);
this.core.onTransitionEnd();
};
Animate.prototype.destroy=function(){
var handler, property;
for (handler in this.handlers){
this.core.$element.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Animate=Animate;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Autoplay=function(carousel){
this._core=carousel;
this._timeout=null;
this._paused=false;
this._handlers={
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name==='settings'){
if(this._core.settings.autoplay){
this.play();
}else{
this.stop();
}}else if(e.namespace&&e.property.name==='position'){
if(this._core.settings.autoplay){
this._setAutoPlayInterval();
}}
}, this),
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoplay){
this.play();
}}, this),
'play.owl.autoplay': $.proxy(function(e, t, s){
if(e.namespace){
this.play(t, s);
}}, this),
'stop.owl.autoplay': $.proxy(function(e){
if(e.namespace){
this.stop();
}}, this),
'mouseover.owl.autoplay': $.proxy(function(){
if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){
this.pause();
}}, this),
'mouseleave.owl.autoplay': $.proxy(function(){
if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){
this.play();
}}, this),
'touchstart.owl.core': $.proxy(function(){
if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){
this.pause();
}}, this),
'touchend.owl.core': $.proxy(function(){
if(this._core.settings.autoplayHoverPause){
this.play();
}}, this)
};
this._core.$element.on(this._handlers);
this._core.options=$.extend({}, Autoplay.Defaults, this._core.options);
};
Autoplay.Defaults={
autoplay: false,
autoplayTimeout: 5000,
autoplayHoverPause: false,
autoplaySpeed: false
};
Autoplay.prototype.play=function(timeout, speed){
this._paused=false;
if(this._core.is('rotating')){
return;
}
this._core.enter('rotating');
this._setAutoPlayInterval();
};
Autoplay.prototype._getNextTimeout=function(timeout, speed){
if(this._timeout){
window.clearTimeout(this._timeout);
}
return window.setTimeout($.proxy(function(){
if(this._paused||this._core.is('busy')||this._core.is('interacting')||document.hidden){
return;
}
this._core.next(speed||this._core.settings.autoplaySpeed);
}, this), timeout||this._core.settings.autoplayTimeout);
};
Autoplay.prototype._setAutoPlayInterval=function(){
this._timeout=this._getNextTimeout();
};
Autoplay.prototype.stop=function(){
if(!this._core.is('rotating')){
return;
}
window.clearTimeout(this._timeout);
this._core.leave('rotating');
};
Autoplay.prototype.pause=function(){
if(!this._core.is('rotating')){
return;
}
this._paused=true;
};
Autoplay.prototype.destroy=function(){
var handler, property;
this.stop();
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
'use strict';
var Navigation=function(carousel){
this._core=carousel;
this._initialized=false;
this._pages=[];
this._controls={};
this._templates=[];
this.$element=this._core.$element;
this._overrides={
next: this._core.next,
prev: this._core.prev,
to: this._core.to
};
this._handlers={
'prepared.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.dotsData){
this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
}}, this),
'added.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.dotsData){
this._templates.splice(e.position, 0, this._templates.pop());
}}, this),
'remove.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.dotsData){
this._templates.splice(e.position, 1);
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name=='position'){
this.draw();
}}, this),
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&!this._initialized){
this._core.trigger('initialize', null, 'navigation');
this.initialize();
this.update();
this.draw();
this._initialized=true;
this._core.trigger('initialized', null, 'navigation');
}}, this),
'refreshed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._initialized){
this._core.trigger('refresh', null, 'navigation');
this.update();
this.draw();
this._core.trigger('refreshed', null, 'navigation');
}}, this)
};
this._core.options=$.extend({}, Navigation.Defaults, this._core.options);
this.$element.on(this._handlers);
};
Navigation.Defaults={
nav: false,
navText: [ 'prev', 'next' ],
navSpeed: false,
navElement: 'div',
navContainer: false,
navContainerClass: 'owl-nav',
navClass: [ 'owl-prev', 'owl-next' ],
slideBy: 1,
dotClass: 'owl-dot',
dotsClass: 'owl-dots',
dots: true,
dotsEach: false,
dotsData: false,
dotsSpeed: false,
dotsContainer: false
};
Navigation.prototype.initialize=function(){
var override,
settings=this._core.settings;
this._controls.$relative=(settings.navContainer ? $(settings.navContainer)
: $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
this._controls.$previous=$('<' + settings.navElement + '>')
.addClass(settings.navClass[0])
.html(settings.navText[0])
.prependTo(this._controls.$relative)
.on('click', $.proxy(function(e){
this.prev(settings.navSpeed);
}, this));
this._controls.$next=$('<' + settings.navElement + '>')
.addClass(settings.navClass[1])
.html(settings.navText[1])
.appendTo(this._controls.$relative)
.on('click', $.proxy(function(e){
this.next(settings.navSpeed);
}, this));
if(!settings.dotsData){
this._templates=[ $('<div>')
.addClass(settings.dotClass)
.append($('<span>'))
.prop('outerHTML') ];
}
this._controls.$absolute=(settings.dotsContainer ? $(settings.dotsContainer)
: $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
this._controls.$absolute.on('click', 'div', $.proxy(function(e){
var index=$(e.target).parent().is(this._controls.$absolute)
? $(e.target).index():$(e.target).parent().index();
e.preventDefault();
this.to(index, settings.dotsSpeed);
}, this));
for (override in this._overrides){
this._core[override]=$.proxy(this[override], this);
}};
Navigation.prototype.destroy=function(){
var handler, control, property, override;
for (handler in this._handlers){
this.$element.off(handler, this._handlers[handler]);
}
for (control in this._controls){
this._controls[control].remove();
}
for (override in this.overides){
this._core[override]=this._overrides[override];
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
Navigation.prototype.update=function(){
var i, j, k,
lower=this._core.clones().length / 2,
upper=lower + this._core.items().length,
maximum=this._core.maximum(true),
settings=this._core.settings,
size=settings.center||settings.autoWidth||settings.dotsData
? 1:settings.dotsEach||settings.items;
if(settings.slideBy!=='page'){
settings.slideBy=Math.min(settings.slideBy, settings.items);
}
if(settings.dots||settings.slideBy=='page'){
this._pages=[];
for (i=lower, j=0, k=0; i < upper; i++){
if(j >=size||j===0){
this._pages.push({
start: Math.min(maximum, i - lower),
end: i - lower + size - 1
});
if(Math.min(maximum, i - lower)===maximum){
break;
}
j=0, ++k;
}
j +=this._core.mergers(this._core.relative(i));
}}
};
Navigation.prototype.draw=function(){
var difference,
settings=this._core.settings,
disabled=this._core.items().length <=settings.items,
index=this._core.relative(this._core.current()),
loop=settings.loop||settings.rewind;
this._controls.$relative.toggleClass('disabled', !settings.nav||disabled);
if(settings.nav){
this._controls.$previous.toggleClass('disabled', !loop&&index <=this._core.minimum(true));
this._controls.$next.toggleClass('disabled', !loop&&index >=this._core.maximum(true));
}
this._controls.$absolute.toggleClass('disabled', !settings.dots||disabled);
if(settings.dots){
difference=this._pages.length - this._controls.$absolute.children().length;
if(settings.dotsData&&difference!==0){
this._controls.$absolute.html(this._templates.join(''));
}else if(difference > 0){
this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
}else if(difference < 0){
this._controls.$absolute.children().slice(difference).remove();
}
this._controls.$absolute.find('.active').removeClass('active');
this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
}};
Navigation.prototype.onTrigger=function(event){
var settings=this._core.settings;
event.page={
index: $.inArray(this.current(), this._pages),
count: this._pages.length,
size: settings&&(settings.center||settings.autoWidth||settings.dotsData
? 1:settings.dotsEach||settings.items)
};};
Navigation.prototype.current=function(){
var current=this._core.relative(this._core.current());
return $.grep(this._pages, $.proxy(function(page, index){
return page.start <=current&&page.end >=current;
}, this)).pop();
};
Navigation.prototype.getPosition=function(successor){
var position, length,
settings=this._core.settings;
if(settings.slideBy=='page'){
position=$.inArray(this.current(), this._pages);
length=this._pages.length;
successor ? ++position:--position;
position=this._pages[((position % length) + length) % length].start;
}else{
position=this._core.relative(this._core.current());
length=this._core.items().length;
successor ? position +=settings.slideBy:position -=settings.slideBy;
}
return position;
};
Navigation.prototype.next=function(speed){
$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
};
Navigation.prototype.prev=function(speed){
$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
};
Navigation.prototype.to=function(position, speed, standard){
var length;
if(!standard&&this._pages.length){
length=this._pages.length;
$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
}else{
$.proxy(this._overrides.to, this._core)(position, speed);
}};
$.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
'use strict';
var Hash=function(carousel){
this._core=carousel;
this._hashes={};
this.$element=this._core.$element;
this._handlers={
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.startPosition==='URLHash'){
$(window).trigger('hashchange.owl.navigation');
}}, this),
'prepared.owl.carousel': $.proxy(function(e){
if(e.namespace){
var hash=$(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
if(!hash){
return;
}
this._hashes[hash]=e.content;
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name==='position'){
var current=this._core.items(this._core.relative(this._core.current())),
hash=$.map(this._hashes, function(item, hash){
return item===current ? hash:null;
}).join();
if(!hash||window.location.hash.slice(1)===hash){
return;
}
window.location.hash=hash;
}}, this)
};
this._core.options=$.extend({}, Hash.Defaults, this._core.options);
this.$element.on(this._handlers);
$(window).on('hashchange.owl.navigation', $.proxy(function(e){
var hash=window.location.hash.substring(1),
items=this._core.$stage.children(),
position=this._hashes[hash]&&items.index(this._hashes[hash]);
if(position===undefined||position===this._core.current()){
return;
}
this._core.to(this._core.relative(position), false, true);
}, this));
};
Hash.Defaults={
URLhashListener: false
};
Hash.prototype.destroy=function(){
var handler, property;
$(window).off('hashchange.owl.navigation');
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Hash=Hash;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var style=$('<support>').get(0).style,
prefixes='Webkit Moz O ms'.split(' '),
events={
transition: {
end: {
WebkitTransition: 'webkitTransitionEnd',
MozTransition: 'transitionend',
OTransition: 'oTransitionEnd',
transition: 'transitionend'
}},
animation: {
end: {
WebkitAnimation: 'webkitAnimationEnd',
MozAnimation: 'animationend',
OAnimation: 'oAnimationEnd',
animation: 'animationend'
}}
},
tests={
csstransforms: function(){
return !!test('transform');
},
csstransforms3d: function(){
return !!test('perspective');
},
csstransitions: function(){
return !!test('transition');
},
cssanimations: function(){
return !!test('animation');
}};
function test(property, prefixed){
var result=false,
upper=property.charAt(0).toUpperCase() + property.slice(1);
$.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property){
if(style[property]!==undefined){
result=prefixed ? property:true;
return false;
}});
return result;
}
function prefixed(property){
return test(property, true);
}
if(tests.csstransitions()){
$.support.transition=new String(prefixed('transition'))
$.support.transition.end=events.transition.end[ $.support.transition ];
}
if(tests.cssanimations()){
$.support.animation=new String(prefixed('animation'))
$.support.animation.end=events.animation.end[ $.support.animation ];
}
if(tests.csstransforms()){
$.support.transform=new String(prefixed('transform'));
$.support.transform3d=tests.csstransforms3d();
}})(window.Zepto||window.jQuery, window, document);
jQuery(function(f){var t,g=f(".ywcps-wrapper");f.fn.owlCarousel&&g.length&&(t=function(a){var e=parseInt(a.data("n_items")),t=parseInt(a.data("auto_play")),n=t,o=a.data("en_responsive"),s=parseInt(a.data("n_item_desk_small")),i=parseInt(a.data("n_item_tablet")),r=parseInt(a.data("n_item_mobile")),l=a.data("is_loop"),p=parseInt(a.data("pag_speed")),c=a.data("stop_hov"),d=a.data("show_nav"),u=a.data("en_rtl"),_=a.data("anim_in"),m=a.data("anim_out"),w=(parseInt(a.data("anim_speed")),a.data("show_dot_nav")),y=a.data("slide_by");o||(r=i=e);var h=a.find(".ywcps-products"),v={message:null,overlayCSS:{background:"#fff",opacity:.6},ignoreIfBlocked:!0};h.on("initialize.owl.carousel",function(a){a=a.currentTarget;f(a).parents(".ywcps-wrapper").block(v)}),h.on("initialized.owl.carousel ",function(a){a=a.currentTarget;f(a).parents(".ywcps-wrapper").unblock(),f(a).parents(".ywcps-slider").css({visibility:"visible"})}),h.owlCarousel({responsiveClass:o,animateOut:m,animateIn:_,margin:parseInt(ywcps_params.margin_item),responsive:{0:{items:r,slideBy:1},479:{items:i},769:{items:s},1100:{items:e,slideBy:y}},items:e,autoplay:n,autoplayTimeout:t,autoplayHoverPause:c,loop:"loop"===ywcps_params.loop_or_rewind,rewind:l,rtl:u,fluidSpeed:p,dots:w,nav:!1,addClassActive:!0});u=a.find(".ywcps-nav-prev"),p=a.find(".ywcps-nav-next"),u=u.attr("id"),p=p.attr("id");d||(f("#"+u).hide(),f("#"+p).hide()),w||f(".owl-theme .owl-controls").hide(),a.on("click","#"+p,function(){h.trigger("next.owl.carousel")}),a.on("click","#"+u,function(){h.trigger("prev.owl.carousel")}),"true"==ywcps_params.enable_mousewheel&&a.on("mousewheel",".owl-stage",function(a){0<a.deltaY?h.trigger("next.owl"):h.trigger("prev.owl"),a.preventDefault()}),g.parent().hasClass("woocommerce")&&a.on("translated.owl.carousel",function(){"function"==typeof apply_hover&&apply_hover(),"function"==typeof yit_change_thumb_loop&&yit_change_thumb_loop()}),f(document).trigger("yith_owl_initialized",[h])},g.each(function(){var a=f(this);ywcps_params.yit_theme?t(a):a.closest(".vc_tta-panel").length?a.closest(".vc_tta-panel").hasClass("vc_active")&&t(a):a.closest(".panel.group").length&&!a.closest(".panel.group").hasClass("showing")||t(a)}),ywcps_params.yit_theme||(f(document).on("show.vc.tab",function(a){a=a.target,a=f(a).attr("href");t(f(a).find(g))}),f(".tabs-container").on("tab-opened",function(a,e){t(e.find(g))})))});
(typeof define==="function"&&define.amd?define:function(e,t){if(typeof module!=="undefined"&&module.exports)module.exports=t(require("jquery"));else window.toastr=t(window.jQuery)})(["jquery"],function(v){return H=0,i="error",a="info",r="success",l="warning",e={clear:function(e,t){var s=T();b||C(s);o(e,s,t)||(e=>{for(var t=b.children(),s=t.length-1;0<=s;s--)o(v(t[s]),e)})(s)},remove:function(e){var t=T();b||C(t);e&&0===v(":focus",e).length?O(e):b.children().length&&b.remove()},error:function(e,t,s){return n({type:i,iconClass:T().iconClasses.error,message:e,optionsOverride:s,title:t})},getContainer:C,info:function(e,t,s){return n({type:a,iconClass:T().iconClasses.info,message:e,optionsOverride:s,title:t})},options:{},subscribe:function(e){t=e},success:function(e,t,s){return n({type:r,iconClass:T().iconClasses.success,message:e,optionsOverride:s,title:t})},version:"2.1.4",warning:function(e,t,s){return n({type:l,iconClass:T().iconClasses.warning,message:e,optionsOverride:s,title:t})}};function C(e,t){return e=e||T(),(b=v("#"+e.containerId)).length||t&&(t=e,(b=v("<div/>").attr("id",t.containerId).addClass(t.positionClass)).appendTo(v(t.target))),b}function o(e,t,s){s=!(!s||!s.force)&&s.force;return e&&(s||0===v(":focus",e).length)&&(e[t.hideMethod]({duration:t.hideDuration,easing:t.hideEasing,complete:function(){O(e)}}),1)}function w(e){t&&t(e)}function n(e){var n=T(),t=e.iconClass||n.iconClass;if(void 0!==e.optionsOverride&&(n=v.extend(n,e.optionsOverride),t=e.optionsOverride.iconClass||t),!((e,t)=>{if(e.preventDuplicates){if(t.message===D)return 1;D=t.message}})(n,e)){H++,b=C(n,!0);var i=null,a=v("<div/>"),s=v("<div/>"),o=v("<div/>"),r=v("<div/>"),l=v(n.closeHtml),d={intervalId:null,hideEta:null,maxHideTime:null},c={toastId:H,state:"visible",startTime:new Date,options:n,map:e},u=(e.iconClass&&a.addClass(n.toastClass).addClass(t),e.title&&(t=e.title,n.escapeHtml&&(t=p(e.title)),s.append(t).addClass(n.titleClass),a.append(s)),e.message&&(t=e.message,n.escapeHtml&&(t=p(e.message)),o.append(t).addClass(n.messageClass),a.append(o)),n.closeButton&&(l.addClass(n.closeClass).attr("role","button"),a.prepend(l)),n.progressBar&&(r.addClass(n.progressClass),a.prepend(r)),n.rtl&&a.addClass("rtl"),n.newestOnTop?b.prepend(a):b.append(a),"");switch(e.iconClass){case"toast-success":case"toast-info":u="polite";break;default:u="assertive"}return a.attr("aria-live",u),a.hide(),a[n.showMethod]({duration:n.showDuration,easing:n.showEasing,complete:n.onShown}),0<n.timeOut&&(i=setTimeout(m,n.timeOut),d.maxHideTime=parseFloat(n.timeOut),d.hideEta=(new Date).getTime()+d.maxHideTime,n.progressBar)&&(d.intervalId=setInterval(h,10)),n.closeOnHover&&a.hover(f,g),!n.onclick&&n.tapToDismiss&&a.click(m),n.closeButton&&l&&l.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),n.onCloseClick&&n.onCloseClick(e),m(!0)}),n.onclick&&a.click(function(e){n.onclick(e),m()}),w(c),n.debug&&console&&console.log(c),a}function p(e){return(e=null==e?"":e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function m(e){var t=e&&!1!==n.closeMethod?n.closeMethod:n.hideMethod,s=e&&!1!==n.closeDuration?n.closeDuration:n.hideDuration,o=e&&!1!==n.closeEasing?n.closeEasing:n.hideEasing;if(!v(":focus",a).length||e)return clearTimeout(d.intervalId),a[t]({duration:s,easing:o,complete:function(){O(a),clearTimeout(i),n.onHidden&&"hidden"!==c.state&&n.onHidden(),c.state="hidden",c.endTime=new Date,w(c)}})}function g(){(0<n.timeOut||0<n.extendedTimeOut)&&(i=setTimeout(m,n.extendedTimeOut),d.maxHideTime=parseFloat(n.extendedTimeOut),d.hideEta=(new Date).getTime()+d.maxHideTime)}function f(){clearTimeout(i),d.hideEta=0,a.stop(!0,!0)[n.showMethod]({duration:n.showDuration,easing:n.showEasing})}function h(){var e=(d.hideEta-(new Date).getTime())/d.maxHideTime*100;r.width(e+"%")}}function T(){return v.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},e.options)}function O(e){b=b||C(),e.is(":visible")||(e.remove(),e=null,0===b.children().length&&(b.remove(),D=void 0))}var b,t,D,H,i,a,r,l,e});
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}(u=>{var f,h,n,b=u(window),a={},g=[],v=[],m=null,s="_open",y="_close",_=[],k=null,l=/(iPad|iPhone|iPod)/.test(navigator.userAgent),w={_init:function(t){var o=u(t),e=o.data("popupoptions");v[t.id]=!1,g[t.id]=0,o.data("popup-initialized")||(o.attr("data-popup-initialized","true"),w._initonce(t)),e.autoopen&&setTimeout(function(){w.show(t,0)},0)},_initonce:function(e){var t,o,i=u(e),n=u("body"),a=i.data("popupoptions"),p=(m=parseInt(n.css("margin-right"),10),k=void 0!==document.body.style.webkitTransition||void 0!==document.body.style.MozTransition||void 0!==document.body.style.msTransition||void 0!==document.body.style.OTransition||void 0!==document.body.style.transition,a.scrolllock&&void 0===f&&(o=(p=u('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body")).children(),f=o.innerWidth()-o.height(99).innerWidth(),p.remove()),i.attr("id")||i.attr("id","j-popup-"+parseInt(1e8*Math.random(),10)),i.addClass("popup_content"),a.background&&!u("#"+e.id+"_background").length&&(n.append('<div id="'+e.id+'_background" class="popup_background"></div>'),(t=u("#"+e.id+"_background")).css({opacity:0,visibility:"hidden",backgroundColor:a.color,position:"fixed",top:0,right:0,bottom:0,left:0}),a.setzindex&&!a.autozindex&&t.css("z-index","100000"),a.transition)&&t.css("transition",a.transition),n.append(e),i.wrap('<div id="'+e.id+'_wrapper" class="popup_wrapper" />'),(o=u("#"+e.id+"_wrapper")).css({opacity:0,visibility:"hidden",position:"absolute"}),l&&((t=u("#"+e.id+"_background")).css("cursor","pointer"),u(a.pagecontainer).css("cursor","pointer")),"overlay"==a.type&&!a.absolute&&a.background&&(o.css("overflow","auto"),o[0].style.WebkitOverflowScrolling="touch"),i.css({opacity:0,visibility:"hidden","pointer-events":"auto",display:"inline-block"}),a.setzindex&&!a.autozindex&&o.css("z-index","100001"),a.outline||i.css("outline","none"),a.transition&&(i.css("transition",a.transition),o.css("transition",a.transition)),i.attr("aria-hidden",!0),"overlay"==a.type&&(i.css({textAlign:"left",position:"relative",verticalAlign:"middle"}),o.css({position:"fixed",width:"100%",height:"100%",top:0,left:0,textAlign:"center"}),o.append('<div class="popup_align" />'),u(".popup_align").css({display:"inline-block",verticalAlign:"middle",height:"100%"})),i.attr("role","dialog"),a.openelement||"."+e.id+s);u(p).each(function(t,o){u(o).attr("data-popup-ordinal",t),o.id||u(o).attr("id","open_"+parseInt(1e8*Math.random(),10))}),i.attr("aria-labelledby")||i.attr("aria-label")||i.attr("aria-labelledby",u(p).attr("id")),"hover"==a.action?(a.keepfocus=!1,u(p).on("mouseenter",function(){w.show(e,u(this).data("popup-ordinal"))}),u(p).on("mouseleave",function(){w.hide(e)})):u(document).on("click.jqp",p,function(t){t.preventDefault();var o=u(this).data("popup-ordinal");setTimeout(function(){w.show(e,o)},0)}),a.closebutton&&w.addclosebutton(e),a.detach?i.detach():i.hide()},show:function(t,o){var e=u(t);if(!e.data("popup-visible")){e.data("popup-initialized")||w._init(t),e.attr("data-popup-initialized","true");var i=u("body"),n=e.data("popupoptions"),a=u("#"+t.id+"_wrapper"),p=u("#"+t.id+"_background");if(x(t,o,n.beforeopen),v[t.id]=o,setTimeout(function(){_.push(t.id)},0),n.autozindex){for(var s=document.getElementsByTagName("*"),l=s.length,d=0,r=0;r<l;r++){var c=u(s[r]).css("z-index");"auto"!==c&&d<(c=parseInt(c,10))&&(d=c)}g[t.id]=d,n.background&&0<=g[t.id]&&u("#"+t.id+"_background").css({zIndex:g[t.id]+1}),0<=g[t.id]&&a.css({zIndex:g[t.id]+2})}n.detach&&a.prepend(t),e.show(),h=setTimeout(function(){a.css({visibility:"visible",opacity:1}),u("html").addClass("popup_visible").addClass("popup_visible_"+t.id),a.addClass("popup_wrapper_visible")},20),n.scrolllock&&(i.css("overflow","hidden"),i.height()>b.height())&&i.css("margin-right",m+f),e.css({visibility:"visible",opacity:1}),n.background&&(p.css({visibility:"visible",opacity:n.opacity}),setTimeout(function(){p.css({opacity:n.opacity})},0)),e.data("popup-visible",!0),w.reposition(t,o),e.data("focusedelementbeforepopup",document.activeElement),e.attr("tabindex",-1),setTimeout(function(){"closebutton"===n.focuselement?u("#"+t.id+" ."+t.id+y+":first").focus():n.focuselement?u(n.focuselement).focus():!0!==n.focuselement&&!n.keepfocus||e.focus()},n.focusdelay),n.keepfocus&&u(n.pagecontainer).attr("aria-hidden",!0),e.attr("aria-hidden",!1),x(t,o,n.onopen),k?a.one("transitionend",function(){x(t,o,n.opentransitionend)}):x(t,o,n.opentransitionend),"tooltip"==n.type&&u(window).on("resize."+t.id,function(){w.reposition(t,o)})}},hide:function(t,o){var e,i,n,a,p,s=u.inArray(t.id,_);-1!==s&&(h&&clearTimeout(h),e=u("body"),i=u(t),n=i.data("popupoptions"),a=u("#"+t.id+"_wrapper"),p=u("#"+t.id+"_background"),i.data("popup-visible",!1),1===_.length?u("html").removeClass("popup_visible").removeClass("popup_visible_"+t.id):u("html").hasClass("popup_visible_"+t.id)&&u("html").removeClass("popup_visible_"+t.id),_.splice(s,1),a.hasClass("popup_wrapper_visible")&&a.removeClass("popup_wrapper_visible"),n.keepfocus&&!o&&setTimeout(function(){u(i.data("focusedelementbeforepopup")).is(":visible")&&i.data("focusedelementbeforepopup").focus()},0),a.css({visibility:"hidden",opacity:0}),i.css({visibility:"hidden",opacity:0}),n.background&&p.css({visibility:"hidden",opacity:0}),u(n.pagecontainer).attr("aria-hidden",!1),i.attr("aria-hidden",!0),x(t,v[t.id],n.onclose),k&&"0s"!==i.css("transition-duration")?i.one("transitionend",function(){i.data("popup-visible")||(n.detach?i.detach():i.hide()),n.scrolllock&&setTimeout(function(){u.grep(_,function(t){return u("#"+t).data("popupoptions").scrolllock}).length||e.css({overflow:"visible","margin-right":m})},10),x(t,v[t.id],n.closetransitionend)}):(n.detach?i.detach():i.hide(),n.scrolllock&&setTimeout(function(){u.grep(_,function(t){return u("#"+t).data("popupoptions").scrolllock}).length||e.css({overflow:"visible","margin-right":m})},10),x(t,v[t.id],n.closetransitionend)),"tooltip"==n.type)&&u(window).off("resize."+t.id)},toggle:function(t,o){u(t).data("popup-visible")?w.hide(t):setTimeout(function(){w.show(t,o)},0)},reposition:function(t,o){var e,i=u(t),n=i.data("popupoptions"),a=u("#"+t.id+"_wrapper");o=o||0,"tooltip"==n.type?(a.css({position:"absolute"}),e=(o=n.tooltipanchor?u(n.tooltipanchor):n.openelement?u(n.openelement).filter('[data-popup-ordinal="'+o+'"]'):u("."+t.id+s+'[data-popup-ordinal="'+o+'"]')).offset()||{left:0,top:0},"right"==n.horizontal?a.css("left",e.left+o.outerWidth()+n.offsetleft):"leftedge"==n.horizontal?a.css("left",e.left+n.offsetleft):"left"==n.horizontal?a.css("right",b.width()-e.left-n.offsetleft):"rightedge"==n.horizontal?a.css("right",b.width()-e.left-o.outerWidth()-n.offsetleft):a.css("left",e.left+o.outerWidth()/2-i.outerWidth()/2-parseFloat(i.css("marginLeft"))+n.offsetleft),"bottom"==n.vertical?a.css("top",e.top+o.outerHeight()+n.offsettop):"bottomedge"==n.vertical?a.css("top",e.top+o.outerHeight()-i.outerHeight()+n.offsettop):"top"==n.vertical?a.css("bottom",b.height()-e.top-n.offsettop):"topedge"==n.vertical?a.css("bottom",b.height()-e.top-i.outerHeight()-n.offsettop):a.css("top",e.top+o.outerHeight()/2-i.outerHeight()/2-parseFloat(i.css("marginTop"))+n.offsettop)):"overlay"==n.type&&(n.horizontal?a.css("text-align",n.horizontal):a.css("text-align","center"),n.vertical?i.css("vertical-align",n.vertical):i.css("vertical-align","middle"),n.absolute&&a.css({position:"absolute",top:window.scrollY}),n.background||(a.css({"pointer-events":"none"}),n.absolute)||p(t)||(i.css("overflow","auto"),i[0].style.WebkitOverflowScrolling="touch",i.css("max-height","calc(100% - "+i.css("margin-top")+" - "+i.css("margin-bottom")+")")))},addclosebutton:function(t){var o=u(t).data("popupoptions").closebuttonmarkup?u(a.closebuttonmarkup).addClass(t.id+"_close"):'<button class="popup_close '+t.id+'_close" title="Close" aria-label="Close"><span aria-hidden="true">×</span></button>';u(t).data("popup-initialized")&&u(t).append(o)}},x=function(t,o,e){var i=u(t).data("popupoptions");void 0!==i&&(i=i.openelement||"."+t.id+s,i=u(i+'[data-popup-ordinal="'+o+'"]'),"function"==typeof e)&&e.call(u(t),t,i)},p=function(t){t=t.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)};u(document).on("keydown",function(t){var o;_.length&&(o=document.getElementById(_[_.length-1]),u(o).data("popupoptions").escape)&&27==t.keyCode&&w.hide(o)}),u(document).on("mousedown",function(t){n=t.target}),u(document).on("click",function(t){var o,e,i;_.length&&(o=_[_.length-1],e=document.getElementById(o),i=u(e).data("popupoptions")&&u(e).data("popupoptions").closeelement?u(e).data("popupoptions").closeelement:"."+e.id+y,u(t.target).closest(i).length&&(t.preventDefault(),w.hide(e)),u(e).data("popupoptions"))&&u(e).data("popupoptions").blur&&!u(t.target).closest(u(e).data("popupoptions").blurignore).length&&!u(t.target).closest("#"+o).length&&!u(n).closest("#"+o).length&&2!==t.which&&u(t.target).is(":visible")&&(u(e).data("popupoptions").background?(w.hide(e),t.preventDefault()):w.hide(e,!0))}),u(document).on("keydown",function(t){var o,e,i,n;_.length&&9==t.which&&(o=document.getElementById(_[_.length-1]),u(o).data("popupoptions").keepfocus)&&(e=u(o).find("*").filter("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]").filter(":visible"),n=u(":focus"),i=e.length,n=e.index(n),0===i?(u(o).focus(),t.preventDefault()):t.shiftKey?0===n&&(e.get(i-1).focus(),t.preventDefault()):n==i-1&&(e.get(0).focus(),t.preventDefault()))}),u.fn.popup=function(i){return this.each(function(){var t,o=u(this),e=u.extend(!0,{},u.fn.popup.defaults);i&&"tooltip"===i.type&&(e.background=!1),"object"===_typeof(i)?(t=u.extend({},e,o.data("popupoptions"),i),o.data("popupoptions",t),a=o.data("popupoptions"),w._init(this)):"string"==typeof i?(o.data("popupoptions")||(o.data("popupoptions",e),a=o.data("popupoptions")),w[i].call(this,this)):(o.data("popupoptions")||(o.data("popupoptions",e),a=o.data("popupoptions")),w._init(this))})},u.fn.popup.destroyall=function(){for(var t=0;t<_.length;t++)u("#"+_[t]).popup("hide");u(".popup_wrapper").remove(),u(".popup_background").remove(),u(document).off("click.jqp")},u.fn.popup.defaults={type:"overlay",absolute:!1,autoopen:!1,background:!0,color:"black",opacity:"0.5",horizontal:"center",vertical:"middle",offsettop:0,offsetleft:0,escape:!0,blur:!0,blurignore:null,setzindex:!0,autozindex:!1,scrolllock:!1,closebutton:!1,closebuttonmarkup:null,keepfocus:!0,focuselement:null,focusdelay:50,outline:!1,pagecontainer:null,detach:!1,openelement:null,closeelement:null,transition:null,tooltipanchor:null,beforeopen:null,onclose:null,onopen:null,opentransitionend:null,closetransitionend:null}})(jQuery);
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&e(jQuery)}(function(f){"use strict";function u(e){return"function"==typeof e}var i,r,v={interval:100,sensitivity:6,timeout:0},s=0,a=function(e){i=e.pageX,r=e.pageY},p=function(e,t,n,o){if(Math.sqrt((n.pX-i)*(n.pX-i)+(n.pY-r)*(n.pY-r))<o.sensitivity)return t.off(n.event,a),delete n.timeoutId,n.isActive=!0,e.pageX=i,e.pageY=r,delete n.pX,delete n.pY,o.over.apply(t[0],[e]);n.pX=i,n.pY=r,n.timeoutId=setTimeout(function(){p(e,t,n,o)},o.interval)};f.fn.hoverIntent=function(e,t,n){function o(e){var u=f.extend({},e),r=f(this),v=((t=r.data("hoverIntent"))||r.data("hoverIntent",t={}),t[i]),t=(v||(t[i]=v={id:i}),v.timeoutId&&(v.timeoutId=clearTimeout(v.timeoutId)),v.event="mousemove.hoverIntent.hoverIntent"+i);"mouseenter"===e.type?v.isActive||(v.pX=u.pageX,v.pY=u.pageY,r.off(t,a).on(t,a),v.timeoutId=setTimeout(function(){p(u,r,v,d)},d.interval)):v.isActive&&(r.off(t,a),v.timeoutId=setTimeout(function(){var e,t,n,o,i;e=u,t=r,n=v,o=d.out,(i=t.data("hoverIntent"))&&delete i[n.id],o.apply(t[0],[e])},d.timeout))}var i=s++,d=f.extend({},v);f.isPlainObject(e)?(d=f.extend(d,e),u(d.out)||(d.out=d.over)):d=u(t)?f.extend(d,{over:e,out:t,selector:n}):f.extend(d,{over:e,out:e,selector:t});return this.on({"mouseenter.hoverIntent":o,"mouseleave.hoverIntent":o},d.selector)}});
!function i(a,n,r){function s(e,t){if(!n[e]){if(!a[e]){var o="function"==typeof require&&require;if(!t&&o)return o(e,!0);if(l)return l(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}o=n[e]={exports:{}},a[e][0].call(o.exports,function(t){return s(a[e][1][t]||t)},o,o.exports,i,a,n,r)}return n[e].exports}for(var l="function"==typeof require&&require,t=0;t<r.length;t++)s(r[t]);return s}({1:[function(t,e,o){function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var w;(w=jQuery).noConflict(),w(document).ready(function(){var n,t,u=[],e=wlfmc_l10n.lang,o=wlfmc_l10n.wishlist_items,a=!1;w.fn.WLFMC={init_prepare_qty_links:function(){var t=document.querySelectorAll(".wlfmc-wishlist-table .quantity");if(t.length<1)return!1;for(var e=0;e<t.length;e++){if(t[e].classList.contains("hidden"))return!1;var o=t[e].querySelector(".botiga-quantity-plus, a.plus, .ct-increase"),i=t[e].querySelector(".botiga-quantity-minus, a.minus, .ct-decrease");if(!o||!i||o.length<1||i.length<1)return!1;o.classList.add("show"),i.classList.add("show");var a=o.cloneNode(!0),n=i.cloneNode(!0);a.addEventListener("click",function(t){t.preventDefault();var t=this.parentNode.querySelector(".qty"),e=parseFloat(t.value,10)||0,o=document.createEvent("HTMLEvents"),i=t.getAttribute("max")&&parseFloat(t.getAttribute("max"),0)||1/0;return t.value=e<i?Math.round(100*(e+parseFloat(t.step||"1")))/100:i,o.initEvent("change",!0,!1),t.dispatchEvent(o),!1}),n.addEventListener("click",function(t){t.preventDefault();var t=this.parentNode.querySelector(".qty"),e=parseFloat(t.value,10)||0,o=document.createEvent("HTMLEvents"),i=t.getAttribute("min")?Math.round(100*parseFloat(t.getAttribute("min"),0))/100:0;return t.value=i<e?Math.round(100*(e-parseFloat(t.step||"1")))/100:i,o.initEvent("change",!0,!1),t.dispatchEvent(o),!1}),t[e].replaceChild(a,o),t[e].replaceChild(n,i)}},prepare_mini_wishlist:function(t){var e,o,i,a,n,r,s,l,c,d,f;t.hasClass("position-absolute")?(l=(c=t.offset()).left,c=c.top,d=t.outerWidth(),e=t.outerHeight(),n=l-(l=parseFloat(t.css("left"))),o=c-(c=parseFloat(t.css("top"))),l=l,c=c,s=(f=w(window).width())-n-d-50,r=50-n,a=(i=w(document).height())-o-e-50,f<=d?l=-1*n:f-(d+100)<0?l=(f-d)/2-n:0<r?l=r:s<0&&(l=s),i<e&&(t.height(i-t.outerHeight()+t.height()),e=t.outerHeight()),i<=e?c=-1*o:i-(e+100)<0?c=(i-e)/2-o:a<0&&(c=a),t.css({left:l,top:c})):void 0!==(n=w(".wlfmc-counter-wrapper."+t.attr("data-id")))&&0<n.length&&(r=n.offset(),s=w(window).scrollTop(),l=r.left,c=r.top+n.height()-s,d=t.outerWidth(),f=w(window).width(),t.css({left:l=f<l+d?f-d-20:l,top:c}))},appendtoBody:function(t){var e,o,i;0<!t.closest(".wlfmc-counter-wrapper").find(".position-fixed").length||(e=t.closest(".wlfmc-counter-wrapper").find(".wlfmc-counter-items").hasClass("wlfmc-lists-counter-dropdown")?"wlfmc-premium-list-counter":t.closest(".wlfmc-counter-wrapper").hasClass("wlfmc-waitlist-counter-wrapper")?"wlfmc-waitlist-counter":"wlfmc-wishlist-counter",0<t.closest(".elementor-widget-wlfmc-wishlist-counter").length||0<t.closest(".elementor-widget-wlfmc-waitlist-counter").length||0<t.closest(".elementor-widget-wlfmc-premium-list-counter").length?(i=t.closest(".elementor-widget-wlfmc-wishlist-counter").data("id")||t.closest(".elementor-widget-wlfmc-waitlist-counter").data("id")||t.closest(".elementor-widget-wlfmc-premium-list-counter").data("id"),o=t.closest("[data-elementor-id]").data("elementor-id"),w("<div class='wlfmc-elementor elementor elementor-"+o+" "+e+"'><div class='elementor-element elementor-element-"+i+"'></div></div>").appendTo("body"),w(".wlfmc-elementor.elementor-"+o+" .elementor-element-"+i).append(t)):0<!t.closest(".wlfmc-elementor").length&&(i=t.closest(".wlfmc-counter-wrapper").find(".wlfmc-counter-items").data("id"),w("<div class='wlfmc-elementor no-elementor-"+i+" "+e+"'></div>").appendTo("body"),w(".wlfmc-elementor.no-elementor-"+i).append(t)))},show_mini_wishlist:function(){w(".wlfmc-counter-dropdown").removeClass("lists-show");var t=w(".dropdown_"+w(this).attr("data-id"))||w(this).closest(".wlfmc-counter-wrapper").find(".wlfmc-counter-dropdown");w.fn.WLFMC.appendtoBody(t.closest(".wlfmc-counter-wrapper")),w.fn.WLFMC.prepare_mini_wishlist(t),t.addClass("lists-show")},hide_mini_wishlist:function(){var t=w(this).closest(".wlfmc-counter-wrapper").find(".wlfmc-counter-dropdown");w(".wlfmc-first-touch").removeClass("wlfmc-first-touch"),w(".wlfmc-first-click").removeClass("wlfmc-first-click"),t.removeClass("lists-show")},reInit_wlfmc:function(){w(document).trigger("wlfmc_init")},init_tooltip:function(){function a(t,e){var o,e=w(e),t=w(t),i=w("body").offset(),a=(w("body").css({position:"relative"}),s.show(),s.hide(),(e.outerHeight()-t.outerHeight())/2),n=-t.outerWidth()/2+e.outerWidth()/2,n={top:[-t.outerHeight()-7,n],right:[a,e.outerWidth()+7],bottom:[e.outerHeight()+7,n],left:[a,-t.outerWidth()-7]},a=["top","right","bottom","left"];Object.keys(n),"top"===s.direction||"bottom"===s.direction?(t.css("top",e.offset().top-i.top+n[s.direction][0]),t.css("left",e.offset().left-i.left+3.5+n[s.direction][1])):(o=(o=n[s.direction][0]-3.5)<0?3.5+o:o,t.css("top",e.offset().top-i.top+o),t.css("left",e.offset().left-i.left+n[s.direction][1])),r(t)&&(s.direction=a[a.indexOf(s.direction)+1]),s.show()}var r=function(t){return t.offsetLeft+t.offsetWidth<0||t.offsetTop+t.offsetHeight<0||t.offsetLeft+t.offsetWidth>window.innerWidth||t.offsetTop+t.offsetHeight>window.innerHeight},s=new function(){var i=this;this.idSelector="wlfmc-tooltip",this.text="",this.top=0,this.left=0,this.direction=void 0!==this.direction?this.direction:"bottom",this.t_type=void 0!==this.t_type?this.t_type:"default",this.target="",this.hideTimeout=null,this.node=document.getElementById(this.idSelector),this.node||(this.node=document.createElement("div"),this.node.setAttribute("id",this.idSelector),this.node.className=this.node.className+"tooltip__hidden",this.node.innerHTML=this.text,document.body.appendChild(this.node)),this.show=function(){var t=["top","right","bottom","left"],e=(i.node.innerHTML=i.text,i.direction),o=i.t_type;e?w(this.node).addClass("tooltip__expanded tooltip__expanded-"+e):w(this.node).addClass("tooltip__expanded"),w(this.node).addClass("wlfmc-tooltip-"+o),w(this.node).removeClass("tooltip__hidden"),r(w(s.node))&&(s.hide(),s.direction=t[t.indexOf(s.direction)+1],a(s.node,s.target))},this.hide=function(){i.hideTimeout&&(clearTimeout(i.hideTimeout),i.hideTimeout=null),w(i.node).css("top","0"),w(i.node).css("left","0"),w(i.node).attr("class",""),w(i.node).addClass("tooltip__hidden")}},e="ontouchstart"in window||0<navigator.maxTouchPoints;w(document).on("mouseenter touchstart",".wlfmc-tooltip",function(t){(s.target=this).className.split(" ").forEach(function(t){-1!=t.indexOf("wlfmc-tooltip-")&&(s.direction=t.split("-")[t.split("-").length-1])}),w(this).attr("data-tooltip-type")&&(s.t_type=w(this).attr("data-tooltip-type")),w(this).attr("data-tooltip-text")&&(s.text=w(this).attr("data-tooltip-text"),a(s.node,s.target)),"touchstart"===t.type&&t.preventDefault(),s.hideTimeout&&(clearTimeout(s.hideTimeout),s.hideTimeout=null)}),w(document).on("mouseleave touchend",".wlfmc-tooltip",function(t){"touchend"===t.type&&e?s.hideTimeout=setTimeout(function(){s.hide()},1e3):"mouseleave"===t.type&&s.hide()}),w(document).on("touchstart click",function(t){w(t.target).closest(".wlfmc-tooltip").length||w(t.target).is(s.node)||s.hide()})},init_fix_on_image_single_position:function(){0<w(".woocommerce-product-gallery__wrapper .wlfmc-top-of-image").length&&w(".woocommerce-product-gallery__wrapper .wlfmc-top-of-image").each(function(){w(this).insertAfter(w(this).parent())})},init_wishlist_popup:function(){function e(t,e){void 0!==t.classList&&t.classList.contains("wlfmc-overlay")&&(t="remove"===e?"removeClass":"addClass",w("body")[t]("wlfmc-with-popup"))}function o(t){e(t,"add")}function i(t){e(t,"remove")}new MutationObserver(function(t){for(var e in t){e=t[e];"childList"===e.type&&(void 0!==e.addedNodes&&e.addedNodes.forEach(o),void 0!==e.removedNodes)&&e.removedNodes.forEach(i)}}).observe(document.body,{childList:!0})},init_checkbox_handling:function(){var i=w(".wlfmc-wishlist-table, .wlfmc-save-for-later-table").find('tbody .product-checkbox input[type="checkbox"]'),a=w(".multiple-product-move,.multiple-product-copy");i.off("change").on("change",function(t){t.preventDefault();var e,t=w(this),o=t.parent();return t.is(":checked")||(w('input[name="'+t.attr("name")+'"]').prop("checked",!1),w("#bulk_add_to_cart").prop("checked",!1),w("#bulk_add_to_cart2").prop("checked",!1)),o.removeClass("checked").removeClass("unchecked").addClass(t.is(":checked")?"checked":"unchecked"),0<a.length&&(i.is(":checked")?a.show():a.hide(),o=w(this).closest("tr").attr("data-item-id"),e=a.attr("data-item-id"),t.is(":checked")?e=e?((e=e.split(",")).push(o),e.join(",")):o:e&&(-1!==(t=(e=e.split(",")).indexOf(o))&&e.splice(t,1),e=e.join(",")),a.attr("data-item-id",e)),!1}).trigger("change")},init_handling_after_ajax:function(){this.init_prepare_qty_links(),this.init_checkbox_handling(),w(document).trigger("wlfmc_init_after_ajax")},init_quantity:function(){var r,s;w(document).on("change",".wlfmc-wishlist-table .quantity :input, .wlfmc-save-for-later-table .quantity :input",function(){var t=w(this),e=t.closest("[data-row-id]"),o=e.data("row-id"),i=e.data("cart-item-key"),a=t.closest(".wlfmc-wishlist-table,.wlfmc-save-for-later-table"),n=a.data("token");clearTimeout(s),e.find(".add_to_cart_button").attr("data-quantity",t.val()),s=setTimeout(function(){r&&r.abort(),r=w.ajax({url:wlfmc_l10n.ajax_url,data:{action:wlfmc_l10n.actions.update_item_quantity,nonce:a.data("nonce"),context:"frontend",product_id:o,cart_item_key:i,wishlist_token:n,quantity:t.val()},method:"POST",beforeSend:function(t){"rest_api"===wlfmc_l10n.ajax_mode&&t.setRequestHeader("X-WP-Nonce",wlfmc_l10n.nonce),w.fn.WLFMC.block(e)},complete:function(){w.fn.WLFMC.unblock(e)},success:function(t){w.fn.WLFMC.load_fragments()}})},1e3)})},init_popups:function(){w("body").on("click",".wlfmc-popup-trigger:not(.wlfmc-disabled)",function(t){t.preventDefault();var e,t=w(this).data("popup-id"),o=w("#"+t);return w("#"+t+"_wrapper").length||(e={absolute:!1,color:"#333",transition:"all 0.3s",horizontal:o.data("horizontal"),vertical:o.data("vertical")},o.popup(e)),w("#wlfmc-tooltip").css({top:"0",left:"0"}).removeClass().addClass("tooltip__hidden"),w("#"+t).popup("show"),!1}),w("body").on("click",".wlfmc-popup-close",function(t){t.preventDefault();t=w(this).data("popup-id");return w("#"+t).popup("hide"),!1})},init_components:function(){w(document).on("click",".wlfmc-list .product-components",function(t){t.preventDefault();var t=w(this).closest("tr"),e=t.find(".wlfmc-absolute-meta-data"),o=t.next(".wlfmc-row-meta-data").filter(".wlfmc-row-meta-data"),i=o.hasClass("hide");return e.fadeToggle(),o.toggleClass("hide"),t.toggleClass("show-meta-data",i),!1}),w(document).on("click",".wlfmc-list .close-components",function(t){t.preventDefault();t=w(this).closest("tr");return t.find(".wlfmc-absolute-meta-data").fadeToggle(),t.removeClass("show-meta-data"),!1})},init_popup_checkbox_handling:function(){w(document).on("change",".list-item-checkbox",function(){var t,e=w(this).closest(".list-item"),o=w(this).closest(".wlfmc-add-to-list-container, .wlfmc-move-to-list-wrapper, .wlfmc-copy-to-list-wrapper");o.hasClass("wlfmc-add-to-list-container")&&(w(this).is(":checked")?e.addClass("selected"):e.removeClass("selected")),(o.hasClass("wlfmc-move-to-list-wrapper")||o.hasClass("wlfmc-copy-to-list-wrapper"))&&(t=o.find('input[type="checkbox"]'),o.find(".list-item").removeClass("selected"),w(this).is(":checked"))&&(e.addClass("selected"),t.not(w(this)).prop("checked",!1))})},init_copy_wishlist_link:function(){w(document).on("click",".copy-link-trigger",function(t){t.stopImmediatePropagation(),t.preventDefault();t=w(this),t=w("<input/>",{val:t.attr("data-href"),type:"text"});return w("body").append(t),w.fn.WLFMC.isOS()?t[0].setSelectionRange(0,9999):t.select(),document.execCommand ("copy"),t.remove(),toastr.success(wlfmc_l10n.labels.link_copied),!1})},retrieve_fragments:function(t){var o={},e=null;return t?"object"===d(t)?(e=(t=w.extend({fragments:null,s:"",container:w(document),firstLoad:!1},t)).fragments||t.container.find(".wlfmc-wishlist-fragment"),t.s&&(e=e.not("[data-fragment-ref]").add(e.filter('[data-fragment-ref="'+t.s+'"]'))),t.firstLoad&&(e=e.filter(".on-first-load"))):(e=w(".wlfmc-wishlist-fragment"),"string"!=typeof t&&"number"!=typeof t||(e=e.not("[data-fragment-ref]").add(e.filter('[data-fragment-ref="'+t+'"]')))):e=w(".wlfmc-wishlist-fragment"),e.length?(e.each(function(){var t=w(this),e=t.attr("class").split(" ").filter(function(t){return t.length&&"exists"!==t}).join(wlfmc_l10n.fragments_index_glue);o[e]=t.data("fragment-options")}),o):null},load_fragments:function(o,i,a){clearTimeout(t),t=setTimeout(function(){n&&n.abort(),o=w.extend({firstLoad:!0},o);var t=w.fn.WLFMC.retrieve_fragments(o),e=new FormData;e.append("action",wlfmc_l10n.actions.load_fragments),e.append("context","frontend"),e.append("nonce",wlfmc_l10n.ajax_nonce.load_fragments),t&&(t=JSON.stringify(t),t=new File([t],"fragment.json"),e.append("fragments_file",t)),n=w.ajax({url:wlfmc_l10n.admin_url,data:e,type:"POST",contentType:!1,processData:!1,success:function(t){void 0!==t.fragments&&("function"==typeof i&&i.apply(null,a),w.fn.WLFMC.replace_fragments(t.fragments),w.fn.WLFMC.init_handling_after_ajax()),w("#wlfmc-lists,#wlfmc-wishlist-form").addClass("on-first-load"),void 0!==t.products&&w.fn.WLFMC.set_products_hash(JSON.stringify(t.products)),void 0!==t.waitlist&&w.fn.WLFMC.set_waitlist_hash(JSON.stringify(t.waitlist)),void 0!==t.lang&&w.fn.WLFMC.set_lang_hash(t.lang)}})},100)},replace_fragments:function(t){w.each(t,function(t,e){var t="."+t.split(wlfmc_l10n.fragments_index_glue).filter(function(t){return t.length&&"exists"!==t&&"with-count"!==t}).join("."),o=w(t),i=w(e).filter(t);i.length||(i=w(e).find(t)),o.length&&i.length&&o.replaceWith(i)})},load_automations:function(t,e,o,i,a){w.ajax({url:wlfmc_l10n.ajax_url,data:{action:wlfmc_l10n.actions.load_automations,nonce:a,context:"frontend",product_id:parseInt(t),wishlist_id:parseInt(e),customer_id:parseInt(o),list_type:i},method:"POST",beforeSend:function(t){"rest_api"===wlfmc_l10n.ajax_mode&&t.setRequestHeader("X-WP-Nonce",wlfmc_l10n.nonce)},complete:function(){}})},check_products:function(t){var e;null!==t&&(u=[],(e=w(".wlfmc-products-counter-wrapper .wlfmc-counter-item")).length&&u.length&&e.each(function(){var e=w(this).attr("data-row-id");w.grep(u,function(t){return t.product_id===e}).length||w(".wlfmc-products-counter-wrapper").find('[data-row-id="'+e+'"]').remove()}),(e=w(".wlfmc-wishlist-form .wlfmc-table-item")).length&&u.length&&e.each(function(){var e=w(this).attr("data-row-id");w.grep(u,function(t){return t.product_id===e}).length||w(".wlfmc-wishlist-form").find('[data-row-id="'+e+'"]').remove()}),w(".wlfmc-add-to-wishlist").removeClass("exists"),w.each(t,function(t,e){w(".wlfmc-add-to-wishlist-"+e.product_id).each(function(){w(this).addClass("exists"),w(this).find(".wlfmc_delete_item").attr("data-item-id",e.item_id),w(this).find(".wlfmc_delete_item").attr("data-wishlist-id",e.wishlist_id)}),w(".wlfmc-products-counter-wrapper  .products-counter-number").text(e.length),w(".wlfmc-products-counter-wishlist .total-products .wlfmc-total-count").text(e.length),u.push(e)}))},set_products_hash:function(t){r&&(localStorage.setItem(l,t),sessionStorage.setItem(l,t)),w.fn.WLFMC.check_products(JSON.parse(t))},set_lang_hash:function(t){r&&(localStorage.setItem(c,t),sessionStorage.setItem(c,t))},validateEmail:function(t){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())},isTrue:function(t){return!0===t||"yes"===t||"1"===t||1===t||"true"===t},isOS:function(){return navigator.userAgent.match(/ipad|iphone/i)},loading:function(t){0<t.find("i").length?t.addClass("wlfmc-action wlfmc-loading"):t.addClass("wlfmc-action wlfmc-loading-alt")},unloading:function(t){t.removeClass("wlfmc-loading wlfmc-loading-alt")},block:function(t){void 0!==w.fn.block&&wlfmc_l10n.enable_ajax_loading&&t.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+wlfmc_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})},table_block:function(){void 0!==w.fn.block&&w(".wlfmc-wishlist-table-wrapper, .wlfmc-save-for-later-table-wrapper").fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+wlfmc_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"80px 80px",opacity:1}})},unblock:function(t){void 0!==w.fn.unblock&&(t.stop(!0).css("opacity","1").unblock(),w(".tooltip__expanded").removeClass().addClass("tooltip__hidden"))},is_cookie_enabled:function(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t},setCookie:function(t,e){var o=new Date;o.setDate(o.getDate()+9125),document.cookie=t+"="+escape(e)+"; expires="+o.toUTCString()+"; path=/"},updateURLParameter:function(t,e,o){var i="",t=(r=t.split("?"))[0],a=r[1],n="";if(a)for(var r=a.split("&"),s=0;s<r.length;s++)r[s].split("=")[0]!==e&&(i+=n+r[s],n="&");return t+"?"+i+(n+""+e+"="+o.replace("#",""))},getUrlParameter:function(t,e){for(var o,i=decodeURIComponent(t.substring(1)).split(/[&|?]+/),a=0;a<i.length;a++)if((o=i[a].split("="))[0]===e)return void 0===o[1]||o[1]}},toastr.options={tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,closeButton:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:2e4,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"default"===wlfmc_l10n.toast_position?wlfmc_l10n.is_rtl?"toast-top-right":"toast-top-left":wlfmc_l10n.toast_position,timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",newestOnTop:!0,preventDuplicates:!1,progressBar:!0,progressClass:"toast-progress",rtl:!!wlfmc_l10n.is_rtl},w(document).on("wlfmc_init",function(){w.fn.WLFMC.init_fix_on_image_single_position();var o,t=w(this),e=w("body"),p="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";e.on("click",'.wlfmc-list button[name="apply_bulk_actions"]',function(t){var e=w(this).closest(".action-wrapper").find('select[name="bulk_actions"]'),o=w(this).closest("form").find("input.qty");0<e.length&&"delete"===e.val()&&0<o.length&&o.attr("disabled",!0)}),e.on("change","#bulk_add_to_cart,#bulk_add_to_cart2",function(){var t=w(this),e=t.closest(".wlfmc-wishlist-table,.wlfmc-save-for-later-table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');t.is(":checked")?(e.prop("checked","checked").trigger("change"),w("#bulk_add_to_cart").prop("checked","checked"),w("#bulk_add_to_cart2").prop("checked","checked")):(e.prop("checked",!1).trigger("change"),w("#bulk_add_to_cart").prop("checked",!1),w("#bulk_add_to_cart2").prop("checked",!1))}),e.on("submit",".wlfmc-popup-form",function(){return!1}),t.on("found_variation",function(t,e){t=w(t.target).data("product_id");e.product_id=t,w(document).trigger("wlfmc_show_variation",e)}),t.on("wlfmc_reload_fragments",w.fn.WLFMC.load_fragments),t.on("wlfmc_fragments_loaded",function(t,e,o,i){i&&w(".variations_form").find(".variations select").last().trigger("change")}),e.on("click",".wlfmc-tabs a:not(.external-link)",function(t){t.stopImmediatePropagation(),t.preventDefault();t=w(this).data("content");return w(".wlfmc-tab-content").hide(),w(this).closest(".wlfmc-tabs-wrapper").removeClass("active-tab-cart active-tab-save-for-later"),w(this).closest(".wlfmc-tabs-wrapper").addClass("active-tab-"+t),w(this).closest(".wlfmc-tabs-wrapper").find(".wlfmc-tabs a").removeClass("nav-tab-active"),w(this).addClass("nav-tab-active"),w(".wlfmc_content_"+t).show(),window.history.replaceState("","",w.fn.WLFMC.updateURLParameter(window.location.href,"tab",t)),!1}),e.on("click",".wlfmc-gdpr-btn",function(t){t.stopImmediatePropagation(),t.preventDefault();var e=w(this),t=e.data("action"),o=e.data("cid");return w.ajax({url:wlfmc_l10n.ajax_url,data:{action:wlfmc_l10n.actions.gdpr_action,nonce:e.data("nonce"),context:"frontend",action_type:t,cid:o},method:"post",beforeSend:function(t){"rest_api"===wlfmc_l10n.ajax_mode&&t.setRequestHeader("X-WP-Nonce",wlfmc_l10n.nonce),w.fn.WLFMC.loading(e)},complete:function(){w.fn.WLFMC.unloading(e)},success:function(t){t&&w(".wlfmc-gdpr-notice-wrapper, .wlfmc-unsubscribe-notice-wrapper").remove()}}),!1}),e.on("click",".wlfmc_add_to_wishlist",function(t){if(t.stopImmediatePropagation(),t.preventDefault(),a&&Array.isArray(u)&&!u.length)toastr.error(wlfmc_l10n.labels.product_adding);else{var e,r=w(this),s=r.attr("data-product-id"),t=r.attr("data-parent-product-id"),l=r.closest(".wlfmc-add-to-wishlist-"+s),o={action:wlfmc_l10n.actions.add_to_wishlist_action,context:"frontend",add_to_wishlist:s,product_type:r.attr("data-product-type"),nonce:r.data("nonce")},i=(null===w(document).triggerHandler("wlfmc_add_to_wishlist_data",[r,o])&&(o=null),w('form.cart[method=post][data-product_id="'+t+'"], form.vtajaxform[method=post][data-product_id="'+t+'"]').length?e=w('form.cart[method=post][data-product_id="'+t+'"], form.vtajaxform[method=post][data-product_id="'+t+'"]').eq(0):w(this).closest("form.cart[method=post], form.vtajaxform[method=post]").length?e=w(this).closest("form.cart[method=post], form.vtajaxform[method=post]").eq(0):w("#product-"+t+" form.cart[method=post],#product-"+t+" form.vtajaxform[method=post]").length?e=w("#product-"+t+" form.cart[method=post],#product-"+t+" form.vtajaxform[method=post]").eq(0):w('form.cart[method=post] button[name="add-to-cart"][value="'+t+'"],form.vtajaxform[method=post] button[name="add-to-cart"][value="'+t+'"],form.cart[method=post] input[name="add-to-cart"][value="'+t+'"]').length&&(e=w('form.cart[method=post] button[name="add-to-cart"][value="'+t+'"],form.vtajaxform[method=post] button[name="add-to-cart"][value="'+t+'"],form.cart[method=post] input[name="add-to-cart"][value="'+t+'"]').closest("form").eq(0)),new FormData);if(void 0!==e&&0<e.length?(i=new FormData(e.get(0))).delete("add-to-cart"):(e=r.closest(".product.post-"+t).find(".add_to_cart_button")).length&&(o.quantity=e.attr("data-quantity")),w.each(o,function(t,e){i.append(t,"object"===d(e)?JSON.stringify(e):e)}),jQuery(document.body).trigger("wlfmc_adding_to_wishlist"),w.fn.WLFMC.is_cookie_enabled())return w.ajax({url:wlfmc_l10n.ajax_url,data:i,type:"POST",contentType:!1,processData:!1,cache:!1,beforeSend:function(t){"rest_api"===wlfmc_l10n.ajax_mode&&t.setRequestHeader("X-WP-Nonce",wlfmc_l10n.nonce),a=!0,w.fn.WLFMC.loading(r)},complete:function(){a=!1,w.fn.WLFMC.unloading(r)},success:function(t){var e,o,i=t.result,a=t.message,n=!0;"true"!==i&&"exists"!==i||(w.fn.WLFMC.load_fragments(),t.item_id&&null!=u&&(u.push({wishlist_id:t.wishlist_id,item_id:t.item_id,product_id:parseInt(s)}),w.fn.WLFMC.set_products_hash(JSON.stringify(u))),(e=l.attr("data-popup-id"))&&(o={absolute:n=!1,color:"#333",transition:"all 0.3s",horizontal:(e=w("#"+e)).data("horizontal"),vertical:e.data("vertical")},e.popup(o),w("#wlfmc-tooltip").css({top:"0",left:"0"}).removeClass().addClass("tooltip__hidden"),e.popup("show")),n&&""!==w.trim(wlfmc_l10n.labels.product_added_text)&&"true"===i&&toastr.success(wlfmc_l10n.labels.product_added_text),"true"===i&&w.fn.WLFMC.load_automations(s,t.wishlist_id,t.customer_id,"wishlist",t.load_automation_nonce)),"true"===i&&"add-redirect"===wlfmc_l10n.click_behavior&&(window.location.href=wlfmc_l10n.wishlist_page_url),n&&""!==w.trim(t.message)&&"true"!==i&&toastr.error(a),w.fn.WLFMC.init_handling_after_ajax(),w("body").trigger("wlfmc_added_to_wishlist",[r,l])}}),!1;a=!1,window.alert(wlfmc_l10n.labels.cookie_disabled)}}),e.on("click",".wlfmc_ajax_add_to_cart:not(.disabled)",function(t){var e=w(this),o=e.attr("data-item_id"),i=e.attr("data-wishlist_id"),o={action:wlfmc_l10n.actions.add_to_cart_action,nonce:e.data("nonce"),context:"frontend",lid:o,wid:i};return t.stopImmediatePropagation(),t.preventDefault(),e.removeClass("added"),e.addClass("loading"),!1===w(document.body).triggerHandler("should_send_ajax_request.adding_to_cart",[e])?(w(document.body).trigger("ajax_request_not_sent.adding_to_cart",[!1,!1,e]),!0):(w(document.body).trigger("adding_to_cart",[e,o]),w.ajax({url:wlfmc_l10n.admin_url,data:o,type:"POST",dataType:"json",success:function(t){if(t){if(t.error||t.success&&!w.fn.WLFMC.isTrue(t.success)){if(t.product_url)return void(window.location=t.product_url);""!==wlfmc_l10n.labels.failed_add_to_cart_message&&toastr.error(wlfmc_l10n.labels.failed_add_to_cart_message)}else{if(w.fn.WLFMC.isTrue(wc_add_to_cart_params.cart_redirect_after_add))return void(window.location=wc_add_to_cart_params.cart_url);w(document.body).trigger("wc_fragment_refresh"),w(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,e]),""!==wlfmc_l10n.labels.added_to_cart_message&&toastr.success(wlfmc_l10n.labels.added_to_cart_message)}t.message&&""!==t.message&&w(document.body).trigger("add_to_cart_message",[t.message,e])}}}),!1)}),e.on("click",".wlfmc-btn-login-need",function(t){return t.stopImmediatePropagation(),t.preventDefault(),toastr.error(wlfmc_l10n.labels.login_need),!1}),e.on("click",".wlfmc_already_in_wishlist",function(t){return t.stopImmediatePropagation(),t.preventDefault(),toastr.error(wlfmc_l10n.labels.already_in_wishlist_text),!1}),e.on("click",".wlfmc-wishlist-table .remove_from_wishlist",function(t){var a=w(this),t=(t.stopImmediatePropagation(),t.preventDefault(),a.parents(".wlfmc-wishlist-items-wrapper")),n=a.parents("[data-row-id]"),r=n.data("row-id"),s=t.data("id"),t=t.data("token"),t={action:wlfmc_l10n.actions.remove_from_wishlist_action,nonce:a.data("nonce"),context:"frontend",remove_from_wishlist:r,wishlist_id:s,wishlist_token:t};return w.ajax({url:wlfmc_l10n.ajax_url,data:t,method:"post",beforeSend:function(t){"rest_api"===wlfmc_l10n.ajax_mode&&t.setRequestHeader("X-WP-Nonce",wlfmc_l10n.nonce),w.fn.WLFMC.block(n)},complete:function(){w.fn.WLFMC.unblock(n)},success:function(t){if(w.fn.WLFMC.load_fragments(),w.fn.WLFMC.isTrue(t.result)){if(n.addClass("disabled-row"),null!=u){for(var e=u.length,o=0;o<=e-1;o++)if(void 0!==u[o]&&u[o].wishlist_id==s&&u[o].product_id==r){u.splice(o,1),w("body").trigger("wlfmc_removed_from_wishlist",[a,n,t]);break}w.fn.WLFMC.set_products_hash(JSON.stringify(u))}if("undefined"!=typeof product_in_waitlist&&null!==product_in_waitlist){var i=product_in_waitlist.length;for(o=0;o<=i-1;o++)if(void 0!==product_in_waitlist[o]&&product_in_waitlist[o].wishlist_id==s&&product_in_waitlist[o].product_id==r){product_in_waitlist.splice(o,1),w("body").trigger("wlfmc_removed_from_waitlist",[a,n,t]);break}w.fn.WLFMC.set_waitlist_hash(JSON.stringify(product_in_waitlist))}}}}),!1}),e.on("click touchend",".wlfmc-products-counter-wishlist .remove_from_wishlist,.wlfmc-products-counter-waitlist .remove_from_wishlist",function(t){var a=w(this),n=(t.stopImmediatePropagation(),t.preventDefault(),a.parents(".wlfmc-wishlist-items-wrapper")),r=a.parents("[data-row-id]"),s=r.data("row-id"),l=r.data("item-id"),c=r.data("wishlist-id"),t=r.data("wishlist-token"),d=w(".wlfmc-wishlist-form .wlfmc-wishlist-table"),t={action:wlfmc_l10n.actions.remove_from_wishlist_action,nonce:a.data("nonce"),context:"frontend",remove_from_wishlist:s,wishlist_id:c,wishlist_token:t,merge_lists:wlfmc_l10n.merge_lists};return w.ajax({url:wlfmc_l10n.ajax_url,data:t,method:"post",beforeSend:function(t){"rest_api"===wlfmc_l10n.ajax_mode&&t.setRequestHeader("X-WP-Nonce",wlfmc_l10n.nonce),w.fn.WLFMC.loading(a)},complete:function(){w.fn.WLFMC.unloading(a)},success:function(t){if(w.fn.WLFMC.isTrue(t.result)){var e=!1;if(null!=u){for(var o=u.length,i=0;i<=o-1;i++)if(void 0!==u[i]&&u[i].wishlist_id===c&&u[i].product_id===s){u.splice(i,1),w("body").trigger("wlfmc_removed_from_wishlist",[a,r,t]);break}w.fn.WLFMC.set_products_hash(JSON.stringify(u))}if("undefined"!=typeof product_in_waitlist&&null!==product_in_waitlist){for(o=product_in_waitlist.length,i=0;i<=o-1;i++)if(void 0!==product_in_waitlist[i]&&product_in_waitlist[i].wishlist_id===c&&product_in_waitlist[i].product_id===s){product_in_waitlist.splice(i,1),w("body").trigger("wlfmc_removed_from_waitlist",[a,r,t]);break}w.fn.WLFMC.set_waitlist_hash(JSON.stringify(product_in_waitlist))}0<a.closest(".wlfmc-products-counter-wrapper").length&&(w(".wlfmc-products-counter-wrapper").find('[data-item-id="'+l+'"]').remove(),w(".wlfmc-products-counter-wrapper  .products-counter-number").text(t.count),w(".wlfmc-products-counter-wishlist .total-products .wlfmc-total-count").text(t.count),w(".wlfmc-add-to-wishlist.wlfmc-add-to-wishlist-"+s).removeClass("exists")),0<a.closest(".wlfmc-waitlist-counter-wrapper").length&&(w(".wlfmc-waitlist-counter-wrapper").find('[data-item-id="'+l+'"]').remove(),w(".wlfmc-waitlist-counter-wrapper  .products-counter-number").text(t.count),w(".wlfmc-products-counter-waitlist .total-products .wlfmc-total-count").text(t.count),w(".wlfmc-add-to-waitlist.wlfmc-add-to-waitlist-"+s).removeClass("exists")),0<d.length&&parseInt(c)===parseInt(d.attr("data-id"))&&(d.find('[data-item-id="'+l+'"]').addClass("disabled-row"),e=!0),(e=t.count<1||!n.find("[data-row-id]").length?!0:e)&&w.fn.WLFMC.load_fragments()}w.fn.WLFMC.init_handling_after_ajax()}}),!1}),e.on("click",".wlfmc_delete_item",function(t){var o=w(this),e=o.attr("data-product-id"),i=o.attr("data-wishlist-id"),a=o.attr("data-item-id"),n=w(".wlfmc-add-to-wishlist-"+e),e={action:wlfmc_l10n.actions.delete_item_action,context:"frontend",wishlist_id:i,item_id:a,nonce:o.data("nonce")};return t.stopImmediatePropagation(),t.preventDefault(),w.ajax({url:wlfmc_l10n.ajax_url,data:e,method:"post",dataType:"json",beforeSend:function(t){"rest_api"===wlfmc_l10n.ajax_mode&&t.setRequestHeader("X-WP-Nonce",wlfmc_l10n.nonce),w.fn.WLFMC.loading(o)},complete:function(){w.fn.WLFMC.unloading(o)},success:function(t){t.fragments;var e=t.message;"true"===t.result&&(n.removeClass("exists"),null!=u)&&(u=w.grep(u,function(t){return t.item_id!==parseInt(a)}),w.fn.WLFMC.set_products_hash(JSON.stringify(u))),o.closest(".wlfmc-remove-button").length||""===w.trim(e)||toastr.error(e),"true"===t.result&&""!==w.trim(wlfmc_l10n.labels.product_removed_text)&&toastr.error(wlfmc_l10n.labels.product_removed_text),w.fn.WLFMC.load_fragments(),w.fn.WLFMC.init_handling_after_ajax(),w("body").trigger("wlfmc_removed_from_wishlist",[o,n,t])}}),!1}),t.on("wlfmc_show_variation",function(t,e){w(t.target);var o,i,a,n,r,s,l=e.product_id,c=e.variation_id,t=w('.wlfmc-add-to-wishlist [data-parent-product-id="'+l+'"]'),d=t.closest(".wlfmc-add-to-wishlist").data("enable-outofstock");l&&c&&t.length&&(d||e.is_in_stock?t.closest(".wlfmc-add-to-wishlist").removeClass("hide"):t.closest(".wlfmc-add-to-wishlist").addClass("hide"),(d=t.closest(".wlfmc-add-to-wishlist").attr("data-popup-id"))&&(d=w("#"+d)).length&&(o=d.data("product-title"),s=wlfmc_l10n.labels.popup_content,i=wlfmc_l10n.labels.popup_title,a=d.data("image-size"),n=d.find(".wlfmc-popup-header img").data("src"),r=d.find(".wlfmc-parent-product-price").html(),r=""!==e.price_html?e.price_html:r,s=(s=s.replace("{product_price}",r)).replace("{product_name}",o),i=(i=i.replace("{product_price}",r)).replace("{product_name}",o),e.image_id&&"true"==d.data("use-featured")&&(n="large"===a?e.image.full_src:"thumbnail"===a?e.image.thumb_src:e.image.src),d.find(".wlfmc-popup-title").html(i),d.find(".wlfmc-popup-desc").html(s),d.find(".wlfmc-popup-header img").attr("src",n)),t.each(function(){var t=w(this),o=t.closest(".wlfmc-add-to-wishlist");t.attr("data-parent-product-id",l),t.attr("data-product-id",c),o.length&&o.removeClass(function(t,e){return e.match(/wlfmc-add-to-wishlist-\S+/g).join(" ")}).addClass("wlfmc-add-to-wishlist-"+c).removeClass("exists"),o.find(".wlfmc-addtowishlist a").attr("href",o.attr("data-add-url").replace("#product_id",c)),o.find(".wlfmc-removefromwishlist a").attr("href",o.attr("data-remove-url").replace("#product_id",c)),w.each(u,function(t,e){void 0!==e&&e.product_id&&e.product_id==c&&(o.addClass("exists"),o.find(".wlfmc_delete_item").attr("data-wishlist-id",e.wishlist_id),o.find(".wlfmc_delete_item").attr("data-item-id",e.item_id))})}))}),t.on("reset_data",function(t){var e,o,i,a,n,r,s=w(t.target).data("product_id"),t=w('.wlfmc-add-to-wishlist [data-parent-product-id="'+s+'"]');s&&t.length&&(t.closest(".wlfmc-add-to-wishlist").removeClass("hide"),(e=t.closest(".wlfmc-add-to-wishlist").attr("data-popup-id"))&&(e=w("#"+e)).length&&(o=e.find(".wlfmc-parent-product-price").html(),i=e.data("product-title"),r=wlfmc_l10n.labels.popup_content,a=wlfmc_l10n.labels.popup_title,n=e.find(".wlfmc-popup-header img").data("src"),r=(r=r.replace("{product_price}",o)).replace("{product_name}",i),a=(a=a.replace("{product_price}",o)).replace("{product_name}",i),e.find(".wlfmc-popup-title").html(a),e.find(".wlfmc-popup-desc").html(r),e.find(".wlfmc-popup-header img").attr("src",n)),t.each(function(){var t=w(this),o=t.closest(".wlfmc-add-to-wishlist");t.attr("data-parent-product-id",s),t.attr("data-product-id",s),o.length&&o.removeClass(function(t,e){return e.match(/wlfmc-add-to-wishlist-\S+/g).join(" ")}).addClass("wlfmc-add-to-wishlist-"+s).removeClass("exists"),o.find(".wlfmc-addtowishlist a").attr("href",o.attr("data-add-url").replace("#product_id",s)),o.find(".wlfmc-removefromwishlist a").attr("href",o.attr("data-remove-url").replace("#product_id",s)),w.each(u,function(t,e){void 0!==e&&e.product_id&&e.product_id==s&&(o.addClass("exists"),o.find(".wlfmc_delete_item").attr("data-wishlist-id",e.wishlist_id),o.find(".wlfmc_delete_item").attr("data-item-id",e.item_id))})}))}),t.on("adding_to_cart","body",function(t,e,o){void 0!==e&&void 0!==o&&e.closest(".wlfmc-wishlist-table,.wlfmc-save-for-later-table").length&&(o.wishlist_id=e.closest(".wlfmc-wishlist-table,.wlfmc-save-for-later-table").data("id"),o.wishlist_type=e.closest(".wlfmc-wishlist-table,.wlfmc-save-for-later-table").data("wishlist-type"),o.customer_id=e.closest(".wlfmc-wishlist-table,.wlfmc-save-for-later-table").data("customer-id"),o.is_owner=e.closest(".wlfmc-wishlist-table,.wlfmc-save-for-later-table").data("is-owner"),"undefined"!=typeof wc_add_to_cart_params)&&(wc_add_to_cart_params.cart_redirect_after_add=wlfmc_l10n.redirect_to_cart)}),t.on("added_to_cart","body",function(t,e,o,i){if(void 0!==i&&i.closest(".wlfmc-wishlist-table").length){"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=p);var a=(m=(f=i.closest("[data-row-id]")).closest(".wlfmc-wishlist-fragment")).data("fragment-options"),n=f.data("row-id"),r=m.find(".wlfmc-wishlist-table").data("id"),s=(m.find(".wlfmc-wishlist-table").data("token"),m.find(".wlfmc-wishlist-table").data("wishlist-type"));if(i.removeClass("added"),f.find(".added_to_cart").remove(),wlfmc_l10n.remove_from_wishlist_after_add_to_cart&&a.is_user_owner){if(w(".wlfmc-wishlist-form").find('[data-row-id="'+n+'"]').remove(),"wishlist"===s&&null!=u){for(var l=u.length,c=0;c<=l-1;c++)void 0!==u[c]&&u[c].wishlist_id==r&&u[c].product_id==n&&u.splice(c,1);w.fn.WLFMC.set_products_hash(JSON.stringify(u)),w(".wlfmc-products-counter-wrapper").find('[data-row-id="'+n+'"]').remove(),w(".wlfmc-products-counter-wrapper .products-counter-number").text(u.length),w(".wlfmc-products-counter-wishlist .total-products .wlfmc-total-count").text(u.length),w(".wlfmc-add-to-wishlist.wlfmc-add-to-wishlist-"+n).removeClass("exists"),u.length&&0!==u.length&&m.find("[data-row-id]").length||(w(".wlfmc-wishlist-table-wrapper").empty(),w.fn.WLFMC.reload_fragment=!0)}if("waitlist"===s&&"undefined"!=typeof product_in_waitlist&&null!==product_in_waitlist){for(var d=product_in_waitlist.length,c=0;c<=d-1;c++)void 0!==product_in_waitlist[c]&&product_in_waitlist[c].wishlist_id==r&&product_in_waitlist[c].product_id==n&&product_in_waitlist.splice(c,1);w.fn.WLFMC.set_waitlist_hash(JSON.stringify(product_in_waitlist)),w(".wlfmc-waitlist-counter-wrapper").find('[data-row-id="'+n+'"]').remove(),w(".wlfmc-waitlist-counter-wrapper .products-counter-number").text(product_in_waitlist.length),w(".wlfmc-waitlist-counter-wrapper .total-products .wlfmc-total-count").text(product_in_waitlist.length),w(".wlfmc-add-to-waitlist.wlfmc-add-to-waitlist-"+n).removeClass("exists"),product_in_waitlist.length&&0!==product_in_waitlist.length&&m.find("[data-row-id]").length||(w(".wlfmc-wishlist-table-wrapper").empty(),w.fn.WLFMC.reload_fragment=!0)}"lists"===s&&(w.fn.WLFMC.reload_fragment=!0)}}else{var f,m;void 0!==i&&i.closest(".wlfmc-save-for-later-table").length&&(a=(m=(f=i.closest("[data-item-id]")).closest(".wlfmc-wishlist-fragment")).data("fragment-options"),s=f.data("item-id"),i.removeClass("added"),f.find(".added_to_cart").remove(),a.is_user_owner)&&(w(".wlfmc-save-for-later-form").find('[data-item-id="'+s+'"]').remove(),w(".wlfmc-save-for-later-items-wrapper .save-for-later-items-wrapper tr").length||w(".wlfmc-save-for-later-table-wrapper").empty())}}),t.on("add_to_cart_message","body",function(t,e,o){var i=w(".woocommerce-notices-wrapper .woocommerce-error,.woocommerce-notices-wrapper .woocommerce-message");o.removeClass("loading"),0===i.length?w("#wlfmc-wishlist-form").prepend(e):i.fadeOut(300,function(){w(this).closest(".woocommerce-notices-wrapper").replaceWith(e).fadeIn()})}),t.on("cart_page_refreshed","body",w.fn.WLFMC.init_handling_after_ajax),"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?(e.on("touchstart",".wlfmc-counter-wrapper.show-list-on-hover,.wlfmc-counter-wrapper.show-list-on-click",function(t){o=!1}),e.on("touchmove",".wlfmc-counter-wrapper.show-list-on-hover,.wlfmc-counter-wrapper.show-list-on-click",function(t){o=!0}),e.on("touchend",".wlfmc-counter-wrapper.show-list-on-hover .wlfmc-counter.has-dropdown,.wlfmc-counter-wrapper.show-list-on-click  .wlfmc-counter.has-dropdown",function(t){var e=w(this).closest(".wlfmc-counter-wrapper");e.hasClass("wlfmc-first-touch")?o||w.fn.WLFMC.hide_mini_wishlist.call(w(".wlfmc-counter-wrapper"),t):(t.stopImmediatePropagation(),t.preventDefault(),w.fn.WLFMC.show_mini_wishlist.call(this,t),e.addClass("wlfmc-first-touch"))}),e.on("touchend",":not(.wlfmc-counter-wrapper.show-list-on-hover):not(.wlfmc-counter-wrapper.show-list-on-click)",function(t){0===w(t.target).closest(".wlfmc-counter-wrapper").length&&w.fn.WLFMC.hide_mini_wishlist.call(w(".wlfmc-counter-wrapper"),t)}),e.on("touchend",".wlfmc-counter-wrapper .wlfmc-counter.has-dropdown a:not(.remove_from_wishlist)",function(t){return t.stopImmediatePropagation(),t.preventDefault(),window.location.href=w(this).attr("href"),!1})):(e.on("click",".wlfmc-counter-wrapper.show-list-on-click .wlfmc-counter.has-dropdown",function(t){t.stopImmediatePropagation(),t.preventDefault();t=w(".dropdown_"+w(this).attr("data-id"))||w(this).closest(".wlfmc-counter-wrapper").find(".wlfmc-counter-dropdown");return w.fn.WLFMC.appendtoBody(t.closest(".wlfmc-counter-wrapper")),w.fn.WLFMC.prepare_mini_wishlist(t),t.toggleClass("lists-show"),!1}),t.on("click",function(t){var e=w(".wlfmc-counter-wrapper.show-list-on-click .wlfmc-counter.has-dropdown");e===t.target||e.has(t.target).length||w(".wlfmc-counter-dropdown").removeClass("lists-show")}),e.on("mouseover",".wlfmc-counter-wrapper.show-list-on-hover .wlfmc-counter-dropdown",function(t){return t.stopImmediatePropagation(),t.preventDefault(),w(this).addClass("lists-show"),!1}),e.on("mouseout",".wlfmc-counter-wrapper.show-list-on-hover .wlfmc-counter-dropdown",function(t){return t.stopImmediatePropagation(),t.preventDefault(),w(this).removeClass("lists-show"),!1}),e.on("mouseover",".wlfmc-counter-wrapper.show-list-on-hover .wlfmc-counter.has-dropdown",function(t){t.stopImmediatePropagation(),t.preventDefault();t=w(".dropdown_"+w(this).attr("data-id"))||w(this).closest(".wlfmc-counter-wrapper").find(".wlfmc-counter-dropdown");return w(t).addClass("lists-show"),w.fn.WLFMC.appendtoBody(t.closest(".wlfmc-counter-wrapper")),w.fn.WLFMC.prepare_mini_wishlist(t),!1}),e.on("mouseout",".wlfmc-counter-wrapper.show-list-on-hover .wlfmc-counter.has-dropdown",function(t){t.stopImmediatePropagation(),t.preventDefault();t=w(".dropdown_"+w(this).attr("data-id"));return w(t).removeClass("lists-show"),!1}),w(".wlfmc-counter-wrapper.show-list-on-hover .wlfmc-counter.has-dropdown").hoverIntent({interval:0,timeout:100,over:w.fn.WLFMC.show_mini_wishlist,out:w.fn.WLFMC.hide_mini_wishlist})),w.fn.WLFMC.init_prepare_qty_links(),w.fn.WLFMC.init_wishlist_popup(),w.fn.WLFMC.init_quantity(),w.fn.WLFMC.init_checkbox_handling(),w.fn.WLFMC.init_copy_wishlist_link(),w.fn.WLFMC.init_tooltip(),w.fn.WLFMC.init_components(),w.fn.WLFMC.init_popups(),w.fn.WLFMC.init_popup_checkbox_handling()}).trigger("wlfmc_init"),w(document).on("jet-filter-content-rendered",w.fn.WLFMC.reInit_wlfmc).on("jet-woo-builder-content-rendered",w.fn.WLFMC.reInit_wlfmc).on("jet-engine/listing-grid/after-load-more",w.fn.WLFMC.reInit_wlfmc).on("jet-engine/listing-grid/after-lazy-load",w.fn.WLFMC.reInit_wlfmc).on("jet-cw-loaded",w.fn.WLFMC.reInit_wlfmc),w(document).ready(w.fn.WLFMC.load_fragments),w(document).on("deContentLoaded",w.fn.WLFMC.load_fragments),w(document).on("wooco_gallery_loaded",function(t,e){e&&w('*[id^="add_to_waitlist_popup_'+e+'_"].popup_wrapper').remove()});new MutationObserver(function(t){t.forEach(function(t){0<w(".woocommerce-product-gallery__wrapper .wlfmc-top-of-image").length&&w.fn.WLFMC.init_fix_on_image_single_position(),0<w(".pp-single-product .entry-summary > .wlfmc-top-of-image").length&&0<w(".pp-single-product .entry-summary .single-product-image").length&&w(".pp-single-product").each(function(){var t=w(this).find(".wlfmc-top-of-image"),e=w(this).find(".single-product-image");0<t.length&&0<e.length&&t.appendTo(e)})})}).observe(w("body")[0],{childList:!0,subtree:!0}),w(window).on("scroll resize",function(){w(".wlfmc-counter-dropdown").each(function(){w.fn.WLFMC.prepare_mini_wishlist(w(this))})});var i,r=!0,s=wlfmc_l10n.wishlist_hash_key,l=s+"_products",c=s+"_lang";try{r="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wlfmc","test"),window.sessionStorage.removeItem("wlfmc"),window.localStorage.setItem("wlfmc","test"),window.localStorage.removeItem("wlfmc")}catch(t){r=!1}if(wlfmc_l10n.is_cache_enabled&&wlfmc_l10n.is_page_cache_enabled&&w.fn.WLFMC.table_block(),r){w(window).on("storage onstorage",function(t){l===t.originalEvent.key&&localStorage.getItem(l)!==sessionStorage.getItem(l)&&w.fn.WLFMC.load_fragments()}),w(window).on("pageshow",function(t){t.originalEvent.persisted&&w.fn.WLFMC.load_fragments()});try{if(wlfmc_l10n.is_cache_enabled)throw"Need Update wishlist data";if(wlfmc_l10n.update_wishlists_data||null!==e&&e!==localStorage.getItem(c)||localStorage.getItem(l)!==JSON.stringify(o))throw localStorage.setItem(l,""),localStorage.setItem(c,""),w.fn.WLFMC.check_products(o),"Need Update wishlist data";localStorage.getItem(l)&&(i=JSON.parse(localStorage.getItem(l)),"object"===_typeof(i))&&null!==i&&w.fn.WLFMC.check_products(i),w.fn.WLFMC.unblock(w(".wlfmc-wishlist-table-wrapper, .wlfmc-save-for-later-table-wrapper")),w("#wlfmc-lists,#wlfmc-wishlist-form").addClass("on-first-load")}catch(t){console.log(t),w.fn.WLFMC.load_fragments()}}else w.fn.WLFMC.load_fragments();"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.widgetsPreview&&wp.customize.widgetsPreview.WidgetPartial&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){w.fn.WLFMC.load_fragments()})})},{}]},{},[1]);