jQuery(function(e){var t=e.parseJSON(wc_setup_params.locale_info);e('select[name="store_location"]').change(function(){var a=e(this).val().split(":"),s=a[0],c=a[1]||!1,i=t[s],n=["thousand_sep","decimal_sep","num_decimals","currency_pos"];if(i){if(e.each(i,function(t,a){e(':input[name="'+t+'"]').val(a).change(),-1!==e.inArray(t,n)&&e(':input[name="'+t+'"]').closest("tr").hide()}),!e.isArray(i.tax_rates)){var r=[];if(c&&i.tax_rates[c]?r=r.concat(i.tax_rates[c]):i.tax_rates[""]&&(r=r.concat(i.tax_rates[""])),(r=r.concat(i.tax_rates["*"]||[])).length){var o=e("table.tax-rates tbody").empty();e.each(r,function(t,a){e("
",{html:[e("",{"class":"readonly",text:a.country||""}),e(" | ",{"class":"readonly",text:a.state||"*"}),e(" | ",{"class":"readonly",text:a.rate||""}),e(" | ",{"class":"readonly",text:a.name||""})]}).appendTo(o)}),e(".tax-rates").show()}else e(".tax-rates").hide()}}else e(':input[name="currency_pos"]').closest("tr").show(),e(':input[name="thousand_sep"]').closest("tr").show(),e(':input[name="decimal_sep"]').closest("tr").show(),e(':input[name="num_decimals"]').closest("tr").show(),e(".tax-rates").hide()}).change(),e('input[name="woocommerce_calc_taxes"]').change(function(){e(this).is(":checked")?(e(':input[name="woocommerce_prices_include_tax"], :input[name="woocommerce_import_tax_rates"]').closest("tr").show(),e("tr.tax-rates").show()):(e(':input[name="woocommerce_prices_include_tax"], :input[name="woocommerce_import_tax_rates"]').closest("tr").hide(),e("tr.tax-rates").hide())}).change(),e(".button-next").on("click",function(){var t=e(this).parents("form").get(0);return"function"==typeof t.checkValidity&&t.checkValidity()&&e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"):e(this).closest(".wc-wizard-service-toggle").addClass("disabled")}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(t){t.stopPropagation();var a=e(this).find(".wc-wizard-service-toggle input");a.prop("checked",!a.prop("checked")).change()}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select",function(t){var a=e(this),s=t.target.value,c=a.find(".shipping-method-description");c.find("p").hide(),c.find("p."+s).show();var i=a.find(".shipping-method-settings");i.find("div").hide(),i.find("div."+s).show()})}); |