/*! For license information please see back.js.LICENSE.txt */ (()=>{var e={208:()=>{},379:(e,t,n)=>{"use strict";var i,r=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),s=[];function a(e){for(var t=-1,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{"use strict";var e=n(379),t=n.n(e),i=n(208),r=n.n(i);t()(r(),{insert:"head",singleton:!1}),r().locals,window.checkForm=function(){var e=!1,t=!1,n=!1,i=!1;return $("#categories-treeview input[type=checkbox]").each((function(){return!$(this).prop("checked")||(e=!0,!1)})),$('input[name="controllers[]"]').each((function(){$(this).prop("checked")&&(n=!0,"category"===$(this).val()&&(t=!0))})),$(".filter_list_item input[type=checkbox]").each((function(){return!$(this).prop("checked")||(i=!0,!1)})),n?t&&!e?(alert(translations.no_selected_categories),$("#categories-treeview input[type=checkbox]").first().focus(),!1):!!i||(alert(translations.no_selected_filters),$("#filter_list_item input[type=checkbox]").first().focus(),!1):(alert(translations.no_selected_controllers),!1)},$(document).ready((function(){$(".ajaxcall").click((function(){if(void 0===this.legend&&(this.legend=$(this).html()),void 0===this.running&&(this.running=!1),!0===this.running)return!1;$(".ajax-message").hide(),this.running=!0,(void 0===this.restartAllowed||this.restartAllowed)&&($(this).html(this.legend+translations.in_progress),$("#indexing-warning").show()),this.restartAllowed=!1;var e=$(this).attr("rel");return $.ajax({url:"".concat(this.href,"&ajax=1"),context:this,dataType:"json",cache:"false",success:function(){this.running=!1,this.restartAllowed=!0,$("#indexing-warning").hide(),$(this).html(this.legend),$("#ajax-message-ok span").html("price"===e?translations.url_indexation_finished:translations.attribute_indexation_finished),$("#ajax-message-ok").show()},error:function(){this.restartAllowed=!0,$("#indexing-warning").hide(),$("#ajax-message-ko span").html("price"===e?translations.url_indexation_failed:translations.attribute_indexation_failed),$("#ajax-message-ko").show(),$(this).html(this.legend),this.running=!1}}),!1}));var e=0;if($(".ajaxcall-recurcive").each((function(t,n){$(n).click((function(t){return t.preventDefault(),void 0===this.cursor&&(this.cursor=0),void 0===this.legend&&(this.legend=$(this).html()),void 0===this.running&&(this.running=!1),!0===this.running||($(".ajax-message").hide(),this.running=!0,(void 0===this.restartAllowed||this.restartAllowed)&&($(this).html(this.legend+translations.in_progress),$("#indexing-warning").show()),this.restartAllowed=!1,$.ajax({url:"".concat(this.href,"&ajax=1&cursor=").concat(this.cursor),context:this,dataType:"json",cache:"false",success:function(t){if(this.running=!1,t.result)return this.cursor=0,e=0,$("#indexing-warning").hide(),$(this).html(this.legend),$("#ajax-message-ok span").html(translations.price_indexation_finished),void $("#ajax-message-ok").show();e+=parseInt(t.count,10),this.cursor=parseInt(t.cursor,10),$(this).html(this.legend+translations.price_indexation_in_progress.replace("%s","".concat(e,"/").concat(t.total))),$(this).click()},error:function(e){this.restartAllowed=!0,$("#indexing-warning").hide(),$("#ajax-message-ko span").html(translations.price_indexation_failed),$("#ajax-message-ko").show(),$(this).html(this.legend),this.cursor=0,this.running=!1}})),!1}))})),"undefined"!=typeof PS_LAYERED_INDEXED&&PS_LAYERED_INDEXED&&($("#url-indexe").click(),$("#full-index").click()),"undefined"!=typeof Sortable){var t=document.getElementById("list-filters");null!==t&&new Sortable(t,{animation:150,ghostClass:"sortable-ghost"})}else $(".sortable").sortable({forcePlaceholderSize:!0});if($(".filter_list_item input[type=checkbox]").click((function(){var e=parseInt($("#selected_filters").html(),10);$("#selected_filters").html($(this).prop("checked")?e+1:e-1)})),void 0!==window.filters){var n,i=JSON.parse(window.filters),r=null;Object.keys(i).forEach((function(e){(n=$("#".concat(e))).prop("checked",!0),$("#selected_filters").html(parseInt($("#selected_filters").html(),10)+1),$('select[name="'.concat(e,'_filter_type"]')).val(i[e].filter_type),$('select[name="'.concat(e,'_filter_show_limit"]')).val(i[e].filter_show_limit),null===r?(r=$("#".concat(e)).closest("ul"),n.closest("li").detach().prependTo(r)):n.closest("li").detach().insertAfter(r),r=n.closest("li")}))}})),$(document).on("ready",(function(){var e=$('input[name="ps_layered_filter_by_default_category"]');e.on("change",(function(e){var t=$(this);t.prop("checked")&&("1"===t.val()?($('input[name="ps_layered_full_tree"][value="0"]').prop("checked",!0),$('input[name="ps_layered_full_tree"]').prop("disabled",!0)):$('input[name="ps_layered_full_tree"]').prop("disabled",!1))})),e.filter('[value="1"]').trigger("change")}))})()})(); //# sourceMappingURL=back.js.map