File: /home/salamatk/takarzan.ir/wp-content/themes/xts-luman/js/scripts/menuDropdownsAJAX.min.js
(m=>{XTSThemeModule.xtsElementorAddAction("frontend/element_ready/xts_mega_menu.default",function(){XTSThemeModule.menuDropdownsAJAX()}),XTSThemeModule.menuDropdownsAJAX=function(){var o=m(".menu").has(".xts-dropdown-ajax");m("body").on("mousemove",function(c){o.each(function(){var o=m(this);if(!o.hasClass("xts-dropdowns-loading")&&!o.hasClass("xts-dropdowns-loaded")&&(l=50,s=c,r=(e=o).offset().left-l,t=e.offset().top-l,d=r+e.width()+2*l,e=t+e.height()+2*l,l=s.pageX,s=s.pageY,r<l)&&l<d&&t<s&&s<e){var e,s,t,d,a=o,n=(a.addClass("xts-dropdowns-loading"),xts_settings.menu_storage_key+"_"+a.attr("id")),r=!1,l=a.find(".xts-dropdown-ajax"),i=[];if(l.each(function(){i.push(jQuery(this).find(".xts-dropdown-placeholder, .xts-html-placeholder").data("id"))}),xts_settings.ajax_dropdowns_save&&XTSThemeModule.supports_html5_storage){l=localStorage.getItem(n);try{r=JSON.parse(l)}catch(o){console.log("cant parse Json",o)}}function u(s){Object.keys(s).forEach(function(o){var e=s[o];a.hasClass("xts-html-block-on")?a.find('[data-id="'+o+'"]').html(e):(a.find('[data-id="'+o+'"]').siblings(".xts-dropdown-inner").html(e),a.find('[data-id="'+o+'"]').remove())}),XTSThemeModule.$document.trigger("xtsMenuDropdownsAJAXRenderResults")}r?(u(r),a.removeClass("xts-dropdowns-loading").addClass("xts-dropdowns-loaded")):jQuery.ajax({url:xts_settings.ajaxurl,data:{action:"xts_load_html_dropdowns",ids:i},dataType:"json",method:"POST",success:function(o){if("success"===o.status){if(u(o.data),xts_settings.ajax_dropdowns_save&&XTSThemeModule.supports_html5_storage)try{localStorage.setItem(n,JSON.stringify(o.data))}catch(o){}}else console.log("loading html dropdowns returns wrong data - ",o.message)},error:function(){console.log("loading html dropdowns ajax error")},complete:function(){a.removeClass("xts-dropdowns-loading").addClass("xts-dropdowns-loaded")}})}})})},m(document).ready(function(){XTSThemeModule.menuDropdownsAJAX()})})(jQuery);