(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[49],{143:function(e,t,n){"use strict";var c=n(0);n(210),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},144:function(e,t,n){"use strict";var c=n(0),o=n(1),a=n(5),s=n.n(a),r=(n(212),n(143));t.a=e=>{let{children:t,className:n,screenReaderLabel:a,showSpinner:i=!1,isLoading:l=!0}=e;return Object(c.createElement)("div",{className:s()(n,{"wc-block-components-loading-mask":l})},l&&i&&Object(c.createElement)(r.a,null),Object(c.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(c.createElement)("span",{className:"screen-reader-text"},a||Object(o.__)("Loading…","woocommerce")))}},21:function(e,t,n){"use strict";var c=n(0),o=n(5),a=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:s,wrapperProps:r={}}=e;const i=null!=n,l=null!=o;return!i&&l?(t=s||"span",r={...r,className:a()(r.className,"screen-reader-text")},Object(c.createElement)(t,r,o)):(t=s||c.Fragment,i&&l&&n!==o?Object(c.createElement)(t,r,Object(c.createElement)("span",{"aria-hidden":"true"},n),Object(c.createElement)("span",{className:"screen-reader-text"},o)):Object(c.createElement)(t,r,n))}},210:function(e,t){},212:function(e,t){},273:function(e,t,n){"use strict";var c=n(13),o=n.n(c),a=n(0),s=n(62),r=n(5),i=n.n(r),l=n(143);n(274),t.a=e=>{let{className:t,showSpinner:n=!1,children:c,variant:r="contained",...m}=e;const d=i()("wc-block-components-button","wp-element-button",t,r,{"wc-block-components-button--loading":n});return Object(a.createElement)(s.a,o()({className:d},m),n&&Object(a.createElement)(l.a,null),Object(a.createElement)("span",{className:"wc-block-components-button__text"},c))}},274:function(e,t){},277:function(e,t,n){"use strict";var c=n(0),o=n(5),a=n.n(o),s=n(280);t.a=e=>{let{checked:t,name:n,onChange:o,option:r}=e;const{value:i,label:l,description:m,secondaryLabel:d,secondaryDescription:p}=r;return Object(c.createElement)("label",{className:a()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${n}-${i}`},Object(c.createElement)("input",{id:`${n}-${i}`,className:"wc-block-components-radio-control__input",type:"radio",name:n,value:i,onChange:e=>o(e.target.value),checked:t,"aria-describedby":a()({[`${n}-${i}__label`]:l,[`${n}-${i}__secondary-label`]:d,[`${n}-${i}__description`]:m,[`${n}-${i}__secondary-description`]:p})}),Object(c.createElement)(s.a,{id:`${n}-${i}`,label:l,secondaryLabel:d,description:m,secondaryDescription:p}))}},278:function(e,t,n){"use strict";var c=n(13),o=n.n(c),a=n(0),s=n(5),r=n.n(s);n(279),t.a=e=>{let{children:t,className:n,headingLevel:c,...s}=e;const i=r()("wc-block-components-title",n),l="h"+c;return Object(a.createElement)(l,o()({className:i},s),t)}},279:function(e,t){},280:function(e,t,n){"use strict";var c=n(0);t.a=e=>{let{label:t,secondaryLabel:n,description:o,secondaryDescription:a,id:s}=e;return Object(c.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(c.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(c.createElement)("span",{id:s&&s+"__label",className:"wc-block-components-radio-control__label"},t),n&&Object(c.createElement)("span",{id:s&&s+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},n)),(o||a)&&Object(c.createElement)("div",{className:"wc-block-components-radio-control__description-group"},o&&Object(c.createElement)("span",{id:s&&s+"__description",className:"wc-block-components-radio-control__description"},o),a&&Object(c.createElement)("span",{id:s&&s+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},a)))}},281:function(e,t){},283:function(e,t,n){"use strict";var c=n(1);t.a=e=>{let{defaultTitle:t=Object(c.__)("Step","woocommerce"),defaultDescription:n=Object(c.__)("Step description text.","woocommerce"),defaultShowStepNumber:o=!0}=e;return{title:{type:"string",default:t},description:{type:"string",default:n},showStepNumber:{type:"boolean",default:o}}}},285:function(e,t,n){"use strict";var c=n(0),o=n(5),a=n.n(o),s=n(10),r=n(277);n(290);const i=e=>{let{className:t="",id:n,selected:o="",onChange:l,options:m=[]}=e;const d=Object(s.useInstanceId)(i),p=n||d;return m.length?Object(c.createElement)("div",{className:a()("wc-block-components-radio-control",t)},m.map(e=>Object(c.createElement)(r.a,{key:`${p}-${e.value}`,name:"radio-control-"+p,checked:e.value===o,option:e,onChange:t=>{l(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=i},286:function(e,t,n){"use strict";var c=n(0),o=n(5),a=n.n(o),s=n(1),r=n(81),i=n(12),l=Object(c.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(i.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"})),m=(n(309),n(334)),d=Object(c.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(i.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"})),p=Object(c.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(i.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"}));const u=e=>{switch(e){case"success":case"warning":case"info":case"default":return"polite";case"error":default:return"assertive"}},b=e=>{switch(e){case"success":return m.a;case"warning":case"info":case"error":return d;default:return p}};var h=n(273),g=n(29);t.a=e=>{let{className:t,status:n="default",children:o,spokenMessage:i=o,onRemove:m=(()=>{}),isDismissible:d=!0,politeness:p=u(n),summary:v}=e;return((e,t)=>{const n="string"==typeof e?e:Object(c.renderToString)(e);Object(c.useEffect)(()=>{n&&Object(g.speak)(n,t)},[n,t])})(i,p),Object(c.createElement)("div",{className:a()(t,"wc-block-components-notice-banner","is-"+n,{"is-dismissible":d})},Object(c.createElement)(r.a,{icon:b(n)}),Object(c.createElement)("div",{className:"wc-block-components-notice-banner__content"},v&&Object(c.createElement)("p",{className:"wc-block-components-notice-banner__summary"},v),o),!!d&&Object(c.createElement)(h.a,{className:"wc-block-components-notice-banner__dismiss",icon:l,label:Object(s.__)("Dismiss this notice","woocommerce"),onClick:e=>{"function"==typeof(null==e?void 0:e.preventDefault)&&e.preventDefault&&e.preventDefault(),m()},showTooltip:!1}))}},290:function(e,t){},303:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(1),o=n(6),a=n(3),s=n(22),r=n(11),i=n(42);const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:n}=Object(i.a)(),{createErrorNotice:l}=Object(o.useDispatch)("core/notices"),{createNotice:m}=Object(o.useDispatch)("core/notices"),{setValidationErrors:d}=Object(o.useDispatch)(a.VALIDATION_STORE_KEY),{isApplyingCoupon:p,isRemovingCoupon:u}=Object(o.useSelect)(e=>{const t=e(a.CART_STORE_KEY);return{isApplyingCoupon:t.isApplyingCoupon(),isRemovingCoupon:t.isRemovingCoupon()}},[l,m]),{applyCoupon:b,removeCoupon:h}=Object(o.useDispatch)(a.CART_STORE_KEY),g=t=>b(t).then(()=>(Object(r.applyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&m("info",Object(c.sprintf)( /* translators: %s coupon code. */ Object(c.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0))).catch(e=>(d({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),Promise.resolve(!1))),v=t=>h(t).then(()=>(Object(r.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&m("info",Object(c.sprintf)( /* translators: %s coupon code. */ Object(c.__)('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)));return{appliedCoupons:t,isLoading:n,applyCoupon:g,removeCoupon:v,isApplyingCoupon:p,isRemovingCoupon:u}}},304:function(e,t){},309:function(e,t){},310:function(e,t,n){"use strict";var c=n(0),o=n(5),a=n.n(o),s=n(278);n(281);const r=e=>{let{title:t,stepHeadingContent:n}=e;return Object(c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(c.createElement)(s.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&Object(c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},n))};t.a=e=>{let{id:t,className:n,title:o,legend:s,description:i,children:l,disabled:m=!1,showStepNumber:d=!0,stepHeadingContent:p=(()=>{})}=e;const u=s||o?"fieldset":"div";return Object(c.createElement)(u,{className:a()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":m}),id:t,disabled:m},!(!s&&!o)&&Object(c.createElement)("legend",{className:"screen-reader-text"},s||o),!!o&&Object(c.createElement)(r,{title:o,stepHeadingContent:p()}),Object(c.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!i&&Object(c.createElement)("p",{className:"wc-block-components-checkout-step__description"},i),Object(c.createElement)("div",{className:"wc-block-components-checkout-step__content"},l)))}},327:function(e,t,n){"use strict";var c=n(13),o=n.n(c),a=n(0),s=n(5),r=n.n(s);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:n=null,alt:c=""}=e;return n?Object(a.createElement)("img",{className:i(t),src:n,alt:c}):null},m=n(55);const d=[{id:"alipay",alt:"Alipay",src:m.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:m.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:m.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:m.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:m.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:m.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:m.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:m.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:m.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:m.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:m.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:m.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:m.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:m.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:m.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:m.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:m.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:m.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:m.m+"payment-methods/wechat.svg"}];var p=n(26);n(304),t.a=e=>{let{icons:t=[],align:n="center",className:c}=e;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&&Object(p.a)(n.id)&&!t[n.id]&&(t[n.id]=n)}),Object.values(t)})(t);if(0===s.length)return null;const i=r()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===n,"wc-block-components-payment-method-icons--align-right":"right"===n},c);return Object(a.createElement)("div",{className:i},s.map(e=>{const t={...e,...(n=e.id,d.find(e=>e.id===n)||{})};var n;return Object(a.createElement)(l,o()({key:"payment-method-icon-"+e.id},t))}))}},334:function(e,t,n){"use strict";var c=n(0),o=n(12);const a=Object(c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=a},374:function(e,t){},375:function(e,t,n){"use strict";var c=n(18),o=n.n(c),a=n(0),s=n(1),r=n(2),i=n(11),l=n(45);class m extends a.Component{constructor(){super(...arguments),o()(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=Object(s.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(n||r.CURRENT_USER_IS_ADMIN)&&(e=t||Object(s.__)("There was an error with this payment method. Please verify it's configured correctly.","woocommerce"));const c=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(a.createElement)(i.StoreNoticesContainer,{additionalNotices:c,context:l.d.PAYMENTS})}return this.props.children}}m.defaultProps={isEditor:!1},t.a=m},447:function(e,t){},457:function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var c=n(1),o=n(41),a=n(0),s=n(5),r=n.n(s),i=n(12),l=Object(a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(a.createElement)("path",{d:"M0 0h24v24H0z"}),Object(a.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"}),Object(a.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"}))),m=Object(a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(i.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"})),d=Object(a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(i.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"})),p=Object(a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(i.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"})),u=n(81),b=n(26),h=n(20);n(374);const g={bank:m,bill:d,card:p,checkPayment:l};var v=e=>{let{icon:t="",text:n=""}=e;const c=!!t,o=Object(a.useCallback)(e=>c&&Object(b.a)(e)&&Object(h.b)(g,e),[c]),s=r()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":c});return Object(a.createElement)("span",{className:s},o(t)?Object(a.createElement)(u.a,{icon:g[t]}):t,n)},O=n(327),y=n(2),j=n(17),E=n.n(j),k=n(144),w=n(6),_=n(3),S=n(11),f=n(42),P=n(303),C=n(45),N=n(73),M=n(118),R=n(74);const T=(e,t)=>{const n=[],o=(t,n)=>{const c=n+"_tax",o=Object(h.b)(e,n)&&Object(b.a)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:o,valueWithTax:o+(Object(h.b)(e,c)&&Object(b.a)(e[c])?parseInt(e[c],10):0)}};return n.push(o(Object(c.__)("Subtotal:","woocommerce"),"total_items")),n.push(o(Object(c.__)("Fees:","woocommerce"),"total_fees")),n.push(o(Object(c.__)("Discount:","woocommerce"),"total_discount")),n.push({key:"total_tax",label:Object(c.__)("Taxes:","woocommerce"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(o(Object(c.__)("Shipping:","woocommerce"),"total_shipping")),n};var x=n(116);const A=()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:n,onCheckoutAfterProcessingWithError:s,onSubmit:r,onCheckoutSuccess:i,onCheckoutFail:l,onCheckoutValidation:m}=Object(N.b)(),{isCalculating:d,isComplete:p,isIdle:u,isProcessing:b,customerId:h}=Object(w.useSelect)(e=>{const t=e(_.CHECKOUT_STORE_KEY);return{isComplete:t.isComplete(),isIdle:t.isIdle(),isProcessing:t.isProcessing(),customerId:t.getCustomerId(),isCalculating:t.isCalculating()}}),{paymentStatus:g,activePaymentMethod:j,shouldSavePayment:A}=Object(w.useSelect)(e=>{const t=e(_.PAYMENT_STORE_KEY);return{paymentStatus:{get isPristine(){return E()("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 E()("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 E()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()},get isSuccessful(){return E()("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:I}=Object(w.useDispatch)(_.PAYMENT_STORE_KEY),{onPaymentProcessing:D,onPaymentSetup:z}=Object(M.b)(),{shippingErrorStatus:V,shippingErrorTypes:L,onShippingRateSuccess:Y,onShippingRateFail:F,onShippingRateSelectSuccess:$,onShippingRateSelectFail:B}=Object(R.b)(),{shippingRates:K,isLoadingRates:H,selectedRates:W,isSelectingRate:G,selectShippingRate:U,needsShipping:J}=Object(x.a)(),{billingAddress:q,shippingAddress:Q}=Object(w.useSelect)(e=>e(_.CART_STORE_KEY).getCustomerData()),{setShippingAddress:X}=Object(w.useDispatch)(_.CART_STORE_KEY),{cartItems:Z,cartFees:ee,cartTotals:te,extensions:ne}=Object(f.a)(),{appliedCoupons:ce}=Object(P.a)(),oe=Object(a.useRef)(T(te,J)),ae=Object(a.useRef)({label:Object(c.__)("Total","woocommerce"),value:parseInt(te.total_price,10)});Object(a.useEffect)(()=>{oe.current=T(te,J),ae.current={label:Object(c.__)("Total","woocommerce"),value:parseInt(te.total_price,10)}},[te,J]);const se=Object(a.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";E()("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"}),I(e)}),[I]);return{activePaymentMethod:j,billing:{appliedCoupons:ce,billingAddress:q,billingData:q,cartTotal:ae.current,cartTotalItems:oe.current,currency:Object(o.getCurrencyFromPriceResponse)(te),customerId:h,displayPricesIncludingTax:Object(y.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:Z,cartFees:ee,extensions:ne},checkoutStatus:{isCalculating:d,isComplete:p,isIdle:u,isProcessing:b},components:{LoadingMask:k.a,PaymentMethodIcons:O.a,PaymentMethodLabel:v,ValidationInputError:S.ValidationInputError},emitResponse:{noticeContexts:C.d,responseTypes:C.e},eventRegistration:{onCheckoutAfterProcessingWithError:s,onCheckoutAfterProcessingWithSuccess:n,onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutSuccess:i,onCheckoutFail:l,onCheckoutValidation:m,onPaymentProcessing:D,onPaymentSetup:z,onShippingRateFail:F,onShippingRateSelectFail:B,onShippingRateSelectSuccess:$,onShippingRateSuccess:Y},onSubmit:r,paymentStatus:g,setExpressPaymentError:se,shippingData:{isSelectingRate:G,needsShipping:J,selectedRates:W,setSelectedRates:U,setShippingAddress:X,shippingAddress:Q,shippingRates:K,shippingRatesLoading:H},shippingStatus:{shippingErrorStatus:V,shippingErrorTypes:L},shouldSavePayment:A}}},494:function(e,t,n){"use strict";n.r(t);var c=n(0),o=n(5),a=n.n(o),s=n(42),r=n(142),i=n(310),l=n(6),m=n(3),d=n(11),p=n(45),u=n(1),b=n(21),h=n(286);n(447);var g=()=>Object(c.createElement)(h.a,{isDismissible:!1,className:"wc-block-checkout__no-payment-methods-notice",status:"error"},Object(u.__)("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")),v=n(457),O=n(72),y=n(49),j=n(10),E=n(277),k=Object(j.withInstanceId)(e=>{let{className:t,instanceId:n,id:o,selected:s,onChange:r,options:i=[]}=e;const l=o||n;return i.length?Object(c.createElement)("div",{className:a()("wc-block-components-radio-control",t)},i.map(e=>{const t="object"==typeof e&&"content"in e,n=e.value===s;return Object(c.createElement)("div",{className:"wc-block-components-radio-control-accordion-option",key:e.value},Object(c.createElement)(E.a,{name:"radio-control-"+l,checked:n,option:e,onChange:t=>{r(t),"function"==typeof e.onChange&&e.onChange(t)}}),t&&n&&Object(c.createElement)("div",{className:a()("wc-block-components-radio-control-accordion-content",{"wc-block-components-radio-control-accordion-content-hide":!n})},e.content))})):null}),w=n(25),_=n(375),S=e=>{let{children:t,showSaveOption:n}=e;const{isEditor:o}=Object(y.a)(),{shouldSavePaymentMethod:a,customerId:s}=Object(l.useSelect)(e=>{const t=e(m.PAYMENT_STORE_KEY),n=e(m.CHECKOUT_STORE_KEY);return{shouldSavePaymentMethod:t.getShouldSavePaymentMethod(),customerId:n.getCustomerId()}}),{__internalSetShouldSavePaymentMethod:r}=Object(l.useDispatch)(m.PAYMENT_STORE_KEY);return Object(c.createElement)(_.a,{isEditor:o},t,s>0&&n&&Object(c.createElement)(d.CheckboxControl,{className:"wc-block-components-payment-methods__save-card-info",label:Object(u.__)("Save payment information to my account for future purchases.","woocommerce"),checked:a,onChange:()=>r(!a)}))},f=n(103),P=()=>{const{activeSavedToken:e,activePaymentMethod:t,isExpressPaymentMethodActive:n,savedPaymentMethods:o,availablePaymentMethods:s}=Object(l.useSelect)(e=>{const t=e(f.a);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),savedPaymentMethods:t.getSavedPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}}),{__internalSetActivePaymentMethod:r}=Object(l.useDispatch)(f.a),i=Object(w.getPaymentMethods)(),{...m}=Object(v.a)(),{removeNotice:d}=Object(l.useDispatch)("core/notices"),{dispatchCheckoutEvent:u}=Object(O.a)(),{isEditor:b}=Object(y.a)(),h=Object.keys(s).map(e=>{const{edit:t,content:n,label:o,supports:a}=i[e],s=b?t:n;return{value:e,label:"string"==typeof o?o:Object(c.cloneElement)(o,{components:m.components}),name:"wc-saved-payment-method-token-"+e,content:Object(c.createElement)(S,{showSaveOption:a.showSaveOption},Object(c.cloneElement)(s,{__internalSetActivePaymentMethod:r,...m}))}}),g=Object(c.useCallback)(e=>{r(e),d("wc-payment-error",p.d.PAYMENTS),u("set-active-payment-method",{value:e})},[u,d,r]),j=0===Object.keys(o).length&&1===Object.keys(i).length,E=a()({"disable-radio-control":j});return n?null:Object(c.createElement)(k,{id:"wc-payment-method-options",className:E,selected:e?null:t,onChange:g,options:h})},C=n(285);const N=e=>{let{method:t,expires:n}=e;return Object(u.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. */ Object(u.__)("%1$s ending in %2$s (expires %3$s)","woocommerce"),t.brand,t.last4,n)},M=e=>{let{method:t}=e;return t.brand&&t.last4?Object(u.sprintf)( /* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */ Object(u.__)("%1$s ending in %2$s","woocommerce"),t.brand,t.last4):Object(u.sprintf)( /* translators: %s is the name of the payment method gateway. */ Object(u.__)("Saved token for %s","woocommerce"),t.gateway)};var R=()=>{var e,t;const{activeSavedToken:n,activePaymentMethod:o,savedPaymentMethods:a}=Object(l.useSelect)(e=>{const t=e(m.PAYMENT_STORE_KEY);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),savedPaymentMethods:t.getSavedPaymentMethods()}}),{__internalSetActivePaymentMethod:s}=Object(l.useDispatch)(m.PAYMENT_STORE_KEY),r=Object(w.getPaymentMethods)(),i=Object(v.a)(),{removeNotice:d}=Object(l.useDispatch)("core/notices"),{dispatchCheckoutEvent:u}=Object(O.a)(),b=Object(c.useMemo)(()=>Object.keys(a).flatMap(e=>a[e].map(t=>{const n="cc"===e||"echeck"===e,c=t.method.gateway;return{name:"wc-saved-payment-method-token-"+c,label:n?N(t):M(t),value:t.tokenId.toString(),onChange:e=>{s(c,{token:e,payment_method:c,[`wc-${c}-payment-token`]:e.toString(),isSavedToken:!0}),d("wc-payment-error",p.d.PAYMENTS),u("set-active-payment-method",{paymentMethodSlug:c})}}})).filter(Boolean),[a,s,d,u]),h=n&&r[o]&&null!==(e=r[o])&&void 0!==e&&e.savedTokenComponent?Object(c.cloneElement)(null===(t=r[o])||void 0===t?void 0:t.savedTokenComponent,{token:n,...i}):null;return b.length>0?Object(c.createElement)(c.Fragment,null,Object(c.createElement)(C.a,{id:"wc-payment-method-saved-tokens",selected:n,options:b,onChange:()=>{}}),h):null},T=()=>{const{paymentMethodsInitialized:e,availablePaymentMethods:t,savedPaymentMethods:n}=Object(l.useSelect)(e=>{const t=e(m.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),availablePaymentMethods:t.getAvailablePaymentMethods(),savedPaymentMethods:t.getSavedPaymentMethods()}});return e&&0===Object.keys(t).length?Object(c.createElement)(g,null):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(R,null),Object.keys(n).length>0&&Object(c.createElement)(b.a,{label:Object(u.__)("Use another payment method.","woocommerce"),screenReaderLabel:Object(u.__)("Other available payment methods","woocommerce"),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),Object(c.createElement)(P,null))},x=()=>Object(c.createElement)(T,null),A=n(283),I={...Object(A.a)({defaultTitle:Object(u.__)("Payment options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};t.default=Object(r.withFilteredAttributes)(I)(e=>{let{title:t,description:n,showStepNumber:o,children:r,className:u}=e;const b=Object(l.useSelect)(e=>e(m.CHECKOUT_STORE_KEY).isProcessing()),{cartNeedsPayment:h}=Object(s.a)();return h?Object(c.createElement)(i.a,{id:"payment-method",disabled:b,className:a()("wc-block-checkout__payment-method",u),title:t,description:n,showStepNumber:o},Object(c.createElement)(d.StoreNoticesContainer,{context:p.d.PAYMENTS}),Object(c.createElement)(x,null),r):null})}}]);