(()=>{"use strict";var e,t={426(e,t,o){const r=window.wp.domReady;var i=o.n(r);const n=window.wp.a11y,c=window.wp.i18n,s=".wp-block-recesso-digitale-flow",l=".wp-block-recesso-digitale-flow__item-check",a="recessoDigEnhanced",d=".wp-block-recesso-digitale-flow__error";function u(e){const t=e.querySelector(".wp-block-recesso-digitale-flow__form");t&&!t.dataset[a]&&(t.dataset[a]="1",t.addEventListener("submit",w),function(e){e.querySelectorAll(l).forEach(e=>{const t=e.closest(".wp-block-recesso-digitale-flow__item");if(!t)return;const o=t.querySelector(".wp-block-recesso-digitale-flow__item-qty"),r=t.querySelector(".wp-block-recesso-digitale-flow__qty-input"),i=()=>{t.classList.toggle("wp-block-recesso-digitale-flow__item--selected",e.checked),o&&(o.hidden=!e.checked),r&&(r.disabled=!e.checked)};e.addEventListener("change",i),i()})}(e))}async function w(e){const t=e.currentTarget;if(!function(e){const t=e.querySelectorAll(l);return 0===t.length||Array.from(t).some(e=>e.checked)}(t)){e.preventDefault();const o=t.querySelector(l);return o&&o.focus(),void(0,n.speak)((0,c.__)("Select at least one item to withdraw.","erred-eu-order-withdrawal-for-woocommerce"),"assertive")}if("function"!=typeof window.fetch)return;e.preventDefault(),function(e,t){const o=e.querySelector('[type="submit"]');o&&(o.disabled=t,o.setAttribute("aria-busy","true"))}(t,!0);const o=t.getAttribute("action");try{const e=await window.fetch(o,{method:"POST",body:new window.FormData(t),credentials:"same-origin",redirect:"follow",headers:{"X-Requested-With":"XMLHttpRequest"}}),r=await e.text(),i=(new window.DOMParser).parseFromString(r,"text/html").querySelector(s),c=document.querySelector(s);if(!i||!c)return void window.location.assign(e.url||window.location.href);c.replaceWith(i),e.url&&window.history.pushState({},"",e.url),function(e){u(e);const t=e.querySelector(d)||e.querySelector(".wp-block-recesso-digitale-flow__title")||e;t.setAttribute("tabindex","-1"),t.focus();const o=(t.textContent||"").trim();o&&(0,n.speak)(o)}(i)}catch(e){t.removeEventListener("submit",w),t.submit()}}i()(()=>{const e=document.querySelector(s);e&&(u(e),function(e){const t=e.querySelector(d);if(!t)return;t.focus();const o=(t.textContent||"").trim();o&&(0,n.speak)(o)}(e)),document.querySelectorAll(".wp-block-recesso-digitale-model-form").forEach(e=>{const t=e.querySelector(".wp-block-recesso-digitale-model-form__print-button");t&&!e.dataset[a]&&(e.dataset[a]="1",e.classList.add("is-enhanced"),t.addEventListener("click",()=>window.print()))}),window.addEventListener("popstate",()=>window.location.reload())})}},o={};function r(e){var i=o[e];if(void 0!==i)return i.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.m=t,e=[],r.O=(t,o,i,n)=>{if(!o){var c=1/0;for(d=0;d<e.length;d++){for(var[o,i,n]=e[d],s=!0,l=0;l<o.length;l++)(!1&n||c>=n)&&Object.keys(r.O).every(e=>r.O[e](o[l]))?o.splice(l--,1):(s=!1,n<c&&(c=n));if(s){e.splice(d--,1);var a=i();void 0!==a&&(t=a)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[o,i,n]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={552:0,525:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var i,n,[c,s,l]=o,a=0;if(c.some(t=>0!==e[t])){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(l)var d=l(r)}for(t&&t(o);a<c.length;a++)n=c[a],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(d)},o=globalThis.webpackChunkrecesso_digitale=globalThis.webpackChunkrecesso_digitale||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var i=r.O(void 0,[525],()=>r(426));i=r.O(i)})();