geno/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/checkout-blocks/payment-frontend.js
2024-02-01 11:54:18 +00:00

6 lines
No EOL
45 KiB
JavaScript

(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[7162],{8184:(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"}))},5202:(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"}))},5032:(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"}))},5430:(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"}))},9109:(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"}))},5045:(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"}))},8214:(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"}))},4877:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var o=n(9196),s=n(9685),r=n(4184),i=n.n(r),a=(n(5482),n(4705));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))}},1333:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});var o=n(5271);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))||{}},7445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(9196),s=n(4184),r=n.n(s),i=n(2114),a=n(1333),c=n(8718);n(9086);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})})))}},2114:(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},8718:(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n(2646);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)}},2092:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var o=n(9196),s=n(4184),r=n.n(s),i=n(9832),a=n(9109),c=n(5032),l=n(8214),d=n(1984),u=n(2646),p=n(7884),m=n(9307);n(4948);const h={bank:a.Z,bill:c.Z,card:l.Z,checkPayment:i.Z},g=({icon:e="",text:t=""})=>{const n=!!e,s=(0,m.useCallback)((e=>n&&(0,u.H)(e)&&(0,p.$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)}},1193:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var o=n(9196),s=n(5736),r=n(4184),i=n.n(r),a=n(711);n(6575);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")))},6131:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var o=n(9196),s=n(4184),r=n.n(s),i=n(5736),a=n(1984),c=n(5202),l=(n(1365),n(395)),d=n(4877),u=n(2023);const p=({className:e,status:t="default",children:n,spokenMessage:s=n,onRemove:p=(()=>{}),isDismissible:m=!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":m})},(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),!!m&&(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(),p()},showTooltip:!1})))},395:(e,t,n)=>{"use strict";n.d(t,{X:()=>a,x:()=>i});var o=n(8184),s=n(5430),r=n(5045);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}}},1137:(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(4055);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:p,isRemovingCoupon:m}=(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. */
(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. */
(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:p,isRemovingCoupon:m}}},4570:(e,t,n)=>{"use strict";n.d(t,{z:()=>_});var o=n(5736),s=n(4293),r=n(9307),i=n(2092),a=n(7445),c=n(4617),l=n(7180),d=n.n(l),u=n(1193),p=n(9818),m=n(4801),h=n(711),g=n(4055),v=n(1137),f=n(6423),y=n(5999),b=n(9727),w=n(5810),E=n(3523),S=n(5027);const _=()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:n,onCheckoutAfterProcessingWithError:l,onSubmit:_,onCheckoutSuccess:k,onCheckoutFail:C,onCheckoutValidation:P}=(0,y.U)(),{isCalculating:R,isComplete:M,isIdle:x,isProcessing:A,customerId:T}=(0,p.useSelect)((e=>{const t=e(m.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,p.useSelect)((e=>{const t=e(m.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,p.useDispatch)(m.PAYMENT_STORE_KEY),{onPaymentProcessing:F,onPaymentSetup:I}=(0,b.P)(),{shippingErrorStatus:O,shippingErrorTypes:z,onShippingRateSuccess:V,onShippingRateFail:W,onShippingRateSelectSuccess:B,onShippingRateSelectFail:H}=(0,w.d)(),{shippingRates:Y,isLoadingRates:U,selectedRates:K,isSelectingRate:j,selectShippingRate:G,needsShipping:$}=(0,S.V)(),{billingAddress:q,shippingAddress:Q}=(0,p.useSelect)((e=>e(m.CART_STORE_KEY).getCustomerData())),{setShippingAddress:J}=(0,p.useDispatch)(m.CART_STORE_KEY),{cartItems:X,cartFees:ee,cartTotals:te,extensions:ne}=(0,g.b)(),{appliedCoupons:oe}=(0,v.K)(),se=(0,r.useRef)((0,E.a)(te,$)),re=(0,r.useRef)({label:(0,o.__)("Total","woocommerce"),value:parseInt(te.total_price,10)});(0,r.useEffect)((()=>{se.current=(0,E.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:k,onCheckoutFail:C,onCheckoutValidation:P,onPaymentProcessing:F,onPaymentSetup:I,onShippingRateFail:W,onShippingRateSelectFail:H,onShippingRateSelectSuccess:B,onShippingRateSuccess:V},onSubmit:_,paymentStatus:Z,setExpressPaymentError:ie,shippingData:{isSelectingRate:j,needsShipping:$,selectedRates:K,setSelectedRates:G,setShippingAddress:J,shippingAddress:Q,shippingRates:Y,shippingRatesLoading:U},shippingStatus:{shippingErrorStatus:O,shippingErrorTypes:z},shouldSavePayment:D}}},3523:(e,t,n)=>{"use strict";n.d(t,{a:()=>i});var o=n(5736),s=n(7884),r=n(2646);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}},2023:(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])}},970:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(9196),s=n(5736),r=n(9307),i=n(4617),a=n(711),c=n(6423);const l=({isEditor:e,children:t})=>{const[n]=(0,r.useState)(""),[l]=(0,r.useState)(!1);if(l){let t=(0,s.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(e||i.CURRENT_USER_IS_ADMIN)&&(t=n||(0,s.__)("There was an error with this payment method. Please verify it's configured correctly.","woocommerce"));const r=[{id:"0",content:t,isDismissible:!1,status:"error"}];return(0,o.createElement)(a.StoreNoticesContainer,{additionalNotices:r,context:c.n7.PAYMENTS})}return(0,o.createElement)(o.Fragment,null,t)}},9490:(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}})},8023:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>V});var o=n(9196),s=n(4184),r=n.n(s),i=n(4055),a=n(721),c=n(711),l=n(9818),d=n(4801),u=n(6423),p=n(5736),m=n(6131);n(7185);const h=()=>(0,o.createElement)(m.Z,{isDismissible:!1,className:"wc-block-checkout__no-payment-methods-notice",status:"error"},(0,p.__)("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(4570),v=n(5918),f=n(9307),y=n(8832),b=n(4613),w=n(3554),E=n(970);const S=({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)(E.Z,{isEditor:n},e,r>0&&t&&(0,o.createElement)(w.CheckboxControl,{className:"wc-block-components-payment-methods__save-card-info",label:(0,p.__)("Save payment information to my account for future purchases.","woocommerce"),checked:s,onChange:()=>i(!s)}))};var _=n(8110);const k=()=>{const{activeSavedToken:e,activePaymentMethod:t,isExpressPaymentMethodActive:n,savedPaymentMethods:s,availablePaymentMethods:i}=(0,l.useSelect)((e=>{const t=e(_.L);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),savedPaymentMethods:t.getSavedPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),{__internalSetActivePaymentMethod:a}=(0,l.useDispatch)(_.L),d=(0,b.getPaymentMethods)(),{...p}=(0,g.z)(),{removeNotice:m}=(0,l.useDispatch)("core/notices"),{dispatchCheckoutEvent:h}=(0,v.n)(),{isEditor:w}=(0,y._)(),E=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:p.components}),name:`wc-saved-payment-method-token-${e}`,content:(0,o.createElement)(S,{showSaveOption:r.showSaveOption},(0,f.cloneElement)(i,{__internalSetActivePaymentMethod:a,...p}))}})),k=(0,f.useCallback)((e=>{a(e),m("wc-payment-error",u.n7.PAYMENTS),h("set-active-payment-method",{value:e})}),[h,m,a]),C=0===Object.keys(s).length&&1===Object.keys(d).length,P=r()({"disable-radio-control":C});return n?null:(0,o.createElement)(c.RadioControlAccordion,{id:"wc-payment-method-options",className:P,selected:e?null:t,onChange:k,options:E})};var C=n(8519),P=(n(4617),n(4970)),R=n(3881),M=n(4950);const x="wc/store/cart",A=((0,p.__)("Unable to get cart data from the API.","woocommerce"),[]),T=[],Z={},N={cartItemsPendingQuantity:[],cartItemsPendingDelete:[],cartData:{coupons:[],shippingRates:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:"",email:""},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},D=({method:e,expires:t})=>(0,p.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. */
(0,p.__)("%1$s ending in %2$s (expires %3$s)","woocommerce"),e.brand,e.last4,t),L=({method:e})=>e.brand&&e.last4?(0,p.sprintf)(/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */
(0,p.__)("%1$s ending in %2$s","woocommerce"),e.brand,e.last4):(0,p.sprintf)(/* translators: %s is the name of the payment method gateway. */
(0,p.__)("Saved token for %s","woocommerce"),e.gateway),F=()=>{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:N.cartData.billingAddress,billingAddress:N.cartData.billingAddress,shippingAddress:N.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,P.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,P.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,b.getPaymentMethods)(),p=(0,g.z)(),{removeNotice:m}=(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?D(t):L(t),value:t.tokenId.toString(),onChange:e=>{r(s,{token:e,payment_method:s,[`wc-${s}-payment-token`]:e.toString(),isSavedToken:!0}),m("wc-payment-error",u.n7.PAYMENTS),h("set-active-payment-method",{paymentMethodSlug:s})}}})))).filter((e=>void 0!==e))}),[s,a,r,m,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,...p}):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(5012);const I=()=>{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)(F,null),Object.keys(n).length>0&&(0,o.createElement)(c.Label,{label:(0,p.__)("Use another payment method.","woocommerce"),screenReaderLabel:(0,p.__)("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)(k,null))},O=()=>(0,o.createElement)(I,null),z={...(0,n(9490).Z)({defaultTitle:(0,p.__)("Payment options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},V=(0,a.withFilteredAttributes)(z)((({title:e,description:t,showStepNumber:n,children:s,className:a})=>{const p=(0,l.useSelect)((e=>e(d.CHECKOUT_STORE_KEY).isProcessing())),{cartNeedsPayment:m}=(0,i.b)();return m?(0,o.createElement)(c.FormStep,{id:"payment-method",disabled:p,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)(O,null),s):null}))},8110:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});const o="wc/store/payment"},9832:(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"})))},4705:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var o=n(9196);n(129);const s=()=>(0,o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},5482:()=>{},9086:()=>{},4948:()=>{},6575:()=>{},1365:()=>{},7185:()=>{},5012:()=>{},129:()=>{},2444:(e,t,n)=>{"use strict";n.d(t,{T:()=>i});var o=n(4184),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}},9685:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var o=n(7462),s=n(9307),r=n(4184),i=n.n(r),a=n(2819),c=n(7180),l=n.n(c),d=n(9178),u=n(7392),p=n(7593);const m=["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:b,iconPosition:w="left",iconSize:E,showTooltip:S,tooltipPosition:_,shortcut:k,label:C,children:P,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,p,m;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!==(p=a)&&void 0!==p||(a="secondary")),s&&(null!==(m=a)&&void 0!==m||(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":!!b&&!!P,"has-icon":!!b}),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 m)T[e]=e=>{e.stopPropagation(),e.preventDefault()}}const F=!N&&(S&&C||k||!!C&&(!P||(0,a.isArray)(P)&&!P.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"]||C,"aria-describedby":O,ref:t}),b&&"left"===w&&(0,s.createElement)(u.Z,{icon:b,size:E}),R&&(0,s.createElement)(s.Fragment,null,R),b&&"right"===w&&(0,s.createElement)(u.Z,{icon:b,size:E}),P);return F?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d.Z,{text:A||C,shortcut:k,position:_},z),A&&(0,s.createElement)(p.Z,null,(0,s.createElement)("span",{id:I},A))):(0,s.createElement)(s.Fragment,null,z,A&&(0,s.createElement)(p.Z,null,(0,s.createElement)("span",{id:I},A)))}))},6658:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(7462),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))}},7392:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(7462),s=n(9307),r=n(444),i=n(6658);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}},4638:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var o=n(7462),s=n(9307),r=n(4184),i=n.n(r),a=n(5904),c=n(7180),l=n.n(c),d=n(4333),u=n(4787),p=n(4103),m=n(9685),h=n(9753),g=n(1515),v=n(6580),f=n(2444);const y="Popover";function b(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 E(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:k="bottom right",range:C,focusOnMount:P="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),U=(0,s.useRef)(),K=(0,d.useViewportMatch)("medium","<"),[j,G]=(0,s.useState)(),$=(0,g.Z)(F),q=T&&K,[Q,J]=(0,d.useResizeObserver)();c=q||c,(0,s.useLayoutEffect)((()=>{if(q)return S(U.current,"is-without-arrow",c),S(U.current,"is-alternate",_),w(U.current,"data-x-axis"),w(U.current,"data-y-axis"),E(U.current,"top"),E(U.current,"left"),E(Y.current,"maxHeight"),void E(Y.current,"maxWidth");const e=()=>{if(!U.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,p.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,p.cS)((0,a.getRectangleFromRange)(o),o.endContainer.ownerDocument,r);if("function"==typeof(null==o?void 0:o.getBoundingClientRect)){const e=(0,p.cS)(o.getBoundingClientRect(),o.ownerDocument,r);return s?e:b(e,o)}const{top:e,bottom:t}=o,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),c=(0,p.cS)(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,r);return s?c:b(c,o)}if(!e.current)return;const{parentNode:i}=e.current,c=i.getBoundingClientRect();return s?c:b(c,i)}(H,x,A,R,M,U.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=U.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=U.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:m,contentHeight:h,contentWidth:g}=(0,p.sw)(e,i,k,L,U.current,s,o,z,V);"number"==typeof l&&"number"==typeof d&&(E(U.current,"top",l+"px"),E(U.current,"left",d+"px")),S(U.current,"is-without-arrow",c||"center"===u&&"middle"===m),S(U.current,"is-alternate",_),w(U.current,"data-x-axis",u),w(U.current,"data-y-axis",m),E(Y.current,"maxHeight","number"==typeof h?h+"px":""),E(Y.current,"maxWidth","number"==typeof g?g+"px":""),G(({left:"right",right:"left"}[u]||"center")+" "+({top:"bottom",bottom:"top"}[m]||"middle"))};e();const{ownerDocument:t}=U.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,k,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:P,__unstableOnClose:X,onClose:X}),ne=(0,d.useMergeRefs)([U,ee,B]),oe=Boolean(Z&&j)&&(0,f.T)({type:"appear",origin:j});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)(m.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 k=_},4103:(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,p="center",m]=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)},p={popoverTop:e.top,contentHeight:e.top-s-l>0?l:e.top-s},m={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&&p.contentHeight===l)g="top";else if("bottom"===n&&m.contentHeight===l)g="bottom";else{g=p.contentHeight>m.contentHeight?"top":"bottom";const e="top"===g?p.contentHeight:m.contentHeight;v=e!==l?e:null}return h="middle"===g?u.popoverTop:"top"===g?p.popoverTop:m.popoverTop,{yAxis:g,popoverTop:h,contentHeight:v}}(e,t,u,m,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),p={popoverLeft:u,contentWidth:(u-d/2>0?d/2:u)+(u+d/2>window.innerWidth?window.innerWidth-u:d/2)};let m=e.left;"right"===s?m=e.right:"middle"===i||l||(m=u);let h=e.right;"left"===s?h=e.left:"middle"===i||l||(h=u);const g={popoverLeft:m,contentWidth:m-d>0?d:m},v={popoverLeft:h,contentWidth:h+d>window.innerWidth?window.innerWidth-h:d};let f,y=n,b=null;if(!r&&!c)if("center"===n&&p.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&&(b=window.innerWidth),e!==d&&(y="center",p.popoverLeft=window.innerWidth/2)}if(f="center"===y?p.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:b}}(e,t,p,m,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)}},9753:(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}},3586:(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)}},4160:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(9307),s=n(1515);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}},159:(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:()=>{}})},9934:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(7462),s=n(9307),r=n(4333),i=n(159);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))}))},1515:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9307),s=n(159);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])}}},566:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=(0,n(9307).createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}})},8198:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(7462),s=n(9307),r=n(2819),i=n(566),a=n(2009);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}))))},6580:(e,t,n)=>{"use strict";n.d(t,{de:()=>l,g7:()=>d});var o=n(7462),s=n(9307),r=n(8198),i=n(8612),a=n(4160),c=n(9934);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)))},8612:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var o=n(7462),s=n(9307),r=n(2819),i=n(566);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}))))},2009:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(9307),s=n(566);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}},9178:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var o=n(9307),s=n(2819),r=n(4333),i=n(4638),a=n(3586);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)},p=function({children:e,position:t,text:n,shortcut:c}){const[p,m]=(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),m(!0)},y=t=>{u(e,"onMouseUp",t),document.removeEventListener("mouseup",w),m(!1)},b=e=>"mouseUp"===e?y:"mouseDown"===e?f:void 0,w=b("mouseUp"),E=(t,n)=>o=>{if(u(e,t,o),o.currentTarget.disabled)return;if("focus"===o.type&&p)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:E("onMouseEnter",!0),onMouseLeave:E("onMouseLeave"),onClick:E("onClick"),onFocus:E("onFocus"),onBlur:E("onBlur"),onMouseDown:b("mouseDown")},k=o.Children.only(e),{children:C,disabled:P}=k.props,R=P?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:C,isOver:h,position:t,text:n,shortcut:c});return R({child:k,eventHandlers:_,childrenWithPopover:M})}},7593:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(4184),s=n.n(o),r=n(9307),i=n(2004);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})}))},2004:(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)}},4787:(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"}))},7462:(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})}}]);