OwlCyberSecurity - MANAGER
Edit File: proceed-to-checkout-style.js
"use strict";(self.webpackChunkwebpackWcBlocksStylingJsonp=self.webpackChunkwebpackWcBlocksStylingJsonp||[]).push([[9936],{13867:(e,t,o)=>{o.r(t),o.d(t,{default:()=>m});var n=o(41616),r=o(51609),c=o(70851),s=o(86087),a=o(23013),u=o(62516);const l={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1};var i=o(15703),b=o(47143),d=o(47594),p=o(71e3),k=o(73993),f=o(67827),g=o(85746);var h=o(24438);const m=(0,n.withFilteredAttributes)(h.A)((({checkoutPageId:e,className:t,buttonLabel:n})=>{const h=(0,i.getSetting)("page-"+e,!1),m=(0,b.useSelect)((e=>e(d.checkoutStore).isCalculating())),[v,w]=(()=>{const[e,t]=(0,s.useState)(""),o=(0,s.useRef)(null),n=(0,s.useRef)(new IntersectionObserver((e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:[0,.5,1]}));return(0,s.useLayoutEffect)((()=>{const e=o.current,t=n.current;return e&&t.observe(e),()=>{t.unobserve(e)}}),[]),[(0,r.createElement)("div",{"aria-hidden":!0,ref:o,style:l}),e]})(),[C,y]=(0,s.useState)(!1);(0,s.useEffect)((()=>{if("function"!=typeof o.g.addEventListener||"function"!=typeof o.g.removeEventListener)return;const e=()=>{y(!1)};return o.g.addEventListener("pageshow",e),()=>{o.g.removeEventListener("pageshow",e)}}),[]);const E=(0,b.useSelect)((e=>e(d.cartStore).getCartData())),S=(0,p.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLabel",defaultValue:n||g.G,arg:{cart:E}}),L=(0,p.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLink",defaultValue:h||u.tn,arg:{cart:E}}),{dispatchOnProceedToCheckout:_}=(0,f.e)(),N=(0,r.createElement)(a.A,{className:"wc-block-cart__submit-button",href:L,disabled:m,onClick:e=>{_().then((t=>{t.some(k.isErrorResponse)?e.preventDefault():y(!0)}))},showSpinner:C},S),A=(0,s.useMemo)((()=>getComputedStyle(document.body).backgroundColor),[]),B="below"===w,I=(0,c.A)("wc-block-cart__submit-container",{"wc-block-cart__submit-container--sticky":B});return(0,r.createElement)("div",{className:(0,c.A)("wc-block-cart__submit",t)},v,(0,r.createElement)("div",{className:I,style:B?{backgroundColor:A}:{}},N))}))}}]);