!function(n){woodmartThemeModule.menuDropdownsAJAX=function(){woodmartThemeModule.$body.on("mousemove",function(){n(".menu").has(".dropdown-load-ajax").each(function(){var o=n(this);if(!o.hasClass("dropdowns-loading")&&!o.hasClass("dropdowns-loaded")){var d=o,a=(d.addClass("dropdowns-loading"),woodmart_settings.menu_storage_key+"_"+d.attr("id")),o=!1,e=d.find(".dropdown-load-ajax"),t=[];if(e.each(function(){t.push(n(this).find(".dropdown-html-placeholder").data("id"))}),woodmart_settings.ajax_dropdowns_save&&woodmartThemeModule.supports_html5_storage){e=localStorage.getItem(a);try{o=JSON.parse(e)}catch(o){console.log("cant parse Json",o)}}function s(o){Object.keys(o).forEach(function(a){woodmartThemeModule.removeDuplicatedStylesFromHTML(o[a],function(o){d.find('[data-id="'+a+'"]').replaceWith(o),d.addClass("dropdowns-loaded"),setTimeout(function(){d.removeClass("dropdowns-loading")},1e3)})}),woodmartThemeModule.$document.trigger("wdLoadDropdownsSuccess")}o?s(o):n.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_load_html_dropdowns",ids:t},dataType:"json",method:"POST",success:function(o){if("success"===o.status){if(s(o.data),woodmart_settings.ajax_dropdowns_save&&woodmartThemeModule.supports_html5_storage)try{localStorage.setItem(a,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")}})}})})},n(document).ready(function(){woodmartThemeModule.menuDropdownsAJAX()})}(jQuery);