!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.updatePrices(),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())});
var ThemifyStyles;((e,t,i,r)=>{"use strict";var o,a=null,l={},n={},s={},f={},_={},u={},d={},p=async e=>{if(!window.CompressionStream)throw"err";const t=(new TextEncoder).encode(e),i=new CompressionStream("gzip"),r=i.writable.getWriter();r.write(t),r.close();const o=await new Response(i.readable).arrayBuffer();return btoa(String.fromCharCode(...new Uint8Array(o)))};function c(e,t){return e===r||null===e||""===(e=(""+e).trim())?"":/^var\s*\(/i.test(e)?e:/^--[a-zA-Z0-9_-]+$/.test(e)?"var("+e+")":"0"===e?"0":e+(t||"px")}function h(e,t,i){if(!(i=((i||"")+"").trim()))return null;const r=i.indexOf(":"),o=r>=0?i.slice(0,r):i,a=r>=0?i.slice(r):"",l=o.replace(/\+/g," ").trim(),n=l.match(/^var\(\s*(--[a-zA-Z0-9_-]+)\s*\)$/i),s=l.match(/^--([a-zA-Z0-9_-]+)$/i);let f=n?n[1]:s?"--"+s[1]:"";if(!f)return l.split(" ").join("+")+a;0!==f.indexOf("--")&&(f="--"+f.replace(/^--+/,""));let _="";try{_=e.getComputedStyle(t.documentElement).getPropertyValue(f).trim()}catch(e){}if(_){const e=_.split(",")[0].replace(/^["'\s]+|["'\s]+$/g,"").trim();if(e&&!/^var\(/i.test(e))return e.split(" ").join("+")+a}const u=f.replace(/^--+/,"").toLowerCase(),d=e.tfSVData||e.themifyBuilder&&e.themifyBuilder.tf_sv;if(d&&d.vars){const e=[].concat(d.vars.theme||[],d.vars.user||[]);for(let t=0;t<e.length;t++){const i=e[t];if(!i||"font"!==i.type||!i.name)continue;if((i.name+"").replace(/^--+/,"").toLowerCase()!==u)continue;let r=((i.value||"")+"").trim();if("{"===r.charAt(0))try{const e=JSON.parse(r);e&&e.name&&(r=e.name+"")}catch(e){}if(r=r.split(",")[0].replace(/["']/g,"").trim(),r&&!/^var\(/i.test(r))return r.split(" ").join("+")+a}}return null}if(ThemifyStyles={styleName:"tb_component_customize_",saving:null,disableNestedSel:null,isWorking:!1,fonts:{},cf_fonts:{},bgImages:[],GS:{},convertPreset(e,t){if("buttons"===e||"menu"===e)t.text_align||("icon"===e&&t.icon_position?t.text_align=t.icon_position:"buttons"!==e&&"menu"!==e||!t.alignment||(t.text_align=t.alignment));else if("fancy-heading"===e)for(let e=["top","left","right","bottom"],i=e.length-1;i>-1;--i){let r=e[i];for(let e=["mobile","tablet","tablet_landscape","desktop"],i=e.length-1;i>-1;--i){let o="desktop"===e[i]?t:t["breakpoint_"+e[i]];void 0!==o?.["_margin_"+r+"_divider"]&&(o["md_"+r]=o["_margin_"+r+"_divider"],delete o["_margin_"+r+"_divider"],o["_margin_"+r+"_divider_unit"]&&(o["md_"+r+"_unit"]=o["_margin_"+r+"_divider_unit"],delete o["_margin_"+r+"_divider_unit"]))}}else!t?.alignment||t.g_t_a||"overlay-content"!==e&&"cart-icon"!==e||(t.g_t_a=t.alignment);return t},normalizeArea(e,t){if(!e||-1!==e.indexOf("var")||-1===e.indexOf(" "))return e;e=e.replace(/\s\s+/g," ").trim().split('" "');for(var i=[],r=0;r<e.length;++r){for(var o=[],a=0,l=e[r].replaceAll('"',"").split(" "),n=l.length;a<n;++a){o.push("c"===l[a][0]||"."===l[a]?l[a]:"col"+l[a])}i.push('"'+o.join(" ")+'"')}return!0===t?i:i.join(" ")},init(e,t,i,r){for(var o in r)r[o]>0&&(r[o]+="%"),_[o]=r[o];this.breakpointsReverse=t,u=e,a="undefined"!=typeof tb_app&&tb_app.isVisual,this.t(i)},getRules:e=>e?l[e]:l,getStyleData(e,t){const i={};for(let t in e)"label"!==t&&"units"!==t&&"description"!==t&&"after"!==t&&"options"!==t&&"wrap_class"!==t&&"option_js"!==t&&"class"!==t&&"binding"!==t&&(i[t]=e[t]);return i.p=t,i},parseFontName(e){let t="";if(e){if(0===(e=(""+e).trim()).indexOf("var("))return e;if(0===e.indexOf("--"))return"var("+e+")";for(let i=0,r=(e=e.split(",")).length;i<r;++i){let o=e[i].trim();t+="serif"!==o&&"sans-serif"!==o&&"monospace"!==o&&"fantasy"!==o&&"cursive"!==o&&'"'!==o[0]&&"'"!==o[0]?'"'+o+'"':o,i!==r-1&&(t+=", ")}}return t},getArea(e,o,a,l){var n,_,u=null;if(0===i.keys(s).length){var d=t.tfClass("row_inner")[0],p=!1;d===r&&(p=!0,(d=t.createElement("div")).className="row_inner tf_abs",d.style.display="none",t.body.appendChild(d));for(var c=getComputedStyle(d),h=["","m","t","tl"],m=[1,2,3,4,5,6,"1_2","2_1","1_3","3_1","1_1_2","1_2_1","2_1_1","auto"],g=20;g>1;--g)for(var b=13;b>-1;--b)if(m[b]!==g)for(var v=3;v>-1;--v){var y=c.getPropertyValue(S="--area"+h[v]+g+"_"+m[b]);y&&(s[S]=y.replace(/col/gi,"").replace(/\s\s+/g," ").trim())}for(g=13;g>-1;--g){var k=c.getPropertyValue(S="--c"+m[g]);k&&(f[S]=k.replace(/\s\s+/g," ").replace(/\s0\./g," .").replace(/\.+0*?fr/g,"fr").replace(/\.+0*?\%/g,"%").replace(/\.+0*?em/g,"em").replace(/\.+0*?px/g,"px").trim())}!0===p&&d.remove()}if(e)if(-1!==e.indexOf("var"))u=e;else if(-1!==e.indexOf("_"))u="var(--area"+e.replace("--area","")+")";else{var w=(e=e.replace(/\s\s+/g," ").trim()).replace(/col/gi,""),x="--area",z=null;for(var S in n=x+a[0],_=x+l,-1!==a.indexOf("_")&&(n+=a.split("_")[1][0]),n+=l,s)if(s[S]===w){if(0===S.indexOf(n)){u="var("+S+")";break}null===z&&0===S.indexOf(_)&&(z="var("+S+")")}null===u&&(u=null===z?e:z)}return null!==u?(!1===o&&-1!==u.indexOf("--area")&&(u=u.replace(/ /g,""),n&&(u=u.replace(n,"")),_&&(u=u.replace(_,"")),"_"===(u=(u=u.replace(/var|\(|--areat|--areatl|--aream|--area|\)/g,"")).trim())[0]&&(u=u.substring(1))),u):s},getAreaValue(e){return 0===i.keys(s).length&&this.getArea(),e="--area"+e.replace("--area","").replace("area","").trim(),s[e]||!1},getColSize(e,t){var r=null;if(0===i.keys(f).length&&this.getArea(),e)if("auto"===(e=e.trim())||"none"===e||"initial"===e||-1!==e.indexOf("var"))r=e;else if(-1===e.indexOf(" "))r="var(--c"+e+")";else for(var o in r=e=e.replace(/\s\s+/g," ").replace(/\s0\./g," .").replace(/\.+0*?fr/g,"fr").replace(/\.+0*?\%/g,"%").replace(/\.+0*?em/g,"em").replace(/\.+0*?px/g,"px").trim(),f)if(f[o]===e){r="var("+o+")";break}return null!==r?(-1===r.indexOf("--c")||!1!==t&&-1===r.indexOf(" ")||-1===(r=r.replace(/var|\(|--c|\)/g,"")).indexOf(" ")&&(r=r.replace(/ /g,"")),r):f},getColSizeValue(e){return 0===i.keys(f).length&&this.getArea(),e="--c"+e.replace("--c","").replace("c","").replace("var(","").replace(")","").trim(),f[e]!==r&&f[e]},getGutter(e){if(e===r)return _;for(var t in _)if(_[t]===e||0===_[t]&&0===parseFloat(e))return t;return e},getGutterValue:e=>_[e=(""+e).trim()]!==r?""+_[e]:e,extend(){var e={},t=!1,r=this,o=0,a=arguments.length;!0===arguments[0]&&(t=arguments[0],++o);for(var l=o=>{for(var a in o)i.prototype.hasOwnProperty.call(o,a)&&(e[a]=t&&"[object Object]"===i.prototype.toString.call(o[a])?r.extend(!0,e[a],o[a]):o[a])};o<a;++o){l(arguments[o])}return e},t(e){var i=this.breakpointsReverse,r=t.createDocumentFragment();if("undefined"!=typeof tb_app)for(var o=i.length-1;o>-1;--o){var l=t.createElement("style");l.id=this.styleName+i[o]+"_global","desktop"!==i[o]&&!0===a&&(l.media="(max-width:"+tb_app.Utils.getBPWidth(i[o])+"px)"),r.appendChild(l)}for(o=i.length-1;o>-1;--o)(l=t.createElement("style")).id=this.styleName+i[o],"desktop"!==i[o]&&!0===a&&(l.media="(max-width:"+tb_app.Utils.getBPWidth(i[o])+"px)"),r.appendChild(l);var n=t.tfId("tb_active_style_"+e);null!==n?n.parentNode.replaceChild(r,n):null!==(n=t.tfId("themify_concate-css"))?n.parentNode.insertBefore(r,n.nextSibling):t.body.appendChild(r)},getSheet(e,i){return!0===i&&(e+="_global"),t.tfId(this.styleName+e).sheet},getBaseSelector(e,t,i,o){let l=".themify_builder_content-"+t+" .tb_"+i;return"row"!==e&&"column"!==e&&"subrow"!==e&&(l+=".module-"+e),!1===a&&o!==r&&"desktop"!==o&&"undefined"!=typeof tb_app&&(l=".builder-breakpoint-"+o+" "+l),l},getNestedSelector(e){if(null===this.disableNestedSel){const t=["p","blockquote","h1","h2","h3","h4","h5","h6","li","span"],i=t.length;for(let r=(e=e.slice(0)).length-1;r>-1;--r)if(e[r].includes(".tb_text_wrap")){let o=e[r].trimRight();if(o.endsWith(".tb_text_wrap"))for(let r=0;r<i;++r)e.push(o+" "+t[r])}}return e},toRGBA(e){if(e!==r&&null!==e&&""!==e&&"#"!==e){if(0!==(e=(""+e).replace(/--([a-z0-9_-]+)_undefined/gi,"--$1")).indexOf("#var(")&&0!==e.indexOf("#--")||(e=e.substring(1)),0===e.indexOf("var("))return e;if(0===e.indexOf("--"))return"var("+e+")";if("transparent"===e||e.includes("rgba"))return e;let t=e.split("_");if(t[0]!==r){let i=/^([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})$/.exec(t[0].replace("#","")),o=t[1]!==r&&null!==t[1]&&""!==t[1]?t[1]:1;return o=parseFloat(""+parseFloat(parseFloat(o).toFixed(2))),o>=.99&&(o=1),i?"rgba("+parseInt(i[1],16)+", "+parseInt(i[2],16)+", "+parseInt(i[3],16)+", "+o+")":"#"!==e[0]?"#"+e:e}"#"!==e[0]&&(e="#"+e)}else e="";return e},rgbToHex(e){if(e.includes("rgb")){const t=e.replace(")","").split("(")[1].split(",");if(t[2]!==r){if(t[3]!==r)if(1==t[3])t.splice(3,1);else if(0==t[3])return"transparent";t[3]===r&&(e="#"+((1<<24)+(parseFloat(t[0].trim())<<16)+(parseFloat(t[1].trim())<<8)+parseFloat(t[2].trim())).toString(16).slice(1))}}return"#"===e[0]&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]&&(e="#"+e[1]+e[3]+e[5]),e},getStyleVal(e,t,i){let o=r;if(e){if(0!==(e=""+e).indexOf("tf_sv_")){const o=e.endsWith("_unit")?e.slice(0,-5):e,a=this.getStyleVal("tf_sv_"+o,t,i);if(a!==r&&""!==a){if(e.endsWith("_unit"))return"";let t=(""+a).trim().replace(/_undefined$/i,"");if(""!==t&&"undefined"!==t.toLowerCase())return 0===t.indexOf("var(")?t:0===t.indexOf("--")?"var("+t+")":"var(--"+t.replace(/^--+/,"")+")"}}if("desktop"===i)o=""!==t[e]?t[e]:r;else if(t["breakpoint_"+i]!==r&&t["breakpoint_"+i][e]!==r&&""!==t["breakpoint_"+i][e])o=t["breakpoint_"+i][e];else for(let a=this.breakpointsReverse,l=a.indexOf(i)+1,n=a.length;l<n;++l)if("desktop"!==a[l]){if(t["breakpoint_"+a[l]]!==r&&t["breakpoint_"+a[l]][e]!==r&&""!==t["breakpoint_"+a[l]][e]){o=t["breakpoint_"+a[l]][e];break}}else if(""!==t[e]&&t[e]!==r){o=t[e];break}o!==r&&""!==o||!e.endsWith("_unit")||-1!==e.indexOf("frame_")||(o="px")}return o},generateGSstyles(e,t,i){n[t]===r&&(n[t]={});for(var o=this.getStyleOptions(t),a=this.breakpointsReverse,l={},s=(e,i,a)=>{if(n[t][i]!==r)return n[t][i];if(e.is_overlay===r&&"frame"!==e.type&&"video"!==e.type&&("radio"!==e.type||e.prop!==r)){var l=e.p,s=e.type,f=e.is_responsive,_=null,u=e.is_hover,d=e.prop;if("select"===s||"icon_radio"===s||"radio"===s||"checkbox"===s||"icon_checkbox"===s)for(var p in e)if(!0===e[p]&&"option_js"!==p){_=p;break}var c=()=>{for(var e in o)if(l===o[e].p&&d===o[e].prop&&s===o[e].type&&u===o[e].is_hover&&(null===_||!0===o[e][_])&&f===o[e].is_responsive)return n[t][i]=e,!0;return!1};if(!0===c())return n[t][i];if("background-image"!==d||"image"!==s&&"imageGradient"!==s){if("margin-top"===d||"margin-bottom"===d)if("row"===t||"column"===t){if("margin"===s&&"row"!==a&&"column"!==a&&(s="range",!0===c()))return n[t][i]}else if("range"===s&&("row"===a||"column"===a)&&(s="margin",!0===c()))return n[t][i]}else if(s="imageGradient",!0===c())return n[t][i]}return n[t][i]=!1,!1},f=a.length,_=0;_<e.length;++_){var u=e[_].trim();if(""!==u&&i[u]!==r){var d=i[u].data[0],p=i[u].type;if(!d)continue;if("row"!==p&&"subrow"!==p&&(d=d.cols[0]),"column"===p||"row"===p||"subrow"===p?d=d.styling:(p=(d=d.modules[0]).mod_name,d=d.mod_settings),d!==r)for(var c=t===p?o:this.getStyleOptions(p),h=f-1;h>-1;--h)if("desktop"===a[h])for(var m in d){if(-1!==m.indexOf("-frame_width")||-1!==m.indexOf("-frame_height")?o[m]=c[m]={}:"font_gradient_color-gradient"===m&&c[m]===r&&(c[m]=c.font_gradient_color),c[m]!==r&&(l[m]===r||""===l[m]||!1===l[m]))((v=o[m]!==r?m:s(c[m],m,p))===m||!1!==v&&!l[v]&&"0"!=l[v])&&(l[v]=d[m])}else if(d["breakpoint_"+a[h]]!==r){var g=!0,b="breakpoint_"+a[h];for(var m in l[b]===r&&(l[b]={},g=!1),d[b]){var v;if(c[m]!==r&&c[m].is_responsive===r&&(l[b][m]===r||""===l[b][m]||!1===l[b][m]))((v=o[m]!==r?m:s(c[m],m,p))===m||!1!==v&&!l[b][v]&&"0"!=l[b][v])&&(l[b][v]=d[b][m],g=!0)}!1===g&&delete l[b]}}}return l},async createCss(e,t,o,a,l,n,s){o||(o="row"),this.saving=a;var f=this.breakpointsReverse,_=f.length,u={},d={},p=this,c=async(e,t,o)=>{var a=async(e,t,o,a,s)=>{if(a!==r&&null!==a){if("row"!==t&&"column"!==t&&"subrow"!==t&&(a=p.convertPreset(t,a)),l!==r&&a.global_styles!==r&&""!==a.global_styles){const i=p.generateGSstyles(a.global_styles.split(" "),t,l),n=await p.createCss(e,[{styling:i,element_id:o}],t,p.saving,r,!0);p.GS=p.extend(!0,{},p.GS,n)}a.builder_content!==r&&("string"==typeof a.builder_content&&(a.builder_content=JSON.parse(a.builder_content)),await n(a.builder_content,o,"tab"===t||"accordion"===t?"subrow":"row"))}await(async(e,t,o,a,l)=>{var n=a!==r?p.extend(!0,{},a):{};if("row"===t||"subrow"===t){var s,d=l.cols?l.cols.length:0;if(l.sizes!==r){s=i.assign({},l.sizes);for(var c=0;c<_-1;++c)if(s[f[c]+"_size"]===r&&s[f[c]+"_area"]===r)for(var h=c+1;h<_-1;++h)if(s[f[h]+"_size"]!==r){s[f[c]+"_size"]=s[f[h]+"_size"];break}}else{if(s={},d>1){l.gutter!==r&&""!==l.gutter&&"gutter-default"!==l.gutter&&"gutter"!==l.gutter&&(s.desktop_gutter=l.gutter.replace("gutter-","")),h=0;for(var m,g=[],b=[],v=s.desktop_gutter||"def",y=!1,k=!1,w=p.getOldColsSizes(v),x=l.cols.length;h<x;++h)if(l.cols[h].grid_width)y=!0,g.push(l.cols[h].grid_width);else if(l.cols[h].grid_class){var z=l.cols[h].grid_class.split(" ")[0].replace(/tb_3col|tablet_landscape|tablet|mobile|column|first|last/gi,"").trim();w[z]!==r&&g.push(w[z]),b.push(z)}if(!1===(k=y)&&"def"!==v&&b.length>0&&(k=-1!==(m=p.gridBackwardCompatibility(b)).indexOf("_")),!0===k){var S=Math.min.apply(null,g);for(h=g.length-1;h>-1;--h)g[h]=S===g[h]?"1fr":parseFloat((g[h]/S).toFixed(5))+"fr";m=g.join(" ").trim()}else g=null,!m&&b.length>0&&(m=p.gridBackwardCompatibility(b));for("rtl"!==l.desktop_dir||!0!==y&&-1===(""+m).indexOf("_")||(m=(m=(m=m.split(!0===y?" ":"_")).reverse()).join(!0===y?" ":"_")),s.desktop_size=m,b=null,c=_-1;c>-1;--c)if(s[(j=f[c])+"_dir"]=l[j+"_dir"]||"ltr","desktop"!==j){var B=l["col_"+j]&&"auto"!==l["col_"+j]&&"-auto"!==l["col_"+j]?p.gridBackwardCompatibility(l["col_"+j]):"auto";if("auto"===B)if(!0===y)B=m;else{var T,C=j[0];if(-1!==j.indexOf("_")&&(C+=j.split("_")[1][0]),(T=p.getAreaValue(C+d+"_"+B))||(T=p.getAreaValue(d+"_"+B)),!T){for(h=c+1;h<_;++h){var F=s[(N=f[h])+"_size"];if(F===r&&(F=!(!l["col_"+N]||"auto"===l["col_"+N]||"-auto"===l["col_"+N])&&l["col_"+N]),F&&"auto"!==F){T=-1!==F.indexOf("fr")?F:p.gridBackwardCompatibility(F);break}}B=T||""+d}}else if(-1===(""+B).indexOf("_")&&B>0&&B<6&&d<B)for(h=c+1;h<_;++h)if(s[f[h]+"_size"]!==r){B=s[f[h]+"_size"];break}s[j+"_size"]=B}for(c=_-2;c>-1;--c)s[f[c]+"_size"]===r&&(s[f[c]+"_size"]="auto")}l.column_h!==r&&""!==l.column_h&&(s.desktop_auto_h="1"),l.column_alignment!==r&&""!==l.column_alignment&&(s.desktop_align=l.column_alignment)}for(c=0;c<_-1;++c){var A=s[(j=f[c])+"_gutter"],I=s[j+"_auto_h"],O=s[j+"_size"],G=s[j+"_align"];if(1===d&&(delete s[j+"_dir"],delete s[j+"_size"],delete s[j+"_area"],delete s[j+"_gutter"],delete s[j+"_auto_h"],O=I=A=null),A||G||I||O)for(h=c+1;h<_;++h){var N=f[h];if(A&&s[N+"_gutter"]&&(s[N+"_gutter"]===A&&delete s[j+"_gutter"],A=null),G&&s[N+"_align"]&&(s[N+"_align"]===G&&delete s[j+"_align"],G=null),I&&s[N+"_auto_h"]&&(s[N+"_auto_h"]===I&&delete s[j+"_auto_h"],I=null),O&&s[N+"_size"]&&(s[N+"_size"]!==O||!s[j+"_area"]&&-1===O.indexOf(" ")||delete s[j+"_size"],O=null),!(A||G||I||O))break}}for(c=_-1;c>-1;--c){var j=f[c];for(var R in s)0!==R.indexOf(j)||"tablet"===j&&-1!==R.indexOf("tablet_landscape")||("desktop"===j?(n.grid===r&&(n.grid={count:d}),n.grid[R]=s[R]):(n["breakpoint_"+j]===r&&(n["breakpoint_"+j]={}),n["breakpoint_"+j].grid===r&&(n["breakpoint_"+j].grid={count:d}),n["breakpoint_"+j].grid[R]=s[R]))}n.grid===r&&(n.grid={count:d})}if(0!==i.keys(n).length)for(let a=_-1;a>-1;--a){let l=null;if("desktop"===f[a]?l=await p.i(e,o,f[a],t,n,n):n["breakpoint_"+f[a]]!==r&&0!==i.keys(n["breakpoint_"+f[a]]).length&&(l=await p.i(e,o,f[a],t,n["breakpoint_"+f[a]],n)),l&&0!==i.keys(l).length){u[f[a]]===r&&(u[f[a]]={});for(let e in l)if(u[f[a]][e]===r)u[f[a]][e]=l[e];else for(let t=l[e].length-1;t>-1;--t)u[f[a]][e].push(l[e][t])}}})(e,t,o,a,s)},n=async(e,t,i)=>{for(let o in e){let l=e[o],s=l.styling||l.mod_settings;if(l.element_id!==r&&await a(t,i,l.element_id,s,l),l.cols!==r)for(let e=0;e<l.cols.length;++e){let i=l.cols[e];if(i.styling!==r&&await a(t,"column",i.element_id,i.styling,i),i.modules!==r)for(let e=0;e<i.modules.length;++e){let o=i.modules[e];if(o)if(o.mod_name!==r){let e=o.mod_settings;if(e!==r){await a(t,o.mod_name,o.element_id,e,o);let i=e.content_accordion||e.tab_content_tab;if(i)for(let e=0;e<i.length;++e)i[e].builder_content&&await n(i[e].builder_content,t,"subrow");else"toggle"===o.mod_name&&(o.mod_settings.toggle1&&await n(o.mod_settings.toggle1,t,"subrow"),o.mod_settings.toggle2&&await n(o.mod_settings.toggle2,t,"subrow"))}}else await n([o],t,"subrow")}}}};await n(e,t,o)};if(await c(t,e,o),n===r){let e=JSON.stringify(t).replace(/&quot;/gim,"").match(/font-family\:(.*?)\;/gim);if(e)for(let t=e.length-1;t>-1;--t){let i=e[t].replace(/font-family:|;|\'/gi,"").trim();i&&this.fields.font_select.call(this,t+1,"inline",{},{[t+1]:i},null,"desktop")}e=null,i.keys(this.fonts).length>0&&(d.fonts=this.fonts),0!==i.keys(this.cf_fonts).length&&(d.cf_fonts=this.cf_fonts),0!==i.keys(this.GS).length&&(d.gs=this.GS),i.keys(this.bgImages),this.fonts={},this.GS={},this.cf_fonts={},this.bgImages=[],this.saving=null}p=c=null;for(var h=_-1;h>-1;--h)u[f[h]]!==r&&(d[f[h]]=u[f[h]]);return f=_=null,this.optimizeCss(d,s)},getStyleOptions(e){if(l[e]===r){const t=u;if(t[e]===r)return!1;{l[e]={};const i=(t,o)=>{for(var a in t)if(null!==t[a]){let s=t[a],f=s.type,_=s.selector;if("expand"===f||"multi"===f||"group"===f){let e=o;"expand"===f&&s.label!==r&&(e=s.label.replace(/\s/g,""),o!==r&&(e=o+"_"+e)),i(s.options,e)}else if("tabs"===f)for(let e in s.options){i(s.options[e].options||s.options[e],o===r?e:o+"_"+e)}else if("mask_image"===f)l[e][s.prefix+"mask"]={type:"image",selector:s.selector,prop:"mask-image",id:s.prefix+"mask"},l[e][s.prefix+"mask_r"]={type:"select",selector:s.selector,prop:"mask-repeat",id:s.prefix+"mask_r",size:s.prefix+"mask_size"},l[e][s.prefix+"mask_p"]={type:"position_box",selector:s.selector,prop:"mask-position",id:s.prefix+"mask_p"},l[e][s.prefix+"mask_size"]={type:"range",selector:s.selector,prop:"mask-size",id:s.prefix+"mask_size",repeat:s.prefix+"mask_r"};else if(s.id!==r){let t=s.id;if(s.prop!==r){l[e][t]=this.getStyleData(s,o);let i=s.prop;if("font-size"!==i&&"line-height"!==i&&"letter-spacing"!==i&&("range"!==f||"margin-top"!==i&&"margin-bottom"!==i)||(l[e][t+"_unit"]={type:"select",p:o}),"box_shadow"===f||"text_shadow"===f){let i="box_shadow"===f?["hOffset","vOffset","blur","spread","color"]:["hShadow","vShadow","blur","color"];for(let r=i.length-1;r>-1;--r){let a=t+"_"+i[r];l[e][a]=this.getStyleData(s,o),"color"!==i[r]&&(l[e][a+"_unit"]={type:"select",p:o})}"box_shadow"===f&&(l[e][t+"_inset"]={type:"checkbox",p:o})}else if("fontColor"===f)l[e][s.s]===r&&(l[e][s.s]={type:"color",prop:"color",isFontColor:!0,selector:_,origId:t,p:o}),l[e][s.g]===r&&(l[e][s.g]={type:"gradient",p:o},l[e][s.g]=l[e][s.g+"-gradient-angle"]=l[e][s.g+"-circle-radial"]=l[e][s.g+"-gradient-type"]={type:"gradient",p:o});else if("fontStyle"===f)l[e][t+"_regular"]=this.getStyleData(s,o),l[e][t+"_regular"].type="icon_radio",l[e][s.id2]={type:"icon_radio",prop:"font-weight",selector:_,p:o};else if("padding"===f||"margin"===f||"border"===f||"border_radius"===f){let r=["top","right","bottom","left"],a="border"===f,_=!1===a&&"border_radius"===f;!0===a?l[e][t+"-type"]={type:"radio",p:o}:(l[e]["checkbox_"+t+"_apply_all"]={type:"checkbox",p:o},!1===_&&(l[e][t+"_opp_top"]={type:"checkbox",p:o},l[e][t+"_opp_left"]={type:"checkbox",p:o}));for(let f=r.length-1;f>-1;--f){let u=t+"_"+r[f];if(!0===a&&(l[e][u+"_style"]=this.getStyleData(s,o),l[e][u+"_color"]=this.getStyleData(s,o),l[e][u+"_style"].prop=i+"-"+r[f]+"-style",l[e][u+"_color"].prop=i+"-"+r[f]+"-color",l[e][u+"_color"].type="color",u+="_width"),l[e][u]=this.getStyleData(s,o),l[e][u+"_unit"]={type:"select",p:o},!0===_){var n="border-";"top"===r[f]?n+="top-left-radius":"right"===r[f]?n+="top-right-radius":"left"===r[f]?n+="bottom-left-radius":"bottom"===r[f]&&(n+="bottom-right-radius"),l[e][u].prop=n}else l[e][u].prop=i+"-"+r[f]}}else if("gradient"===f||"imageGradient"===f)l[e][t+"-gradient"]=this.getStyleData(s,o),l[e][t+"-gradient-angle"]=l[e][t+"-circle-radial"]=l[e][t+"-gradient-type"]={type:"gradient",p:o},"imageGradient"===f&&(l[e][t+"-type"]={type:"radio",p:o},l[e][s.colorId]=this.getStyleData(s,o),l[e][s.colorId].prop="background-color",l[e][s.colorId].type="color",l[e][s.colorId].id=s.colorId);else if("multiColumns"===f)l[e][t+"_gap"]={type:f,p:o,prop:"column-gap",selector:_},l[e][t+"_gap_unit"]={type:"select",p:o},l[e][t+"_divider_color"]={type:f,p:o,prop:"column-rule-color",selector:_},l[e][t+"_divider_width"]={type:f,p:o,prop:"column-rule-width",selector:_},l[e][t+"_divider_width_unit"]={type:"select",p:o},l[e][t+"_divider_style"]={type:f,p:o,prop:"column-rule-style",selector:_};else if("font_select"===f)l[e][t+"_w"]={type:"font_weight"};else if("filters"===f){let i=["hue","saturation","brightness","contrast","invert","sepia","opacity","blur"];for(let r=i.length-1;r>-1;--r)l[e][t+"_"+i[r]]=this.getStyleData(s,o);l[e][s.mid]={prop:"mix-blend-mode",selector:_,type:"select"},s.h&&(l[e][s.mid].h=!0)}else if("width"===f||"height"===f){let i="width"===f?"max_"+t:s.maxid||"mx_h";l[e]["width"===f?"min_"+t:s.minid||"mi_h"]={prop:"min-"+f,selector:_,type:f,p:o},l[e][i]={prop:"max-"+f,selector:_,type:f,p:o},l[e][t+"_auto_"+f]={prop:f,selector:_,type:f,p:o},l[e][t+"_unit"]={type:"select",p:o}}else if("transform"===f){let i=this.getStyleData(s,o);for(let r=["scale","translate","skew"],o=r.length-1;o>-1;--o){let a=t+"_"+r[o];l[e][a+"_top"]=l[e][a+"_bottom"]=i}for(let r=["x","y","z"],o=r.length-1;o>-1;--o)l[e][t+"_rotate_"+r[o]]=i;l[e][t+"_position"]={prop:"transform-origin",type:"position_box",selector:i.selector}}else if("frame-custom"===i&&t.includes("frame_type")){let i=t.split("-")[0]+"-",r=["frame_custom","frame_color","frame_width","frame_height","frame_repeat","frame_sh_x","frame_sh_y","frame_sh_b","frame_sh_c","frame_ani_dur","frame_ani_rev"];for(let t=r.length-1;t>-1;--t){let o=i+r[t];l[e][o]||(l[e][o]={}),l[e][o].prop="frame-custom",l[e][o].type="radio",l[e][o].selector=_}}}else l[e][t]||(l[e][t]=this.getStyleData(s,o))}else"margin_opposity"===f&&(l[e][s.topId]={prop:"margin-top",selector:_,type:"range",p:o},l[e][s.bottomId]={prop:"margin-bottom",selector:_,type:"range",p:o},l[e][s.topId+"_unit"]={type:"select",p:o},l[e][s.bottomId+"_unit"]={type:"select",p:o},l[e][s.topId+"_opp_top"]={type:"checkbox",p:o})}};i(t[e].styling!==r?t[e].styling.options.length!==r?t[e].styling.options:t[e].styling:t[e].type===r?t[e]:[t[e]])}}return l[e]},async i(e,t,o,l,n,s){if(u[l]!==r){const f={},_=this.getStyleOptions(l),u=this.getBaseSelector(l,e,t),d=!0===this.saving;n.resp_no_bg!==r&&!1!==n.resp_no_bg&&(n[_.resp_no_bg.origId]="none"),["top","right","bottom","left"].forEach((e=>{n[e+"-frame_layout"]&&!n[e+"-frame_type"]&&(n[e+"-frame_type"]=e+"-presets")}));const p=i.keys(n);for(let e=p.length-1;e>-1;--e){let t=p[e];if(0===t.indexOf("tf_sv_")&&n[t]&&""!==n[t]){let e=t.substring(6);_[e]!==r&&_[e].selector!==r&&-1===p.indexOf(e)&&p.push(e)}}for(let e=p.length-1;e>-1;--e){let i=p[e];if(_[i]!==r&&_[i].selector!==r){let e=_[i].type;"margin"===e?e="padding":"letterSpace"===e||"lineHeight"===e||"fontSize"===e||"zIndex"===e?e="range":_[i].style_handler!==r&&(e=_[i].style_handler);let p=await this.fields[e].call(this,i,l,_[i],n,t,s,o);if(!1!==p){let e=Array.isArray(_[i].selector)?_[i].selector:[_[i].selector],t=!0===_[i].h||!0===_[i].ishover,o=[];e=this.getNestedSelector(e);for(let i=0;i<e.length;++i){let r=e[i];if(!0!==t||r.endsWith(":after")||r.endsWith(":before")||(r+=":hover"),!0===a)if(!1===d)!0!==t&&-1===r.indexOf(":hover")||(r+=","+u+r.replace(":hover",".tb_visual_hover"));else if(-1!==r.indexOf(".tb_visual_hover")){let e=r.split(",");for(let t=e.length-1;t>-1;--t)-1!==e[t].indexOf(".tb_visual_hover")&&e.splice(t,1);r=e.join(","),e=null}o.push(u+r)}o=o.join(",").trim().replace(/\s\s+/g," "),f[o]===r&&(f[o]=[]),p=p.split("#@#");for(let e=0;e<p.length;++e)""!==p[e]&&-1===f[o].indexOf(p[e])&&f[o].push(p[e])}else null===p&&delete n[i]}}return f}return!1},fields:{frameCache:{},imageGradient(e,t,i,r,o,a,l){let n=!1,s=-1!==e.indexOf("-gradient",3),f=!0===s?e.replace("-gradient","-type"):e+"-type";if(f=this.getStyleVal(f,a,l),"gradient"===f)!0===s&&(n=this.fields.gradient.call(this,e,t,i,r,o,a,l),n+="background-color:transparent#@#");else if(!1===s&&(n=this.fields.image.call(this,e,t,i,r,o,a,l),!1!==n&&""!==this.getStyleVal(e,a,l))){var _=this.fields.select.call(this,i.repeatId,t,{prop:"background-mode",origId:i.origId},r,o,a,l);!1!==_&&(n+=_),n+=!1!==(_=this.fields.position_box.call(this,i.posId,t,{prop:"background-position",origId:i.origId},r,o,a,l))?_:"background-position:50% 50%#@#"}return n},image(e,t,i,o,a,l,n){let s=this.getStyleVal(e,l,n),f=!1;if(s!==r){if("background_image"===e||"bg_i_h"===e){let t="background_image"===e?"background_type":"b_t_h";if(t=this.getStyleVal(t,l,n),t&&"image"!==t&&"video"!==t)return!1;s="desktop"!==n&&"none"===this.getStyleVal("resp_no_bg",l,n)?"":s}""===s||"none"===s?"desktop"!==n&&(f=i.prop+":none#@#","mask-image"===i.prop&&(f+="-webkit-mask-image: none#@#")):(!0===this.saving&&this.bgImages.push(s),f=i.prop+":url("+s+")#@#","mask-image"===i.prop&&(f+='-webkit-mask-image: url("'+s+'")#@#'))}return f},gradient(e,t,i,r,o,a,l){let n=!1,s=i.id,f=this.getStyleVal(e,a,l);if(!s)return!1;if("background_gradient"===s||"b_g_h"===s||"cover_gradient"===s||"cover_gradient_hover"===s){let e;if(e="background_gradient"===s?"background_type":"b_g_h"===s?"b_t_h":"cover_gradient"===s?"cover_color-type":"cover_color_hover-type",e=this.getStyleVal(e,a,l),"gradient"!==e&&"hover_gradient"!==e&&"cover_gradient"!==e)return!1}if(f){let e,t=f.split("|"),r=this.getStyleVal(s+"-gradient-type",a,l)||"linear",o=[];"radial"===r?e=this.getStyleVal(s+"-circle-radial",a,l)?"circle":"":(e=this.getStyleVal(s+"-gradient-angle",a,l)||"180",e+="deg"),""!==e&&(e+=",");for(let e=0;e<t.length;++e){let i=parseInt(t[e])+"%",r=t[e].replace(i,"").trim();o.push(r+" "+i)}o=o.join(","),n=i.prop+":"+r+"-gradient("+e+o+")#@#"}return n},icon_radio(e,t,i,r,o,a,l){const n=this.getStyleVal(e,a,l);return!!n&&i.prop+":"+n+"#@#"},color(e,t,i,o,a,l,n){if("column-rule-color"===i.prop)return!1;let s=this.getStyleVal(e,l,n);if(s===r)return delete o[e],!1;let f=this.toRGBA(s);if(""===f||"_"===f)return delete o[e],!1;if(!0===i.isFontColor)return this.fields.fontColor.call(this,i.origId,t,{s:e},o,a,l,n);let _=i.prop+":"+f+"#@#";if(i.colorId!==e||i.origId===r||this.getStyleVal(i.origId,l,n)){if(!("b_c_h"!==e&&"b_c_i_h"!==e||"row"!==t&&"column"!==t&&"subrow"!==t)){this.getStyleVal("b_c_h"===e?"bg_i_h":"b_i_i_h",l,n)||("b_c_h"!==e||"b_c_h"===e&&"gradient"!==this.getStyleVal("b_t_h",l,n))&&(_+="background-image:none#@#")}}else{if("gradient"===this.getStyleVal(i.origId+"-type",l,n))return!1;_+="background-image:none#@#"}return _},fontColor(e,t,i,o,a,l,n){let s=this.getStyleVal(e,l,n),f=!1;return s===r||-1===s.indexOf("_gradient")?(f=this.fields.color.call(this,i.s!==r?i.s:s.replace(/_solid$/gi,""),t,{prop:"color"},o,a,l,n),!1!==f&&(f+="background-image:none#@#background-clip:border-box#@#")):s!==r&&(f=this.fields.gradient.call(this,s.replace(/_gradient$/gi,"-gradient"),t,{prop:"background-image",id:i.g},o,a,l,n),!1!==f&&(f+="background-clip:text#@#-webkit-background-clip:text#@#color:transparent#@#")),f},padding(e,t,i,o,a,l,n){let s=i.prop,f=-1!==s.indexOf("padding")?"padding":"margin",_=i.id,u=this.getStyleVal(e,l,n),p=this.getStyleVal("checkbox_"+_+"_apply_all",l,n);if(u===r||"padding"===f&&u<0)return delete o[e+"_unit"],!1;if(p&&"|"!==p&&"false"!==p){if(s!==f+"-top")return!1;s=f}let c=this.getStyleVal(e+"_unit",l,n)||"px",h=(""+u).split(",");return"%"===c&&"column"===t&&h[0]&&h[1]===r&&-1!==["padding_top","padding_bottom","padding_left","padding_right","margin-bottom","margin-top"].indexOf(e)&&(d[n]===r&&(d[n]={}),d[n][a]===r&&(d[n][a]=[]),d[n][a].push(e)),u=h[1]!==r&&""!==h[1]?h[1]:h[0],u=u.trim(),"0"===u&&(c=""),0===u.indexOf("var(")?s+":"+u+"#@#":0===u.indexOf("--")?s+":var("+u+")#@#":s+":"+u+c+"#@#"},box_shadow(e,t,i,o,a,l,n){let s=i.prop,f=i.id;if(this.getStyleVal(e,l,n)===r)return delete o[e+"_unit"],!1;let _="box-shadow"===s?["hOffset","vOffset","blur","spread"]:["hShadow","vShadow","blur"],u="",d=!0;for(let e=0;e<_.length;++e){let t=f+"_"+_[e],i=this.getStyleVal(t,l,n),o=this.getStyleVal(t+"_unit",l,n)||"px";i===r?i="0":d=!1,i=(""+i).trim(),0===i.indexOf("var(")?o="":0===i.indexOf("--")&&(i="var("+i+")",o=""),u+=i+o+" "}return!1===d?(u+=this.toRGBA(this.getStyleVal(f+"_color",l,n)),"box-shadow"===s&&"inset"===this.getStyleVal(f+"_inset",l,n)&&(u="inset "+u),u=s+":"+u+"#@#"):u=!1,u},text_shadow(e,t,i,r,o,a,l){return this.fields.box_shadow.call(this,e,t,i,r,o,a,l)},border_radius(e,t,i,o,a,l,n){let s=i.id,f=this.getStyleVal("checkbox_"+s+"_apply_all",l,n),_=i.prop;"1"===f?.toString()&&(e=s+"_top",_="border-radius");let u=this.getStyleVal(e,l,n);if(u===r)return delete o[e+"_unit"],!1;const d=this.getStyleVal(e+"_unit",l,n)||"px";return u=(""+u).trim(),0===u.indexOf("var(")?_+":"+u+"#@#":0===u.indexOf("--")?_+":var("+u+")#@#":_+":"+u+d+"#@#"},border(e,t,i,o,a,l,n){let s,f=i.prop,_=i.id,u=this.getStyleVal(e,l,n);if(-1!==e.indexOf("_color")||"none"!==u&&-1!==e.indexOf("_style"))return!1;if("all"===(this.getStyleVal(_+"-type",l,n)||"top")){if(-1===f.indexOf("border-top"))return!1;f="border"}let d=this.getStyleVal(e.replace("_width","_style"),l,n),p=e.replace("_width","_color");if("none"===d)s=d;else{if(u===r)return!1;d||(d="solid");const e=(u+"").trim();let t;t=0===e.indexOf("var(")?e:0===e.indexOf("--")?"var("+e+")":u+"px",s=t+" "+d;let i=this.getStyleVal(p,l,n);""!==i&&i!==r?s+=" "+this.toRGBA(i):delete o[p]}return f+":"+s+"#@#"},select(e,t,i,o,a,l,n){let s=i.prop,f="",_=this.getStyleVal(e,l,n),u=e.endsWith("_inner")?"_inner":"";if(_===r||""===_||"column-rule-style"===s)return!1;if("background-mode"===s||"background-repeat"===s||"background-attachment"===s){const e=i.origId&&0===i.origId.indexOf("background_image");if(!this.getStyleVal(i.origId,l,n)||e&&!u&&this.getStyleVal("resp_no_bg",l,n))return!1;if(e&&!u){let e=this.getStyleVal("background_type",l,n);if(e&&"image"!==e)return!1}if("background-mode"===s){var d={repeat:"repeat","repeat-x":"repeat-x","repeat-y":"repeat-y","repeat-none":"no-repeat",space:"space",round:"round","no-repeat":"no-repeat",fullcover:"cover","best-fit-image":"contain","builder-parallax-scrolling":"cover","builder-zoom-scrolling":"100%","builder-zooming":"115%"},p=_;if(d[_]!==r){if(-1!==_.indexOf("repeat")||"space"===_||"round"===_)s="background-repeat","desktop"!==n&&(f="background-size:auto#@#");else if(s="background-size",f="background-repeat:no-repeat#@#","best-fit-image"===_||"builder-parallax-scrolling"===_||"builder-zoom-scrolling"===_||"builder-zooming"===_){let e=this.extend(!0,{},i);e.prop="background-position";let r=this.fields.position_box.call(this,"background_position"+u,t,e,o,a,l,n)||"background-position:center#@#";e=null,f+=r,"builder-parallax-scrolling"===_?f+="background-attachment:fixed#@#--tbBg:parallax#@#":"builder-zooming"===_?f+="background-attachment:scroll#@#--tbBg:zooming#@#":"builder-zoom-scrolling"===_&&(f+="background-attachment:scroll#@#--tbBg:zoom#@#")}_=d[_]}u||"builder-parallax-scrolling"===p||"builder-zooming"===p||"builder-zoom-scrolling"===p||(f+="--tbBg:0#@#")}else if("background-repeat"===s&&"fullcover"===_)s="background-size",_="cover";else if("background-attachment"===s){const e=this.getStyleVal("background_repeat"+u,l,n);if("builder-parallax-scrolling"===e||"builder-zooming"===e||"builder-zoom-scrolling"===e)return!1}}else if("column-count"===s){if("0"==_){let t=[e,e+"_gap",e+"_divider_color",e+"_width",e+"_divider_style"];for(let e=t.length-1;e>-1;--e)delete o[t[e]];return!1}let t=this.getStyleVal(e+"_gap",l,n);""!==t&&t!==r&&(f="column-gap:"+c(t,this.getStyleVal(e+"_gap_unit",l,n)||"px")+"#@#");let i=this.getStyleVal(e+"_divider_style",l,n),a=this.getStyleVal(e+"_width",l,n);if("none"===i)delete o[e+"_divider_color"],delete o[e+"_width"],f+="column-rule:none#@#";else if(""===a||a===r)delete o[e+"_divider_color"],delete o[e+"_width"],delete o[e+"_divider_style"];else{i||(i="solid"),f+="column-rule:"+c(a,this.getStyleVal(e+"_width_unit",l,n)||"px")+" "+i;var h=this.getStyleVal(e+"_divider_color",l,n);""!==h&&h!==r&&(f+=" "+this.toRGBA(h)),f+="#@#"}}else if("vertical-align"===s){if("inline-block"!==o[i.origID])return delete o[e],!1;""!==_&&!0!==this.saving&&r!==themifyBuilder&&(f+="align-self:"+("top"===_?"start":"middle"===_?"center":"end")+"#@#")}else if(!0===i.display&&!0!==this.saving&&r!==themifyBuilder){if("none"===_)return!1;f+="inline-block"===_?"width:auto#@#":"width:100%#@#"}return f+=s+":"+_+"#@#","mask-repeat"===s&&(f+="-webkit-mask-repeat:"+_+"#@#"),f},grid_flow(e,t,i,o,a,l,n){let s=i.prop,f=this.getStyleVal(e,l,n);return f!==r&&""!==f&&("row"!==f||"desktop"!==n)&&s+":"+f+"#@#"},gap(e,t,i,o,a,l,n){let s=i.prop,f=this.getStyleVal(e,l,n),_=this.getStyleVal(e+"_unit",l,n)||"px";const u=i.default||0;return f!==r&&""!==f&&(parseInt(f)!==u||"desktop"!==n)&&(f=(""+f).trim(),0===f.indexOf("var(")?s+":"+f+"#@#":0===f.indexOf("--")?s+":var("+f+")#@#":s+":"+f+_+"#@#")},position_box(e,t,i,o,a,l,n){let s=i.prop,f=this.getStyleVal(e,l,n)?.toString();if(f===r||""===f)return!1;if(!("background-position"!==s||this.getStyleVal(i.origId,l,n)||o.o&&o.o[i.origId]!==r&&""!==o.o[i.origId]))return!1;if(f.includes("-"))f=f.replace("-"," ");else if(f.includes(",")){const e=f.split(",");f=e[0]+"% "+e[1]+"%"}var _=s+":"+f+"#@#";return"mask-position"===s&&(_+="-webkit-mask-position:"+f+"#@#"),_},font_select(e,t,i,o,a,l,n){let s=l||o,f=this.getStyleVal(e,s,n),_="";if("default"===f||""===f||f===r)return delete o[e],delete o[e+"_w"],!1;let u="undefined"!=typeof ThemifyConstructor&&ThemifyConstructor.font_select.google[f]!==r||"undefined"!=typeof ThemifyBuilderStyle&&ThemifyBuilderStyle.google[f]!==r,d=!0!==u&&("undefined"!=typeof ThemifyConstructor&&ThemifyConstructor.font_select.cf[f]!==r||"undefined"!=typeof ThemifyBuilderStyle&&ThemifyBuilderStyle.cf[f]!==r);u||d||(u="undefined"!=typeof themifyBuilder&&null!==themifyBuilder.google&&themifyBuilder.google[f]!==r,d=!0!==u&&("undefined"!=typeof themifyBuilder&&null!==themifyBuilder.cf&&themifyBuilder.cf[f]!==r));const p=(""+f).trim();if(0===p.indexOf("var("))return delete o[e+"_w"],i.prop+":"+p+"#@#";if(0===p.indexOf("--"))return delete o[e+"_w"],i.prop+":var("+p+")#@#";if(u||d){let t=this.getStyleVal(e+"_w",s,n)?.toString()||"",i=!0===u?"fonts":"cf_fonts";if(this[i][f]===r&&(this[i][f]=[]),t){const e={normal:"normal",regular:400,italic:400,bold:700};-1===this[i][f].indexOf(t)&&this[i][f].push(e[t]||t);const r=-1!==t.indexOf("italic")?";font-style:italic":"";t=e[t]||t.replace(/[^0-9]/g,""),t+=r,_="font-weight:"+t+"#@#"}}else delete o[e+"_w"];return f=this.parseFontName(f),f&&(_+=i.prop+":"+f+"#@#"),_},frame:(e,t,i,r,o,a,l)=>!1,range(e,t,i,o,a,l,n){if("column-gap"===i.prop&&!i.grid_gap||"column-rule-width"===i.prop)return!1;let s=this.getStyleVal(e,l,n);if(""===s||s===r)return delete o[e],delete o[e+"_unit"],!1;s=""+s;let f="z-index"!==i.prop?this.getStyleVal(e+"_unit",l,n)||"px":"",_=s.split(",");s="%"!==f||"column"!==t||"margin-bottom"!==e&&"margin-top"!==e||_[1]===r||""===_[1]?_[0]:_[1],s=s.trim(),/^var\s*\(/i.test(s)?(f="","backdrop-filter"===i.prop?s="blur("+s+")":"mask-size"===i.prop&&(s=s+" "+s)):0===s.indexOf("--")?(s="backdrop-filter"===i.prop?"blur(var("+s+"))":"mask-size"===i.prop?"var("+s+") var("+s+")":"var("+s+")",f=""):("0"===s&&(f=""),"backdrop-filter"===i.prop?(s="blur("+s+"px)",f=""):"mask-size"===i.prop&&(s=s+f+" "+s+f,f=""));var u=i.prop+":"+s+f+"#@#";return"mask-size"===i.prop&&(u+="-webkit-mask-size: "+s+"#@#"),u},async radio(e,i,o,l,n,s,f){if("frame-custom"===o.prop){let i=e.split("-")[0],o="",l=i+"-presets",n=this.getStyleVal(i+"-frame_type",s,f)||l,_=this.getStyleVal(n===l?i+"-frame_layout":i+"-frame_custom",s,f),u=this.getStyleVal(i+"-frame_width",s,f),d=this.getStyleVal(i+"-frame_height",s,f),p=this.getStyleVal(i+"-frame_width_unit",s,f)||"%",c=this.getStyleVal(i+"-frame_height_unit",s,f)||"%";if(!_||"none"===_)return!(!_||"desktop"===f)&&"background-image:none#@#";if(n===l){_.startsWith("corner")&&(u||(u=150,p="px"),d||(d=150,c="px"),"bottom"===i?o+="left: auto#@#":"left"===i&&(o+="top: auto#@#")),"left"!==i&&"right"!==i||(_+="-l");const e=this.fields.frameCache;if(e[_]===r){let i=t.tfId("tmpl-frame_"+_);if(null!==i)e[_]=i.textContent.trim();else{const t=!0!==a&&"undefined"!=typeof themifyBuilder?themifyBuilder.builder_url:ThemifyBuilderStyle.builder_url,i=await Themify.fetch("","text",{method:"GET"},t+"/img/row-frame/"+_+".svg");e[_]=i}}let l=this.getStyleVal(i+"-frame_color",s,f),n=e[_];l!==r&&""!==l&&(n=n.replace(/\#D3D3D3/gi,this.toRGBA(l))),o+='background-image:url("data:image/svg+xml;utf8,'+encodeURIComponent(n)+'")#@#'}else o='background-image:url("'+_+'")#@#';let h=this.getStyleVal(i+"-frame_repeat",s,f),m=parseFloat(this.getStyleVal(i+"-frame_ani_dur",s,f)),g=m>0,b=[this.getStyleVal(i+"-frame_sh_x",s,f),this.getStyleVal(i+"-frame_sh_y",s,f),this.getStyleVal(i+"-frame_sh_b",s,f),this.getStyleVal(i+"-frame_sh_c",s,f)];if(g&&("left"===i||"right"===i?(d=200,c="%"):(u=200,p="%"),h=h?2*parseInt(h):2),u&&(o+="width:"+u+p+"#@#"),d&&(o+="height:"+d+c+"#@#"),h){const e=100/h;o+="background-size:",o+="left"===i||"right"===i?"100% "+e:e+"% 100",o+="%#@#"}return g&&(o+="animation-name:tb_frame_"+("left"===i||"right"===i?"vertical":"horizontal")+"#@#",o+="animation-iteration-count:infinite#@#",o+="animation-timing-function:linear#@#",o+="animation-duration:"+m+"s#@#",o+="animation-direction:"+("1"===this.getStyleVal(i+"-frame_ani_rev",s,f)?"reverse":"")+"#@#"),n!==l||"bottom"!==i&&"right"!==i||(o+="transform:rotate(180deg)#@#"),b[2]&&b[3]!==r&&""!==b[3]&&(b[0]=b[0]?b[0]+"px":0,b[1]=b[1]?b[1]+"px":0,b[2]+="px",b[3]=this.toRGBA(b[3]),o+="filter:drop-shadow("+b.join(" ")+")#@#"),""!==o&&o}return!1},multiColumns(e,t,i,o,a,l,n){if("column-gap"===i.prop){let t=this.getStyleVal(e,l,n);return""!==t&&t!==r&&"column-gap:"+c(t,this.getStyleVal(e+"_unit",l,n)||"px")+"#@#"}if("column-rule-width"===i.prop){let t=this.getStyleVal(e,l,n);if(t){let i=this.getStyleVal(e.replace(/_width$/,"_style"),l,n),o=this.getStyleVal(e.replace(/_width$/,"_color"),l,n),a="column-rule:"+c(t,this.getStyleVal(e+"_unit",l,n)||"px")+" ";return a+=i||"solid",a+=""!==o&&o!==r?" "+this.toRGBA(o):"",a+"#@#"}return!1}if("column-rule-color"===i.prop){let t=this.getStyleVal(e,l,n);return""!==t&&t!==r&&"column-rule-color:"+this.toRGBA(t)+"#@#"}if("column-rule-style"===i.prop){let t=this.getStyleVal(e,l,n);return!!t&&"column-rule-style:"+t+"#@#"}if("column-count"!==i.prop)return!1;let s=this.getStyleVal(e,l,n),f=!1;if(s==r||""===s||"0"==s||0===s)return delete o[e],delete o[e+"_gap"],delete o[e+"_divider_color"],delete o[e+"_divider_width"],delete o[e+"_divider_style"],!1;if(s){f=i.prop+":"+s+"#@#";let t=this.getStyleVal(e+"_gap",l,n),a=this.getStyleVal(e+"_divider_width",l,n);if(""!==t&&t!==r?f+="column-gap:"+c(t,this.getStyleVal(e+"_gap_unit",l,n)||"px")+"#@#":delete o[e+"_gap"],a){let t=this.getStyleVal(e+"_divider_style",l,n),i=this.getStyleVal(e+"_divider_color",l,n);f+="column-rule:"+c(a,this.getStyleVal(e+"_divider_width_unit",l,n)||"px")+" ",f+=t||"solid",f+=""!==i&&i!==r?" "+this.toRGBA(i):"",f+="#@#"}else delete o[e+"_divider_color"],delete o[e+"_divider_width"],delete o[e+"_divider_style"]}else delete o[e],delete o[e+"_gap"],delete o[e+"_divider_color"],delete o[e+"_divider_width"],delete o[e+"_divider_style"];return f},filters(e,t,i,o,a,l,n){let s={hue:{unit:"deg",prop:"hue-rotate"},saturation:{unit:"%",prop:"saturate"},brightness:{unit:"%",prop:"brightness"},contrast:{unit:"%",prop:"contrast"},invert:{unit:"%",prop:"invert"},sepia:{unit:"%",prop:"sepia"},opacity:{unit:"%",prop:"opacity"},blur:{unit:"px",prop:"blur"}},f="";for(let t in s){let a=this.getStyleVal(i.id+"_"+t,l,n);a!==r?f+=s[t].prop+"("+a+s[t].unit+") ":delete o[e+"_"+t]}return""!==f&&"filter:"+f+"#@#"},text(e,t,i,o,a,l,n){let s=this.getStyleVal(e,l,n),f=!1;return s!==r&&""!==s&&(f=i.prop+":"+s+"#@#"),f},number(e,t,i,r,o,a,l,n){return this.fields.text.call(this,e,t,i,r,o,a,l,n)},width(e,t,i,o,a,l,n,s){let f=i.prop,_=!1,u=this.getStyleVal(e,l,n);if(!1!==u&&("width"!==f&&"height"!==f||"auto"!==this.getStyleVal(e+"_auto_"+f,l,n)||(u="auto"),u!==r)){let t="auto"===u?"":this.getStyleVal(e+"_unit",l,n)||"px";u=(""+u).trim(),0===u.indexOf("var(")?t="":0===u.indexOf("--")&&(u="var("+u+")",t=""),_=f+":"+u+t+"#@#"}return _},height(e,t,i,r,o,a,l,n){return this.fields.width.call(this,e,t,i,r,o,a,l,n)},position(e,t,i,o,a,l,n){let s=!1,f=this.getStyleVal(e,l,n);if(f!==r&&(s="position:"+f+"#@#",""!==f&&"static"!==f))for(let t=["top","right","bottom","left"],i=t.length-1;i>-1;--i){let o=this.getStyleVal(e+"_"+t[i]+"_auto",l,n);"auto"!==o&&(o=this.getStyleVal(e+"_"+t[i],l,n),o=o===r||isNaN(o)?"":o+(this.getStyleVal(e+"_"+t[i]+"_unit",l,n)||"px")),""!==o&&(s+=""!==o?t[i]+":"+o+"#@#":"")}return s},transform(e,t,i,o,a,l,n){let s,f="",_=["skew","rotate","translate","scale"],u=e.split("_")[0];for(let e=_.length-1;e>-1;--e){let t=_[e];switch(t){case"scale":case"translate":case"skew":let e=this.getStyleVal(u+"_"+t+"_top",l,n),i=this.getStyleVal(u+"_"+t+"_bottom",l,n),o="skew"===t?"deg":"",a="translate"===t;a&&(o={x:this.getStyleVal(u+"_"+t+"_top_unit",l,n)||"px",y:this.getStyleVal(u+"_"+t+"_bottom_unit",l,n)||"px"}),e===r&&i===r||(e!==r&&this.getStyleVal(u+"_"+t+"_opp_bottom",l,n)?f+=t+"("+e+(a?o.x:o)+") ":f+=e!==r&&i!==r?t+"("+e+(a?o.x:o)+","+i+(a?o.y:o)+") ":e!==r?t+"X("+e+(a?o.x:o)+") ":t+"Y("+i+(a?o.y:o)+") ");break;case"rotate":for(let e=["z","y","x"],i=e.length-1;i>-1;--i)s=this.getStyleVal(u+"_"+t+"_"+e[i],l,n),s!==r&&(f+=t+e[i].toUpperCase()+"("+s+"deg) ");break}}return""!==f?(f="transform:"+f+"#@#",s=this.getStyleVal(u+"_position",l,n),s&&(s=s.split(","),f+="transform-origin:"+s[0]+"% "+s[1]+"%#@#")):f=!1,f},aspectRatio(e,t,i,r,o,a,l,n){let s=!1,f=this.getStyleVal(e,a,l);return f&&(s=i.prop+":"+f+"#@#"),s},grid(o,a,l,n,s,f,_,u){var d={},p=null,c=n[o],h=!0===Themify.is_builder_active&&e.tb_app&&tb_app.Builder&&tb_app.Builder.get&&tb_app.Builder.get()&&tb_app.Builder.get().el?tb_app.Builder.get().el.querySelector(".tb_"+s):null,m=c.count;h||(h=t.tfClass("tb_"+s)[0]),h&&(h.classList.contains("module_row")&&(h=h.querySelector(".row_inner")),h&&(m=h.querySelectorAll(":scope>.module_column").length));var g=null!==f&&i.keys(f).length>0?f:null,b=["dir","align","gutter","area","size","auto_h"],v=[];for(var y in c){var k=c[y];if(k&&0===y.indexOf(_)&&("tablet"!==_||-1===y.indexOf("tablet_landscape"))){var w=b.indexOf(y.replace(_+"_",""));if(-1===w||!c[_+"_"+b[w]]||1===m&&"align"!==b[w])continue;if(k=""+c[_+"_"+(w=b[w])],v.push(w),"size"===w){if(!k.includes(" ")){if("desktop"!==_){var x=_[0];_.includes("_")&&(x+=_.split("_")[1][0]);var z="--area"+x+m+"_"+k,S="";if((B=this.getAreaValue(z))||(B=this.getAreaValue(z="--area"+m+"_"+k)),B||c[_+"_area"])S=c[_+"_area"]?this.normalizeArea(c[_+"_area"]):"var("+z+")",k=-1!==k.indexOf("_")?k:"none";else{var B,T=!0,C=(B="auto"!==k?this.getColSizeValue(k):null)?B.replace(/\s\s+/g," ").trim().split(" ").length:m,F=m%C;if(m>=(k.includes("_")?0:parseInt(k))){C>m&&(F=0,k=""+(k=C=m));for(var A=m-F,I=1;I<=A;++I)!0===T&&(S+='"',T=!1),S+="col"+I+" ",I%C!=0&&I!==A||(S=S.trim(),S+='" ',T=!0);if(F>0){var O=[];for(I=m;I>A;--I)O.push("col"+I);for(O.reverse(),I=O.length;I<C;++I)O.push(".");-1===k.indexOf("_")&&(k="none"),S+='"'+O.join(" ").trim()+'"'}}}""!==S&&(d["--area"]=S.trim())}""!==k&&("desktop"!==_||"1"!==k&&"2"!==k&&"3"!==k&&"4"!==k&&"5"!==k&&"6"!==k)?"none"!==k&&(k=d["--area"]&&-1===k.indexOf("_")?m<parseInt(k)?"":"none":this.getColSizeValue(k)?"var(--c"+k+")":""):k=""}d["--col"]=k}else if("area"===w)d["--area"]=this.normalizeArea(k);else if("auto_h"===w)"desktop"===_&&"-1"===k||(d["--align_items"]="1"===k?"var(--align_content)":"var(--auto_height)");else if("align"===w){if(1===m&&h&&!h.closest(".module_row").classList.contains("fullheight"))continue;d["--align_content"]="var(--align_"+(k="col_align_bottom"===k||"end"===k?"end":"col_align_middle"===k||"center"===k?"center":"start")+")"}else if("gutter"===w){if(k!==r&&"undefined"!==k){var G=parseFloat(k);isNaN(G)||(0===G&&(k=G),k=this.getGutter(k)),("desktop"!==_||"gutter"!==k&&"gutter-default"!==k)&&("gutter"!==k&&"none"!==k&&"narrow"!==k||(k="var(--"+k+")"),d["--colg"]=k)}}else"dir"===w&&m>1&&(p=k)}}if("desktop"===_&&1!==m&&(!0!==u||-1!==v.indexOf("area")||-1!==v.indexOf("size"))){var N=[];for(I=1;I<=m;++I)N.push("col"+I);d["--area"]||(d["--area"]='"'+N.join(" ")+'"')}if(null!==p&&m>1&&"desktop"!==_){var j=d["--area"]||!1,R=d["--col"]||!1,D=this;if(null!==g){"none"===R&&"auto"===(R=!!(g["breakpoint_"+_]&&g["breakpoint_"+_][o]&&g["breakpoint_"+_][o][_+"_size"])&&g["breakpoint_"+_][o][_+"_size"])&&(R=!1);var E=p;if(!0===(g[o]!==r&&"rtl"===g[o].desktop_dir)&&(p="rtl"===p?"ltr":"rtl"),!1===j||!1===R){var J=ThemifyStyles.breakpointsReverse,P=J.length;for(y=J.indexOf(_)+1;y<P;++y){var V=J[y],U="desktop"!==V?g["breakpoint_"+V]:g;if(U!==r&&U[o]!==r&&U[o][V+"_size"]!==r){var Z={};if(Z[o]={},Z[o][_+"_size"]=U[o][V+"_size"],!1===j)j=this.fields[o].call(this,o,a,l,Z,s,g,_,!0)["--area"];!1===R&&"auto"!==Z[o][_+"_size"]&&(R=-1===Z[o][_+"_size"].indexOf(" ")?"var(--c"+Z[o][_+"_size"]+")":Z[o][_+"_size"]);break}}if(!j)if(j&&j["--area"])j=j["--area"];else{N=[];for(y=1;y<=m;++y)N.push("col"+y);j='"'+N.join(" ")+'"'}}}if("rtl"===p||"rtl"===E&&R&&R.includes("_")){var q=((e,t)=>{var i=[];if(t&&"none"!==t&&"initial"!==t&&"auto"!==t&&(t=-1===(t=t.replace(/[\r\n]/gm,"").replace(/  +/g," ").trim()).indexOf(" ")?"var(--c"+(t=t.replace("var(--c","").replace(")","").trim().split("_").reverse().join("_"))+")":t.split(" ").reverse().join(" ")),e){-1!==e.indexOf("var")&&(e=e.replace("var(","").replace(")","").trim(),e=D.getAreaValue(e));var r=e.split('" "')[0].split(" ").length,o=[],a=0;e=e.replace(/[\r\n]/gm,"").replace(/\"/g,"").replace(/  +/g," ").trim().split(" ").reverse();while("."===e[0])e.push(e.splice(0,1)[0]);for(var l=0,n=e.length;l<n;++l)o.push(e[l]),(++a>0&&a%r==0||l===n-1)&&(i.push('"'+o.join(" ")+'"'),o=[],a=0);i=i.join(" ")}else i=e;return{area:i,cols:t}})(j,R);"rtl"===p&&(j=q.area),R=q.cols}if(j){if(R=((e,t)=>{if(t&&"none"!==t){e.includes("var")&&(e=e.replace("var(","").replace(")","").trim(),e=D.getAreaValue(e));var i=e.split('" "')[0].split(" ").length,r=D.getColSizeValue(t);r||(r=t),r.split(" ").length!==i&&(t="none")}return t})(j,R),null!==g&&!0===Themify.is_builder_active){var H=c.model?c.model:h?tb_app.Registry.get(h.closest("[data-cid]").dataset.cid):null;!H||"row"!==H.type&&"subrow"!==H.type||(-1===j.indexOf("--area")&&H.setCols({area:j.replace(/col/g,"")},_),R&&"none"!==R&&"initial"!==R&&H.setCols({size:(""+R).replace("var(--c","").replace(")","").trim()},_),delete H.fields.sizes[_+"_dir"])}d["--area"]=this.normalizeArea(j),R&&(d["--col"]=R)}}d["--area"]&&("desktop"===_||d["--area"].includes("var")?"desktop"===_&&m<9&&(d["--area"]=""):(d["--area"]=this.getArea(d["--area"],!0,_,m),1===(this.getAreaValue(d["--area"])||d["--area"]).split('" "')[0].split(" ").length&&(d["--col"]="none")));if("none"===d["--col"]&&"desktop"===_)delete d["--col"];else if(d["--col"]){if(d["--col"].includes(" ")){var Y=d["--col"].split(" ");d["--area"]&&(Y=Y.slice(0,d["--area"].split('" "')[0].replace(/\s\s+/g," ").trim().split(" ").length));for(I=Y.length-1;I>-1;--I){var L=parseFloat(Y[I].trim());1!==L&&(Y[I]=Y[I].replace(""+L,""+parseFloat(L.toFixed(4))))}d["--col"]=Y.join(" ")}d["--col"]=this.getColSize(d["--col"])}if(!0!==u){var M="";for(y in d)""!==d[y]&&(M+=y+":"+d[y]+"#@#");d=""!==M&&M}return d}},optimizeCss(e,t){for(var o,a=this.breakpointsReverse,l=a.length,n=["left","bottom","right","top"],s=["bottom-left","bottom-right","top-right","top-left"],f=["family","line-height","size","weight","variant","style"],_=f.length-1,u=e=>{if(!e||-1!==e.indexOf("var")||-1!==e.indexOf('" "')||-1===e.indexOf(" "))return!1;for(var t=e.replace(/col|"/gi,"").replace(/\s\s+/g," ").trim().split(" "),i=t.length-1;i>0;--i)if(parseInt(t[i])<=parseInt(t[i-1]))return!1;return!0},d=0;d<l;++d)if(e[o=a[d]]!==r)for(var p in e[o]){for(var c={},h=[],m=0,g=(E=e[o][p]).length;m<g;++m)if(""!==E[m])if("@"!==E[m][0]){var b=E[m].indexOf(":");c[y=E[m].substring(0,b)]=E[m].substring(b+1)}else{var v=E[m].split("{");e[o][v[0]+"{"+p]=v[1].replace("}","").split("#@@#")}for(var y in c){var k=c[y],w="-"===y[0]&&"-"===y[1]?[y]:y.split("-"),x=w[0];if(k){if(!0===t&&(w[1]!==r&&("padding"===x||"margin"===x||"background"===x||"border"===x||"font"===x||"line-height"===y)||"--area"===x||"color"===x))if("padding"===x||"margin"===x){for(var z=[],S=3;S>-1;--S)c[x+"-"+n[S]]!==r&&z.push(c[x+"-"+n[S]]);if(4===z.length){for(S=z.length-1;S>-1;--S)";"===z[S][z[S].length-1]&&(z[S]=z[S].slice(0,-1));for(z[0]===z[2]&&z[1]===z[3]?(z[2]=z[3]=null,z[0]===z[1]&&(z[1]=null)):z[1]===z[3]&&(z[3]=null),S=3;S>-1;--S)null===z[S]&&z.splice(S,1);for(y=x,k=z.join(" "),S=3;S>-1;--S)delete c[x+"-"+n[S]]}}else if("border"===x){if("radius"===w[3]){for(z=[],S=3;S>-1;--S)c[x+"-"+s[S]+"-radius"]!==r&&z.push(c[x+"-"+s[S]+"-"+w[3]]);if(4===z.length){for(S=z.length-1;S>-1;--S)";"===z[S][z[S].length-1]&&(z[S]=z[S].slice(0,-1));for(z[0]===z[2]&&z[1]===z[3]?(z[2]=z[3]=null,z[0]===z[1]&&(z[1]=null)):z[1]===z[3]&&(z[3]=null),S=3;S>-1;--S)null===z[S]&&z.splice(S,1);for(y=x+"-"+w[3],k=z.join(" "),S=3;S>-1;--S)delete c[x+"-"+s[S]+"-"+w[3]]}}}else if("font"===x){if(c["font-family"]!==r&&c["font-size"]!==r){for(z=[],S=_;S>-1;--S){if(c[B="line-height"===f[S]?f[S]:x+"-"+f[S]]!==r)z.push("line-height"===f[S]?"/"+c[B]:c[B])}if(z.length===_+1){for(y=x,S=z.length-1;S>-1;--S)";"===z[S][z[S].length-1]&&(z[S]=z[S].slice(0,-1));for(k=z.join(" "),S=_;S>-1;--S){var B;delete c[B="line-height"===f[S]?f[S]:x+"-"+f[S]]}}}}else"color"===x?-1===k.indexOf("var(")&&(k=this.rgbToHex(k.replace(";",""))):"background"===x||"--area"===x&&"tablet_landscape"===o&&u(k)&&(k="");if(""!==k&&k!==r&&!1!==k&&null!==k){if("background"!==x||"background-color"===y){if(k.includes("rgb")&&-1===k.indexOf("var(")){var T=k.match(/(rgb.+?\))/gi);if(null!==T)for(S=T.length-1;S>-1;--S){var C=this.rgbToHex(T[S].replace(";",""));C!==T[S]&&(k=k.replace(T[S],C))}}k=k.replace(/\s0\./g," .").replace(/\s\s+/g," ").replace(/\.+0*?fr/g,"fr").replace(/\.+0*?\%/g,"%").replace(/\.+0*?rem/g,"rem").replace(/\.+0*?em/g,"em").replace(/\.+0*?px/g,"px").replace(/\b(?:0px|0%|0em|0fr|0rem)/g,"0")}"@"!==y[0]&&";"!==k.slice(-1)&&(k+=";"),h.push(y+":"+k)}}}e[o][p]=h}if(!0===t){for(d=0;d<l-1;++d)if(e[o=a[d]]!==r){for(var p in e[o]){for(m=(E=e[o][p]).length-1;m>-1;--m){b=E[m].indexOf(":"),y=E[m].substring(0,b);var F=E[m].substring(b+1);if(";"===F[F.length-1]&&(F=F.slice(0,-1)),"none"!==F||"--col"!==y||"tablet_landscape"!==o||e.desktop!==r&&e.desktop[p]!==r&&-1!==e.desktop[p].join("").indexOf("--col:"))if("--area"!==y||"tablet"!==o||e.tablet_landscape!==r&&e.tablet_landscape[p]!==r&&-1!==e.tablet_landscape[p].join("").indexOf("--area:")||!u(F)){for(var A=d+1;A<l;++A)if(e[a[A]]!==r&&e[a[A]][p]!==r){for(var I=e[a[A]][p],O=!1,G=I.length-1;G>-1;--G)if(-1!==I[G].indexOf(y)){var N=I[G].indexOf(":"),j=I[G].substring(0,N),R=I[G].substring(N+1);if(j===y){";"===R[R.length-1]&&(R=R.slice(0,-1)),R===F&&E.splice(m,1),O=!0;break}}if(!0===O)break}}else E.splice(m,1);else E.splice(m,1)}0===E.length&&delete e[o][p]}0===i.keys(e[o]).length&&delete e[o]}if(e.mobile!==r)for(var p in e.mobile)if(e.tablet===r||e.tablet[p]===r||-1===e.tablet[p].join("").indexOf("--area:"))for(m=(E=e.mobile[p]).length-1;m>-1;--m)if(-1!==E[m].indexOf("--area:")){u(E[m].split(":")[1])&&e.mobile[p].splice(m,1);break}if(e.desktop!==r)for(var p in e.desktop){-1===(b=e.desktop[p].indexOf("--tbBg:0;"))&&(b=e.desktop[p].indexOf("--tbBg:0")),-1!==b&&e.desktop[p].splice(b,1)}for(d=0;d<l;++d)if(e[o=a[d]]!==r){var D={};for(var p in e[o]){var E,J=[];for(m=(E=e[o][p]).length-1;m>-1;--m)J.push(E[m]);D[J=J.join("A#_B#")]===r&&(D[J]=[]),D[J].push(p)}for(var P in D){for(m=D[P].length-1;m>-1;--m)delete e[o][D[P][m]];p=D[P].join(","),";"===P[P.length-1]&&(P=P.slice(0,-1)),e[o][p]=P.split("A#_B#")}if("@"===p[0]){v=p.split("{")[0];e[o][p.replace(","+v+"{",",")]=e[o][p],delete e[o][p]}}}return e},gridBackwardCompatibility(e){if("-auto"===e||"auto"===e)return"auto";var t,i=Array.isArray(e),o=!1;if(!0===i){for(var a=e.length-1;a>-1;--a)!1===o&&(o=-1!==e[a].indexOf("col")),e[a]=(""+e[a]).replace(/tb_3col|tablet_landscape|tablet|mobile|column|col|first|last/gi,"").replaceAll("-","_").trim(),-1!==e[a].indexOf(" ")&&(e[a]=e[a].split(" ")[0].trim()),"4_1_4_2"===e[a]?e[a]="4_1_4_1_4_2":"4_2_4_1"===e[a]&&(e[a]="4_2_4_1_4_1");t=e[0]}else-1!==(e=(""+e).trim()).indexOf(" ")&&(e=e.split(" ")[0].trim()),t=e;return t=""+t,!1===o&&(o=-1!==t.indexOf("col")),"4_1_4_2"===(t=t.replace(/tb_3col|tablet_landscape|tablet|mobile|column|col|first|last/gi,"").replaceAll("-","_").trim())?"1_1_2":"4_2_4_1"===t?"2_1_1":"_full"===t?"1":"4_2"===t&&(!1===i||"4_2"===e[1])||"2_1"===t&&!0===i&&"2_1"===e[1]?"2":"1"===t||"2"===t||"3"===t||"4"===t||"5"===t||"6"===t||"1"===t[0]||!1===o&&("2_1"===t||"3_1"===t||"2_1_1"===t)?t:"6_1"===t||"5_1"===t||"4_1"===t&&(!1===i||e[3]!==r)||"3_1"===t&&(!1===i||e[2]!==r)?t[0]:!1===i?t.replaceAll(t[0]+"_","").trim():(e=e.join("_")).replaceAll(e[0]+"_","").trim()},getOldColsSizes(e){const t={def:{"col6-1":14,"col5-1":17.44,"col4-1":22.6,"col3-1":31.2,"col4-2":48.4,"col3-2":65.6,"col4-3":74.2},narrow:{"col6-1":15.33,"col5-1":18.72,"col4-1":23.8,"col3-1":32.266,"col4-2":49.2,"col3-2":66.05,"col4-3":74.539},none:{"col6-1":16.666,"col5-1":20,"col4-1":25,"col3-1":33.333,"col4-2":50,"col3-2":66.666,"col4-3":75}};return e!==r?t[e]!==r&&t[e]:t}},"undefined"==typeof ThemifyBuilderStyle){const e=t.getElementById("tb_builder_js_style-js-extra");if(e&&e.type&&"text/javascript"!==e.type){const i=t.createElement("script");i.innerHTML=e.innerHTML,i.id=e.id,e.replaceWith(i)}}if("undefined"!=typeof ThemifyBuilderStyle){const a=async()=>{let a,l=i.keys(ThemifyBuilderStyle.points).reverse();if(l.push("desktop"),await(()=>{const t={method:"GET"},r=[];for(let o=ThemifyBuilderStyle.style_json,a=o.length-1;a>-1;--a){let l=new Promise((async(r,l)=>{try{const l=new URL(o[a]),n=e.location.origin;l.origin!==n&&(l.origin=n);const s=await Themify.fetch("",null,t,""+l);i.assign(ThemifyBuilderStyle.styles,s),r()}catch(e){l(e)}}));r.push(l)}return Promise.all(r)})(),ThemifyStyles.init(ThemifyBuilderStyle.styles,l,ThemifyBuilderStyle.gutters),ThemifyBuilderStyle.styles=l=null,ThemifyBuilderStyle.google!==r){a=ThemifyBuilderStyle.google,ThemifyBuilderStyle.google={};for(var n=a.length-1;n>-1;--n)""!==a[n].value&&"default"!==a[n].value&&(ThemifyBuilderStyle.google[a[n].value]={n:a[n].name,v:a[n].variant});a=null}if(ThemifyBuilderStyle.cf!==r){a=ThemifyBuilderStyle.cf,ThemifyBuilderStyle.cf={};for(n=a.length-1;n>-1;--n)""!==a[n].value&&"default"!==a[n].value&&(ThemifyBuilderStyle.cf[a[n].value]={n:a[n].name,v:a[n].variant});a=null}const s=async()=>{const a=e.innerWidth;for(let u in e)if(0===u.indexOf("themify_builder_data_")&&null!==e[u]){let d,c,m=u.replace("themify_builder_data_",""),g={},b=await ThemifyStyles.createCss(m,e[u].data,null,!0,e[u].gs),v={fonts:[],cf_fonts:[]},y=t.tfId("themify_builder_content-"+m),k={},w="",x=t.createDocumentFragment();if(b.gs!==r)for(d in b.gs){var l=t.createElement("style");if(l.id="tb_temp_global_styles_"+m,"desktop"!==d){var n=ThemifyBuilderStyle.points[d];"mobile"!==d&&(n=n[1]),l.media="(max-width:"+n+"px)"}for(c in b.gs[d]){w+=c+"{"+b.gs[d][c].join("@"===c[0]?";":" ")+"}","@"===c[0]&&(w+="}")}l.appendChild(t.createTextNode(w)),x.appendChild(l)}for(d in b)if("gs"!==d&&"bg"!==d)if("fonts"!==d&&"cf_fonts"!==d){let e=t.createElement("style");if(e.id="tb_temp_styles_"+d+"_"+m,w="","desktop"!==d){let t=ThemifyBuilderStyle.points[d];"mobile"!==d&&(t=t[1]),e.media="(max-width:"+t+"px)"}for(c in b[d]){w+=c+"{"+b[d][c].join("@"===c[0]?";":" ")+"}","@"===c[0]&&(w+="}")}e.appendChild(t.createTextNode(w)),x.appendChild(e)}else for(c in b[d]){var s=c.split(" ").join("+");b[d][c].length>0&&(s+=":"+b[d][c].join(","));var f=h(e,t,s);f&&v[d].push(f)}let z=i.keys(v);for(let e=z.length-1;e>=0;--e)if(v[z[e]].length>0){var _="fonts"===z[e]?"https://fonts.googleapis.com/css?family="+v[z[e]].join("|"):ThemifyBuilderStyle.cf_api_url+v[z[e]].join("|");Themify.loadCss(_,null,!1).catch((()=>{}))}else delete b[z[e]];if(v=z=null,void 0!==e[u].custom_css){let i=t.createElement("style");i.id="tb_temp_styles_custom_css_"+m,i.innerHTML=e[u].custom_css,x.appendChild(i)}let S=i.keys(g).length>0&&o?x.cloneNode(!0):null;if(t.head.appendChild(x),null!==S){let e=t.createElement("style");e.textContent="html,body,body *,div,a{transition:none!important;animation:none!important;pointer-events:none!important}",S.appendChild(e),o.contentWindow.document.head.appendChild(S);let i=ThemifyStyles.breakpointsReverse;for(d=i.length-1;d>-1;--d){let e=i[d];if(b[e]!==r&&g[e]!==r){let l="max-width",n=1*ThemifyBuilderStyle.points[e],s=t.tfId("tb_temp_styles_"+e+"_"+m),f=null;for(c in(!n||n>=a+5)&&(l="min-width",n||(n=ThemifyBuilderStyle.points.tablet_landscape[1]+1,n<a&&(n="")),n===a&&--n),o.style.setProperty("max-width","none","important"),o.style.setProperty("min-width","auto","important"),o.style.setProperty(l,n+"px","important"),null!==s&&(s=s.sheet,f=s.cssRules),b[e])if(-1!==c.indexOf(".module_column")&&-1===c.indexOf(".module_column ")){let t,a,l=null,n=c.split(" ")[1].replace(".module_column","").replace(".tb_","");if(g[e][n]!==r)for(let _=b[e][c].length-1;_>-1;--_){let u=b[e][c][_];if(-1!==u.indexOf("%")&&(0===u.indexOf("padding")||0===u.indexOf("margin"))){let p=u.split(":"),h=p[0],m="p"===h[0]?h.replace("-","_"):h;if("padding"===h&&-1===g[e][n].indexOf("padding_top")||"padding"!==h&&-1===g[e][n].indexOf(m))continue;if(null===l){if(l=o.contentWindow.document.querySelector(c),null===l)continue;let e=getComputedStyle(l).getPropertyValue("position");if("absolute"===e||"fixed"===e)continue;l.style.setProperty("padding","0","important"),t=l.parentNode.getBoundingClientRect().width,a=l.getBoundingClientRect().width}let v=100*parseFloat(parseFloat(p[1])/100*t/a);if(v=parseFloat(parseFloat(v.toFixed(2)))+"%",b[e][c][_]=h+":"+v+";",null!==f){let t=!1;for(let e=f.length-1;e>-1;--e)if(f[e].selectorText===c&&f[e].style.getPropertyValue(h)){f[e].style.setProperty(h,v),t=!0;break}!1===t&&s.insertRule(c+"{"+b[e][c][_]+"}",f.length)}if(k[n]===r&&(k[n]={}),k[n][e]===r&&(k[n][e]={}),v=v.replace("%",""),"padding"===h?(k[n][e][m+"_top"]=v,k[n][e][m+"_top_unit"]="%"):(k[n][e][m]=v,k[n][e][m+"_unit"]="%"),"mobile"!==e){let e=i[d-1],t=b[e],o=!1;if(t&&t[c]){let e=-1!==h.indexOf("padding");for(let i=t[c].length-1;i>-1;--i){let r=t[c][i];if(!0===e&&0===r.indexOf("padding")||!1===e&&0===r.indexOf("margin")){let t=r.split(":")[0];if(t===h||!0===e&&"padding"===t||!1===e&&"margin"===t){o=!0;break}}}}!1===o&&(t===r&&(t={}),t[c]===r&&(t[c]=[]),t[c].push(u),g[e]===r&&(g[e]={}),g[e][n]===r&&(g[e][n]=[]),g[e][n].push(m))}}}}}}}null!==y&&(y.style.visibility=y.style.opacity="",y.classList.remove("tb_generate_css")),await(async()=>{i.keys(k).length>0&&Themify.fetch({data:k,action:"tb_update_old_data",nonce:ThemifyBuilderStyle.nonce,bid:m});try{const t=JSON.stringify(ThemifyStyles.optimizeCss(b,!0)),i={action:"tb_generate_on_fly",nonce:ThemifyBuilderStyle.nonce,bid:m,mode:"gzip"};void 0!==e[u].custom_css&&(i.custom_css=e[u].custom_css);try{i.css=await p(t);const e=await Themify.fetch(i);if(!e?.success)throw""}catch(e){delete i.mode,i.css=t,Themify.fetch(i)}}catch(e){console.error(e)}})()}o&&(o.parentNode.removeChild(o),o=null),ThemifyStyles.isWorking=!1};function f(){if("tb_regenerate_css_iframe"!==e.name){var i=!0,a=["padding_top","padding_bottom","padding_left","padding_right","margin-bottom","margin-top"],l=ThemifyStyles.breakpointsReverse,n=l.length,f=e=>{for(var t=5;t>-1;--t){if("%"===e[a[t]+"_unit"]&&e[a[t]]&&-1===(""+e[a[t]]).indexOf(","))return!0;for(var i=n-2;i>-1;--i)if(e["breakpoint_"+l[i]]){var o=e["breakpoint_"+l[i]][a[t]];if(""!==o&&o!==r&&-1===(""+o).indexOf(",")&&"%"===ThemifyStyles.getStyleVal(a[t]+"_unit",e,l[i]))return!0}}};for(var _ in e){if(!1===i)break;if(0===_.indexOf("themify_builder_data_")&&e[_])for(var u=e[_].data,d=u.length-1;d>-1;--d){if(!1===i)break;var p=u[d];if(p.cols!==r)for(var c in p.cols){if(!1===i)break;var h=p.cols[c];if(h.styling&&f(h.styling)){i=!1;break}if(h.modules!==r)for(var m in h.modules){if(!1===i)break;var g=h.modules[m];if(g&&g.cols!==r)for(var b in g.cols){var v=g.cols[b];if(v.styling&&f(v.styling)){i=!1;break}}}}}}if(!1===i){ThemifyStyles.isWorking=!0,(o=t.createElement("iframe")).id=o.name="tb_regenerate_css_iframe",o.style.setProperty("position","fixed","important"),o.style.setProperty("top","-100000000px","important"),o.style.setProperty("left","-100000000px","important"),o.style.setProperty("visibility","hidden","important"),o.style.setProperty("min-width","auto","important"),o.style.setProperty("max-height","none","important"),o.style.setProperty("min-height","auto","important"),o.style.setProperty("contain","none","important"),o.style.setProperty("width","100%","important"),o.style.setProperty("height","100%","important"),o.style.setProperty("opacity","0","important"),o.src="about:blank",t.body.appendChild(o);let e=o.contentWindow.document;e.open(),e.write("<!DOCTYPE html>"+t.documentElement.outerHTML),o.tfOn("load",(()=>{e.tfId("tb_regenerate_css_iframe").remove(),e=null,s()}),{passive:!0,once:!0}),e.close()}else s()}}"complete"===t.readyState?f():e.tfOn("load",f,{passive:!0,once:!0}),t.tfOn("tb_regenerate_css",f,{passive:!0})};a()}else if(e.themifyBuilder!==r){var m;if(themifyBuilder.google!==r&&Array.isArray(themifyBuilder.google)){m=themifyBuilder.google,themifyBuilder.google={};for(var g=m.length-1;g>-1;--g)""!==m[g].value&&"default"!==m[g].value&&(themifyBuilder.google[m[g].value]={n:m[g].name,v:m[g].variant})}if(themifyBuilder.cf!==r&&Array.isArray(themifyBuilder.cf)){m=themifyBuilder.cf,themifyBuilder.cf={};for(g=m.length-1;g>-1;--g)""!==m[g].value&&"default"!==m[g].value&&(themifyBuilder.cf[m[g].value]={n:m[g].name,v:m[g].variant})}}})(window,document,Object,void 0);
(()=>{"use strict";const t=window.wp.hooks,e=(t,e)=>{const a={id:"gla_"+t.id,quantity:e,google_business_vertical:"retail"};return t.name&&(a.name=t.name),t?.categories?.length&&(a.category=t.categories[0].name),t?.prices?.price&&(a.price=parseInt(t.prices.price,10)/10**t.prices.currency_minor_unit),a},a=(t,a=1)=>{((t,e)=>{if("function"!=typeof gtag)throw new Error("Function gtag not implemented.");window.gtag("event","add_to_cart",{send_to:"GLA",...e})})(0,{ecomm_pagetype:"cart",event_category:"ecommerce",items:[e(t,a)]})},n=t=>{var e;return glaGtagData.products[t.id]&&(t.name=glaGtagData.products[t.id].name,t.prices=(e=glaGtagData.products[t.id].price,{price:Math.round(e*10**glaGtagData.currency_minor_unit),currency_minor_unit:glaGtagData.currency_minor_unit})),t};(0,t.addAction)("experimental__woocommerce_blocks-cart-add-item","google-listings-and-ads",({product:t,quantity:e=1})=>{a(t,e)});const r=function(t){const e=t.currentTarget.dataset,r=n({id:e.product_id});a(r,e.quantity||1)},o=function(t){const e=t.target.closest("form.cart");if(!e)return;const r=e.querySelector("[name=add-to-cart]");if(!r)return;const o=e.querySelector("[name=variation_id]"),c=e.querySelector("[name=quantity]"),i=n({id:parseInt(o?o.value:r.value,10)});a(i,c?parseInt(c.value,10):1)};document.defaultView.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".add_to_cart_button:not(.product_type_variable):not(.product_type_grouped):not(.wc-block-components-product-button__button)").forEach(t=>{t.addEventListener("click",r)}),document.querySelectorAll('[data-block-name="woocommerce/product-button"] > .add_to_cart_button:not(.product_type_variable):not(.product_type_grouped)').forEach(t=>{t.addEventListener("click",r)}),document.querySelectorAll(".single_add_to_cart_button").forEach(t=>{t.addEventListener("click",o)})}),"function"==typeof jQuery&&jQuery(document).on("found_variation","form.cart",function(t,e){(t=>{t?.variation_id&&(glaGtagData.products[t.variation_id]={name:t.display_name,price:t.display_price})})(e)})})();