File: /home/salamatk/takarzan.ir/wp-content/themes/xts-luman/js/scripts/searchCatDropdown.min.js
(c=>{XTSThemeModule.xtsElementorAddAction("frontend/element_ready/xts_ajax_search.default",function(){XTSThemeModule.searchCatDropdown()}),XTSThemeModule.searchCatDropdown=function(){c(".xts-search-cats").each(function(){var s=c(this),n=s.find("> a"),a=s.find("> input"),d=s.find("> .xts-dropdown-search-cats"),i=s.parent().parent().find(".s");function r(){d.removeClass("xts-opened")}function o(){var e,t;XTSThemeModule.isMobile()||i.hasClass("xts-padding-inited")||"yes"!==xts_settings.search_input_padding||(e=s.innerWidth()+17,s.parents(".searchform").hasClass("xts-style-default")||s.parents(".searchform").hasClass("xts-style-icon-alt-2")||(e+=s.parent().siblings(".searchsubmit").innerWidth()),t="padding-right",XTSThemeModule.$body.hasClass("rtl")&&(t="padding-left"),i.css(t,e),i.addClass("xts-padding-inited"))}i.on("focus",function(){o()}),XTSThemeModule.$document.on("click",function(e){e=e.target;if(d.hasClass("xts-opened")&&!c(e).is(".xts-search-cats")&&!c(e).parents().is(".xts-search-cats"))return r(),!1}),n.on("click",function(e){return e.preventDefault(),d.hasClass("xts-opened")?r():(d.addClass("xts-opened"),void 0!==c.fn.devbridgeAutocomplete&&s.siblings('[type="text"]').devbridgeAutocomplete("hide")),!1}),d.on("click","a",function(e){e.preventDefault();var e=c(this),t=e.data("val"),s=e.text();d.find(".xts-current").removeClass("xts-current"),e.parent().addClass("xts-current"),0!==t?d.find("ul:not(.children) > li:first-child").show():0===t&&d.find("ul:not(.children) > li:first-child").hide(),n.find("span").text(s),a.val(t).trigger("cat_selected"),r(),o()})})},c(document).ready(function(){XTSThemeModule.searchCatDropdown()})})(jQuery);