File "payment-frontend.js"
Full Path: /home/jlklyejr/public_html/wp-content/test/wp-content/plugins/woocommerce/assets/client/blocks/checkout-blocks/payment-frontend.js
File size: 46.22 KB
MIME-type: text/plain
Charset: utf-8
(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[7162],{3854:(e,t,n)=>{"use strict";n.d(t,{T:()=>i});var o=n(7608),s=n.n(o);function r(e){return"appear"===e?"top":"left"}function i(e){if("loading"===e.type)return s()("components-animate__loading");const{type:t,origin:n=r(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return s()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?s()("components-animate__slide-in","is-from-"+n):void 0}},9770:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var o=n(2314),s=n(9307),r=n(7608),i=n.n(r),a=n(2819),c=n(7180),l=n.n(c),d=n(2858),u=n(9402),m=n(7971);const p=["onMouseDown","onClick"],h=(0,s.forwardRef)((function(e,t){const{href:n,target:r,isSmall:c,isPressed:h,isBusy:g,isDestructive:v,className:f,disabled:y,icon:E,iconPosition:w="left",iconSize:b,showTooltip:S,tooltipPosition:_,shortcut:C,label:P,children:k,text:R,variant:M,__experimentalIsFocusable:x,describedBy:A,...T}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:o,isLink:s,variant:r,...i}){let a=r;var c,d,u,m,p;return t&&(null!==(c=a)&&void 0!==c||(a="primary")),o&&(null!==(d=a)&&void 0!==d||(a="tertiary")),n&&(null!==(u=a)&&void 0!==u||(a="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(m=a)&&void 0!==m||(a="secondary")),s&&(null!==(p=a)&&void 0!==p||(a="link")),{...i,variant:a}}(e),Z=i()("components-button",f,{"is-secondary":"secondary"===M,"is-primary":"primary"===M,"is-small":c,"is-tertiary":"tertiary"===M,"is-pressed":h,"is-busy":g,"is-link":"link"===M,"is-destructive":v,"has-text":!!E&&!!k,"has-icon":!!E}),N=y&&!x,D=void 0===n||N?"button":"a",L="a"===D?{href:n,target:r}:{type:"button",disabled:N,"aria-pressed":h};if(y&&x){L["aria-disabled"]=!0;for(const e of p)T[e]=e=>{e.stopPropagation(),e.preventDefault()}}const F=!N&&(S&&P||C||!!P&&(!k||(0,a.isArray)(k)&&!k.length)&&!1!==S),I=A?(0,a.uniqueId)():null,O=T["aria-describedby"]||I,z=(0,s.createElement)(D,(0,o.Z)({},L,T,{className:Z,"aria-label":T["aria-label"]||P,"aria-describedby":O,ref:t}),E&&"left"===w&&(0,s.createElement)(u.Z,{icon:E,size:b}),R&&(0,s.createElement)(s.Fragment,null,R),E&&"right"===w&&(0,s.createElement)(u.Z,{icon:E,size:b}),k);return F?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d.Z,{text:A||P,shortcut:C,position:_},z),A&&(0,s.createElement)(m.Z,null,(0,s.createElement)("span",{id:I},A))):(0,s.createElement)(s.Fragment,null,z,A&&(0,s.createElement)(m.Z,null,(0,s.createElement)("span",{id:I},A)))}))},6372:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(2314),s=n(9307);const r=function({icon:e,className:t,...n}){const r=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return(0,s.createElement)("span",(0,o.Z)({className:r},n))}},9402:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(2314),s=n(9307),r=n(444),i=n(6372);const a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return(0,s.createElement)(i.Z,(0,o.Z)({icon:e},n));if((0,s.isValidElement)(e)&&i.Z===e.type)return(0,s.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof s.Component?(0,s.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===r.SVG)){const o={width:t,height:t,...e.props,...n};return(0,s.createElement)(r.SVG,o)}return(0,s.isValidElement)(e)?(0,s.cloneElement)(e,{size:t,...n}):e}},8689:(e,t,n)=>{"use strict";n.d(t,{Z:()=>C});var o=n(2314),s=n(9307),r=n(7608),i=n.n(r),a=n(5904),c=n(7180),l=n.n(c),d=n(4333),u=n(7152),m=n(2023),p=n(9770),h=n(9330),g=n(3698),v=n(7031),f=n(3854);const y="Popover";function E(e,t){const{paddingTop:n,paddingBottom:o,paddingLeft:s,paddingRight:r}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const a=n?parseInt(n,10):0,c=o?parseInt(o,10):0,l=s?parseInt(s,10):0,d=r?parseInt(r,10):0;return{x:e.left+l,y:e.top+a,width:e.width-l-d,height:e.height-a-c,left:e.left+l,right:e.right-d,top:e.top+a,bottom:e.bottom-c}}function w(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function b(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function S(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const _=(0,s.forwardRef)((({headerTitle:e,onClose:t,children:n,className:r,noArrow:c=!0,isAlternate:_,position:C="bottom right",range:P,focusOnMount:k="firstElement",anchorRef:R,shouldAnchorIncludePadding:M,anchorRect:x,getAnchorRect:A,expandOnMobile:T,animate:Z=!0,onClickOutside:N,onFocusOutside:D,__unstableStickyBoundaryElement:L,__unstableSlotName:F=y,__unstableObserveElement:I,__unstableBoundaryParent:O,__unstableForcePosition:z,__unstableForceXAlignment:V,...W},B)=>{const H=(0,s.useRef)(null),Y=(0,s.useRef)(null),j=(0,s.useRef)(),U=(0,d.useViewportMatch)("medium","<"),[K,G]=(0,s.useState)(),$=(0,g.Z)(F),q=T&&U,[Q,J]=(0,d.useResizeObserver)();c=q||c,(0,s.useLayoutEffect)((()=>{if(q)return S(j.current,"is-without-arrow",c),S(j.current,"is-alternate",_),w(j.current,"data-x-axis"),w(j.current,"data-y-axis"),b(j.current,"top"),b(j.current,"left"),b(Y.current,"maxHeight"),void b(Y.current,"maxWidth");const e=()=>{if(!j.current||!Y.current)return;let e=function(e,t,n,o=!1,s,r){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return(0,m.cS)(t,t.ownerDocument||e.current.ownerDocument,r)}if(!1!==o){if(!(o&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==o?void 0:o.cloneRange))return(0,m.cS)((0,a.getRectangleFromRange)(o),o.endContainer.ownerDocument,r);if("function"==typeof(null==o?void 0:o.getBoundingClientRect)){const e=(0,m.cS)(o.getBoundingClientRect(),o.ownerDocument,r);return s?e:E(e,o)}const{top:e,bottom:t}=o,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),c=(0,m.cS)(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,r);return s?c:E(c,o)}if(!e.current)return;const{parentNode:i}=e.current,c=i.getBoundingClientRect();return s?c:E(c,i)}(H,x,A,R,M,j.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=j.current;let o,s=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();s=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var r;O&&(o=null===(r=j.current.closest(".popover-slot"))||void 0===r?void 0:r.parentNode);const i=J.height?J:Y.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:d,xAxis:u,yAxis:p,contentHeight:h,contentWidth:g}=(0,m.sw)(e,i,C,L,j.current,s,o,z,V);"number"==typeof l&&"number"==typeof d&&(b(j.current,"top",l+"px"),b(j.current,"left",d+"px")),S(j.current,"is-without-arrow",c||"center"===u&&"middle"===p),S(j.current,"is-alternate",_),w(j.current,"data-x-axis",u),w(j.current,"data-y-axis",p),b(Y.current,"maxHeight","number"==typeof h?h+"px":""),b(Y.current,"maxWidth","number"==typeof g?g+"px":""),G(({left:"right",right:"left"}[u]||"center")+" "+({top:"bottom",bottom:"top"}[p]||"middle"))};e();const{ownerDocument:t}=j.current,{defaultView:n}=t,o=n.setInterval(e,500);let s;const r=()=>{n.cancelAnimationFrame(s),s=n.requestAnimationFrame(e)};n.addEventListener("click",r),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(R);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),I&&(l=new n.MutationObserver(e),l.observe(I,{attributes:!0})),()=>{n.clearInterval(o),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",r),n.cancelAnimationFrame(s),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}}),[q,x,A,R,M,C,J,L,I,O]);const X=(e,n)=>{if("focus-outside"===e&&D)D(n);else if("focus-outside"===e&&N){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),N(e)}else t&&t()},[ee,te]=(0,d.__experimentalUseDialog)({focusOnMount:k,__unstableOnClose:X,onClose:X}),ne=(0,d.useMergeRefs)([j,ee,B]),oe=Boolean(Z&&K)&&(0,f.T)({type:"appear",origin:K});let se=(0,s.createElement)("div",(0,o.Z)({className:i()("components-popover",r,oe,{"is-expanded":q,"is-without-arrow":c,"is-alternate":_})},W,{ref:ne},te,{tabIndex:"-1"}),q&&(0,s.createElement)(h.Z,null),q&&(0,s.createElement)("div",{className:"components-popover__header"},(0,s.createElement)("span",{className:"components-popover__header-title"},e),(0,s.createElement)(p.Z,{className:"components-popover__close",icon:u.Z,onClick:t})),(0,s.createElement)("div",{ref:Y,className:"components-popover__content"},(0,s.createElement)("div",{style:{position:"relative"}},Q,n)));return $.ref&&(se=(0,s.createElement)(v.de,{name:F},se)),R||x?se:(0,s.createElement)("span",{ref:H},se)}));_.Slot=(0,s.forwardRef)((function({name:e=y},t){return(0,s.createElement)(v.g7,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));const C=_},2023:(e,t,n)=>{"use strict";n.d(t,{cS:()=>i,sw:()=>r});var o=n(5736);const s=10;function r(e,t,n="top",r,i,a,c,l,d){const[u,m="center",p]=n.split(" "),h=function(e,t,n,o,r,i,a,c){const{height:l}=t;if(r){const t=r.getBoundingClientRect().top+l-a;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let d=e.top+e.height/2;"bottom"===o?d=e.bottom:"top"===o&&(d=e.top);const u={popoverTop:d,contentHeight:(d-l/2>0?l/2:d)+(d+l/2>window.innerHeight?window.innerHeight-d:l/2)},m={popoverTop:e.top,contentHeight:e.top-s-l>0?l:e.top-s},p={popoverTop:e.bottom,contentHeight:e.bottom+s+l>window.innerHeight?window.innerHeight-s-e.bottom:l};let h,g=n,v=null;if(!r&&!c)if("middle"===n&&u.contentHeight===l)g="middle";else if("top"===n&&m.contentHeight===l)g="top";else if("bottom"===n&&p.contentHeight===l)g="bottom";else{g=m.contentHeight>p.contentHeight?"top":"bottom";const e="top"===g?m.contentHeight:p.contentHeight;v=e!==l?e:null}return h="middle"===g?u.popoverTop:"top"===g?m.popoverTop:p.popoverTop,{yAxis:g,popoverTop:h,contentHeight:v}}(e,t,u,p,r,0,a,l),g=function(e,t,n,s,r,i,a,c,l){const{width:d}=t;"left"===n&&(0,o.isRTL)()?n="right":"right"===n&&(0,o.isRTL)()&&(n="left"),"left"===s&&(0,o.isRTL)()?s="right":"right"===s&&(0,o.isRTL)()&&(s="left");const u=Math.round(e.left+e.width/2),m={popoverLeft:u,contentWidth:(u-d/2>0?d/2:u)+(u+d/2>window.innerWidth?window.innerWidth-u:d/2)};let p=e.left;"right"===s?p=e.right:"middle"===i||l||(p=u);let h=e.right;"left"===s?h=e.left:"middle"===i||l||(h=u);const g={popoverLeft:p,contentWidth:p-d>0?d:p},v={popoverLeft:h,contentWidth:h+d>window.innerWidth?window.innerWidth-h:d};let f,y=n,E=null;if(!r&&!c)if("center"===n&&m.contentWidth===d)y="center";else if("left"===n&&g.contentWidth===d)y="left";else if("right"===n&&v.contentWidth===d)y="right";else{y=g.contentWidth>v.contentWidth?"left":"right";const e="left"===y?g.contentWidth:v.contentWidth;d>window.innerWidth&&(E=window.innerWidth),e!==d&&(y="center",m.popoverLeft=window.innerWidth/2)}if(f="center"===y?m.popoverLeft:"left"===y?g.popoverLeft:v.popoverLeft,a){const e=a.getBoundingClientRect();f=Math.min(f,e.right-d),(0,o.isRTL)()||(f=Math.max(f,0))}return{xAxis:y,popoverLeft:f,contentWidth:E}}(e,t,m,p,r,h.yAxis,c,l,d);return{...g,...h}}function i(e,t,n){const{defaultView:o}=t,{frameElement:s}=o;if(!s||t===n.ownerDocument)return e;const r=s.getBoundingClientRect();return new o.DOMRect(e.left+r.left,e.top+r.top,e.width,e.height)}},9330:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(9307);let s=0;function r(e){const t=document.scrollingElement||document.body;e&&(s=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=s)}let i=0;function a(){return(0,o.useEffect)((()=>(0===i&&r(!0),++i,()=>{1===i&&r(!1),--i})),[]),null}},1202:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9307),s=n(2819);const r=function({shortcut:e,className:t}){if(!e)return null;let n,r;return(0,s.isString)(e)&&(n=e),(0,s.isObject)(e)&&(n=e.display,r=e.ariaLabel),(0,o.createElement)("span",{className:t,"aria-label":r},n)}},9183:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(9307),s=n(3698);function r(){const[,e]=(0,o.useState)({}),t=(0,o.useRef)(!0);return(0,o.useEffect)((()=>()=>{t.current=!1}),[]),()=>{t.current&&e({})}}function i({name:e,children:t}){const n=(0,s.Z)(e),i=(0,o.useRef)({rerender:r()});return(0,o.useEffect)((()=>(n.registerFill(i),()=>{n.unregisterFill(i)})),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),(0,o.createPortal)(t,n.ref.current)):null}},4745:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var o=n(9307);n(2560);const s=(0,o.createContext)({slots:{},fills:{},registerSlot:()=>{"undefined"!=typeof process&&process.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}})},942:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(2314),s=n(9307),r=n(4333),i=n(4745);const a=(0,s.forwardRef)((function({name:e,fillProps:t={},as:n="div",...a},c){const l=(0,s.useContext)(i.Z),d=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(l.registerSlot(e,d,t),()=>{l.unregisterSlot(e,d)})),[l.registerSlot,l.unregisterSlot,e]),(0,s.useLayoutEffect)((()=>{l.updateSlot(e,t)})),(0,s.createElement)(n,(0,o.Z)({ref:(0,r.useMergeRefs)([c,d])},a))}))},3698:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9307),s=n(4745);function r(e){const t=(0,o.useContext)(s.Z),n=t.slots[e]||{},r=t.fills[e],i=(0,o.useMemo)((()=>r||[]),[r]);return{...n,updateSlot:(0,o.useCallback)((n=>{t.updateSlot(e,n)}),[e,t.updateSlot]),unregisterSlot:(0,o.useCallback)((n=>{t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),fills:i,registerFill:(0,o.useCallback)((n=>{t.registerFill(e,n)}),[e,t.registerFill]),unregisterFill:(0,o.useCallback)((n=>{t.unregisterFill(e,n)}),[e,t.unregisterFill])}}},2146:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=(0,n(9307).createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}})},4011:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(2314),s=n(9307),r=n(2819),i=n(2146),a=n(293);function c({name:e,children:t,registerFill:n,unregisterFill:o}){const i=(0,a.Z)(e),c=(0,s.useRef)({name:e,children:t});return(0,s.useLayoutEffect)((()=>(n(e,c.current),()=>o(e,c.current))),[]),(0,s.useLayoutEffect)((()=>{c.current.children=t,i&&i.forceUpdate()}),[t]),(0,s.useLayoutEffect)((()=>{e!==c.current.name&&(o(c.current.name,c.current),c.current.name=e,n(e,c.current))}),[e]),i&&i.node?((0,r.isFunction)(t)&&(t=t(i.props.fillProps)),(0,s.createPortal)(t,i.node)):null}const l=e=>(0,s.createElement)(i.Z.Consumer,null,(({registerFill:t,unregisterFill:n})=>(0,s.createElement)(c,(0,o.Z)({},e,{registerFill:t,unregisterFill:n}))))},7031:(e,t,n)=>{"use strict";n.d(t,{de:()=>l,g7:()=>d});var o=n(2314),s=n(9307),r=n(4011),i=n(9137),a=n(9183),c=n(942);function l(e){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(r.Z,e),(0,s.createElement)(a.Z,e))}const d=(0,s.forwardRef)((({bubblesVirtually:e,...t},n)=>e?(0,s.createElement)(c.Z,(0,o.Z)({},t,{ref:n})):(0,s.createElement)(i.Z,t)))},9137:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var o=n(2314),s=n(9307),r=n(2819),i=n(2146);class a extends s.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:o}=this.props;e.name!==t&&(n(e.name),o(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:o}=this.props,i=(0,r.map)(o(t,this),(e=>{const t=(0,r.isFunction)(e.children)?e.children(n):e.children;return s.Children.map(t,((e,t)=>{if(!e||(0,r.isString)(e))return e;const n=e.key||t;return(0,s.cloneElement)(e,{key:n})}))})).filter((0,r.negate)(s.isEmptyElement));return(0,s.createElement)(s.Fragment,null,(0,r.isFunction)(e)?e(i):i)}}const c=e=>(0,s.createElement)(i.Z.Consumer,null,(({registerSlot:t,unregisterSlot:n,getFills:r})=>(0,s.createElement)(a,(0,o.Z)({},e,{registerSlot:t,unregisterSlot:n,getFills:r}))))},293:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9307),s=n(2146);const r=e=>{const{getSlot:t,subscribe:n}=(0,o.useContext)(s.Z),[r,i]=(0,o.useState)(t(e));return(0,o.useEffect)((()=>(i(t(e)),n((()=>{i(t(e))})))),[e]),r}},2858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var o=n(9307),s=n(2819),r=n(4333),i=n(8689),a=n(1202);const c=(0,o.createElement)("div",{className:"event-catcher"}),l=({eventHandlers:e,child:t,childrenWithPopover:n})=>(0,o.cloneElement)((0,o.createElement)("span",{className:"disabled-element-wrapper"},(0,o.cloneElement)(c,e),(0,o.cloneElement)(t,{children:n}),","),e),d=({child:e,eventHandlers:t,childrenWithPopover:n})=>(0,o.cloneElement)(e,{...t,children:n}),u=(e,t,n)=>{if(1!==o.Children.count(e))return;const s=o.Children.only(e);"function"==typeof s.props[t]&&s.props[t](n)},m=function({children:e,position:t,text:n,shortcut:c}){const[m,p]=(0,o.useState)(!1),[h,g]=(0,o.useState)(!1),v=(0,r.useDebounce)(g,700),f=t=>{u(e,"onMouseDown",t),document.addEventListener("mouseup",w),p(!0)},y=t=>{u(e,"onMouseUp",t),document.removeEventListener("mouseup",w),p(!1)},E=e=>"mouseUp"===e?y:"mouseDown"===e?f:void 0,w=E("mouseUp"),b=(t,n)=>o=>{if(u(e,t,o),o.currentTarget.disabled)return;if("focus"===o.type&&m)return;v.cancel();const r=(0,s.includes)(["focus","mouseenter"],o.type);r!==h&&(n?v(r):g(r))},S=()=>{v.cancel(),document.removeEventListener("mouseup",w)};if((0,o.useEffect)((()=>S),[]),1!==o.Children.count(e))return e;const _={onMouseEnter:b("onMouseEnter",!0),onMouseLeave:b("onMouseLeave"),onClick:b("onClick"),onFocus:b("onFocus"),onBlur:b("onBlur"),onMouseDown:E("mouseDown")},C=o.Children.only(e),{children:P,disabled:k}=C.props,R=k?l:d,M=(({grandchildren:e,isOver:t,position:n,text:s,shortcut:r})=>(0,o.concatChildren)(e,t&&(0,o.createElement)(i.Z,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},s,(0,o.createElement)(a.Z,{className:"components-tooltip__shortcut",shortcut:r}))))({grandchildren:P,isOver:h,position:t,text:n,shortcut:c});return R({child:C,eventHandlers:_,childrenWithPopover:M})}},7971:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(7608),s=n.n(o),r=n(9307),i=n(6186);const a=(0,r.forwardRef)((function({as:e="div",className:t,...n},o){return(0,i.k)({as:e,className:s()("components-visually-hidden",t),...n,ref:o})}))},6186:(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n(9307);function s({as:e="div",...t}){return"function"==typeof t.children?t.children(t):(0,o.createElement)(e,t)}},7152:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9307),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}))},202:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))},9140:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}))},1231:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"}))},2720:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}))},214:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{fillRule:"evenodd",d:"M18.646 9H20V8l-1-.5L12 4 5 7.5 4 8v1h14.646zm-3-1.5L12 5.677 8.354 7.5h7.292zm-7.897 9.44v-6.5h-1.5v6.5h1.5zm5-6.5v6.5h-1.5v-6.5h1.5zm5 0v6.5h-1.5v-6.5h1.5zm2.252 8.81c0 .414-.334.75-.748.75H4.752a.75.75 0 010-1.5h14.5a.75.75 0 01.749.75z",clipRule:"evenodd"}))},1242:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{fillRule:"evenodd",d:"M6.863 13.644L5 13.25h-.5a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5H5L18 6.5h2V16h-2l-3.854-.815.026.008a3.75 3.75 0 01-7.31-1.549zm1.477.313a2.251 2.251 0 004.356.921l-4.356-.921zm-2.84-3.28L18.157 8h.343v6.5h-.343L5.5 11.823v-1.146z",clipRule:"evenodd"}))},3326:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"}))},2904:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var o=n(9196),s=n(9770),r=n(3849),i=n.n(r),a=(n(1029),n(2595));const c=({className:e,showSpinner:t=!1,children:n,variant:r="contained",...c})=>{const l=i()("wc-block-components-button","wp-element-button",e,r,{"wc-block-components-button--loading":t});return(0,o.createElement)(s.Z,{className:l,...c},t&&(0,o.createElement)(a.Z,null),(0,o.createElement)("span",{className:"wc-block-components-button__text"},n))}},4570:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});var o=n(8752);const s=[{id:"alipay",alt:"Alipay",src:o.td+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:o.td+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:o.td+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:o.td+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:o.td+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:o.td+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:o.td+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:o.td+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:o.td+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:o.td+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:o.td+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:o.td+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:o.td+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:o.td+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:o.td+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:o.td+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:o.td+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:o.td+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:o.td+"payment-methods/wechat.svg"}],r=e=>s.find((t=>t.id===e))||{}},2454:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(9196),s=n(3849),r=n.n(s),i=n(1368),a=n(4570),c=n(8999);n(6391);const l=({icons:e=[],align:t="center",className:n})=>{const s=(0,c.L)(e);if(0===s.length)return null;const l=r()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===t,"wc-block-components-payment-method-icons--align-right":"right"===t},n);return(0,o.createElement)("div",{className:l},s.map((e=>{const t={...e,...(0,a.C)(e.id)};return(0,o.createElement)(i.Z,{key:"payment-method-icon-"+e.id,...t})})))}},1368:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196);const s=e=>`wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${e}`,r=({id:e,src:t=null,alt:n=""})=>t?(0,o.createElement)("img",{className:s(e),src:t,alt:n}):null},8999:(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n(3243);const s=e=>{const t={};return e.forEach((e=>{let n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"==typeof e&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&(0,o.H)(n.id)&&!t[n.id]&&(t[n.id]=n)})),Object.values(t)}},7673:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var o=n(9196),s=n(3849),r=n.n(s),i=n(6574),a=n(214),c=n(1231),l=n(3326),d=n(2911),u=n(3243),m=n(7998),p=n(9307);n(3169);const h={bank:a.Z,bill:c.Z,card:l.Z,checkPayment:i.Z},g=({icon:e="",text:t=""})=>{const n=!!e,s=(0,p.useCallback)((e=>n&&(0,u.H)(e)&&(0,m.$n)(h,e)),[n]),i=r()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":n});return(0,o.createElement)("span",{className:i},s(e)?(0,o.createElement)(d.Z,{icon:h[e]}):e,t)}},6881:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var o=n(9196),s=n(5736),r=n(3849),i=n.n(r),a=n(711);n(991);const c=({children:e,className:t,screenReaderLabel:n,showSpinner:r=!1,isLoading:c=!0})=>(0,o.createElement)("div",{className:i()(t,{"wc-block-components-loading-mask":c})},c&&r&&(0,o.createElement)(a.Spinner,null),(0,o.createElement)("div",{className:i()({"wc-block-components-loading-mask__children":c}),"aria-hidden":c},e),c&&(0,o.createElement)("span",{className:"screen-reader-text"},n||(0,s.__)("Loading…","woocommerce")))},4787:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var o=n(9196),s=n(3849),r=n.n(s),i=n(5736),a=n(2911),c=n(9140),l=(n(946),n(9114)),d=n(2904),u=n(2010);const m=({className:e,status:t="default",children:n,spokenMessage:s=n,onRemove:m=(()=>{}),isDismissible:p=!0,politeness:h=(0,l.x)(t),summary:g})=>((0,u.o)(s,h),(0,o.createElement)("div",{className:r()(e,"wc-block-components-notice-banner","is-"+t,{"is-dismissible":p})},(0,o.createElement)(a.Z,{icon:(0,l.X)(t)}),(0,o.createElement)("div",{className:"wc-block-components-notice-banner__content"},g&&(0,o.createElement)("p",{className:"wc-block-components-notice-banner__summary"},g),n),!!p&&(0,o.createElement)(d.Z,{className:"wc-block-components-notice-banner__dismiss",icon:c.Z,label:(0,i.__)("Dismiss this notice","woocommerce"),onClick:e=>{"function"==typeof(null==e?void 0:e.preventDefault)&&e.preventDefault&&e.preventDefault(),m()},showTooltip:!1})))},9114:(e,t,n)=>{"use strict";n.d(t,{X:()=>a,x:()=>i});var o=n(202),s=n(2720),r=n(1242);const i=e=>{switch(e){case"success":case"warning":case"info":case"default":return"polite";default:return"assertive"}},a=e=>{switch(e){case"success":return o.Z;case"warning":case"info":case"error":return s.Z;default:return r.Z}}},9095:(e,t,n)=>{"use strict";n.d(t,{K:()=>l});var o=n(5736),s=n(9818),r=n(4801),i=n(2629),a=n(3554),c=n(9659);const l=(e="")=>{const{cartCoupons:t,cartIsLoading:n}=(0,c.b)(),{createErrorNotice:l}=(0,s.useDispatch)("core/notices"),{createNotice:d}=(0,s.useDispatch)("core/notices"),{setValidationErrors:u}=(0,s.useDispatch)(r.VALIDATION_STORE_KEY),{isApplyingCoupon:m,isRemovingCoupon:p}=(0,s.useSelect)((e=>{const t=e(r.CART_STORE_KEY);return{isApplyingCoupon:t.isApplyingCoupon(),isRemovingCoupon:t.isRemovingCoupon()}}),[l,d]),{applyCoupon:h,removeCoupon:g}=(0,s.useDispatch)(r.CART_STORE_KEY);return{appliedCoupons:t,isLoading:n,applyCoupon:t=>h(t).then((()=>((0,a.applyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&d("info",(0,o.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,o.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((e=>(u({coupon:{message:(0,i.decodeEntities)(e.message),hidden:!1}}),Promise.resolve(!1)))),removeCoupon:t=>g(t).then((()=>((0,a.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&d("info",(0,o.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,o.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((t=>(l(t.message,{id:"coupon-form",context:e}),Promise.resolve(!1)))),isApplyingCoupon:m,isRemovingCoupon:p}}},1116:(e,t,n)=>{"use strict";n.d(t,{z:()=>_});var o=n(5736),s=n(4293),r=n(9307),i=n(7673),a=n(2454),c=n(4617),l=n(7180),d=n.n(l),u=n(6881),m=n(9818),p=n(4801),h=n(711),g=n(9659),v=n(9095),f=n(8027),y=n(1715),E=n(6410),w=n(5576),b=n(401),S=n(3251);const _=()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:n,onCheckoutAfterProcessingWithError:l,onSubmit:_,onCheckoutSuccess:C,onCheckoutFail:P,onCheckoutValidation:k}=(0,y.U)(),{isCalculating:R,isComplete:M,isIdle:x,isProcessing:A,customerId:T}=(0,m.useSelect)((e=>{const t=e(p.CHECKOUT_STORE_KEY);return{isComplete:t.isComplete(),isIdle:t.isIdle(),isProcessing:t.isProcessing(),customerId:t.getCustomerId(),isCalculating:t.isCalculating()}})),{paymentStatus:Z,activePaymentMethod:N,shouldSavePayment:D}=(0,m.useSelect)((e=>{const t=e(p.PAYMENT_STORE_KEY);return{paymentStatus:{get isPristine(){return d()("isPristine",{since:"9.6.0",alternative:"isIdle",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentIdle()},isIdle:t.isPaymentIdle(),isStarted:t.isExpressPaymentStarted(),isProcessing:t.isPaymentProcessing(),get isFinished(){return d()("isFinished",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()||t.isPaymentReady()},hasError:t.hasPaymentError(),get hasFailed(){return d()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()},get isSuccessful(){return d()("isSuccessful",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentReady()},isReady:t.isPaymentReady(),isDoingExpressPayment:t.isExpressPaymentMethodActive()},activePaymentMethod:t.getActivePaymentMethod(),shouldSavePayment:t.getShouldSavePaymentMethod()}})),{__internalSetExpressPaymentError:L}=(0,m.useDispatch)(p.PAYMENT_STORE_KEY),{onPaymentProcessing:F,onPaymentSetup:I}=(0,E.P)(),{shippingErrorStatus:O,shippingErrorTypes:z,onShippingRateSuccess:V,onShippingRateFail:W,onShippingRateSelectSuccess:B,onShippingRateSelectFail:H}=(0,w.d)(),{shippingRates:Y,isLoadingRates:j,selectedRates:U,isSelectingRate:K,selectShippingRate:G,needsShipping:$}=(0,S.V)(),{billingAddress:q,shippingAddress:Q}=(0,m.useSelect)((e=>e(p.CART_STORE_KEY).getCustomerData())),{setShippingAddress:J}=(0,m.useDispatch)(p.CART_STORE_KEY),{cartItems:X,cartFees:ee,cartTotals:te,extensions:ne}=(0,g.b)(),{appliedCoupons:oe}=(0,v.K)(),se=(0,r.useRef)((0,b.a)(te,$)),re=(0,r.useRef)({label:(0,o.__)("Total","woocommerce"),value:parseInt(te.total_price,10)});(0,r.useEffect)((()=>{se.current=(0,b.a)(te,$),re.current={label:(0,o.__)("Total","woocommerce"),value:parseInt(te.total_price,10)}}),[te,$]);const ie=(0,r.useCallback)(((e="")=>{d()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),L(e)}),[L]);return{activePaymentMethod:N,billing:{appliedCoupons:oe,billingAddress:q,billingData:q,cartTotal:re.current,cartTotalItems:se.current,currency:(0,s.getCurrencyFromPriceResponse)(te),customerId:T,displayPricesIncludingTax:(0,c.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:X,cartFees:ee,extensions:ne},checkoutStatus:{isCalculating:R,isComplete:M,isIdle:x,isProcessing:A},components:{LoadingMask:u.Z,PaymentMethodIcons:a.Z,PaymentMethodLabel:i.Z,ValidationInputError:h.ValidationInputError},emitResponse:{noticeContexts:f.n7,responseTypes:f.dO},eventRegistration:{onCheckoutAfterProcessingWithError:l,onCheckoutAfterProcessingWithSuccess:n,onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutSuccess:C,onCheckoutFail:P,onCheckoutValidation:k,onPaymentProcessing:F,onPaymentSetup:I,onShippingRateFail:W,onShippingRateSelectFail:H,onShippingRateSelectSuccess:B,onShippingRateSuccess:V},onSubmit:_,paymentStatus:Z,setExpressPaymentError:ie,shippingData:{isSelectingRate:K,needsShipping:$,selectedRates:U,setSelectedRates:G,setShippingAddress:J,shippingAddress:Q,shippingRates:Y,shippingRatesLoading:j},shippingStatus:{shippingErrorStatus:O,shippingErrorTypes:z},shouldSavePayment:D}}},401:(e,t,n)=>{"use strict";n.d(t,{a:()=>i});var o=n(5736),s=n(7998),r=n(3243);const i=(e,t)=>{const n=[],i=(t,n)=>{const o=n+"_tax",i=(0,s.$n)(e,n)&&(0,r.H)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:i,valueWithTax:i+((0,s.$n)(e,o)&&(0,r.H)(e[o])?parseInt(e[o],10):0)}};return n.push(i((0,o.__)("Subtotal:","woocommerce"),"total_items")),n.push(i((0,o.__)("Fees:","woocommerce"),"total_fees")),n.push(i((0,o.__)("Discount:","woocommerce"),"total_discount")),n.push({key:"total_tax",label:(0,o.__)("Taxes:","woocommerce"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(i((0,o.__)("Shipping:","woocommerce"),"total_shipping")),n}},2010:(e,t,n)=>{"use strict";n.d(t,{o:()=>r});var o=n(9307),s=n(5158);const r=(e,t)=>{const n="string"==typeof e?e:(0,o.renderToString)(e);(0,o.useEffect)((()=>{n&&(0,s.speak)(n,t)}),[n,t])}},2444:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var o=n(7708),s=n(9196),r=n(5736),i=n(9307),a=n(4617),c=n(711),l=n(8027);class d extends i.Component{constructor(...e){super(...e),(0,o.Z)(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:n}=this.props;if(e){let e=(0,r.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(n||a.CURRENT_USER_IS_ADMIN)&&(e=t||(0,r.__)("There was an error with this payment method. Please verify it's configured correctly.","woocommerce"));const o=[{id:"0",content:e,isDismissible:!1,status:"error"}];return(0,s.createElement)(c.StoreNoticesContainer,{additionalNotices:o,context:l.n7.PAYMENTS})}return this.props.children}}const u=d},1070:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var o=n(5736);const s=({defaultTitle:e=(0,o.__)("Step","woocommerce"),defaultDescription:t=(0,o.__)("Step description text.","woocommerce"),defaultShowStepNumber:n=!0})=>({title:{type:"string",default:e},description:{type:"string",default:t},showStepNumber:{type:"boolean",default:n}})},9298:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>B});var o=n(9196),s=n(3849),r=n.n(s),i=n(9659),a=n(721),c=n(711),l=n(9818),d=n(4801),u=n(8027),m=n(5736),p=n(4787);n(7277);const h=()=>(0,o.createElement)(p.Z,{isDismissible:!1,className:"wc-block-checkout__no-payment-methods-notice",status:"error"},(0,m.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.","woocommerce"));var g=n(1116),v=n(8360),f=n(9307),y=n(8449),E=n(4613),w=n(2444);const b=({children:e,showSaveOption:t})=>{const{isEditor:n}=(0,y._)(),{shouldSavePaymentMethod:s,customerId:r}=(0,l.useSelect)((e=>{const t=e(d.PAYMENT_STORE_KEY),n=e(d.CHECKOUT_STORE_KEY);return{shouldSavePaymentMethod:t.getShouldSavePaymentMethod(),customerId:n.getCustomerId()}})),{__internalSetShouldSavePaymentMethod:i}=(0,l.useDispatch)(d.PAYMENT_STORE_KEY);return(0,o.createElement)(w.Z,{isEditor:n},e,r>0&&t&&(0,o.createElement)(c.CheckboxControl,{className:"wc-block-components-payment-methods__save-card-info",label:(0,m.__)("Save payment information to my account for future purchases.","woocommerce"),checked:s,onChange:()=>i(!s)}))};var S=n(940);const _=()=>{const{activeSavedToken:e,activePaymentMethod:t,isExpressPaymentMethodActive:n,savedPaymentMethods:s,availablePaymentMethods:i}=(0,l.useSelect)((e=>{const t=e(S.L);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),savedPaymentMethods:t.getSavedPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),{__internalSetActivePaymentMethod:a}=(0,l.useDispatch)(S.L),d=(0,E.getPaymentMethods)(),{...m}=(0,g.z)(),{removeNotice:p}=(0,l.useDispatch)("core/notices"),{dispatchCheckoutEvent:h}=(0,v.n)(),{isEditor:w}=(0,y._)(),_=Object.keys(i).map((e=>{const{edit:t,content:n,label:s,supports:r}=d[e],i=w?t:n;return{value:e,label:"string"==typeof s?s:(0,f.cloneElement)(s,{components:m.components}),name:`wc-saved-payment-method-token-${e}`,content:(0,o.createElement)(b,{showSaveOption:r.showSaveOption},(0,f.cloneElement)(i,{__internalSetActivePaymentMethod:a,...m}))}})),C=(0,f.useCallback)((e=>{a(e),p("wc-payment-error",u.n7.PAYMENTS),h("set-active-payment-method",{value:e})}),[h,p,a]),P=0===Object.keys(s).length&&1===Object.keys(d).length,k=r()({"disable-radio-control":P});return n?null:(0,o.createElement)(c.RadioControlAccordion,{id:"wc-payment-method-options",className:k,selected:e?null:t,onChange:C,options:_})};var C=n(2893),P=n(4617),k=n(7618),R=n(9040),M=n(5585);const x="wc/store/cart",A=((0,m.__)("Unable to get cart data from the API.","woocommerce"),[]),T=[],Z={},N={};Object.keys(P.defaultFields).forEach((e=>{N[e]=""})),delete N.email;const D={};Object.keys(P.defaultFields).forEach((e=>{D[e]=""}));const L={cartItemsPendingQuantity:[],cartItemsPendingDelete:[],cartData:{coupons:[],shippingRates:[],shippingAddress:N,billingAddress:D,items:[],itemsCount:0,itemsWeight:0,crossSells:[],needsShipping:!0,needsPayment:!1,hasCalculatedShipping:!0,fees:[],totals:{currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"",currency_suffix:"",total_items:"0",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_price:"0",total_tax:"0",tax_lines:[]},errors:A,paymentMethods:[],paymentRequirements:[],extensions:Z},metaData:{updatingCustomerData:!1,updatingSelectedRate:!1,applyingCoupon:"",removingCoupon:"",isCartDataStale:!1},errors:T},F=({method:e,expires:t})=>(0,m.sprintf)(/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date. */ /* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date. */
(0,m.__)("%1$s ending in %2$s (expires %3$s)","woocommerce"),e.brand,e.last4,t),I=({method:e})=>e.brand&&e.last4?(0,m.sprintf)(/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */ /* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */
(0,m.__)("%1$s ending in %2$s","woocommerce"),e.brand,e.last4):(0,m.sprintf)(/* translators: %s is the name of the payment method gateway. */ /* translators: %s is the name of the payment method gateway. */
(0,m.__)("Saved token for %s","woocommerce"),e.gateway),O=()=>{var e;const{activeSavedToken:t,activePaymentMethod:n,savedPaymentMethods:s}=(0,l.useSelect)((e=>{const t=e(d.PAYMENT_STORE_KEY);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),savedPaymentMethods:t.getSavedPaymentMethods()}})),{__internalSetActivePaymentMethod:r}=(0,l.useDispatch)(d.PAYMENT_STORE_KEY),i=(()=>{let e;if((0,l.select)("core/editor")){const t={cartCoupons:M.s.coupons,cartItems:M.s.items,crossSellsProducts:M.s.cross_sells,cartFees:M.s.fees,cartItemsCount:M.s.items_count,cartItemsWeight:M.s.items_weight,cartNeedsPayment:M.s.needs_payment,cartNeedsShipping:M.s.needs_shipping,cartItemErrors:A,cartTotals:M.s.totals,cartIsLoading:!1,cartErrors:T,billingData:L.cartData.billingAddress,billingAddress:L.cartData.billingAddress,shippingAddress:L.cartData.shippingAddress,extensions:Z,shippingRates:M.s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:M.s.has_calculated_shipping,paymentRequirements:M.s.payment_requirements,receiveCart:()=>{}};e={cart:t,cartTotals:t.cartTotals,cartNeedsShipping:t.cartNeedsShipping,billingData:t.billingAddress,billingAddress:t.billingAddress,shippingAddress:t.shippingAddress,selectedShippingMethods:(0,k.l)(t.shippingRates),paymentMethods:M.s.payment_methods,paymentRequirements:t.paymentRequirements}}else{const t=(0,l.select)(x),n=t.getCartData(),o=t.getCartErrors(),s=t.getCartTotals(),r=!t.hasFinishedResolution("getCartData"),i=t.isCustomerDataUpdating(),a=(0,k.l)(n.shippingRates);e={cart:{cartCoupons:n.coupons,cartItems:n.items,crossSellsProducts:n.crossSells,cartFees:n.fees,cartItemsCount:n.itemsCount,cartItemsWeight:n.itemsWeight,cartNeedsPayment:n.needsPayment,cartNeedsShipping:n.needsShipping,cartItemErrors:n.errors,cartTotals:s,cartIsLoading:r,cartErrors:o,billingData:(0,R.QI)(n.billingAddress),billingAddress:(0,R.QI)(n.billingAddress),shippingAddress:(0,R.QI)(n.shippingAddress),extensions:n.extensions,shippingRates:n.shippingRates,isLoadingRates:i,cartHasCalculatedShipping:n.hasCalculatedShipping,paymentRequirements:n.paymentRequirements,receiveCart:(0,l.dispatch)(x).receiveCart},cartTotals:n.totals,cartNeedsShipping:n.needsShipping,billingData:n.billingAddress,billingAddress:n.billingAddress,shippingAddress:n.shippingAddress,selectedShippingMethods:a,paymentMethods:n.paymentMethods,paymentRequirements:n.paymentRequirements}}return e})(),a=(0,E.getPaymentMethods)(),m=(0,g.z)(),{removeNotice:p}=(0,l.useDispatch)("core/notices"),{dispatchCheckoutEvent:h}=(0,v.n)(),y=(0,f.useMemo)((()=>{const e=Object.keys(s),t=new Set(e.flatMap((e=>s[e].map((e=>e.method.gateway))))),n=Array.from(t).filter((e=>{var t;return null===(t=a[e])||void 0===t?void 0:t.canMakePayment(i)}));return e.flatMap((e=>s[e].map((t=>{if(!n.includes(t.method.gateway))return;const o="cc"===e||"echeck"===e,s=t.method.gateway;return{name:`wc-saved-payment-method-token-${s}`,label:o?F(t):I(t),value:t.tokenId.toString(),onChange:e=>{r(s,{token:e,payment_method:s,[`wc-${s}-payment-token`]:e.toString(),isSavedToken:!0}),p("wc-payment-error",u.n7.PAYMENTS),h("set-active-payment-method",{paymentMethodSlug:s})}}})))).filter((e=>void 0!==e))}),[s,a,r,p,h,i]),w=t&&a[n]&&void 0!==(null===(e=a[n])||void 0===e?void 0:e.savedTokenComponent)&&!(0,C.F)(a[n].savedTokenComponent)?(0,f.cloneElement)(a[n].savedTokenComponent,{token:t,...m}):null;return y.length>0?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(c.RadioControl,{id:"wc-payment-method-saved-tokens",selected:t,options:y,onChange:()=>{}}),w):null};n(7586);const z=()=>{const{paymentMethodsInitialized:e,availablePaymentMethods:t,savedPaymentMethods:n}=(0,l.useSelect)((e=>{const t=e(d.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),availablePaymentMethods:t.getAvailablePaymentMethods(),savedPaymentMethods:t.getSavedPaymentMethods()}}));return e&&0===Object.keys(t).length?(0,o.createElement)(h,null):(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O,null),Object.keys(n).length>0&&(0,o.createElement)(c.Label,{label:(0,m.__)("Use another payment method.","woocommerce"),screenReaderLabel:(0,m.__)("Other available payment methods","woocommerce"),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),(0,o.createElement)(_,null))},V=()=>(0,o.createElement)(z,null),W={...(0,n(1070).Z)({defaultTitle:(0,m.__)("Payment options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},B=(0,a.withFilteredAttributes)(W)((({title:e,description:t,showStepNumber:n,children:s,className:a})=>{const m=(0,l.useSelect)((e=>e(d.CHECKOUT_STORE_KEY).isProcessing())),{cartNeedsPayment:p}=(0,i.b)();return p?(0,o.createElement)(c.FormStep,{id:"payment-method",disabled:m,className:r()("wc-block-checkout__payment-method",a),title:e,description:t,showStepNumber:n},(0,o.createElement)(c.StoreNoticesContainer,{context:u.n7.PAYMENTS}),(0,o.createElement)(V,null),s):null}))},940:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});const o="wc/store/payment"},6574:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9196),s=n(444);const r=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)("g",{fill:"none",fillRule:"evenodd"},(0,o.createElement)("path",{d:"M0 0h24v24H0z"}),(0,o.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),(0,o.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"})))},2595:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var o=n(9196);n(7440);const s=()=>(0,o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},7608:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=s.apply(null,n);i&&e.push(i)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()},1029:()=>{},6391:()=>{},3169:()=>{},991:()=>{},946:()=>{},7277:()=>{},7586:()=>{},7440:()=>{},2314:(e,t,n)=>{"use strict";function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},o.apply(this,arguments)}n.d(t,{Z:()=>o})}}]);