!function(_){woodmartThemeModule.$document.on("wdShopPageInit",function(){woodmartThemeModule.ajaxSearch()}),_.each(["frontend/element_ready/wd_search.default"],function(e,a){woodmartThemeModule.wdElementorAddAction(a,function(){woodmartThemeModule.ajaxSearch()})}),woodmartThemeModule.ajaxSearch=function(){void 0!==_.fn.devbridgeAutocomplete&&(_("form.woodmart-ajax-search").each(function(){var s=_(this),d=parseInt(s.data("count")),n=parseInt(s.data("thumbnail")),r=parseInt(s.data("symbols_count")),o=s.find('[name="product_cat"]'),e=s.parent(),l=s.data("post_type"),c=woodmart_settings.ajaxurl+"?action=woodmart_ajax_search",i=parseInt(s.data("price")),u=s.data("sku"),h=s.parents(".wd-search-full-screen").length,w=s.parents(".wd-search-full-screen-2").length,p=s.parents(".wd-search-dropdown").length,m=e.find(`.wd-search-results${h||w?"":" > "}.wd-scroll-content`),f=e.find(".wd-search-results"),g=s.data("include_cat_search");function v(e){0!==s.parents(".wd-search-form.wd-display-form.wd-with-overlay").length&&_(".wd-close-side").trigger("wdCloseSideAction",["open"===e?"show":"hide","click"])}0'+woodmart_settings.all_results+"")),_(e).removeAttr("style")},onSelect:function(e){0"),n&&e.thumbnail&&(t+='
'+e.thumbnail+"
"),e.value&&(t=(t+='
')+'
'+e.value.replace(new RegExp(a,"gi"),"$1").replace(/<(\/?strong)>/g,"<$1>")+"
"),u&&e.sku&&(t+='

'+e.sku+"

"),i&&e.price&&(t+='

'+e.price+"

"),e.value&&(t+="
"),e.permalink&&(a="",e.value&&(a=`aria-label="${e.value.replace(/(<([^>]+)>)/gi,"")}"`),t+=` `),e.products_not_found&&(t=''+e.value+""),w&&(e.no_results?f.addClass("wd-no-results"):f.removeClass("wd-no-results")),h||w||f.addClass("wd-opened"),(w?s.parent():s).parent().addClass("wd-searched"),t}}),a.addClass("wd-search-inited")),o.length&&"cat_selected"===e.type){""!==o.val()&&(t.product_cat=o.val());a=s.find('[type="text"]').devbridgeAutocomplete();let e=woodmart_settings.ajaxurl+"?"+new URLSearchParams(t).toString();g&&"yes"===g&&(e+="&include_cat_search="+g),a.setOptions({serviceUrl:e}),a.hide(),a.onValueChange()}}),woodmartThemeModule.$document.on("click",function(e){e=e.target;_(e).is(".wd-search-form")||_(e).parents().is(".wd-search-form")||_(e).is(".wd-search-full-screen")||_(e).parents().is(".wd-search-full-screen")||_(e).is(".wd-clear-search")||s.find('[type="text"]').devbridgeAutocomplete("hide")}),_(".wd-search-results > .wd-scroll-content").on("click",function(e){e.stopPropagation()})}),_(".wd-header-search.wd-display-dropdown > a").on("click",function(e){e.preventDefault()}))},_(document).ready(function(){woodmartThemeModule.ajaxSearch()}),window.addEventListener("wdUpdatedHeader",function(){woodmartThemeModule.ajaxSearch()})}(jQuery);