!function(){"use strict";var t=window.ctFrontend;function e(t,e){const n=function(r){r.target===t&&(t.removeEventListener("transitionend",n),e())};t.addEventListener("transitionend",n)}const n=function(t){const e=JSON.parse(t.dataset.product_variations||"[]"),n=Object.keys(e[0]?.attributes||{});return!n.length||n.every(function(e){const n=t.querySelector(`[name="${e}"]`);return n&&""!==n.value.trim()})},r=function(t,e,r){const a=function(t){return JSON.parse(t.dataset.dynamicAddToCartData)}(e),o=t.querySelector(".button:not(.single_add_to_cart_button):not(.product_type_external)");n(r)?o.innerHTML=a.simple.text:o.innerHTML=a.variable.text},a=function(){const t=document.querySelector(".ct-floating-bar");if(!t)return;const e=t.querySelector(".ct-floating-bar-actions");if(!e?.dataset.dynamicAddToCartData)return;const a=document.querySelector(".single-product form.variations_form");a&&(function(t){const e=t.querySelector(".product-price .price"),n=document.querySelector(".product .summary .price");e&&n&&(e.innerHTML=n.innerHTML)}(t),function(t){const e=t.querySelector("img"),n=document.querySelector(".product .product-entry-wrapper .main-product-image");e&&n&&(e.src=n.src,e.srcset=n.srcset,e.sizes=n.sizes,e.alt=n.alt,e.title=n.title)}(t),r(t,e,a),function(t,e){const r=t.querySelector(".ct-floating-bar-actions .quantity");if(!r)return;const a=document.querySelector(".ct-cart-actions .quantity"),o=!n(e);r.classList.toggle("hidden",!a||a.classList.contains("hidden")||o)}(t,a))};(0,t.registerDynamicChunk)("blocksy_ext_woo_extra_floating_cart",{mount:function(n,{state:r}){if("INPUT"===n.tagName&&n.classList.contains("qty"))return void function(t){const e=document.querySelector(".ct-floating-bar .quantity .qty"),n=document.querySelector(".ct-cart-actions .quantity .qty");e&&n&&[e,n].forEach(function(e){e.value=t.value,e.dispatchEvent(new Event("change",{bubbles:!0}))})}(n);"target-after-bottom"===r&&(n.closest(".ct-drawer-canvas").dataset.floatingBar="yes:start",requestAnimationFrame(function(){n.closest(".ct-drawer-canvas").dataset.floatingBar="yes",a()})),"target-after-bottom"!==r&&(n.closest(".ct-drawer-canvas").dataset.floatingBar="no:updating",e(n,function(){"no:updating"===n.closest(".ct-drawer-canvas").dataset.floatingBar&&(n.closest(".ct-drawer-canvas").dataset.floatingBar="no")}));const o=n.querySelector(".button:not(.single_add_to_cart_button):not(.product_type_external)");o&&(o.hasClickListener||(o.hasClickListener=!0,o.addEventListener("click",function(e){e.preventDefault(),function(e){if(!e)return;var n=window.scrollY,r=null;const a=function(o){r||(r=o);var c=o-r;const i=e.getBoundingClientRect();let s=0;const u=document.querySelector("[data-sticky*=yes], [data-sticky*=fixed]");u&&(s=parseFloat(getComputedStyle(u).top)||0);const l=window.scrollY+i.top-(parseFloat(getComputedStyle(document.body).getPropertyValue("--header-sticky-height"))||0)-20-s;var d,f,y,m=Math.max((d=c,f=n,y=-n,(d/=350)<1?y/2*d*d+f:-y/2*(--d*(d-2)-1)+f),l);t.areWeDealingWithSafari?(scrollTo(0,m),c<700&&requestAnimationFrame(a)):scrollTo(0,l)};t.areWeDealingWithSafari?requestAnimationFrame(a):a(0)}(document.querySelector(".single-product .single_add_to_cart_button").closest("form"))})))}})}();