"use strict";(globalThis.blocksyJsonP=globalThis.blocksyJsonP||[]).push([[902],{4902(t,e,n){n.r(e),n.d(e,{mount:function(){return s}});var o=n(8043),r=n.n(o),c=n(2151),u=n.n(c);let a=null,i=null;r()(document.body).on("updated_cart_totals",function(){setTimeout(function(){[...document.querySelectorAll(`[name="${i}"]`)].map(function(t){t.focus()})},500),u().trigger("blocksy:frontend:init")}),r()(document.body).on("updated_checkout",function(t,e){if(!e?.fragments?.[".woocommerce-checkout-review-order-table"])return;const n=document.createElement("div");n.innerHTML=e.fragments[".woocommerce-checkout-review-order-table"],[...n.querySelectorAll(".cart_item")].length?n.remove():window.location.reload()});const s=function(t,{event:e}){if(t.matches("input"))return void function(t,e){t.closest("tr")&&[...t.closest("tr").querySelectorAll(".quantity input")].filter(function(e){return e!==t}).map(function(t){return t.value=e.target.value}),document.activeElement===t&&(i=t.name),t.closest(".ct-cart-auto-update")&&(a&&clearTimeout(a),a=setTimeout(function(){r()("[name='update_cart']").trigger("click")},300))}(t,e);if(!t.classList.contains("ct-increase")&&!t.classList.contains("ct-decrease"))return;const n=t.parentNode.querySelector("input"),o=parseFloat(n.value,10)||0;if(t.classList.contains("ct-increase")){const t=n.getAttribute("max")&&parseFloat(n.getAttribute("max"),0)||1/0;n.value=o<t?Math.round(100*(o+parseFloat(n.step||"1")))/100:t}if(t.classList.contains("ct-decrease")){const t=n.getAttribute("min")?Math.round(100*parseFloat(n.getAttribute("min"),0))/100:0;n.value=o>t?Math.round(100*(o-parseFloat(n.step||"1")))/100:t}r()(n).trigger("change"),r()(n).trigger("input"),n.dispatchEvent(new Event("input",{bubbles:!0})),n.closest("tr")&&[...n.closest("tr").querySelectorAll(".quantity input")].filter(function(t){return t!==n}).map(function(t){return t.value=n.value})}}}]);