%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/vacivi36/vittashop.com.br/wp-content/plugins/woocommerce/assets/client/blocks/
Upload File :
Create Path :
Current File : //home2/vacivi36/vittashop.com.br/wp-content/plugins/woocommerce/assets/client/blocks/cart.js

(()=>{var e,t,o,s={1895:(e,t,o)=>{"use strict";var s=o(7723),r=o(4921);const c=window.wp.blockEditor;var n=o(5573),a=o(790);const i=(0,a.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.jsx)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"})]});var l=o(4530);const d=window.wp.blocks;var m=o(6087);const u=window.wc.wcSettings,p=(0,u.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),h=p.pluginUrl+"assets/images/",g=(p.pluginUrl,u.STORE_PAGES.shop?.permalink),_=u.STORE_PAGES.checkout?.id,w=(u.STORE_PAGES.checkout,u.STORE_PAGES.privacy,u.STORE_PAGES.privacy,u.STORE_PAGES.terms,u.STORE_PAGES.terms,u.STORE_PAGES.cart?.id),k=u.STORE_PAGES.cart?.permalink,b=(u.STORE_PAGES.myaccount?.permalink?u.STORE_PAGES.myaccount.permalink:(0,u.getSetting)("wpLoginUrl","/wp-login.php"),(0,u.getSetting)("localPickupEnabled",!1)),y=((0,u.getSetting)("shippingMethodsExist",!1),(0,u.getSetting)("shippingEnabled",!0)),x=(0,u.getSetting)("countries",{}),v=(0,u.getSetting)("countryData",{}),f={...Object.fromEntries(Object.keys(v).filter((e=>!0===v[e].allowBilling)).map((e=>[e,x[e]||""]))),...Object.fromEntries(Object.keys(v).filter((e=>!0===v[e].allowShipping)).map((e=>[e,x[e]||""])))},S=(Object.fromEntries(Object.keys(f).map((e=>[e,v[e].states||{}]))),Object.fromEntries(Object.keys(f).map((e=>[e,v[e].locale||{}])))),j={address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]},C=(0,u.getSetting)("addressFieldsLocations",j).address,P=((0,u.getSetting)("addressFieldsLocations",j).contact,(0,u.getSetting)("addressFieldsLocations",j).order,(0,u.getSetting)("additionalOrderFields",{}),(0,u.getSetting)("additionalContactFields",{}),(0,u.getSetting)("additionalAddressFields",{}),({imageUrl:e=`${h}/block-error.svg`,header:t=(0,s.__)("Oops!","woocommerce"),text:o=(0,s.__)("There was an error loading the content.","woocommerce"),errorMessage:r,errorMessagePrefix:c=(0,s.__)("Error:","woocommerce"),button:n,showErrorBlock:i=!0})=>i?(0,a.jsxs)("div",{className:"wc-block-error wc-block-components-error",children:[e&&(0,a.jsx)("img",{className:"wc-block-error__image wc-block-components-error__image",src:e,alt:""}),(0,a.jsxs)("div",{className:"wc-block-error__content wc-block-components-error__content",children:[t&&(0,a.jsx)("p",{className:"wc-block-error__header wc-block-components-error__header",children:t}),o&&(0,a.jsx)("p",{className:"wc-block-error__text wc-block-components-error__text",children:o}),r&&(0,a.jsxs)("p",{className:"wc-block-error__message wc-block-components-error__message",children:[c?c+" ":"",r]}),n&&(0,a.jsx)("p",{className:"wc-block-error__button wc-block-components-error__button",children:n})]})]}):null);o(5893);class N extends m.Component{state={errorMessage:"",hasError:!1};static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:e.status}),": ",e.statusText]}),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:o=!0,showErrorBlock:s=!0,text:r,errorMessagePrefix:c,renderError:n,button:i}=this.props,{errorMessage:l,hasError:d}=this.state;return d?"function"==typeof n?n({errorMessage:l}):(0,a.jsx)(P,{showErrorBlock:s,errorMessage:o?l:null,header:e,imageUrl:t,text:r,errorMessagePrefix:c,button:i}):this.props.children}}const E=N,A=window.wp.data,I=(0,m.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})}),R=()=>(0,m.useContext)(I),B=({children:e,currentPostId:t=0,previewData:o={},currentView:s="",isPreview:r=!1})=>{const c=(0,A.useSelect)((e=>t||e("core/editor").getCurrentPostId()),[t]),n=(0,m.useCallback)(((e,t={})=>o&&e in o?o[e]:t),[o]),i={isEditor:!0,currentPostId:c,currentView:s,previewData:o,getPreviewData:n,isPreview:r};return(0,a.jsx)(I.Provider,{value:i,children:e})},T=window.wp.plugins,D=window.wc.wcBlocksData;var M=o(4040),O=o.n(M);let L=function(e){return e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback",e}({});const F={},V=(e=F,{type:t,eventType:o,id:s,callback:r,priority:c})=>{const n=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(t){case L.ADD_EVENT_CALLBACK:return n.set(s,{priority:c,callback:r}),{...e,[o]:n};case L.REMOVE_EVENT_CALLBACK:return n.delete(s),{...e,[o]:n}}},H=(e,t)=>(o,s=10)=>{const r=((e,t,o=10)=>({id:Math.floor(Math.random()*Date.now()).toString(),type:L.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:o}))(e,o,s);return t(r),()=>{var o;t((o=e,{id:r.id,type:L.REMOVE_EVENT_CALLBACK,eventType:o}))}},z=(0,m.createContext)({onPaymentProcessing:()=>()=>()=>{},onPaymentSetup:()=>()=>()=>{}}),U=({children:e})=>{const{isProcessing:t,isIdle:o,isCalculating:s,hasError:r}=(0,A.useSelect)((e=>{const t=e(D.checkoutStore);return{isProcessing:t.isProcessing(),isIdle:t.isIdle(),hasError:t.hasError(),isCalculating:t.isCalculating()}})),{isPaymentReady:c}=(0,A.useSelect)((e=>{const t=e(D.paymentStore);return{isPaymentProcessing:t.isPaymentProcessing(),isPaymentReady:t.isPaymentReady()}})),{setValidationErrors:n}=(0,A.useDispatch)(D.validationStore),[i,l]=(0,m.useReducer)(V,{}),{onPaymentSetup:d}=(e=>(0,m.useMemo)((()=>({onPaymentSetup:H("payment_setup",e)})),[e]))(l),u=(0,m.useRef)(i);(0,m.useEffect)((()=>{u.current=i}),[i]);const{__internalSetPaymentProcessing:p,__internalSetPaymentIdle:h,__internalEmitPaymentProcessingEvent:g}=(0,A.useDispatch)(D.paymentStore);(0,m.useEffect)((()=>{!t||r||s||(p(),g(u.current,n))}),[t,r,s,p,g,n]),(0,m.useEffect)((()=>{o&&!c&&h()}),[o,c,h]),(0,m.useEffect)((()=>{r&&c&&h()}),[r,c,h]);const _={onPaymentProcessing:(0,m.useMemo)((()=>function(...e){return O()("onPaymentProcessing",{alternative:"onPaymentSetup",plugin:"WooCommerce Blocks"}),d(...e)}),[d]),onPaymentSetup:d};return(0,a.jsx)(z.Provider,{value:_,children:e})},$={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},W={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},q={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:e=>e,shippingErrorTypes:$,onShippingRateSuccess:()=>()=>{},onShippingRateFail:()=>()=>{},onShippingRateSelectSuccess:()=>()=>{},onShippingRateSelectFail:()=>()=>{}},Y=(e,{type:t})=>Object.values($).includes(t)?t:e,X="shipping_rates_success",G="shipping_rates_fail",J="shipping_rate_select_success",Q="shipping_rate_select_fail",K=e=>({onSuccess:H(X,e),onFail:H(G,e),onSelectSuccess:H(J,e),onSelectFail:H(Q,e)}),Z=window.wc.wcTypes;let ee=function(e){return e.CART="wc/cart",e.CHECKOUT="wc/checkout",e.PAYMENTS="wc/checkout/payments",e.EXPRESS_PAYMENTS="wc/checkout/express-payments",e.CONTACT_INFORMATION="wc/checkout/contact-information",e.SHIPPING_ADDRESS="wc/checkout/shipping-address",e.BILLING_ADDRESS="wc/checkout/billing-address",e.SHIPPING_METHODS="wc/checkout/shipping-methods",e.CHECKOUT_ACTIONS="wc/checkout/checkout-actions",e.ORDER_INFORMATION="wc/checkout/order-information",e}({});const te=async(e,t,o)=>{const s=((e,t)=>e[t]?Array.from(e[t].values()).sort(((e,t)=>e.priority-t.priority)):[])(e,t),r=[];for(const e of s)try{const t=await Promise.resolve(e.callback(o));"object"==typeof t&&r.push(t)}catch(e){console.error(e)}return!r.length||r};var oe=o(1824),se=o.n(oe);const re=window.wp.htmlEntities,ce=Object.entries(S).reduce(((e,[t,o])=>(e[t]=Object.entries(o).reduce(((e,[t,o])=>(e[t]=(e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=(0,s.sprintf)(/* translators: %s Field label. */ /* translators: %s Field label. */
(0,s.__)("%s (optional)","woocommerce"),e.label)),e.index&&((0,Z.isNumber)(e.index)&&(t.index=e.index),(0,Z.isString)(e.index)&&(t.index=parseInt(e.index,10))),e.hidden&&(t.required=!1),t})(o),e)),{}),e)),{}),ne=e=>{const t=((e,t,o="")=>{const s=o&&void 0!==ce[o]?ce[o]:{};return e.map((e=>({key:e,...t&&e in t?t[e]:{},...s&&e in s?s[e]:{}}))).sort(((e,t)=>e.index-t.index))})(C,u.defaultFields,e.country),o=Object.assign({},e);return t.forEach((({key:t,hidden:s})=>{!0===s&&((e,t)=>e in t)(t,e)&&(o[t]="")})),o},ae=window.CustomEvent||null,ie=(e,t,o=!1,s=!1)=>{if("function"!=typeof jQuery)return()=>{};const r=()=>{((e,{bubbles:t=!1,cancelable:o=!1,element:s,detail:r={}})=>{if(!ae)return;s||(s=document.body);const c=new ae(e,{bubbles:t,cancelable:o,detail:r});s.dispatchEvent(c)})(t,{bubbles:o,cancelable:s})};return jQuery(document).on(e,r),()=>jQuery(document).off(e,r)},le=e=>{const t=e?.detail;t&&t.preserveCartData||(0,A.dispatch)(D.cartStore).invalidateResolutionForStore()},de=e=>{(e?.persisted||"back_forward"===(window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:""))&&(0,A.dispatch)(D.cartStore).invalidateResolutionForStore()},me=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},ue={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},pe={...ue,email:""},he={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:D.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},ge=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,re.decodeEntities)(t)]))),_e={cartCoupons:D.EMPTY_CART_COUPONS,cartItems:D.EMPTY_CART_ITEMS,cartFees:D.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:D.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:D.EMPTY_CART_ITEM_ERRORS,cartTotals:he,cartIsLoading:!0,cartErrors:D.EMPTY_CART_ERRORS,billingData:pe,billingAddress:pe,shippingAddress:ue,shippingRates:D.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentMethods:D.EMPTY_PAYMENT_METHODS,paymentRequirements:D.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},receiveCartContents:()=>{},extensions:D.EMPTY_EXTENSIONS},we=(e={shouldSelect:!0})=>{const{shouldSelect:t}=e,o=(0,m.useRef)(),s=(0,m.useRef)(pe),r=(0,m.useRef)(ue);(0,m.useEffect)((()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),window.wcBlocksStoreCartListeners?.count>0)return void window.wcBlocksStoreCartListeners.count++;document.body.addEventListener("wc-blocks_added_to_cart",le),document.body.addEventListener("wc-blocks_removed_from_cart",le),window.addEventListener("pageshow",de);const e=ie("added_to_cart","wc-blocks_added_to_cart"),t=ie("removed_from_cart","wc-blocks_removed_from_cart");window.wcBlocksStoreCartListeners.count=1,window.wcBlocksStoreCartListeners.remove=()=>{document.body.removeEventListener("wc-blocks_added_to_cart",le),document.body.removeEventListener("wc-blocks_removed_from_cart",le),window.removeEventListener("pageshow",de),e(),t()}})(),me)),[]);const{receiveCart:c,receiveCartContents:n}=(0,A.useDispatch)(D.cartStore),{cartData:a,cartErrors:i,cartTotals:l,cartIsLoading:d,isLoadingRates:u}=(0,A.useSelect)((e=>{const t=e(D.cartStore);return{cartData:t.getCartData(),cartErrors:t.getCartErrors(),cartTotals:t.getCartTotals(),cartIsLoading:!t.hasFinishedResolution("getCartData"),isLoadingRates:t.isAddressFieldsForShippingRatesUpdating()}}),[]);if(!t)return _e;const p=ne(ge(a.billingAddress));se()(s.current,p)||(s.current=p);const h=s.current,g=a.needsShipping?ne(ge(a.shippingAddress)):h;se()(r.current,g)||(r.current=g);const _=r.current,w={cartCoupons:a.coupons.length>0?a.coupons.map((e=>({...e,label:(0,re.decodeEntities)(e.code)}))):D.EMPTY_CART_COUPONS,cartItems:a.items,crossSellsProducts:a.crossSells,cartFees:a.fees.length>0?a.fees.map((e=>ge(e))):D.EMPTY_CART_FEES,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:d,cartErrors:i,billingData:h,billingAddress:h,shippingAddress:_,extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:u,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,paymentMethods:a.paymentMethods,receiveCart:c,receiveCartContents:n};return o.current&&se()(o.current,w)||(o.current=w),o.current},ke=(0,u.getSetting)("collectableMethodIds",[]),be=e=>!!b&&(Array.isArray(e)?!!e.find((e=>ke.includes(e))):ke.includes(e)),ye=e=>!!(e=>e.some((e=>!!e.shipping_rates.length)))(e)&&e.some((e=>e.shipping_rates.some((e=>e.selected)))),xe=e=>Array.from(new Set(e.flatMap((e=>e.shipping_rates.filter((e=>e.selected)).map((e=>e.name))))));var ve=o(923),fe=o.n(ve);const Se=window.wp.hooks,je=()=>({dispatchStoreEvent:(0,m.useCallback)(((e,t={})=>{try{(0,Se.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,m.useCallback)(((e,t={})=>{try{(0,Se.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,A.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])}),Ce=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:o,isLoadingRates:s,isCollectable:r,isSelectingRate:c}=(0,A.useSelect)((e=>{const t=e(D.cartStore),o=t.getShippingRates();return{shippingRates:o,needsShipping:t.getNeedsShipping(),hasCalculatedShipping:t.getHasCalculatedShipping(),isLoadingRates:t.isAddressFieldsForShippingRatesUpdating(),isCollectable:o.every((({shipping_rates:e})=>e.find((({method_id:e})=>be(e))))),isSelectingRate:t.isShippingRateBeingSelected()}}),[]),n=(0,m.useRef)({});(0,m.useEffect)((()=>{const t=(e=>Object.fromEntries(e.map((({package_id:e,shipping_rates:t})=>[e,t.find((e=>e.selected))?.rate_id||""]))))(e);(0,Z.isObject)(t)&&!fe()(n.current,t)&&(n.current=t)}),[e]);const{selectShippingRate:a}=(0,A.useDispatch)(D.cartStore),i=be(Object.values(n.current).map((e=>e.split(":")[0]))),{dispatchCheckoutEvent:l}=je(),d=(0,m.useCallback)(((e,t)=>{let o;void 0!==e&&(o=be(e.split(":")[0])?a(e,null):a(e,t),o.then((()=>{l("set-selected-shipping-rate",{shippingRateId:e})})).catch((e=>{(0,D.processErrorResponse)(e)})))}),[a,l]);return{isSelectingRate:c,selectedRates:n.current,selectShippingRate:d,shippingRates:e,needsShipping:t,hasCalculatedShipping:o,isLoadingRates:s,isCollectable:r,hasSelectedLocalPickup:i}},{NONE:Pe,INVALID_ADDRESS:Ne,UNKNOWN:Ee}=$,Ae=(0,m.createContext)(q),Ie=()=>(0,m.useContext)(Ae),Re=({children:e})=>{const{__internalStartCalculation:t,__internalFinishCalculation:o}=(0,A.useDispatch)(D.checkoutStore),{shippingRates:s,isLoadingRates:r,cartErrors:c}=we(),{selectedRates:n,isSelectingRate:i}=Ce(),[l,d]=(0,m.useReducer)(Y,Pe),[u,p]=(0,m.useReducer)(V,{}),h=(0,m.useRef)(u),g=(0,m.useMemo)((()=>({onShippingRateSuccess:K(p).onSuccess,onShippingRateFail:K(p).onFail,onShippingRateSelectSuccess:K(p).onSelectSuccess,onShippingRateSelectFail:K(p).onSelectFail})),[p]);(0,m.useEffect)((()=>{h.current=u}),[u]),(0,m.useEffect)((()=>{r?t():o()}),[r,t,o]),(0,m.useEffect)((()=>{i?t():o()}),[t,o,i]),(0,m.useEffect)((()=>{c.length>0&&c.some((e=>!(!e.code||!Object.values(W).includes(e.code))))?d({type:Ne}):d({type:Pe})}),[c]);const _=(0,m.useMemo)((()=>({isPristine:l===Pe,isValid:l===Pe,hasInvalidAddress:l===Ne,hasError:l===Ee||l===Ne})),[l]);(0,m.useEffect)((()=>{r||0!==s.length&&!_.hasError||te(h.current,G,{hasInvalidAddress:_.hasInvalidAddress,hasError:_.hasError})}),[s,r,_.hasError,_.hasInvalidAddress]),(0,m.useEffect)((()=>{!r&&s.length>0&&!_.hasError&&te(h.current,X,s)}),[s,r,_.hasError]),(0,m.useEffect)((()=>{i||(_.hasError?te(h.current,Q,{hasError:_.hasError,hasInvalidAddress:_.hasInvalidAddress}):te(h.current,J,n.current))}),[n,i,_.hasError,_.hasInvalidAddress]);const w={shippingErrorStatus:_,dispatchErrorStatus:d,shippingErrorTypes:$,...g};return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(Ae.Provider,{value:w,children:e})})};function Be(e,t){const o=(0,m.useRef)();return(0,m.useEffect)((()=>{o.current===e||t&&!t(e,o.current)||(o.current=e)}),[e,t]),o.current}const Te=window.wp.notices,De=window.wc.blocksCheckoutEvents,Me={},Oe={},Le=()=>Me,Fe=()=>Oe,Ve=(0,m.createContext)({onSubmit:()=>{},onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},onCheckoutSuccess:()=>()=>{},onCheckoutFail:()=>()=>{},onCheckoutValidation:()=>()=>{}}),He=({children:e,redirectUrl:t})=>{const o=Le(),s=Fe(),{isEditor:r}=R(),{__internalUpdateAvailablePaymentMethods:c}=(0,A.useDispatch)(D.paymentStore);(0,m.useEffect)((()=>{(r||0!==Object.keys(o).length||0!==Object.keys(s).length)&&c()}),[r,o,s,c]);const{__internalSetRedirectUrl:n,__internalEmitValidateEvent:i,__internalEmitAfterProcessingEvents:l,__internalSetBeforeProcessing:d}=(0,A.useDispatch)(D.checkoutStore),{checkoutRedirectUrl:u,checkoutStatus:p,isCheckoutBeforeProcessing:h,isCheckoutAfterProcessing:g,checkoutHasError:_,checkoutOrderId:w,checkoutOrderNotes:k,checkoutCustomerId:b}=(0,A.useSelect)((e=>{const t=e(D.checkoutStore);return{checkoutRedirectUrl:t.getRedirectUrl(),checkoutStatus:t.getCheckoutStatus(),isCheckoutBeforeProcessing:t.isBeforeProcessing(),isCheckoutAfterProcessing:t.isAfterProcessing(),checkoutHasError:t.hasError(),checkoutOrderId:t.getOrderId(),checkoutOrderNotes:t.getOrderNotes(),checkoutCustomerId:t.getCustomerId()}}));t&&t!==u&&n(t);const{setValidationErrors:y}=(0,A.useDispatch)(D.validationStore),{dispatchCheckoutEvent:x}=je(),v=Object.values(ee).filter((e=>e!==ee.PAYMENTS&&e!==ee.EXPRESS_PAYMENTS)),f=(0,A.useSelect)((e=>{const{getNotices:t}=e(Te.store);return v.reduce(((e,o)=>[...e,...t(o)]),[])}),[v]),{paymentNotices:S,expressPaymentNotices:j}=(0,A.useSelect)((e=>{const{getNotices:t}=e(Te.store);return{paymentNotices:t(ee.PAYMENTS),expressPaymentNotices:t(ee.EXPRESS_PAYMENTS)}}),[]),[C]=(0,m.useReducer)(V,{}),P=(0,m.useRef)(C),{onCheckoutValidation:N,onCheckoutSuccess:E,onCheckoutFail:I}=De.checkoutEvents;(0,m.useEffect)((()=>{P.current=C}),[C]);const B=(0,m.useMemo)((()=>function(...e){return O()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks"}),N(...e)}),[N]),T=(0,m.useMemo)((()=>function(...e){return O()("onCheckoutValidationBeforeProcessing",{since:"9.7.0",alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),N(...e)}),[N]),M=(0,m.useMemo)((()=>function(...e){return O()("onCheckoutAfterProcessingWithSuccess",{since:"9.7.0",alternative:"onCheckoutSuccess",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),E(...e)}),[E]),L=(0,m.useMemo)((()=>function(...e){return O()("onCheckoutAfterProcessingWithError",{since:"9.7.0",alternative:"onCheckoutFail",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),I(...e)}),[I]);(0,m.useEffect)((()=>{h&&i({setValidationErrors:y})}),[h,y,i]);const F=Be(p),H=Be(_);(0,m.useEffect)((()=>{p===F&&_===H||g&&l({notices:{checkoutNotices:f,paymentNotices:S,expressPaymentNotices:j}})}),[p,_,u,w,b,k,g,h,F,H,f,j,S,i,l]);const z={onSubmit:(0,m.useCallback)((()=>{x("submit"),d()}),[x,d]),onCheckoutBeforeProcessing:B,onCheckoutValidationBeforeProcessing:T,onCheckoutAfterProcessingWithSuccess:M,onCheckoutAfterProcessingWithError:L,onCheckoutSuccess:E,onCheckoutFail:I,onCheckoutValidation:N};return(0,a.jsx)(Ve.Provider,{value:z,children:e})},ze=window.wp.apiFetch;var Ue=o.n(ze);(0,s.__)("Something went wrong. Please contact us to get assistance.","woocommerce");const $e=window.wc.wcBlocksRegistry,We=(e,t,o)=>{const s=Object.keys(e).map((t=>({key:t,value:e[t]})),[]),r=`wc-${o}-new-payment-method`;return s.push({key:r,value:t}),s},qe=e=>{if(!e)return;const{__internalSetCustomerId:t}=(0,A.dispatch)(D.checkoutStore);Ue().setNonce&&"function"==typeof Ue().setNonce&&Ue().setNonce(e),Ue().setCartHash&&"function"==typeof Ue().setCartHash&&Ue().setCartHash(e),e?.get("User-ID")&&t(parseInt(e.get("User-ID")||"0",10))},Ye=()=>{const{onCheckoutValidation:e}=De.checkoutEvents,{additionalFields:t,customerId:o,customerPassword:r,extensionData:c,hasError:n,isBeforeProcessing:a,isComplete:i,isProcessing:l,orderNotes:d,redirectUrl:p,shouldCreateAccount:h}=(0,A.useSelect)((e=>{const t=e(D.checkoutStore);return{additionalFields:t.getAdditionalFields(),customerId:t.getCustomerId(),customerPassword:t.getCustomerPassword(),extensionData:t.getExtensionData(),hasError:t.hasError(),isBeforeProcessing:t.isBeforeProcessing(),isComplete:t.isComplete(),isProcessing:t.isProcessing(),orderNotes:t.getOrderNotes(),redirectUrl:t.getRedirectUrl(),shouldCreateAccount:t.getShouldCreateAccount()}}),[]),{__internalSetHasError:g,__internalProcessCheckoutResponse:_}=(0,A.useDispatch)(D.checkoutStore),w=(0,A.useSelect)((e=>e(D.validationStore).hasValidationErrors),[]),{shippingErrorStatus:k}=Ie(),{shippingAddress:b,billingAddress:y,useBillingAsShipping:x}=(()=>{const{isEditor:e,getPreviewData:t}=R(),{needsShipping:o}=Ce(),{useShippingAsBilling:s,prefersCollection:r,editingBillingAddress:c,editingShippingAddress:n}=(0,A.useSelect)((e=>({useShippingAsBilling:e(D.checkoutStore).getUseShippingAsBilling(),prefersCollection:e(D.checkoutStore).prefersCollection(),editingBillingAddress:e(D.checkoutStore).getEditingBillingAddress(),editingShippingAddress:e(D.checkoutStore).getEditingShippingAddress()}))),{__internalSetUseShippingAsBilling:a,setEditingBillingAddress:i,setEditingShippingAddress:l}=(0,A.useDispatch)(D.checkoutStore),{billingAddress:d,setBillingAddress:p,shippingAddress:h,setShippingAddress:g}=(()=>{const{customerData:e,isInitialized:t}=(0,A.useSelect)((e=>{const t=e(D.cartStore);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}})),{setShippingAddress:o,setBillingAddress:s}=(0,A.useDispatch)(D.cartStore);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:s,setShippingAddress:o}})(),_=(0,m.useCallback)((e=>{p({email:e})}),[p]),w=(0,u.getSetting)("forcedBillingAddress",!1);return{shippingAddress:h,billingAddress:d,setShippingAddress:g,setBillingAddress:p,setEmail:_,defaultFields:e?t("defaultFields",u.defaultFields):u.defaultFields,useShippingAsBilling:s,setUseShippingAsBilling:a,editingBillingAddress:c,editingShippingAddress:n,setEditingBillingAddress:i,setEditingShippingAddress:l,needsShipping:o,showShippingFields:!w&&o&&!r,showShippingMethods:o&&!r,showBillingFields:!o||!s||!!r,forcedBillingAddress:w,useBillingAsShipping:w||!!r}})(),{cartNeedsPayment:v,cartNeedsShipping:f,receiveCartContents:S}=we(),{activePaymentMethod:j,paymentMethodData:C,isExpressPaymentMethodActive:P,hasPaymentError:N,isPaymentReady:E,shouldSavePayment:I}=(0,A.useSelect)((e=>{const t=e(D.paymentStore);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),hasPaymentError:t.hasPaymentError(),isPaymentReady:t.isPaymentReady(),shouldSavePayment:t.getShouldSavePaymentMethod()}}),[]),B=(0,$e.getPaymentMethods)(),T=(0,$e.getExpressPaymentMethods)(),M=(0,m.useRef)(y),O=(0,m.useRef)(b),L=(0,m.useRef)(p),[F,V]=(0,m.useState)(!1),H=(0,m.useMemo)((()=>{const e={...T,...B};return e?.[j]?.paymentMethodId}),[j,T,B]),z=w()&&!P||N||k.hasError,U=!n&&!z&&(E||!v)&&l;(0,m.useEffect)((()=>{z===n||!l&&!a||P||g(z)}),[z,n,l,a,P,g]),(0,m.useEffect)((()=>{M.current=y,O.current=b,L.current=p}),[y,b,p]);const $=(0,m.useCallback)((()=>w()?void 0!==(0,A.select)(D.validationStore).getValidationError("shipping-rates-error")&&{type:Z.responseTypes.ERROR,errorMessage:(0,s.__)("Sorry, this order requires a shipping option.","woocommerce")}:N?{type:Z.responseTypes.ERROR,errorMessage:(0,s.__)("There was a problem with your payment option.","woocommerce"),context:"wc/checkout/payments"}:!k.hasError||{type:Z.responseTypes.ERROR,errorMessage:(0,s.__)("There was a problem with your shipping option.","woocommerce"),context:"wc/checkout/shipping-methods"}),[w,N,k.hasError]);(0,m.useEffect)((()=>{let t;return P||(t=e($,0)),()=>{P||"function"!=typeof t||t()}}),[e,$,P]),(0,m.useEffect)((()=>{window.localStorage.removeItem("WOOCOMMERCE_CHECKOUT_IS_CUSTOMER_DATA_DIRTY"),L.current&&(window.location.href=L.current)}),[i]);const W=(0,m.useCallback)((async()=>{if(F)return;V(!0),(()=>{const e=(0,A.select)("wc/store/store-notices").getRegisteredContainers(),{removeNotice:t}=(0,A.dispatch)(Te.store),{getNotices:o}=(0,A.select)(Te.store);e.forEach((e=>{o(e).forEach((o=>{t(o.id,e)}))}))})();const e=v?{payment_method:H,payment_data:We(C,I,j)}:{},n=ne(M.current),a=x?n:ne(O.current),i={additional_fields:t,billing_address:n,create_account:h,customer_note:d,customer_password:r,extensions:{...c},shipping_address:f?a:void 0,...e};(0,D.clearCheckoutPutRequests)(),Ue()({path:"/wc/store/v1/checkout",method:"POST",data:i,cache:"no-store",parse:!1}).then((e=>{if((0,Z.assertResponseIsValid)(e),qe(e.headers),!e.ok)throw e;return e.json()})).then((e=>{_(e),V(!1)})).catch((e=>{qe(e?.headers);try{e.json().then((e=>e)).then((e=>{e.data?.cart&&S(e.data.cart),(0,D.processErrorResponse)(e),_(e)}))}catch{let e=(0,s.__)("Something went wrong when placing the order. Check your email for order updates before retrying.","woocommerce");0!==o&&(e=(0,s.__)("Something went wrong when placing the order. Check your account's order history or your email for order updates before retrying.","woocommerce")),(0,D.processErrorResponse)({code:"unknown_error",message:e,data:null})}g(!0),V(!1)}))}),[F,v,H,C,I,j,d,h,o,r,c,t,f,S,g,_,x]);return(0,m.useEffect)((()=>{U&&!F&&W()}),[W,U,F]),null},Xe=({children:e,redirectUrl:t})=>(0,a.jsx)(He,{redirectUrl:t,children:(0,a.jsx)(Re,{children:(0,a.jsxs)(U,{children:[e,(0,a.jsx)(E,{renderError:u.CURRENT_USER_IS_ADMIN?null:()=>null,children:(0,a.jsx)(T.PluginArea,{scope:"woocommerce-checkout"})}),(0,a.jsx)(Ye,{})]})})}),Ge=({children:e,redirectUrl:t})=>(0,a.jsx)(Xe,{redirectUrl:t,children:e}),Je={currency_code:u.SITE_CURRENCY.code,currency_symbol:u.SITE_CURRENCY.symbol,currency_minor_unit:u.SITE_CURRENCY.minorUnit,currency_decimal_separator:u.SITE_CURRENCY.decimalSeparator,currency_thousand_separator:u.SITE_CURRENCY.thousandSeparator,currency_prefix:u.SITE_CURRENCY.prefix,currency_suffix:u.SITE_CURRENCY.suffix},Qe=(e,t=2)=>{const o=u.SITE_CURRENCY.minorUnit;if(o===t||!e)return e;const s=Math.pow(10,o);return(Math.round(parseInt(e,10)/Math.pow(10,t))*s).toString()},Ke=(0,u.getSetting)("localPickupEnabled",!1),Ze=(0,u.getSetting)("localPickupText",(0,s.__)("Local pickup","woocommerce")),et=(0,u.getSetting)("localPickupCost",""),tt=Ke?(0,u.getSetting)("localPickupLocations",[]):[],ot=tt?Object.values(tt).map(((e,t)=>({...Je,name:`${Ze} (${e.name})`,description:"",delivery_time:"",price:Qe(et,0)||"0",taxes:"0",rate_id:`pickup_location:${t+1}`,instance_id:t+1,meta_data:[{key:"pickup_location",value:e.name},{key:"pickup_address",value:e.formatted_address},{key:"pickup_details",value:e.details}],method_id:"pickup_location",selected:!1}))):[],st=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:(0,s.__)("Shipping","woocommerce"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:(0,s._x)("Beanie with Logo","example product in Cart Block","woocommerce"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:(0,s._x)("Beanie","example product in Cart Block","woocommerce"),quantity:1}],shipping_rates:[{...Je,name:(0,s.__)("Flat rate shipping","woocommerce"),description:"",delivery_time:"",price:Qe("500"),taxes:"0",rate_id:"flat_rate:0",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!1},{...Je,name:(0,s.__)("Free shipping","woocommerce"),description:"",delivery_time:"",price:"0",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},...ot]}],rt=(0,u.getSetting)("displayCartPricesIncludingTax",!1),ct={coupons:[],shipping_rates:(0,u.getSetting)("shippingMethodsExist",!1)||(0,u.getSetting)("localPickupEnabled",!1)?st:[],items:[{key:"1",id:1,type:"simple",quantity:2,catalog_visibility:"visible",name:(0,s.__)("Beanie","woocommerce"),summary:(0,s.__)("Beanie","woocommerce"),short_description:(0,s.__)("Warm hat for winter","woocommerce"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,quantity_limits:{minimum:1,maximum:99,multiple_of:1,editable:!0},images:[{id:10,src:h+"previews/beanie.jpg",thumbnail:h+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,s.__)("Color","woocommerce"),value:(0,s.__)("Yellow","woocommerce")},{attribute:(0,s.__)("Size","woocommerce"),value:(0,s.__)("Small","woocommerce")}],prices:{...Je,price:Qe(rt?"12000":"10000"),regular_price:Qe(rt?"120":"100"),sale_price:Qe(rt?"12000":"10000"),price_range:null,raw_prices:{precision:6,price:rt?"12000000":"10000000",regular_price:rt?"12000000":"10000000",sale_price:rt?"12000000":"10000000"}},totals:{...Je,line_subtotal:Qe("2000"),line_subtotal_tax:Qe("400"),line_total:Qe("2000"),line_total_tax:Qe("400")},extensions:{},item_data:[]},{key:"2",id:2,type:"simple",quantity:1,catalog_visibility:"visible",name:(0,s.__)("Cap","woocommerce"),summary:(0,s.__)("Cap","woocommerce"),short_description:(0,s.__)("Lightweight baseball cap","woocommerce"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",low_stock_remaining:null,permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,quantity_limits:{minimum:1,maximum:99,multiple_of:1,editable:!0},images:[{id:11,src:h+"previews/cap.jpg",thumbnail:h+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,s.__)("Color","woocommerce"),value:(0,s.__)("Orange","woocommerce")}],prices:{...Je,price:Qe(rt?"2400":"2000"),regular_price:Qe(rt?"2400":"2000"),sale_price:Qe(rt?"2400":"2000"),price_range:null,raw_prices:{precision:6,price:rt?"24000000":"20000000",regular_price:rt?"24000000":"20000000",sale_price:rt?"24000000":"20000000"}},totals:{...Je,line_subtotal:Qe("2000"),line_subtotal_tax:Qe("400"),line_total:Qe("2000"),line_total_tax:Qe("400")},extensions:{},item_data:[]}],cross_sells:[{id:1,name:(0,s.__)("Polo","woocommerce"),slug:"polo",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-polo",short_description:(0,s.__)("Polo","woocommerce"),description:(0,s.__)("Polo","woocommerce"),on_sale:!1,prices:{...Je,price:Qe(rt?"24000":"20000"),regular_price:Qe(rt?"24000":"20000"),sale_price:Qe(rt?"12000":"10000"),price_range:null},price_html:"",average_rating:"4.5",review_count:2,images:[{id:17,src:h+"previews/polo.jpg",thumbnail:h+"previews/polo.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:2,name:(0,s.__)("Long Sleeve Tee","woocommerce"),slug:"long-sleeve-tee",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-long-sleeve-tee",short_description:(0,s.__)("Long Sleeve Tee","woocommerce"),description:(0,s.__)("Long Sleeve Tee","woocommerce"),on_sale:!1,prices:{...Je,price:Qe(rt?"30000":"25000"),regular_price:Qe(rt?"30000":"25000"),sale_price:Qe(rt?"30000":"25000"),price_range:null},price_html:"",average_rating:"4",review_count:2,images:[{id:17,src:h+"previews/long-sleeve-tee.jpg",thumbnail:h+"previews/long-sleeve-tee.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:3,name:(0,s.__)("Hoodie with Zipper","woocommerce"),slug:"hoodie-with-zipper",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-zipper",short_description:(0,s.__)("Hoodie with Zipper","woocommerce"),description:(0,s.__)("Hoodie with Zipper","woocommerce"),on_sale:!0,prices:{...Je,price:Qe(rt?"15000":"12500"),regular_price:Qe(rt?"30000":"25000"),sale_price:Qe(rt?"15000":"12500"),price_range:null},price_html:"",average_rating:"1",review_count:2,images:[{id:17,src:h+"previews/hoodie-with-zipper.jpg",thumbnail:h+"previews/hoodie-with-zipper.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:4,name:(0,s.__)("Hoodie with Logo","woocommerce"),slug:"hoodie-with-logo",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-logo",short_description:(0,s.__)("Polo","woocommerce"),description:(0,s.__)("Polo","woocommerce"),on_sale:!1,prices:{...Je,price:Qe(rt?"4500":"4250"),regular_price:Qe(rt?"4500":"4250"),sale_price:Qe(rt?"4500":"4250"),price_range:null},price_html:"",average_rating:"5",review_count:2,images:[{id:17,src:h+"previews/hoodie-with-logo.jpg",thumbnail:h+"previews/hoodie-with-logo.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:5,name:(0,s.__)("Hoodie with Pocket","woocommerce"),slug:"hoodie-with-pocket",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-pocket",short_description:(0,s.__)("Hoodie with Pocket","woocommerce"),description:(0,s.__)("Hoodie with Pocket","woocommerce"),on_sale:!0,prices:{...Je,price:Qe(rt?"3500":"3250"),regular_price:Qe(rt?"4500":"4250"),sale_price:Qe(rt?"3500":"3250"),price_range:null},price_html:"",average_rating:"3.75",review_count:4,images:[{id:17,src:h+"previews/hoodie-with-pocket.jpg",thumbnail:h+"previews/hoodie-with-pocket.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:6,name:(0,s.__)("T-Shirt","woocommerce"),slug:"t-shirt",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-t-shirt",short_description:(0,s.__)("T-Shirt","woocommerce"),description:(0,s.__)("T-Shirt","woocommerce"),on_sale:!1,prices:{...Je,price:Qe(rt?"1800":"1500"),regular_price:Qe(rt?"1800":"1500"),sale_price:Qe(rt?"1800":"1500"),price_range:null},price_html:"",average_rating:"3",review_count:2,images:[{id:17,src:h+"previews/tshirt.jpg",thumbnail:h+"previews/tshirt.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}}],fees:[{id:"fee",name:(0,s.__)("Fee","woocommerce"),totals:{...Je,total:Qe("100"),total_tax:Qe("20")}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:y,has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{...Je,total_items:Qe("4000"),total_items_tax:Qe("800"),total_fees:Qe("100"),total_fees_tax:Qe("20"),total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:Qe("820"),total_price:Qe("4920"),tax_lines:[{name:(0,s.__)("Sales tax","woocommerce"),rate:"20%",price:Qe("820")}]},errors:[],payment_methods:["cod","bacs","cheque"],payment_requirements:["products"],extensions:{}},nt=window.wc.blocksCheckout,at=window.wp.url,it=(0,a.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,a.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,a.jsx)("path",{d:"M0 0h24v24H0z"}),(0,a.jsx)("path",{fill:"currentColor",fillRule:"nonzero",d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45ZM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Z"})]})," "]});var lt=o(9491);const dt=(0,m.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),mt=({children:e,className:t=""})=>{const[o,s]=(()=>{const[e,{width:t}]=(0,lt.useResizeObserver)();let o="";return t>700?o="is-large":t>520?o="is-medium":t>400?o="is-small":t&&(o="is-mobile"),[e,o]})(),c={hasContainerWidth:""!==s,containerClassName:s,isMobile:"is-mobile"===s,isSmall:"is-small"===s,isMedium:"is-medium"===s,isLarge:"is-large"===s};return(0,a.jsx)(dt.Provider,{value:c,children:(0,a.jsxs)("div",{className:(0,r.A)(t,s),children:[o,e]})})};o(9163);const ut=({children:e,className:t})=>(0,a.jsx)(mt,{className:(0,r.A)("wc-block-components-sidebar-layout",t),children:e}),pt=["core/paragraph","core/image","core/separator"],ht=e=>{const t=(0,nt.applyCheckoutFilter)({filterName:"additionalCartCheckoutInnerBlockTypes",defaultValue:[],extensions:(0,A.select)(D.cartStore).getCartData().extensions,arg:{block:e},validation:e=>{if(Array.isArray(e)&&e.every((e=>"string"==typeof e)))return!0;throw new Error("allowedBlockTypes filters must return an array of strings.")}});return Array.from(new Set([...(0,d.getBlockTypes)().filter((t=>(t?.parent||[]).includes(e))).map((({name:e})=>e)),...pt,...t]))},gt=({clientId:e,registeredBlocks:t,defaultTemplate:o=[]})=>{const s=(0,m.useRef)(t),r=(0,m.useRef)(o),c=(0,A.useRegistry)(),{isPreview:n}=R();(0,m.useEffect)((()=>{let t=!1;if(n)return;const{replaceInnerBlocks:o}=(0,A.dispatch)("core/block-editor");return c.subscribe((()=>{if(!c.select("core/block-editor").getBlock(e))return;const n=c.select("core/block-editor").getBlocks(e);if(0===n.length&&r.current.length>0&&!t){const s=(0,d.createBlocksFromInnerBlocksTemplate)(r.current);if(0!==s.length)return t=!0,void o(e,s)}const a=s.current.map((e=>(0,d.getBlockType)(e))),i=((e,t)=>{const o=t.filter((e=>e&&(({attributes:e})=>Boolean(e.lock?.remove||e.lock?.default?.remove))(e))),s=[];return o.forEach((t=>{if(void 0===t)return;const o=e.find((e=>e.name===t.name));o||s.push(t)})),s})(n,a);if(0===i.length)return;let l=-1;const m=i.map((e=>{const t=r.current.findIndex((([t])=>t===e.name)),o=(0,d.createBlock)(e.name);return-1===l&&(l=(({defaultTemplatePosition:e,innerBlocks:t,currentDefaultTemplate:o})=>{switch(e){case-1:return t.length;case 0:return 0;default:const s=o.current[e-1],r=t.findIndex((({name:e})=>e===s[0]));return-1===r?e:r+1}})({defaultTemplatePosition:t,innerBlocks:n,currentDefaultTemplate:r})),o}));c.batch((()=>{c.dispatch("core/block-editor").insertBlocks(m,l,e)}))}),"core/block-editor")}),[e,n,c])};o(398);const _t=(0,m.createContext)({hasDarkControls:!1}),wt=JSON.parse('{"DD":"Filled Cart","XV":3}');(0,d.registerBlockType)("woocommerce/filled-cart-block",{apiVersion:wt.XV,title:wt.DD,icon:{src:(0,a.jsx)(l.A,{icon:it,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,c.useBlockProps)(),{currentView:o}=R(),{hasDarkControls:s}=(0,m.useContext)(_t),n=ht(nt.innerBlockAreas.FILLED_CART),i=[["woocommerce/cart-items-block",{},[]],["woocommerce/cart-totals-block",{},[]]];return gt({clientId:e,registeredBlocks:n,defaultTemplate:i}),(0,a.jsx)("div",{...t,hidden:"woocommerce/filled-cart-block"!==o,children:(0,a.jsx)(ut,{className:(0,r.A)("wc-block-cart",{"has-dark-controls":s}),children:(0,a.jsx)(c.InnerBlocks,{allowedBlocks:n,template:i,templateLock:"insert"})})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})})});var kt=o(4782);const bt=(0,m.forwardRef)((({children:e,className:t=""},o)=>(0,a.jsx)("div",{ref:o,className:(0,r.A)("wc-block-components-main",t),children:e}))),yt=JSON.parse('{"DD":"Cart Items","XV":3}');(0,d.registerBlockType)("woocommerce/cart-items-block",{apiVersion:yt.XV,title:yt.DD,icon:{src:(0,a.jsx)(l.A,{icon:kt.A,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,c.useBlockProps)({className:"wc-block-cart__main"}),o=ht(nt.innerBlockAreas.CART_ITEMS),s=[["woocommerce/cart-line-items-block",{},[]],["woocommerce/cart-cross-sells-block",{},[]]];return gt({clientId:e,registeredBlocks:o,defaultTemplate:s}),(0,a.jsx)(bt,{...t,children:(0,a.jsx)(c.InnerBlocks,{allowedBlocks:o,template:s,templateLock:!1,renderAppender:c.InnerBlocks.ButtonBlockAppender})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})})});var xt=o(8107),vt=o(4347);const ft=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"],St=({children:e,style:t={},...o})=>{const s=(0,m.useRef)(null),r=()=>{s.current&&xt.focus.focusable.find(s.current).forEach((e=>{ft.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))},c=(0,vt.YQ)(r,0,{leading:!0});return(0,m.useLayoutEffect)((()=>{let e;return r(),s.current&&(e=new window.MutationObserver(c),e.observe(s.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),c.cancel()}}),[c]),(0,a.jsx)("div",{ref:s,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...t},...o,children:e})};var jt=o(195),Ct=o(8558);o(9959);const Pt=({className:e,quantity:t=1,minimum:o=1,maximum:c,onChange:n=()=>{},step:i=1,itemName:l="",disabled:d,editable:u=!0})=>{const p=(0,r.A)("wc-block-components-quantity-selector",e),h=(0,m.useRef)(null),g=(0,m.useRef)(null),_=(0,m.useRef)(null),w=void 0!==c,k=!d&&t-i>=o,b=!d&&(!w||t+i<=c),y=(0,m.useCallback)((e=>{let t=e;w&&(t=Math.min(t,Math.floor(c/i)*i)),t=Math.max(t,Math.ceil(o/i)*i),t=Math.floor(t/i)*i,t!==e&&n(t)}),[w,c,o,n,i]),x=(0,vt.YQ)(y,300);(0,m.useLayoutEffect)((()=>{y(t)}),[t,y]);const v=(0,m.useCallback)((e=>{const o=void 0!==typeof e.key?"ArrowDown"===e.key:e.keyCode===Ct.DOWN,s=void 0!==typeof e.key?"ArrowUp"===e.key:e.keyCode===Ct.UP;o&&k&&(e.preventDefault(),n(t-i)),s&&b&&(e.preventDefault(),n(t+i))}),[t,n,b,k,i]);return(0,a.jsxs)("div",{className:p,children:[(0,a.jsx)("input",{ref:h,className:"wc-block-components-quantity-selector__input",disabled:d,readOnly:!u,type:"number",step:i,min:o,max:c,value:t,onKeyDown:v,onChange:e=>{let o=parseInt(e.target.value,10);o=isNaN(o)?t:o,o!==t&&(n(o),x(o))},"aria-label":(0,s.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,s.__)("Quantity of %s in your cart.","woocommerce"),l)}),u&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{ref:g,"aria-label":(0,s.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,s.__)("Reduce quantity of %s","woocommerce"),l),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:!k,onClick:()=>{const e=t-i;n(e),(0,jt.speak)((0,s.sprintf)(/* translators: %s refers to the item's new quantity in the cart. */ /* translators: %s refers to the item's new quantity in the cart. */
(0,s.__)("Quantity reduced to %s.","woocommerce"),e)),y(e)},children:"-"}),(0,a.jsx)("button",{ref:_,"aria-label":(0,s.sprintf)(/* translators: %s refers to the item's name in the cart. */ /* translators: %s refers to the item's name in the cart. */
(0,s.__)("Increase quantity of %s","woocommerce"),l),disabled:!b,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=t+i;n(e),(0,jt.speak)((0,s.sprintf)(/* translators: %s refers to the item's new quantity in the cart. */ /* translators: %s refers to the item's new quantity in the cart. */
(0,s.__)("Quantity increased to %s.","woocommerce"),e)),y(e)},children:"+"})]})]})},Nt=window.wc.blocksComponents,Et=window.wc.priceFormat;o(8501);const At=({currency:e,maxPrice:t,minPrice:o,priceClassName:c,priceStyle:n={}})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,s.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,s.__)("Price between %1$s and %2$s","woocommerce"),(0,Et.formatPrice)(o),(0,Et.formatPrice)(t))}),(0,a.jsxs)("span",{"aria-hidden":!0,children:[(0,a.jsx)(Nt.FormattedMonetaryAmount,{className:(0,r.A)("wc-block-components-product-price__value",c),currency:e,value:o,style:n})," — ",(0,a.jsx)(Nt.FormattedMonetaryAmount,{className:(0,r.A)("wc-block-components-product-price__value",c),currency:e,value:t,style:n})]})]}),It=({currency:e,regularPriceClassName:t,regularPriceStyle:o,regularPrice:c,priceClassName:n,priceStyle:i,price:l})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,s.__)("Previous price:","woocommerce")}),(0,a.jsx)(Nt.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,a.jsx)("del",{className:(0,r.A)("wc-block-components-product-price__regular",t),style:o,children:e}),value:c}),(0,a.jsx)("span",{className:"screen-reader-text",children:(0,s.__)("Discounted price:","woocommerce")}),(0,a.jsx)(Nt.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,a.jsx)("ins",{className:(0,r.A)("wc-block-components-product-price__value","is-discounted",n),style:i,children:e}),value:l})]}),Rt=({align:e,className:t,currency:o,format:s="<price/>",maxPrice:c,minPrice:n,price:i,priceClassName:l,priceStyle:d,regularPrice:u,regularPriceClassName:p,regularPriceStyle:h,style:g})=>{const _=(0,r.A)(t,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));const w=u&&i&&i<u;let k=(0,a.jsx)("span",{className:(0,r.A)("wc-block-components-product-price__value",l)});return w?k=(0,a.jsx)(It,{currency:o,price:i,priceClassName:l,priceStyle:d,regularPrice:u,regularPriceClassName:p,regularPriceStyle:h}):void 0!==n&&void 0!==c?k=(0,a.jsx)(At,{currency:o,maxPrice:c,minPrice:n,priceClassName:l,priceStyle:d}):i&&(k=(0,a.jsx)(Nt.FormattedMonetaryAmount,{className:(0,r.A)("wc-block-components-product-price__value",l),currency:o,value:i,style:d})),(0,a.jsx)("span",{className:_,style:g,children:(0,m.createInterpolateElement)(s,{price:k})})};o(959);const Bt=({className:e="",disabled:t=!1,name:o,permalink:s="",target:c,rel:n,style:i,onClick:l,disabledTagName:d="span",...m})=>{const u=(0,r.A)("wc-block-components-product-name",e),p=d;if(t){const e=m;return(0,a.jsx)(p,{className:u,...e,dangerouslySetInnerHTML:{__html:o}})}return(0,a.jsx)("a",{className:u,href:s,target:c,...m,dangerouslySetInnerHTML:{__html:o},style:i})};var Tt=o(6513);o(7605);const Dt=({children:e,className:t})=>(0,a.jsx)("div",{className:(0,r.A)("wc-block-components-product-badge",t),children:e}),Mt=()=>(0,a.jsx)(Dt,{className:"wc-block-components-product-backorder-badge",children:(0,s.__)("Available on backorder","woocommerce")}),Ot=({image:e={},fallbackAlt:t=""})=>{const o=e.thumbnail?{src:e.thumbnail,alt:(0,re.decodeEntities)(e.alt)||t||"Product Image"}:{src:u.PLACEHOLDER_IMG_SRC,alt:""};return(0,a.jsx)("img",{...o,alt:o.alt})},Lt=({lowStockRemaining:e})=>e?(0,a.jsx)(Dt,{className:"wc-block-components-product-low-stock-badge",children:(0,s.sprintf)(/* translators: %d stock amount (number of items in stock for product) */ /* translators: %d stock amount (number of items in stock for product) */
(0,s.__)("%d left in stock","woocommerce"),e)}):null;var Ft=o(7356);o(3692);const Vt=({details:e=[]})=>{if(!Array.isArray(e))return null;if(0===(e=e.filter((e=>!e.hidden))).length)return null;let t="ul",o="li";return 1===e.length&&(t="div",o="div"),(0,a.jsx)(t,{className:"wc-block-components-product-details",children:e.map((e=>{const t=e?.key||e.name||"",s=e?.className||(t?`wc-block-components-product-details__${(0,Ft.c)(t)}`:"");return(0,a.jsxs)(o,{className:s,children:[t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"wc-block-components-product-details__name",children:[(0,re.decodeEntities)(t),":"]})," "]}),(0,a.jsx)("span",{className:"wc-block-components-product-details__value",children:(0,re.decodeEntities)(e.display||e.value)})]},t+(e.display||e.value))}))})};var Ht=o(3240),zt=o.n(Ht);const Ut=["a","b","em","i","strong","p","br"],$t=["target","href","rel","name","download"],Wt=(e,t)=>{const o=t?.tags||Ut,s=t?.attr||$t;return zt().sanitize(e,{ALLOWED_TAGS:o,ALLOWED_ATTR:s})},qt=window.wp.autop,Yt=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),Xt=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,Gt=window.wp.wordcount,Jt=["a","b","em","i","strong","p","br","ul","ol","li","h1","h2","h3","h4","h5","h6","pre","blockquote","img"],Qt=["target","href","rel","name","download","src","class","alt","style"],Kt=({source:e,maxLength:t=15,countType:o="words",className:s="",style:r={}})=>{const c=(0,m.useMemo)((()=>((e,t=15,o="words")=>{const s=(0,qt.autop)(e);if((0,Gt.count)(s,o)<=t)return s;const r=(e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)})(s);return(0,Gt.count)(r,o)<=t?r:"words"===o?((e,t,o="&hellip;",s=!0)=>{const r=Yt(e),c=r.split(" ").splice(0,t).join(" ");return c===r?s?(0,qt.autop)(r):r:s?(0,qt.autop)(Xt(c,o)):Xt(c,o)})(r,t):((e,t,o=!0,s="&hellip;",r=!0)=>{const c=Yt(e),n=c.slice(0,t);if(n===c)return r?(0,qt.autop)(c):c;if(o)return(0,qt.autop)(Xt(n,s));const a=n.match(/([\s]+)/g),i=a?a.length:0,l=c.slice(0,t+i);return r?(0,qt.autop)(Xt(l,s)):Xt(l,s)})(r,t,"characters_including_spaces"===o)})(e,t,o)),[e,t,o]);return(0,a.jsx)(m.RawHTML,{style:r,className:s,children:Wt(c,{tags:Jt,attr:Qt})})},Zt=({className:e,shortDescription:t="",fullDescription:o=""})=>{const s=t||o;return s?(0,a.jsx)(Kt,{className:e,source:s,maxLength:15,countType:p.wordCountType||"words"}):null};o(8879);const eo=({shortDescription:e="",fullDescription:t="",itemData:o=[],variation:s=[]})=>(0,a.jsxs)("div",{className:"wc-block-components-product-metadata",children:[(0,a.jsx)(Zt,{className:"wc-block-components-product-metadata__description",shortDescription:e,fullDescription:t}),(0,a.jsx)(Vt,{details:o}),(0,a.jsx)(Vt,{details:s.map((({attribute:e="",value:t})=>({key:e,value:t})))})]}),to=({currency:e,saleAmount:t,format:o="<price/>"})=>{if(!t||t<=0)return null;o.includes("<price/>")||(o="<price/>",console.error("Price formats need to include the `<price/>` tag."));const r=(0,s.sprintf)(/* translators: %s will be replaced by the discount amount */ /* translators: %s will be replaced by the discount amount */
(0,s.__)("Save %s","woocommerce"),o);return(0,a.jsx)(Dt,{className:"wc-block-components-sale-badge",children:(0,m.createInterpolateElement)(r,{price:(0,a.jsx)(Nt.FormattedMonetaryAmount,{currency:e,value:t})})})},oo=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),so=(0,m.forwardRef)((({lineItem:e,onRemove:t=()=>{},tabIndex:o},c)=>{const{name:n="",catalog_visibility:i="visible",short_description:l="",description:d="",low_stock_remaining:p=null,show_backorder_badge:h=!1,quantity_limits:g={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:_=!1,permalink:w="",images:k=[],variation:b=[],item_data:y=[],prices:x={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:v={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:f}=e,{quantity:S,setItemQuantity:j,removeItem:C,isPendingDelete:P}=(e=>{const t={key:"",quantity:1};(e=>(0,Z.isObject)(e)&&(0,Z.objectHasProp)(e,"key")&&(0,Z.objectHasProp)(e,"quantity")&&(0,Z.isString)(e.key)&&(0,Z.isNumber)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:o="",quantity:s=1}=t,{cartErrors:r}=we(),{__internalStartCalculation:c,__internalFinishCalculation:n}=(0,A.useDispatch)(D.checkoutStore),[a,i]=(0,m.useState)(s),[l]=(0,vt.d7)(a,400),d=Be(l),{removeItemFromCart:u,changeCartItemQuantity:p}=(0,A.useDispatch)(D.cartStore);(0,m.useEffect)((()=>i(s)),[s]);const h=(0,A.useSelect)((e=>{if(!o)return{quantity:!1,delete:!1};const t=e(D.cartStore);return{quantity:t.isItemPendingQuantity(o),delete:t.isItemPendingDelete(o)}}),[o]),g=(0,m.useCallback)((()=>o?u(o).catch((e=>{(0,D.processErrorResponse)(e)})):Promise.resolve(!1)),[o,u]);return(0,m.useEffect)((()=>{o&&(0,Z.isNumber)(d)&&Number.isFinite(d)&&d!==l&&p(o,l).catch((e=>{(0,D.processErrorResponse)(e)}))}),[o,p,l,d]),(0,m.useEffect)((()=>(h.delete?c():n(),()=>{h.delete&&n()})),[n,c,h.delete]),(0,m.useEffect)((()=>(h.quantity||l!==a?c():n(),()=>{(h.quantity||l!==a)&&n()})),[c,n,h.quantity,l,a]),{isPendingDelete:h.delete,quantity:a,setItemQuantity:i,removeItem:g,cartItemQuantityErrors:r}})(e),{dispatchStoreEvent:N}=je(),{receiveCart:E,...I}=we(),R=(0,m.useMemo)((()=>({context:"cart",cartItem:e,cart:I})),[e,I]),B=(0,Et.getCurrencyFromPriceResponse)(x),T=(0,nt.applyCheckoutFilter)({filterName:"itemName",defaultValue:n,extensions:f,arg:R}),M=(0,Tt.A)({amount:parseInt(x.raw_prices.regular_price,10),precision:x.raw_prices.precision}),O=(0,Tt.A)({amount:parseInt(x.raw_prices.price,10),precision:x.raw_prices.precision}),L=M.subtract(O),F=L.multiply(S),V=(0,Et.getCurrencyFromPriceResponse)(v);let H=parseInt(v.line_subtotal,10);(0,u.getSetting)("displayCartPricesIncludingTax",!1)&&(H+=parseInt(v.line_subtotal_tax,10));const z=(0,Tt.A)({amount:H,precision:V.minorUnit}),U=k.length?k[0]:{},$="hidden"===i||"search"===i,W=(0,nt.applyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:f,arg:R}),q=(0,nt.applyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:f,arg:R,validation:nt.productPriceValidation}),Y=(0,nt.applyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:f,arg:R,validation:nt.productPriceValidation}),X=(0,nt.applyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:f,arg:R,validation:nt.productPriceValidation}),G=(0,nt.applyCheckoutFilter)({filterName:"showRemoveItemLink",defaultValue:!0,extensions:f,arg:R});return(0,a.jsxs)("tr",{className:(0,r.A)("wc-block-cart-items__row",W,{"is-disabled":P}),ref:c,tabIndex:o,children:[(0,a.jsx)("td",{className:"wc-block-cart-item__image","aria-hidden":!(0,Z.objectHasProp)(U,"alt")||!U.alt,children:$?(0,a.jsx)(Ot,{image:U,fallbackAlt:T}):(0,a.jsx)("a",{href:w,tabIndex:-1,children:(0,a.jsx)(Ot,{image:U,fallbackAlt:T})})}),(0,a.jsx)("td",{className:"wc-block-cart-item__product",children:(0,a.jsxs)("div",{className:"wc-block-cart-item__wrap",children:[(0,a.jsx)(Bt,{disabled:P||$,name:T,permalink:w}),h?(0,a.jsx)(Mt,{}):!!p&&(0,a.jsx)(Lt,{lowStockRemaining:p}),(0,a.jsx)("div",{className:"wc-block-cart-item__prices",children:(0,a.jsx)(Rt,{currency:B,regularPrice:oo(M,B),price:oo(O,B),format:Y})}),(0,a.jsx)(to,{currency:B,saleAmount:oo(L,B),format:X}),(0,a.jsx)(eo,{shortDescription:l,fullDescription:d,itemData:y,variation:b}),(0,a.jsxs)("div",{className:"wc-block-cart-item__quantity",children:[!_&&(0,a.jsx)(Pt,{disabled:P,editable:g.editable,quantity:S,minimum:g.minimum,maximum:g.maximum,step:g.multiple_of,onChange:t=>{j(t),N("cart-set-item-quantity",{product:e,quantity:t})},itemName:T}),G&&(0,a.jsx)("button",{className:"wc-block-cart-item__remove-link","aria-label":(0,s.sprintf)(/* translators: %s refers to the item's name in the cart. */ /* translators: %s refers to the item's name in the cart. */
(0,s.__)("Remove %s from cart","woocommerce"),T),onClick:()=>{t(),C(),N("cart-remove-item",{product:e,quantity:S}),(0,jt.speak)((0,s.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,s.__)("%s has been removed from your cart.","woocommerce"),T))},disabled:P,children:(0,s.__)("Remove item","woocommerce")})]})]})}),(0,a.jsx)("td",{className:"wc-block-cart-item__total",children:(0,a.jsxs)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper",children:[(0,a.jsx)(Rt,{currency:V,format:q,price:z.getAmount()}),S>1&&(0,a.jsx)(to,{currency:B,saleAmount:oo(F,B),format:X})]})})]})})),ro=so;o(359);const co=[...Array(3)].map(((_x,e)=>(0,a.jsx)(ro,{lineItem:{}},e))),no=e=>{const t={};return e.forEach((({key:e})=>{t[e]=(0,m.createRef)()})),t},ao=({lineItems:e=[],isLoading:t=!1,className:o})=>{const c=(0,m.useRef)(null),n=(0,m.useRef)(no(e));(0,m.useEffect)((()=>{n.current=no(e)}),[e]);const i=e=>()=>{n?.current&&e&&n.current[e].current instanceof HTMLElement?n.current[e].current.focus():c.current instanceof HTMLElement&&c.current.focus()},l=t?co:e.map(((t,o)=>{const s=e.length>o+1?e[o+1].key:null;return(0,a.jsx)(ro,{lineItem:t,onRemove:i(s),ref:n.current[t.key],tabIndex:-1},t.key)}));return(0,a.jsxs)("table",{className:(0,r.A)("wc-block-cart-items",o),ref:c,tabIndex:-1,children:[(0,a.jsx)("caption",{className:"screen-reader-text",children:(0,a.jsx)("h2",{children:(0,s.__)("Products in cart","woocommerce")})}),(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"wc-block-cart-items__header",children:[(0,a.jsx)("th",{className:"wc-block-cart-items__header-image",children:(0,a.jsx)("span",{children:(0,s.__)("Product","woocommerce")})}),(0,a.jsx)("th",{className:"wc-block-cart-items__header-product",children:(0,a.jsx)("span",{children:(0,s.__)("Details","woocommerce")})}),(0,a.jsx)("th",{className:"wc-block-cart-items__header-total",children:(0,a.jsx)("span",{children:(0,s.__)("Total","woocommerce")})})]})}),(0,a.jsx)("tbody",{children:l})]})},io=({className:e})=>{const{cartItems:t,cartIsLoading:o}=we();return(0,a.jsx)(ao,{className:e,lineItems:t,isLoading:o})},lo=JSON.parse('{"DD":"Cart Line Items","XV":3}');(0,d.registerBlockType)("woocommerce/cart-line-items-block",{apiVersion:lo.XV,title:lo.DD,icon:{src:(0,a.jsx)(l.A,{icon:kt.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,c.useBlockProps)();return(0,a.jsx)("div",{...o,children:(0,a.jsx)(St,{children:(0,a.jsx)(io,{className:t})})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});const mo=JSON.parse('{"DD":"Cart Cross-Sells","XV":3}');(0,d.registerBlockType)("woocommerce/cart-cross-sells-block",{apiVersion:mo.XV,title:mo.DD,icon:{src:(0,a.jsx)(l.A,{icon:kt.A,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=(0,c.useBlockProps)({className:"wc-block-cart__cross-sells"}),t=[["core/heading",{content:(0,s.__)("You may be interested in…","woocommerce"),level:2,fontSize:"large"},[]],["woocommerce/cart-cross-sells-products-block",{},[]]];return(0,a.jsx)("div",{...e,children:(0,a.jsx)(c.InnerBlocks,{template:t,templateLock:!1})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})})});const uo=window.wp.components,po=window.wc.wcBlocksSharedContext,ho=window.wp.styleEngine;function go(e={}){const t={};return(0,ho.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function _o(e,t){return e&&t?`has-${(0,Ft.c)(t)}-${e}`:""}const wo=e=>{const t=(e=>{const t=(0,Z.isObject)(e)?e:{style:{}};let o=t.style;return(0,Z.isString)(o)&&(o=JSON.parse(o)||{}),(0,Z.isObject)(o)||(o={}),{...t,style:o}})(e),o=function(e){const{backgroundColor:t,textColor:o,gradient:s,style:c}=e,n=_o("background-color",t),a=_o("color",o),i=function(e){if(e)return`has-${e}-gradient-background`}(s),l=i||c?.color?.gradient;return{className:(0,r.A)(a,i,{[n]:!l&&!!n,"has-text-color":o||c?.color?.text,"has-background":t||c?.color?.background||s||c?.color?.gradient,"has-link-color":(0,Z.isObject)(c?.elements?.link)?c?.elements?.link?.color:void 0}),style:go({color:c?.color||{}})}}(t),s=function(e){const t=e.style?.border||{},o=function(e){const{borderColor:t,style:o}=e,s=t?_o("border-color",t):"";return(0,r.A)({"has-border-color":!!t||!!o?.border?.color,[s]:!!s})}(e);return{className:o,style:go({border:t})}}(t),c=function(e){return{className:void 0,style:go({spacing:e.style?.spacing||{}})}}(t),n=(e=>{const t=(0,Z.isObject)(e.style.typography)?e.style.typography:{},o=(0,Z.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:o,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:(0,r.A)(n.className,o.className,s.className,c.className),style:{...n.style,...o.style,...s.style,...c.style}}},ko=window.wc.wcBlocksSharedHocs;o(4313);const bo=(0,ko.withProductDataContext)((e=>{const{className:t,align:o,isDescendentOfSingleProductTemplate:c}=e,n=wo(e),{parentClassName:i}=(0,po.useInnerBlockLayoutContext)(),{product:l}=(0,po.useProductDataContext)();if(!(l.id&&l.on_sale||c))return null;const d="string"==typeof o?`wc-block-components-product-sale-badge--align-${o}`:"";return(0,a.jsx)("div",{className:(0,r.A)("wc-block-components-product-sale-badge",t,d,{[`${i}__product-onsale`]:i},n.className),style:n.style,children:(0,a.jsx)(Nt.Label,{label:(0,s.__)("Sale","woocommerce"),screenReaderLabel:(0,s.__)("Product on sale","woocommerce")})})}));o(1189);let yo=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({});const xo=e=>(0,a.jsx)("img",{...e,src:u.PLACEHOLDER_IMG_SRC,alt:"",width:void 0,height:void 0}),vo=({image:e,loaded:t,showFullSize:o,fallbackAlt:s,width:r,scale:c,height:n,aspectRatio:i})=>{const{thumbnail:l,src:d,srcset:m,sizes:u,alt:p}=e||{},h={alt:p||s,hidden:!t,src:l,...o&&{src:d,srcSet:m,sizes:u}},g={height:n,width:r,objectFit:c,aspectRatio:i};return(0,a.jsxs)(a.Fragment,{children:[h.src&&(0,a.jsx)("img",{style:g,"data-testid":"product-image",...h}),!e&&(0,a.jsx)(xo,{style:g})]})},fo=e=>{const{product:t}=e;return!(0,Z.isEmpty)(t)&&(void 0===(o=e.showSaleBadge)||o);var o},So=e=>{const{aspectRatio:t,children:o,className:c,height:n,imageId:i,imageSizing:l=yo.SINGLE,scale:d,showProductLink:u=!0,style:p,width:h,...g}=e,_=wo(e),{parentClassName:w}=(0,po.useInnerBlockLayoutContext)(),{product:k,isLoading:b}=(0,po.useProductDataContext)(),{dispatchStoreEvent:y}=je();if(!k?.id)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:(0,r.A)(c,"wc-block-components-product-image",{[`${w}__product-image`]:w},_.className),style:_.style,children:(0,a.jsx)(xo,{})}),o]});const x=((e,t)=>e.images.length?t&&e.images.find((e=>e.id===t))||e.images[0]:null)(k,i);x&&(x.alt=x.alt||(0,re.decodeEntities)(k.name));const v=u?"a":m.Fragment,f=k?.name?
// translators: %s is the product name.
// translators: %s is the product name.
(0,s.sprintf)((0,s.__)("Link to %s","woocommerce"),k.name):"",S={href:u?k?.permalink:void 0,...u&&{"aria-label":f,onClick:()=>{y("product-view-link",{product:k})}}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:(0,r.A)(c,"wc-block-components-product-image",{[`${w}__product-image`]:w},_.className),style:_.style,children:[fo(e)&&(0,a.jsx)(bo,{align:e.saleBadgeAlign||"right",...g}),(0,a.jsx)(v,{...u&&S,children:(0,a.jsx)(vo,{fallbackAlt:(0,re.decodeEntities)(k.name),image:x,loaded:!b,showFullSize:l!==yo.THUMBNAIL,width:h,height:n,scale:d,aspectRatio:(0,Z.objectHasProp)(p,"dimensions")&&(0,Z.objectHasProp)(p.dimensions,"aspectRatio")&&(0,Z.isString)(p.dimensions.aspectRatio)?p.dimensions.aspectRatio:t})})]}),o]})};(0,ko.withProductDataContext)(So),o(7578);const jo=({children:e,headingLevel:t,elementType:o=`h${t}`,...s})=>(0,a.jsx)(o,{...s,children:e}),Co=e=>{const{className:t,headingLevel:o=2,showProductLink:s=!0,linkTarget:c,align:n}=e,i=wo(e),{parentClassName:l}=(0,po.useInnerBlockLayoutContext)(),{product:d}=(0,po.useProductDataContext)(),{dispatchStoreEvent:m}=je();return d.id?(0,a.jsx)(jo,{headingLevel:o,className:(0,r.A)(t,i.className,"wc-block-components-product-title",{[`${l}__product-title`]:l,[`wc-block-components-product-title--align-${n}`]:n}),style:i.style,children:(0,a.jsx)(Bt,{disabled:!s,name:d.name,permalink:d.permalink,target:c,onClick:()=>{m("product-view-link",{product:d})}})}):(0,a.jsx)(jo,{headingLevel:o,className:(0,r.A)(t,i.className,"wc-block-components-product-title",{[`${l}__product-title`]:l,[`wc-block-components-product-title--align-${n}`]:n}),style:i.style})},Po=((0,ko.withProductDataContext)(Co),e=>({width:e/5*100+"%"})),No=({className:e,parentClassName:t})=>{const o=Po(0);return(0,a.jsxs)("div",{className:(0,r.A)(`${e}__norating-container`,`${t}-product-rating__norating-container`),children:[(0,a.jsx)("div",{className:`${e}__norating`,role:"img",children:(0,a.jsx)("span",{style:o})}),(0,a.jsx)("span",{children:(0,s.__)("No Reviews","woocommerce")})]})},Eo=e=>{const{className:t,rating:o,reviews:c,parentClassName:n}=e,i=Po(o),l=(0,s.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */
(0,s.__)("Rated %f out of 5","woocommerce"),o),d={__html:(0,s.sprintf)(/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
(0,s._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",c,"woocommerce"),(0,s.sprintf)('<strong class="rating">%f</strong>',o),(0,s.sprintf)('<span class="rating">%d</span>',c))};return(0,a.jsx)("div",{className:(0,r.A)(`${t}__stars`,`${n}__product-rating__stars`),role:"img","aria-label":l,children:(0,a.jsx)("span",{style:i,dangerouslySetInnerHTML:d})})},Ao=e=>{const{className:t,reviews:o}=e,r=(0,s.sprintf)(/* translators: %s is referring to the total of reviews for a product */ /* translators: %s is referring to the total of reviews for a product */
(0,s._n)("(%s customer review)","(%s customer reviews)",o,"woocommerce"),o);return(0,a.jsx)("span",{className:`${t}__reviews_count`,children:r})},Io=e=>{const{className:t="wc-block-components-product-rating",showReviewCount:o,showMockedReviews:s,parentClassName:c="",rating:n,reviews:i,styleProps:l,textAlign:d}=e,m=(0,r.A)(l.className,t,{[`${c}__product-rating`]:c,[`has-text-align-${d}`]:d}),u=s&&(0,a.jsx)(No,{className:t,parentClassName:c}),p=i?(0,a.jsx)(Eo,{className:t,rating:n,reviews:i,parentClassName:c}):u,h=i&&o;return(0,a.jsx)("div",{className:m,style:l.style,children:(0,a.jsxs)("div",{className:`${t}__container`,children:[p,h?(0,a.jsx)(Ao,{className:t,reviews:i}):null]})})};o(7545);const Ro=e=>{const{textAlign:t="",shouldDisplayMockedReviewsWhenProductHasNoReviews:o}=e,s=wo(e),{parentClassName:r}=(0,po.useInnerBlockLayoutContext)(),{product:c}=(0,po.useProductDataContext)(),n=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(c),i=(e=>{const t=(0,Z.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(c);return(0,a.jsx)(Io,{className:"wc-block-components-product-rating-stars",showMockedReviews:o,styleProps:s,parentClassName:r,reviews:i,rating:n,textAlign:t})},Bo=((0,ko.withProductDataContext)(Ro),e=>{const{className:t,textAlign:o,isDescendentOfSingleProductTemplate:s}=e,c=wo(e),{parentName:n,parentClassName:i}=(0,po.useInnerBlockLayoutContext)(),{product:l}=(0,po.useProductDataContext)(),d="woocommerce/all-products"===n,m=s&&!("woocommerce/add-to-cart-with-options-grouped-product-item"===n),u=(0,r.A)("wc-block-components-product-price",t,c.className,{[`${i}__product-price`]:i});if(!l.id&&!s){const e=(0,a.jsx)(Rt,{align:o,className:u});return d?(0,a.jsx)("div",{className:"wp-block-woocommerce-product-price",children:e}):e}const p=l.prices,h=m?(0,Et.getCurrencyFromPriceResponse)():(0,Et.getCurrencyFromPriceResponse)(p),g="5000",_=p.price!==p.regular_price,w=(0,r.A)({[`${i}__product-price__value`]:i,[`${i}__product-price__value--on-sale`]:_}),k=(0,a.jsx)(Rt,{align:o,className:u,style:c.style,regularPriceStyle:c.style,priceStyle:c.style,priceClassName:w,currency:h,price:m?g:p.price,minPrice:p?.price_range?.min_amount,maxPrice:p?.price_range?.max_amount,regularPrice:m?g:p.regular_price,regularPriceClassName:(0,r.A)({[`${i}__product-price__regular`]:i})});return d?(0,a.jsx)("div",{className:"wp-block-woocommerce-product-price",children:k}):k}),To=(e,t)=>{const o=e.find((({id:e})=>e===t));return o?o.quantity:0};o(7316);const Do="woocommerce/product-type-template-state",Mo="SWITCH_PRODUCT_TYPE",Oo="SET_PRODUCT_TYPES",Lo="REGISTER_LISTENER",Fo="UNREGISTER_LISTENER",Vo=(0,u.getSetting)("productTypes",{}),Ho=Object.keys(Vo).map((e=>({slug:e,label:Vo[e]}))),zo={productTypes:{list:Ho,current:Ho[0]?.slug},listeners:[]},Uo={switchProductType:e=>({type:Mo,current:e}),setProductTypes:e=>({type:Oo,productTypes:e}),registerListener:e=>({type:Lo,listener:e}),unregisterListener:e=>({type:Fo,listener:e})},$o=(0,A.createReduxStore)(Do,{reducer:(e=zo,t)=>{switch(t.type){case Oo:return{...e,productTypes:{...e.productTypes,list:t.productTypes||[]}};case Mo:return{...e,productTypes:{...e.productTypes,current:t.current}};case Lo:return{...e,listeners:[...e.listeners,t.listener||""]};case Fo:return{...e,listeners:e.listeners.filter((e=>e!==t.listener))};default:return e}},actions:Uo,selectors:{getProductTypes:e=>e.productTypes.list,getCurrentProductType:e=>e.productTypes.list.find((t=>t.slug===e.productTypes.current)),getRegisteredListeners:e=>e.listeners}});(0,A.select)(Do)||(0,A.register)($o);const Wo=({product:e,isDescendantOfAddToCartWithOptions:t,className:o,style:c})=>{const{id:n,permalink:i,add_to_cart:l,has_options:d,is_purchasable:p,is_in_stock:h}=e,{dispatchStoreEvent:g}=je(),{cartQuantity:_,addingToCart:w,addToCart:b}=(e=>{const{addItemToCart:t}=(0,A.useDispatch)(D.cartStore),{cartItems:o,cartIsLoading:s}=we(),{createErrorNotice:r,removeNotice:c}=(0,A.useDispatch)("core/notices"),[n,a]=(0,m.useState)(!1),i=(0,m.useRef)(To(o,e));return(0,m.useEffect)((()=>{const t=To(o,e);t!==i.current&&(i.current=t)}),[o,e]),{cartQuantity:Number.isFinite(i.current)?i.current:0,addingToCart:n,cartIsLoading:s,addToCart:(o=1)=>(a(!0),t(e,o).then((()=>{c("add-to-cart")})).catch((e=>{r((0,re.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})})).finally((()=>{a(!1)})))}})(n),y=Number.isFinite(_)&&_>0,x=!d&&p&&h,v=(0,re.decodeEntities)(l?.description||""),f=(({cartQuantity:e,productCartDetails:t,isDescendantOfAddToCartWithOptions:o})=>Number.isFinite(e)&&e>0?(0,s.sprintf)(/* translators: %s number of products in cart. */ /* translators: %s number of products in cart. */
(0,s._n)("%d in cart","%d in cart",e,"woocommerce"),e):o&&t?.single_text?t?.single_text:t?.text||(0,s.__)("Add to cart","woocommerce"))({cartQuantity:_,productCartDetails:l,isDescendantOfAddToCartWithOptions:t}),S=x?"button":"a",j={};return x?j.onClick=async()=>{await b(),g("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=(0,u.getSetting)("productsSettings");t&&(window.location.href=k)}:(j.href=i,j.rel="nofollow",j.onClick=()=>{g("product-view-link",{product:e})}),(0,a.jsx)(S,{...j,"aria-label":v,disabled:w,className:(0,r.A)(o,"wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",{loading:w,added:y}),style:c,children:f})},qo=({className:e,style:t})=>(0,a.jsx)("button",{className:(0,r.A)("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",e),style:t,disabled:!0,children:(0,s.__)("Add to cart","woocommerce")}),Yo=({className:e,style:t,blockClientId:o})=>{const{current:c,registerListener:n,unregisterListener:i}=function(){const{productTypes:e,current:t,registeredListeners:o}=(0,A.useSelect)((e=>{const{getProductTypes:t,getCurrentProductType:o,getRegisteredListeners:s}=e($o);return{productTypes:t(),current:o(),registeredListeners:s()}}),[]),{switchProductType:s,registerListener:r,unregisterListener:c}=(0,A.useDispatch)($o);return{productTypes:e,current:t,set:s,registeredListeners:o,registerListener:r,unregisterListener:c}}();(0,m.useEffect)((()=>{if(o)return n(o),()=>{i(o)}}),[o,n,i]);const l="external"===c?.slug?(0,s.__)("Buy product","woocommerce"):(0,s.__)("Add to cart","woocommerce");return(0,a.jsx)("button",{className:(0,r.A)("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",e),style:t,disabled:!0,children:l})},Xo=e=>{const{className:t,textAlign:o,blockClientId:s}=e,c=wo(e),{parentClassName:n}=(0,po.useInnerBlockLayoutContext)(),{isLoading:i,product:l}=(0,po.useProductDataContext)();return(0,a.jsx)("div",{className:(0,r.A)(t,"wp-block-button","wc-block-components-product-button",{[`${n}__product-add-to-cart`]:n,[`align-${o}`]:o}),children:i?(0,a.jsx)(qo,{className:c.className,style:c.style}):(0,a.jsx)(a.Fragment,{children:l.id?(0,a.jsx)(Wo,{product:l,style:c.style,className:c.className,isDescendantOfAddToCartWithOptions:e["woocommerce/isDescendantOfAddToCartWithOptions"]}):(0,a.jsx)(Yo,{style:c.style,className:c.className,isLoading:i,blockClientId:s})})})},Go=((0,ko.withProductDataContext)(Xo),({product:e})=>(0,a.jsx)("div",{className:"cross-sells-product",children:(0,a.jsx)(po.InnerBlockLayoutContextProvider,{parentName:"woocommerce/cart-cross-sells-block",parentClassName:"wp-block-cart-cross-sells-product",children:(0,a.jsxs)(po.ProductDataContextProvider,{isLoading:!1,product:e,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(So,{className:"",showSaleBadge:!0,productId:e.id,showProductLink:!0,saleBadgeAlign:"left",imageSizing:yo.SINGLE,isDescendentOfQueryLoop:!1,scale:"cover",aspectRatio:"1:1"}),(0,a.jsx)(Co,{align:"",headingLevel:3,showProductLink:!0}),(0,a.jsx)(Ro,{isDescendentOfQueryLoop:!1,isDescendentOfSingleProductBlock:!1,productId:e.id,postId:0,shouldDisplayMockedReviewsWhenProductHasNoReviews:!1}),(0,a.jsx)(Bo,{})]}),(0,a.jsx)(Xo,{})]})})})),Jo=({products:e,columns:t})=>{const o=e.map(((e,o)=>o>=t?null:(0,a.jsx)(Go,{isLoading:!1,product:e},e.id)));return(0,a.jsx)("div",{children:o})},Qo=JSON.parse('{"DD":"Cart Cross-Sells Products","uK":{"Y":{"A":3}},"XV":3}'),Ko=({className:e,columns:t})=>{const{crossSellsProducts:o}=we();return void 0===t&&(t=Qo.uK.Y.A),(0,a.jsx)(Jo,{className:e,columns:t,products:o})};o(535),o(7128),(0,d.registerBlockType)("woocommerce/cart-cross-sells-products-block",{apiVersion:Qo.XV,title:Qo.DD,icon:{src:(0,a.jsx)(l.A,{icon:kt.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{className:o,columns:r}=e,n=(0,c.useBlockProps)();return(0,a.jsxs)("div",{...n,children:[(0,a.jsx)(c.InspectorControls,{children:(0,a.jsx)(uo.PanelBody,{title:(0,s.__)("Settings","woocommerce"),children:(0,a.jsx)(uo.RangeControl,{label:(0,s.__)("Cross-Sells products to show","woocommerce"),value:r,onChange:e=>t({columns:e}),min:(0,u.getSetting)("minColumns",1),max:(0,u.getSetting)("maxColumns",6)})})}),(0,a.jsx)(St,{children:(0,a.jsx)(Ko,{columns:r,className:o})})]})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});const Zo=(0,m.forwardRef)((({children:e,className:t=""},o)=>(0,a.jsx)("div",{ref:o,className:(0,r.A)("wc-block-components-sidebar",t),children:e})));o(5675);const es=JSON.parse('{"DD":"Cart Totals","XV":3}');function ts(e){const t=(0,m.useRef)(e);return fe()(e,t.current)||(t.current=e),t.current}(0,d.registerBlockType)("woocommerce/cart-totals-block",{apiVersion:es.XV,title:es.DD,icon:{src:(0,a.jsx)(l.A,{icon:kt.A,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,c.useBlockProps)({className:"wc-block-cart__sidebar"}),o=ht(nt.innerBlockAreas.CART_TOTALS),s=[["woocommerce/cart-order-summary-block",{},[]],["woocommerce/cart-express-payment-block",{},[]],["woocommerce/proceed-to-checkout-block",{},[]],["woocommerce/cart-accepted-payment-methods-block",{},[]]];return gt({clientId:e,registeredBlocks:o,defaultTemplate:s}),(0,a.jsx)(Zo,{...t,children:(0,a.jsx)(c.InnerBlocks,{allowedBlocks:o,template:s,templateLock:!1,renderAppender:c.InnerBlocks.ButtonBlockAppender})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})})});const os=(e=!1)=>{const{paymentMethodsInitialized:t,expressPaymentMethodsInitialized:o,availablePaymentMethods:s,availableExpressPaymentMethods:r}=(0,A.useSelect)((e=>{const t=e(D.paymentStore);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),c=Object.values(s).map((({name:e})=>e)),n=Object.values(r).map((({name:e})=>e)),a=(0,$e.getPaymentMethods)(),i=(0,$e.getExpressPaymentMethods)(),l=Object.keys(a).reduce(((e,t)=>(c.includes(t)&&(e[t]=a[t]),e)),{}),d=Object.keys(i).reduce(((e,t)=>(n.includes(t)&&(e[t]=i[t]),e)),{}),m=ts(l),u=ts(d);return{paymentMethods:e?u:m,isInitialized:e?o:t}},ss=()=>os(!0);var rs=o(7035);const cs={warning:"#F0B849",error:"#CC1818",success:"#46B450",info:"#0073AA"},ns=({status:e="warning",...t})=>(0,a.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...t,children:[(0,a.jsx)("path",{d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z",stroke:cs[e],strokeWidth:"1.5"}),(0,a.jsx)("path",{d:"M13 7H11V13H13V7Z",fill:cs[e]}),(0,a.jsx)("path",{d:"M13 15H11V17H13V15Z",fill:cs[e]})]});o(4459);const as=({href:e,title:t,description:o,warning:r})=>(0,a.jsxs)("a",{href:e,className:"wc-block-editor-components-external-link-card",target:"_blank",rel:"noreferrer",children:[(0,a.jsxs)("span",{className:"wc-block-editor-components-external-link-card__content",children:[(0,a.jsx)("strong",{className:"wc-block-editor-components-external-link-card__title",children:t}),o&&(0,a.jsx)("span",{className:"wc-block-editor-components-external-link-card__description",dangerouslySetInnerHTML:{__html:Wt(o)}}),r?(0,a.jsxs)("span",{className:"wc-block-editor-components-external-link-card__warning",children:[(0,a.jsx)(l.A,{icon:(0,a.jsx)(ns,{status:"error"})}),(0,a.jsx)("span",{children:r})]}):null]}),(0,a.jsx)(uo.VisuallyHidden,{as:"span",children:/* translators: accessibility text */ /* translators: accessibility text */
(0,s.__)("(opens in a new tab)","woocommerce")}),(0,a.jsx)(l.A,{icon:rs.A,className:"wc-block-editor-components-external-link-card__icon"})]}),is=["height","borderRadius"],ls=e=>{const t=(0,A.select)(D.paymentStore).getAvailableExpressPaymentMethods();return Object.values(t).reduce(((t,o)=>t||o?.supportsStyle.some((t=>e.includes(t)))),!1)},ds=({attributes:e,setAttributes:t})=>{const{buttonHeight:o,buttonBorderRadius:r}=e;return(0,a.jsxs)(a.Fragment,{children:[ls(["height"])&&(0,a.jsx)(uo.RadioControl,{label:(0,s.__)("Button height","woocommerce"),selected:o,options:[{label:(0,s.__)("Small (40px)","woocommerce"),value:"40"},{label:(0,s.__)("Medium (48px)","woocommerce"),value:"48"},{label:(0,s.__)("Large (55px)","woocommerce"),value:"55"}],onChange:e=>t({buttonHeight:e})}),ls(["borderRadius"])&&(0,a.jsx)("div",{className:"border-radius-control-container",children:(0,a.jsx)(c.HeightControl,{label:(0,s.__)("Button border radius","woocommerce"),value:r,onChange:e=>{const o=e.replace("px","");t({buttonBorderRadius:o})}})})]})},ms=({attributes:e,setAttributes:t})=>e.showButtonStyles?(0,a.jsx)(ds,{attributes:e,setAttributes:t}):null,us=()=>{const e=(0,A.select)(D.paymentStore).getAvailableExpressPaymentMethods();return Object.entries(e).length<1?(0,a.jsx)("p",{className:"wc-block-checkout__controls-text",children:(0,s.__)("You currently have no express payment integrations active.","woocommerce")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"wc-block-checkout__controls-text",children:(0,s.__)("You currently have the following express payment integrations active.","woocommerce")}),Object.values(e).map((e=>(0,a.jsx)(as,{href:`${u.ADMIN_URL}admin.php?page=wc-settings&tab=checkout&section=${encodeURIComponent(e.gatewayId)}`,title:e.title,description:e.description},e.name)))]})},ps=(0,a.jsxs)(a.Fragment,{children:[(0,s.__)("Apply uniform styles","woocommerce")," ",(0,a.jsx)("span",{className:"express-payment-styles-beta-badge",children:"Beta"})]}),hs=({attributes:e,setAttributes:t})=>(0,a.jsxs)(c.InspectorControls,{children:[ls(is)&&(0,a.jsxs)(uo.PanelBody,{title:(0,s.__)("Button Settings","woocommerce"),className:"express-payment-button-settings",children:[(0,a.jsx)(uo.ToggleControl,{label:ps,checked:e.showButtonStyles,onChange:()=>t({showButtonStyles:!e.showButtonStyles}),help:(0,s.__)("Sets a consistent style for express payment buttons.","woocommerce")}),(0,a.jsxs)(uo.Notice,{status:"warning",isDismissible:!1,className:"wc-block-checkout__notice express-payment-styles-notice",children:[(0,a.jsxs)("strong",{children:[(0,s.__)("Note","woocommerce"),":"]})," ",(0,s.__)("Some payment methods might not yet support all style controls","woocommerce")]}),(0,a.jsx)(ms,{attributes:e,setAttributes:t})]}),(0,a.jsx)(uo.PanelBody,{title:(0,s.__)("Express Payment Methods","woocommerce"),children:(0,a.jsx)(us,{})})]});o(9961);const gs=({children:e,className:t,screenReaderLabel:o,showSpinner:c=!1,isLoading:n=!0})=>(0,a.jsxs)("div",{className:(0,r.A)(t,{"wc-block-components-loading-mask":n}),children:[n&&c&&(0,a.jsx)(Nt.Spinner,{}),(0,a.jsx)("div",{className:(0,r.A)({"wc-block-components-loading-mask__children":n}),"aria-hidden":n,children:e}),n&&(0,a.jsx)("span",{className:"screen-reader-text",children:o||(0,s.__)("Loading…","woocommerce")})]}),_s=(0,a.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,a.jsx)("path",{d:"M0 0h24v24H0z"}),(0,a.jsx)("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,a.jsx)("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"})]})});var ws=o(6600),ks=o(8486),bs=o(6208);o(9287);const ys={bank:ws.A,bill:ks.A,card:bs.A,checkPayment:_s},xs=({icon:e="",text:t=""})=>{const o=!!e,s=(0,m.useCallback)((e=>o&&(0,Z.isString)(e)&&(0,Z.objectHasProp)(ys,e)),[o]),c=(0,r.A)("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":o});return(0,a.jsxs)("span",{className:c,children:[s(e)?(0,a.jsx)(l.A,{icon:ys[e]}):e,t]})},vs=e=>`wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${e}`,fs=({id:e,src:t=null,alt:o=""})=>t?(0,a.jsx)("img",{className:vs(e),src:t,alt:o}):null,Ss=[{id:"alipay",alt:"Alipay",src:h+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:h+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:h+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:h+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:h+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:h+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:h+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:h+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:h+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:h+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:h+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:h+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:h+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:h+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:h+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:h+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:h+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:h+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:h+"payment-methods/wechat.svg"}];o(6983);const js=({icons:e=[],align:t="center",className:o})=>{const s=(e=>{const t={};return e.forEach((e=>{let o={};"string"==typeof e&&(o={id:e,alt:e,src:null}),"object"==typeof e&&(o={id:e.id||"",alt:e.alt||"",src:e.src||null}),o.id&&(0,Z.isString)(o.id)&&!t[o.id]&&(t[o.id]=o)})),Object.values(t)})(e);if(0===s.length)return null;const c=(0,r.A)("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},o);return(0,a.jsx)("div",{className:c,children:s.map((e=>{const t={...e,...(o=e.id,Ss.find((e=>e.id===o))||{})};var o;return(0,a.jsx)(fs,{...t},"payment-method-icon-"+e.id)}))})},Cs=(e="")=>{const{cartCoupons:t,cartIsLoading:o}=we(),{applyCoupon:r,removeCoupon:c}=(0,A.useDispatch)(D.cartStore),{isApplyingCoupon:n,isRemovingCoupon:a,orderId:i}=(0,A.useSelect)((e=>({isApplyingCoupon:e(D.cartStore).isApplyingCoupon(),isRemovingCoupon:e(D.cartStore).isRemovingCoupon(),orderId:e(D.checkoutStore).getOrderId()})),[]),l=(0,m.useCallback)((e=>i&&i>0&&e?.data?.details?.checkout?e.data.details.checkout:e?.data?.details?.cart?e.data.details.cart:e.message),[i]);return{appliedCoupons:t,isLoading:o,applyCoupon:(0,m.useCallback)((t=>r(t).then((()=>((0,nt.applyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&(0,A.dispatch)("core/notices").createNotice("info",(0,s.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,s.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((e=>{const t=l(e);return(0,A.dispatch)(D.validationStore).setValidationErrors({coupon:{message:(0,re.decodeEntities)(t),hidden:!1}}),Promise.resolve(!1)}))),[r,l,e]),removeCoupon:(0,m.useCallback)((t=>c(t).then((()=>((0,nt.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&(0,A.dispatch)("core/notices").createNotice("info",(0,s.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,s.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),(0,re.decodeEntities)(t)),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((t=>((0,A.dispatch)("core/notices").createErrorNotice(t.message,{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!1))))),[c,e]),isApplyingCoupon:n,isRemovingCoupon:a}},Ps=(e,t)=>{const o=[],r=(t,o)=>{const s=o+"_tax",r=(0,Z.objectHasProp)(e,o)&&(0,Z.isString)(e[o])?parseInt(e[o],10):0;return{key:o,label:t,value:r,valueWithTax:r+((0,Z.objectHasProp)(e,s)&&(0,Z.isString)(e[s])?parseInt(e[s],10):0)}};return o.push(r((0,s.__)("Subtotal:","woocommerce"),"total_items")),o.push(r((0,s.__)("Fees:","woocommerce"),"total_fees")),o.push(r((0,s.__)("Discount:","woocommerce"),"total_discount")),o.push({key:"total_tax",label:(0,s.__)("Taxes:","woocommerce"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&o.push(r((0,s.__)("Shipping:","woocommerce"),"total_shipping")),o};class Ns extends m.Component{state={errorMessage:"",hasError:!1};static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:o}=this.props;if(e){let e=(0,s.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(o||u.CURRENT_USER_IS_ADMIN)&&(e=t||(0,s.__)("There was an error with this payment method. Please verify it's configured correctly.","woocommerce"));const r=[{id:"0",content:e,isDismissible:!1,status:"error"}];return(0,a.jsx)(Nt.StoreNoticesContainer,{additionalNotices:r,context:ee.PAYMENTS})}return this.props.children}}const Es=Ns,As="wc/store/payment",Is=(0,m.createContext)({showButtonStyles:!1,buttonHeight:"48",buttonBorderRadius:"4"}),Rs=()=>{const{isEditor:e}=R(),{showButtonStyles:t,buttonHeight:o,buttonBorderRadius:r}=(0,m.useContext)(Is),c=t?{height:o,borderRadius:r}:void 0,{activePaymentMethod:n,paymentMethodData:i}=(0,A.useSelect)((e=>{const t=e(As);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData()}})),{__internalSetActivePaymentMethod:l,__internalSetExpressPaymentStarted:d,__internalSetPaymentIdle:p,__internalSetPaymentError:h,__internalSetPaymentMethodData:g,__internalSetExpressPaymentError:_}=(0,A.useDispatch)(As),{paymentMethods:w}=ss(),k=(()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:o,onCheckoutAfterProcessingWithError:r,onSubmit:c}=(0,m.useContext)(Ve),{onCheckoutValidation:n,onCheckoutSuccess:a,onCheckoutFail:i}=De.checkoutEvents,{isCalculating:l,isComplete:d,isIdle:p,isProcessing:h,customerId:g}=(0,A.useSelect)((e=>{const t=e(D.checkoutStore);return{isComplete:t.isComplete(),isIdle:t.isIdle(),isProcessing:t.isProcessing(),customerId:t.getCustomerId(),isCalculating:t.isCalculating()}}),[]),{paymentIsIdle:_,paymentIsStarted:w,paymentIsProcessing:k,paymentHasError:b,paymentIsReady:y,paymentIsDoingExpressPayment:x,activePaymentMethod:v,shouldSavePayment:f}=(0,A.useSelect)((e=>{const t=e(D.paymentStore);return{paymentIsIdle:t.isPaymentIdle(),paymentIsStarted:t.isExpressPaymentStarted(),paymentIsProcessing:t.isPaymentProcessing(),paymentHasError:t.hasPaymentError(),paymentIsReady:t.isPaymentReady(),paymentIsDoingExpressPayment:t.isExpressPaymentMethodActive(),activePaymentMethod:t.getActivePaymentMethod(),shouldSavePayment:t.getShouldSavePaymentMethod()}}),[]),S={isIdle:_,isStarted:w,isProcessing:k,hasError:b,isReady:y,isDoingExpressPayment:x,get isPristine(){return O()("isPristine",{since:"9.6.0",alternative:"isIdle",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),_},get isFinished(){return O()("isFinished",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),b||y},get hasFailed(){return O()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),b},get isSuccessful(){return O()("isSuccessful",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),y}},{__internalSetExpressPaymentError:j}=(0,A.useDispatch)(D.paymentStore),{onPaymentProcessing:C,onPaymentSetup:P}=(0,m.useContext)(z),{shippingErrorStatus:N,shippingErrorTypes:E,onShippingRateSuccess:I,onShippingRateFail:R,onShippingRateSelectSuccess:B,onShippingRateSelectFail:T}=Ie(),{shippingRates:M,isLoadingRates:L,selectedRates:F,isSelectingRate:V,selectShippingRate:H,needsShipping:U}=Ce(),{billingAddress:$,shippingAddress:W}=(0,A.useSelect)((e=>e(D.cartStore).getCustomerData()),[]),{setShippingAddress:q}=(0,A.useDispatch)(D.cartStore),{cartItems:Y,cartFees:X,cartTotals:G,extensions:J}=we(),{appliedCoupons:Q}=Cs(),K=(0,m.useRef)(Ps(G,U)),te=(0,m.useRef)({label:(0,s.__)("Total","woocommerce"),value:parseInt(G.total_price,10)});(0,m.useEffect)((()=>{K.current=Ps(G,U),te.current={label:(0,s.__)("Total","woocommerce"),value:parseInt(G.total_price,10)}}),[G,U]);const oe=(0,m.useCallback)(((e="")=>{O()("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"}),j(e)}),[j]);return{activePaymentMethod:v,billing:{appliedCoupons:Q,billingAddress:$,billingData:$,cartTotal:te.current,cartTotalItems:K.current,currency:(0,Et.getCurrencyFromPriceResponse)(G),customerId:g,displayPricesIncludingTax:(0,u.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:Y,cartFees:X,extensions:J},checkoutStatus:{isCalculating:l,isComplete:d,isIdle:p,isProcessing:h},components:{LoadingMask:gs,PaymentMethodIcons:js,PaymentMethodLabel:xs,ValidationInputError:Nt.ValidationInputError},emitResponse:{noticeContexts:ee,responseTypes:Z.responseTypes},eventRegistration:{onCheckoutAfterProcessingWithError:r,onCheckoutAfterProcessingWithSuccess:o,onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutSuccess:a,onCheckoutFail:i,onCheckoutValidation:n,onPaymentProcessing:C,onPaymentSetup:P,onShippingRateFail:R,onShippingRateSelectFail:T,onShippingRateSelectSuccess:B,onShippingRateSuccess:I},onSubmit:c,paymentStatus:S,setExpressPaymentError:oe,shippingData:{isSelectingRate:V,needsShipping:U,selectedRates:F,setSelectedRates:H,setShippingAddress:q,shippingAddress:W,shippingRates:M,shippingRatesLoading:L},shippingStatus:{shippingErrorStatus:N,shippingErrorTypes:E},shouldSavePayment:f}})(),b=(0,m.useRef)(n),y=(0,m.useRef)(i),x=(0,m.useCallback)((e=>()=>{b.current=n,y.current=i,d(),l(e)}),[n,i,l,d]),v=(0,m.useCallback)((()=>{p(),l(b.current,y.current)}),[l,p]),f=(0,m.useCallback)((e=>{h(),g(e),_(e),l(b.current,y.current)}),[l,h,g,_]),S=(0,m.useCallback)(((e="")=>{O()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?f(e):_("")}),[_,f]),j=Object.entries(w),C=j.length>0?j.map((([t,o])=>{const s=e?o.edit:o.content;return(0,m.isValidElement)(s)?(0,a.jsx)("li",{id:`express-payment-method-${t}`,children:(0,m.cloneElement)(s,{...k,onClick:x(t),onClose:v,onError:f,setExpressPaymentError:S,buttonAttributes:c})},t):null})):(0,a.jsx)("li",{children:(0,s.__)("No registered Payment Methods","woocommerce")},"noneRegistered");return(0,a.jsx)(Es,{isEditor:e,children:(0,a.jsx)("ul",{className:"wc-block-components-express-payment__event-buttons",children:C})})};o(2831);const Bs=()=>{const{paymentMethods:e,isInitialized:t}=ss(),{isCalculating:o,isProcessing:r,isAfterProcessing:c,isBeforeProcessing:n,isComplete:i,hasError:l}=(0,A.useSelect)((e=>{const t=e(D.checkoutStore);return{isCalculating:t.isCalculating(),isProcessing:t.isProcessing(),isAfterProcessing:t.isAfterProcessing(),isBeforeProcessing:t.isBeforeProcessing(),isComplete:t.isComplete(),hasError:t.hasError()}})),d=(0,A.useSelect)((e=>e(D.paymentStore).isExpressPaymentMethodActive()));if(!t||t&&0===Object.keys(e).length)return null;const m=r||c||n||i&&!l;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(gs,{isLoading:o||m||d,children:(0,a.jsx)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart",children:(0,a.jsxs)("div",{className:"wc-block-components-express-payment__content",children:[(0,a.jsx)(Nt.StoreNoticesContainer,{context:ee.EXPRESS_PAYMENTS}),(0,a.jsx)(Rs,{})]})})}),(0,a.jsx)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart",children:(0,s.__)("Or","woocommerce")})]})},Ts=({className:e})=>{const{cartNeedsPayment:t}=we();return t?(0,a.jsx)("div",{className:(0,r.A)("wc-block-cart__payment-options",e),children:(0,a.jsx)(Bs,{})}):null};o(7467);const Ds=(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{stroke:"#1E1E1E",strokeLinejoin:"round",strokeWidth:"1.5",d:"M18.25 12a6.25 6.25 0 1 1-12.5 0 6.25 6.25 0 0 1 12.5 0Z"}),(0,a.jsx)("path",{fill:"#1E1E1E",d:"M10 3h4v3h-4z"}),(0,a.jsx)("rect",{width:"1.5",height:"5",x:"11.25",y:"8",fill:"#1E1E1E",rx:".75"}),(0,a.jsx)("path",{fill:"#1E1E1E",d:"m15.7 4.816 1.66 1.078-1.114 1.718-1.661-1.078z"})]}),Ms=JSON.parse('{"DD":"Express Checkout","XV":3}');(0,d.registerBlockType)("woocommerce/cart-express-payment-block",{apiVersion:Ms.XV,title:Ms.DD,icon:{src:(0,a.jsx)(l.A,{style:{fill:"none"},icon:Ds,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{paymentMethods:o,isInitialized:s}=ss(),n=Object.keys(o).length>0,i=(0,c.useBlockProps)({className:(0,r.A)({"wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods":n})}),{className:l,showButtonStyles:d,buttonHeight:m,buttonBorderRadius:u}=e;return s&&n?(0,a.jsxs)("div",{...i,children:[(0,a.jsx)(hs,{attributes:e,setAttributes:t}),(0,a.jsx)(Is.Provider,{value:{showButtonStyles:d,buttonHeight:m,buttonBorderRadius:u},children:(0,a.jsx)(Ts,{className:l})})]}):null},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});var Os=o(6012);const Ls=(0,s.__)("Proceed to Checkout","woocommerce"),Fs={checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}},buttonLabel:{type:"string",default:Ls}};var Vs=o(111);o(6882);const Hs=(0,m.forwardRef)(((e,t)=>{const{className:o,children:s,variant:c="contained",removeTextWrap:n=!1,...i}=e,l=(0,r.A)("wc-block-components-button","wp-element-button",o,c);if("href"in e)return(0,a.jsx)(Vs.$,{render:(0,a.jsx)("a",{ref:t,href:e.href,children:(0,a.jsx)("div",{className:"wc-block-components-button__text",children:s})}),className:l,...i});const d=n?e.children:(0,a.jsx)("div",{className:"wc-block-components-button__text",children:e.children});return(0,a.jsx)(Vs.$,{ref:t,className:l,...i,children:d})})),zs=({onChange:e,placeholder:t,value:o,children:s,...r})=>(0,a.jsxs)(Hs,{...r,children:[(0,a.jsx)(c.RichText,{multiline:!1,allowedFormats:[],value:o,placeholder:t,onChange:e}),s]}),Us=(e,t)=>{if(!e.title.raw)return e.slug;const o=1===t.filter((t=>t.title.raw===e.title.raw)).length;return e.title.raw+(o?"":` - ${e.slug}`)},$s=({setPageId:e,pageId:t,labels:o})=>{const r=(0,A.useSelect)((e=>e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})),[])||null;return r?(0,a.jsx)(uo.PanelBody,{title:o.title,children:(0,a.jsx)(uo.SelectControl,{label:(0,s.__)("Link to","woocommerce"),value:t,options:[{label:o.default,value:0},...r.map((e=>({label:Us(e,r),value:parseInt(e.id,10)})))],onChange:t=>e(parseInt(t,10))})}):null};o(2766);const Ws=JSON.parse('{"DD":"Proceed to Checkout","XV":3}');(0,d.registerBlockType)("woocommerce/proceed-to-checkout-block",{apiVersion:Ws.XV,title:Ws.DD,icon:{src:(0,a.jsx)(l.A,{icon:Os.A,className:"wc-block-editor-components-block-icon"})},attributes:Fs,edit:({attributes:e,setAttributes:t})=>{const o=(0,c.useBlockProps)(),{checkoutPageId:r=0,buttonLabel:n}=e,{current:i}=(0,m.useRef)(r),l=(0,A.useSelect)((e=>i||e("core/editor").getCurrentPostId()),[i]);return(0,a.jsxs)("div",{...o,children:[(0,a.jsx)(c.InspectorControls,{children:!(l===w&&0===i)&&(0,a.jsx)($s,{pageId:r,setPageId:e=>t({checkoutPageId:e}),labels:{title:(0,s.__)("Proceed to Checkout button","woocommerce"),default:(0,s.__)("WooCommerce Checkout Page","woocommerce")}})}),(0,a.jsx)(zs,{className:"wc-block-cart__submit-button",value:n,placeholder:Ls,onChange:e=>{t({buttonLabel:e})}})]})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});const qs=(0,a.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"}),(0,a.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"})]}),Ys=g?["core/paragraph",{align:"center",content:(0,s.sprintf)(/* translators: %s is the link to the store product directory. */ /* translators: %s is the link to the store product directory. */
(0,s.__)('<a href="%s">Browse store</a>',"woocommerce"),g),dropCap:!1}]:null,Xs=[["core/heading",{textAlign:"center",content:(0,s.__)("Your cart is currently empty!","woocommerce"),level:2,className:"with-empty-cart-icon wc-block-cart__empty-cart__title"}],Ys,["core/separator",{className:"is-style-dots"}],["core/heading",{textAlign:"center",content:(0,s.__)("New in store","woocommerce"),level:2}],["woocommerce/product-new",{columns:4,rows:1}]].filter(Boolean);o(9685);const Gs=JSON.parse('{"DD":"Empty Cart","XV":3}');(0,d.registerBlockType)("woocommerce/empty-cart-block",{apiVersion:Gs.XV,title:Gs.DD,icon:{src:(0,a.jsx)(l.A,{icon:qs,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,c.useBlockProps)(),{currentView:o}=R(),s=ht(nt.innerBlockAreas.EMPTY_CART);return gt({clientId:e,registeredBlocks:s,defaultTemplate:Xs}),(0,a.jsx)("div",{...t,hidden:"woocommerce/empty-cart-block"!==o,children:(0,a.jsx)(c.InnerBlocks,{template:Xs,templateLock:!1,renderAppender:c.InnerBlocks.ButtonBlockAppender})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})})});const Js=e=>Object.values(e).reduce(((e,t)=>(null!==t.icons&&(e=e.concat(t.icons)),e)),[]),Qs=({className:e})=>{const{paymentMethods:t}=os(!1);return(0,a.jsx)(js,{className:e,icons:Js(t)})},Ks=JSON.parse('{"DD":"Accepted Payment Methods","XV":3}');(0,d.registerBlockType)("woocommerce/cart-accepted-payment-methods-block",{apiVersion:Ks.XV,title:Ks.DD,icon:{src:(0,a.jsx)(l.A,{icon:bs.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,c.useBlockProps)();return(0,a.jsx)("div",{...o,children:(0,a.jsx)(Qs,{className:t})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});const Zs=(0,a.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none",children:[(0,a.jsx)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z",clipRule:"evenodd"}),(0,a.jsx)("path",{fill:"currentColor",d:"M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"})]});o(9581);const er=({instanceId:e,isLoading:t=!1,onSubmit:o,displayCouponForm:c=!1})=>{const[n,i]=(0,m.useState)(""),[l,d]=(0,m.useState)(c),u=`wc-block-components-totals-coupon__input-${e}`,{validationErrorId:p}=(0,A.useSelect)((t=>({validationErrorId:t(D.validationStore).getValidationErrorId(e)})),[e]),h=(0,m.useRef)(null);return(0,a.jsx)(Nt.Panel,{className:"wc-block-components-totals-coupon",initialOpen:l,hasBorder:!1,headingLevel:2,title:(0,s.__)("Add coupons","woocommerce"),state:[l,d],children:(0,a.jsx)(gs,{screenReaderLabel:(0,s.__)("Applying coupon…","woocommerce"),isLoading:t,showSpinner:!1,children:(0,a.jsxs)("div",{className:"wc-block-components-totals-coupon__content",children:[(0,a.jsxs)("form",{className:"wc-block-components-totals-coupon__form",id:"wc-block-components-totals-coupon__form",children:[(0,a.jsx)(Nt.ValidatedTextInput,{id:u,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:(0,s.__)("Enter code","woocommerce"),value:n,ariaDescribedBy:p||"",onChange:e=>{i(e)},focusOnMount:!0,validateOnMount:!1,showError:!1,ref:h}),(0,a.jsxs)(Hs,{className:(0,r.A)("wc-block-components-totals-coupon__button",{"wc-block-components-totals-coupon__button--loading":t}),disabled:t||!n,onClick:e=>{e.preventDefault(),void 0!==o?o(n)?.then((e=>{e?(i(""),d(!1)):h.current?.focus&&h.current.focus()})):(i(""),d(!0))},type:"submit",children:[t&&(0,a.jsx)(Nt.Spinner,{}),(0,s.__)("Apply","woocommerce")]})]}),(0,a.jsx)(Nt.ValidationInputError,{propertyName:"coupon",elementId:e})]})})})};o(619);const tr={context:"summary"},or=({cartCoupons:e=[],currency:t,isRemovingCoupon:o,removeCoupon:r,values:c})=>{const{total_discount:n,total_discount_tax:i}=c,l=parseInt(n,10),d=(0,nt.applyCheckoutFilter)({arg:tr,filterName:"coupons",defaultValue:e});if(!l&&0===d.length)return null;const m=parseInt(i,10),p=(0,u.getSetting)("displayCartPricesIncludingTax",!1)?l+m:l;return(0,a.jsx)(Nt.TotalsItem,{className:"wc-block-components-totals-discount",currency:t,description:0!==d.length&&(0,a.jsx)(gs,{screenReaderLabel:(0,s.__)("Removing coupon…","woocommerce"),isLoading:o,showSpinner:!1,children:(0,a.jsx)("ul",{className:"wc-block-components-totals-discount__coupon-list",children:d.map((e=>(0,a.jsx)(Nt.RemovableChip,{className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:(0,s.sprintf)(/* translators: %s Coupon code. */ /* translators: %s Coupon code. */
(0,s.__)("Coupon: %s","woocommerce"),e.label),disabled:o,onRemove:()=>{r(e.code)},radius:"large",ariaLabel:(0,s.sprintf)(/* translators: %s is a coupon code. */ /* translators: %s is a coupon code. */
(0,s.__)('Remove coupon "%s"',"woocommerce"),e.label)},"coupon-"+e.code)))})}),label:p?(0,s.__)("Discount","woocommerce"):(0,s.__)("Coupons","woocommerce"),value:p?-1*p:"-"})};o(8413);const sr=({currency:e,values:t,className:o,isEstimate:c=!1})=>{const n=(0,u.getSetting)("taxesEnabled",!0)&&(0,u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:i,total_tax:l,tax_lines:d}=t,{receiveCart:p,...h}=we(),g=(0,nt.applyCheckoutFilter)({filterName:"totalLabel",defaultValue:c?(0,s.__)("Estimated total","woocommerce"):(0,s.__)("Total","woocommerce"),extensions:h.extensions,arg:{cart:h}}),_=(0,nt.applyCheckoutFilter)({filterName:"totalValue",defaultValue:"<price/>",extensions:h.extensions,arg:{cart:h},validation:nt.productPriceValidation}),w=(0,a.jsx)(Nt.FormattedMonetaryAmount,{className:"wc-block-components-totals-footer-item-tax-value",currency:e,value:parseInt(i,10)}),k=(0,m.createInterpolateElement)(_,{price:w}),b=parseInt(l,10),y=d&&d.length>0?(0,s.sprintf)(/* translators: %s is a list of tax rates */ /* translators: %s is a list of tax rates */
(0,s.__)("Including %s","woocommerce"),d.map((({name:t,price:o})=>`${(0,Et.formatPrice)(o,e)} ${t}`)).join(", ")):(0,s.__)("Including <TaxAmount/> in taxes","woocommerce"),x=ye(h.shippingRates),v=h.cartNeedsShipping;return(0,a.jsx)(Nt.TotalsItem,{className:(0,r.A)("wc-block-components-totals-footer-item",o),currency:e,label:g,value:k,description:(0,a.jsxs)(a.Fragment,{children:[n&&0!==b&&(0,a.jsx)("p",{className:"wc-block-components-totals-footer-item-tax",children:(0,m.createInterpolateElement)(y,{TaxAmount:(0,a.jsx)(Nt.FormattedMonetaryAmount,{className:"wc-block-components-totals-footer-item-tax-value",currency:e,value:b})})}),c&&!x&&v&&(0,a.jsx)("p",{className:"wc-block-components-totals-footer-item-shipping",children:(0,s.__)("Shipping will be calculated at checkout","woocommerce")})]})})},rr=()=>{const{shippingRates:e}=we(),t=xe(e);return t?(0,a.jsx)("div",{className:"wc-block-components-totals-shipping__via",children:(0,re.decodeEntities)(t.filter(((e,o)=>t.indexOf(e)===o)).join(", "))}):null},cr=e=>{const t=(e=>(0,u.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.total_shipping,10)+parseInt(e.total_shipping_tax,10):parseInt(e.total_shipping,10))(e);return 0===t?(0,a.jsx)("strong",{children:(0,s.__)("Free","woocommerce")}):t};o(6562);const nr=({label:e=(0,s.__)("Shipping","woocommerce"),placeholder:t=null,collaterals:o=null})=>{const{cartTotals:r,shippingRates:c}=we(),n=ye(c),i=xe(c),l=i.length>1,d=!n||l?e:i[0];return(0,a.jsx)("div",{className:"wc-block-components-totals-shipping",children:(0,a.jsx)(Nt.TotalsItem,{label:d,value:n?cr(r):t,description:(0,a.jsxs)(a.Fragment,{children:[l&&(0,a.jsx)(rr,{}),o&&(0,a.jsx)("div",{className:"wc-block-components-totals-shipping__collaterals",children:o})]}),currency:(0,Et.getCurrencyFromPriceResponse)(r)})})},ar=()=>{const{extensions:e,receiveCart:t,...o}=we(),s={extensions:e,cart:o,context:"woocommerce/cart"};return(0,a.jsx)(nt.ExperimentalOrderMeta.Slot,{...s})},ir=JSON.parse('{"DD":"Order Summary","xY":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"uK":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"XV":3}'),lr=[{attributes:ir.uK,save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})}),supports:ir.xY,migrate:({attributes:e})=>[e,[(0,d.createBlock)("woocommerce/cart-order-summary-heading-block",{content:(0,s.__)("Cart totals","woocommerce")},[]),(0,d.createBlock)("woocommerce/cart-order-summary-coupon-form-block",{},[]),(0,d.createBlock)("woocommerce/cart-order-summary-totals-block",{},[(0,d.createBlock)("woocommerce/cart-order-summary-subtotal-block",{},[]),(0,d.createBlock)("woocommerce/cart-order-summary-fee-block",{},[]),(0,d.createBlock)("woocommerce/cart-order-summary-discount-block",{},[]),(0,d.createBlock)("woocommerce/cart-order-summary-shipping-block",{},[]),(0,d.createBlock)("woocommerce/cart-order-summary-taxes-block",{},[])])]],isEligible:(e,t)=>!t.some((e=>"woocommerce/cart-order-summary-totals-block"===e.name))}],dr=lr;(0,d.registerBlockType)("woocommerce/cart-order-summary-block",{apiVersion:ir.XV,title:ir.DD,icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,c.useBlockProps)(),{cartTotals:o}=we(),r=(0,Et.getCurrencyFromPriceResponse)(o),n=ht(nt.innerBlockAreas.CART_ORDER_SUMMARY),i=[["woocommerce/cart-order-summary-heading-block",{content:(0,s.__)("Cart totals","woocommerce")},[]],["woocommerce/cart-order-summary-coupon-form-block",{},[]],["woocommerce/cart-order-summary-totals-block",{},[]]];return gt({clientId:e,registeredBlocks:n,defaultTemplate:i}),(0,a.jsxs)("div",{...t,children:[(0,a.jsx)(c.InnerBlocks,{allowedBlocks:n,template:i}),(0,a.jsx)("div",{className:"wc-block-components-totals-wrapper",children:(0,a.jsx)(sr,{currency:r,values:o,isEstimate:!0})}),(0,a.jsx)(ar,{})]})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})}),deprecated:dr});const mr=({className:e=""})=>{const{cartTotals:t}=we();if(!parseFloat(t.total_fees)&&!parseFloat(t.total_discount)&&!parseFloat(t.total_shipping))return null;const o=(0,Et.getCurrencyFromPriceResponse)(t);return(0,a.jsx)(Nt.TotalsWrapper,{className:e,children:(0,a.jsx)(Nt.Subtotal,{currency:o,values:t})})},ur=JSON.parse('{"DD":"Subtotal","XV":3}');(0,d.registerBlockType)("woocommerce/cart-order-summary-subtotal-block",{apiVersion:ur.XV,title:ur.DD,icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,c.useBlockProps)();return(0,a.jsx)("div",{...o,children:(0,a.jsx)(mr,{className:t})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})}),o(2115);const pr=JSON.parse('{"DD":"Totals","XV":3}');(0,d.registerBlockType)("woocommerce/cart-order-summary-totals-block",{apiVersion:pr.XV,title:pr.DD,icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,c.useBlockProps)(),o=ht(nt.innerBlockAreas.CART_ORDER_SUMMARY_TOTALS),s=[["woocommerce/cart-order-summary-subtotal-block",{},[]],["woocommerce/cart-order-summary-fee-block",{},[]],["woocommerce/cart-order-summary-discount-block",{},[]],["woocommerce/cart-order-summary-shipping-block",{},[]],["woocommerce/cart-order-summary-taxes-block",{},[]]];return gt({clientId:e,registeredBlocks:o,defaultTemplate:s}),(0,a.jsx)("div",{...t,children:(0,a.jsx)(c.InnerBlocks,{allowedBlocks:o,template:s})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save(),children:(0,a.jsx)(c.InnerBlocks.Content,{})})});const hr=({className:e})=>{const{cartFees:t,cartTotals:o}=we();if(!t.length)return null;const s=(0,Et.getCurrencyFromPriceResponse)(o);return(0,a.jsx)(Nt.TotalsWrapper,{className:e,children:(0,a.jsx)(Nt.TotalsFees,{currency:s,cartFees:t})})};(0,d.registerBlockType)("woocommerce/cart-order-summary-fee-block",{apiVersion:3,title:"Fees",icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,c.useBlockProps)();return(0,a.jsx)("div",{...o,children:(0,a.jsx)(hr,{className:t})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});const gr=()=>{const{extensions:e,receiveCart:t,...o}=we(),s={extensions:e,cart:o,context:"woocommerce/cart"};return(0,a.jsx)(nt.ExperimentalDiscountsMeta.Slot,{...s})},_r=({className:e})=>{const{cartTotals:t,cartCoupons:o}=we(),{removeCoupon:s,isRemovingCoupon:r}=Cs("wc/cart");if(!o.length)return(0,a.jsx)(gr,{});const c=(0,Et.getCurrencyFromPriceResponse)(t);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Nt.TotalsWrapper,{className:e,children:(0,a.jsx)(or,{cartCoupons:o,currency:c,isRemovingCoupon:r,removeCoupon:s,values:t})}),(0,a.jsx)(gr,{})]})},wr=JSON.parse('{"DD":"Discount","XV":3}');(0,d.registerBlockType)("woocommerce/cart-order-summary-discount-block",{apiVersion:wr.XV,title:wr.DD,icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,c.useBlockProps)();return(0,a.jsx)("div",{...o,children:(0,a.jsx)(_r,{className:t})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});const kr=({className:e})=>{const{cartNeedsShipping:t,shippingRates:o}=we();return t&&ye(o)?(0,a.jsx)(nt.TotalsWrapper,{className:e,children:(0,a.jsx)(nr,{label:(0,s.__)("Shipping","woocommerce"),placeholder:(0,a.jsx)("span",{className:"wc-block-components-shipping-placeholder__value",children:(0,s.__)("Calculated at checkout","woocommerce")})})}):null},br=JSON.parse('{"DD":"Shipping","XV":3}');(0,d.registerBlockType)("woocommerce/cart-order-summary-shipping-block",{apiVersion:br.XV,title:br.DD,icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,c.useBlockProps)();return(0,a.jsxs)("div",{...o,children:[(0,a.jsx)(c.InspectorControls,{children:!!y&&(0,a.jsxs)(uo.PanelBody,{title:(0,s.__)("Shipping Calculations","woocommerce"),children:[(0,a.jsx)("p",{className:"wc-block-checkout__controls-text",children:(0,s.__)("Options that control shipping can be managed in your store settings.","woocommerce")}),(0,a.jsx)(uo.ExternalLink,{href:`${u.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&section=options`,children:(0,s.__)("Manage shipping options","woocommerce")})," "]})}),(0,a.jsx)(St,{children:(0,a.jsx)(kr,{className:t})})]})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});var yr=o(1686);const xr=JSON.parse('{"DD":"Coupon Form","XV":3}'),vr=({className:e})=>{const t=(0,u.getSetting)("couponsEnabled",!0),{applyCoupon:o,isApplyingCoupon:s}=Cs("wc/cart");return t?(0,a.jsx)(Nt.TotalsWrapper,{className:e,children:(0,a.jsx)(er,{onSubmit:o,isLoading:s,instanceId:"coupon"})}):null};(0,d.registerBlockType)("woocommerce/cart-order-summary-coupon-form-block",{apiVersion:xr.XV,title:xr.DD,icon:{src:(0,a.jsx)(l.A,{icon:yr.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,c.useBlockProps)();return(0,a.jsx)("div",{...o,children:(0,a.jsx)(St,{children:(0,a.jsx)(vr,{className:t})})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})});const fr=({className:e,showRateAfterTaxName:t})=>{const{cartTotals:o}=we();if((0,u.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(o.total_tax,10)<=0)return null;const s=(0,Et.getCurrencyFromPriceResponse)(o);return(0,a.jsx)(Nt.TotalsWrapper,{className:e,children:(0,a.jsx)(Nt.TotalsTaxes,{showRateAfterTaxName:t,currency:s,values:o})})},Sr={showRateAfterTaxName:{type:"boolean",default:(0,u.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}},jr=JSON.parse('{"DD":"Taxes","XV":3}');(0,d.registerBlockType)("woocommerce/cart-order-summary-taxes-block",{apiVersion:jr.XV,title:jr.DD,icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},attributes:Sr,edit:({attributes:e,setAttributes:t})=>{const{className:o,showRateAfterTaxName:r}=e,n=(0,c.useBlockProps)(),i=(0,u.getSetting)("taxesEnabled"),l=(0,u.getSetting)("displayItemizedTaxes",!1),d=(0,u.getSetting)("displayCartPricesIncludingTax",!1);return(0,a.jsxs)("div",{...n,children:[(0,a.jsx)(c.InspectorControls,{children:i&&l&&!d&&(0,a.jsx)(uo.PanelBody,{title:(0,s.__)("Taxes","woocommerce"),children:(0,a.jsx)(uo.ToggleControl,{label:(0,s.__)("Show rate after tax name","woocommerce"),help:(0,s.__)("Show the percentage rate alongside each tax line in the summary.","woocommerce"),checked:r,onChange:()=>t({showRateAfterTaxName:!r})})})}),(0,a.jsx)(fr,{className:o,showRateAfterTaxName:r})]})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})}),o(3580);const Cr=JSON.parse('{"DD":"Heading","XV":3}');(0,d.registerBlockType)("woocommerce/cart-order-summary-heading-block",{apiVersion:Cr.XV,title:Cr.DD,icon:{src:(0,a.jsx)(l.A,{icon:Zs,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{content:o="",className:s=""}=e,n=(0,c.useBlockProps)();return(0,a.jsx)("div",{...n,children:(0,a.jsx)("h2",{className:(0,r.A)(s,"wc-block-cart__totals-title"),children:(0,a.jsx)(c.PlainText,{className:"",value:o,onChange:e=>t({content:e}),style:{backgroundColor:"transparent"}})})})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save()})}),o(9184);const Pr=(e,t=!0)=>{t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},Nr=({attributes:e,setAttributes:t})=>{const{hasDarkControls:o,showFormStepNumbers:r}=e;return(0,a.jsx)(c.InspectorControls,{children:(0,a.jsxs)(uo.PanelBody,{title:(0,s.__)("Style","woocommerce"),children:[(0,a.jsx)(uo.ToggleControl,{label:(0,s.__)("Show form step numbers","woocommerce"),checked:r,onChange:()=>t({showFormStepNumbers:!r})}),(0,a.jsx)(uo.ToggleControl,{label:(0,s.__)("Dark mode inputs","woocommerce"),help:(0,s.__)("Inputs styled specifically for use on dark background colors.","woocommerce"),checked:o,onChange:()=>t({hasDarkControls:!o})})]})})},Er=window.wp.editor,Ar=window.wp.coreData;function Ir({block:e}){const t="checkout"===e?_:w,o="checkout"===e?"woocommerce_checkout_page_id":"woocommerce_cart_page_id",{saveEntityRecord:r}=(0,A.useDispatch)(Ar.store),{editPost:c,savePost:n}=(0,A.useDispatch)(Er.store),{slug:i,postPublished:l,currentPostId:d}=(0,A.useSelect)((o=>{const{getEntityRecord:s}=o(Ar.store),{isCurrentPostPublished:r,getCurrentPostId:c}=o(Er.store);return{slug:s("postType","page",t)?.slug||e,postPublished:r(),currentPostId:c()}}),[]),[u,p]=(0,m.useState)("pristine"),h=(0,m.useCallback)((()=>{p("updating"),Promise.resolve().then((()=>Ue()({path:`/wc/v3/settings/advanced/${o}`,method:"GET"}))).catch((e=>{"rest_setting_setting_invalid"===e.code&&p("error")})).then((()=>{if(!l)return c({status:"publish"}),n()})).then((()=>Ue()({path:`/wc/v3/settings/advanced/${o}`,method:"POST",data:{value:d.toString()}}))).then((()=>{if(0!==t)return r("postType","page",{id:t,slug:`${i}-2`})})).then((()=>c({slug:i}))).then((()=>n())).then((()=>p("updated")))}),[l,c,n,o,d,t,r,i]);let g;return g="checkout"===e?(0,m.createInterpolateElement)((0,s.__)("If you would like to use this block as your default checkout, <a>update your page settings</a>.","woocommerce"),{a:(0,a.jsx)("a",{href:"#",onClick:h,children:(0,s.__)("update your page settings","woocommerce")})}):(0,m.createInterpolateElement)((0,s.__)("If you would like to use this block as your default cart, <a>update your page settings</a>.","woocommerce"),{a:(0,a.jsx)("a",{href:"#",onClick:h,children:(0,s.__)("update your page settings","woocommerce")})}),"string"==typeof pagenow&&"site-editor"===pagenow||d===t||"dismissed"===u?null:(0,a.jsx)(uo.Notice,{className:"wc-default-page-notice",status:"updated"===u?"success":"info",onRemove:()=>p("dismissed"),spokenMessage:"updated"===u?(0,s.__)("Page settings updated","woocommerce"):g,children:"updated"===u?(0,s.__)("Page settings updated","woocommerce"):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("p",{children:g})})})}o(3650);var Rr=o(2174);const Br=[],Tr=e=>{const[t,o,s]=(()=>{const e={};(0,u.getSetting)("incompatibleExtensions")&&(0,u.getSetting)("incompatibleExtensions").forEach((t=>{e[t.id]=t.title}));const t=Object.keys(e),o=t.length;return[e,t,o]})(),[r,c,n]=(()=>{const{incompatiblePaymentMethods:e}=(0,A.useSelect)((e=>{const{getIncompatiblePaymentMethods:t}=e(D.paymentStore);return{incompatiblePaymentMethods:t()}}),[]),t=Object.keys(e);return[e,t,t.length]})(),a={...t,...r},i=[...o,...c],l=s+n,[d,p]=((e,t)=>{const[o,s]=(0,m.useState)((()=>{const o=window.localStorage.getItem(e);if(o)try{return JSON.parse(o)}catch{console.error(`Value for key '${e}' could not be retrieved from localStorage because it can't be parsed.`)}return t}));return(0,m.useEffect)((()=>{try{window.localStorage.setItem(e,JSON.stringify(o))}catch{console.error(`Value for key '${e}' could not be saved in localStorage because it can't be converted into a string.`)}}),[e,o]),[o,s]})("wc-blocks_dismissed_incompatible_extensions_notices",Br),[h,g]=(0,m.useState)(!1),_=d.some((t=>{return Object.keys(t).includes(e)&&(o=t[e],s=i,o.length===s.length&&new Set([...o,...s]).size===o.length);var o,s})),w=0===l||_;return(0,m.useEffect)((()=>{g(!w),w||_||p((t=>t.reduce(((t,o)=>(Object.keys(o).includes(e)||t.push(o),t)),[])))}),[w,_,p,e]),[h,()=>{const t=new Set(d);t.add({[e]:i}),p([...t])},(k=a,Object.fromEntries(Object.entries(k).sort((([,e],[,t])=>e.localeCompare(t))))),l];var k};var Dr=o(1244),Mr=o.n(Dr);Mr()("wc-admin:tracks:stats");const Or=Mr()("wc-admin:tracks");function Lr(e,t){if(Or("recordevent %s %o","wcadmin_"+e,t,{_tqk:window._tkq,shouldRecord:!!window._tkq&&!!window.wcTracks&&!!window.wcTracks.isEnabled}),!window.wcTracks||"function"!=typeof window.wcTracks.recordEvent)return!1;window.wcTracks.recordEvent(e,t)}const Fr=({blocks:e,findCondition:t})=>{for(const o of e){if(t(o))return o;if(o.innerBlocks){const e=Fr({blocks:o.innerBlocks,findCondition:t});if(e)return e}}},Vr=({blockType:e="woocommerce/cart"})=>"woocommerce/cart"===e?(0,a.jsx)("p",{children:(0,s.__)("If you continue, the cart block will be replaced with the classic experience powered by shortcodes. This means that you may lose customizations that you made to the cart block.","woocommerce")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:(0,s.__)("If you continue, the checkout block will be replaced with the classic experience powered by shortcodes. This means that you may lose:","woocommerce")}),(0,a.jsxs)("ul",{className:"cross-list",children:[(0,a.jsx)("li",{children:(0,s.__)("Customizations and updates to the block","woocommerce")}),(0,a.jsx)("li",{children:(0,s.__)("Additional local pickup options created for the new checkout","woocommerce")})]})]});function Hr({block:e,clientId:t,type:o}){const{createInfoNotice:r}=(0,A.useDispatch)(Te.store),{replaceBlock:n,selectBlock:i}=(0,A.useDispatch)(c.store),[l,u]=(0,m.useState)(!1),p=()=>u(!1),{undo:h}=(0,A.useDispatch)(Ar.store),[,,g,_]=Tr(e),w="woocommerce/cart"===e,k=w?(0,s.__)("Switch to classic cart","woocommerce"):(0,s.__)("Switch to classic checkout","woocommerce"),b=w?(0,s.__)("Switched to classic cart.","woocommerce"):(0,s.__)("Switched to classic checkout.","woocommerce"),y=w?"cart":"checkout",x={shortcode:y,notice:"incompatible"===o?"incompatible_notice":"generic_notice",incompatible_extensions_count:_,incompatible_extensions_names:JSON.stringify(g)},{getBlocks:v}=(0,A.useSelect)((e=>({getBlocks:e(c.store).getBlocks})),[]),f=()=>{h(),Lr("switch_to_classic_shortcode_undo",x)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(uo.Button,{variant:"secondary",onClick:()=>{Lr("switch_to_classic_shortcode_click",x),u(!0)},children:k}),l&&(0,a.jsxs)(uo.Modal,{size:"medium",title:k,onRequestClose:p,className:"wc-blocks-switch-to-classic-shortcode-modal-content",children:[(0,a.jsx)(Vr,{blockType:e}),(0,a.jsxs)(uo.TabbableContainer,{className:"wc-blocks-switch-to-classic-shortcode-modal-actions",children:[(0,a.jsx)(uo.Button,{variant:"primary",isDestructive:!0,onClick:()=>{n(t,(0,d.createBlock)("woocommerce/classic-shortcode",{shortcode:y})),Lr("switch_to_classic_shortcode_confirm",x),(()=>{const e=Fr({blocks:v(),findCondition:e=>"woocommerce/classic-shortcode"===e.name});e&&i(e.clientId)})(),r(b,{actions:[{label:(0,s.__)("Undo","woocommerce"),onClick:f}],type:"snackbar"}),p()},children:(0,s.__)("Switch","woocommerce")})," ",(0,a.jsx)(uo.Button,{variant:"secondary",onClick:()=>{Lr("switch_to_classic_shortcode_cancel",x),p()},children:(0,s.__)("Cancel","woocommerce")})]})]})]})}function zr({block:e,clientId:t}){const[o,r,c,n]=Tr(e);if(!o)return null;const i=(0,a.jsx)(a.Fragment,{children:n>1?(0,m.createInterpolateElement)((0,s.__)("Some active extensions do not yet support this block. This may impact the shopper experience. <a>Learn more</a>","woocommerce"),{a:(0,a.jsx)(uo.ExternalLink,{href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/"})}):(0,m.createInterpolateElement)((0,s.sprintf)(
// translators: %s is the name of the extension.
// translators: %s is the name of the extension.
(0,s.__)("<strong>%s</strong> does not yet support this block. This may impact the shopper experience. <a>Learn more</a>","woocommerce"),Object.values(c)[0]),{strong:(0,a.jsx)("strong",{}),a:(0,a.jsx)(uo.ExternalLink,{href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/"})})}),d=Object.entries(c),u=d.length-2;return(0,a.jsx)(uo.Notice,{className:"wc-blocks-incompatible-extensions-notice",status:"warning",onRemove:r,spokenMessage:i,children:(0,a.jsxs)("div",{className:"wc-blocks-incompatible-extensions-notice__content",children:[(0,a.jsx)(l.A,{className:"wc-blocks-incompatible-extensions-notice__warning-icon",icon:(0,a.jsx)(ns,{})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{children:i}),n>1&&(0,a.jsx)("ul",{children:d.slice(0,2).map((([e,t])=>(0,a.jsx)("li",{className:"wc-blocks-incompatible-extensions-notice__element",children:t},e)))}),d.length>2&&(0,a.jsxs)("details",{children:[(0,a.jsxs)("summary",{children:[(0,a.jsx)("span",{children:(0,s.sprintf)(
// translators: %s is the number of incompatible extensions.
// translators: %s is the number of incompatible extensions.
(0,s._n)("%s more incompatibility","%s more incompatibilities",u,"woocommerce"),u)}),(0,a.jsx)(l.A,{icon:Rr.A})]}),(0,a.jsx)("ul",{children:d.slice(2).map((([e,t])=>(0,a.jsx)("li",{className:"wc-blocks-incompatible-extensions-notice__element",children:t},e)))})]}),(0,a.jsx)(Hr,{block:e,clientId:t,type:"incompatible"})]})]})})}o(4490),o(6342);var Ur=o(3791);o(4268);const $r=({text:e,title:t=(0,s.__)("Feedback?","woocommerce"),url:o})=>{const[r,c]=(0,m.useState)(!1);return(0,m.useEffect)((()=>{c(!0)}),[]),(0,a.jsx)(a.Fragment,{children:r&&(0,a.jsxs)("div",{className:"wc-block-feedback-prompt",children:[(0,a.jsx)(l.A,{icon:Ur.A}),(0,a.jsx)("h2",{className:"wc-block-feedback-prompt__title",children:t}),(0,a.jsx)("p",{className:"wc-block-feedback-prompt__text",children:e}),(0,a.jsxs)("a",{href:o,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank",children:[(0,s.__)("Give us your feedback.","woocommerce"),(0,a.jsx)(l.A,{icon:rs.A,size:16})]})]})})},Wr=()=>(0,a.jsx)($r,{text:(0,s.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.","woocommerce"),url:"https://github.com/woocommerce/woocommerce/discussions/new?category=checkout-flow&labels=type%3A+product%20feedback"}),qr=(0,lt.createHigherOrderComponent)((e=>t=>{const{clientId:o,name:s,isSelected:r}=t,{isCart:n,isCheckout:i,parentId:l}=(0,A.useSelect)((e=>{const{getBlockParentsByBlockName:t,getBlockName:s}=e(c.store),r=t(o,["woocommerce/cart","woocommerce/checkout"]).reduce(((e,t)=>(e[s(t)]=t,e)),{}),n=s(o),a=Object.keys(r).includes("woocommerce/cart"),i=Object.keys(r).includes("woocommerce/checkout"),l="woocommerce/cart"===n||a,d=l?"woocommerce/cart":"woocommerce/checkout";return{isCart:l,isCheckout:"woocommerce/checkout"===n||i,parentId:n===d?o:r[d]}}));return s.startsWith("woocommerce/")&&r&&(n||i)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.InspectorControls,{children:[(0,a.jsx)(zr,{block:n?"woocommerce/cart":"woocommerce/checkout",clientId:l}),(0,a.jsx)(Ir,{block:i?"checkout":"cart"}),(0,a.jsx)(Wr,{})]}),(0,a.jsx)(e,{...t},"edit")]}):(0,a.jsx)(e,{...t},"edit")}),"withSidebarNotices");(0,Se.hasFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice")||(0,Se.addFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice",qr,11);const Yr=(0,a.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.jsx)("path",{d:"M12 6a9.77 9.77 0 0 1 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0 1 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"})]}),Xr=(e,t,o=!0)=>{const{updateBlockAttributes:s,selectBlock:r}=(0,A.dispatch)("core/block-editor");s(e,{currentView:t}),o&&r((0,A.select)("core/block-editor").getBlock(e)?.innerBlocks.find((e=>e.name===t))?.clientId||e)},Gr={views:[],currentView:"",viewClientId:""},Jr=(e,t=10,o=0)=>{const s=o+1;if(s>t)return Gr;const{getBlockAttributes:r,getBlockRootClientId:c}=(0,A.select)("core/block-editor"),n=c(e);if(null===n||""===n)return Gr;const a=r(n);return a?void 0!==a.editorViews?{views:a.editorViews,currentView:a.currentView||a.editorViews[0].view,viewClientId:n}:Jr(n,t,s):Gr},Qr=({currentView:e,views:t,clientId:o})=>{const{getBlockName:r,getSelectedBlockClientId:n,getBlockParentsByBlockName:i}=(0,A.useSelect)((e=>{const t=e("core/block-editor");return{getBlockName:t.getBlockName,getSelectedBlockClientId:t.getSelectedBlockClientId,getBlockParentsByBlockName:t.getBlockParentsByBlockName}}),[]),d=n(),u=((e,t)=>t.find((t=>t.view===e)))(e,t)||t[0],p=u.label;return(0,m.useLayoutEffect)((()=>{const s=d?r(d):null;if(!s||e===s)return;const c=t.map((e=>e.view));if(c.includes(s))return void Xr(o,s);const n=i(d,c),a=1===n.length?r(n[0]):null;a&&e!==a&&Xr(o,a,!1)}),[o,e,r,i,d,t]),(0,a.jsx)(c.BlockControls,{children:(0,a.jsx)(uo.ToolbarGroup,{children:(0,a.jsx)(uo.ToolbarDropdownMenu,{label:(0,s.__)("Switch view","woocommerce"),text:p,icon:(0,a.jsx)(l.A,{icon:Yr,style:{marginRight:"8px"}}),controls:t.map((t=>({...t,title:(0,a.jsx)("span",{style:{marginLeft:"8px"},children:t.label}),isActive:t.view===e,onClick:()=>{Xr(o,t.view)}})))})})})};(0,Se.hasFilter)("editor.BlockEdit","woocommerce/with-view-switcher")||(0,Se.addFilter)("editor.BlockEdit","woocommerce/with-view-switcher",(e=>t=>{const{clientId:o}=t,{views:s,currentView:r,viewClientId:c}=(0,A.useSelect)((e=>{const t=e("core/block-editor").getBlockAttributes(o);return t?.editorViews?{views:t.editorViews,currentView:t.currentView,viewClientId:o}:Jr(o)}));return 0===s.length?(0,a.jsx)(e,{...t}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Qr,{currentView:r,views:s,clientId:c}),(0,a.jsx)(e,{...t})]})}),11),(0,Se.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||(0,A.subscribe)((()=>{const e=(0,A.select)(c.store);if(!e)return;const t=e.getSelectedBlock();t&&(Pr("wc-lock-selected-block--remove",!!t?.attributes?.lock?.remove),Pr("wc-lock-selected-block--move",!!t?.attributes?.lock?.move))}));const Kr=["woocommerce/filled-cart-block","woocommerce/empty-cart-block"];o(7826);const Zr={isPreview:{type:"boolean",default:!1},currentView:{type:"string",default:"woocommerce/filled-cart-block",source:"readonly"},editorViews:{type:"object",default:[{view:"woocommerce/filled-cart-block",label:(0,s.__)("Filled Cart","woocommerce"),icon:(0,a.jsx)(l.A,{icon:it})},{view:"woocommerce/empty-cart-block",label:(0,s.__)("Empty Cart","woocommerce"),icon:(0,a.jsx)(l.A,{icon:qs})}]},hasDarkControls:{type:"boolean",default:(0,u.getSetting)("hasDarkEditorStyleSupport",!1)},checkoutPageId:{type:"number",default:0},showRateAfterTaxName:{type:"boolean",default:!0},align:{type:"string",default:"wide"}},ec={title:(0,s.__)("Cart","woocommerce"),apiVersion:3,icon:{src:(0,a.jsx)(l.A,{icon:i,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[(0,s.__)("WooCommerce","woocommerce")],description:(0,s.__)("Shopping cart.","woocommerce"),supports:{align:["wide"],html:!1,multiple:!1},example:{attributes:{isPreview:!0},viewportWidth:800},attributes:Zr,edit:({clientId:e,className:t,attributes:o,setAttributes:n})=>{const{hasDarkControls:i,currentView:l,isPreview:u=!1}=o,p=((e={})=>{const t=(0,m.useRef)(),o=(0,c.useBlockProps)({ref:t,...e});return(({ref:e})=>{const t=(0,Se.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),o=e.current;(0,m.useEffect)((()=>{if(o&&!t)return o.addEventListener("keydown",e,{capture:!0,passive:!1}),()=>{o.removeEventListener("keydown",e,{capture:!0})};function e(e){const{keyCode:t,target:o}=e;if(!(o instanceof HTMLElement))return;if(t!==Ct.BACKSPACE&&t!==Ct.DELETE)return;if((0,xt.isTextField)(o))return;const s=o;if(void 0===s.dataset.block)return;const r=(e=>{if(!e)return!1;const{getBlock:t}=(0,A.select)(c.store),o=t(e);if("boolean"==typeof o?.attributes?.lock?.remove)return o.attributes.lock.remove;const s=(0,d.getBlockType)(o.name);return"boolean"==typeof s?.attributes?.lock?.default?.remove&&s?.attributes?.lock?.default?.remove})(s.dataset.block);r&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}}),[o,t])})({ref:t}),o})({className:(0,r.A)(t,"wp-block-woocommerce-cart",{"is-editor-preview":u})}),h=(0,m.useRef)((0,at.getQueryArg)(window.location.href,"focus"));return(0,m.useEffect)((()=>{"cart"!==h.current||(0,A.select)("core/block-editor").hasSelectedBlock()||((0,A.dispatch)("core/block-editor").selectBlock(e),(0,A.dispatch)("core/interface").enableComplementaryArea("core/edit-site","edit-site/block-inspector"))}),[e]),(0,a.jsxs)("div",{...p,children:[(0,a.jsx)(c.InspectorControls,{children:(0,a.jsx)(Nr,{attributes:o,setAttributes:n})}),(0,a.jsx)(E,{header:(0,s.__)("Cart Block Error","woocommerce"),text:(0,s.__)("There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.","woocommerce"),showErrorMessage:!0,errorMessagePrefix:(0,s.__)("Error message:","woocommerce"),children:(0,a.jsx)(B,{previewData:{previewCart:ct},currentView:l,isPreview:!!u,children:(0,a.jsx)(_t.Provider,{value:{hasDarkControls:i},children:(0,a.jsx)(nt.SlotFillProvider,{children:(0,a.jsx)(Ge,{children:(0,a.jsx)(c.InnerBlocks,{allowedBlocks:Kr,template:[["woocommerce/filled-cart-block",{},[]],["woocommerce/empty-cart-block",{},[]]],templateLock:"insert"})})})})})})]})},save:()=>(0,a.jsx)("div",{...c.useBlockProps.save({className:"is-loading"}),children:(0,a.jsx)(c.InnerBlocks.Content,{})}),transforms:{to:[{type:"block",blocks:["woocommerce/classic-shortcode"],transform:e=>(0,d.createBlock)("woocommerce/classic-shortcode",{shortcode:"cart",align:e.align},[])}]},deprecated:[{attributes:Zr,save:({attributes:e})=>(0,a.jsx)("div",{className:(0,r.A)("is-loading",e.className),children:(0,a.jsx)(c.InnerBlocks.Content,{})}),migrate:(e,t)=>{const{checkoutPageId:o,align:s}=e;return[e,[(0,d.createBlock)("woocommerce/filled-cart-block",{align:s},[(0,d.createBlock)("woocommerce/cart-items-block"),(0,d.createBlock)("woocommerce/cart-totals-block",{},[(0,d.createBlock)("woocommerce/cart-order-summary-block",{}),(0,d.createBlock)("woocommerce/cart-express-payment-block"),(0,d.createBlock)("woocommerce/proceed-to-checkout-block",{checkoutPageId:o}),(0,d.createBlock)("woocommerce/cart-accepted-payment-methods-block")])]),(0,d.createBlock)("woocommerce/empty-cart-block",{align:s},t)]]},isEligible:(e,t)=>!t.find((e=>"woocommerce/filled-cart-block"===e.name))}]};(0,d.registerBlockType)("woocommerce/cart",ec)},7316:()=>{},1189:()=>{},7545:()=>{},4313:()=>{},7578:()=>{},5893:()=>{},6882:()=>{},359:()=>{},6983:()=>{},9287:()=>{},7605:()=>{},3692:()=>{},8879:()=>{},9581:()=>{},619:()=>{},8413:()=>{},6562:()=>{},9961:()=>{},959:()=>{},8501:()=>{},9959:()=>{},9163:()=>{},2831:()=>{},9184:()=>{},535:()=>{},7128:()=>{},7467:()=>{},3580:()=>{},2115:()=>{},5675:()=>{},9685:()=>{},398:()=>{},2766:()=>{},7826:()=>{},3650:()=>{},4459:()=>{},4268:()=>{},6342:()=>{},4490:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},195:e=>{"use strict";e.exports=window.wp.a11y},9491:e=>{"use strict";e.exports=window.wp.compose},4040:e=>{"use strict";e.exports=window.wp.deprecated},8107:e=>{"use strict";e.exports=window.wp.dom},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},923:e=>{"use strict";e.exports=window.wp.isShallowEqual},8558:e=>{"use strict";e.exports=window.wp.keycodes},5573:e=>{"use strict";e.exports=window.wp.primitives}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return s[e].call(o.exports,o,o.exports,c),o.exports}c.m=s,e=[],c.O=(t,o,s,r)=>{if(!o){var n=1/0;for(d=0;d<e.length;d++){for(var[o,s,r]=e[d],a=!0,i=0;i<o.length;i++)(!1&r||n>=r)&&Object.keys(c.O).every((e=>c.O[e](o[i])))?o.splice(i--,1):(a=!1,r<n&&(n=r));if(a){e.splice(d--,1);var l=s();void 0!==l&&(t=l)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[o,s,r]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,s){if(1&s&&(e=this(e)),8&s)return e;if("object"==typeof e&&e){if(4&s&&e.__esModule)return e;if(16&s&&"function"==typeof e.then)return e}var r=Object.create(null);c.r(r);var n={};t=t||[null,o({}),o([]),o(o)];for(var a=2&s&&e;"object"==typeof a&&!~t.indexOf(a);a=o(a))Object.getOwnPropertyNames(a).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,c.d(r,n),r},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.j=7949,(()=>{var e={7949:0};c.O.j=t=>0===e[t];var t=(t,o)=>{var s,r,[n,a,i]=o,l=0;if(n.some((t=>0!==e[t]))){for(s in a)c.o(a,s)&&(c.m[s]=a[s]);if(i)var d=i(c)}for(t&&t(o);l<n.length;l++)r=n[l],c.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return c.O(d)},o=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var n=c.O(void 0,[94],(()=>c(1895)));n=c.O(n),((this.wc=this.wc||{}).blocks=this.wc.blocks||{}).cart=n})();

Zerion Mini Shell 1.0