Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.15.10.139
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/cynthiaadediran.com/wp-content/plugins/woocommerce/assets/client/blocks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/cynthiaadediran.com/wp-content/plugins/woocommerce/assets/client/blocks/cart.js
(()=>{var e,t,o,r={1212:(e,t,o)=>{"use strict";o.r(t);var r=o(1609),c=o(7723),n=o(851);const a=window.wp.blockEditor;var s=o(5573);const l=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)("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 i=o(7104);const m=window.wp.blocks;var u=o(2294),d=o(6087);const p=window.wc.wcSettings;var _,h,g,E,w,k,b,y,v,f;const C=(0,p.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),S=C.pluginUrl+"assets/images/",N=(C.pluginUrl,null===(_=p.STORE_PAGES.shop)||void 0===_?void 0:_.permalink),P=null===(h=p.STORE_PAGES.checkout)||void 0===h?void 0:h.id,A=(null===(g=p.STORE_PAGES.checkout)||void 0===g||g.permalink,null===(E=p.STORE_PAGES.privacy)||void 0===E||E.permalink,null===(w=p.STORE_PAGES.privacy)||void 0===w||w.title,null===(k=p.STORE_PAGES.terms)||void 0===k||k.permalink,null===(b=p.STORE_PAGES.terms)||void 0===b||b.title,null===(y=p.STORE_PAGES.cart)||void 0===y?void 0:y.id),R=null===(v=p.STORE_PAGES.cart)||void 0===v?void 0:v.permalink,T=(null!==(f=p.STORE_PAGES.myaccount)&&void 0!==f&&f.permalink?p.STORE_PAGES.myaccount.permalink:(0,p.getSetting)("wpLoginUrl","/wp-login.php"),(0,p.getSetting)("localPickupEnabled",!1)),I=(0,p.getSetting)("countries",{}),x=(0,p.getSetting)("countryData",{}),B=Object.fromEntries(Object.keys(x).filter((e=>!0===x[e].allowBilling)).map((e=>[e,I[e]||""]))),O=Object.fromEntries(Object.keys(x).filter((e=>!0===x[e].allowBilling)).map((e=>[e,x[e].states||[]]))),M=Object.fromEntries(Object.keys(x).filter((e=>!0===x[e].allowShipping)).map((e=>[e,I[e]||""]))),D=Object.fromEntries(Object.keys(x).filter((e=>!0===x[e].allowShipping)).map((e=>[e,x[e].states||[]]))),L=Object.fromEntries(Object.keys(x).map((e=>[e,x[e].locale||[]]))),F={address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]},V=(0,p.getSetting)("addressFieldsLocations",F).address,j=((0,p.getSetting)("addressFieldsLocations",F).contact,(0,p.getSetting)("addressFieldsLocations",F).order,(0,p.getSetting)("additionalOrderFields",{}),(0,p.getSetting)("additionalContactFields",{}),(0,p.getSetting)("additionalAddressFields",{}),({imageUrl:e=`${S}/block-error.svg`,header:t=(0,c.__)("Oops!","woocommerce"),text:o=(0,c.__)("There was an error loading the content.","woocommerce"),errorMessage:n,errorMessagePrefix:a=(0,c.__)("Error:","woocommerce"),button:s,showErrorBlock:l=!0})=>l?(0,r.createElement)("div",{className:"wc-block-error wc-block-components-error"},e&&(0,r.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:e,alt:""}),(0,r.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},t&&(0,r.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},t),o&&(0,r.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},o),n&&(0,r.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},a?a+" ":"",n),s&&(0,r.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},s))):null);o(9407);class Y extends d.Component{constructor(...e){super(...e),(0,u.A)(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:o=!0,showErrorBlock:c=!0,text:n,errorMessagePrefix:a,renderError:s,button:l}=this.props,{errorMessage:i,hasError:m}=this.state;return m?"function"==typeof s?s({errorMessage:i}):(0,r.createElement)(j,{showErrorBlock:c,errorMessage:o?i:null,header:e,imageUrl:t,text:n,errorMessagePrefix:a,button:l}):this.props.children}}const H=Y,U=window.wp.data,z=(0,d.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})}),K=()=>(0,d.useContext)(z),$=({children:e,currentPostId:t=0,previewData:o={},currentView:c="",isPreview:n=!1})=>{const a=(0,U.useSelect)((e=>t||e("core/editor").getCurrentPostId()),[t]),s=(0,d.useCallback)((e=>o&&e in o?o[e]:{}),[o]),l={isEditor:!0,currentPostId:a,currentView:c,previewData:o,getPreviewData:s,isPreview:n};return(0,r.createElement)(z.Provider,{value:l},e)},q=window.wp.plugins,W=window.wc.wcBlocksData;var G=o(4040),Q=o.n(G);let Z=function(e){return e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback",e}({});const J={},X=(e=J,{type:t,eventType:o,id:r,callback:c,priority:n})=>{const a=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(t){case Z.ADD_EVENT_CALLBACK:return a.set(r,{priority:n,callback:c}),{...e,[o]:a};case Z.REMOVE_EVENT_CALLBACK:return a.delete(r),{...e,[o]:a}}},ee=(e,t)=>(o,r=10)=>{const c=((e,t,o=10)=>({id:Math.floor(Math.random()*Date.now()).toString(),type:Z.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:o}))(e,o,r);return t(c),()=>{var o;t((o=e,{id:c.id,type:Z.REMOVE_EVENT_CALLBACK,eventType:o}))}},te=(0,d.createContext)({onPaymentProcessing:()=>()=>()=>{},onPaymentSetup:()=>()=>()=>{}}),oe=({children:e})=>{const{isProcessing:t,isIdle:o,isCalculating:c,hasError:n}=(0,U.useSelect)((e=>{const t=e(W.CHECKOUT_STORE_KEY);return{isProcessing:t.isProcessing(),isIdle:t.isIdle(),hasError:t.hasError(),isCalculating:t.isCalculating()}})),{isPaymentReady:a}=(0,U.useSelect)((e=>{const t=e(W.PAYMENT_STORE_KEY);return{isPaymentProcessing:t.isPaymentProcessing(),isPaymentReady:t.isPaymentReady()}})),{setValidationErrors:s}=(0,U.useDispatch)(W.VALIDATION_STORE_KEY),[l,i]=(0,d.useReducer)(X,{}),{onPaymentSetup:m}=(e=>(0,d.useMemo)((()=>({onPaymentSetup:ee("payment_setup",e)})),[e]))(i),u=(0,d.useRef)(l);(0,d.useEffect)((()=>{u.current=l}),[l]);const{__internalSetPaymentProcessing:p,__internalSetPaymentIdle:_,__internalEmitPaymentProcessingEvent:h}=(0,U.useDispatch)(W.PAYMENT_STORE_KEY);(0,d.useEffect)((()=>{!t||n||c||(p(),h(u.current,s))}),[t,n,c,p,h,s]),(0,d.useEffect)((()=>{o&&!a&&_()}),[o,a,_]),(0,d.useEffect)((()=>{n&&a&&_()}),[n,a,_]);const g={onPaymentProcessing:(0,d.useMemo)((()=>function(...e){return Q()("onPaymentProcessing",{alternative:"onPaymentSetup",plugin:"WooCommerce Blocks"}),m(...e)}),[m]),onPaymentSetup:m};return(0,r.createElement)(te.Provider,{value:g},e)},re={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},ce={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"},ne={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:e=>e,shippingErrorTypes:re,onShippingRateSuccess:()=>()=>{},onShippingRateFail:()=>()=>{},onShippingRateSelectSuccess:()=>()=>{},onShippingRateSelectFail:()=>()=>{}},ae=(e,{type:t})=>Object.values(re).includes(t)?t:e,se="shipping_rates_success",le="shipping_rates_fail",ie="shipping_rate_select_success",me="shipping_rate_select_fail",ue=e=>({onSuccess:ee(se,e),onFail:ee(le,e),onSelectSuccess:ee(ie,e),onSelectFail:ee(me,e)}),de=window.wc.wcTypes;let pe=function(e){return e.SUCCESS="success",e.FAIL="failure",e.ERROR="error",e}({}),_e=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/additional-information",e}({});const he=async(e,t,o)=>{const r=((e,t)=>e[t]?Array.from(e[t].values()).sort(((e,t)=>e.priority-t.priority)):[])(e,t),c=[];for(const e of r)try{const t=await Promise.resolve(e.callback(o));"object"==typeof t&&c.push(t)}catch(e){console.error(e)}return!c.length||c};var ge=o(458),Ee=o.n(ge);const we=window.wp.htmlEntities,ke=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,c.sprintf)(/* translators: %s Field label. */ /* translators: %s Field label. */
(0,c.__)("%s (optional)","woocommerce"),e.label)),e.priority&&((0,de.isNumber)(e.priority)&&(t.index=e.priority),(0,de.isString)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},be=Object.entries(L).map((([e,t])=>[e,Object.entries(t).map((([e,t])=>[e,ke(t)])).reduce(((e,[t,o])=>(e[t]=o,e)),{})])).reduce(((e,[t,o])=>(e[t]=o,e)),{}),ye=(e,t,o="")=>{const r=o&&void 0!==be[o]?be[o]:{};return e.map((e=>({key:e,...p.defaultFields[e]||{},...r[e]||{},...t[e]||{}}))).sort(((e,t)=>e.index-t.index))},ve=window.wp.url,fe=(e,t)=>e in t,Ce=e=>{const t=ye(V,{},e.country),o=Object.assign({},e);return t.forEach((({key:t="",hidden:r=!1})=>{r&&fe(t,e)&&(o[t]="")})),o},Se=e=>{if(0===Object.values(e).length)return null;const t=(0,de.isString)(M[e.country])?(0,we.decodeEntities)(M[e.country]):"",o=(0,de.isObject)(D[e.country])&&(0,de.isString)(D[e.country][e.state])?(0,we.decodeEntities)(D[e.country][e.state]):e.state,r=[];r.push(e.postcode.toUpperCase()),r.push(e.city),r.push(o),r.push(t);return r.filter(Boolean).join(", ")||null},Ne=window.CustomEvent||null,Pe=(e,t,o=!1,r=!1)=>{if("function"!=typeof jQuery)return()=>{};const c=()=>{((e,{bubbles:t=!1,cancelable:o=!1,element:r,detail:c={}})=>{if(!Ne)return;r||(r=document.body);const n=new Ne(e,{bubbles:t,cancelable:o,detail:c});r.dispatchEvent(n)})(t,{bubbles:o,cancelable:r})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)},Ae=e=>{const t=null==e?void 0:e.detail;t&&t.preserveCartData||(0,U.dispatch)(W.CART_STORE_KEY).invalidateResolutionForStore()},Re=e=>{(null!=e&&e.persisted||"back_forward"===(window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:""))&&(0,U.dispatch)(W.CART_STORE_KEY).invalidateResolutionForStore()},Te=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},Ie={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},xe={...Ie,email:""},Be={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:W.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},Oe=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,we.decodeEntities)(t)]))),Me={cartCoupons:W.EMPTY_CART_COUPONS,cartItems:W.EMPTY_CART_ITEMS,cartFees:W.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:W.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:W.EMPTY_CART_ITEM_ERRORS,cartTotals:Be,cartIsLoading:!0,cartErrors:W.EMPTY_CART_ERRORS,billingAddress:xe,shippingAddress:Ie,shippingRates:W.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentMethods:W.EMPTY_PAYMENT_METHODS,paymentRequirements:W.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},receiveCartContents:()=>{},extensions:W.EMPTY_EXTENSIONS},De=(e={shouldSelect:!0})=>{const{isEditor:t,previewData:o}=K(),r=null==o?void 0:o.previewCart,{shouldSelect:c}=e,n=(0,d.useRef)();(0,d.useEffect)((()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),(null===(e=window.wcBlocksStoreCartListeners)||void 0===e?void 0:e.count)>0)return void window.wcBlocksStoreCartListeners.count++;var e;document.body.addEventListener("wc-blocks_added_to_cart",Ae),document.body.addEventListener("wc-blocks_removed_from_cart",Ae),window.addEventListener("pageshow",Re);const t=Pe("added_to_cart","wc-blocks_added_to_cart"),o=Pe("removed_from_cart","wc-blocks_removed_from_cart");window.wcBlocksStoreCartListeners.count=1,window.wcBlocksStoreCartListeners.remove=()=>{document.body.removeEventListener("wc-blocks_added_to_cart",Ae),document.body.removeEventListener("wc-blocks_removed_from_cart",Ae),window.removeEventListener("pageshow",Re),t(),o()}})(),Te)),[]);const a=(0,U.useSelect)(((e,{dispatch:o})=>{if(!c)return Me;if(t)return{cartCoupons:r.coupons,cartItems:r.items,crossSellsProducts:r.cross_sells,cartFees:r.fees,cartItemsCount:r.items_count,cartItemsWeight:r.items_weight,cartNeedsPayment:r.needs_payment,cartNeedsShipping:r.needs_shipping,cartItemErrors:W.EMPTY_CART_ITEM_ERRORS,cartTotals:r.totals,cartIsLoading:!1,cartErrors:W.EMPTY_CART_ERRORS,billingData:xe,billingAddress:xe,shippingAddress:Ie,extensions:W.EMPTY_EXTENSIONS,shippingRates:r.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:r.has_calculated_shipping,paymentRequirements:r.paymentRequirements,receiveCart:"function"==typeof(null==r?void 0:r.receiveCart)?r.receiveCart:()=>{},receiveCartContents:"function"==typeof(null==r?void 0:r.receiveCartContents)?r.receiveCartContents:()=>{}};const n=e(W.CART_STORE_KEY),a=n.getCartData(),s=n.getCartErrors(),l=n.getCartTotals(),i=!n.hasFinishedResolution("getCartData"),m=n.isCustomerDataUpdating(),{receiveCart:u,receiveCartContents:d}=o(W.CART_STORE_KEY),p=Oe(a.billingAddress),_=a.needsShipping?Oe(a.shippingAddress):p,h=a.fees.length>0?a.fees.map((e=>Oe(e))):W.EMPTY_CART_FEES,g=a.coupons.length>0?a.coupons.map((e=>({...e,label:e.code}))):W.EMPTY_CART_COUPONS;return{cartCoupons:g,cartItems:a.items,crossSellsProducts:a.crossSells,cartFees:h,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:i,cartErrors:s,billingData:Ce(p),billingAddress:Ce(p),shippingAddress:Ce(_),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:u,receiveCartContents:d}}),[c]);return n.current&&Ee()(n.current,a)||(n.current=a),n.current},Le=e=>e.length,Fe=(0,p.getSetting)("collectableMethodIds",[]),Ve=e=>Fe.includes(e.method_id),je=e=>!!T&&(Array.isArray(e)?!!e.find((e=>Fe.includes(e))):Fe.includes(e)),Ye=e=>e.some((e=>!!e.shipping_rates.length)),He=e=>!!Ye(e)&&e.every((e=>e.shipping_rates.every((e=>Ve(e)))));var Ue=o(923),ze=o.n(Ue);const Ke={currency_code:p.SITE_CURRENCY.code,currency_symbol:p.SITE_CURRENCY.symbol,currency_minor_unit:p.SITE_CURRENCY.minorUnit,currency_decimal_separator:p.SITE_CURRENCY.decimalSeparator,currency_thousand_separator:p.SITE_CURRENCY.thousandSeparator,currency_prefix:p.SITE_CURRENCY.prefix,currency_suffix:p.SITE_CURRENCY.suffix},$e=e=>{const t=p.SITE_CURRENCY.minorUnit;if(2===t)return e;const o=Math.pow(10,t);return(Math.round(parseInt(e,10)/Math.pow(10,2))*o).toString()},qe=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:(0,c.__)("Shipping","woocommerce"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:(0,c._x)("Beanie with Logo","example product in Cart Block","woocommerce"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:(0,c._x)("Beanie","example product in Cart Block","woocommerce"),quantity:1}],shipping_rates:[{...Ke,name:(0,c.__)("Flat rate shipping","woocommerce"),description:"",delivery_time:"",price:$e("500"),taxes:"0",rate_id:"flat_rate:0",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!1},{...Ke,name:(0,c.__)("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},{...Ke,name:(0,c.__)("Local pickup #1","woocommerce"),description:"",delivery_time:"",price:"0",taxes:"0",rate_id:"pickup_location:1",instance_id:1,meta_data:[{key:"pickup_location",value:"New York"},{key:"pickup_address",value:"123 Easy Street, New York, 12345"}],method_id:"pickup_location",selected:!1},{...Ke,name:(0,c.__)("Local pickup #2","woocommerce"),description:"",delivery_time:"",price:"0",taxes:"0",rate_id:"pickup_location:2",instance_id:1,meta_data:[{key:"pickup_location",value:"Los Angeles"},{key:"pickup_address",value:"123 Easy Street, Los Angeles, California, 90210"}],method_id:"pickup_location",selected:!1}]}],We=(0,p.getSetting)("displayCartPricesIncludingTax",!1),Ge={coupons:[],shipping_rates:(0,p.getSetting)("shippingMethodsExist",!1)||(0,p.getSetting)("localPickupEnabled",!1)?qe:[],items:[{key:"1",id:1,type:"simple",quantity:2,catalog_visibility:"visible",name:(0,c.__)("Beanie","woocommerce"),summary:(0,c.__)("Beanie","woocommerce"),short_description:(0,c.__)("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:S+"previews/beanie.jpg",thumbnail:S+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,c.__)("Color","woocommerce"),value:(0,c.__)("Yellow","woocommerce")},{attribute:(0,c.__)("Size","woocommerce"),value:(0,c.__)("Small","woocommerce")}],prices:{...Ke,price:$e(We?"12000":"10000"),regular_price:$e(We?"120":"100"),sale_price:$e(We?"12000":"10000"),price_range:null,raw_prices:{precision:6,price:We?"12000000":"10000000",regular_price:We?"12000000":"10000000",sale_price:We?"12000000":"10000000"}},totals:{...Ke,line_subtotal:$e("2000"),line_subtotal_tax:$e("400"),line_total:$e("2000"),line_total_tax:$e("400")},extensions:{},item_data:[]},{key:"2",id:2,type:"simple",quantity:1,catalog_visibility:"visible",name:(0,c.__)("Cap","woocommerce"),summary:(0,c.__)("Cap","woocommerce"),short_description:(0,c.__)("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:S+"previews/cap.jpg",thumbnail:S+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,c.__)("Color","woocommerce"),value:(0,c.__)("Orange","woocommerce")}],prices:{...Ke,price:$e(We?"2400":"2000"),regular_price:$e(We?"2400":"2000"),sale_price:$e(We?"2400":"2000"),price_range:null,raw_prices:{precision:6,price:We?"24000000":"20000000",regular_price:We?"24000000":"20000000",sale_price:We?"24000000":"20000000"}},totals:{...Ke,line_subtotal:$e("2000"),line_subtotal_tax:$e("400"),line_total:$e("2000"),line_total_tax:$e("400")},extensions:{},item_data:[]}],cross_sells:[{id:1,name:(0,c.__)("Polo","woocommerce"),slug:"polo",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-polo",short_description:(0,c.__)("Polo","woocommerce"),description:(0,c.__)("Polo","woocommerce"),on_sale:!1,prices:{...Ke,price:$e(We?"24000":"20000"),regular_price:$e(We?"24000":"20000"),sale_price:$e(We?"12000":"10000"),price_range:null},price_html:"",average_rating:"4.5",review_count:2,images:[{id:17,src:S+"previews/polo.jpg",thumbnail:S+"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,c.__)("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,c.__)("Long Sleeve Tee","woocommerce"),description:(0,c.__)("Long Sleeve Tee","woocommerce"),on_sale:!1,prices:{...Ke,price:$e(We?"30000":"25000"),regular_price:$e(We?"30000":"25000"),sale_price:$e(We?"30000":"25000"),price_range:null},price_html:"",average_rating:"4",review_count:2,images:[{id:17,src:S+"previews/long-sleeve-tee.jpg",thumbnail:S+"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,c.__)("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,c.__)("Hoodie with Zipper","woocommerce"),description:(0,c.__)("Hoodie with Zipper","woocommerce"),on_sale:!0,prices:{...Ke,price:$e(We?"15000":"12500"),regular_price:$e(We?"30000":"25000"),sale_price:$e(We?"15000":"12500"),price_range:null},price_html:"",average_rating:"1",review_count:2,images:[{id:17,src:S+"previews/hoodie-with-zipper.jpg",thumbnail:S+"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,c.__)("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,c.__)("Polo","woocommerce"),description:(0,c.__)("Polo","woocommerce"),on_sale:!1,prices:{...Ke,price:$e(We?"4500":"4250"),regular_price:$e(We?"4500":"4250"),sale_price:$e(We?"4500":"4250"),price_range:null},price_html:"",average_rating:"5",review_count:2,images:[{id:17,src:S+"previews/hoodie-with-logo.jpg",thumbnail:S+"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,c.__)("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,c.__)("Hoodie with Pocket","woocommerce"),description:(0,c.__)("Hoodie with Pocket","woocommerce"),on_sale:!0,prices:{...Ke,price:$e(We?"3500":"3250"),regular_price:$e(We?"4500":"4250"),sale_price:$e(We?"3500":"3250"),price_range:null},price_html:"",average_rating:"3.75",review_count:4,images:[{id:17,src:S+"previews/hoodie-with-pocket.jpg",thumbnail:S+"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,c.__)("T-Shirt","woocommerce"),slug:"t-shirt",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-t-shirt",short_description:(0,c.__)("T-Shirt","woocommerce"),description:(0,c.__)("T-Shirt","woocommerce"),on_sale:!1,prices:{...Ke,price:$e(We?"1800":"1500"),regular_price:$e(We?"1800":"1500"),sale_price:$e(We?"1800":"1500"),price_range:null},price_html:"",average_rating:"3",review_count:2,images:[{id:17,src:S+"previews/tshirt.jpg",thumbnail:S+"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,c.__)("Fee","woocommerce"),totals:{...Ke,total:$e("100"),total_tax:$e("20")}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:(0,p.getSetting)("shippingEnabled",!0),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:{...Ke,total_items:$e("4000"),total_items_tax:$e("800"),total_fees:$e("100"),total_fees_tax:$e("20"),total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:$e("820"),total_price:$e("4920"),tax_lines:[{name:(0,c.__)("Sales tax","woocommerce"),rate:"20%",price:$e("820")}]},errors:[],payment_methods:["cod","bacs","cheque"],payment_requirements:["products"],extensions:{}},Qe=window.wp.hooks,Ze=()=>({dispatchStoreEvent:(0,d.useCallback)(((e,t={})=>{try{(0,Qe.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,d.useCallback)(((e,t={})=>{try{(0,Qe.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,U.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])}),Je=()=>{const{isEditor:e}=K(),{shippingRates:t,needsShipping:o,hasCalculatedShipping:r,isLoadingRates:c,isCollectable:n,isSelectingRate:a}=(0,U.useSelect)((t=>{const o=t(W.CART_STORE_KEY),r=e?Ge.shipping_rates:o.getShippingRates();return{shippingRates:r,needsShipping:e?Ge.needs_shipping:o.getNeedsShipping(),hasCalculatedShipping:e?Ge.has_calculated_shipping:o.getHasCalculatedShipping(),isLoadingRates:!e&&o.isCustomerDataUpdating(),isCollectable:r.every((({shipping_rates:e})=>e.find((({method_id:e})=>je(e))))),isSelectingRate:!e&&o.isShippingRateBeingSelected()}}),[e]),s=(0,d.useRef)({});(0,d.useEffect)((()=>{const e=(e=>Object.fromEntries(e.map((({package_id:e,shipping_rates:t})=>{var o;return[e,(null===(o=t.find((e=>e.selected)))||void 0===o?void 0:o.rate_id)||""]}))))(t);(0,de.isObject)(e)&&!ze()(s.current,e)&&(s.current=e)}),[t]);const{selectShippingRate:l}=(0,U.useDispatch)(W.CART_STORE_KEY),i=je(Object.values(s.current).map((e=>e.split(":")[0]))),{dispatchCheckoutEvent:m}=Ze(),u=(0,d.useCallback)(((e,t)=>{let o;void 0!==e&&(o=je(e.split(":")[0])?l(e,null):l(e,t),o.then((()=>{m("set-selected-shipping-rate",{shippingRateId:e})})).catch((e=>{(0,W.processErrorResponse)(e)})))}),[l,m]);return{isSelectingRate:a,selectedRates:s.current,selectShippingRate:u,shippingRates:t,needsShipping:o,hasCalculatedShipping:r,isLoadingRates:c,isCollectable:n,hasSelectedLocalPickup:i}},{NONE:Xe,INVALID_ADDRESS:et,UNKNOWN:tt}=re,ot=(0,d.createContext)(ne),rt=()=>(0,d.useContext)(ot),ct=({children:e})=>{const{__internalIncrementCalculating:t,__internalDecrementCalculating:o}=(0,U.useDispatch)(W.CHECKOUT_STORE_KEY),{shippingRates:c,isLoadingRates:n,cartErrors:a}=De(),{selectedRates:s,isSelectingRate:l}=Je(),[i,m]=(0,d.useReducer)(ae,Xe),[u,p]=(0,d.useReducer)(X,{}),_=(0,d.useRef)(u),h=(0,d.useMemo)((()=>({onShippingRateSuccess:ue(p).onSuccess,onShippingRateFail:ue(p).onFail,onShippingRateSelectSuccess:ue(p).onSelectSuccess,onShippingRateSelectFail:ue(p).onSelectFail})),[p]);(0,d.useEffect)((()=>{_.current=u}),[u]),(0,d.useEffect)((()=>{n?t():o()}),[n,t,o]),(0,d.useEffect)((()=>{l?t():o()}),[t,o,l]),(0,d.useEffect)((()=>{a.length>0&&a.some((e=>!(!e.code||!Object.values(ce).includes(e.code))))?m({type:et}):m({type:Xe})}),[a]);const g=(0,d.useMemo)((()=>({isPristine:i===Xe,isValid:i===Xe,hasInvalidAddress:i===et,hasError:i===tt||i===et})),[i]);(0,d.useEffect)((()=>{n||0!==c.length&&!g.hasError||he(_.current,le,{hasInvalidAddress:g.hasInvalidAddress,hasError:g.hasError})}),[c,n,g.hasError,g.hasInvalidAddress]),(0,d.useEffect)((()=>{!n&&c.length>0&&!g.hasError&&he(_.current,se,c)}),[c,n,g.hasError]),(0,d.useEffect)((()=>{l||(g.hasError?he(_.current,me,{hasError:g.hasError,hasInvalidAddress:g.hasInvalidAddress}):he(_.current,ie,s.current))}),[s,l,g.hasError,g.hasInvalidAddress]);const E={shippingErrorStatus:g,dispatchErrorStatus:m,shippingErrorTypes:re,...h};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ot.Provider,{value:E},e))};function nt(e,t){const o=(0,d.useRef)();return(0,d.useEffect)((()=>{o.current===e||t&&!t(e,o.current)||(o.current=e)}),[e,t]),o.current}const at={},st={},lt=()=>at,it=()=>st,mt=(0,d.createContext)({onSubmit:()=>{},onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},onCheckoutSuccess:()=>()=>{},onCheckoutFail:()=>()=>{},onCheckoutValidation:()=>()=>{}}),ut=()=>(0,d.useContext)(mt),dt=({children:e,redirectUrl:t})=>{const o=lt(),c=it(),{isEditor:n}=K(),{__internalUpdateAvailablePaymentMethods:a}=(0,U.useDispatch)(W.PAYMENT_STORE_KEY);(0,d.useEffect)((()=>{(n||0!==Object.keys(o).length||0!==Object.keys(c).length)&&a()}),[n,o,c,a]);const{__internalSetRedirectUrl:s,__internalEmitValidateEvent:l,__internalEmitAfterProcessingEvents:i,__internalSetBeforeProcessing:m}=(0,U.useDispatch)(W.CHECKOUT_STORE_KEY),{checkoutRedirectUrl:u,checkoutStatus:p,isCheckoutBeforeProcessing:_,isCheckoutAfterProcessing:h,checkoutHasError:g,checkoutOrderId:E,checkoutOrderNotes:w,checkoutCustomerId:k}=(0,U.useSelect)((e=>{const t=e(W.CHECKOUT_STORE_KEY);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&&s(t);const{setValidationErrors:b}=(0,U.useDispatch)(W.VALIDATION_STORE_KEY),{dispatchCheckoutEvent:y}=Ze(),{checkoutNotices:v,paymentNotices:f,expressPaymentNotices:C}=(0,U.useSelect)((e=>{const{getNotices:t}=e("core/notices");return{checkoutNotices:Object.values(_e).filter((e=>e!==_e.PAYMENTS&&e!==_e.EXPRESS_PAYMENTS)).reduce(((e,o)=>[...e,...t(o)]),[]),paymentNotices:t(_e.PAYMENTS),expressPaymentNotices:t(_e.EXPRESS_PAYMENTS)}}),[]),[S,N]=(0,d.useReducer)(X,{}),P=(0,d.useRef)(S),{onCheckoutValidation:A,onCheckoutSuccess:R,onCheckoutFail:T}=(e=>(0,d.useMemo)((()=>({onCheckoutSuccess:ee("checkout_success",e),onCheckoutFail:ee("checkout_fail",e),onCheckoutValidation:ee("checkout_validation",e)})),[e]))(N);(0,d.useEffect)((()=>{P.current=S}),[S]);const I=(0,d.useMemo)((()=>function(...e){return Q()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks"}),A(...e)}),[A]),x=(0,d.useMemo)((()=>function(...e){return Q()("onCheckoutValidationBeforeProcessing",{since:"9.7.0",alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),A(...e)}),[A]),B=(0,d.useMemo)((()=>function(...e){return Q()("onCheckoutAfterProcessingWithSuccess",{since:"9.7.0",alternative:"onCheckoutSuccess",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),R(...e)}),[R]),O=(0,d.useMemo)((()=>function(...e){return Q()("onCheckoutAfterProcessingWithError",{since:"9.7.0",alternative:"onCheckoutFail",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),T(...e)}),[T]);(0,d.useEffect)((()=>{_&&l({observers:P.current,setValidationErrors:b})}),[_,b,l]);const M=nt(p),D=nt(g);(0,d.useEffect)((()=>{p===M&&g===D||h&&i({observers:P.current,notices:{checkoutNotices:v,paymentNotices:f,expressPaymentNotices:C}})}),[p,g,u,E,k,w,h,_,M,D,v,C,f,l,i]);const L={onSubmit:(0,d.useCallback)((()=>{y("submit"),m()}),[y,m]),onCheckoutBeforeProcessing:I,onCheckoutValidationBeforeProcessing:x,onCheckoutAfterProcessingWithSuccess:B,onCheckoutAfterProcessingWithError:O,onCheckoutSuccess:R,onCheckoutFail:T,onCheckoutValidation:A};return(0,r.createElement)(mt.Provider,{value:L},e)},pt=window.wp.apiFetch;var _t=o.n(pt);(0,c.__)("Something went wrong. Please contact us to get assistance.","woocommerce");const ht=window.wc.wcBlocksRegistry,gt=(e,t,o)=>{const r=Object.keys(e).map((t=>({key:t,value:e[t]})),[]),c=`wc-${o}-new-payment-method`;return r.push({key:c,value:t}),r},Et=e=>{if(!e)return;const{__internalSetCustomerId:t}=(0,U.dispatch)(W.CHECKOUT_STORE_KEY);_t().setNonce&&"function"==typeof _t().setNonce&&_t().setNonce(e),null!=e&&e.get("User-ID")&&t(parseInt(e.get("User-ID")||"0",10))},wt=()=>{const{onCheckoutValidation:e}=ut(),{additionalFields:t,customerId:o,customerPassword:r,extensionData:n,hasError:a,isBeforeProcessing:s,isComplete:l,isProcessing:i,orderNotes:m,redirectUrl:u,shouldCreateAccount:p}=(0,U.useSelect)((e=>{const t=e(W.CHECKOUT_STORE_KEY);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:_,__internalProcessCheckoutResponse:h}=(0,U.useDispatch)(W.CHECKOUT_STORE_KEY),g=(0,U.useSelect)((e=>e(W.VALIDATION_STORE_KEY).hasValidationErrors)),{shippingErrorStatus:E}=rt(),{billingAddress:w,shippingAddress:k}=(0,U.useSelect)((e=>e(W.CART_STORE_KEY).getCustomerData())),{cartNeedsPayment:b,cartNeedsShipping:y,receiveCartContents:v}=De(),{activePaymentMethod:f,paymentMethodData:C,isExpressPaymentMethodActive:S,hasPaymentError:N,isPaymentReady:P,shouldSavePayment:A}=(0,U.useSelect)((e=>{const t=e(W.PAYMENT_STORE_KEY);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),hasPaymentError:t.hasPaymentError(),isPaymentReady:t.isPaymentReady(),shouldSavePayment:t.getShouldSavePaymentMethod()}}),[]),R=(0,ht.getPaymentMethods)(),T=(0,ht.getExpressPaymentMethods)(),I=(0,d.useRef)(w),x=(0,d.useRef)(k),B=(0,d.useRef)(u),[O,M]=(0,d.useState)(!1),D=(0,d.useMemo)((()=>{var e;const t={...T,...R};return null==t||null===(e=t[f])||void 0===e?void 0:e.paymentMethodId}),[f,T,R]),L=g()&&!S||N||E.hasError,F=!a&&!L&&(P||!b)&&i;(0,d.useEffect)((()=>{L===a||!i&&!s||S||_(L)}),[L,a,i,s,S,_]),(0,d.useEffect)((()=>{I.current=w,x.current=k,B.current=u}),[w,k,u]);const V=(0,d.useCallback)((()=>g()?void 0!==(0,U.select)(W.VALIDATION_STORE_KEY).getValidationError("shipping-rates-error")&&{errorMessage:(0,c.__)("Sorry, this order requires a shipping option.","woocommerce")}:N?{errorMessage:(0,c.__)("There was a problem with your payment option.","woocommerce"),context:"wc/checkout/payments"}:!E.hasError||{errorMessage:(0,c.__)("There was a problem with your shipping option.","woocommerce"),context:"wc/checkout/shipping-methods"}),[g,N,E.hasError]);(0,d.useEffect)((()=>{let t;return S||(t=e(V,0)),()=>{S||"function"!=typeof t||t()}}),[e,V,S]),(0,d.useEffect)((()=>{window.localStorage.removeItem("WOOCOMMERCE_CHECKOUT_IS_CUSTOMER_DATA_DIRTY"),B.current&&(window.location.href=B.current)}),[l]);const j=(0,d.useCallback)((async()=>{if(O)return;M(!0),(()=>{const e=(0,U.select)("wc/store/store-notices").getRegisteredContainers(),{removeNotice:t}=(0,U.dispatch)("core/notices"),{getNotices:o}=(0,U.select)("core/notices");e.forEach((e=>{o(e).forEach((o=>{t(o.id,e)}))}))})();const e=b?{payment_method:D,payment_data:gt(C,A,f)}:{},a={additional_fields:t,billing_address:Ce(I.current),create_account:p,customer_note:m,customer_password:r,extensions:{...n},shipping_address:y?Ce(x.current):void 0,...e};_t()({path:"/wc/store/v1/checkout",method:"POST",data:a,cache:"no-store",parse:!1}).then((e=>{if((0,de.assertResponseIsValid)(e),Et(e.headers),!e.ok)throw e;return e.json()})).then((e=>{h(e),M(!1)})).catch((e=>{Et(null==e?void 0:e.headers);try{e.json().then((e=>e)).then((e=>{var t;null!==(t=e.data)&&void 0!==t&&t.cart&&v(e.data.cart),(0,W.processErrorResponse)(e),h(e)}))}catch{let e=(0,c.__)("Something went wrong when placing the order. Check your email for order updates before retrying.","woocommerce");0!==o&&(e=(0,c.__)("Something went wrong when placing the order. Check your account's order history or your email for order updates before retrying.","woocommerce")),(0,W.processErrorResponse)({code:"unknown_error",message:e,data:null})}_(!0),M(!1)}))}),[O,b,D,C,A,f,m,p,o,r,n,t,y,v,_,h]);return(0,d.useEffect)((()=>{F&&!O&&j()}),[j,F,O]),null},kt=({children:e,redirectUrl:t})=>(0,r.createElement)(dt,{redirectUrl:t},(0,r.createElement)(ct,null,(0,r.createElement)(oe,null,e,(0,r.createElement)(H,{renderError:p.CURRENT_USER_IS_ADMIN?null:()=>null},(0,r.createElement)(q.PluginArea,{scope:"woocommerce-checkout"})),(0,r.createElement)(wt,null)))),bt=({children:e,redirectUrl:t})=>(0,r.createElement)(kt,{redirectUrl:t},e),yt=window.wc.blocksCheckout,vt=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("g",{fill:"none",fillRule:"evenodd"},(0,r.createElement)("path",{d:"M0 0h24v24H0z"}),(0,r.createElement)("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 ft=o(9491);const Ct=(0,d.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),St=({children:e,className:t=""})=>{const[o,c]=(()=>{const[e,{width:t}]=(0,ft.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]})(),a={hasContainerWidth:""!==c,containerClassName:c,isMobile:"is-mobile"===c,isSmall:"is-small"===c,isMedium:"is-medium"===c,isLarge:"is-large"===c};return(0,r.createElement)(Ct.Provider,{value:a},(0,r.createElement)("div",{className:(0,n.A)(t,c)},o,e))};o(1221);const Nt=({children:e,className:t})=>(0,r.createElement)(St,{className:(0,n.A)("wc-block-components-sidebar-layout",t)},e),Pt=["core/paragraph","core/image","core/separator"],At=e=>{const t=(0,yt.applyCheckoutFilter)({filterName:"additionalCartCheckoutInnerBlockTypes",defaultValue:[],extensions:(0,U.select)(W.CART_STORE_KEY).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,m.getBlockTypes)().filter((t=>((null==t?void 0:t.parent)||[]).includes(e))).map((({name:e})=>e)),...Pt,...t]))},Rt=({clientId:e,registeredBlocks:t,defaultTemplate:o=[]})=>{const r=(0,d.useRef)(t),c=(0,d.useRef)(o),n=(0,U.useRegistry)(),{isPreview:a}=K();(0,d.useEffect)((()=>{let t=!1;if(a)return;const{replaceInnerBlocks:o}=(0,U.dispatch)("core/block-editor");return n.subscribe((()=>{if(!n.select("core/block-editor").getBlock(e))return;const a=n.select("core/block-editor").getBlocks(e);if(0===a.length&&c.current.length>0&&!t){const r=(0,m.createBlocksFromInnerBlocksTemplate)(c.current);if(0!==r.length)return t=!0,void o(e,r)}const s=r.current.map((e=>(0,m.getBlockType)(e))),l=((e,t)=>{const o=t.filter((e=>e&&(({attributes:e})=>{var t,o,r;return Boolean((null===(t=e.lock)||void 0===t?void 0:t.remove)||(null===(o=e.lock)||void 0===o||null===(r=o.default)||void 0===r?void 0:r.remove))})(e))),r=[];return o.forEach((t=>{if(void 0===t)return;const o=e.find((e=>e.name===t.name));o||r.push(t)})),r})(a,s);if(0===l.length)return;let i=-1;const u=l.map((e=>{const t=c.current.findIndex((([t])=>t===e.name)),o=(0,m.createBlock)(e.name);return-1===i&&(i=(({defaultTemplatePosition:e,innerBlocks:t,currentDefaultTemplate:o})=>{switch(e){case-1:return t.length;case 0:return 0;default:const r=o.current[e-1],c=t.findIndex((({name:e})=>e===r[0]));return-1===c?e:c+1}})({defaultTemplatePosition:t,innerBlocks:a,currentDefaultTemplate:c})),o}));n.batch((()=>{n.dispatch("core/block-editor").insertBlocks(u,i,e)}))}),"core/block-editor")}),[e,a,n])};o(1876);const Tt=(0,d.createContext)({hasDarkControls:!1});(0,m.registerBlockType)("woocommerce/filled-cart-block",{icon:{src:(0,r.createElement)(i.A,{icon:vt,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)(),{currentView:o}=K(),{hasDarkControls:c}=(0,d.useContext)(Tt),s=At(yt.innerBlockAreas.FILLED_CART),l=[["woocommerce/cart-items-block",{},[]],["woocommerce/cart-totals-block",{},[]]];return Rt({clientId:e,registeredBlocks:s,defaultTemplate:l}),(0,r.createElement)("div",{...t,hidden:"woocommerce/filled-cart-block"!==o},(0,r.createElement)(Nt,{className:(0,n.A)("wc-block-cart",{"has-dark-controls":c})},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:s,template:l,templateLock:"insert"})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});var It=o(2172);const xt=(0,d.forwardRef)((({children:e,className:t=""},o)=>(0,r.createElement)("div",{ref:o,className:(0,n.A)("wc-block-components-main",t)},e)));(0,m.registerBlockType)("woocommerce/cart-items-block",{icon:{src:(0,r.createElement)(i.A,{icon:It.A,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)({className:"wc-block-cart__main"}),o=At(yt.innerBlockAreas.CART_ITEMS),c=[["woocommerce/cart-line-items-block",{},[]],["woocommerce/cart-cross-sells-block",{},[]]];return Rt({clientId:e,registeredBlocks:o,defaultTemplate:c}),(0,r.createElement)(xt,{...t},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:o,template:c,templateLock:!1,renderAppender:a.InnerBlocks.ButtonBlockAppender}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});var Bt=o(8107),Ot=o(4717);const Mt=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"],Dt=({children:e,style:t={},...o})=>{const c=(0,d.useRef)(null),n=()=>{c.current&&Bt.focus.focusable.find(c.current).forEach((e=>{Mt.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))},a=(0,Ot.YQ)(n,0,{leading:!0});return(0,d.useLayoutEffect)((()=>{let e;return n(),c.current&&(e=new window.MutationObserver(a),e.observe(c.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),a.cancel()}}),[a]),(0,r.createElement)("div",{ref:c,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...t},...o},e)};var Lt=o(195),Ft=o(8558);o(5193);const Vt=({className:e,quantity:t=1,minimum:o=1,maximum:a,onChange:s=(()=>{}),step:l=1,itemName:i="",disabled:m,editable:u})=>{const p=(0,n.A)("wc-block-components-quantity-selector",e),_=(0,d.useRef)(null),h=(0,d.useRef)(null),g=(0,d.useRef)(null),E=void 0!==a,w=!m&&t-l>=o,k=!m&&(!E||t+l<=a),b=(0,d.useCallback)((e=>{let t=e;E&&(t=Math.min(t,Math.floor(a/l)*l)),t=Math.max(t,Math.ceil(o/l)*l),t=Math.floor(t/l)*l,t!==e&&s(t)}),[E,a,o,s,l]),y=(0,Ot.YQ)(b,300);(0,d.useLayoutEffect)((()=>{b(t)}),[t,b]);const v=(0,d.useCallback)((e=>{const o=void 0!==typeof e.key?"ArrowDown"===e.key:e.keyCode===Ft.DOWN,r=void 0!==typeof e.key?"ArrowUp"===e.key:e.keyCode===Ft.UP;o&&w&&(e.preventDefault(),s(t-l)),r&&k&&(e.preventDefault(),s(t+l))}),[t,s,k,w,l]);return(0,r.createElement)("div",{className:p},(0,r.createElement)("input",{ref:_,className:"wc-block-components-quantity-selector__input",disabled:m,readOnly:!u,type:"number",step:l,min:o,max:a,value:t,onKeyDown:v,onChange:e=>{let o=parseInt(e.target.value,10);o=isNaN(o)?t:o,o!==t&&(s(o),y(o))},"aria-label":(0,c.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,c.__)("Quantity of %s in your cart.","woocommerce"),i)}),u&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("button",{ref:h,"aria-label":(0,c.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,c.__)("Reduce quantity of %s","woocommerce"),i),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:!w,onClick:()=>{const e=t-l;s(e),(0,Lt.speak)((0,c.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,c.__)("Quantity reduced to %s.","woocommerce"),e)),b(e)}},"-"),(0,r.createElement)("button",{ref:g,"aria-label":(0,c.sprintf)(/* translators: %s refers to the item's name in the cart. */ /* translators: %s refers to the item's name in the cart. */
(0,c.__)("Increase quantity of %s","woocommerce"),i),disabled:!k,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=t+l;s(e),(0,Lt.speak)((0,c.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,c.__)("Quantity increased to %s.","woocommerce"),e)),b(e)}},"+")))},jt=window.wc.blocksComponents,Yt=window.wc.priceFormat;o(4567);const Ht=({currency:e,maxPrice:t,minPrice:o,priceClassName:a,priceStyle:s={}})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,c.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,c.__)("Price between %1$s and %2$s","woocommerce"),(0,Yt.formatPrice)(o),(0,Yt.formatPrice)(t))),(0,r.createElement)("span",{"aria-hidden":!0},(0,r.createElement)(jt.FormattedMonetaryAmount,{className:(0,n.A)("wc-block-components-product-price__value",a),currency:e,value:o,style:s})," — ",(0,r.createElement)(jt.FormattedMonetaryAmount,{className:(0,n.A)("wc-block-components-product-price__value",a),currency:e,value:t,style:s}))),Ut=({currency:e,regularPriceClassName:t,regularPriceStyle:o,regularPrice:a,priceClassName:s,priceStyle:l,price:i})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,c.__)("Previous price:","woocommerce")),(0,r.createElement)(jt.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("del",{className:(0,n.A)("wc-block-components-product-price__regular",t),style:o},e),value:a}),(0,r.createElement)("span",{className:"screen-reader-text"},(0,c.__)("Discounted price:","woocommerce")),(0,r.createElement)(jt.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("ins",{className:(0,n.A)("wc-block-components-product-price__value","is-discounted",s),style:l},e),value:i})),zt=({align:e,className:t,currency:o,format:c="<price/>",maxPrice:a,minPrice:s,price:l,priceClassName:i,priceStyle:m,regularPrice:u,regularPriceClassName:p,regularPriceStyle:_,style:h})=>{const g=(0,n.A)(t,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});c.includes("<price/>")||(c="<price/>",console.error("Price formats need to include the `<price/>` tag."));const E=u&&l&&l<u;let w=(0,r.createElement)("span",{className:(0,n.A)("wc-block-components-product-price__value",i)});return E?w=(0,r.createElement)(Ut,{currency:o,price:l,priceClassName:i,priceStyle:m,regularPrice:u,regularPriceClassName:p,regularPriceStyle:_}):void 0!==s&&void 0!==a?w=(0,r.createElement)(Ht,{currency:o,maxPrice:a,minPrice:s,priceClassName:i,priceStyle:m}):l&&(w=(0,r.createElement)(jt.FormattedMonetaryAmount,{className:(0,n.A)("wc-block-components-product-price__value",i),currency:o,value:l,style:m})),(0,r.createElement)("span",{className:g,style:h},(0,d.createInterpolateElement)(c,{price:w}))};o(6625);const Kt=({className:e="",disabled:t=!1,name:o,permalink:c="",target:a,rel:s,style:l,onClick:i,...m})=>{const u=(0,n.A)("wc-block-components-product-name",e);if(t){const e=m;return(0,r.createElement)("span",{className:u,...e,dangerouslySetInnerHTML:{__html:(0,we.decodeEntities)(o)}})}return(0,r.createElement)("a",{className:u,href:c,target:a,...m,dangerouslySetInnerHTML:{__html:(0,we.decodeEntities)(o)},style:l})};var $t=o(131);o(9507);const qt=({children:e,className:t})=>(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-product-badge",t)},e),Wt=()=>(0,r.createElement)(qt,{className:"wc-block-components-product-backorder-badge"},(0,c.__)("Available on backorder","woocommerce")),Gt=({image:e={},fallbackAlt:t=""})=>{const o=e.thumbnail?{src:e.thumbnail,alt:(0,we.decodeEntities)(e.alt)||t||"Product Image"}:{src:p.PLACEHOLDER_IMG_SRC,alt:""};return(0,r.createElement)("img",{...o,alt:o.alt})},Qt=({lowStockRemaining:e})=>e?(0,r.createElement)(qt,{className:"wc-block-components-product-low-stock-badge"},(0,c.sprintf)(/* translators: %d stock amount (number of items in stock for product) */ /* translators: %d stock amount (number of items in stock for product) */
(0,c.__)("%d left in stock","woocommerce"),e)):null;var Zt=o(1194);o(4982);const Jt=({details:e=[]})=>Array.isArray(e)?0===(e=e.filter((e=>!e.hidden))).length?null:(0,r.createElement)("ul",{className:"wc-block-components-product-details"},e.map((e=>{const t=(null==e?void 0:e.key)||e.name||"",o=(null==e?void 0:e.className)||(t?`wc-block-components-product-details__${(0,Zt.c)(t)}`:"");return(0,r.createElement)("li",{key:t+(e.display||e.value),className:o},t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"wc-block-components-product-details__name"},(0,we.decodeEntities)(t),":")," "),(0,r.createElement)("span",{className:"wc-block-components-product-details__value"},(0,we.decodeEntities)(e.display||e.value)))}))):null,Xt=window.wp.autop,eo=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),to=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,oo=window.wp.wordcount,ro=({source:e,maxLength:t=15,countType:o="words",className:c="",style:n={}})=>{const a=(0,d.useMemo)((()=>((e,t=15,o="words")=>{const r=(0,Xt.autop)(e);if((0,oo.count)(r,o)<=t)return r;const c=(e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)})(r);return(0,oo.count)(c,o)<=t?c:"words"===o?((e,t,o="&hellip;",r=!0)=>{const c=eo(e),n=c.split(" ").splice(0,t).join(" ");return n===c?r?(0,Xt.autop)(c):c:r?(0,Xt.autop)(to(n,o)):to(n,o)})(c,t):((e,t,o=!0,r="&hellip;",c=!0)=>{const n=eo(e),a=n.slice(0,t);if(a===n)return c?(0,Xt.autop)(n):n;if(o)return(0,Xt.autop)(to(a,r));const s=a.match(/([\s]+)/g),l=s?s.length:0,i=n.slice(0,t+l);return c?(0,Xt.autop)(to(i,r)):to(i,r)})(c,t,"characters_including_spaces"===o)})(e,t,o)),[e,t,o]);return(0,r.createElement)(d.RawHTML,{style:n,className:c},a)},co=({className:e,shortDescription:t="",fullDescription:o=""})=>{const c=t||o;return c?(0,r.createElement)(ro,{className:e,source:c,maxLength:15,countType:C.wordCountType||"words"}):null};o(401);const no=({shortDescription:e="",fullDescription:t="",itemData:o=[],variation:c=[]})=>(0,r.createElement)("div",{className:"wc-block-components-product-metadata"},(0,r.createElement)(co,{className:"wc-block-components-product-metadata__description",shortDescription:e,fullDescription:t}),(0,r.createElement)(Jt,{details:o}),(0,r.createElement)(Jt,{details:c.map((({attribute:e="",value:t})=>({key:e,value:t})))})),ao=({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 n=(0,c.sprintf)(/* translators: %s will be replaced by the discount amount */ /* translators: %s will be replaced by the discount amount */
(0,c.__)("Save %s","woocommerce"),o);return(0,r.createElement)(qt,{className:"wc-block-components-sale-badge"},(0,d.createInterpolateElement)(n,{price:(0,r.createElement)(jt.FormattedMonetaryAmount,{currency:e,value:t})}))},so=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),lo=(0,d.forwardRef)((({lineItem:e,onRemove:t=(()=>{}),tabIndex:o},a)=>{const{name:s="",catalog_visibility:l="visible",short_description:i="",description:m="",low_stock_remaining:u=null,show_backorder_badge:_=!1,quantity_limits:h={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:g=!1,permalink:E="",images:w=[],variation:k=[],item_data:b=[],prices:y={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:C,setItemQuantity:S,removeItem:N,isPendingDelete:P}=(e=>{const t={key:"",quantity:1};(e=>(0,de.isObject)(e)&&(0,de.objectHasProp)(e,"key")&&(0,de.objectHasProp)(e,"quantity")&&(0,de.isString)(e.key)&&(0,de.isNumber)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:o="",quantity:r=1}=t,{cartErrors:c}=De(),{__internalIncrementCalculating:n,__internalDecrementCalculating:a}=(0,U.useDispatch)(W.CHECKOUT_STORE_KEY),[s,l]=(0,d.useState)(r),[i]=(0,Ot.d7)(s,400),m=nt(i),{removeItemFromCart:u,changeCartItemQuantity:p}=(0,U.useDispatch)(W.CART_STORE_KEY);(0,d.useEffect)((()=>l(r)),[r]);const _=(0,U.useSelect)((e=>{if(!o)return{quantity:!1,delete:!1};const t=e(W.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(o),delete:t.isItemPendingDelete(o)}}),[o]),h=(0,d.useCallback)((()=>o?u(o).catch((e=>{(0,W.processErrorResponse)(e)})):Promise.resolve(!1)),[o,u]);return(0,d.useEffect)((()=>{o&&(0,de.isNumber)(m)&&Number.isFinite(m)&&m!==i&&p(o,i).catch((e=>{(0,W.processErrorResponse)(e)}))}),[o,p,i,m]),(0,d.useEffect)((()=>(_.delete?n():a(),()=>{_.delete&&a()})),[a,n,_.delete]),(0,d.useEffect)((()=>(_.quantity||i!==s?n():a(),()=>{(_.quantity||i!==s)&&a()})),[n,a,_.quantity,i,s]),{isPendingDelete:_.delete,quantity:s,setItemQuantity:l,removeItem:h,cartItemQuantityErrors:c}})(e),{dispatchStoreEvent:A}=Ze(),{receiveCart:R,...T}=De(),I=(0,d.useMemo)((()=>({context:"cart",cartItem:e,cart:T})),[e,T]),x=(0,Yt.getCurrencyFromPriceResponse)(y),B=(0,yt.applyCheckoutFilter)({filterName:"itemName",defaultValue:s,extensions:f,arg:I}),O=(0,$t.A)({amount:parseInt(y.raw_prices.regular_price,10),precision:y.raw_prices.precision}),M=(0,$t.A)({amount:parseInt(y.raw_prices.price,10),precision:y.raw_prices.precision}),D=O.subtract(M),L=D.multiply(C),F=(0,Yt.getCurrencyFromPriceResponse)(v);let V=parseInt(v.line_subtotal,10);(0,p.getSetting)("displayCartPricesIncludingTax",!1)&&(V+=parseInt(v.line_subtotal_tax,10));const j=(0,$t.A)({amount:V,precision:F.minorUnit}),Y=w.length?w[0]:{},H="hidden"===l||"search"===l,z=(0,yt.applyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:f,arg:I}),K=(0,yt.applyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:f,arg:I,validation:yt.productPriceValidation}),$=(0,yt.applyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:f,arg:I,validation:yt.productPriceValidation}),q=(0,yt.applyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:f,arg:I,validation:yt.productPriceValidation}),G=(0,yt.applyCheckoutFilter)({filterName:"showRemoveItemLink",defaultValue:!0,extensions:f,arg:I});return(0,r.createElement)("tr",{className:(0,n.A)("wc-block-cart-items__row",z,{"is-disabled":P}),ref:a,tabIndex:o},(0,r.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!(0,de.objectHasProp)(Y,"alt")||!Y.alt},H?(0,r.createElement)(Gt,{image:Y,fallbackAlt:B}):(0,r.createElement)("a",{href:E,tabIndex:-1},(0,r.createElement)(Gt,{image:Y,fallbackAlt:B}))),(0,r.createElement)("td",{className:"wc-block-cart-item__product"},(0,r.createElement)("div",{className:"wc-block-cart-item__wrap"},(0,r.createElement)(Kt,{disabled:P||H,name:B,permalink:E}),_?(0,r.createElement)(Wt,null):!!u&&(0,r.createElement)(Qt,{lowStockRemaining:u}),(0,r.createElement)("div",{className:"wc-block-cart-item__prices"},(0,r.createElement)(zt,{currency:x,regularPrice:so(O,x),price:so(M,x),format:$})),(0,r.createElement)(ao,{currency:x,saleAmount:so(D,x),format:q}),(0,r.createElement)(no,{shortDescription:i,fullDescription:m,itemData:b,variation:k}),(0,r.createElement)("div",{className:"wc-block-cart-item__quantity"},!g&&(0,r.createElement)(Vt,{disabled:P,editable:h.editable,quantity:C,minimum:h.minimum,maximum:h.maximum,step:h.multiple_of,onChange:t=>{S(t),A("cart-set-item-quantity",{product:e,quantity:t})},itemName:B}),G&&(0,r.createElement)("button",{className:"wc-block-cart-item__remove-link","aria-label":(0,c.sprintf)(/* translators: %s refers to the item's name in the cart. */ /* translators: %s refers to the item's name in the cart. */
(0,c.__)("Remove %s from cart","woocommerce"),B),onClick:()=>{t(),N(),A("cart-remove-item",{product:e,quantity:C}),(0,Lt.speak)((0,c.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,c.__)("%s has been removed from your cart.","woocommerce"),B))},disabled:P},(0,c.__)("Remove item","woocommerce"))))),(0,r.createElement)("td",{className:"wc-block-cart-item__total"},(0,r.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},(0,r.createElement)(zt,{currency:F,format:K,price:j.getAmount()}),C>1&&(0,r.createElement)(ao,{currency:x,saleAmount:so(L,x),format:q}))))}));o(1045);const io=[...Array(3)].map(((_x,e)=>(0,r.createElement)(lo,{lineItem:{},key:e}))),mo=e=>{const t={};return e.forEach((({key:e})=>{t[e]=(0,d.createRef)()})),t},uo=({lineItems:e=[],isLoading:t=!1,className:o})=>{const a=(0,d.useRef)(null),s=(0,d.useRef)(mo(e));(0,d.useEffect)((()=>{s.current=mo(e)}),[e]);const l=e=>()=>{null!=s&&s.current&&e&&s.current[e].current instanceof HTMLElement?s.current[e].current.focus():a.current instanceof HTMLElement&&a.current.focus()},i=t?io:e.map(((t,o)=>{const c=e.length>o+1?e[o+1].key:null;return(0,r.createElement)(lo,{key:t.key,lineItem:t,onRemove:l(c),ref:s.current[t.key],tabIndex:-1})}));return(0,r.createElement)("table",{className:(0,n.A)("wc-block-cart-items",o),ref:a,tabIndex:-1},(0,r.createElement)("thead",null,(0,r.createElement)("tr",{className:"wc-block-cart-items__header"},(0,r.createElement)("th",{className:"wc-block-cart-items__header-image"},(0,r.createElement)("span",null,(0,c.__)("Product","woocommerce"))),(0,r.createElement)("th",{className:"wc-block-cart-items__header-product"},(0,r.createElement)("span",null,(0,c.__)("Details","woocommerce"))),(0,r.createElement)("th",{className:"wc-block-cart-items__header-total"},(0,r.createElement)("span",null,(0,c.__)("Total","woocommerce"))))),(0,r.createElement)("tbody",null,i))},po=({className:e})=>{const{cartItems:t,cartIsLoading:o}=De();return(0,r.createElement)(uo,{className:e,lineItems:t,isLoading:o})};(0,m.registerBlockType)("woocommerce/cart-line-items-block",{icon:{src:(0,r.createElement)(i.A,{icon:It.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Dt,null,(0,r.createElement)(po,{className:t})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})}),(0,m.registerBlockType)("woocommerce/cart-cross-sells-block",{icon:{src:(0,r.createElement)(i.A,{icon:It.A,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=(0,a.useBlockProps)({className:"wc-block-cart__cross-sells"}),t=[["core/heading",{content:(0,c.__)("You may be interested in…","woocommerce"),level:2,fontSize:"large"},[]],["woocommerce/cart-cross-sells-products-block",{},[]]];return(0,r.createElement)("div",{...e},(0,r.createElement)(a.InnerBlocks,{template:t,templateLock:!1}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});const _o=window.wp.components,ho=window.wc.wcBlocksSharedContext,go=window.wp.styleEngine;function Eo(e={}){const t={};return(0,go.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function wo(e,t){return e&&t?`has-${(0,Zt.c)(t)}-${e}`:""}const ko=e=>{const t=(e=>{const t=(0,de.isObject)(e)?e:{style:{}};let o=t.style;return(0,de.isString)(o)&&(o=JSON.parse(o)||{}),(0,de.isObject)(o)||(o={}),{...t,style:o}})(e),o=function(e){var t,o,r,c,a,s,l;const{backgroundColor:i,textColor:m,gradient:u,style:d}=e,p=wo("background-color",i),_=wo("color",m),h=function(e){if(e)return`has-${e}-gradient-background`}(u),g=h||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:(0,n.A)(_,h,{[p]:!g&&!!p,"has-text-color":m||(null==d||null===(o=d.color)||void 0===o?void 0:o.text),"has-background":i||(null==d||null===(r=d.color)||void 0===r?void 0:r.background)||u||(null==d||null===(c=d.color)||void 0===c?void 0:c.gradient),"has-link-color":(0,de.isObject)(null==d||null===(a=d.elements)||void 0===a?void 0:a.link)?null==d||null===(s=d.elements)||void 0===s||null===(l=s.link)||void 0===l?void 0:l.color:void 0}),style:Eo({color:(null==d?void 0:d.color)||{}})}}(t),r=function(e){var t;const o=(null===(t=e.style)||void 0===t?void 0:t.border)||{},r=function(e){var t;const{borderColor:o,style:r}=e,c=o?wo("border-color",o):"";return(0,n.A)({"has-border-color":!!o||!(null==r||null===(t=r.border)||void 0===t||!t.color),[c]:!!c})}(e);return{className:r,style:Eo({border:o})}}(t),c=function(e){var t;return{className:void 0,style:Eo({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}(t),a=(e=>{const t=(0,de.isObject)(e.style.typography)?e.style.typography:{},o=(0,de.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,n.A)(a.className,o.className,r.className,c.className),style:{...a.style,...o.style,...r.style,...c.style}}},bo=window.wc.wcBlocksSharedHocs;o(6007);const yo=(0,bo.withProductDataContext)((e=>{const{className:t,align:o}=e,a=ko(e),{parentClassName:s}=(0,ho.useInnerBlockLayoutContext)(),{product:l}=(0,ho.useProductDataContext)();if(!(l.id&&l.on_sale||e.isDescendentOfSingleProductTemplate))return null;const i="string"==typeof o?`wc-block-components-product-sale-badge--align-${o}`:"";return(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-product-sale-badge",t,i,{[`${s}__product-onsale`]:s},a.className),style:a.style},(0,r.createElement)(jt.Label,{label:(0,c.__)("Sale","woocommerce"),screenReaderLabel:(0,c.__)("Product on sale","woocommerce")}))}));o(5183);let vo=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({});const fo=e=>(0,r.createElement)("img",{...e,src:p.PLACEHOLDER_IMG_SRC,alt:"",width:void 0,height:void 0}),Co=({image:e,loaded:t,showFullSize:o,fallbackAlt:c,width:n,scale:a,height:s,aspectRatio:l})=>{const{thumbnail:i,src:m,srcset:u,sizes:p,alt:_}=e||{},h={alt:_||c,hidden:!t,src:i,...o&&{src:m,srcSet:u,sizes:p}},g={height:s,width:n,objectFit:a,aspectRatio:l};return(0,r.createElement)(d.Fragment,null,h.src&&(0,r.createElement)("img",{style:g,"data-testid":"product-image",...h}),!e&&(0,r.createElement)(fo,{style:g}))},So=e=>{const{className:t,imageSizing:o=vo.SINGLE,showProductLink:a=!0,showSaleBadge:s,saleBadgeAlign:l="right",height:i,width:m,scale:u,aspectRatio:p,..._}=e,h=ko(e),{parentClassName:g}=(0,ho.useInnerBlockLayoutContext)(),{product:E,isLoading:w}=(0,ho.useProductDataContext)(),{dispatchStoreEvent:k}=Ze();if(!E.id)return(0,r.createElement)("div",{className:(0,n.A)(t,"wc-block-components-product-image",{[`${g}__product-image`]:g},h.className),style:h.style},(0,r.createElement)(fo,null));const b=!!E.images.length,y=b?E.images[0]:null,v=a?"a":d.Fragment,f=(0,c.sprintf)(/* translators: %s is referring to the product name */ /* translators: %s is referring to the product name */
(0,c.__)("Link to %s","woocommerce"),E.name),C={href:E.permalink,...!b&&{"aria-label":f},onClick:()=>{k("product-view-link",{product:E})}};return delete _.style,(0,r.createElement)("div",{className:(0,n.A)(t,"wc-block-components-product-image",{[`${g}__product-image`]:g},h.className),style:h.style},(0,r.createElement)(v,{...a&&C},!!s&&(0,r.createElement)(yo,{align:l,..._}),(0,r.createElement)(Co,{fallbackAlt:E.name,image:y,loaded:!w,showFullSize:o!==vo.THUMBNAIL,width:m,height:i,scale:u,aspectRatio:p})))};(0,bo.withProductDataContext)(So),o(7128);const No=({children:e,headingLevel:t,elementType:o=`h${t}`,...c})=>(0,r.createElement)(o,{...c},e),Po=e=>{const{className:t,headingLevel:o=2,showProductLink:c=!0,linkTarget:a,align:s}=e,l=ko(e),{parentClassName:i}=(0,ho.useInnerBlockLayoutContext)(),{product:m}=(0,ho.useProductDataContext)(),{dispatchStoreEvent:u}=Ze();return m.id?(0,r.createElement)(No,{headingLevel:o,className:(0,n.A)(t,l.className,"wc-block-components-product-title",{[`${i}__product-title`]:i,[`wc-block-components-product-title--align-${s}`]:s}),style:l.style},(0,r.createElement)(Kt,{disabled:!c,name:m.name,permalink:m.permalink,target:a,onClick:()=>{u("product-view-link",{product:m})}})):(0,r.createElement)(No,{headingLevel:o,className:(0,n.A)(t,l.className,"wc-block-components-product-title",{[`${i}__product-title`]:i,[`wc-block-components-product-title--align-${s}`]:s}),style:l.style})},Ao=((0,bo.withProductDataContext)(Po),e=>({width:e/5*100+"%"})),Ro=({className:e,parentClassName:t})=>{const o=Ao(0);return(0,r.createElement)("div",{className:(0,n.A)(`${e}__norating-container`,`${t}-product-rating__norating-container`)},(0,r.createElement)("div",{className:`${e}__norating`,role:"img"},(0,r.createElement)("span",{style:o})),(0,r.createElement)("span",null,(0,c.__)("No Reviews","woocommerce")))},To=e=>{const{className:t,rating:o,reviews:a,parentClassName:s}=e,l=Ao(o),i=(0,c.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */
(0,c.__)("Rated %f out of 5","woocommerce"),o),m={__html:(0,c.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,c._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",a,"woocommerce"),(0,c.sprintf)('<strong class="rating">%f</strong>',o),(0,c.sprintf)('<span class="rating">%d</span>',a))};return(0,r.createElement)("div",{className:(0,n.A)(`${t}__stars`,`${s}__product-rating__stars`),role:"img","aria-label":i},(0,r.createElement)("span",{style:l,dangerouslySetInnerHTML:m}))},Io=e=>{const{className:t,reviews:o}=e,n=(0,c.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,c._n)("(%s customer review)","(%s customer reviews)",o,"woocommerce"),o);return(0,r.createElement)("span",{className:`${t}__reviews_count`},n)},xo=e=>{const{className:t="wc-block-components-product-rating",showReviewCount:o,showMockedReviews:c,parentClassName:a="",rating:s,reviews:l,styleProps:i,textAlign:m}=e,u=(0,n.A)(i.className,t,{[`${a}__product-rating`]:a,[`has-text-align-${m}`]:m}),d=c&&(0,r.createElement)(Ro,{className:t,parentClassName:a}),p=l?(0,r.createElement)(To,{className:t,rating:s,reviews:l,parentClassName:a}):d,_=l&&o;return(0,r.createElement)("div",{className:u,style:i.style},(0,r.createElement)("div",{className:`${t}__container`},p,_?(0,r.createElement)(Io,{className:t,reviews:l}):null))};o(7195);const Bo=e=>{const{textAlign:t="",shouldDisplayMockedReviewsWhenProductHasNoReviews:o}=e,c=ko(e),{parentClassName:n}=(0,ho.useInnerBlockLayoutContext)(),{product:a}=(0,ho.useProductDataContext)(),s=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(a),l=(e=>{const t=(0,de.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(a);return(0,r.createElement)(xo,{className:"wc-block-components-product-rating-stars",showMockedReviews:o,styleProps:c,parentClassName:n,reviews:l,rating:s,textAlign:t})},Oo=((0,bo.withProductDataContext)(Bo),e=>{var t,o;const{className:c,textAlign:a,isDescendentOfSingleProductTemplate:s}=e,l=ko(e),{parentName:i,parentClassName:m}=(0,ho.useInnerBlockLayoutContext)(),{product:u}=(0,ho.useProductDataContext)(),d="woocommerce/all-products"===i,p=(0,n.A)("wc-block-components-product-price",c,l.className,{[`${m}__product-price`]:m});if(!u.id&&!s){const e=(0,r.createElement)(zt,{align:a,className:p});return d?(0,r.createElement)("div",{className:"wp-block-woocommerce-product-price"},e):e}const _=u.prices,h=s?(0,Yt.getCurrencyFromPriceResponse)():(0,Yt.getCurrencyFromPriceResponse)(_),g="5000",E=_.price!==_.regular_price,w=(0,n.A)({[`${m}__product-price__value`]:m,[`${m}__product-price__value--on-sale`]:E}),k=(0,r.createElement)(zt,{align:a,className:p,style:l.style,regularPriceStyle:l.style,priceStyle:l.style,priceClassName:w,currency:h,price:s?g:_.price,minPrice:null==_||null===(t=_.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==_||null===(o=_.price_range)||void 0===o?void 0:o.max_amount,regularPrice:s?g:_.regular_price,regularPriceClassName:(0,n.A)({[`${m}__product-price__regular`]:m})});return d?(0,r.createElement)("div",{className:"wp-block-woocommerce-product-price"},k):k}),Mo=(e,t)=>{const o=e.find((({id:e})=>e===t));return o?o.quantity:0};o(1546);const Do=({product:e,className:t,style:o})=>{const{id:a,permalink:s,add_to_cart:l,has_options:i,is_purchasable:m,is_in_stock:u}=e,{dispatchStoreEvent:_}=Ze(),{cartQuantity:h,addingToCart:g,addToCart:E}=(e=>{const{addItemToCart:t}=(0,U.useDispatch)(W.CART_STORE_KEY),{cartItems:o,cartIsLoading:r}=De(),{createErrorNotice:c,removeNotice:n}=(0,U.useDispatch)("core/notices"),[a,s]=(0,d.useState)(!1),l=(0,d.useRef)(Mo(o,e));return(0,d.useEffect)((()=>{const t=Mo(o,e);t!==l.current&&(l.current=t)}),[o,e]),{cartQuantity:Number.isFinite(l.current)?l.current:0,addingToCart:a,cartIsLoading:r,addToCart:(o=1)=>(s(!0),t(e,o).then((()=>{n("add-to-cart")})).catch((e=>{c((0,we.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})})).finally((()=>{s(!1)})))}})(a),w=Number.isFinite(h)&&h>0,k=!i&&m&&u,b=(0,we.decodeEntities)((null==l?void 0:l.description)||""),y=w?(0,c.sprintf)(/* translators: %s number of products in cart. */ /* translators: %s number of products in cart. */
(0,c._n)("%d in cart","%d in cart",h,"woocommerce"),h):(0,we.decodeEntities)((null==l?void 0:l.text)||(0,c.__)("Add to cart","woocommerce")),v=k?"button":"a",f={};return k?f.onClick=async()=>{await E(),_("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=(0,p.getSetting)("productsSettings");t&&(window.location.href=R)}:(f.href=s,f.rel="nofollow",f.onClick=()=>{_("product-view-link",{product:e})}),(0,r.createElement)(v,{...f,"aria-label":b,disabled:g,className:(0,n.A)(t,"wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",{loading:g,added:w}),style:o},y)},Lo=({className:e,style:t})=>(0,r.createElement)("button",{className:(0,n.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}),Fo=e=>{const{className:t,textAlign:o}=e,c=ko(e),{parentClassName:a}=(0,ho.useInnerBlockLayoutContext)(),{product:s}=(0,ho.useProductDataContext)();return(0,r.createElement)("div",{className:(0,n.A)(t,"wp-block-button","wc-block-components-product-button",{[`${a}__product-add-to-cart`]:a,[`align-${o}`]:o})},s.id?(0,r.createElement)(Do,{product:s,style:c.style,className:c.className}):(0,r.createElement)(Lo,{style:c.style,className:c.className}))},Vo=((0,bo.withProductDataContext)(Fo),({product:e})=>(0,r.createElement)("div",{className:"cross-sells-product"},(0,r.createElement)(ho.InnerBlockLayoutContextProvider,{parentName:"woocommerce/cart-cross-sells-block",parentClassName:"wp-block-cart-cross-sells-product"},(0,r.createElement)(ho.ProductDataContextProvider,{isLoading:!1,product:e},(0,r.createElement)("div",null,(0,r.createElement)(So,{className:"",showSaleBadge:!0,productId:e.id,showProductLink:!0,saleBadgeAlign:"left",imageSizing:vo.SINGLE,isDescendentOfQueryLoop:!1,scale:"cover",aspectRatio:"1:1"}),(0,r.createElement)(Po,{align:"",headingLevel:3,showProductLink:!0}),(0,r.createElement)(Bo,{isDescendentOfQueryLoop:!1,isDescendentOfSingleProductBlock:!1,productId:e.id,postId:0,shouldDisplayMockedReviewsWhenProductHasNoReviews:!1}),(0,r.createElement)(Oo,null)),(0,r.createElement)(Fo,null))))),jo=({products:e,columns:t})=>{const o=e.map(((e,o)=>o>=t?null:(0,r.createElement)(Vo,{isLoading:!1,product:e,key:e.id})));return(0,r.createElement)("div",null,o)},Yo={A:3},Ho=({className:e,columns:t})=>{const{crossSellsProducts:o}=De();return void 0===t&&(t=Yo.A),(0,r.createElement)(jo,{className:e,columns:t,products:o})};o(9085),o(5049),(0,m.registerBlockType)("woocommerce/cart-cross-sells-products-block",{icon:{src:(0,r.createElement)(i.A,{icon:It.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{className:o,columns:n}=e,s=(0,a.useBlockProps)();return(0,r.createElement)("div",{...s},(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(_o.PanelBody,{title:(0,c.__)("Settings","woocommerce")},(0,r.createElement)(_o.RangeControl,{label:(0,c.__)("Cross-Sells products to show","woocommerce"),value:n,onChange:e=>t({columns:e}),min:(0,p.getSetting)("minColumns",1),max:(0,p.getSetting)("maxColumns",6)}))),(0,r.createElement)(Dt,null,(0,r.createElement)(Ho,{columns:n,className:o})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});const Uo=(0,d.forwardRef)((({children:e,className:t=""},o)=>(0,r.createElement)("div",{ref:o,className:(0,n.A)("wc-block-components-sidebar",t)},e)));function zo(e){const t=(0,d.useRef)(e);return ze()(e,t.current)||(t.current=e),t.current}o(6229),(0,m.registerBlockType)("woocommerce/cart-totals-block",{icon:{src:(0,r.createElement)(i.A,{icon:It.A,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)({className:"wc-block-cart__sidebar"}),o=At(yt.innerBlockAreas.CART_TOTALS),c=[["woocommerce/cart-order-summary-block",{},[]],["woocommerce/cart-express-payment-block",{},[]],["woocommerce/proceed-to-checkout-block",{},[]],["woocommerce/cart-accepted-payment-methods-block",{},[]]];return Rt({clientId:e,registeredBlocks:o,defaultTemplate:c}),(0,r.createElement)(Uo,{...t},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:o,template:c,templateLock:!1,renderAppender:a.InnerBlocks.ButtonBlockAppender}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});const Ko=(e=!1)=>{const{paymentMethodsInitialized:t,expressPaymentMethodsInitialized:o,availablePaymentMethods:r,availableExpressPaymentMethods:c}=(0,U.useSelect)((e=>{const t=e(W.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),n=Object.values(r).map((({name:e})=>e)),a=Object.values(c).map((({name:e})=>e)),s=(0,ht.getPaymentMethods)(),l=(0,ht.getExpressPaymentMethods)(),i=Object.keys(s).reduce(((e,t)=>(n.includes(t)&&(e[t]=s[t]),e)),{}),m=Object.keys(l).reduce(((e,t)=>(a.includes(t)&&(e[t]=l[t]),e)),{}),u=zo(i),d=zo(m);return{paymentMethods:e?d:u,isInitialized:e?o:t}},$o=()=>Ko(!0);var qo=o(4133),Wo=o(7674),Go=o.n(Wo);const Qo=["a","b","em","i","strong","p","br"],Zo=["target","href","rel","name","download"],Jo=(e,t)=>{const o=(null==t?void 0:t.tags)||Qo,r=(null==t?void 0:t.attr)||Zo;return Go().sanitize(e,{ALLOWED_TAGS:o,ALLOWED_ATTR:r})},Xo={warning:"#F0B849",error:"#CC1818",success:"#46B450",info:"#0073AA"},er=({status:e="warning",...t})=>(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...t},(0,r.createElement)("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:Xo[e],strokeWidth:"1.5"}),(0,r.createElement)("path",{d:"M13 7H11V13H13V7Z",fill:Xo[e]}),(0,r.createElement)("path",{d:"M13 15H11V17H13V15Z",fill:Xo[e]}));o(9705);const tr=({href:e,title:t,description:o,warning:n})=>(0,r.createElement)("a",{href:e,className:"wc-block-editor-components-external-link-card",target:"_blank",rel:"noreferrer"},(0,r.createElement)("span",{className:"wc-block-editor-components-external-link-card__content"},(0,r.createElement)("strong",{className:"wc-block-editor-components-external-link-card__title"},t),o&&(0,r.createElement)("span",{className:"wc-block-editor-components-external-link-card__description",dangerouslySetInnerHTML:{__html:Jo(o)}}),n?(0,r.createElement)("span",{className:"wc-block-editor-components-external-link-card__warning"},(0,r.createElement)(i.A,{icon:(0,r.createElement)(er,{status:"error"})}),(0,r.createElement)("span",null,n)):null),(0,r.createElement)(_o.VisuallyHidden,{as:"span"},/* translators: accessibility text */ /* translators: accessibility text */
(0,c.__)("(opens in a new tab)","woocommerce")),(0,r.createElement)(i.A,{icon:qo.A,className:"wc-block-editor-components-external-link-card__icon"})),or=["height","borderRadius"],rr=e=>{const t=(0,U.select)(W.PAYMENT_STORE_KEY).getAvailableExpressPaymentMethods();return Object.values(t).reduce(((t,o)=>t||(null==o?void 0:o.supportsStyle.some((t=>e.includes(t))))),!1)},cr=({attributes:e,setAttributes:t})=>{const{buttonHeight:o,buttonBorderRadius:n}=e;return(0,r.createElement)(r.Fragment,null,rr(["height"])&&(0,r.createElement)(_o.RadioControl,{label:(0,c.__)("Button height","woocommerce"),selected:o,options:[{label:(0,c.__)("Small (40px)","woocommerce"),value:"40"},{label:(0,c.__)("Medium (48px)","woocommerce"),value:"48"},{label:(0,c.__)("Large (55px)","woocommerce"),value:"55"}],onChange:e=>t({buttonHeight:e})}),rr(["borderRadius"])&&(0,r.createElement)("div",{className:"border-radius-control-container"},(0,r.createElement)(a.HeightControl,{label:(0,c.__)("Button border radius","woocommerce"),value:n,onChange:e=>{const o=e.replace("px","");t({buttonBorderRadius:o})}})))},nr=({attributes:e,setAttributes:t})=>e.showButtonStyles?(0,r.createElement)(cr,{attributes:e,setAttributes:t}):null,ar=()=>{const e=(0,U.select)(W.PAYMENT_STORE_KEY).getAvailableExpressPaymentMethods();return Object.entries(e).length<1?(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,c.__)("You currently have no express payment integrations active.","woocommerce")):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,c.__)("You currently have the following express payment integrations active.","woocommerce")),Object.values(e).map((e=>(0,r.createElement)(tr,{key:e.name,href:`${p.ADMIN_URL}admin.php?page=wc-settings&tab=checkout&section=${encodeURIComponent(e.gatewayId)}`,title:e.title,description:e.description}))))},sr=(0,r.createElement)(r.Fragment,null,(0,c.__)("Apply uniform styles","woocommerce")," ",(0,r.createElement)("span",{className:"express-payment-styles-beta-badge"},"Beta")),lr=({attributes:e,setAttributes:t})=>(0,r.createElement)(a.InspectorControls,null,rr(or)&&(0,r.createElement)(_o.PanelBody,{title:(0,c.__)("Button Settings","woocommerce"),className:"express-payment-button-settings"},(0,r.createElement)(_o.ToggleControl,{label:sr,checked:e.showButtonStyles,onChange:()=>t({showButtonStyles:!e.showButtonStyles}),help:(0,c.__)("Sets a consistent style for express payment buttons.","woocommerce")}),(0,r.createElement)(_o.Notice,{status:"warning",isDismissible:!1,className:"wc-block-checkout__notice express-payment-styles-notice"},(0,r.createElement)("strong",null,(0,c.__)("Note","woocommerce"),":")," ",(0,c.__)("Some payment methods might not yet support all style controls","woocommerce")),(0,r.createElement)(nr,{attributes:e,setAttributes:t})),(0,r.createElement)(_o.PanelBody,{title:(0,c.__)("Express Payment Methods","woocommerce")},(0,r.createElement)(ar,null)));o(8375);const ir=({children:e,className:t,screenReaderLabel:o,showSpinner:a=!1,isLoading:s=!0})=>(0,r.createElement)("div",{className:(0,n.A)(t,{"wc-block-components-loading-mask":s})},s&&a&&(0,r.createElement)(jt.Spinner,null),(0,r.createElement)("div",{className:(0,n.A)({"wc-block-components-loading-mask__children":s}),"aria-hidden":s},e),s&&(0,r.createElement)("span",{className:"screen-reader-text"},o||(0,c.__)("Loading…","woocommerce"))),mr=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("g",{fill:"none",fillRule:"evenodd"},(0,r.createElement)("path",{d:"M0 0h24v24H0z"}),(0,r.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),(0,r.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"})));var ur=o(4166),dr=o(3576),pr=o(8994);o(777);const _r={bank:ur.A,bill:dr.A,card:pr.A,checkPayment:mr},hr=({icon:e="",text:t=""})=>{const o=!!e,c=(0,d.useCallback)((e=>o&&(0,de.isString)(e)&&(0,de.objectHasProp)(_r,e)),[o]),a=(0,n.A)("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":o});return(0,r.createElement)("span",{className:a},c(e)?(0,r.createElement)(i.A,{icon:_r[e]}):e,t)},gr=e=>`wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${e}`,Er=({id:e,src:t=null,alt:o=""})=>t?(0,r.createElement)("img",{className:gr(e),src:t,alt:o}):null,wr=[{id:"alipay",alt:"Alipay",src:S+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:S+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:S+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:S+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:S+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:S+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:S+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:S+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:S+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:S+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:S+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:S+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:S+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:S+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:S+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:S+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:S+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:S+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:S+"payment-methods/wechat.svg"}];o(4957);const kr=({icons:e=[],align:t="center",className:o})=>{const c=(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,de.isString)(o.id)&&!t[o.id]&&(t[o.id]=o)})),Object.values(t)})(e);if(0===c.length)return null;const a=(0,n.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,r.createElement)("div",{className:a},c.map((e=>{const t={...e,...(o=e.id,wr.find((e=>e.id===o))||{})};var o;return(0,r.createElement)(Er,{key:"payment-method-icon-"+e.id,...t})})))},br=(e="")=>{const{cartCoupons:t,cartIsLoading:o}=De(),{createErrorNotice:r}=(0,U.useDispatch)("core/notices"),{createNotice:n}=(0,U.useDispatch)("core/notices"),{setValidationErrors:a}=(0,U.useDispatch)(W.VALIDATION_STORE_KEY),{isApplyingCoupon:s,isRemovingCoupon:l}=(0,U.useSelect)((e=>{const t=e(W.CART_STORE_KEY);return{isApplyingCoupon:t.isApplyingCoupon(),isRemovingCoupon:t.isRemovingCoupon()}}),[r,n]),{applyCoupon:i,removeCoupon:m}=(0,U.useDispatch)(W.CART_STORE_KEY),u=(0,U.useSelect)((e=>e(W.CHECKOUT_STORE_KEY).getOrderId()));return{appliedCoupons:t,isLoading:o,applyCoupon:t=>i(t).then((()=>((0,yt.applyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&n("info",(0,c.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,c.__)('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=(e=>{var t,o,r,c;return u&&u>0&&null!=e&&null!==(t=e.data)&&void 0!==t&&null!==(o=t.details)&&void 0!==o&&o.checkout?e.data.details.checkout:null!=e&&null!==(r=e.data)&&void 0!==r&&null!==(c=r.details)&&void 0!==c&&c.cart?e.data.details.cart:e.message})(e);return a({coupon:{message:(0,we.decodeEntities)(t),hidden:!1}}),Promise.resolve(!1)})),removeCoupon:t=>m(t).then((()=>((0,yt.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&n("info",(0,c.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,c.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((t=>(r(t.message,{id:"coupon-form",context:e}),Promise.resolve(!1)))),isApplyingCoupon:s,isRemovingCoupon:l}},yr=(e,t)=>{const o=[],r=(t,o)=>{const r=o+"_tax",c=(0,de.objectHasProp)(e,o)&&(0,de.isString)(e[o])?parseInt(e[o],10):0;return{key:o,label:t,value:c,valueWithTax:c+((0,de.objectHasProp)(e,r)&&(0,de.isString)(e[r])?parseInt(e[r],10):0)}};return o.push(r((0,c.__)("Subtotal:","woocommerce"),"total_items")),o.push(r((0,c.__)("Fees:","woocommerce"),"total_fees")),o.push(r((0,c.__)("Discount:","woocommerce"),"total_discount")),o.push({key:"total_tax",label:(0,c.__)("Taxes:","woocommerce"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&o.push(r((0,c.__)("Shipping:","woocommerce"),"total_shipping")),o};class vr extends d.Component{constructor(...e){super(...e),(0,u.A)(this,"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,c.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(o||p.CURRENT_USER_IS_ADMIN)&&(e=t||(0,c.__)("There was an error with this payment method. Please verify it's configured correctly.","woocommerce"));const n=[{id:"0",content:e,isDismissible:!1,status:"error"}];return(0,r.createElement)(jt.StoreNoticesContainer,{additionalNotices:n,context:_e.PAYMENTS})}return this.props.children}}const fr=vr,Cr="wc/store/payment",Sr=(0,d.createContext)({showButtonStyles:!1,buttonHeight:"48",buttonBorderRadius:"4"}),Nr=()=>{const{isEditor:e}=K(),{showButtonStyles:t,buttonHeight:o,buttonBorderRadius:n}=(0,d.useContext)(Sr),a=t?{height:o,borderRadius:n}:void 0,{activePaymentMethod:s,paymentMethodData:l}=(0,U.useSelect)((e=>{const t=e(Cr);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData()}})),{__internalSetActivePaymentMethod:i,__internalSetExpressPaymentStarted:m,__internalSetPaymentIdle:u,__internalSetPaymentError:_,__internalSetPaymentMethodData:h,__internalSetExpressPaymentError:g}=(0,U.useDispatch)(Cr),{paymentMethods:E}=$o(),w=(()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:o,onCheckoutAfterProcessingWithError:r,onSubmit:n,onCheckoutSuccess:a,onCheckoutFail:s,onCheckoutValidation:l}=ut(),{isCalculating:i,isComplete:m,isIdle:u,isProcessing:_,customerId:h}=(0,U.useSelect)((e=>{const t=e(W.CHECKOUT_STORE_KEY);return{isComplete:t.isComplete(),isIdle:t.isIdle(),isProcessing:t.isProcessing(),customerId:t.getCustomerId(),isCalculating:t.isCalculating()}})),{paymentStatus:g,activePaymentMethod:E,shouldSavePayment:w}=(0,U.useSelect)((e=>{const t=e(W.PAYMENT_STORE_KEY);return{paymentStatus:{get isPristine(){return Q()("isPristine",{since:"9.6.0",alternative:"isIdle",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentIdle()},isIdle:t.isPaymentIdle(),isStarted:t.isExpressPaymentStarted(),isProcessing:t.isPaymentProcessing(),get isFinished(){return Q()("isFinished",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()||t.isPaymentReady()},hasError:t.hasPaymentError(),get hasFailed(){return Q()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()},get isSuccessful(){return Q()("isSuccessful",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentReady()},isReady:t.isPaymentReady(),isDoingExpressPayment:t.isExpressPaymentMethodActive()},activePaymentMethod:t.getActivePaymentMethod(),shouldSavePayment:t.getShouldSavePaymentMethod()}})),{__internalSetExpressPaymentError:k}=(0,U.useDispatch)(W.PAYMENT_STORE_KEY),{onPaymentProcessing:b,onPaymentSetup:y}=(0,d.useContext)(te),{shippingErrorStatus:v,shippingErrorTypes:f,onShippingRateSuccess:C,onShippingRateFail:S,onShippingRateSelectSuccess:N,onShippingRateSelectFail:P}=rt(),{shippingRates:A,isLoadingRates:R,selectedRates:T,isSelectingRate:I,selectShippingRate:x,needsShipping:B}=Je(),{billingAddress:O,shippingAddress:M}=(0,U.useSelect)((e=>e(W.CART_STORE_KEY).getCustomerData())),{setShippingAddress:D}=(0,U.useDispatch)(W.CART_STORE_KEY),{cartItems:L,cartFees:F,cartTotals:V,extensions:j}=De(),{appliedCoupons:Y}=br(),H=(0,d.useRef)(yr(V,B)),z=(0,d.useRef)({label:(0,c.__)("Total","woocommerce"),value:parseInt(V.total_price,10)});(0,d.useEffect)((()=>{H.current=yr(V,B),z.current={label:(0,c.__)("Total","woocommerce"),value:parseInt(V.total_price,10)}}),[V,B]);const K=(0,d.useCallback)(((e="")=>{Q()("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"}),k(e)}),[k]);return{activePaymentMethod:E,billing:{appliedCoupons:Y,billingAddress:O,billingData:O,cartTotal:z.current,cartTotalItems:H.current,currency:(0,Yt.getCurrencyFromPriceResponse)(V),customerId:h,displayPricesIncludingTax:(0,p.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:L,cartFees:F,extensions:j},checkoutStatus:{isCalculating:i,isComplete:m,isIdle:u,isProcessing:_},components:{LoadingMask:ir,PaymentMethodIcons:kr,PaymentMethodLabel:hr,ValidationInputError:jt.ValidationInputError},emitResponse:{noticeContexts:_e,responseTypes:pe},eventRegistration:{onCheckoutAfterProcessingWithError:r,onCheckoutAfterProcessingWithSuccess:o,onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutSuccess:a,onCheckoutFail:s,onCheckoutValidation:l,onPaymentProcessing:b,onPaymentSetup:y,onShippingRateFail:S,onShippingRateSelectFail:P,onShippingRateSelectSuccess:N,onShippingRateSuccess:C},onSubmit:n,paymentStatus:g,setExpressPaymentError:K,shippingData:{isSelectingRate:I,needsShipping:B,selectedRates:T,setSelectedRates:x,setShippingAddress:D,shippingAddress:M,shippingRates:A,shippingRatesLoading:R},shippingStatus:{shippingErrorStatus:v,shippingErrorTypes:f},shouldSavePayment:w}})(),k=(0,d.useRef)(s),b=(0,d.useRef)(l),y=(0,d.useCallback)((e=>()=>{k.current=s,b.current=l,m(),i(e)}),[s,l,i,m]),v=(0,d.useCallback)((()=>{u(),i(k.current,b.current)}),[i,u]),f=(0,d.useCallback)((e=>{_(),h(e),g(e),i(k.current,b.current)}),[i,_,h,g]),C=(0,d.useCallback)(((e="")=>{Q()("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):g("")}),[g,f]),S=Object.entries(E),N=S.length>0?S.map((([t,o])=>{const c=e?o.edit:o.content;return(0,d.isValidElement)(c)?(0,r.createElement)("li",{key:t,id:`express-payment-method-${t}`},(0,d.cloneElement)(c,{...w,onClick:y(t),onClose:v,onError:f,setExpressPaymentError:C,buttonAttributes:a})):null})):(0,r.createElement)("li",{key:"noneRegistered"},(0,c.__)("No registered Payment Methods","woocommerce"));return(0,r.createElement)(fr,{isEditor:e},(0,r.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},N))};o(9569);const Pr=()=>{const{paymentMethods:e,isInitialized:t}=$o(),{isCalculating:o,isProcessing:n,isAfterProcessing:a,isBeforeProcessing:s,isComplete:l,hasError:i}=(0,U.useSelect)((e=>{const t=e(W.CHECKOUT_STORE_KEY);return{isCalculating:t.isCalculating(),isProcessing:t.isProcessing(),isAfterProcessing:t.isAfterProcessing(),isBeforeProcessing:t.isBeforeProcessing(),isComplete:t.isComplete(),hasError:t.hasError()}})),m=(0,U.useSelect)((e=>e(W.PAYMENT_STORE_KEY).isExpressPaymentMethodActive()));if(!t||t&&0===Object.keys(e).length)return null;const u=n||a||s||l&&!i;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ir,{isLoading:o||u||m},(0,r.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},(0,r.createElement)("div",{className:"wc-block-components-express-payment__content"},(0,r.createElement)(jt.StoreNoticesContainer,{context:_e.EXPRESS_PAYMENTS}),(0,r.createElement)(Nr,null)))),(0,r.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},(0,c.__)("Or","woocommerce")))},Ar=({className:e})=>{const{cartNeedsPayment:t}=De();return t?(0,r.createElement)("div",{className:(0,n.A)("wc-block-cart__payment-options",e)},(0,r.createElement)(Pr,null)):null};o(5913);const Rr=(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},(0,r.createElement)("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,r.createElement)("path",{fill:"#1E1E1E",d:"M10 3h4v3h-4z"}),(0,r.createElement)("rect",{width:"1.5",height:"5",x:"11.25",y:"8",fill:"#1E1E1E",rx:".75"}),(0,r.createElement)("path",{fill:"#1E1E1E",d:"m15.7 4.816 1.66 1.078-1.114 1.718-1.661-1.078z"}));(0,m.registerBlockType)("woocommerce/cart-express-payment-block",{icon:{src:(0,r.createElement)(i.A,{style:{fill:"none"},icon:Rr,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{paymentMethods:o,isInitialized:c}=$o(),s=Object.keys(o).length>0,l=(0,a.useBlockProps)({className:(0,n.A)({"wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods":s})}),{className:i,showButtonStyles:m,buttonHeight:u,buttonBorderRadius:d}=e;return c&&s?(0,r.createElement)("div",{...l},(0,r.createElement)(lr,{attributes:e,setAttributes:t}),(0,r.createElement)(Sr.Provider,{value:{showButtonStyles:m,buttonHeight:u,buttonBorderRadius:d}},(0,r.createElement)(Ar,{className:i}))):null},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});var Tr=o(498);const Ir=(0,c.__)("Proceed to Checkout","woocommerce"),xr={checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}},buttonLabel:{type:"string",default:Ir}};var Br=o(1777);o(2080),o(7791);const Or=()=>(0,r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"}),Mr=(0,d.forwardRef)(((e,t)=>{"showSpinner"in e&&Q()("showSpinner prop",{version:"8.9.0",alternative:"Render a spinner in the button children instead.",plugin:"WooCommerce"});const{className:o,showSpinner:c=!1,children:a,variant:s="contained",removeTextWrap:l=!1,...i}=e,m=(0,n.A)("wc-block-components-button","wp-element-button",o,s,{"wc-block-components-button--loading":c});if("href"in e)return(0,r.createElement)(Br.$,{render:(0,r.createElement)("a",{ref:t,href:e.href},c&&(0,r.createElement)(Or,null),(0,r.createElement)("span",{className:"wc-block-components-button__text"},a)),className:m,...i});const u=l?e.children:(0,r.createElement)("span",{className:"wc-block-components-button__text"},e.children);return(0,r.createElement)(Br.$,{ref:t,className:m,...i},c&&(0,r.createElement)(Or,null),u)})),Dr=({onChange:e,placeholder:t,value:o,children:c,...n})=>(0,r.createElement)(Mr,{...n},(0,r.createElement)(a.RichText,{multiline:!1,allowedFormats:[],value:o,placeholder:t,onChange:e}),c),Lr=(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}`)},Fr=({setPageId:e,pageId:t,labels:o})=>{const n=(0,U.useSelect)((e=>e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})),[])||null;return n?(0,r.createElement)(_o.PanelBody,{title:o.title},(0,r.createElement)(_o.SelectControl,{label:(0,c.__)("Link to","woocommerce"),value:t,options:[{label:o.default,value:0},...n.map((e=>({label:Lr(e,n),value:parseInt(e.id,10)})))],onChange:t=>e(parseInt(t,10))})):null};o(6080),(0,m.registerBlockType)("woocommerce/proceed-to-checkout-block",{icon:{src:(0,r.createElement)(i.A,{icon:Tr.A,className:"wc-block-editor-components-block-icon"})},attributes:xr,edit:({attributes:e,setAttributes:t})=>{const o=(0,a.useBlockProps)(),{checkoutPageId:n=0,buttonLabel:s}=e,{current:l}=(0,d.useRef)(n),i=(0,U.useSelect)((e=>l||e("core/editor").getCurrentPostId()),[l]);return(0,r.createElement)("div",{...o},(0,r.createElement)(a.InspectorControls,null,!(i===A&&0===l)&&(0,r.createElement)(Fr,{pageId:n,setPageId:e=>t({checkoutPageId:e}),labels:{title:(0,c.__)("Proceed to Checkout button","woocommerce"),default:(0,c.__)("WooCommerce Checkout Page","woocommerce")}})),(0,r.createElement)(Dr,{className:"wc-block-cart__submit-button",value:s,placeholder:Ir,onChange:e=>{t({buttonLabel:e})}}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});const Vr=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("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,r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"})),jr=N?["core/paragraph",{align:"center",content:(0,c.sprintf)(/* translators: %s is the link to the store product directory. */ /* translators: %s is the link to the store product directory. */
(0,c.__)('<a href="%s">Browse store</a>',"woocommerce"),N),dropCap:!1}]:null,Yr=[["core/heading",{textAlign:"center",content:(0,c.__)("Your cart is currently empty!","woocommerce"),level:2,className:"with-empty-cart-icon wc-block-cart__empty-cart__title"}],jr,["core/separator",{className:"is-style-dots"}],["core/heading",{textAlign:"center",content:(0,c.__)("New in store","woocommerce"),level:2}],["woocommerce/product-new",{columns:4,rows:1}]].filter(Boolean);o(6611),(0,m.registerBlockType)("woocommerce/empty-cart-block",{icon:{src:(0,r.createElement)(i.A,{icon:Vr,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)(),{currentView:o}=K(),c=At(yt.innerBlockAreas.EMPTY_CART);return Rt({clientId:e,registeredBlocks:c,defaultTemplate:Yr}),(0,r.createElement)("div",{...t,hidden:"woocommerce/empty-cart-block"!==o},(0,r.createElement)(a.InnerBlocks,{template:Yr,templateLock:!1,renderAppender:a.InnerBlocks.ButtonBlockAppender}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});const Hr=e=>Object.values(e).reduce(((e,t)=>(null!==t.icons&&(e=e.concat(t.icons)),e)),[]),Ur=({className:e})=>{const{paymentMethods:t}=Ko(!1);return(0,r.createElement)(kr,{className:e,icons:Hr(t)})};(0,m.registerBlockType)("woocommerce/cart-accepted-payment-methods-block",{icon:{src:(0,r.createElement)(i.A,{icon:pr.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Ur,{className:t}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});const zr=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},(0,r.createElement)("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,r.createElement)("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,r.createElement)("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(3048);const Kr=({instanceId:e,isLoading:t=!1,onSubmit:o,displayCouponForm:n=!1})=>{const[a,s]=(0,d.useState)(""),[l,i]=(0,d.useState)(n),m=`wc-block-components-totals-coupon__input-${e}`,{validationErrorId:u}=(0,U.useSelect)((t=>({validationErrorId:t(W.VALIDATION_STORE_KEY).getValidationErrorId(e)}))),p=(0,d.useRef)(null);return(0,r.createElement)(jt.Panel,{className:"wc-block-components-totals-coupon",initialOpen:l,hasBorder:!1,title:(0,c.__)("Add a coupon","woocommerce"),state:[l,i]},(0,r.createElement)(ir,{screenReaderLabel:(0,c.__)("Applying coupon…","woocommerce"),isLoading:t,showSpinner:!1},(0,r.createElement)("div",{className:"wc-block-components-totals-coupon__content"},(0,r.createElement)("form",{className:"wc-block-components-totals-coupon__form",id:"wc-block-components-totals-coupon__form"},(0,r.createElement)(jt.ValidatedTextInput,{id:m,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:(0,c.__)("Enter code","woocommerce"),value:a,ariaDescribedBy:u,onChange:e=>{s(e)},focusOnMount:!0,validateOnMount:!1,showError:!1,ref:p}),(0,r.createElement)(Mr,{className:"wc-block-components-totals-coupon__button",disabled:t||!a,showSpinner:t,onClick:e=>{var t;e.preventDefault(),void 0!==o?null===(t=o(a))||void 0===t||t.then((e=>{var t;e?(s(""),i(!1)):null!==(t=p.current)&&void 0!==t&&t.focus&&p.current.focus()})):(s(""),i(!0))},type:"submit"},(0,c.__)("Apply","woocommerce"))),(0,r.createElement)(jt.ValidationInputError,{propertyName:"coupon",elementId:e}))))};o(265);const $r={context:"summary"},qr=({cartCoupons:e=[],currency:t,isRemovingCoupon:o,removeCoupon:n,values:a})=>{const{total_discount:s,total_discount_tax:l}=a,i=parseInt(s,10),m=(0,yt.applyCheckoutFilter)({arg:$r,filterName:"coupons",defaultValue:e});if(!i&&0===m.length)return null;const u=parseInt(l,10),d=(0,p.getSetting)("displayCartPricesIncludingTax",!1)?i+u:i;return(0,r.createElement)(jt.TotalsItem,{className:"wc-block-components-totals-discount",currency:t,description:0!==m.length&&(0,r.createElement)(ir,{screenReaderLabel:(0,c.__)("Removing coupon…","woocommerce"),isLoading:o,showSpinner:!1},(0,r.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},m.map((e=>(0,r.createElement)(jt.RemovableChip,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:(0,c.sprintf)(/* translators: %s Coupon code. */ /* translators: %s Coupon code. */
(0,c.__)("Coupon: %s","woocommerce"),e.label),disabled:o,onRemove:()=>{n(e.code)},radius:"large",ariaLabel:(0,c.sprintf)(/* translators: %s is a coupon code. */ /* translators: %s is a coupon code. */
(0,c.__)('Remove coupon "%s"',"woocommerce"),e.label)}))))),label:d?(0,c.__)("Discount","woocommerce"):(0,c.__)("Coupons","woocommerce"),value:d?-1*d:"-"})};o(7919);const Wr=({currency:e,values:t,className:o})=>{const a=(0,p.getSetting)("taxesEnabled",!0)&&(0,p.getSetting)("displayCartPricesIncludingTax",!1),{total_price:s,total_tax:l,tax_lines:i}=t,{receiveCart:m,...u}=De(),_=(0,yt.applyCheckoutFilter)({filterName:"totalLabel",defaultValue:(0,c.__)("Total","woocommerce"),extensions:u.extensions,arg:{cart:u}}),h=(0,yt.applyCheckoutFilter)({filterName:"totalValue",defaultValue:"<price/>",extensions:u.extensions,arg:{cart:u},validation:yt.productPriceValidation}),g=(0,r.createElement)(jt.FormattedMonetaryAmount,{className:"wc-block-components-totals-footer-item-tax-value",currency:e,value:parseInt(s,10)}),E=(0,d.createInterpolateElement)(h,{price:g}),w=parseInt(l,10),k=i&&i.length>0?(0,c.sprintf)(/* translators: %s is a list of tax rates */ /* translators: %s is a list of tax rates */
(0,c.__)("Including %s","woocommerce"),i.map((({name:t,price:o})=>`${(0,Yt.formatPrice)(o,e)} ${t}`)).join(", ")):(0,c.__)("Including <TaxAmount/> in taxes","woocommerce");return(0,r.createElement)(jt.TotalsItem,{className:(0,n.A)("wc-block-components-totals-footer-item",o),currency:e,label:_,value:E,description:a&&0!==w&&(0,r.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},(0,d.createInterpolateElement)(k,{TaxAmount:(0,r.createElement)(jt.FormattedMonetaryAmount,{className:"wc-block-components-totals-footer-item-tax-value",currency:e,value:w})}))})},Gr=()=>{const{shippingRates:e}=De(),t=(e=>e.flatMap((e=>e.shipping_rates.filter((e=>e.selected)).flatMap((e=>e.name)))))(e);return t?(0,r.createElement)("div",{className:"wc-block-components-totals-shipping__via"},(0,we.decodeEntities)(t.filter(((e,o)=>t.indexOf(e)===o)).join(", "))):null};let Qr=null;o(7051),o(2931);var Zr=o(224);o(5452);const Jr=e=>{const{onChange:t,options:o,label:a,value:s="",className:l,size:m,errorId:u,required:p,errorMessage:_=(0,c.__)("Please select a valid option","woocommerce"),placeholder:h,...g}=e,E=(0,d.useCallback)((e=>{t(e.target.value)}),[t]),w=(0,d.useMemo)((()=>({value:"",label:null!=h?h:(0,c.sprintf)(
// translators: %s will be label of the field. For example "country/region".
// translators: %s will be label of the field. For example "country/region".
(0,c.__)("Select a %s","woocommerce"),null==a?void 0:a.toLowerCase()),disabled:!!p})),[a,h,p]),k=(0,d.useId)(),b=g.id||`wc-blocks-components-select-${k}`,y=u||b,v=(0,d.useMemo)((()=>p&&s?o:[w].concat(o)),[p,s,w,o]),{setValidationErrors:f,clearValidationError:C}=(0,U.useDispatch)(W.VALIDATION_STORE_KEY),{error:S,validationErrorId:N}=(0,U.useSelect)((e=>{const t=e(W.VALIDATION_STORE_KEY);return{error:t.getValidationError(y),validationErrorId:t.getValidationErrorId(y)}}));(0,d.useEffect)((()=>(!p||s?C(y):f({[y]:{message:_,hidden:!0}}),()=>{C(y)})),[C,s,y,_,p,f]);const P=(0,U.useSelect)((e=>e(W.VALIDATION_STORE_KEY).getValidationError(y||"")||{hidden:!0}));return(0,r.createElement)("div",{className:(0,n.A)(l,{"has-error":!P.hidden})},(0,r.createElement)("div",{className:"wc-blocks-components-select"},(0,r.createElement)("div",{className:"wc-blocks-components-select__container"},(0,r.createElement)("label",{htmlFor:b,className:"wc-blocks-components-select__label"},a),(0,r.createElement)("select",{className:"wc-blocks-components-select__select",id:b,size:void 0!==m?m:1,onChange:E,value:s,"aria-invalid":!(null==S||!S.message||null!=S&&S.hidden),"aria-errormessage":N,...g},v.map((e=>(0,r.createElement)("option",{key:e.value,value:e.value,"data-alternate-values":`[${e.label}]`,disabled:void 0!==e.disabled&&e.disabled},e.label)))),(0,r.createElement)(i.A,{className:"wc-blocks-components-select__expand",icon:Zr.A}))),(0,r.createElement)(jt.ValidationInputError,{propertyName:y}))},Xr=({className:e,countries:t,id:o,label:c,onChange:a,value:s="",autoComplete:l="off",required:i=!1})=>{const m=(0,d.useMemo)((()=>Object.entries(t).map((([e,t])=>({value:e,label:(0,we.decodeEntities)(t)})))),[t]);return(0,r.createElement)(Jr,{className:(0,n.A)(e,"wc-block-components-country-input"),id:o,label:c||"",onChange:a,options:m,value:s,required:i,autoComplete:l})},ec=e=>{const{...t}=e;return(0,r.createElement)(Xr,{countries:B,...t})},tc=e=>(0,r.createElement)(Xr,{countries:M,...e});o(8824);const oc=(e,t)=>{const o=t.find((t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()));return o?o.value:""},rc=({className:e,id:t,states:o,country:c,label:a,onChange:s,autoComplete:l="off",value:i="",required:m=!1})=>{const u=o[c],p=(0,d.useMemo)((()=>u&&Object.keys(u).length>0?Object.keys(u).map((e=>({value:e,label:(0,we.decodeEntities)(u[e])}))):[]),[u]),_=(0,d.useCallback)((e=>{const t=p.length>0?oc(e,p):e;t!==i&&s(t)}),[s,p,i]),h=(0,d.useRef)(i);return(0,d.useEffect)((()=>{h.current!==i&&(h.current=i)}),[i]),(0,d.useEffect)((()=>{if(p.length>0&&h.current){const e=oc(h.current,p);e!==h.current&&_(e)}}),[p,_]),p.length>0?(0,r.createElement)(Jr,{className:(0,n.$)(e,"wc-block-components-state-input"),options:p,label:a||"",id:t,onChange:_,value:i,autoComplete:l,required:m}):(0,r.createElement)(jt.ValidatedTextInput,{className:e,id:t,label:a,onChange:_,autoComplete:l,value:i,required:m})},cc=e=>{const{...t}=e;return(0,r.createElement)(rc,{states:O,...t})},nc=e=>(0,r.createElement)(rc,{states:D,...e});o(5684);const ac=({field:e,props:t,onChange:o,value:n})=>{var a;const s=null!==(a=null==e?void 0:e.required)&&void 0!==a&&a,[l,i]=(0,d.useState)((()=>Boolean(n)||s)),m=(0,d.useCallback)((t=>{o(e.key,t),i(!0)}),[e.key,o]);return(0,r.createElement)(d.Fragment,null,l?(0,r.createElement)(jt.ValidatedTextInput,{...t,type:e.type,label:s?e.label:e.optionalLabel,className:`wc-block-components-address-form__${e.key}`,value:n,onChange:t=>o(e.key,t)}):(0,r.createElement)(d.Fragment,null,(0,r.createElement)(Br.$,{render:(0,r.createElement)("span",null),className:"wc-block-components-address-form__address_2-toggle",onClick:()=>i(!0)},(0,c.sprintf)(
// translators: %s: address 2 field label.
// translators: %s: address 2 field label.
(0,c.__)("+ Add %s","woocommerce"),e.label.toLowerCase())),(0,r.createElement)("input",{type:"text",tabIndex:-1,className:"wc-block-components-address-form__address_2-hidden-input","aria-hidden":"true","aria-label":e.label,autoComplete:e.autocomplete,id:null==t?void 0:t.id,value:n,onChange:e=>m(e.target.value)})))},sc=(e,t,o)=>({id:`${t}-${null==e?void 0:e.key}`.replaceAll("/","-"),errorId:`${o}_${null==e?void 0:e.key}`,label:null!=e&&e.required?null==e?void 0:e.label:null==e?void 0:e.optionalLabel,autoCapitalize:null==e?void 0:e.autocapitalize,autoComplete:null==e?void 0:e.autocomplete,errorMessage:null==e?void 0:e.errorMessage,required:null==e?void 0:e.required,placeholder:null==e?void 0:e.placeholder,className:`wc-block-components-address-form__${null==e?void 0:e.key}`.replaceAll("/","-"),...null==e?void 0:e.attributes}),lc=(e,t,o)=>({field:t.find((t=>t.key===e)),value:(0,de.objectHasProp)(o,e)?o[e]:void 0}),ic=({formId:e,address1:t,address2:o,addressType:c,onChange:n})=>{var a,s,l,i;const m=t?sc(t.field,e,c):void 0,u=o?sc(o.field,e,c):void 0;return(0,r.createElement)(r.Fragment,null,t&&(0,r.createElement)(jt.ValidatedTextInput,{...m,type:null===(a=t.field)||void 0===a?void 0:a.type,label:null===(s=t.field)||void 0===s?void 0:s.label,className:`wc-block-components-address-form__${null===(l=t.field)||void 0===l?void 0:l.key}`,value:t.value,onChange:e=>{var o;return n(null===(o=t.field)||void 0===o?void 0:o.key,e)}}),(null==o?void 0:o.field)&&!(null!=o&&null!==(i=o.field)&&void 0!==i&&i.hidden)&&(0,r.createElement)(ac,{field:o.field,props:u,onChange:n,value:null==o?void 0:o.value}))};function mc(e){let t=e;return function(e){const o=t;return t=e,o}}const uc=mc(),dc=mc(),pc=({id:e="",fields:t,fieldConfig:o={},onChange:a,addressType:s="shipping",values:l,children:i,isEditing:m})=>{const u=(0,ft.useInstanceId)(pc),p=(0,d.useRef)(!0),_=zo(t),h=zo(o),g=zo((0,de.objectHasProp)(l,"country")?l.country:""),E=(0,d.useMemo)((()=>{const e=ye(_,h,g);return{fields:e,addressType:s,required:e.filter((e=>e.required)),hidden:e.filter((e=>e.hidden))}}),[_,h,g,s]),w=(0,d.useRef)({});return(0,d.useEffect)((()=>{const e={...l,...Object.fromEntries(E.hidden.map((e=>[e.key,""])))};ze()(l,e)||a(e)}),[a,E,l]),(0,d.useEffect)((()=>{if((0,de.objectHasProp)(l,"country")&&((e,t)=>{const o=`${e}_country`,r=(0,U.select)(W.VALIDATION_STORE_KEY).getValidationError(o);!t.country&&(t.city||t.state||t.postcode)&&(r?(0,U.dispatch)(W.VALIDATION_STORE_KEY).showValidationError(o):(0,U.dispatch)(W.VALIDATION_STORE_KEY).setValidationErrors({[o]:{message:(0,c.__)("Please select your country","woocommerce"),hidden:!1}})),r&&t.country&&(0,U.dispatch)(W.VALIDATION_STORE_KEY).clearValidationError(o)})(s,l),(0,de.objectHasProp)(l,"state")){const e=E.fields.find((e=>"state"===e.key));e&&((e,t,o)=>{const r=`${e}_state`,n=(0,U.select)(W.VALIDATION_STORE_KEY).getValidationError(r),a=o.required,s="shipping"===e?uc(t):dc(t),l=!!s&&!ze()(s,t);n?!a||t.state?(0,U.dispatch)(W.VALIDATION_STORE_KEY).clearValidationError(r):l||(0,U.dispatch)(W.VALIDATION_STORE_KEY).showValidationError(r):!n&&a&&!t.state&&t.country&&(0,U.dispatch)(W.VALIDATION_STORE_KEY).setValidationErrors({[r]:{message:(0,c.sprintf)(/* translators: %s will be the state field label in lowercase e.g. "state" */ /* translators: %s will be the state field label in lowercase e.g. "state" */
(0,c.__)("Please select a %s","woocommerce"),o.label.toLowerCase()),hidden:!0}})})(s,l,e)}}),[l,s,E]),(0,d.useEffect)((()=>{var e,t;null===(e=w.current)||void 0===e||null===(t=e.postcode)||void 0===t||t.revalidate()}),[g]),(0,d.useEffect)((()=>{let t;if(!p.current&&m&&w.current){const o=E.fields.find((e=>!1===e.hidden));if(!o)return;const{id:r}=sc(o,e||`${u}`,s),c=document.getElementById(r);c&&(t=setTimeout((()=>{c.focus()}),300))}return p.current=!1,()=>{clearTimeout(t)}}),[m,E,e,u,s]),e=e||`${u}`,(0,r.createElement)("div",{id:e,className:"wc-block-components-address-form"},E.fields.map((t=>{if(t.hidden)return null;const o=sc(t,e,s),i=(e=>{const{errorId:t,errorMessage:o,autoCapitalize:r,autoComplete:c,placeholder:n,...a}=e;return a})(o);if("email"===t.key&&(o.id="email",o.errorId="billing_email"),"checkbox"===t.type)return(0,r.createElement)(jt.CheckboxControl,{key:t.key,checked:Boolean(l[t.key]),onChange:e=>{a({...l,[t.key]:e})},...i});if("address_1"===t.key){const o=lc("address_1",E.fields,l),c=lc("address_2",E.fields,l);return(0,r.createElement)(ic,{address1:o,address2:c,addressType:s,formId:e,key:t.key,onChange:(e,t)=>{a({...l,[e]:t})}})}if("address_2"===t.key)return null;if("country"===t.key&&(0,de.objectHasProp)(l,"country")){const e="shipping"===s?tc:ec;return(0,r.createElement)(e,{key:t.key,...o,value:l.country,onChange:e=>{a({...l,country:e,state:"",postcode:""})}})}if("state"===t.key&&(0,de.objectHasProp)(l,"state")){const e="shipping"===s?nc:cc;return(0,r.createElement)(e,{key:t.key,...o,country:l.country,value:l.state,onChange:e=>a({...l,state:e})})}return"select"===t.type?void 0===t.options?null:(0,r.createElement)(Jr,{key:t.key,...o,label:o.label||"",className:(0,n.A)("wc-block-components-select-input",`wc-block-components-select-input-${t.key}`.replaceAll("/","-")),value:l[t.key],onChange:e=>{a({...l,[t.key]:e})},options:t.options,required:t.required,errorMessage:o.errorMessage||void 0}):(0,r.createElement)(jt.ValidatedTextInput,{key:t.key,ref:e=>w.current[t.key]=e,...o,type:t.type,value:l[t.key],onChange:e=>a({...l,[t.key]:e}),customFormatter:e=>"postcode"===t.key?e.trimStart().toUpperCase():e,customValidation:e=>((e,t,o)=>!((e.required||e.value)&&("postcode"===t&&o&&!(0,yt.isPostcode)({postcode:e.value,country:o})?(e.setCustomValidity((0,c.__)("Please enter a valid postcode","woocommerce")),1):"email"===t&&!(0,ve.isEmail)(e.value)&&(e.setCustomValidity((0,c.__)("Please enter a valid email address","woocommerce")),1))))(e,t.key,(0,de.objectHasProp)(l,"country")?l.country:"")})})),i)},_c=pc,hc=({address:e,onUpdate:t,onCancel:o,addressFields:n})=>{const[a,s]=(0,d.useState)(e),{showAllValidationErrors:l}=(0,U.useDispatch)(W.VALIDATION_STORE_KEY),i=function(e){const t=(0,d.useRef)(null),o=(0,d.useRef)(null),r=(0,d.useRef)(e);return(0,d.useEffect)((()=>{r.current=e}),[e]),(0,d.useCallback)((e=>{if(e)t.current=e,o.current=e.ownerDocument.activeElement;else if(o.current){var c,n,a;const e=null===(c=t.current)||void 0===c?void 0:c.contains(null===(n=t.current)||void 0===n?void 0:n.ownerDocument.activeElement);var s;if(null!==(a=t.current)&&void 0!==a&&a.isConnected&&!e&&(null!==(s=Qr)&&void 0!==s||(Qr=o.current)),r.current)r.current();else{var l;const e=o.current;null===(l=null!=e&&e.isConnected?e:Qr)||void 0===l||l.focus()}Qr=null}}),[])}(),{hasValidationErrors:m,isCustomerDataUpdating:u}=(0,U.useSelect)((e=>({hasValidationErrors:e(W.VALIDATION_STORE_KEY).hasValidationErrors,isCustomerDataUpdating:e(W.CART_STORE_KEY).isCustomerDataUpdating()})));return(0,r.createElement)("form",{className:"wc-block-components-shipping-calculator-address",ref:i},(0,r.createElement)(_c,{fields:n,onChange:s,values:a}),(0,r.createElement)(Mr,{className:"wc-block-components-shipping-calculator-address__button",disabled:u,variant:"outlined",onClick:r=>{if(r.preventDefault(),ze()(a,e))return o();if(l(),!m()){const e={};return n.forEach((t=>{void 0!==a[t]&&(e[t]=a[t])})),t(e)}},type:"submit"},(0,c.__)("Check delivery options","woocommerce")))},gc=(0,d.createContext)({shippingCalculatorID:"",showCalculator:!1,isShippingCalculatorOpen:!1,setIsShippingCalculatorOpen:()=>{}}),Ec=({onUpdate:e=(()=>{}),onCancel:t=(()=>{}),addressFields:o=["country","state","city","postcode"]})=>{const{shippingCalculatorID:c,showCalculator:n,setIsShippingCalculatorOpen:a}=(0,d.useContext)(gc),{shippingAddress:s}=(()=>{const{customerData:e,isInitialized:t}=(0,U.useSelect)((e=>{const t=e(W.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}})),{setShippingAddress:o,setBillingAddress:r}=(0,U.useDispatch)(W.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:r,setShippingAddress:o}})(),l="wc/cart/shipping-calculator",i=(0,d.useCallback)((()=>{a(!1),t()}),[a,t]),m=(0,d.useCallback)((t=>{(0,U.dispatch)(W.CART_STORE_KEY).updateCustomerData({shipping_address:t},!1).then((()=>{(e=>{const{removeNotice:t}=(0,U.dispatch)("core/notices"),{getNotices:o}=(0,U.select)("core/notices");o(e).forEach((o=>{t(o.id,e)}))})(l),a(!1),e(t)})).catch((e=>{(0,W.processErrorResponse)(e,l)}))}),[e,a]);return n?(0,r.createElement)("div",{className:"wc-block-components-shipping-calculator",id:c},(0,r.createElement)(jt.StoreNoticesContainer,{context:l}),(0,r.createElement)(hc,{address:s,addressFields:o,onCancel:i,onUpdate:m})):null},wc=({label:e=(0,c.__)("Calculate","woocommerce")})=>{const{isShippingCalculatorOpen:t,setIsShippingCalculatorOpen:o,showCalculator:n,shippingCalculatorID:a}=(0,d.useContext)(gc);return n?(0,r.createElement)(Br.$,{render:(0,r.createElement)("span",null),className:"wc-block-components-totals-shipping__change-address__link",onClick:e=>{e.preventDefault(),o(!t)},"aria-label":e,"aria-expanded":t,"aria-controls":a},e):null},kc=e=>{const t=(e=>(0,p.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.total_shipping,10)+parseInt(e.total_shipping_tax,10):parseInt(e.total_shipping,10))(e);return 0===t?(0,r.createElement)("strong",null,(0,c.__)("Free","woocommerce")):t},bc=()=>{const{shippingRates:e,shippingAddress:t}=De(),o=(0,U.useSelect)((e=>e(W.CHECKOUT_STORE_KEY).prefersCollection())),n=o?(e=>{const t=(e||[]).flatMap((e=>e.shipping_rates)).find((e=>e.selected&&Ve(e)));if((0,de.isObject)(t)&&(0,de.objectHasProp)(t,"meta_data")){const e=t.meta_data.find((e=>"pickup_address"===e.key));if((0,de.isObject)(e)&&(0,de.objectHasProp)(e,"value")&&e.value)return e.value}return""})(e):Se(t),a=o?/* translators: %s location. */ /* translators: %s location. */
(0,c.__)("Collection from %s","woocommerce"):/* translators: %s location. */ /* translators: %s location. */
(0,c.__)("Delivers to %s","woocommerce"),s=!n||o?(0,c.__)("Enter address to check delivery options","woocommerce"):(0,c.__)("Change address","woocommerce");return(0,r.createElement)("div",{className:"wc-block-components-shipping-address"},n?(0,c.sprintf)(a,n)+" ":null,(0,r.createElement)(wc,{label:s}))};o(780);const yc=({label:e=(0,c.__)("Shipping","woocommerce"),placeholder:t=null,collaterals:o=null})=>{const{cartTotals:n,shippingRates:a}=De(),s=Ye(a);return(0,r.createElement)("div",{className:"wc-block-components-totals-shipping"},(0,r.createElement)(jt.TotalsItem,{label:e,value:s?kc(n):t,description:(0,r.createElement)(r.Fragment,null,!!s&&(0,r.createElement)(Gr,null),!!s&&(0,r.createElement)(bc,null),o&&(0,r.createElement)("div",{className:"wc-block-components-totals-shipping__collaterals"},o)),currency:(0,Yt.getCurrencyFromPriceResponse)(n)}))},vc=()=>{const{extensions:e,receiveCart:t,...o}=De(),c={extensions:e,cart:o,context:"woocommerce/cart"};return(0,r.createElement)(yt.ExperimentalOrderMeta.Slot,{...c})},fc=JSON.parse('{"xY":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"uK":{"lock":{"type":"object","default":{"remove":true,"move":true}}}}'),Cc=[{attributes:fc.uK,save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null)),supports:fc.xY,migrate:({attributes:e})=>[e,[(0,m.createBlock)("woocommerce/cart-order-summary-heading-block",{content:(0,c.__)("Cart totals","woocommerce")},[]),(0,m.createBlock)("woocommerce/cart-order-summary-coupon-form-block",{},[]),(0,m.createBlock)("woocommerce/cart-order-summary-totals-block",{},[(0,m.createBlock)("woocommerce/cart-order-summary-subtotal-block",{},[]),(0,m.createBlock)("woocommerce/cart-order-summary-fee-block",{},[]),(0,m.createBlock)("woocommerce/cart-order-summary-discount-block",{},[]),(0,m.createBlock)("woocommerce/cart-order-summary-shipping-block",{},[]),(0,m.createBlock)("woocommerce/cart-order-summary-taxes-block",{},[])])]],isEligible:(e,t)=>!t.some((e=>"woocommerce/cart-order-summary-totals-block"===e.name))}],Sc=Cc;(0,m.registerBlockType)("woocommerce/cart-order-summary-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)(),{cartTotals:o}=De(),n=(0,Yt.getCurrencyFromPriceResponse)(o),s=At(yt.innerBlockAreas.CART_ORDER_SUMMARY),l=[["woocommerce/cart-order-summary-heading-block",{content:(0,c.__)("Cart totals","woocommerce")},[]],["woocommerce/cart-order-summary-coupon-form-block",{},[]],["woocommerce/cart-order-summary-totals-block",{},[]]];return Rt({clientId:e,registeredBlocks:s,defaultTemplate:l}),(0,r.createElement)("div",{...t},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:s,template:l}),(0,r.createElement)("div",{className:"wc-block-components-totals-wrapper"},(0,r.createElement)(Wr,{currency:n,values:o})),(0,r.createElement)(vc,null))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null)),deprecated:Sc});const Nc=({className:e=""})=>{const{cartTotals:t}=De(),o=(0,Yt.getCurrencyFromPriceResponse)(t);return(0,r.createElement)(jt.TotalsWrapper,{className:e},(0,r.createElement)(jt.Subtotal,{currency:o,values:t}))};(0,m.registerBlockType)("woocommerce/cart-order-summary-subtotal-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Nc,{className:t}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})}),o(2961),(0,m.registerBlockType)("woocommerce/cart-order-summary-totals-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)(),o=At(yt.innerBlockAreas.CART_ORDER_SUMMARY_TOTALS),c=[["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 Rt({clientId:e,registeredBlocks:o,defaultTemplate:c}),(0,r.createElement)("div",{...t},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:o,template:c}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});const Pc=({className:e})=>{const{cartFees:t,cartTotals:o}=De(),c=(0,Yt.getCurrencyFromPriceResponse)(o);return(0,r.createElement)(jt.TotalsWrapper,{className:e},(0,r.createElement)(jt.TotalsFees,{currency:c,cartFees:t}))};(0,m.registerBlockType)("woocommerce/cart-order-summary-fee-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Pc,{className:t}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});const Ac=()=>{const{extensions:e,receiveCart:t,...o}=De(),c={extensions:e,cart:o,context:"woocommerce/cart"};return(0,r.createElement)(yt.ExperimentalDiscountsMeta.Slot,{...c})},Rc=({className:e})=>{const{cartTotals:t,cartCoupons:o}=De(),{removeCoupon:c,isRemovingCoupon:n}=br("wc/cart"),a=(0,Yt.getCurrencyFromPriceResponse)(t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(jt.TotalsWrapper,{className:e},(0,r.createElement)(qr,{cartCoupons:o,currency:a,isRemovingCoupon:n,removeCoupon:c,values:t})),(0,r.createElement)(Ac,null))};(0,m.registerBlockType)("woocommerce/cart-order-summary-discount-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Rc,{className:t}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});var Tc=o(1208),Ic=(o(9345),o(2900)),xc=o(2478),Bc=o(8306);const Oc=e=>{switch(e){case"success":case"warning":case"info":case"default":return"polite";default:return"assertive"}},Mc=e=>{switch(e){case"success":return Ic.A;case"warning":case"info":case"error":return xc.A;default:return Bc.A}},Dc=({className:e,status:t="default",children:o,spokenMessage:a=o,onRemove:s=(()=>{}),isDismissible:l=!0,politeness:m=Oc(t),summary:u})=>(((e,t)=>{const o="string"==typeof e?e:(0,d.renderToString)(e);(0,d.useEffect)((()=>{o&&(0,Lt.speak)(o,t)}),[o,t])})(a,m),(0,r.createElement)("div",{className:(0,n.A)(e,"wc-block-components-notice-banner","is-"+t,{"is-dismissible":l})},(0,r.createElement)(i.A,{icon:Mc(t)}),(0,r.createElement)("div",{className:"wc-block-components-notice-banner__content"},u&&(0,r.createElement)("p",{className:"wc-block-components-notice-banner__summary"},u),o),!!l&&(0,r.createElement)(Mr,{className:"wc-block-components-notice-banner__dismiss","aria-label":(0,c.__)("Dismiss this notice","woocommerce"),onClick:e=>{"function"==typeof(null==e?void 0:e.preventDefault)&&e.preventDefault&&e.preventDefault(),s()},removeTextWrap:!0},(0,r.createElement)(i.A,{icon:Tc.A})))),Lc=e=>{const t=(0,p.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);let o=(0,r.createElement)(r.Fragment,null,Number.isFinite(t)&&(0,r.createElement)(jt.FormattedMonetaryAmount,{currency:(0,Yt.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,(0,we.decodeEntities)(e.delivery_time));return 0===t&&(o=(0,r.createElement)("span",{className:"wc-block-components-shipping-rates-control__package__description--free"},(0,c.__)("Free","woocommerce"))),{label:(0,we.decodeEntities)(e.name),value:e.rate_id,description:o}},Fc=({className:e="",noResultsMessage:t,onSelectRate:o,rates:c,renderOption:n=Lc,selectedRate:a,disabled:s=!1,highlightChecked:l=!1})=>{const i=(null==a?void 0:a.rate_id)||"",m=nt(i),[u,p]=(0,d.useState)(null!=i?i:"");return(0,d.useEffect)((()=>{i&&i!==m&&i!==u&&p(i)}),[i,u,m]),(0,d.useEffect)((()=>{!u&&c.length>0&&(p(c[0].rate_id),o(c[0].rate_id))}),[o,c,u]),0===c.length?t:(0,r.createElement)(jt.RadioControl,{className:e,onChange:e=>{p(e),o(e)},highlightChecked:l,disabled:s,selected:u,options:c.map(n)})};o(2867);const Vc=({packageId:e,className:t="",noResultsMessage:o,renderOption:a,packageData:s,collapsible:l,showItems:i,highlightChecked:m=!1})=>{var u;const{selectShippingRate:p,isSelectingRate:_}=Je(),h=(0,U.useSelect)((e=>{var t,o,r;return null===(t=e(W.CART_STORE_KEY))||void 0===t||null===(o=t.getCartData())||void 0===o||null===(r=o.shippingRates)||void 0===r?void 0:r.length}))>1||document.querySelectorAll(".wc-block-components-shipping-rates-control__package").length>1,g=null!=i?i:h,E=null!=l?l:h,w=(0,r.createElement)(r.Fragment,null,(E||g)&&(0,r.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title",dangerouslySetInnerHTML:{__html:Jo(s.name)}}),g&&(0,r.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(s.items).map((e=>{const t=(0,we.decodeEntities)(e.name),o=e.quantity;return(0,r.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},(0,r.createElement)(jt.Label,{label:o>1?`${t} × ${o}`:`${t}`,screenReaderLabel:(0,c.sprintf)(/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */ /* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
(0,c._n)("%1$s (%2$d unit)","%1$s (%2$d units)",o,"woocommerce"),t,o)}))})))),k=(0,d.useCallback)((t=>{p(t,e)}),[e,p]),b={className:t,noResultsMessage:o,rates:s.shipping_rates,onSelectRate:k,selectedRate:s.shipping_rates.find((e=>e.selected)),renderOption:a,disabled:_,highlightChecked:m},y=(0,d.useMemo)((()=>{var e;return null==s||null===(e=s.shipping_rates)||void 0===e?void 0:e.findIndex((e=>null==e?void 0:e.selected))}),[null==s?void 0:s.shipping_rates]);return E?(0,r.createElement)(jt.Panel,{className:(0,n.A)("wc-block-components-shipping-rates-control__package",t,{"wc-block-components-shipping-rates-control__package--disabled":_}),initialOpen:!1,title:w},(0,r.createElement)(Fc,{...b})):(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-shipping-rates-control__package",t,{"wc-block-components-shipping-rates-control__package--disabled":_,"wc-block-components-shipping-rates-control__package--first-selected":!_&&0===y,"wc-block-components-shipping-rates-control__package--last-selected":!_&&y===(null==s||null===(u=s.shipping_rates)||void 0===u?void 0:u.length)-1})},w,(0,r.createElement)(Fc,{...b}))},jc=({packages:e,showItems:t,collapsible:o,noResultsMessage:c,renderOption:n,context:a=""})=>e.length?(0,r.createElement)(r.Fragment,null,e.map((({package_id:e,...s})=>(0,r.createElement)(Vc,{highlightChecked:"woocommerce/cart"!==a,key:e,packageId:e,packageData:s,collapsible:o,showItems:t,noResultsMessage:c,renderOption:n})))):null,Yc=({shippingRates:e,isLoadingRates:t,className:o,collapsible:n,showItems:a,noResultsMessage:s,renderOption:l,context:i})=>{(0,d.useEffect)((()=>{var o,r;t||(o=Le(e),r=(e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0))(e),1===o?(0,Lt.speak)((0,c.sprintf)(/* translators: %d number of shipping options found. */ /* translators: %d number of shipping options found. */
(0,c._n)("%d shipping option was found.","%d shipping options were found.",r,"woocommerce"),r)):(0,Lt.speak)((0,c.sprintf)(/* translators: %d number of shipping packages packages. */ /* translators: %d number of shipping packages packages. */
(0,c._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",o,"woocommerce"),o)+" "+(0,c.sprintf)(/* translators: %d number of shipping options available. */ /* translators: %d number of shipping options available. */
(0,c._n)("%d shipping option was found","%d shipping options were found",r,"woocommerce"),r)))}),[t,e]);const{extensions:m,receiveCart:u,...p}=De(),_={className:o,collapsible:n,showItems:a,noResultsMessage:s,renderOption:l,extensions:m,cart:p,components:{ShippingRatesControlPackage:Vc},context:i},{isEditor:h}=K(),{hasSelectedLocalPickup:g,selectedRates:E}=Je(),w=(0,de.isObject)(E)?Object.values(E):[],k=w.every((e=>e===w[0]));return(0,r.createElement)(ir,{isLoading:t,screenReaderLabel:(0,c.__)("Loading shipping rates…","woocommerce"),showSpinner:!0},g&&"woocommerce/cart"===i&&e.length>1&&!k&&!h&&(0,r.createElement)(Dc,{className:"wc-block-components-notice",isDismissible:!1,status:"warning"},(0,c.__)("Multiple shipments must have the same pickup location","woocommerce")),(0,r.createElement)(yt.ExperimentalOrderShippingPackages.Slot,{..._}),(0,r.createElement)(yt.ExperimentalOrderShippingPackages,null,(0,r.createElement)(jc,{packages:e,noResultsMessage:s,renderOption:l})))},Hc=()=>{const{shippingRates:e,isLoadingRates:t,shippingAddress:o}=De(),n=((e,t=[])=>{if(!e.country)return!1;const o=ye(V,{},e.country);return(t.length>0?Object.values(o).filter((({key:e})=>t.includes(e))):o).every((({key:t="",hidden:o=!1,required:r=!1})=>!(!o&&r)||fe(t,e)&&""!==e[t]))})(o,["state","country","postcode","city"]);return(0,r.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},(0,r.createElement)("legend",{className:"screen-reader-text"},(0,c.__)("Shipping options","woocommerce")),(0,r.createElement)(Yc,{className:"wc-block-components-totals-shipping__options",noResultsMessage:(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(Dc,{isDismissible:!1,className:"wc-block-components-shipping-rates-control__no-results-notice",status:"warning"},(0,d.createInterpolateElement)((0,c.sprintf)(
// translators: %s is the address that was used to calculate shipping.
// translators: %s is the address that was used to calculate shipping.
(0,c.__)("No delivery options available for <strong>%s</strong>. Please verify the address is correct or try a different address.","woocommerce"),Se(o)),{strong:(0,r.createElement)("strong",null)}))),shippingRates:e,isLoadingRates:t,context:"woocommerce/cart"}))},Uc=({className:e})=>{const{isEditor:t}=K(),{cartNeedsShipping:o,shippingRates:n}=De(),[a,s]=(0,d.useState)(!1);if(!o)return null;if(t&&0===Le(n))return null;const l=(0,p.getSetting)("isShippingCalculatorEnabled",!0),i=(e=>!!Ye(e)&&e.every((e=>e.shipping_rates.every((e=>!e.selected||Ve(e))))))(n);return(0,r.createElement)(yt.TotalsWrapper,{className:e},(0,r.createElement)(gc.Provider,{value:{showCalculator:l,shippingCalculatorID:"shipping-calculator-form-wrapper",isShippingCalculatorOpen:a,setIsShippingCalculatorOpen:s}},(0,r.createElement)(yc,{label:i?(0,c.__)("Collection","woocommerce"):(0,c.__)("Delivery","woocommerce"),placeholder:l?(0,r.createElement)(wc,{label:(0,c.__)("Enter address to check delivery options","woocommerce")}):(0,r.createElement)("span",{className:"wc-block-components-shipping-placeholder__value"},(0,c.__)("Calculated on checkout","woocommerce")),collaterals:(0,r.createElement)(r.Fragment,null,a&&(0,r.createElement)(Ec,null),!a&&(0,r.createElement)(Hc,null),!l&&He(n)&&(0,r.createElement)("div",{className:"wc-block-components-totals-shipping__delivery-options-notice"},(0,c.__)("Delivery options will be calculated during checkout","woocommerce")))})))};(0,m.registerBlockType)("woocommerce/cart-order-summary-shipping-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,p.getSetting)("shippingEnabled",!0),n=(0,a.useBlockProps)();return(0,r.createElement)("div",{...n},(0,r.createElement)(a.InspectorControls,null,!!o&&(0,r.createElement)(_o.PanelBody,{title:(0,c.__)("Shipping Calculations","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,c.__)("Options that control shipping can be managed in your store settings.","woocommerce")),(0,r.createElement)(_o.ExternalLink,{href:`${p.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&section=options`},(0,c.__)("Manage shipping options","woocommerce"))," ")),(0,r.createElement)(Dt,null,(0,r.createElement)(Uc,{className:t})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});var zc=o(8848);const Kc=({className:e})=>{const t=(0,p.getSetting)("couponsEnabled",!0),{applyCoupon:o,isApplyingCoupon:c}=br("wc/cart");return t?(0,r.createElement)(jt.TotalsWrapper,{className:e},(0,r.createElement)(Kr,{onSubmit:o,isLoading:c,instanceId:"coupon"})):null};(0,m.registerBlockType)("woocommerce/cart-order-summary-coupon-form-block",{icon:{src:(0,r.createElement)(i.A,{icon:zc.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Dt,null,(0,r.createElement)(Kc,{className:t})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});const $c=({className:e,showRateAfterTaxName:t})=>{const{cartTotals:o}=De();if((0,p.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(o.total_tax,10)<=0)return null;const c=(0,Yt.getCurrencyFromPriceResponse)(o);return(0,r.createElement)(jt.TotalsWrapper,{className:e},(0,r.createElement)(jt.TotalsTaxes,{showRateAfterTaxName:t,currency:c,values:o}))},qc={showRateAfterTaxName:{type:"boolean",default:(0,p.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};(0,m.registerBlockType)("woocommerce/cart-order-summary-taxes-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},attributes:qc,edit:({attributes:e,setAttributes:t})=>{const{className:o,showRateAfterTaxName:n}=e,s=(0,a.useBlockProps)(),l=(0,p.getSetting)("taxesEnabled"),i=(0,p.getSetting)("displayItemizedTaxes",!1),m=(0,p.getSetting)("displayCartPricesIncludingTax",!1);return(0,r.createElement)("div",{...s},(0,r.createElement)(a.InspectorControls,null,l&&i&&!m&&(0,r.createElement)(_o.PanelBody,{title:(0,c.__)("Taxes","woocommerce")},(0,r.createElement)(_o.ToggleControl,{label:(0,c.__)("Show rate after tax name","woocommerce"),help:(0,c.__)("Show the percentage rate alongside each tax line in the summary.","woocommerce"),checked:n,onChange:()=>t({showRateAfterTaxName:!n})}))),(0,r.createElement)($c,{className:o,showRateAfterTaxName:n}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})}),o(5966),(0,m.registerBlockType)("woocommerce/cart-order-summary-heading-block",{icon:{src:(0,r.createElement)(i.A,{icon:zr,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{content:o="",className:c=""}=e,s=(0,a.useBlockProps)();return(0,r.createElement)("div",{...s},(0,r.createElement)("span",{className:(0,n.A)(c,"wc-block-cart__totals-title")},(0,r.createElement)(a.PlainText,{className:"",value:o,onChange:e=>t({content:e}),style:{backgroundColor:"transparent"}})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})}),o(2838);const Wc=(e,t=!0)=>{t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},Gc=({attributes:e,setAttributes:t})=>{const{hasDarkControls:o}=e;return(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(_o.PanelBody,{title:(0,c.__)("Style","woocommerce")},(0,r.createElement)(_o.ToggleControl,{label:(0,c.__)("Dark mode inputs","woocommerce"),help:(0,c.__)("Inputs styled specifically for use on dark background colors.","woocommerce"),checked:o,onChange:()=>t({hasDarkControls:!o})})))},Qc=window.wp.editor,Zc=window.wp.coreData;function Jc({block:e}){const t="checkout"===e?P:A,o="checkout"===e?"woocommerce_checkout_page_id":"woocommerce_cart_page_id",{saveEntityRecord:n}=(0,U.useDispatch)(Zc.store),{editPost:a,savePost:s}=(0,U.useDispatch)(Qc.store),{slug:l,postPublished:i,currentPostId:m}=(0,U.useSelect)((o=>{var r;const{getEntityRecord:c}=o(Zc.store),{isCurrentPostPublished:n,getCurrentPostId:a}=o(Qc.store);return{slug:(null===(r=c("postType","page",t))||void 0===r?void 0:r.slug)||e,postPublished:n(),currentPostId:a()}}),[]),[u,p]=(0,d.useState)("pristine"),_=(0,d.useCallback)((()=>{p("updating"),Promise.resolve().then((()=>_t()({path:`/wc/v3/settings/advanced/${o}`,method:"GET"}))).catch((e=>{"rest_setting_setting_invalid"===e.code&&p("error")})).then((()=>{if(!i)return a({status:"publish"}),s()})).then((()=>_t()({path:`/wc/v3/settings/advanced/${o}`,method:"POST",data:{value:m.toString()}}))).then((()=>{if(0!==t)return n("postType","page",{id:t,slug:`${l}-2`})})).then((()=>a({slug:l}))).then((()=>s())).then((()=>p("updated")))}),[i,a,s,o,m,t,n,l]);let h;return h="checkout"===e?(0,d.createInterpolateElement)((0,c.__)("If you would like to use this block as your default checkout, <a>update your page settings</a>.","woocommerce"),{a:(0,r.createElement)("a",{href:"#",onClick:_},(0,c.__)("update your page settings","woocommerce"))}):(0,d.createInterpolateElement)((0,c.__)("If you would like to use this block as your default cart, <a>update your page settings</a>.","woocommerce"),{a:(0,r.createElement)("a",{href:"#",onClick:_},(0,c.__)("update your page settings","woocommerce"))}),"string"==typeof pagenow&&"site-editor"===pagenow||m===t||"dismissed"===u?null:(0,r.createElement)(_o.Notice,{className:"wc-default-page-notice",status:"updated"===u?"success":"info",onRemove:()=>p("dismissed"),spokenMessage:"updated"===u?(0,c.__)("Page settings updated","woocommerce"):h},"updated"===u?(0,c.__)("Page settings updated","woocommerce"):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,h)))}o(4688);const Xc=[],en=e=>{const[t,o,r]=(()=>{const e={};(0,p.getSetting)("incompatibleExtensions")&&(0,p.getSetting)("incompatibleExtensions").forEach((t=>{e[t.id]=t.title}));const t=Object.keys(e),o=t.length;return[e,t,o]})(),[c,n,a]=(()=>{const{incompatiblePaymentMethods:e}=(0,U.useSelect)((e=>{const{getIncompatiblePaymentMethods:t}=e(Cr);return{incompatiblePaymentMethods:t()}}),[]),t=Object.keys(e);return[e,t,t.length]})(),s={...t,...c},l=[...o,...n],i=r+a,[m,u]=((e,t)=>{const[o,r]=(0,d.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,d.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,r]})("wc-blocks_dismissed_incompatible_extensions_notices",Xc),[_,h]=(0,d.useState)(!1),g=m.some((t=>{return Object.keys(t).includes(e)&&(o=t[e],r=l,o.length===r.length&&new Set([...o,...r]).size===o.length);var o,r})),E=0===i||g;return(0,d.useEffect)((()=>{h(!E),E||g||u((t=>t.reduce(((t,o)=>(Object.keys(o).includes(e)||t.push(o),t)),[])))}),[E,g,u,e]),[_,()=>{const t=new Set(m);t.add({[e]:l}),u([...t])},(w=s,Object.fromEntries(Object.entries(w).sort((([,e],[,t])=>e.localeCompare(t))))),i];var w},tn=window.wp.notices;var on=o(4922),rn=o.n(on);const cn=!1;rn()("wc-admin:tracks:stats");const nn=rn()("wc-admin:tracks");function an(e,t){return nn("recordevent %s %o","wcadmin_"+e,t,{_tqk:window._tkq,shouldRecord:!(cn||!window._tkq||!window.wcTracks||!window.wcTracks.isEnabled)}),!(!window.wcTracks||"function"!=typeof window.wcTracks.recordEvent)&&(cn?(window.wcTracks.validateEvent(e,t),!1):void window.wcTracks.recordEvent(e,t))}const sn=({blocks:e,findCondition:t})=>{for(const o of e){if(t(o))return o;if(o.innerBlocks){const e=sn({blocks:o.innerBlocks,findCondition:t});if(e)return e}}},ln=({blockType:e="woocommerce/cart"})=>"woocommerce/cart"===e?(0,r.createElement)("p",null,(0,c.__)("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,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,(0,c.__)("If you continue, the checkout block will be replaced with the classic experience powered by shortcodes. This means that you may lose:","woocommerce")),(0,r.createElement)("ul",{className:"cross-list"},(0,r.createElement)("li",null,(0,c.__)("Customizations and updates to the block","woocommerce")),(0,r.createElement)("li",null,(0,c.__)("Additional local pickup options created for the new checkout","woocommerce"))));function mn({block:e,clientId:t,type:o}){const{createInfoNotice:n}=(0,U.useDispatch)(tn.store),{replaceBlock:s,selectBlock:l}=(0,U.useDispatch)(a.store),[i,u]=(0,d.useState)(!1),p=()=>u(!1),{undo:_}=(0,U.useDispatch)(Zc.store),[,,h,g]=en(e),E="woocommerce/cart"===e,w=E?(0,c.__)("Switch to classic cart","woocommerce"):(0,c.__)("Switch to classic checkout","woocommerce"),k=E?(0,c.__)("Switched to classic cart.","woocommerce"):(0,c.__)("Switched to classic checkout.","woocommerce"),b=E?"cart":"checkout",y={shortcode:b,notice:"incompatible"===o?"incompatible_notice":"generic_notice",incompatible_extensions_count:g,incompatible_extensions_names:JSON.stringify(h)},{getBlocks:v}=(0,U.useSelect)((e=>({getBlocks:e(a.store).getBlocks})),[]),f=()=>{_(),an("switch_to_classic_shortcode_undo",y)};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(_o.Button,{variant:"secondary",onClick:()=>{an("switch_to_classic_shortcode_click",y),u(!0)}},w),i&&(0,r.createElement)(_o.Modal,{size:"medium",title:w,onRequestClose:p,className:"wc-blocks-switch-to-classic-shortcode-modal-content"},(0,r.createElement)(ln,{blockType:e}),(0,r.createElement)(_o.TabbableContainer,{className:"wc-blocks-switch-to-classic-shortcode-modal-actions"},(0,r.createElement)(_o.Button,{variant:"primary",isDestructive:!0,onClick:()=>{s(t,(0,m.createBlock)("woocommerce/classic-shortcode",{shortcode:b})),an("switch_to_classic_shortcode_confirm",y),(()=>{const e=sn({blocks:v(),findCondition:e=>"woocommerce/classic-shortcode"===e.name});e&&l(e.clientId)})(),n(k,{actions:[{label:(0,c.__)("Undo","woocommerce"),onClick:f}],type:"snackbar"}),p()}},(0,c.__)("Switch","woocommerce"))," ",(0,r.createElement)(_o.Button,{variant:"secondary",onClick:()=>{an("switch_to_classic_shortcode_cancel",y),p()}},(0,c.__)("Cancel","woocommerce")))))}function un({block:e,clientId:t}){const[o,n,a,s]=en(e);if(!o)return null;const l=(0,r.createElement)(r.Fragment,null,s>1?(0,d.createInterpolateElement)((0,c.__)("Some active extensions do not yet support this block. This may impact the shopper experience. <a>Learn more</a>","woocommerce"),{a:(0,r.createElement)(_o.ExternalLink,{href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/"})}):(0,d.createInterpolateElement)((0,c.sprintf)(
// translators: %s is the name of the extension.
// translators: %s is the name of the extension.
(0,c.__)("<strong>%s</strong> does not yet support this block. This may impact the shopper experience. <a>Learn more</a>","woocommerce"),Object.values(a)[0]),{strong:(0,r.createElement)("strong",null),a:(0,r.createElement)(_o.ExternalLink,{href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/"})})),m=Object.entries(a),u=m.length-2;return(0,r.createElement)(_o.Notice,{className:"wc-blocks-incompatible-extensions-notice",status:"warning",onRemove:n,spokenMessage:l},(0,r.createElement)("div",{className:"wc-blocks-incompatible-extensions-notice__content"},(0,r.createElement)(i.A,{className:"wc-blocks-incompatible-extensions-notice__warning-icon",icon:(0,r.createElement)(er,null)}),(0,r.createElement)("div",null,(0,r.createElement)("p",null,l),s>1&&(0,r.createElement)("ul",null,m.slice(0,2).map((([e,t])=>(0,r.createElement)("li",{key:e,className:"wc-blocks-incompatible-extensions-notice__element"},t)))),m.length>2&&(0,r.createElement)("details",null,(0,r.createElement)("summary",null,(0,r.createElement)("span",null,(0,c.sprintf)(
// translators: %s is the number of incompatible extensions.
// translators: %s is the number of incompatible extensions.
(0,c._n)("%s more incompatibility","%s more incompatibilities",u,"woocommerce"),u)),(0,r.createElement)(i.A,{icon:Zr.A})),(0,r.createElement)("ul",null,m.slice(2).map((([e,t])=>(0,r.createElement)("li",{key:e,className:"wc-blocks-incompatible-extensions-notice__element"},t))))),(0,r.createElement)(mn,{block:e,clientId:t,type:"incompatible"}))))}o(7840),o(8831);var dn=o(361);o(1598);const pn=({text:e,title:t=(0,c.__)("Feedback?","woocommerce"),url:o})=>{const[n,a]=(0,d.useState)(!1);return(0,d.useEffect)((()=>{a(!0)}),[]),(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)("div",{className:"wc-block-feedback-prompt"},(0,r.createElement)(i.A,{icon:dn.A}),(0,r.createElement)("h2",{className:"wc-block-feedback-prompt__title"},t),(0,r.createElement)("p",{className:"wc-block-feedback-prompt__text"},e),(0,r.createElement)("a",{href:o,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},(0,c.__)("Give us your feedback.","woocommerce"),(0,r.createElement)(i.A,{icon:qo.A,size:16}))))},hn=()=>(0,r.createElement)(pn,{text:(0,c.__)("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"}),gn=(0,ft.createHigherOrderComponent)((e=>t=>{const{clientId:o,name:c,isSelected:n}=t,{isCart:s,isCheckout:l,parentId:i}=(0,U.useSelect)((e=>{const{getBlockParentsByBlockName:t,getBlockName:r}=e(a.store),c=t(o,["woocommerce/cart","woocommerce/checkout"]).reduce(((e,t)=>(e[r(t)]=t,e)),{}),n=r(o),s=Object.keys(c).includes("woocommerce/cart"),l=Object.keys(c).includes("woocommerce/checkout"),i="woocommerce/cart"===n||s,m=i?"woocommerce/cart":"woocommerce/checkout";return{isCart:i,isCheckout:"woocommerce/checkout"===n||l,parentId:n===m?o:c[m]}}));return c.startsWith("woocommerce/")&&n&&(s||l)?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(un,{block:s?"woocommerce/cart":"woocommerce/checkout",clientId:i}),(0,r.createElement)(Jc,{block:l?"checkout":"cart"}),(0,r.createElement)(hn,null)),(0,r.createElement)(e,{key:"edit",...t})):(0,r.createElement)(e,{key:"edit",...t})}),"withSidebarNotices");(0,Qe.hasFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice")||(0,Qe.addFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice",gn,11);const En=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)("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"})),wn=(e,t,o=!0)=>{const{updateBlockAttributes:r,selectBlock:c}=(0,U.dispatch)("core/block-editor");var n,a;r(e,{currentView:t}),o&&c((null===(n=(0,U.select)("core/block-editor").getBlock(e))||void 0===n||null===(a=n.innerBlocks.find((e=>e.name===t)))||void 0===a?void 0:a.clientId)||e)},kn={views:[],currentView:"",viewClientId:""},bn=(e,t=10,o=0)=>{const r=o+1;if(r>t)return kn;const{getBlockAttributes:c,getBlockRootClientId:n}=(0,U.select)("core/block-editor"),a=n(e);if(null===a||""===a)return kn;const s=c(a);return s?void 0!==s.editorViews?{views:s.editorViews,currentView:s.currentView||s.editorViews[0].view,viewClientId:a}:bn(a,t,r):kn},yn=({currentView:e,views:t,clientId:o})=>{const{getBlockName:n,getSelectedBlockClientId:s,getBlockParentsByBlockName:l}=(0,U.useSelect)((e=>{const t=e("core/block-editor");return{getBlockName:t.getBlockName,getSelectedBlockClientId:t.getSelectedBlockClientId,getBlockParentsByBlockName:t.getBlockParentsByBlockName}}),[]),m=s(),u=((e,t)=>t.find((t=>t.view===e)))(e,t)||t[0],p=u.label;return(0,d.useLayoutEffect)((()=>{const r=m?n(m):null;if(!r||e===r)return;const c=t.map((e=>e.view));if(c.includes(r))return void wn(o,r);const a=l(m,c),s=1===a.length?n(a[0]):null;s&&e!==s&&wn(o,s,!1)}),[o,e,n,l,m,t]),(0,r.createElement)(a.BlockControls,null,(0,r.createElement)(_o.ToolbarGroup,null,(0,r.createElement)(_o.ToolbarDropdownMenu,{label:(0,c.__)("Switch view","woocommerce"),text:p,icon:(0,r.createElement)(i.A,{icon:En,style:{marginRight:"8px"}}),controls:t.map((t=>({...t,title:(0,r.createElement)("span",{style:{marginLeft:"8px"}},t.label),isActive:t.view===e,onClick:()=>{wn(o,t.view)}})))})))};(0,Qe.hasFilter)("editor.BlockEdit","woocommerce/with-view-switcher")||(0,Qe.addFilter)("editor.BlockEdit","woocommerce/with-view-switcher",(e=>t=>{const{clientId:o}=t,{views:c,currentView:n,viewClientId:a}=(0,U.useSelect)((e=>{const t=e("core/block-editor").getBlockAttributes(o);return null!=t&&t.editorViews?{views:t.editorViews,currentView:t.currentView,viewClientId:o}:bn(o)}));return 0===c.length?(0,r.createElement)(e,{...t}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(yn,{currentView:n,views:c,clientId:a}),(0,r.createElement)(e,{...t}))}),11),(0,Qe.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||(0,U.subscribe)((()=>{var e,t,o,r;const c=(0,U.select)(a.store);if(!c)return;const n=c.getSelectedBlock();n&&(Wc("wc-lock-selected-block--remove",!(null==n||null===(e=n.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),Wc("wc-lock-selected-block--move",!(null==n||null===(o=n.attributes)||void 0===o||null===(r=o.lock)||void 0===r||!r.move)))}));const vn=["woocommerce/filled-cart-block","woocommerce/empty-cart-block"];o(2584);const fn={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,c.__)("Filled Cart","woocommerce"),icon:(0,r.createElement)(i.A,{icon:vt})},{view:"woocommerce/empty-cart-block",label:(0,c.__)("Empty Cart","woocommerce"),icon:(0,r.createElement)(i.A,{icon:Vr})}]},hasDarkControls:{type:"boolean",default:(0,p.getSetting)("hasDarkEditorStyleSupport",!1)},isShippingCalculatorEnabled:{type:"boolean",default:(0,p.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},showRateAfterTaxName:{type:"boolean",default:!0},align:{type:"string",default:"wide"}},Cn={title:(0,c.__)("Cart","woocommerce"),apiVersion:3,icon:{src:(0,r.createElement)(i.A,{icon:l,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[(0,c.__)("WooCommerce","woocommerce")],description:(0,c.__)("Shopping cart.","woocommerce"),supports:{align:["wide"],html:!1,multiple:!1},example:{attributes:{isPreview:!0},viewportWidth:800},attributes:fn,edit:({clientId:e,className:t,attributes:o,setAttributes:s})=>{const{hasDarkControls:l,currentView:i,isPreview:u=!1}=o,p=((e={})=>{const t=(0,d.useRef)(),o=(0,a.useBlockProps)({ref:t,...e});return(({ref:e})=>{const t=(0,Qe.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),o=e.current;(0,d.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!==Ft.BACKSPACE&&t!==Ft.DELETE)return;if((0,Bt.isTextField)(o))return;const r=o;if(void 0===r.dataset.block)return;const c=(e=>{var t,o,r,c,n;if(!e)return!1;const{getBlock:s}=(0,U.select)(a.store),l=s(e);if("boolean"==typeof(null==l||null===(t=l.attributes)||void 0===t||null===(o=t.lock)||void 0===o?void 0:o.remove))return l.attributes.lock.remove;const i=(0,m.getBlockType)(l.name);var u,d,p;return"boolean"==typeof(null==i||null===(r=i.attributes)||void 0===r||null===(c=r.lock)||void 0===c||null===(n=c.default)||void 0===n?void 0:n.remove)&&(null==i||null===(u=i.attributes)||void 0===u||null===(d=u.lock)||void 0===d||null===(p=d.default)||void 0===p?void 0:p.remove)})(r.dataset.block);c&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}}),[o,t])})({ref:t}),o})({className:(0,n.A)(t,"wp-block-woocommerce-cart",{"is-editor-preview":u})}),_=(0,d.useRef)((0,ve.getQueryArg)(window.location.href,"focus"));return(0,d.useEffect)((()=>{"cart"!==_.current||(0,U.select)("core/block-editor").hasSelectedBlock()||((0,U.dispatch)("core/block-editor").selectBlock(e),(0,U.dispatch)("core/interface").enableComplementaryArea("core/edit-site","edit-site/block-inspector"))}),[e]),(0,r.createElement)("div",{...p},(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(Gc,{attributes:o,setAttributes:s})),(0,r.createElement)(H,{header:(0,c.__)("Cart Block Error","woocommerce"),text:(0,c.__)("There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.","woocommerce"),showErrorMessage:!0,errorMessagePrefix:(0,c.__)("Error message:","woocommerce")},(0,r.createElement)($,{previewData:{previewCart:Ge},currentView:i,isPreview:u},(0,r.createElement)(Tt.Provider,{value:{hasDarkControls:l}},(0,r.createElement)(yt.SlotFillProvider,null,(0,r.createElement)(bt,null,(0,r.createElement)(a.InnerBlocks,{allowedBlocks:vn,template:[["woocommerce/filled-cart-block",{},[]],["woocommerce/empty-cart-block",{},[]]],templateLock:"insert"})))))))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save({className:"is-loading"})},(0,r.createElement)(a.InnerBlocks.Content,null)),transforms:{to:[{type:"block",blocks:["woocommerce/classic-shortcode"],transform:e=>(0,m.createBlock)("woocommerce/classic-shortcode",{shortcode:"cart",align:e.align},[])}]},deprecated:[{attributes:fn,save:({attributes:e})=>(0,r.createElement)("div",{className:(0,n.A)("is-loading",e.className)},(0,r.createElement)(a.InnerBlocks.Content,null)),migrate:(e,t)=>{const{checkoutPageId:o,align:r}=e;return[e,[(0,m.createBlock)("woocommerce/filled-cart-block",{align:r},[(0,m.createBlock)("woocommerce/cart-items-block"),(0,m.createBlock)("woocommerce/cart-totals-block",{},[(0,m.createBlock)("woocommerce/cart-order-summary-block",{}),(0,m.createBlock)("woocommerce/cart-express-payment-block"),(0,m.createBlock)("woocommerce/proceed-to-checkout-block",{checkoutPageId:o}),(0,m.createBlock)("woocommerce/cart-accepted-payment-methods-block")])]),(0,m.createBlock)("woocommerce/empty-cart-block",{align:r},t)]]},isEligible:(e,t)=>!t.find((e=>"woocommerce/filled-cart-block"===e.name))}]};(0,m.registerBlockType)("woocommerce/cart",Cn)},1546:()=>{},5183:()=>{},7195:()=>{},6007:()=>{},7128:()=>{},9407:()=>{},2080:()=>{},1045:()=>{},5684:()=>{},4957:()=>{},777:()=>{},9507:()=>{},4982:()=>{},401:()=>{},7051:()=>{},2867:()=>{},3048:()=>{},265:()=>{},7919:()=>{},780:()=>{},2931:()=>{},8375:()=>{},9345:()=>{},6625:()=>{},4567:()=>{},5193:()=>{},5452:()=>{},1221:()=>{},8824:()=>{},9569:()=>{},2838:()=>{},9085:()=>{},5049:()=>{},5913:()=>{},5966:()=>{},2961:()=>{},6229:()=>{},6611:()=>{},1876:()=>{},6080:()=>{},2584:()=>{},4688:()=>{},9705:()=>{},1598:()=>{},8831:()=>{},7840:()=>{},7791:()=>{},1609:e=>{"use strict";e.exports=window.React},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}},c={};function n(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return r[e].call(o.exports,o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,c)=>{if(!o){var a=1/0;for(m=0;m<e.length;m++){for(var[o,r,c]=e[m],s=!0,l=0;l<o.length;l++)(!1&c||a>=c)&&Object.keys(n.O).every((e=>n.O[e](o[l])))?o.splice(l--,1):(s=!1,c<a&&(a=c));if(s){e.splice(m--,1);var i=r();void 0!==i&&(t=i)}}return t}c=c||0;for(var m=e.length;m>0&&e[m-1][2]>c;m--)e[m]=e[m-1];e[m]=[o,r,c]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);n.r(c);var a={};t=t||[null,o({}),o([]),o(o)];for(var s=2&r&&e;"object"==typeof s&&!~t.indexOf(s);s=o(s))Object.getOwnPropertyNames(s).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,n.d(c,a),c},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=7949,(()=>{var e={7949:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var r,c,[a,s,l]=o,i=0;if(a.some((t=>0!==e[t]))){for(r in s)n.o(s,r)&&(n.m[r]=s[r]);if(l)var m=l(n)}for(t&&t(o);i<a.length;i++)c=a[i],n.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return n.O(m)},o=self.webpackChunkwebpackWcBlocksMainJsonp=self.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var a=n.O(void 0,[94],(()=>n(1212)));a=n.O(a),((this.wc=this.wc||{}).blocks=this.wc.blocks||{}).cart=a})();

Youez - 2016 - github.com/yon3zu
LinuXploit