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 : 18.116.85.111
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/checkout.js
(()=>{var e,t,o,r={2817:(e,t,o)=>{"use strict";o.r(t);var r=o(1609),n=o(851),c=o(5573);const s=(0,r.createElement)(c.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:"M5 3.75h14c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H5c-.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.4 10.75c0-.47.38-.85.85-.85h9.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-9.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h8.8v-.8H7.6zM12.4 15.25c0-.47.38-.85.85-.85h3.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-3.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h2.8v-.8h-2.8zM6.5 15.9a.6.6 0 01.6-.6h2.8a.6.6 0 010 1.2H7.1a.6.6 0 01-.6-.6zM6.5 7.9a.6.6 0 01.6-.6h9.8a.6.6 0 110 1.2H7.1a.6.6 0 01-.6-.6z",clipRule:"evenodd"}));var a=o(7104);const i=window.wp.blocks;var l=o(7723);const m=window.wp.blockEditor;var d=o(6087),u=o(9491);const p=(0,d.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),h=()=>(0,d.useContext)(p),_=({children:e,className:t=""})=>{const[o,c]=(()=>{const[e,{width:t}]=(0,u.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]})(),s={hasContainerWidth:""!==c,containerClassName:c,isMobile:"is-mobile"===c,isSmall:"is-small"===c,isMedium:"is-medium"===c,isLarge:"is-large"===c};return(0,r.createElement)(p.Provider,{value:s},(0,r.createElement)("div",{className:(0,n.A)(t,c)},o,e))};o(1221);const g=({children:e,className:t})=>(0,r.createElement)(_,{className:(0,n.A)("wc-block-components-sidebar-layout",t)},e),E=window.wp.data,k=(0,d.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})}),w=()=>(0,d.useContext)(k),b=({children:e,currentPostId:t=0,previewData:o={},currentView:n="",isPreview:c=!1})=>{const s=(0,E.useSelect)((e=>t||e("core/editor").getCurrentPostId()),[t]),a=(0,d.useCallback)((e=>o&&e in o?o[e]:{}),[o]),i={isEditor:!0,currentPostId:s,currentView:n,previewData:o,getPreviewData:a,isPreview:c};return(0,r.createElement)(k.Provider,{value:i},e)},y=window.wp.plugins,v=window.wc.wcSettings;var f,C,S,P,A,N,T,R,x,I,O=o(2294);const M=(0,v.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),B=M.pluginUrl+"assets/images/",F=(M.pluginUrl,null===(f=v.STORE_PAGES.shop)||void 0===f||f.permalink,null===(C=v.STORE_PAGES.checkout)||void 0===C?void 0:C.id),D=(null===(S=v.STORE_PAGES.checkout)||void 0===S||S.permalink,null===(P=v.STORE_PAGES.privacy)||void 0===P?void 0:P.permalink),L=(null===(A=v.STORE_PAGES.privacy)||void 0===A||A.title,null===(N=v.STORE_PAGES.terms)||void 0===N?void 0:N.permalink),Y=(null===(T=v.STORE_PAGES.terms)||void 0===T||T.title,null===(R=v.STORE_PAGES.cart)||void 0===R?void 0:R.id),j=null===(x=v.STORE_PAGES.cart)||void 0===x?void 0:x.permalink,V=(null!==(I=v.STORE_PAGES.myaccount)&&void 0!==I&&I.permalink?v.STORE_PAGES.myaccount.permalink:(0,v.getSetting)("wpLoginUrl","/wp-login.php"),(0,v.getSetting)("localPickupEnabled",!1)),K=(0,v.getSetting)("countries",{}),U=(0,v.getSetting)("countryData",{}),H=Object.fromEntries(Object.keys(U).filter((e=>!0===U[e].allowBilling)).map((e=>[e,K[e]||""]))),q=Object.fromEntries(Object.keys(U).filter((e=>!0===U[e].allowBilling)).map((e=>[e,U[e].states||[]]))),$=Object.fromEntries(Object.keys(U).filter((e=>!0===U[e].allowShipping)).map((e=>[e,K[e]||""]))),z=Object.fromEntries(Object.keys(U).filter((e=>!0===U[e].allowShipping)).map((e=>[e,U[e].states||[]]))),W=Object.fromEntries(Object.keys(U).map((e=>[e,U[e].locale||[]]))),G={address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]},Z=(0,v.getSetting)("addressFieldsLocations",G).address,J=(0,v.getSetting)("addressFieldsLocations",G).contact,X=(0,v.getSetting)("addressFieldsLocations",G).order,Q=((0,v.getSetting)("additionalOrderFields",{}),(0,v.getSetting)("additionalContactFields",{}),(0,v.getSetting)("additionalAddressFields",{}),({imageUrl:e=`${B}/block-error.svg`,header:t=(0,l.__)("Oops!","woocommerce"),text:o=(0,l.__)("There was an error loading the content.","woocommerce"),errorMessage:n,errorMessagePrefix:c=(0,l.__)("Error:","woocommerce"),button:s,showErrorBlock:a=!0})=>a?(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"},c?c+" ":"",n),s&&(0,r.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},s))):null);o(9407);class ee extends d.Component{constructor(...e){super(...e),(0,O.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:n=!0,text:c,errorMessagePrefix:s,renderError:a,button:i}=this.props,{errorMessage:l,hasError:m}=this.state;return m?"function"==typeof a?a({errorMessage:l}):(0,r.createElement)(Q,{showErrorBlock:n,errorMessage:o?l:null,header:e,imageUrl:t,text:c,errorMessagePrefix:s,button:i}):this.props.children}}const te=ee,oe=window.wc.wcBlocksData;var re=o(4040),ne=o.n(re);let ce=function(e){return e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback",e}({});const se={},ae=(e=se,{type:t,eventType:o,id:r,callback:n,priority:c})=>{const s=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(t){case ce.ADD_EVENT_CALLBACK:return s.set(r,{priority:c,callback:n}),{...e,[o]:s};case ce.REMOVE_EVENT_CALLBACK:return s.delete(r),{...e,[o]:s}}},ie=(e,t)=>(o,r=10)=>{const n=((e,t,o=10)=>({id:Math.floor(Math.random()*Date.now()).toString(),type:ce.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:o}))(e,o,r);return t(n),()=>{var o;t((o=e,{id:n.id,type:ce.REMOVE_EVENT_CALLBACK,eventType:o}))}},le=(0,d.createContext)({onPaymentProcessing:()=>()=>()=>{},onPaymentSetup:()=>()=>()=>{}}),me=({children:e})=>{const{isProcessing:t,isIdle:o,isCalculating:n,hasError:c}=(0,E.useSelect)((e=>{const t=e(oe.CHECKOUT_STORE_KEY);return{isProcessing:t.isProcessing(),isIdle:t.isIdle(),hasError:t.hasError(),isCalculating:t.isCalculating()}})),{isPaymentReady:s}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY);return{isPaymentProcessing:t.isPaymentProcessing(),isPaymentReady:t.isPaymentReady()}})),{setValidationErrors:a}=(0,E.useDispatch)(oe.VALIDATION_STORE_KEY),[i,l]=(0,d.useReducer)(ae,{}),{onPaymentSetup:m}=(e=>(0,d.useMemo)((()=>({onPaymentSetup:ie("payment_setup",e)})),[e]))(l),u=(0,d.useRef)(i);(0,d.useEffect)((()=>{u.current=i}),[i]);const{__internalSetPaymentProcessing:p,__internalSetPaymentIdle:h,__internalEmitPaymentProcessingEvent:_}=(0,E.useDispatch)(oe.PAYMENT_STORE_KEY);(0,d.useEffect)((()=>{!t||c||n||(p(),_(u.current,a))}),[t,c,n,p,_,a]),(0,d.useEffect)((()=>{o&&!s&&h()}),[o,s,h]),(0,d.useEffect)((()=>{c&&s&&h()}),[c,s,h]);const g={onPaymentProcessing:(0,d.useMemo)((()=>function(...e){return ne()("onPaymentProcessing",{alternative:"onPaymentSetup",plugin:"WooCommerce Blocks"}),m(...e)}),[m]),onPaymentSetup:m};return(0,r.createElement)(le.Provider,{value:g},e)},de={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},ue={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"},pe={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:e=>e,shippingErrorTypes:de,onShippingRateSuccess:()=>()=>{},onShippingRateFail:()=>()=>{},onShippingRateSelectSuccess:()=>()=>{},onShippingRateSelectFail:()=>()=>{}},he=(e,{type:t})=>Object.values(de).includes(t)?t:e,_e="shipping_rates_success",ge="shipping_rates_fail",Ee="shipping_rate_select_success",ke="shipping_rate_select_fail",we=e=>({onSuccess:ie(_e,e),onFail:ie(ge,e),onSelectSuccess:ie(Ee,e),onSelectFail:ie(ke,e)}),be=window.wc.wcTypes;let ye=function(e){return e.SUCCESS="success",e.FAIL="failure",e.ERROR="error",e}({}),ve=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 fe=async(e,t,o)=>{const r=((e,t)=>e[t]?Array.from(e[t].values()).sort(((e,t)=>e.priority-t.priority)):[])(e,t),n=[];for(const e of r)try{const t=await Promise.resolve(e.callback(o));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n};var Ce=o(458),Se=o.n(Ce);const Pe=window.wp.htmlEntities,Ae=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,l.sprintf)(/* translators: %s Field label. */ /* translators: %s Field label. */
(0,l.__)("%s (optional)","woocommerce"),e.label)),e.priority&&((0,be.isNumber)(e.priority)&&(t.index=e.priority),(0,be.isString)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},Ne=Object.entries(W).map((([e,t])=>[e,Object.entries(t).map((([e,t])=>[e,Ae(t)])).reduce(((e,[t,o])=>(e[t]=o,e)),{})])).reduce(((e,[t,o])=>(e[t]=o,e)),{}),Te=(e,t,o="")=>{const r=o&&void 0!==Ne[o]?Ne[o]:{};return e.map((e=>({key:e,...v.defaultFields[e]||{},...r[e]||{},...t[e]||{}}))).sort(((e,t)=>e.index-t.index))},Re=window.wp.url,xe=(e,t)=>e in t,Ie=e=>{const t=Te(Z,{},e.country),o=Object.assign({},e);return t.forEach((({key:t="",hidden:r=!1})=>{r&&xe(t,e)&&(o[t]="")})),o},Oe=(e,t=[])=>{if(!e.country)return!1;const o=Te(Z,{},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)||xe(t,e)&&""!==e[t]))},Me=window.CustomEvent||null,Be=(e,t,o=!1,r=!1)=>{if("function"!=typeof jQuery)return()=>{};const n=()=>{((e,{bubbles:t=!1,cancelable:o=!1,element:r,detail:n={}})=>{if(!Me)return;r||(r=document.body);const c=new Me(e,{bubbles:t,cancelable:o,detail:n});r.dispatchEvent(c)})(t,{bubbles:o,cancelable:r})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)},Fe=e=>{const t=null==e?void 0:e.detail;t&&t.preserveCartData||(0,E.dispatch)(oe.CART_STORE_KEY).invalidateResolutionForStore()},De=e=>{(null!=e&&e.persisted||"back_forward"===(window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:""))&&(0,E.dispatch)(oe.CART_STORE_KEY).invalidateResolutionForStore()},Le=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},Ye={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},je={...Ye,email:""},Ve={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:oe.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},Ke=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,Pe.decodeEntities)(t)]))),Ue={cartCoupons:oe.EMPTY_CART_COUPONS,cartItems:oe.EMPTY_CART_ITEMS,cartFees:oe.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:oe.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:oe.EMPTY_CART_ITEM_ERRORS,cartTotals:Ve,cartIsLoading:!0,cartErrors:oe.EMPTY_CART_ERRORS,billingAddress:je,shippingAddress:Ye,shippingRates:oe.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentMethods:oe.EMPTY_PAYMENT_METHODS,paymentRequirements:oe.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},receiveCartContents:()=>{},extensions:oe.EMPTY_EXTENSIONS},He=(e={shouldSelect:!0})=>{const{isEditor:t,previewData:o}=w(),r=null==o?void 0:o.previewCart,{shouldSelect:n}=e,c=(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",Fe),document.body.addEventListener("wc-blocks_removed_from_cart",Fe),window.addEventListener("pageshow",De);const t=Be("added_to_cart","wc-blocks_added_to_cart"),o=Be("removed_from_cart","wc-blocks_removed_from_cart");window.wcBlocksStoreCartListeners.count=1,window.wcBlocksStoreCartListeners.remove=()=>{document.body.removeEventListener("wc-blocks_added_to_cart",Fe),document.body.removeEventListener("wc-blocks_removed_from_cart",Fe),window.removeEventListener("pageshow",De),t(),o()}})(),Le)),[]);const s=(0,E.useSelect)(((e,{dispatch:o})=>{if(!n)return Ue;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:oe.EMPTY_CART_ITEM_ERRORS,cartTotals:r.totals,cartIsLoading:!1,cartErrors:oe.EMPTY_CART_ERRORS,billingData:je,billingAddress:je,shippingAddress:Ye,extensions:oe.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 c=e(oe.CART_STORE_KEY),s=c.getCartData(),a=c.getCartErrors(),i=c.getCartTotals(),l=!c.hasFinishedResolution("getCartData"),m=c.isCustomerDataUpdating(),{receiveCart:d,receiveCartContents:u}=o(oe.CART_STORE_KEY),p=Ke(s.billingAddress),h=s.needsShipping?Ke(s.shippingAddress):p,_=s.fees.length>0?s.fees.map((e=>Ke(e))):oe.EMPTY_CART_FEES,g=s.coupons.length>0?s.coupons.map((e=>({...e,label:e.code}))):oe.EMPTY_CART_COUPONS;return{cartCoupons:g,cartItems:s.items,crossSellsProducts:s.crossSells,cartFees:_,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:i,cartIsLoading:l,cartErrors:a,billingData:Ie(p),billingAddress:Ie(p),shippingAddress:Ie(h),extensions:s.extensions,shippingRates:s.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:d,receiveCartContents:u}}),[n]);return c.current&&Se()(c.current,s)||(c.current=s),c.current},qe=e=>e.length,$e=(0,v.getSetting)("collectableMethodIds",[]),ze=e=>$e.includes(e.method_id),We=e=>!!V&&(Array.isArray(e)?!!e.find((e=>$e.includes(e))):$e.includes(e)),Ge=e=>e.some((e=>!!e.shipping_rates.length)),Ze=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)||""]})));var Je=o(923),Xe=o.n(Je);const Qe={currency_code:v.SITE_CURRENCY.code,currency_symbol:v.SITE_CURRENCY.symbol,currency_minor_unit:v.SITE_CURRENCY.minorUnit,currency_decimal_separator:v.SITE_CURRENCY.decimalSeparator,currency_thousand_separator:v.SITE_CURRENCY.thousandSeparator,currency_prefix:v.SITE_CURRENCY.prefix,currency_suffix:v.SITE_CURRENCY.suffix},et=e=>{const t=v.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()},tt=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:(0,l.__)("Shipping","woocommerce"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:(0,l._x)("Beanie with Logo","example product in Cart Block","woocommerce"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:(0,l._x)("Beanie","example product in Cart Block","woocommerce"),quantity:1}],shipping_rates:[{...Qe,name:(0,l.__)("Flat rate shipping","woocommerce"),description:"",delivery_time:"",price:et("500"),taxes:"0",rate_id:"flat_rate:0",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!1},{...Qe,name:(0,l.__)("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},{...Qe,name:(0,l.__)("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},{...Qe,name:(0,l.__)("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}]}],ot=(0,v.getSetting)("displayCartPricesIncludingTax",!1),rt={coupons:[],shipping_rates:(0,v.getSetting)("shippingMethodsExist",!1)||(0,v.getSetting)("localPickupEnabled",!1)?tt:[],items:[{key:"1",id:1,type:"simple",quantity:2,catalog_visibility:"visible",name:(0,l.__)("Beanie","woocommerce"),summary:(0,l.__)("Beanie","woocommerce"),short_description:(0,l.__)("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:B+"previews/beanie.jpg",thumbnail:B+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,l.__)("Color","woocommerce"),value:(0,l.__)("Yellow","woocommerce")},{attribute:(0,l.__)("Size","woocommerce"),value:(0,l.__)("Small","woocommerce")}],prices:{...Qe,price:et(ot?"12000":"10000"),regular_price:et(ot?"120":"100"),sale_price:et(ot?"12000":"10000"),price_range:null,raw_prices:{precision:6,price:ot?"12000000":"10000000",regular_price:ot?"12000000":"10000000",sale_price:ot?"12000000":"10000000"}},totals:{...Qe,line_subtotal:et("2000"),line_subtotal_tax:et("400"),line_total:et("2000"),line_total_tax:et("400")},extensions:{},item_data:[]},{key:"2",id:2,type:"simple",quantity:1,catalog_visibility:"visible",name:(0,l.__)("Cap","woocommerce"),summary:(0,l.__)("Cap","woocommerce"),short_description:(0,l.__)("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:B+"previews/cap.jpg",thumbnail:B+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,l.__)("Color","woocommerce"),value:(0,l.__)("Orange","woocommerce")}],prices:{...Qe,price:et(ot?"2400":"2000"),regular_price:et(ot?"2400":"2000"),sale_price:et(ot?"2400":"2000"),price_range:null,raw_prices:{precision:6,price:ot?"24000000":"20000000",regular_price:ot?"24000000":"20000000",sale_price:ot?"24000000":"20000000"}},totals:{...Qe,line_subtotal:et("2000"),line_subtotal_tax:et("400"),line_total:et("2000"),line_total_tax:et("400")},extensions:{},item_data:[]}],cross_sells:[{id:1,name:(0,l.__)("Polo","woocommerce"),slug:"polo",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-polo",short_description:(0,l.__)("Polo","woocommerce"),description:(0,l.__)("Polo","woocommerce"),on_sale:!1,prices:{...Qe,price:et(ot?"24000":"20000"),regular_price:et(ot?"24000":"20000"),sale_price:et(ot?"12000":"10000"),price_range:null},price_html:"",average_rating:"4.5",review_count:2,images:[{id:17,src:B+"previews/polo.jpg",thumbnail:B+"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,l.__)("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,l.__)("Long Sleeve Tee","woocommerce"),description:(0,l.__)("Long Sleeve Tee","woocommerce"),on_sale:!1,prices:{...Qe,price:et(ot?"30000":"25000"),regular_price:et(ot?"30000":"25000"),sale_price:et(ot?"30000":"25000"),price_range:null},price_html:"",average_rating:"4",review_count:2,images:[{id:17,src:B+"previews/long-sleeve-tee.jpg",thumbnail:B+"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,l.__)("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,l.__)("Hoodie with Zipper","woocommerce"),description:(0,l.__)("Hoodie with Zipper","woocommerce"),on_sale:!0,prices:{...Qe,price:et(ot?"15000":"12500"),regular_price:et(ot?"30000":"25000"),sale_price:et(ot?"15000":"12500"),price_range:null},price_html:"",average_rating:"1",review_count:2,images:[{id:17,src:B+"previews/hoodie-with-zipper.jpg",thumbnail:B+"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,l.__)("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,l.__)("Polo","woocommerce"),description:(0,l.__)("Polo","woocommerce"),on_sale:!1,prices:{...Qe,price:et(ot?"4500":"4250"),regular_price:et(ot?"4500":"4250"),sale_price:et(ot?"4500":"4250"),price_range:null},price_html:"",average_rating:"5",review_count:2,images:[{id:17,src:B+"previews/hoodie-with-logo.jpg",thumbnail:B+"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,l.__)("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,l.__)("Hoodie with Pocket","woocommerce"),description:(0,l.__)("Hoodie with Pocket","woocommerce"),on_sale:!0,prices:{...Qe,price:et(ot?"3500":"3250"),regular_price:et(ot?"4500":"4250"),sale_price:et(ot?"3500":"3250"),price_range:null},price_html:"",average_rating:"3.75",review_count:4,images:[{id:17,src:B+"previews/hoodie-with-pocket.jpg",thumbnail:B+"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,l.__)("T-Shirt","woocommerce"),slug:"t-shirt",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-t-shirt",short_description:(0,l.__)("T-Shirt","woocommerce"),description:(0,l.__)("T-Shirt","woocommerce"),on_sale:!1,prices:{...Qe,price:et(ot?"1800":"1500"),regular_price:et(ot?"1800":"1500"),sale_price:et(ot?"1800":"1500"),price_range:null},price_html:"",average_rating:"3",review_count:2,images:[{id:17,src:B+"previews/tshirt.jpg",thumbnail:B+"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,l.__)("Fee","woocommerce"),totals:{...Qe,total:et("100"),total_tax:et("20")}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:(0,v.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:{...Qe,total_items:et("4000"),total_items_tax:et("800"),total_fees:et("100"),total_fees_tax:et("20"),total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:et("820"),total_price:et("4920"),tax_lines:[{name:(0,l.__)("Sales tax","woocommerce"),rate:"20%",price:et("820")}]},errors:[],payment_methods:["cod","bacs","cheque"],payment_requirements:["products"],extensions:{}},nt=window.wp.hooks,ct=()=>({dispatchStoreEvent:(0,d.useCallback)(((e,t={})=>{try{(0,nt.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,d.useCallback)(((e,t={})=>{try{(0,nt.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,E.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])}),st=()=>{const{isEditor:e}=w(),{shippingRates:t,needsShipping:o,hasCalculatedShipping:r,isLoadingRates:n,isCollectable:c,isSelectingRate:s}=(0,E.useSelect)((t=>{const o=t(oe.CART_STORE_KEY),r=e?rt.shipping_rates:o.getShippingRates();return{shippingRates:r,needsShipping:e?rt.needs_shipping:o.getNeedsShipping(),hasCalculatedShipping:e?rt.has_calculated_shipping:o.getHasCalculatedShipping(),isLoadingRates:!e&&o.isCustomerDataUpdating(),isCollectable:r.every((({shipping_rates:e})=>e.find((({method_id:e})=>We(e))))),isSelectingRate:!e&&o.isShippingRateBeingSelected()}}),[e]),a=(0,d.useRef)({});(0,d.useEffect)((()=>{const e=Ze(t);(0,be.isObject)(e)&&!Xe()(a.current,e)&&(a.current=e)}),[t]);const{selectShippingRate:i}=(0,E.useDispatch)(oe.CART_STORE_KEY),l=We(Object.values(a.current).map((e=>e.split(":")[0]))),{dispatchCheckoutEvent:m}=ct(),u=(0,d.useCallback)(((e,t)=>{let o;void 0!==e&&(o=We(e.split(":")[0])?i(e,null):i(e,t),o.then((()=>{m("set-selected-shipping-rate",{shippingRateId:e})})).catch((e=>{(0,oe.processErrorResponse)(e)})))}),[i,m]);return{isSelectingRate:s,selectedRates:a.current,selectShippingRate:u,shippingRates:t,needsShipping:o,hasCalculatedShipping:r,isLoadingRates:n,isCollectable:c,hasSelectedLocalPickup:l}},{NONE:at,INVALID_ADDRESS:it,UNKNOWN:lt}=de,mt=(0,d.createContext)(pe),dt=()=>(0,d.useContext)(mt),ut=({children:e})=>{const{__internalIncrementCalculating:t,__internalDecrementCalculating:o}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),{shippingRates:n,isLoadingRates:c,cartErrors:s}=He(),{selectedRates:a,isSelectingRate:i}=st(),[l,m]=(0,d.useReducer)(he,at),[u,p]=(0,d.useReducer)(ae,{}),h=(0,d.useRef)(u),_=(0,d.useMemo)((()=>({onShippingRateSuccess:we(p).onSuccess,onShippingRateFail:we(p).onFail,onShippingRateSelectSuccess:we(p).onSelectSuccess,onShippingRateSelectFail:we(p).onSelectFail})),[p]);(0,d.useEffect)((()=>{h.current=u}),[u]),(0,d.useEffect)((()=>{c?t():o()}),[c,t,o]),(0,d.useEffect)((()=>{i?t():o()}),[t,o,i]),(0,d.useEffect)((()=>{s.length>0&&s.some((e=>!(!e.code||!Object.values(ue).includes(e.code))))?m({type:it}):m({type:at})}),[s]);const g=(0,d.useMemo)((()=>({isPristine:l===at,isValid:l===at,hasInvalidAddress:l===it,hasError:l===lt||l===it})),[l]);(0,d.useEffect)((()=>{c||0!==n.length&&!g.hasError||fe(h.current,ge,{hasInvalidAddress:g.hasInvalidAddress,hasError:g.hasError})}),[n,c,g.hasError,g.hasInvalidAddress]),(0,d.useEffect)((()=>{!c&&n.length>0&&!g.hasError&&fe(h.current,_e,n)}),[n,c,g.hasError]),(0,d.useEffect)((()=>{i||(g.hasError?fe(h.current,ke,{hasError:g.hasError,hasInvalidAddress:g.hasInvalidAddress}):fe(h.current,Ee,a.current))}),[a,i,g.hasError,g.hasInvalidAddress]);const k={shippingErrorStatus:g,dispatchErrorStatus:m,shippingErrorTypes:de,..._};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(mt.Provider,{value:k},e))};function pt(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 ht={},_t={},gt=()=>ht,Et=()=>_t,kt=(0,d.createContext)({onSubmit:()=>{},onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},onCheckoutSuccess:()=>()=>{},onCheckoutFail:()=>()=>{},onCheckoutValidation:()=>()=>{}}),wt=()=>(0,d.useContext)(kt),bt=({children:e,redirectUrl:t})=>{const o=gt(),n=Et(),{isEditor:c}=w(),{__internalUpdateAvailablePaymentMethods:s}=(0,E.useDispatch)(oe.PAYMENT_STORE_KEY);(0,d.useEffect)((()=>{(c||0!==Object.keys(o).length||0!==Object.keys(n).length)&&s()}),[c,o,n,s]);const{__internalSetRedirectUrl:a,__internalEmitValidateEvent:i,__internalEmitAfterProcessingEvents:l,__internalSetBeforeProcessing:m}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),{checkoutRedirectUrl:u,checkoutStatus:p,isCheckoutBeforeProcessing:h,isCheckoutAfterProcessing:_,checkoutHasError:g,checkoutOrderId:k,checkoutOrderNotes:b,checkoutCustomerId:y}=(0,E.useSelect)((e=>{const t=e(oe.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&&a(t);const{setValidationErrors:v}=(0,E.useDispatch)(oe.VALIDATION_STORE_KEY),{dispatchCheckoutEvent:f}=ct(),{checkoutNotices:C,paymentNotices:S,expressPaymentNotices:P}=(0,E.useSelect)((e=>{const{getNotices:t}=e("core/notices");return{checkoutNotices:Object.values(ve).filter((e=>e!==ve.PAYMENTS&&e!==ve.EXPRESS_PAYMENTS)).reduce(((e,o)=>[...e,...t(o)]),[]),paymentNotices:t(ve.PAYMENTS),expressPaymentNotices:t(ve.EXPRESS_PAYMENTS)}}),[]),[A,N]=(0,d.useReducer)(ae,{}),T=(0,d.useRef)(A),{onCheckoutValidation:R,onCheckoutSuccess:x,onCheckoutFail:I}=(e=>(0,d.useMemo)((()=>({onCheckoutSuccess:ie("checkout_success",e),onCheckoutFail:ie("checkout_fail",e),onCheckoutValidation:ie("checkout_validation",e)})),[e]))(N);(0,d.useEffect)((()=>{T.current=A}),[A]);const O=(0,d.useMemo)((()=>function(...e){return ne()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks"}),R(...e)}),[R]),M=(0,d.useMemo)((()=>function(...e){return ne()("onCheckoutValidationBeforeProcessing",{since:"9.7.0",alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),R(...e)}),[R]),B=(0,d.useMemo)((()=>function(...e){return ne()("onCheckoutAfterProcessingWithSuccess",{since:"9.7.0",alternative:"onCheckoutSuccess",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),x(...e)}),[x]),F=(0,d.useMemo)((()=>function(...e){return ne()("onCheckoutAfterProcessingWithError",{since:"9.7.0",alternative:"onCheckoutFail",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),I(...e)}),[I]);(0,d.useEffect)((()=>{h&&i({observers:T.current,setValidationErrors:v})}),[h,v,i]);const D=pt(p),L=pt(g);(0,d.useEffect)((()=>{p===D&&g===L||_&&l({observers:T.current,notices:{checkoutNotices:C,paymentNotices:S,expressPaymentNotices:P}})}),[p,g,u,k,y,b,_,h,D,L,C,P,S,i,l]);const Y={onSubmit:(0,d.useCallback)((()=>{f("submit"),m()}),[f,m]),onCheckoutBeforeProcessing:O,onCheckoutValidationBeforeProcessing:M,onCheckoutAfterProcessingWithSuccess:B,onCheckoutAfterProcessingWithError:F,onCheckoutSuccess:x,onCheckoutFail:I,onCheckoutValidation:R};return(0,r.createElement)(kt.Provider,{value:Y},e)},yt=window.wp.apiFetch;var vt=o.n(yt);(0,l.__)("Something went wrong. Please contact us to get assistance.","woocommerce");const ft=window.wc.wcBlocksRegistry,Ct=(e,t,o)=>{const r=Object.keys(e).map((t=>({key:t,value:e[t]})),[]),n=`wc-${o}-new-payment-method`;return r.push({key:n,value:t}),r},St=e=>{if(!e)return;const{__internalSetCustomerId:t}=(0,E.dispatch)(oe.CHECKOUT_STORE_KEY);vt().setNonce&&"function"==typeof vt().setNonce&&vt().setNonce(e),null!=e&&e.get("User-ID")&&t(parseInt(e.get("User-ID")||"0",10))},Pt=()=>{const{onCheckoutValidation:e}=wt(),{additionalFields:t,customerId:o,customerPassword:r,extensionData:n,hasError:c,isBeforeProcessing:s,isComplete:a,isProcessing:i,orderNotes:m,redirectUrl:u,shouldCreateAccount:p}=(0,E.useSelect)((e=>{const t=e(oe.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:h,__internalProcessCheckoutResponse:_}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),g=(0,E.useSelect)((e=>e(oe.VALIDATION_STORE_KEY).hasValidationErrors)),{shippingErrorStatus:k}=dt(),{billingAddress:w,shippingAddress:b}=(0,E.useSelect)((e=>e(oe.CART_STORE_KEY).getCustomerData())),{cartNeedsPayment:y,cartNeedsShipping:v,receiveCartContents:f}=He(),{activePaymentMethod:C,paymentMethodData:S,isExpressPaymentMethodActive:P,hasPaymentError:A,isPaymentReady:N,shouldSavePayment:T}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),hasPaymentError:t.hasPaymentError(),isPaymentReady:t.isPaymentReady(),shouldSavePayment:t.getShouldSavePaymentMethod()}}),[]),R=(0,ft.getPaymentMethods)(),x=(0,ft.getExpressPaymentMethods)(),I=(0,d.useRef)(w),O=(0,d.useRef)(b),M=(0,d.useRef)(u),[B,F]=(0,d.useState)(!1),D=(0,d.useMemo)((()=>{var e;const t={...x,...R};return null==t||null===(e=t[C])||void 0===e?void 0:e.paymentMethodId}),[C,x,R]),L=g()&&!P||A||k.hasError,Y=!c&&!L&&(N||!y)&&i;(0,d.useEffect)((()=>{L===c||!i&&!s||P||h(L)}),[L,c,i,s,P,h]),(0,d.useEffect)((()=>{I.current=w,O.current=b,M.current=u}),[w,b,u]);const j=(0,d.useCallback)((()=>g()?void 0!==(0,E.select)(oe.VALIDATION_STORE_KEY).getValidationError("shipping-rates-error")&&{errorMessage:(0,l.__)("Sorry, this order requires a shipping option.","woocommerce")}:A?{errorMessage:(0,l.__)("There was a problem with your payment option.","woocommerce"),context:"wc/checkout/payments"}:!k.hasError||{errorMessage:(0,l.__)("There was a problem with your shipping option.","woocommerce"),context:"wc/checkout/shipping-methods"}),[g,A,k.hasError]);(0,d.useEffect)((()=>{let t;return P||(t=e(j,0)),()=>{P||"function"!=typeof t||t()}}),[e,j,P]),(0,d.useEffect)((()=>{window.localStorage.removeItem("WOOCOMMERCE_CHECKOUT_IS_CUSTOMER_DATA_DIRTY"),M.current&&(window.location.href=M.current)}),[a]);const V=(0,d.useCallback)((async()=>{if(B)return;F(!0),(()=>{const e=(0,E.select)("wc/store/store-notices").getRegisteredContainers(),{removeNotice:t}=(0,E.dispatch)("core/notices"),{getNotices:o}=(0,E.select)("core/notices");e.forEach((e=>{o(e).forEach((o=>{t(o.id,e)}))}))})();const e=y?{payment_method:D,payment_data:Ct(S,T,C)}:{},c={additional_fields:t,billing_address:Ie(I.current),create_account:p,customer_note:m,customer_password:r,extensions:{...n},shipping_address:v?Ie(O.current):void 0,...e};vt()({path:"/wc/store/v1/checkout",method:"POST",data:c,cache:"no-store",parse:!1}).then((e=>{if((0,be.assertResponseIsValid)(e),St(e.headers),!e.ok)throw e;return e.json()})).then((e=>{_(e),F(!1)})).catch((e=>{St(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&&f(e.data.cart),(0,oe.processErrorResponse)(e),_(e)}))}catch{let e=(0,l.__)("Something went wrong when placing the order. Check your email for order updates before retrying.","woocommerce");0!==o&&(e=(0,l.__)("Something went wrong when placing the order. Check your account's order history or your email for order updates before retrying.","woocommerce")),(0,oe.processErrorResponse)({code:"unknown_error",message:e,data:null})}h(!0),F(!1)}))}),[B,y,D,S,T,C,m,p,o,r,n,t,v,f,h,_]);return(0,d.useEffect)((()=>{Y&&!B&&V()}),[V,Y,B]),null},At=({children:e,redirectUrl:t})=>(0,r.createElement)(bt,{redirectUrl:t},(0,r.createElement)(ut,null,(0,r.createElement)(me,null,e,(0,r.createElement)(te,{renderError:v.CURRENT_USER_IS_ADMIN?null:()=>null},(0,r.createElement)(y.PluginArea,{scope:"woocommerce-checkout"})),(0,r.createElement)(Pt,null)))),Nt={cc:[{method:{gateway:"credit-card",last4:"5678",brand:"Visa"},expires:"12/20",is_default:!1,tokenId:"1"}]},Tt=window.wp.components,Rt=window.wc.blocksCheckout;var xt=o(2172);const It=(0,d.forwardRef)((({children:e,className:t=""},o)=>(0,r.createElement)("div",{ref:o,className:(0,n.A)("wc-block-components-main",t)},e))),Ot=(0,d.createContext)({showCompanyField:!1,requireCompanyField:!1,showApartmentField:!1,requireApartmentField:!1,showPhoneField:!1,requirePhoneField:!1,showOrderNotes:!0,showPolicyLinks:!0,showReturnToCart:!0,cartPageId:0,showRateAfterTaxName:!1,showFormStepNumbers:!1}),Mt=(0,d.createContext)({addressFieldControls:()=>null}),Bt=()=>(0,d.useContext)(Ot),Ft=()=>(0,d.useContext)(Mt),Dt=["core/paragraph","core/image","core/separator"],Lt=e=>{const t=(0,Rt.applyCheckoutFilter)({filterName:"additionalCartCheckoutInnerBlockTypes",defaultValue:[],extensions:(0,E.select)(oe.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,i.getBlockTypes)().filter((t=>((null==t?void 0:t.parent)||[]).includes(e))).map((({name:e})=>e)),...Dt,...t]))},Yt=({clientId:e,registeredBlocks:t,defaultTemplate:o=[]})=>{const r=(0,d.useRef)(t),n=(0,d.useRef)(o),c=(0,E.useRegistry)(),{isPreview:s}=w();(0,d.useEffect)((()=>{let t=!1;if(s)return;const{replaceInnerBlocks:o}=(0,E.dispatch)("core/block-editor");return c.subscribe((()=>{if(!c.select("core/block-editor").getBlock(e))return;const s=c.select("core/block-editor").getBlocks(e);if(0===s.length&&n.current.length>0&&!t){const r=(0,i.createBlocksFromInnerBlocksTemplate)(n.current);if(0!==r.length)return t=!0,void o(e,r)}const a=r.current.map((e=>(0,i.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})(s,a);if(0===l.length)return;let m=-1;const d=l.map((e=>{const t=n.current.findIndex((([t])=>t===e.name)),o=(0,i.createBlock)(e.name);return-1===m&&(m=(({defaultTemplatePosition:e,innerBlocks:t,currentDefaultTemplate:o})=>{switch(e){case-1:return t.length;case 0:return 0;default:const r=o.current[e-1],n=t.findIndex((({name:e})=>e===r[0]));return-1===n?e:n+1}})({defaultTemplatePosition:t,innerBlocks:s,currentDefaultTemplate:n})),o}));c.batch((()=>{c.dispatch("core/block-editor").insertBlocks(d,m,e)}))}),"core/block-editor")}),[e,s,c])};o(6619),(0,i.registerBlockType)("woocommerce/checkout-fields-block",{icon:{src:(0,r.createElement)(a.A,{icon:xt.A,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e,attributes:t})=>{const o=(0,m.useBlockProps)({className:(0,n.A)("wc-block-checkout__main",null==t?void 0:t.className)}),c=Lt(Rt.innerBlockAreas.CHECKOUT_FIELDS),{showFormStepNumbers:s}=Bt(),{addressFieldControls:a}=Ft(),i=[["woocommerce/checkout-express-payment-block",{},[]],["woocommerce/checkout-contact-information-block",{},[]],["woocommerce/checkout-shipping-method-block",{},[]],["woocommerce/checkout-pickup-options-block",{},[]],["woocommerce/checkout-shipping-address-block",{},[]],["woocommerce/checkout-billing-address-block",{},[]],["woocommerce/checkout-shipping-methods-block",{},[]],["woocommerce/checkout-payment-block",{},[]],["woocommerce/checkout-additional-information-block",{},[]],["woocommerce/checkout-order-note-block",{},[]],["woocommerce/checkout-terms-block",{},[]],["woocommerce/checkout-actions-block",{},[]]].filter(Boolean);return Yt({clientId:e,registeredBlocks:c,defaultTemplate:i}),(0,r.createElement)(It,{...o},(0,r.createElement)(a,null),(0,r.createElement)("form",{className:(0,n.A)("wc-block-components-form wc-block-checkout__form",{"wc-block-checkout__form--with-step-numbers":s})},(0,r.createElement)(m.InnerBlocks,{allowedBlocks:c,templateLock:!1,template:i,renderAppender:m.InnerBlocks.ButtonBlockAppender})))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(m.InnerBlocks.Content,null))});const jt=(0,d.forwardRef)((({children:e,className:t=""},o)=>(0,r.createElement)("div",{ref:o,className:(0,n.A)("wc-block-components-sidebar",t)},e)));o(7765),(0,i.registerBlockType)("woocommerce/checkout-totals-block",{icon:{src:(0,r.createElement)(a.A,{icon:xt.A,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e,attributes:t})=>{const o=(0,m.useBlockProps)({className:(0,n.A)("wc-block-checkout__sidebar",null==t?void 0:t.className)}),c=Lt(Rt.innerBlockAreas.CHECKOUT_TOTALS),s=[["woocommerce/checkout-order-summary-block",{},[]]];return Yt({clientId:e,registeredBlocks:c,defaultTemplate:s}),(0,r.createElement)(jt,{...o},(0,r.createElement)(m.InnerBlocks,{allowedBlocks:c,templateLock:!1,template:s,renderAppender:m.InnerBlocks.ButtonBlockAppender}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(m.InnerBlocks.Content,null))});var Vt=o(601);const Kt=()=>{const{customerData:e,isInitialized:t}=(0,E.useSelect)((e=>{const t=e(oe.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}})),{setShippingAddress:o,setBillingAddress:r}=(0,E.useDispatch)(oe.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:r,setShippingAddress:o}},Ut=()=>{const{needsShipping:e}=st(),{useShippingAsBilling:t,prefersCollection:o,editingBillingAddress:r,editingShippingAddress:n}=(0,E.useSelect)((e=>({useShippingAsBilling:e(oe.CHECKOUT_STORE_KEY).getUseShippingAsBilling(),prefersCollection:e(oe.CHECKOUT_STORE_KEY).prefersCollection(),editingBillingAddress:e(oe.CHECKOUT_STORE_KEY).getEditingBillingAddress(),editingShippingAddress:e(oe.CHECKOUT_STORE_KEY).getEditingShippingAddress()}))),{__internalSetUseShippingAsBilling:c,setEditingBillingAddress:s,setEditingShippingAddress:a}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),{billingAddress:i,setBillingAddress:l,shippingAddress:m,setShippingAddress:u}=Kt(),p=(0,d.useCallback)((e=>{l({email:e})}),[l]),h=(0,v.getSetting)("forcedBillingAddress",!1);return{shippingAddress:m,billingAddress:i,setShippingAddress:u,setBillingAddress:l,setEmail:p,defaultFields:v.defaultFields,useShippingAsBilling:t,setUseShippingAsBilling:c,editingBillingAddress:r,editingShippingAddress:n,setEditingBillingAddress:s,setEditingShippingAddress:a,needsShipping:e,showShippingFields:!h&&e&&!o,showShippingMethods:e&&!o,showBillingFields:!e||!t||!!o,forcedBillingAddress:h,useBillingAsShipping:h||!!o}},Ht=window.wc.blocksComponents,qt=({children:e,stepHeadingContent:t})=>(0,r.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,r.createElement)(Ht.Title,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},e),!!t&&(0,r.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},t)),$t=({attributes:e,setAttributes:t,className:o="",children:c})=>{const{showFormStepNumbers:s}=Bt(),{title:a="",description:i=""}=e,d=(0,m.useBlockProps)({className:(0,n.A)("wc-block-components-checkout-step",o,{"wc-block-components-checkout-step--with-step-number":s})});return(0,r.createElement)("div",{...d},(0,r.createElement)(qt,null,(0,r.createElement)(m.PlainText,{className:"",value:a,onChange:e=>t({title:e}),style:{backgroundColor:"transparent"}})),(0,r.createElement)("div",{className:"wc-block-components-checkout-step__container"},(0,r.createElement)("p",{className:"wc-block-components-checkout-step__description"},(0,r.createElement)(m.PlainText,{className:i?"":"wc-block-components-checkout-step__description-placeholder",value:i,placeholder:(0,l.__)("Optional text for this form step.","woocommerce"),onChange:e=>t({description:e}),style:{backgroundColor:"transparent"}})),(0,r.createElement)("div",{className:"wc-block-components-checkout-step__content"},c)))};o(6664);const zt=({block:e})=>{const{"data-block":t}=(0,m.useBlockProps)(),o=Lt(e);return Yt({clientId:t,registeredBlocks:o}),(0,r.createElement)("div",{className:"wc-block-checkout__additional_fields"},(0,r.createElement)(m.InnerBlocks,{allowedBlocks:o}))},Wt=()=>(0,r.createElement)(m.InnerBlocks.Content,null);var Gt=o(4375),Zt=o(8107),Jt=o(4717);const Xt=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"],Qt=({children:e,style:t={},...o})=>{const n=(0,d.useRef)(null),c=()=>{n.current&&Zt.focus.focusable.find(n.current).forEach((e=>{Xt.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))},s=(0,Jt.YQ)(c,0,{leading:!0});return(0,d.useLayoutEffect)((()=>{let e;return c(),n.current&&(e=new window.MutationObserver(s),e.observe(n.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),s.cancel()}}),[s]),(0,r.createElement)("div",{ref:n,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...t},...o},e)};o(2931);var eo=o(224);o(5452);const to=e=>{const{onChange:t,options:o,label:c,value:s="",className:i,size:m,errorId:u,required:p,errorMessage:h=(0,l.__)("Please select a valid option","woocommerce"),placeholder:_,...g}=e,k=(0,d.useCallback)((e=>{t(e.target.value)}),[t]),w=(0,d.useMemo)((()=>({value:"",label:null!=_?_:(0,l.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,l.__)("Select a %s","woocommerce"),null==c?void 0:c.toLowerCase()),disabled:!!p})),[c,_,p]),b=(0,d.useId)(),y=g.id||`wc-blocks-components-select-${b}`,v=u||y,f=(0,d.useMemo)((()=>p&&s?o:[w].concat(o)),[p,s,w,o]),{setValidationErrors:C,clearValidationError:S}=(0,E.useDispatch)(oe.VALIDATION_STORE_KEY),{error:P,validationErrorId:A}=(0,E.useSelect)((e=>{const t=e(oe.VALIDATION_STORE_KEY);return{error:t.getValidationError(v),validationErrorId:t.getValidationErrorId(v)}}));(0,d.useEffect)((()=>(!p||s?S(v):C({[v]:{message:h,hidden:!0}}),()=>{S(v)})),[S,s,v,h,p,C]);const N=(0,E.useSelect)((e=>e(oe.VALIDATION_STORE_KEY).getValidationError(v||"")||{hidden:!0}));return(0,r.createElement)("div",{className:(0,n.A)(i,{"has-error":!N.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:y,className:"wc-blocks-components-select__label"},c),(0,r.createElement)("select",{className:"wc-blocks-components-select__select",id:y,size:void 0!==m?m:1,onChange:k,value:s,"aria-invalid":!(null==P||!P.message||null!=P&&P.hidden),"aria-errormessage":A,...g},f.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)(a.A,{className:"wc-blocks-components-select__expand",icon:eo.A}))),(0,r.createElement)(Ht.ValidationInputError,{propertyName:v}))},oo=({className:e,countries:t,id:o,label:c,onChange:s,value:a="",autoComplete:i="off",required:l=!1})=>{const m=(0,d.useMemo)((()=>Object.entries(t).map((([e,t])=>({value:e,label:(0,Pe.decodeEntities)(t)})))),[t]);return(0,r.createElement)(to,{className:(0,n.A)(e,"wc-block-components-country-input"),id:o,label:c||"",onChange:s,options:m,value:a,required:l,autoComplete:i})},ro=e=>{const{...t}=e;return(0,r.createElement)(oo,{countries:H,...t})},no=e=>(0,r.createElement)(oo,{countries:$,...e});o(8824);const co=(e,t)=>{const o=t.find((t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()));return o?o.value:""},so=({className:e,id:t,states:o,country:c,label:s,onChange:a,autoComplete:i="off",value:l="",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,Pe.decodeEntities)(u[e])}))):[]),[u]),h=(0,d.useCallback)((e=>{const t=p.length>0?co(e,p):e;t!==l&&a(t)}),[a,p,l]),_=(0,d.useRef)(l);return(0,d.useEffect)((()=>{_.current!==l&&(_.current=l)}),[l]),(0,d.useEffect)((()=>{if(p.length>0&&_.current){const e=co(_.current,p);e!==_.current&&h(e)}}),[p,h]),p.length>0?(0,r.createElement)(to,{className:(0,n.$)(e,"wc-block-components-state-input"),options:p,label:s||"",id:t,onChange:h,value:l,autoComplete:i,required:m}):(0,r.createElement)(Ht.ValidatedTextInput,{className:e,id:t,label:s,onChange:h,autoComplete:i,value:l,required:m})},ao=e=>{const{...t}=e;return(0,r.createElement)(so,{states:q,...t})},io=e=>(0,r.createElement)(so,{states:z,...e});function lo(e){const t=(0,d.useRef)(e);return Xe()(e,t.current)||(t.current=e),t.current}var mo=o(1777);o(5684);const uo=({field:e,props:t,onChange:o,value:n})=>{var c;const s=null!==(c=null==e?void 0:e.required)&&void 0!==c&&c,[a,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,a?(0,r.createElement)(Ht.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)(mo.$,{render:(0,r.createElement)("span",null),className:"wc-block-components-address-form__address_2-toggle",onClick:()=>i(!0)},(0,l.sprintf)(
// translators: %s: address 2 field label.
// translators: %s: address 2 field label.
(0,l.__)("+ 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)})))},po=(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}),ho=(e,t,o)=>({field:t.find((t=>t.key===e)),value:(0,be.objectHasProp)(o,e)?o[e]:void 0}),_o=({formId:e,address1:t,address2:o,addressType:n,onChange:c})=>{var s,a,i,l;const m=t?po(t.field,e,n):void 0,d=o?po(o.field,e,n):void 0;return(0,r.createElement)(r.Fragment,null,t&&(0,r.createElement)(Ht.ValidatedTextInput,{...m,type:null===(s=t.field)||void 0===s?void 0:s.type,label:null===(a=t.field)||void 0===a?void 0:a.label,className:`wc-block-components-address-form__${null===(i=t.field)||void 0===i?void 0:i.key}`,value:t.value,onChange:e=>{var o;return c(null===(o=t.field)||void 0===o?void 0:o.key,e)}}),(null==o?void 0:o.field)&&!(null!=o&&null!==(l=o.field)&&void 0!==l&&l.hidden)&&(0,r.createElement)(uo,{field:o.field,props:d,onChange:c,value:null==o?void 0:o.value}))};function go(e){let t=e;return function(e){const o=t;return t=e,o}}const Eo=go(),ko=go(),wo=({id:e="",fields:t,fieldConfig:o={},onChange:c,addressType:s="shipping",values:a,children:i,isEditing:m})=>{const p=(0,u.useInstanceId)(wo),h=(0,d.useRef)(!0),_=lo(t),g=lo(o),k=lo((0,be.objectHasProp)(a,"country")?a.country:""),w=(0,d.useMemo)((()=>{const e=Te(_,g,k);return{fields:e,addressType:s,required:e.filter((e=>e.required)),hidden:e.filter((e=>e.hidden))}}),[_,g,k,s]),b=(0,d.useRef)({});return(0,d.useEffect)((()=>{const e={...a,...Object.fromEntries(w.hidden.map((e=>[e.key,""])))};Xe()(a,e)||c(e)}),[c,w,a]),(0,d.useEffect)((()=>{if((0,be.objectHasProp)(a,"country")&&((e,t)=>{const o=`${e}_country`,r=(0,E.select)(oe.VALIDATION_STORE_KEY).getValidationError(o);!t.country&&(t.city||t.state||t.postcode)&&(r?(0,E.dispatch)(oe.VALIDATION_STORE_KEY).showValidationError(o):(0,E.dispatch)(oe.VALIDATION_STORE_KEY).setValidationErrors({[o]:{message:(0,l.__)("Please select your country","woocommerce"),hidden:!1}})),r&&t.country&&(0,E.dispatch)(oe.VALIDATION_STORE_KEY).clearValidationError(o)})(s,a),(0,be.objectHasProp)(a,"state")){const e=w.fields.find((e=>"state"===e.key));e&&((e,t,o)=>{const r=`${e}_state`,n=(0,E.select)(oe.VALIDATION_STORE_KEY).getValidationError(r),c=o.required,s="shipping"===e?Eo(t):ko(t),a=!!s&&!Xe()(s,t);n?!c||t.state?(0,E.dispatch)(oe.VALIDATION_STORE_KEY).clearValidationError(r):a||(0,E.dispatch)(oe.VALIDATION_STORE_KEY).showValidationError(r):!n&&c&&!t.state&&t.country&&(0,E.dispatch)(oe.VALIDATION_STORE_KEY).setValidationErrors({[r]:{message:(0,l.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,l.__)("Please select a %s","woocommerce"),o.label.toLowerCase()),hidden:!0}})})(s,a,e)}}),[a,s,w]),(0,d.useEffect)((()=>{var e,t;null===(e=b.current)||void 0===e||null===(t=e.postcode)||void 0===t||t.revalidate()}),[k]),(0,d.useEffect)((()=>{let t;if(!h.current&&m&&b.current){const o=w.fields.find((e=>!1===e.hidden));if(!o)return;const{id:r}=po(o,e||`${p}`,s),n=document.getElementById(r);n&&(t=setTimeout((()=>{n.focus()}),300))}return h.current=!1,()=>{clearTimeout(t)}}),[m,w,e,p,s]),e=e||`${p}`,(0,r.createElement)("div",{id:e,className:"wc-block-components-address-form"},w.fields.map((t=>{if(t.hidden)return null;const o=po(t,e,s),i=(e=>{const{errorId:t,errorMessage:o,autoCapitalize:r,autoComplete:n,placeholder:c,...s}=e;return s})(o);if("email"===t.key&&(o.id="email",o.errorId="billing_email"),"checkbox"===t.type)return(0,r.createElement)(Ht.CheckboxControl,{key:t.key,checked:Boolean(a[t.key]),onChange:e=>{c({...a,[t.key]:e})},...i});if("address_1"===t.key){const o=ho("address_1",w.fields,a),n=ho("address_2",w.fields,a);return(0,r.createElement)(_o,{address1:o,address2:n,addressType:s,formId:e,key:t.key,onChange:(e,t)=>{c({...a,[e]:t})}})}if("address_2"===t.key)return null;if("country"===t.key&&(0,be.objectHasProp)(a,"country")){const e="shipping"===s?no:ro;return(0,r.createElement)(e,{key:t.key,...o,value:a.country,onChange:e=>{c({...a,country:e,state:"",postcode:""})}})}if("state"===t.key&&(0,be.objectHasProp)(a,"state")){const e="shipping"===s?io:ao;return(0,r.createElement)(e,{key:t.key,...o,country:a.country,value:a.state,onChange:e=>c({...a,state:e})})}return"select"===t.type?void 0===t.options?null:(0,r.createElement)(to,{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:a[t.key],onChange:e=>{c({...a,[t.key]:e})},options:t.options,required:t.required,errorMessage:o.errorMessage||void 0}):(0,r.createElement)(Ht.ValidatedTextInput,{key:t.key,ref:e=>b.current[t.key]=e,...o,type:t.type,value:a[t.key],onChange:e=>c({...a,[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,Rt.isPostcode)({postcode:e.value,country:o})?(e.setCustomValidity((0,l.__)("Please enter a valid postcode","woocommerce")),1):"email"===t&&!(0,Re.isEmail)(e.value)&&(e.setCustomValidity((0,l.__)("Please enter a valid email address","woocommerce")),1))))(e,t.key,(0,be.objectHasProp)(a,"country")?a.country:"")})})),i)},bo=wo;o(7259);const yo=({isEditing:e=!1,addressCard:t,addressForm:o})=>{const c=(0,n.A)("wc-block-components-address-address-wrapper",{"is-editing":e});return(0,r.createElement)("div",{className:c},(0,r.createElement)("div",{className:"wc-block-components-address-card-wrapper"},t()),(0,r.createElement)("div",{className:"wc-block-components-address-form-wrapper"},o()))},vo=e=>(0,be.isObject)(q[e.country])&&(0,be.isString)(q[e.country][e.state])?(0,Pe.decodeEntities)(q[e.country][e.state]):e.state,fo=e=>(0,be.isString)(H[e.country])?(0,Pe.decodeEntities)(H[e.country]):e.country;o(1094);const Co=({address:e,onEdit:t,target:o,fieldConfig:n,isExpanded:c})=>{const s=(0,v.getSetting)("countryData",{});let a=(0,v.getSetting)("defaultAddressFormat","{name}\n{company}\n{address_1}\n{address_2}\n{city}\n{state}\n{postcode}\n{country}");(0,be.objectHasProp)(s,null==e?void 0:e.country)&&(0,be.objectHasProp)(s[e.country],"format")&&(0,be.isString)(s[e.country].format)&&(a=s[e.country].format);const{name:i,address:m}=((e,t)=>{const o=(e=>["{name}","{name_upper}","{first_name} {last_name}","{last_name} {first_name}","{first_name_upper} {last_name_upper}","{last_name_upper} {first_name_upper}","{first_name} {last_name_upper}","{first_name_upper} {last_name}","{last_name} {first_name_upper}","{last_name_upper} {first_name}"].find((t=>e.indexOf(t)>=0))||"")(t),r=t.replace(`${o}\n`,""),n=[["{company}",(null==e?void 0:e.company)||""],["{address_1}",(null==e?void 0:e.address_1)||""],["{address_2}",(null==e?void 0:e.address_2)||""],["{city}",(null==e?void 0:e.city)||""],["{state}",vo(e)],["{postcode}",(null==e?void 0:e.postcode)||""],["{country}",fo(e)],["{company_upper}",((null==e?void 0:e.company)||"").toUpperCase()],["{address_1_upper}",((null==e?void 0:e.address_1)||"").toUpperCase()],["{address_2_upper}",((null==e?void 0:e.address_2)||"").toUpperCase()],["{city_upper}",((null==e?void 0:e.city)||"").toUpperCase()],["{state_upper}",vo(e).toUpperCase()],["{state_code}",(null==e?void 0:e.state)||""],["{postcode_upper}",((null==e?void 0:e.postcode)||"").toUpperCase()],["{country_upper}",fo(e).toUpperCase()]],c=[["{name}",(null==e?void 0:e.first_name)+(null!=e&&e.first_name&&null!=e&&e.last_name?" ":"")+(null==e?void 0:e.last_name)],["{name_upper}",((null==e?void 0:e.first_name)+(null!=e&&e.first_name&&null!=e&&e.last_name?" ":"")+(null==e?void 0:e.last_name)).toUpperCase()],["{first_name}",(null==e?void 0:e.first_name)||""],["{last_name}",(null==e?void 0:e.last_name)||""],["{first_name_upper}",((null==e?void 0:e.first_name)||"").toUpperCase()],["{last_name_upper}",((null==e?void 0:e.last_name)||"").toUpperCase()]];let s=o;c.forEach((([e,t])=>{s=s.replace(e,t)}));let a=r;n.forEach((([e,t])=>{a=a.replace(e,t)}));const i=a.replace(/^,\s|,\s$/g,"").replace(/\n{2,}/,"\n").split("\n").filter(Boolean);return{name:s,address:i}})(e,a),d="shipping"===o?(0,l.__)("Edit shipping address","woocommerce"):(0,l.__)("Edit billing address","woocommerce");return(0,r.createElement)("div",{className:"wc-block-components-address-card"},(0,r.createElement)("address",null,(0,r.createElement)("span",{className:"wc-block-components-address-card__address-section"},i),(0,r.createElement)("div",{className:"wc-block-components-address-card__address-section"},m.filter((e=>!!e)).map(((e,t)=>(0,r.createElement)("span",{key:"address-"+t},e)))),e.phone&&!n.phone.hidden?(0,r.createElement)("div",{key:"address-phone",className:"wc-block-components-address-card__address-section"},e.phone):""),t&&(0,r.createElement)(mo.$,{render:(0,r.createElement)("span",null),className:"wc-block-components-address-card__edit","aria-controls":o,"aria-expanded":c,"aria-label":d,onClick:e=>{e.preventDefault(),t()},type:"button"},(0,l.__)("Edit","woocommerce")))},So=({addressFieldsConfig:e})=>{const{shippingAddress:t,setShippingAddress:o,setBillingAddress:n,useShippingAsBilling:c,editingShippingAddress:s,setEditingShippingAddress:a}=Ut(),{dispatchCheckoutEvent:i}=ct(),{hasValidationErrors:l,invalidProps:m}=(0,E.useSelect)((e=>{const o=e(oe.VALIDATION_STORE_KEY);return{hasValidationErrors:o.hasValidationErrors(),invalidProps:Object.keys(t).filter((e=>void 0!==o.getValidationError("shipping_"+e))).filter(Boolean)}}));(0,d.useEffect)((()=>{m.length>0&&!1===s&&a(!0)}),[s,l,m.length,a]);const u=(0,d.useCallback)((e=>{o(e),c&&(n(e),i("set-billing-address")),i("set-shipping-address")}),[i,n,o,c]),p=(0,d.useCallback)((()=>(0,r.createElement)(Co,{address:t,target:"shipping",onEdit:()=>{a(!0)},fieldConfig:e,isExpanded:s})),[t,e,s,a]),h=(0,d.useCallback)((()=>(0,r.createElement)(bo,{id:"shipping",addressType:"shipping",onChange:u,values:t,fields:Z,fieldConfig:e,isEditing:s})),[e,u,t,s]);return(0,r.createElement)(yo,{isEditing:s,addressCard:p,addressForm:h})},Po=({showCompanyField:e=!1,requireCompanyField:t=!1,showApartmentField:o=!1,requireApartmentField:n=!1,showPhoneField:c=!1,requirePhoneField:s=!1})=>{const{setBillingAddress:a,shippingAddress:i,billingAddress:m,useShippingAsBilling:u,setUseShippingAsBilling:p,setEditingBillingAddress:h}=Ut(),{isEditor:_}=w(),g=0===(0,v.getSetting)("currentUserId"),k=()=>{const t={...i};c||delete t.phone,e&&delete t.company,a(t)};(0,Gt.Su)((()=>{u&&k()}));const b=(0,d.useMemo)((()=>({company:{hidden:!e,required:t},address_2:{hidden:!o,required:n},phone:{hidden:!c,required:s}})),[e,t,o,n,c,s]),y=_?Qt:d.Fragment,f=u?[ve.SHIPPING_ADDRESS,ve.BILLING_ADDRESS]:[ve.SHIPPING_ADDRESS],{cartDataLoaded:C}=(0,E.useSelect)((e=>({cartDataLoaded:e(oe.CART_STORE_KEY).hasFinishedResolution("getCartData")})));return(0,r.createElement)(d.Fragment,null,(0,r.createElement)(Ht.StoreNoticesContainer,{context:f}),(0,r.createElement)(y,null,C?(0,r.createElement)(So,{addressFieldsConfig:b}):null),(0,r.createElement)(Ht.CheckboxControl,{className:"wc-block-checkout__use-address-for-billing",label:(0,l.__)("Use same address for billing","woocommerce"),checked:u,onChange:e=>{p(e),e?k():(h(!0),(e=>{if(!e||!g)return;const t=(e=>{const t=Te(Z,{},e.country),o=Object.assign({},e);return t.forEach((({key:t=""})=>{"country"!==t&&"state"!==t&&xe(t,e)&&(o[t]="")})),o})(e);a(t)})(m))}}))},Ao=({defaultTitle:e=(0,l.__)("Step","woocommerce"),defaultDescription:t=(0,l.__)("Step description text.","woocommerce"),defaultShowStepNumber:o=!0})=>({title:{type:"string",default:e},description:{type:"string",default:t},showStepNumber:{type:"boolean",default:o}}),No={...Ao({defaultTitle:(0,l.__)("Shipping address","woocommerce"),defaultDescription:(0,l.__)("Enter the address where you want your order delivered.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};(0,i.registerBlockType)("woocommerce/checkout-shipping-address-block",{icon:{src:(0,r.createElement)(a.A,{icon:Vt.A,className:"wc-block-editor-components-block-icon"})},attributes:No,edit:({attributes:e,setAttributes:t})=>{const{showCompanyField:o,requireCompanyField:c,showApartmentField:s,requireApartmentField:a,showPhoneField:i,requirePhoneField:l}=Bt(),{addressFieldControls:m}=Ft(),{showShippingFields:d}=Ut();if(!d)return null;const u=`shipping-address-${a?"visible":"hidden"}-address-2`;return(0,r.createElement)($t,{setAttributes:t,attributes:e,className:(0,n.A)("wc-block-checkout__shipping-fields",null==e?void 0:e.className)},(0,r.createElement)(m,null),(0,r.createElement)(Po,{key:u,showCompanyField:o,requireCompanyField:c,showApartmentField:s,requireApartmentField:a,showPhoneField:i,requirePhoneField:l}),(0,r.createElement)(zt,{block:Rt.innerBlockAreas.SHIPPING_ADDRESS}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(Wt,null))});var To=o(3813);o(8845);const Ro=L?`<a href="${L}" target="_blank">${(0,l.__)("Terms and Conditions","woocommerce")}</a>`:(0,l.__)("Terms and Conditions","woocommerce"),xo=D?`<a href="${D}" target="_blank">${(0,l.__)("Privacy Policy","woocommerce")}</a>`:(0,l.__)("Privacy Policy","woocommerce"),Io=(0,l.sprintf)(/* translators: %1$s terms page link, %2$s privacy page link. */ /* translators: %1$s terms page link, %2$s privacy page link. */
(0,l.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woocommerce"),Ro,xo),Oo=(0,l.sprintf)(/* translators: %1$s terms page link, %2$s privacy page link. */ /* translators: %1$s terms page link, %2$s privacy page link. */
(0,l.__)("You must accept our %1$s and %2$s to continue with your purchase.","woocommerce"),Ro,xo);o(5609),(0,i.registerBlockType)("woocommerce/checkout-terms-block",{icon:{src:(0,r.createElement)(a.A,{icon:To.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:{checkbox:e,text:t,showSeparator:o},setAttributes:c})=>{const s=(0,m.useBlockProps)(),a=t||(e?Oo:Io);return(0,r.createElement)("div",{...s},(0,r.createElement)(m.InspectorControls,null,(!L||!D)&&(0,r.createElement)(Tt.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1},(0,l.__)("Link to your store's Terms and Conditions and Privacy Policy pages by creating pages for them.","woocommerce"),(0,r.createElement)("br",null),!L&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("br",null),(0,r.createElement)(Tt.ExternalLink,{href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=advanced`},(0,l.__)("Setup a Terms and Conditions page","woocommerce"))),!D&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("br",null),(0,r.createElement)(Tt.ExternalLink,{href:`${v.ADMIN_URL}options-privacy.php`},(0,l.__)("Setup a Privacy Policy page","woocommerce")))),L&&D&&!(a.includes(L)&&a.includes(D))&&(0,r.createElement)(Tt.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:Io!==t?[{label:(0,l.__)("Restore default text","woocommerce"),onClick:()=>c({text:""})}]:[]},(0,r.createElement)("p",null,(0,l.__)("Ensure you add links to your policy pages in this section.","woocommerce"))),(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Display options","woocommerce")},(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Require checkbox","woocommerce"),checked:e,onChange:()=>c({checkbox:!e})}),(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Show separator","woocommerce"),checked:o,onChange:()=>c({showSeparator:!o})}))),(0,r.createElement)("div",{className:(0,n.A)("wc-block-checkout__terms",{"wc-block-checkout__terms--with-separator":o})},e?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ht.CheckboxControl,{id:"terms-condition",checked:!1}),(0,r.createElement)(m.RichText,{value:a,onChange:e=>c({text:e})})):(0,r.createElement)(m.RichText,{tagName:"span",value:a,onChange:e=>c({text:e})})))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});var Mo=o(2596),Bo=o(3876);o(3091);const Fo=[(0,l.__)("Too weak","woocommerce"),(0,l.__)("Weak","woocommerce"),(0,l.__)("Medium","woocommerce"),(0,l.__)("Strong","woocommerce"),(0,l.__)("Very strong","woocommerce")],Do=({password:e="",onChange:t})=>{var o;const c=(0,u.useInstanceId)(Do,"woocommerce-password-strength-meter");let s=-1;e.length>0&&(s=(e=>void 0===window.zxcvbn?(0,Bo.Bi)(e,[{id:0,value:Fo[0],minDiversity:0,minLength:0},{id:1,value:Fo[1],minDiversity:1,minLength:4},{id:2,value:Fo[2],minDiversity:2,minLength:8},{id:3,value:Fo[3],minDiversity:4,minLength:12},{id:4,value:Fo[4],minDiversity:4,minLength:20}]).id:window.zxcvbn(e).score)(e));const a=pt(s);return(0,d.useEffect)((()=>{s!==a&&t&&t(s)}),[s,a,t]),(0,r.createElement)("div",{id:c,className:(0,n.A)("wc-block-components-password-strength",{hidden:-1===s})},(0,r.createElement)("label",{htmlFor:c+"-meter",className:"screen-reader-text"},(0,l.__)("Password strength","woocommerce")),(0,r.createElement)("meter",{id:c+"-meter",className:"wc-block-components-password-strength__meter",min:0,max:4,value:s>-1?s:0},null!==(o=Fo[s])&&void 0!==o?o:""),!!Fo[s]&&(0,r.createElement)("div",{id:c+"-result",className:"wc-block-components-password-strength__result"},(0,r.createElement)("span",{className:"screen-reader-text","aria-live":"polite"},(0,l.sprintf)(/* translators: %s: Password strength */ /* translators: %s: Password strength */
(0,l.__)("Password strength: %1$s (%2$d characters long)","woocommerce"),Fo[s],e.length))," ",(0,r.createElement)("span",{"aria-hidden":!0},Fo[s])))},Lo=Do,Yo=()=>{const[e,t]=(0,d.useState)(0),{customerPassword:o}=(0,E.useSelect)((e=>({customerPassword:e(oe.CHECKOUT_STORE_KEY).getCustomerPassword()}))),{__internalSetCustomerPassword:n}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY);return(0,r.createElement)(Ht.ValidatedTextInput,{type:"password",label:(0,l.__)("Create a password","woocommerce"),className:"wc-block-components-address-form__password",value:o,required:!0,errorId:"account-password",customValidityMessage:e=>{if(e.valueMissing||e.badInput||e.typeMismatch)return(0,l.__)("Please enter a valid password","woocommerce")},customValidation:t=>!(e<2&&(t.setCustomValidity((0,l.__)("Please create a stronger password","woocommerce")),1)),onChange:e=>n(e),feedback:(0,r.createElement)(Lo,{password:o,onChange:e=>t(e)})})},jo=()=>{const{shouldCreateAccount:e}=(0,E.useSelect)((e=>({shouldCreateAccount:e(oe.CHECKOUT_STORE_KEY).getShouldCreateAccount()}))),{__internalSetShouldCreateAccount:t,__internalSetCustomerPassword:o}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),n=(0,v.getSetting)("checkoutAllowsGuest",!1),c=(0,v.getSetting)("checkoutAllowsSignup",!1),s=n&&c,a=!(0,v.getSetting)("generatePassword",!1)&&(s&&e||!n);return n||s||a?(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)("p",{className:"wc-block-checkout__guest-checkout-notice"},(0,l.__)("You are currently checking out as a guest.","woocommerce")),s&&(0,r.createElement)(Ht.CheckboxControl,{className:"wc-block-checkout__create-account",label:(0,l.sprintf)(/* translators: Store name */ /* translators: Store name */
(0,l.__)("Create an account with %s","woocommerce"),(0,v.getSetting)("siteTitle","")),checked:e,onChange:e=>{t(e),o("")}}),a&&(0,r.createElement)(Yo,null)):null},Vo=()=>{const{additionalFields:e,customerId:t}=(0,E.useSelect)((e=>{const t=e(oe.CHECKOUT_STORE_KEY);return{additionalFields:t.getAdditionalFields(),customerId:t.getCustomerId()}})),{setAdditionalFields:o}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),{billingAddress:n,setEmail:c}=Ut(),{dispatchCheckoutEvent:s}=ct(),a={email:n.email,...e};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ht.StoreNoticesContainer,{context:ve.CONTACT_INFORMATION}),(0,r.createElement)(bo,{id:"contact",addressType:"contact",onChange:e=>{const{email:t,...r}=e;c(t),s("set-email-address"),o(r)},values:a,fields:J},!t&&(0,r.createElement)(jo,null)))},Ko={...Ao({defaultTitle:(0,l.__)("Contact information","woocommerce"),defaultDescription:(0,l.__)("We'll use this email to send you details and updates about your order.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{remove:!0,move:!0}}};(0,i.registerBlockType)("woocommerce/checkout-contact-information-block",{icon:{src:(0,r.createElement)(a.A,{icon:Mo.A,className:"wc-block-editor-components-block-icon"})},attributes:Ko,edit:({attributes:e,setAttributes:t})=>(0,r.createElement)($t,{attributes:e,setAttributes:t,className:(0,n.A)("wc-block-checkout__contact-fields",null==e?void 0:e.className)},(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Account creation and guest checkout","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("Account creation and guest checkout settings can be managed in your store settings.","woocommerce")),(0,r.createElement)(Tt.ExternalLink,{href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=account`},(0,l.__)("Manage account settings","woocommerce")))),(0,r.createElement)(Qt,null,(0,r.createElement)(Vo,null)),(0,r.createElement)(zt,{block:Rt.innerBlockAreas.CONTACT_INFORMATION})),save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(Wt,null))});const Uo=({addressFieldsConfig:e})=>{const{billingAddress:t,setShippingAddress:o,setBillingAddress:n,useBillingAsShipping:c,editingBillingAddress:s,setEditingBillingAddress:a}=Ut(),{dispatchCheckoutEvent:i}=ct(),{hasValidationErrors:l,invalidProps:m}=(0,E.useSelect)((e=>{const o=e(oe.VALIDATION_STORE_KEY);return{hasValidationErrors:o.hasValidationErrors(),invalidProps:Object.keys(t).filter((e=>"email"!==e&&void 0!==o.getValidationError("billing_"+e))).filter(Boolean)}}));(0,d.useEffect)((()=>{m.length>0&&!1===s&&a(!0)}),[s,l,m.length,a]);const u=(0,d.useCallback)((e=>{n(e),c&&(o(e),i("set-shipping-address")),i("set-billing-address")}),[i,n,o,c]),p=(0,d.useCallback)((()=>(0,r.createElement)(Co,{address:t,target:"billing",onEdit:()=>{a(!0)},fieldConfig:e,isExpanded:s})),[t,e,s,a]),h=(0,d.useCallback)((()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(bo,{id:"billing",addressType:"billing",onChange:u,values:t,fields:Z,fieldConfig:e,isEditing:s}))),[e,t,u,s]);return(0,r.createElement)(yo,{isEditing:s,addressCard:p,addressForm:h})},Ho=({showCompanyField:e=!1,requireCompanyField:t=!1,showApartmentField:o=!1,requireApartmentField:n=!1,showPhoneField:c=!1,requirePhoneField:s=!1})=>{const{billingAddress:a,setShippingAddress:i,useBillingAsShipping:l}=Ut(),{isEditor:m}=w();(0,Gt.Su)((()=>{if(l){const{email:t,...o}=a,r={...o};c||delete r.phone,e&&delete r.company,i(r)}}));const u=(0,d.useMemo)((()=>({company:{hidden:!e,required:t},address_2:{hidden:!o,required:n},phone:{hidden:!c,required:s}})),[e,t,o,n,c,s]),p=m?Qt:d.Fragment,h=l?[ve.BILLING_ADDRESS,ve.SHIPPING_ADDRESS]:[ve.BILLING_ADDRESS],{cartDataLoaded:_}=(0,E.useSelect)((e=>({cartDataLoaded:e(oe.CART_STORE_KEY).hasFinishedResolution("getCartData")})));return(0,r.createElement)(d.Fragment,null,(0,r.createElement)(Ht.StoreNoticesContainer,{context:h}),(0,r.createElement)(p,null,_?(0,r.createElement)(Uo,{addressFieldsConfig:u}):null))},qo=(0,l.__)("Billing address","woocommerce"),$o=(0,l.__)("Enter the billing address that matches your payment method.","woocommerce"),zo=(0,l.__)("Billing and shipping address","woocommerce"),Wo=(0,l.__)("Enter the billing and shipping address that matches your payment method.","woocommerce"),Go={...Ao({defaultTitle:qo,defaultDescription:$o}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};(0,i.registerBlockType)("woocommerce/checkout-billing-address-block",{icon:{src:(0,r.createElement)(a.A,{icon:Vt.A,className:"wc-block-editor-components-block-icon"})},attributes:Go,edit:({attributes:e,setAttributes:t})=>{const{showCompanyField:o,requireCompanyField:c,showApartmentField:s,requireApartmentField:a,showPhoneField:i,requirePhoneField:l}=Bt(),{addressFieldControls:m}=Ft(),{showBillingFields:d,forcedBillingAddress:u,useBillingAsShipping:p}=Ut();if(!d&&!p)return null;e.title=((e,t)=>t?e===qo?zo:e:e===zo?qo:e)(e.title,u),e.description=((e,t)=>t?e===$o?Wo:e:e===Wo?$o:e)(e.description,u);const h=`billing-address-${a?"visible":"hidden"}-address-2`;return(0,r.createElement)($t,{setAttributes:t,attributes:e,className:(0,n.A)("wc-block-checkout__billing-fields",null==e?void 0:e.className)},(0,r.createElement)(m,null),(0,r.createElement)(Ho,{key:h,showCompanyField:o,requireCompanyField:c,showApartmentField:s,requireApartmentField:a,showPhoneField:i,requirePhoneField:l}),(0,r.createElement)(zt,{block:Rt.innerBlockAreas.BILLING_ADDRESS}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(Wt,null))});var Zo=o(498);const Jo=(0,l.__)("Place Order","woocommerce"),Xo=(0,l.__)("Return to Cart","woocommerce"),Qo={placeOrderButtonLabel:{type:"string",default:Jo},returnToCartButtonLabel:{type:"string",default:Xo}},er=(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}`)},tr=({setPageId:e,pageId:t,labels:o})=>{const n=(0,E.useSelect)((e=>e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})),[])||null;return n?(0,r.createElement)(Tt.PanelBody,{title:o.title},(0,r.createElement)(Tt.SelectControl,{label:(0,l.__)("Link to","woocommerce"),value:t,options:[{label:o.default,value:0},...n.map((e=>({label:er(e,n),value:parseInt(e.id,10)})))],onChange:t=>e(parseInt(t,10))})):null};var or=o(1387);o(8337);const rr=({href:e,children:t})=>{const o=e||j;return o?(0,r.createElement)("a",{href:o,className:"wc-block-components-checkout-return-to-cart-button"},(0,r.createElement)(a.A,{icon:or.A}),t):null};o(2080),o(7791);const nr=()=>(0,r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"}),cr=(0,d.forwardRef)(((e,t)=>{"showSpinner"in e&&ne()("showSpinner prop",{version:"8.9.0",alternative:"Render a spinner in the button children instead.",plugin:"WooCommerce"});const{className:o,showSpinner:c=!1,children:s,variant:a="contained",removeTextWrap:i=!1,...l}=e,m=(0,n.A)("wc-block-components-button","wp-element-button",o,a,{"wc-block-components-button--loading":c});if("href"in e)return(0,r.createElement)(mo.$,{render:(0,r.createElement)("a",{ref:t,href:e.href},c&&(0,r.createElement)(nr,null),(0,r.createElement)("span",{className:"wc-block-components-button__text"},s)),className:m,...l});const d=i?e.children:(0,r.createElement)("span",{className:"wc-block-components-button__text"},e.children);return(0,r.createElement)(mo.$,{ref:t,className:m,...l},c&&(0,r.createElement)(nr,null),d)})),sr=({onChange:e,placeholder:t,value:o,children:n,...c})=>(0,r.createElement)(cr,{...c},(0,r.createElement)(m.RichText,{multiline:!1,allowedFormats:[],value:o,placeholder:t,onChange:e}),n),ar=window.wc.priceFormat;o(149);const ir=JSON.parse('{"uK":{"lock":{"type":"object","default":{"remove":true,"move":true}},"cartPageId":{"type":"number","default":0},"showReturnToCart":{"type":"boolean","default":true},"className":{"type":"string","default":""},"priceSeparator":{"type":"string","default":"·"}}}');o(5089);const lr={example:{attributes:{showPrice:!0,placeOrderButtonLabel:(0,l.__)("Place Order","woocommerce"),showReturnToCart:!1}},icon:{src:(0,r.createElement)(a.A,{icon:Zo.A,className:"wc-block-editor-components-block-icon"})},attributes:{...Qo,...ir.uK},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()}),edit:({attributes:e,setAttributes:t})=>{const o=(0,m.useBlockProps)(),{cartPageId:c=0,showReturnToCart:s=!1,placeOrderButtonLabel:a,returnToCartButtonLabel:i}=e,{cartTotals:u}=He(),p=(0,ar.getCurrencyFromPriceResponse)(u),{current:h}=(0,d.useRef)(c),_=(0,E.useSelect)((e=>h||e("core/editor").getCurrentPostId()),[h]),g=o.className.includes("is-style-with-price");return(0,r.createElement)("div",{...o},(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Options","woocommerce")},(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)('Show a "Return to Cart" link',"woocommerce"),help:(0,l.__)("Recommended to enable only if there is no Cart link in the header.","woocommerce"),checked:s,onChange:()=>t({showReturnToCart:!s})}),g&&(0,r.createElement)(Tt.TextControl,{label:(0,l.__)("Price separator","woocommerce"),id:"price-separator",value:e.priceSeparator,onChange:e=>{t({priceSeparator:e})}})),s&&!(_===F&&0===h)&&(0,r.createElement)(tr,{pageId:c,setPageId:e=>t({cartPageId:e}),labels:{title:(0,l.__)("Return to Cart button","woocommerce"),default:(0,l.__)("WooCommerce Cart Page","woocommerce")}})),(0,r.createElement)("div",{className:"wc-block-checkout__actions"},(0,r.createElement)("div",{className:"wc-block-checkout__actions_row"},s&&(0,r.createElement)(rr,{href:"#cart-page-placeholder"},(0,r.createElement)(m.RichText,{multiline:!1,allowedFormats:[],value:i,placeholder:Xo,onChange:e=>{t({returnToCartButtonLabel:e})}})),(0,r.createElement)(sr,{className:(0,n.A)("wc-block-cart__submit-button","wc-block-components-checkout-place-order-button",{"wc-block-components-checkout-place-order-button--full-width":!s}),value:a,placeholder:Jo,onChange:e=>{t({placeOrderButtonLabel:e})}},g&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("style",null,`.wp-block-woocommerce-checkout-actions-block {\n\t\t\t\t\t\t\t\t\t\t.wc-block-components-checkout-place-order-button__separator {\n\t\t\t\t\t\t\t\t\t\t\t&::after {\n\t\t\t\t\t\t\t\t\t\t\t\tcontent: "${e.priceSeparator}";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}`),(0,r.createElement)("div",{className:"wc-block-components-checkout-place-order-button__separator"}),(0,r.createElement)("div",{className:"wc-block-components-checkout-place-order-button__price"},(0,r.createElement)(Ht.FormattedMonetaryAmount,{value:u.total_price,currency:p})))))))}};(0,i.registerBlockType)("woocommerce/checkout-actions-block",lr);const mr=()=>{const{additionalFields:e}=(0,E.useSelect)((e=>({additionalFields:e(oe.CHECKOUT_STORE_KEY).getAdditionalFields()}))),{setAdditionalFields:t}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),o={...e};return 0===X.length?null:(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ht.StoreNoticesContainer,{context:ve.ORDER_INFORMATION}),(0,r.createElement)(bo,{id:"additional-information",addressType:"additional-information",onChange:e=>{t(e)},values:o,fields:X}))},dr={...Ao({defaultTitle:(0,l.__)("Additional order information","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!1,remove:!0}}};(0,i.registerBlockType)("woocommerce/checkout-additional-information-block",{attributes:dr,icon:{src:(0,r.createElement)(a.A,{icon:To.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>0===X.length?null:(0,r.createElement)($t,{setAttributes:t,attributes:e,className:(0,n.A)("wc-block-checkout__additional-information-fields",null==e?void 0:e.className)},(0,r.createElement)(mr,null)),save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});var ur=o(6465);const pr=({disabled:e,onChange:t,placeholder:o,value:n})=>{const[c,s]=(0,d.useState)(!1),[a,i]=(0,d.useState)("");return(0,r.createElement)("div",{className:"wc-block-checkout__add-note"},(0,r.createElement)(Ht.CheckboxControl,{disabled:e,label:(0,l.__)("Add a note to your order","woocommerce"),checked:c,onChange:e=>{s(e),e?n!==a&&t(a):(t(""),i(n))}}),c&&(0,r.createElement)(Ht.Textarea,{disabled:e,onTextChange:t,placeholder:o,value:n}))},hr=({className:e})=>{const{needsShipping:t}=st(),{isProcessing:o,orderNotes:c}=(0,E.useSelect)((e=>{const t=e(oe.CHECKOUT_STORE_KEY);return{isProcessing:t.isProcessing(),orderNotes:t.getOrderNotes()}})),{__internalSetOrderNotes:s}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY);return(0,r.createElement)(Ht.FormStep,{id:"order-notes",showStepNumber:!1,className:(0,n.A)("wc-block-checkout__order-notes",e),disabled:o},(0,r.createElement)(pr,{disabled:o,onChange:s,placeholder:t?(0,l.__)("Notes about your order, e.g. special notes for delivery.","woocommerce"):(0,l.__)("Notes about your order.","woocommerce"),value:c}))};o(377),o(7797),(0,i.registerBlockType)("woocommerce/checkout-order-note-block",{icon:{src:(0,r.createElement)(a.A,{icon:ur.A,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=(0,m.useBlockProps)();return(0,r.createElement)("div",{...e},(0,r.createElement)(Qt,null,(0,r.createElement)(hr,null)))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});const _r=(0,r.createElement)(c.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(8375);const gr=({children:e,className:t,screenReaderLabel:o,showSpinner:c=!1,isLoading:s=!0})=>(0,r.createElement)("div",{className:(0,n.A)(t,{"wc-block-components-loading-mask":s})},s&&c&&(0,r.createElement)(Ht.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,l.__)("Loading…","woocommerce")));o(3048);const Er=({instanceId:e,isLoading:t=!1,onSubmit:o,displayCouponForm:n=!1})=>{const[c,s]=(0,d.useState)(""),[a,i]=(0,d.useState)(n),m=`wc-block-components-totals-coupon__input-${e}`,{validationErrorId:u}=(0,E.useSelect)((t=>({validationErrorId:t(oe.VALIDATION_STORE_KEY).getValidationErrorId(e)}))),p=(0,d.useRef)(null);return(0,r.createElement)(Ht.Panel,{className:"wc-block-components-totals-coupon",initialOpen:a,hasBorder:!1,title:(0,l.__)("Add a coupon","woocommerce"),state:[a,i]},(0,r.createElement)(gr,{screenReaderLabel:(0,l.__)("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)(Ht.ValidatedTextInput,{id:m,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:(0,l.__)("Enter code","woocommerce"),value:c,ariaDescribedBy:u,onChange:e=>{s(e)},focusOnMount:!0,validateOnMount:!1,showError:!1,ref:p}),(0,r.createElement)(cr,{className:"wc-block-components-totals-coupon__button",disabled:t||!c,showSpinner:t,onClick:e=>{var t;e.preventDefault(),void 0!==o?null===(t=o(c))||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,l.__)("Apply","woocommerce"))),(0,r.createElement)(Ht.ValidationInputError,{propertyName:"coupon",elementId:e}))))};o(265);const kr={context:"summary"},wr=({cartCoupons:e=[],currency:t,isRemovingCoupon:o,removeCoupon:n,values:c})=>{const{total_discount:s,total_discount_tax:a}=c,i=parseInt(s,10),m=(0,Rt.applyCheckoutFilter)({arg:kr,filterName:"coupons",defaultValue:e});if(!i&&0===m.length)return null;const d=parseInt(a,10),u=(0,v.getSetting)("displayCartPricesIncludingTax",!1)?i+d:i;return(0,r.createElement)(Ht.TotalsItem,{className:"wc-block-components-totals-discount",currency:t,description:0!==m.length&&(0,r.createElement)(gr,{screenReaderLabel:(0,l.__)("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)(Ht.RemovableChip,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:(0,l.sprintf)(/* translators: %s Coupon code. */ /* translators: %s Coupon code. */
(0,l.__)("Coupon: %s","woocommerce"),e.label),disabled:o,onRemove:()=>{n(e.code)},radius:"large",ariaLabel:(0,l.sprintf)(/* translators: %s is a coupon code. */ /* translators: %s is a coupon code. */
(0,l.__)('Remove coupon "%s"',"woocommerce"),e.label)}))))),label:u?(0,l.__)("Discount","woocommerce"):(0,l.__)("Coupons","woocommerce"),value:u?-1*u:"-"})};o(7919);const br=({currency:e,values:t,className:o})=>{const c=(0,v.getSetting)("taxesEnabled",!0)&&(0,v.getSetting)("displayCartPricesIncludingTax",!1),{total_price:s,total_tax:a,tax_lines:i}=t,{receiveCart:m,...u}=He(),p=(0,Rt.applyCheckoutFilter)({filterName:"totalLabel",defaultValue:(0,l.__)("Total","woocommerce"),extensions:u.extensions,arg:{cart:u}}),h=(0,Rt.applyCheckoutFilter)({filterName:"totalValue",defaultValue:"<price/>",extensions:u.extensions,arg:{cart:u},validation:Rt.productPriceValidation}),_=(0,r.createElement)(Ht.FormattedMonetaryAmount,{className:"wc-block-components-totals-footer-item-tax-value",currency:e,value:parseInt(s,10)}),g=(0,d.createInterpolateElement)(h,{price:_}),E=parseInt(a,10),k=i&&i.length>0?(0,l.sprintf)(/* translators: %s is a list of tax rates */ /* translators: %s is a list of tax rates */
(0,l.__)("Including %s","woocommerce"),i.map((({name:t,price:o})=>`${(0,ar.formatPrice)(o,e)} ${t}`)).join(", ")):(0,l.__)("Including <TaxAmount/> in taxes","woocommerce");return(0,r.createElement)(Ht.TotalsItem,{className:(0,n.A)("wc-block-components-totals-footer-item",o),currency:e,label:p,value:g,description:c&&0!==E&&(0,r.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},(0,d.createInterpolateElement)(k,{TaxAmount:(0,r.createElement)(Ht.FormattedMonetaryAmount,{className:"wc-block-components-totals-footer-item-tax-value",currency:e,value:E})}))})},yr=()=>{const{shippingRates:e}=He(),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,Pe.decodeEntities)(t.filter(((e,o)=>t.indexOf(e)===o)).join(", "))):null};o(7051);const vr=(0,d.createContext)({shippingCalculatorID:"",showCalculator:!1,isShippingCalculatorOpen:!1,setIsShippingCalculatorOpen:()=>{}}),fr=({label:e=(0,l.__)("Calculate","woocommerce")})=>{const{isShippingCalculatorOpen:t,setIsShippingCalculatorOpen:o,showCalculator:n,shippingCalculatorID:c}=(0,d.useContext)(vr);return n?(0,r.createElement)(mo.$,{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":c},e):null},Cr=e=>{const t=(e=>(0,v.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,l.__)("Free","woocommerce")):t},Sr=()=>{const{shippingRates:e,shippingAddress:t}=He(),o=(0,E.useSelect)((e=>e(oe.CHECKOUT_STORE_KEY).prefersCollection())),n=o?(e=>{const t=(e||[]).flatMap((e=>e.shipping_rates)).find((e=>e.selected&&ze(e)));if((0,be.isObject)(t)&&(0,be.objectHasProp)(t,"meta_data")){const e=t.meta_data.find((e=>"pickup_address"===e.key));if((0,be.isObject)(e)&&(0,be.objectHasProp)(e,"value")&&e.value)return e.value}return""})(e):(e=>{if(0===Object.values(e).length)return null;const t=(0,be.isString)($[e.country])?(0,Pe.decodeEntities)($[e.country]):"",o=(0,be.isObject)(z[e.country])&&(0,be.isString)(z[e.country][e.state])?(0,Pe.decodeEntities)(z[e.country][e.state]):e.state,r=[];return r.push(e.postcode.toUpperCase()),r.push(e.city),r.push(o),r.push(t),r.filter(Boolean).join(", ")||null})(t),c=o?/* translators: %s location. */ /* translators: %s location. */
(0,l.__)("Collection from %s","woocommerce"):/* translators: %s location. */ /* translators: %s location. */
(0,l.__)("Delivers to %s","woocommerce"),s=!n||o?(0,l.__)("Enter address to check delivery options","woocommerce"):(0,l.__)("Change address","woocommerce");return(0,r.createElement)("div",{className:"wc-block-components-shipping-address"},n?(0,l.sprintf)(c,n)+" ":null,(0,r.createElement)(fr,{label:s}))};o(780);const Pr=({label:e=(0,l.__)("Shipping","woocommerce"),placeholder:t=null,collaterals:o=null})=>{const{cartTotals:n,shippingRates:c}=He(),s=Ge(c);return(0,r.createElement)("div",{className:"wc-block-components-totals-shipping"},(0,r.createElement)(Ht.TotalsItem,{label:e,value:s?Cr(n):t,description:(0,r.createElement)(r.Fragment,null,!!s&&(0,r.createElement)(yr,null),!!s&&(0,r.createElement)(Sr,null),o&&(0,r.createElement)("div",{className:"wc-block-components-totals-shipping__collaterals"},o)),currency:(0,ar.getCurrencyFromPriceResponse)(n)}))};var Ar=o(9813);const Nr=()=>{const{extensions:e,receiveCart:t,...o}=He(),n={extensions:e,cart:o,context:"woocommerce/checkout"};return(0,r.createElement)(Rt.ExperimentalOrderMeta.Slot,{...n})},{Fill:Tr,Slot:Rr}=(0,Rt.createSlotFill)("checkoutOrderSummaryActionArea"),xr=JSON.parse('{"xY":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"uK":{"lock":{"type":"object","default":{"remove":true}}}}'),Ir=[{attributes:xr.uK,save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(m.InnerBlocks.Content,null)),supports:xr.xY,migrate:({attributes:e})=>[e,[(0,i.createBlock)("woocommerce/checkout-order-summary-cart-items-block",{},[]),(0,i.createBlock)("woocommerce/checkout-order-summary-coupon-form-block",{},[]),(0,i.createBlock)("woocommerce/checkout-order-summary-totals-block",{},[(0,i.createBlock)("woocommerce/checkout-order-summary-subtotal-block",{},[]),(0,i.createBlock)("woocommerce/checkout-order-summary-fee-block",{},[]),(0,i.createBlock)("woocommerce/checkout-order-summary-discount-block",{},[]),(0,i.createBlock)("woocommerce/checkout-order-summary-shipping-block",{},[]),(0,i.createBlock)("woocommerce/checkout-order-summary-taxes-block",{},[])])]],isEligible:(e,t)=>!t.some((e=>"woocommerce/checkout-order-summary-totals-block"===e.name))}],Or=Ir;o(1407),(0,i.registerBlockType)("woocommerce/checkout-order-summary-block",{icon:{src:(0,r.createElement)(a.A,{icon:_r,className:"wc-block-editor-components-block-icon"})},attributes:{className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},edit:({clientId:e})=>{const t=(0,m.useBlockProps)(),{cartTotals:o}=He(),c=(0,ar.getCurrencyFromPriceResponse)(o),s=parseInt(o.total_price,10),a=Lt(Rt.innerBlockAreas.CHECKOUT_ORDER_SUMMARY),{isLarge:i}=h(),[u,p]=(0,d.useState)(!1),_=(0,d.useId)(),g=i?{}:{role:"button",onClick:()=>p(!u),"aria-expanded":u,"aria-controls":_,tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||p(!u)}},E=[["woocommerce/checkout-order-summary-cart-items-block",{},[]],["woocommerce/checkout-order-summary-coupon-form-block",{},[]],["woocommerce/checkout-order-summary-totals-block",{},[]]];return Yt({clientId:e,registeredBlocks:a,defaultTemplate:E}),(0,r.createElement)("div",{...t},(0,r.createElement)("div",{className:"wc-block-components-checkout-order-summary__title",...g},(0,r.createElement)("p",{className:"wc-block-components-checkout-order-summary__title-text",role:"heading"},(0,l.__)("Order summary","woocommerce")),!i&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ht.FormattedMonetaryAmount,{currency:c,value:s}),(0,r.createElement)(Tt.Icon,{icon:u?Ar.A:eo.A}))),(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-checkout-order-summary__content",{"is-open":u}),id:_},(0,r.createElement)(m.InnerBlocks,{allowedBlocks:a,template:E}),(0,r.createElement)("div",{className:"wc-block-components-totals-wrapper"},(0,r.createElement)(br,{currency:c,values:o})),(0,r.createElement)(Nr,null)))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(m.InnerBlocks.Content,null)),deprecated:Or});var Mr=o(8994),Br=o(4133),Fr=o(7674),Dr=o.n(Fr);const Lr=["a","b","em","i","strong","p","br"],Yr=["target","href","rel","name","download"],jr=(e,t)=>{const o=(null==t?void 0:t.tags)||Lr,r=(null==t?void 0:t.attr)||Yr;return Dr().sanitize(e,{ALLOWED_TAGS:o,ALLOWED_ATTR:r})},Vr={warning:"#F0B849",error:"#CC1818",success:"#46B450",info:"#0073AA"},Kr=({status:e="warning",...t})=>(0,r.createElement)(c.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:Vr[e],strokeWidth:"1.5"}),(0,r.createElement)("path",{d:"M13 7H11V13H13V7Z",fill:Vr[e]}),(0,r.createElement)("path",{d:"M13 15H11V17H13V15Z",fill:Vr[e]}));o(9705);const Ur=({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:jr(o)}}),n?(0,r.createElement)("span",{className:"wc-block-editor-components-external-link-card__warning"},(0,r.createElement)(a.A,{icon:(0,r.createElement)(Kr,{status:"error"})}),(0,r.createElement)("span",null,n)):null),(0,r.createElement)(Tt.VisuallyHidden,{as:"span"},/* translators: accessibility text */ /* translators: accessibility text */
(0,l.__)("(opens in a new tab)","woocommerce")),(0,r.createElement)(a.A,{icon:Br.A,className:"wc-block-editor-components-external-link-card__icon"})),Hr=window.wp.autop,qr=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),$r=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,zr=(e,t,o="&hellip;",r=!0)=>{const n=qr(e),c=n.split(" ").splice(0,t).join(" ");return c===n?r?(0,Hr.autop)(n):n:r?(0,Hr.autop)($r(c,o)):$r(c,o)},Wr=(e,t,o=!0,r="&hellip;",n=!0)=>{const c=qr(e),s=c.slice(0,t);if(s===c)return n?(0,Hr.autop)(c):c;if(o)return(0,Hr.autop)($r(s,r));const a=s.match(/([\s]+)/g),i=a?a.length:0,l=c.slice(0,t+i);return n?(0,Hr.autop)($r(l,r)):$r(l,r)};var Gr=o(1208),Zr=(o(9345),o(2900)),Jr=o(2478),Xr=o(8306);const Qr=e=>{switch(e){case"success":case"warning":case"info":case"default":return"polite";default:return"assertive"}},en=e=>{switch(e){case"success":return Zr.A;case"warning":case"info":case"error":return Jr.A;default:return Xr.A}};var tn=o(195);const on=({className:e,status:t="default",children:o,spokenMessage:c=o,onRemove:s=(()=>{}),isDismissible:i=!0,politeness:m=Qr(t),summary:u})=>(((e,t)=>{const o="string"==typeof e?e:(0,d.renderToString)(e);(0,d.useEffect)((()=>{o&&(0,tn.speak)(o,t)}),[o,t])})(c,m),(0,r.createElement)("div",{className:(0,n.A)(e,"wc-block-components-notice-banner","is-"+t,{"is-dismissible":i})},(0,r.createElement)(a.A,{icon:en(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),!!i&&(0,r.createElement)(cr,{className:"wc-block-components-notice-banner__dismiss","aria-label":(0,l.__)("Dismiss this notice","woocommerce"),onClick:e=>{"function"==typeof(null==e?void 0:e.preventDefault)&&e.preventDefault&&e.preventDefault(),s()},removeTextWrap:!0},(0,r.createElement)(a.A,{icon:Gr.A}))));o(1637);const rn=()=>(0,r.createElement)(on,{isDismissible:!1,className:"wc-block-checkout__no-payment-methods-notice",status:"error"},(0,l.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.","woocommerce")),nn=(0,r.createElement)(c.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 cn=o(4166),sn=o(3576);o(777);const an={bank:cn.A,bill:sn.A,card:Mr.A,checkPayment:nn},ln=({icon:e="",text:t=""})=>{const o=!!e,c=(0,d.useCallback)((e=>o&&(0,be.isString)(e)&&(0,be.objectHasProp)(an,e)),[o]),s=(0,n.A)("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":o});return(0,r.createElement)("span",{className:s},c(e)?(0,r.createElement)(a.A,{icon:an[e]}):e,t)},mn=e=>`wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${e}`,dn=({id:e,src:t=null,alt:o=""})=>t?(0,r.createElement)("img",{className:mn(e),src:t,alt:o}):null,un=[{id:"alipay",alt:"Alipay",src:B+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:B+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:B+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:B+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:B+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:B+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:B+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:B+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:B+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:B+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:B+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:B+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:B+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:B+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:B+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:B+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:B+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:B+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:B+"payment-methods/wechat.svg"}];o(4957);const pn=({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,be.isString)(o.id)&&!t[o.id]&&(t[o.id]=o)})),Object.values(t)})(e);if(0===c.length)return null;const s=(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:s},c.map((e=>{const t={...e,...(o=e.id,un.find((e=>e.id===o))||{})};var o;return(0,r.createElement)(dn,{key:"payment-method-icon-"+e.id,...t})})))},hn=(e="")=>{const{cartCoupons:t,cartIsLoading:o}=He(),{createErrorNotice:r}=(0,E.useDispatch)("core/notices"),{createNotice:n}=(0,E.useDispatch)("core/notices"),{setValidationErrors:c}=(0,E.useDispatch)(oe.VALIDATION_STORE_KEY),{isApplyingCoupon:s,isRemovingCoupon:a}=(0,E.useSelect)((e=>{const t=e(oe.CART_STORE_KEY);return{isApplyingCoupon:t.isApplyingCoupon(),isRemovingCoupon:t.isRemovingCoupon()}}),[r,n]),{applyCoupon:i,removeCoupon:m}=(0,E.useDispatch)(oe.CART_STORE_KEY),d=(0,E.useSelect)((e=>e(oe.CHECKOUT_STORE_KEY).getOrderId()));return{appliedCoupons:t,isLoading:o,applyCoupon:t=>i(t).then((()=>((0,Rt.applyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&n("info",(0,l.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,l.__)('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,n;return d&&d>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!==(n=r.details)&&void 0!==n&&n.cart?e.data.details.cart:e.message})(e);return c({coupon:{message:(0,Pe.decodeEntities)(t),hidden:!1}}),Promise.resolve(!1)})),removeCoupon:t=>m(t).then((()=>((0,Rt.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&n("info",(0,l.sprintf)(/* translators: %s coupon code. */ /* translators: %s coupon code. */
(0,l.__)('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:a}},gn=(e,t)=>{const o=[],r=(t,o)=>{const r=o+"_tax",n=(0,be.objectHasProp)(e,o)&&(0,be.isString)(e[o])?parseInt(e[o],10):0;return{key:o,label:t,value:n,valueWithTax:n+((0,be.objectHasProp)(e,r)&&(0,be.isString)(e[r])?parseInt(e[r],10):0)}};return o.push(r((0,l.__)("Subtotal:","woocommerce"),"total_items")),o.push(r((0,l.__)("Fees:","woocommerce"),"total_fees")),o.push(r((0,l.__)("Discount:","woocommerce"),"total_discount")),o.push({key:"total_tax",label:(0,l.__)("Taxes:","woocommerce"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&o.push(r((0,l.__)("Shipping:","woocommerce"),"total_shipping")),o},En=()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:o,onCheckoutAfterProcessingWithError:r,onSubmit:n,onCheckoutSuccess:c,onCheckoutFail:s,onCheckoutValidation:a}=wt(),{isCalculating:i,isComplete:m,isIdle:u,isProcessing:p,customerId:h}=(0,E.useSelect)((e=>{const t=e(oe.CHECKOUT_STORE_KEY);return{isComplete:t.isComplete(),isIdle:t.isIdle(),isProcessing:t.isProcessing(),customerId:t.getCustomerId(),isCalculating:t.isCalculating()}})),{paymentStatus:_,activePaymentMethod:g,shouldSavePayment:k}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY);return{paymentStatus:{get isPristine(){return ne()("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 ne()("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 ne()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()},get isSuccessful(){return ne()("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:w}=(0,E.useDispatch)(oe.PAYMENT_STORE_KEY),{onPaymentProcessing:b,onPaymentSetup:y}=(0,d.useContext)(le),{shippingErrorStatus:f,shippingErrorTypes:C,onShippingRateSuccess:S,onShippingRateFail:P,onShippingRateSelectSuccess:A,onShippingRateSelectFail:N}=dt(),{shippingRates:T,isLoadingRates:R,selectedRates:x,isSelectingRate:I,selectShippingRate:O,needsShipping:M}=st(),{billingAddress:B,shippingAddress:F}=(0,E.useSelect)((e=>e(oe.CART_STORE_KEY).getCustomerData())),{setShippingAddress:D}=(0,E.useDispatch)(oe.CART_STORE_KEY),{cartItems:L,cartFees:Y,cartTotals:j,extensions:V}=He(),{appliedCoupons:K}=hn(),U=(0,d.useRef)(gn(j,M)),H=(0,d.useRef)({label:(0,l.__)("Total","woocommerce"),value:parseInt(j.total_price,10)});(0,d.useEffect)((()=>{U.current=gn(j,M),H.current={label:(0,l.__)("Total","woocommerce"),value:parseInt(j.total_price,10)}}),[j,M]);const q=(0,d.useCallback)(((e="")=>{ne()("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"}),w(e)}),[w]);return{activePaymentMethod:g,billing:{appliedCoupons:K,billingAddress:B,billingData:B,cartTotal:H.current,cartTotalItems:U.current,currency:(0,ar.getCurrencyFromPriceResponse)(j),customerId:h,displayPricesIncludingTax:(0,v.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:L,cartFees:Y,extensions:V},checkoutStatus:{isCalculating:i,isComplete:m,isIdle:u,isProcessing:p},components:{LoadingMask:gr,PaymentMethodIcons:pn,PaymentMethodLabel:ln,ValidationInputError:Ht.ValidationInputError},emitResponse:{noticeContexts:ve,responseTypes:ye},eventRegistration:{onCheckoutAfterProcessingWithError:r,onCheckoutAfterProcessingWithSuccess:o,onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutSuccess:c,onCheckoutFail:s,onCheckoutValidation:a,onPaymentProcessing:b,onPaymentSetup:y,onShippingRateFail:P,onShippingRateSelectFail:N,onShippingRateSelectSuccess:A,onShippingRateSuccess:S},onSubmit:n,paymentStatus:_,setExpressPaymentError:q,shippingData:{isSelectingRate:I,needsShipping:M,selectedRates:x,setSelectedRates:O,setShippingAddress:D,shippingAddress:F,shippingRates:T,shippingRatesLoading:R},shippingStatus:{shippingErrorStatus:f,shippingErrorTypes:C},shouldSavePayment:k}};class kn extends d.Component{constructor(...e){super(...e),(0,O.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,l.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(o||v.CURRENT_USER_IS_ADMIN)&&(e=t||(0,l.__)("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)(Ht.StoreNoticesContainer,{additionalNotices:n,context:ve.PAYMENTS})}return this.props.children}}const wn=kn,bn=({children:e,showSaveOption:t})=>{const{isEditor:o}=w(),{shouldSavePaymentMethod:n,customerId:c}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY),o=e(oe.CHECKOUT_STORE_KEY);return{shouldSavePaymentMethod:t.getShouldSavePaymentMethod(),customerId:o.getCustomerId()}})),{__internalSetShouldSavePaymentMethod:s}=(0,E.useDispatch)(oe.PAYMENT_STORE_KEY);return(0,r.createElement)(wn,{isEditor:o},e,c>0&&t&&(0,r.createElement)(Ht.CheckboxControl,{className:"wc-block-components-payment-methods__save-card-info",label:(0,l.__)("Save payment information to my account for future purchases.","woocommerce"),checked:n,onChange:()=>s(!n)}))},yn="wc/store/payment",vn=()=>{const{activeSavedToken:e,activePaymentMethod:t,isExpressPaymentMethodActive:o,savedPaymentMethods:c,availablePaymentMethods:s}=(0,E.useSelect)((e=>{const t=e(yn);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),savedPaymentMethods:t.getSavedPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),{__internalSetActivePaymentMethod:a}=(0,E.useDispatch)(yn),i=(0,ft.getPaymentMethods)(),{...l}=En(),{removeNotice:m}=(0,E.useDispatch)("core/notices"),{dispatchCheckoutEvent:u}=ct(),{isEditor:p}=w(),h=Object.keys(s).map((e=>{const{edit:t,content:o,label:n,supports:c}=i[e],s=p?t:o;return{value:e,label:"string"==typeof n?n:(0,d.cloneElement)(n,{components:l.components}),name:`wc-saved-payment-method-token-${e}`,content:(0,r.createElement)(bn,{showSaveOption:c.showSaveOption},(0,d.cloneElement)(s,{__internalSetActivePaymentMethod:a,...l}))}})),_=(0,d.useCallback)((e=>{a(e),m("wc-payment-error",ve.PAYMENTS),u("set-active-payment-method",{value:e})}),[u,m,a]),g=0===Object.keys(c).length&&1===Object.keys(i).length,k=(0,n.A)({"disable-radio-control":g});return o?null:(0,r.createElement)(Ht.RadioControlAccordion,{highlightChecked:!0,id:"wc-payment-method-options",className:k,selected:e?null:t,onChange:_,options:h})},fn="wc/store/cart",Cn=((0,l.__)("Unable to get cart data from the API.","woocommerce"),[]),Sn=[],Pn={},An={};Object.keys(v.defaultFields).forEach((e=>{An[e]=""})),delete An.email;const Nn={};Object.keys(v.defaultFields).forEach((e=>{Nn[e]=""}));const Tn={cartItemsPendingQuantity:[],cartItemsPendingDelete:[],cartData:{coupons:[],shippingRates:[],shippingAddress:An,billingAddress:Nn,items:[],itemsCount:0,itemsWeight:0,crossSells:[],needsShipping:!0,needsPayment:!1,hasCalculatedShipping:!0,fees:[],totals:{currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"",currency_suffix:"",total_items:"0",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_price:"0",total_tax:"0",tax_lines:[]},errors:Cn,paymentMethods:[],paymentRequirements:[],extensions:Pn},metaData:{updatingCustomerData:!1,updatingSelectedRate:!1,applyingCoupon:"",removingCoupon:"",isCartDataStale:!1},errors:Sn},Rn=({method:e,expires:t})=>{var o,r,n;return(0,l.sprintf)(/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date.  */ /* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date.  */
(0,l.__)("%1$s ending in %2$s (expires %3$s)","woocommerce"),null!==(o=null!==(r=null==e?void 0:e.display_brand)&&void 0!==r?r:null==e||null===(n=e.networks)||void 0===n?void 0:n.preferred)&&void 0!==o?o:e.brand,e.last4,t)},xn=({method:e})=>e.brand&&e.last4?(0,l.sprintf)(/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */ /* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */
(0,l.__)("%1$s ending in %2$s","woocommerce"),e.brand,e.last4):(0,l.sprintf)(/* translators: %s is the name of the payment method gateway. */ /* translators: %s is the name of the payment method gateway. */
(0,l.__)("Saved token for %s","woocommerce"),e.gateway),In=()=>{var e;const{activeSavedToken:t,activePaymentMethod:o,savedPaymentMethods:n}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),savedPaymentMethods:t.getSavedPaymentMethods()}})),{__internalSetActivePaymentMethod:c}=(0,E.useDispatch)(oe.PAYMENT_STORE_KEY),s=(()=>{let e;if((0,E.select)("core/editor")){const t={cartCoupons:rt.coupons,cartItems:rt.items,crossSellsProducts:rt.cross_sells,cartFees:rt.fees,cartItemsCount:rt.items_count,cartItemsWeight:rt.items_weight,cartNeedsPayment:rt.needs_payment,cartNeedsShipping:rt.needs_shipping,cartItemErrors:Cn,cartTotals:rt.totals,cartIsLoading:!1,cartErrors:Sn,billingData:Tn.cartData.billingAddress,billingAddress:Tn.cartData.billingAddress,shippingAddress:Tn.cartData.shippingAddress,extensions:Pn,shippingRates:rt.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:rt.has_calculated_shipping,paymentRequirements:rt.payment_requirements,receiveCart:()=>{}};e={cart:t,cartTotals:t.cartTotals,cartNeedsShipping:t.cartNeedsShipping,billingData:t.billingAddress,billingAddress:t.billingAddress,shippingAddress:t.shippingAddress,selectedShippingMethods:Ze(t.shippingRates),paymentMethods:rt.payment_methods,paymentRequirements:t.paymentRequirements}}else{const t=(0,E.select)(fn),o=t.getCartData(),r=t.getCartErrors(),n=t.getCartTotals(),c=!t.hasFinishedResolution("getCartData"),s=t.isCustomerDataUpdating(),a=Ze(o.shippingRates);e={cart:{cartCoupons:o.coupons,cartItems:o.items,crossSellsProducts:o.crossSells,cartFees:o.fees,cartItemsCount:o.itemsCount,cartItemsWeight:o.itemsWeight,cartNeedsPayment:o.needsPayment,cartNeedsShipping:o.needsShipping,cartItemErrors:o.errors,cartTotals:n,cartIsLoading:c,cartErrors:r,billingData:Ie(o.billingAddress),billingAddress:Ie(o.billingAddress),shippingAddress:Ie(o.shippingAddress),extensions:o.extensions,shippingRates:o.shippingRates,isLoadingRates:s,cartHasCalculatedShipping:o.hasCalculatedShipping,paymentRequirements:o.paymentRequirements,receiveCart:(0,E.dispatch)(fn).receiveCart},cartTotals:o.totals,cartNeedsShipping:o.needsShipping,billingData:o.billingAddress,billingAddress:o.billingAddress,shippingAddress:o.shippingAddress,selectedShippingMethods:a,paymentMethods:o.paymentMethods,paymentRequirements:o.paymentRequirements}}return e})(),a=(0,ft.getPaymentMethods)(),i=En(),{removeNotice:l}=(0,E.useDispatch)("core/notices"),{dispatchCheckoutEvent:m}=ct(),u=(0,d.useMemo)((()=>{const e=Object.keys(n),t=new Set(e.flatMap((e=>n[e].map((e=>e.method.gateway))))),o=Array.from(t).filter((e=>{var t;return null===(t=a[e])||void 0===t?void 0:t.canMakePayment(s)}));return e.flatMap((e=>n[e].map((t=>{if(!o.includes(t.method.gateway))return;const r="cc"===e||"echeck"===e,n=t.method.gateway;return{name:`wc-saved-payment-method-token-${n}`,label:r?Rn(t):xn(t),value:t.tokenId.toString(),onChange:e=>{c(n,{token:e,payment_method:n,[`wc-${n}-payment-token`]:e.toString(),isSavedToken:!0}),l("wc-payment-error",ve.PAYMENTS),m("set-active-payment-method",{paymentMethodSlug:n})}}})))).filter((e=>void 0!==e))}),[n,a,c,l,m,s]),p=t&&a[o]&&void 0!==(null===(e=a[o])||void 0===e?void 0:e.savedTokenComponent)&&!(0,be.isNull)(a[o].savedTokenComponent)?(0,d.cloneElement)(a[o].savedTokenComponent,{token:t,...i}):null;return u.length>0?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ht.RadioControl,{highlightChecked:!0,id:"wc-payment-method-saved-tokens",selected:t,options:u,onChange:()=>{}}),p):null};o(181);const On=({noPaymentMethods:e=(0,r.createElement)(rn,null)})=>{const{paymentMethodsInitialized:t,availablePaymentMethods:o,savedPaymentMethods:n}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),availablePaymentMethods:t.getAvailablePaymentMethods(),savedPaymentMethods:t.getSavedPaymentMethods()}}));return t&&0===Object.keys(o).length?e:(0,r.createElement)(r.Fragment,null,(0,r.createElement)(In,null),Object.keys(n).length>0&&(0,r.createElement)(Ht.Label,{label:(0,l.__)("Use another payment method.","woocommerce"),screenReaderLabel:(0,l.__)("Other available payment methods","woocommerce"),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),(0,r.createElement)(vn,null))},Mn=({noPaymentMethods:e})=>(0,r.createElement)(On,{noPaymentMethods:e});var Bn=o(433),Fn=o(2181);const Dn=({label:e,description:t,buttonLabel:o,buttonHref:n,icon:c=Bn.A})=>(0,r.createElement)(Tt.Placeholder,{icon:(0,r.createElement)(a.A,{icon:c}),label:e,className:"wc-block-checkout__configure-placeholder"},(0,r.createElement)("span",{className:"wc-block-checkout__configure-placeholder-description"},t),(0,r.createElement)(Tt.Button,{variant:"primary",href:n,target:"_blank",rel:"noopener noreferrer",style:{backgroundColor:Fn.T.fN,color:Fn.T.c,pointerEvents:"all"}},o)),Ln={...Ao({defaultTitle:(0,l.__)("Payment options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};(0,i.registerBlockType)("woocommerce/checkout-payment-block",{icon:{src:(0,r.createElement)(a.A,{icon:Mr.A,className:"wc-block-editor-components-block-icon"})},attributes:Ln,edit:({attributes:e,setAttributes:t})=>{const o=(0,v.getSetting)("globalPaymentMethods"),{incompatiblePaymentMethods:c}=(0,E.useSelect)((e=>{const{getIncompatiblePaymentMethods:t}=e(oe.PAYMENT_STORE_KEY);return{incompatiblePaymentMethods:t()}}),[]),s=(0,l.__)("Incompatible with block-based checkout","woocommerce"),a=M.wordCountType;return(0,r.createElement)($t,{attributes:e,setAttributes:t,className:(0,n.A)("wc-block-checkout__payment-method",null==e?void 0:e.className)},(0,r.createElement)(m.InspectorControls,null,o.length>0&&(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Methods","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("You currently have the following payment integrations active.","woocommerce")),o.map((e=>{const t=!!c[e.id];let o;return o="words"===a?zr(e.description,30,void 0,!1):Wr(e.description,30,"characters_including_spaces"===a,void 0,!1),(0,r.createElement)(Ur,{key:e.id,href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=checkout&section=${e.id}`,title:e.title,description:o,...t?{warning:s}:{}})})),(0,r.createElement)(Tt.ExternalLink,{href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=checkout`},(0,l.__)("Manage payment methods","woocommerce")))),(0,r.createElement)(Qt,null,(0,r.createElement)(Mn,{noPaymentMethods:(0,r.createElement)(Dn,{icon:Mr.A,label:(0,l.__)("Payment options","woocommerce"),description:(0,l.__)("Your store does not have any payment methods that support the Checkout block. Once you have configured a compatible payment method it will be displayed here.","woocommerce"),buttonLabel:(0,l.__)("Configure Payment Options","woocommerce"),buttonHref:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=checkout`})})),(0,r.createElement)(zt,{block:Rt.innerBlockAreas.PAYMENT_METHODS}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(Wt,null))});const Yn=(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"})),jn=()=>((e=!1)=>{const{paymentMethodsInitialized:t,expressPaymentMethodsInitialized:o,availablePaymentMethods:r,availableExpressPaymentMethods:n}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}})),c=Object.values(r).map((({name:e})=>e)),s=Object.values(n).map((({name:e})=>e)),a=(0,ft.getPaymentMethods)(),i=(0,ft.getExpressPaymentMethods)(),l=Object.keys(a).reduce(((e,t)=>(c.includes(t)&&(e[t]=a[t]),e)),{}),m=Object.keys(i).reduce(((e,t)=>(s.includes(t)&&(e[t]=i[t]),e)),{}),d=lo(l),u=lo(m);return{paymentMethods:e?u:d,isInitialized:e?o:t}})(!0),Vn=["height","borderRadius"],Kn=e=>{const t=(0,E.select)(oe.PAYMENT_STORE_KEY).getAvailableExpressPaymentMethods();return Object.values(t).reduce(((t,o)=>t||(null==o?void 0:o.supportsStyle.some((t=>e.includes(t))))),!1)},Un=({attributes:e,setAttributes:t})=>{const{buttonHeight:o,buttonBorderRadius:n}=e;return(0,r.createElement)(r.Fragment,null,Kn(["height"])&&(0,r.createElement)(Tt.RadioControl,{label:(0,l.__)("Button height","woocommerce"),selected:o,options:[{label:(0,l.__)("Small (40px)","woocommerce"),value:"40"},{label:(0,l.__)("Medium (48px)","woocommerce"),value:"48"},{label:(0,l.__)("Large (55px)","woocommerce"),value:"55"}],onChange:e=>t({buttonHeight:e})}),Kn(["borderRadius"])&&(0,r.createElement)("div",{className:"border-radius-control-container"},(0,r.createElement)(m.HeightControl,{label:(0,l.__)("Button border radius","woocommerce"),value:n,onChange:e=>{const o=e.replace("px","");t({buttonBorderRadius:o})}})))},Hn=({attributes:e,setAttributes:t})=>e.showButtonStyles?(0,r.createElement)(Un,{attributes:e,setAttributes:t}):null,qn=()=>{const e=(0,E.select)(oe.PAYMENT_STORE_KEY).getAvailableExpressPaymentMethods();return Object.entries(e).length<1?(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("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,l.__)("You currently have the following express payment integrations active.","woocommerce")),Object.values(e).map((e=>(0,r.createElement)(Ur,{key:e.name,href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=checkout&section=${encodeURIComponent(e.gatewayId)}`,title:e.title,description:e.description}))))},$n=(0,r.createElement)(r.Fragment,null,(0,l.__)("Apply uniform styles","woocommerce")," ",(0,r.createElement)("span",{className:"express-payment-styles-beta-badge"},"Beta")),zn=({attributes:e,setAttributes:t})=>(0,r.createElement)(m.InspectorControls,null,Kn(Vn)&&(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Button Settings","woocommerce"),className:"express-payment-button-settings"},(0,r.createElement)(Tt.ToggleControl,{label:$n,checked:e.showButtonStyles,onChange:()=>t({showButtonStyles:!e.showButtonStyles}),help:(0,l.__)("Sets a consistent style for express payment buttons.","woocommerce")}),(0,r.createElement)(Tt.Notice,{status:"warning",isDismissible:!1,className:"wc-block-checkout__notice express-payment-styles-notice"},(0,r.createElement)("strong",null,(0,l.__)("Note","woocommerce"),":")," ",(0,l.__)("Some payment methods might not yet support all style controls","woocommerce")),(0,r.createElement)(Hn,{attributes:e,setAttributes:t})),(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Express Payment Methods","woocommerce")},(0,r.createElement)(qn,null))),Wn=(0,d.createContext)({showButtonStyles:!1,buttonHeight:"48",buttonBorderRadius:"4"}),Gn=()=>{const{isEditor:e}=w(),{showButtonStyles:t,buttonHeight:o,buttonBorderRadius:n}=(0,d.useContext)(Wn),c=t?{height:o,borderRadius:n}:void 0,{activePaymentMethod:s,paymentMethodData:a}=(0,E.useSelect)((e=>{const t=e(yn);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData()}})),{__internalSetActivePaymentMethod:i,__internalSetExpressPaymentStarted:m,__internalSetPaymentIdle:u,__internalSetPaymentError:p,__internalSetPaymentMethodData:h,__internalSetExpressPaymentError:_}=(0,E.useDispatch)(yn),{paymentMethods:g}=jn(),k=En(),b=(0,d.useRef)(s),y=(0,d.useRef)(a),v=(0,d.useCallback)((e=>()=>{b.current=s,y.current=a,m(),i(e)}),[s,a,i,m]),f=(0,d.useCallback)((()=>{u(),i(b.current,y.current)}),[i,u]),C=(0,d.useCallback)((e=>{p(),h(e),_(e),i(b.current,y.current)}),[i,p,h,_]),S=(0,d.useCallback)(((e="")=>{ne()("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?C(e):_("")}),[_,C]),P=Object.entries(g),A=P.length>0?P.map((([t,o])=>{const n=e?o.edit:o.content;return(0,d.isValidElement)(n)?(0,r.createElement)("li",{key:t,id:`express-payment-method-${t}`},(0,d.cloneElement)(n,{...k,onClick:v(t),onClose:f,onError:C,setExpressPaymentError:S,buttonAttributes:c})):null})):(0,r.createElement)("li",{key:"noneRegistered"},(0,l.__)("No registered Payment Methods","woocommerce"));return(0,r.createElement)(wn,{isEditor:e},(0,r.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},A))};o(9569);const Zn=()=>{const{isCalculating:e,isProcessing:t,isAfterProcessing:o,isBeforeProcessing:n,isComplete:c,hasError:s}=(0,E.useSelect)((e=>{const t=e(oe.CHECKOUT_STORE_KEY);return{isCalculating:t.isCalculating(),isProcessing:t.isProcessing(),isAfterProcessing:t.isAfterProcessing(),isBeforeProcessing:t.isBeforeProcessing(),isComplete:t.isComplete(),hasError:t.hasError()}})),{availableExpressPaymentMethods:a,expressPaymentMethodsInitialized:i,isExpressPaymentMethodActive:m}=(0,E.useSelect)((e=>{const t=e(oe.PAYMENT_STORE_KEY);return{availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive()}})),{isEditor:d}=w();if(!i||i&&0===Object.keys(a).length)return d||v.CURRENT_USER_IS_ADMIN?(0,r.createElement)(Ht.StoreNoticesContainer,{context:ve.EXPRESS_PAYMENTS}):null;const u=t||o||n||c&&!s;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(gr,{isLoading:e||u||m},(0,r.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--checkout"},(0,r.createElement)("div",{className:"wc-block-components-express-payment__title-container"},(0,r.createElement)(Ht.Title,{className:"wc-block-components-express-payment__title",headingLevel:"2"},(0,l.__)("Express Checkout","woocommerce"))),(0,r.createElement)("div",{className:"wc-block-components-express-payment__content"},(0,r.createElement)(Ht.StoreNoticesContainer,{context:ve.EXPRESS_PAYMENTS}),(0,r.createElement)(Gn,null)))),(0,r.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout"},(0,l.__)("Or continue below","woocommerce")))},Jn=({className:e})=>{const{cartNeedsPayment:t}=He();return t?(0,r.createElement)("div",{className:e},(0,r.createElement)(Zn,null)):null};o(9865),(0,i.registerBlockType)("woocommerce/checkout-express-payment-block",{icon:{src:(0,r.createElement)(a.A,{style:{fill:"none"},icon:Yn,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{paymentMethods:o,isInitialized:c}=jn(),s=Object.keys(o).length>0,a=(0,m.useBlockProps)({className:(0,n.A)({"wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods":s},null==e?void 0:e.className),attributes:e});if(!c||!s)return null;const{buttonHeight:i,buttonBorderRadius:l,showButtonStyles:d}=e;return(0,r.createElement)("div",{...a},(0,r.createElement)(zn,{attributes:e,setAttributes:t}),(0,r.createElement)(Wn.Provider,{value:{showButtonStyles:d,buttonHeight:i,buttonBorderRadius:l}},(0,r.createElement)(Jn,null)))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});var Xn=o(1176),Qn=o(3705);const ec=({minRate:e,maxRate:t,multiple:o=!1})=>{if(void 0===e||void 0===t)return null;const n=(0,v.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10),c=(0,v.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(t.price,10)+parseInt(t.taxes,10):parseInt(t.price,10),s=0===n?(0,r.createElement)("em",null,(0,l.__)("free","woocommerce")):(0,r.createElement)(Ht.FormattedMonetaryAmount,{currency:(0,ar.getCurrencyFromPriceResponse)(e),value:n});return(0,r.createElement)("span",{className:"wc-block-checkout__shipping-method-option-price"},n!==c||o?(0,d.createInterpolateElement)(0===n&&0===c?"<price />":(0,l.__)("from <price />","woocommerce"),{price:s}):s)};function tc(e){return e?{min:e.reduce(((e,t)=>We(t.method_id)?e:void 0===e||parseInt(t.price,10)<parseInt(e.price,10)?t:e),void 0),max:e.reduce(((e,t)=>We(t.method_id)?e:void 0===e||parseInt(t.price,10)>parseInt(e.price,10)?t:e),void 0)}:{min:void 0,max:void 0}}function oc(e){return e?{min:e.reduce(((e,t)=>We(t.method_id)&&(void 0===e||t.price<e.price)?t:e),void 0),max:e.reduce(((e,t)=>We(t.method_id)&&(void 0===e||t.price>e.price)?t:e),void 0)}:{min:void 0,max:void 0}}o(7694);const rc=(0,l.__)("Pickup","woocommerce"),nc=(0,l.__)("Ship","woocommerce"),cc=({checked:e,rate:t,showPrice:o,showIcon:c,toggleText:s,setAttributes:i,onClick:l})=>(0,r.createElement)(mo.$,{render:(0,r.createElement)("div",null),className:(0,n.A)("wc-block-checkout__shipping-method-option",{"wc-block-checkout__shipping-method-option--selected":"pickup"===e}),onClick:l},!0===c&&(0,r.createElement)(a.A,{icon:Qn.A,size:28,className:"wc-block-checkout__shipping-method-option-icon"}),(0,r.createElement)(m.RichText,{value:s,placeholder:rc,tagName:"span",className:"wc-block-checkout__shipping-method-option-title",onChange:e=>i({localPickupText:e}),__unstableDisableFormats:!0,preserveWhiteSpace:!0}),!0===o&&(0,r.createElement)(ec,{minRate:t.min,maxRate:t.max})),sc=({checked:e,rate:t,showPrice:o,showIcon:c,toggleText:s,setAttributes:i,onClick:d})=>{const u=void 0===t.min?(0,r.createElement)("span",{className:"wc-block-checkout__shipping-method-option-price"},(0,l.__)("calculated with an address","woocommerce")):(0,r.createElement)(ec,{minRate:t.min,maxRate:t.max});return(0,r.createElement)(mo.$,{render:(0,r.createElement)("div",null),className:(0,n.A)("wc-block-checkout__shipping-method-option",{"wc-block-checkout__shipping-method-option--selected":"shipping"===e}),onClick:d},!0===c&&(0,r.createElement)(a.A,{icon:Xn.A,size:28,className:"wc-block-checkout__shipping-method-option-icon"}),(0,r.createElement)(m.RichText,{value:s,placeholder:nc,tagName:"span",className:"wc-block-checkout__shipping-method-option-title",onChange:e=>i({shippingText:e}),__unstableDisableFormats:!0,preserveWhiteSpace:!0}),!0===o&&u)},ac={...Ao({defaultTitle:(0,l.__)("Delivery","woocommerce"),defaultDescription:(0,l.__)("Select how you would like to receive your order.","woocommerce")}),className:{type:"string",default:""},showIcon:{type:"boolean",default:!0},showPrice:{type:"boolean",default:!1},localPickupText:{type:"string",default:rc},shippingText:{type:"string",default:nc},lock:{type:"object",default:{move:!0,remove:!0}}};(0,i.registerBlockType)("woocommerce/checkout-shipping-method-block",{icon:{src:(0,r.createElement)(a.A,{icon:Xn.A,className:"wc-block-editor-components-block-icon"})},attributes:ac,edit:({attributes:e,setAttributes:t})=>{var o,c;(0,d.useEffect)((()=>{const o=(0,v.getSetting)("localPickupText",e.localPickupText);t({localPickupText:o})}),[t]);const{setPrefersCollection:s}=(0,E.useDispatch)(oe.CHECKOUT_STORE_KEY),{prefersCollection:a}=(0,E.useSelect)((e=>({prefersCollection:e(oe.CHECKOUT_STORE_KEY).prefersCollection()}))),{showPrice:i,showIcon:u,className:p,localPickupText:h,shippingText:_}=e,{shippingRates:g,needsShipping:k,hasCalculatedShipping:w,isCollectable:b}=st();if(!(k&&w&&g&&b&&V))return null;const y=e=>{s("pickup"===e)};return(0,r.createElement)($t,{attributes:e,setAttributes:t,className:(0,n.A)("wc-block-checkout__shipping-method",p)},(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Appearance","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("Choose how this block is displayed to your customers.","woocommerce")),(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Show icon","woocommerce"),checked:u,onChange:()=>t({showIcon:!u})}),(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Show costs","woocommerce"),checked:i,onChange:()=>t({showPrice:!i})})),(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Shipping Methods","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("Methods can be made managed in your store settings.","woocommerce")),(0,r.createElement)(Ur,{key:"shipping_methods",href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=shipping`,title:(0,l.__)("Shipping","woocommerce"),description:(0,l.__)("Manage your shipping zones, methods, and rates.","woocommerce")}),(0,r.createElement)(Ur,{key:"pickup_location",href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&section=pickup_location`,title:(0,l.__)("Pickup","woocommerce"),description:(0,l.__)("Allow customers to choose a local pickup location during checkout.","woocommerce")}))),(0,r.createElement)("div",{id:"shipping-method",className:"wc-block-checkout__shipping-method-container",role:"radiogroup"},(0,r.createElement)(sc,{checked:a?"pickup":"shipping",rate:tc(null===(o=g[0])||void 0===o?void 0:o.shipping_rates),onClick:()=>{y("shipping")},showPrice:i,showIcon:u,setAttributes:t,toggleText:_}),(0,r.createElement)(cc,{checked:a?"pickup":"shipping",rate:oc(null===(c=g[0])||void 0===c?void 0:c.shipping_rates),showPrice:i,onClick:()=>{y("pickup")},showIcon:u,setAttributes:t,toggleText:h})),(0,r.createElement)(zt,{block:Rt.innerBlockAreas.SHIPPING_METHOD}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(Wt,null))});const ic=e=>{const t=(0,v.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)(Ht.FormattedMonetaryAmount,{currency:(0,ar.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,(0,Pe.decodeEntities)(e.delivery_time));return 0===t&&(o=(0,r.createElement)("span",{className:"wc-block-components-shipping-rates-control__package__description--free"},(0,l.__)("Free","woocommerce"))),{label:(0,Pe.decodeEntities)(e.name),value:e.rate_id,description:o}},lc=({className:e="",noResultsMessage:t,onSelectRate:o,rates:n,renderOption:c=ic,selectedRate:s,disabled:a=!1,highlightChecked:i=!1})=>{const l=(null==s?void 0:s.rate_id)||"",m=pt(l),[u,p]=(0,d.useState)(null!=l?l:"");return(0,d.useEffect)((()=>{l&&l!==m&&l!==u&&p(l)}),[l,u,m]),(0,d.useEffect)((()=>{!u&&n.length>0&&(p(n[0].rate_id),o(n[0].rate_id))}),[o,n,u]),0===n.length?t:(0,r.createElement)(Ht.RadioControl,{className:e,onChange:e=>{p(e),o(e)},highlightChecked:i,disabled:a,selected:u,options:n.map(c)})};o(2867);const mc=({packageId:e,className:t="",noResultsMessage:o,renderOption:c,packageData:s,collapsible:a,showItems:i,highlightChecked:m=!1})=>{var u;const{selectShippingRate:p,isSelectingRate:h}=st(),_=(0,E.useSelect)((e=>{var t,o,r;return null===(t=e(oe.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:_,k=null!=a?a:_,w=(0,r.createElement)(r.Fragment,null,(k||g)&&(0,r.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title",dangerouslySetInnerHTML:{__html:jr(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,Pe.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)(Ht.Label,{label:o>1?`${t} × ${o}`:`${t}`,screenReaderLabel:(0,l.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,l._n)("%1$s (%2$d unit)","%1$s (%2$d units)",o,"woocommerce"),t,o)}))})))),b=(0,d.useCallback)((t=>{p(t,e)}),[e,p]),y={className:t,noResultsMessage:o,rates:s.shipping_rates,onSelectRate:b,selectedRate:s.shipping_rates.find((e=>e.selected)),renderOption:c,disabled:h,highlightChecked:m},v=(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 k?(0,r.createElement)(Ht.Panel,{className:(0,n.A)("wc-block-components-shipping-rates-control__package",t,{"wc-block-components-shipping-rates-control__package--disabled":h}),initialOpen:!1,title:w},(0,r.createElement)(lc,{...y})):(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-shipping-rates-control__package",t,{"wc-block-components-shipping-rates-control__package--disabled":h,"wc-block-components-shipping-rates-control__package--first-selected":!h&&0===v,"wc-block-components-shipping-rates-control__package--last-selected":!h&&v===(null==s||null===(u=s.shipping_rates)||void 0===u?void 0:u.length)-1})},w,(0,r.createElement)(lc,{...y}))},dc=({packages:e,showItems:t,collapsible:o,noResultsMessage:n,renderOption:c,context:s=""})=>e.length?(0,r.createElement)(r.Fragment,null,e.map((({package_id:e,...a})=>(0,r.createElement)(mc,{highlightChecked:"woocommerce/cart"!==s,key:e,packageId:e,packageData:a,collapsible:o,showItems:t,noResultsMessage:n,renderOption:c})))):null,uc=({shippingRates:e,isLoadingRates:t,className:o,collapsible:n,showItems:c,noResultsMessage:s,renderOption:a,context:i})=>{(0,d.useEffect)((()=>{var o,r;t||(o=qe(e),r=(e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0))(e),1===o?(0,tn.speak)((0,l.sprintf)(/* translators: %d number of shipping options found. */ /* translators: %d number of shipping options found. */
(0,l._n)("%d shipping option was found.","%d shipping options were found.",r,"woocommerce"),r)):(0,tn.speak)((0,l.sprintf)(/* translators: %d number of shipping packages packages. */ /* translators: %d number of shipping packages packages. */
(0,l._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",o,"woocommerce"),o)+" "+(0,l.sprintf)(/* translators: %d number of shipping options available. */ /* translators: %d number of shipping options available. */
(0,l._n)("%d shipping option was found","%d shipping options were found",r,"woocommerce"),r)))}),[t,e]);const{extensions:m,receiveCart:u,...p}=He(),h={className:o,collapsible:n,showItems:c,noResultsMessage:s,renderOption:a,extensions:m,cart:p,components:{ShippingRatesControlPackage:mc},context:i},{isEditor:_}=w(),{hasSelectedLocalPickup:g,selectedRates:E}=st(),k=(0,be.isObject)(E)?Object.values(E):[],b=k.every((e=>e===k[0]));return(0,r.createElement)(gr,{isLoading:t,screenReaderLabel:(0,l.__)("Loading shipping rates…","woocommerce"),showSpinner:!0},g&&"woocommerce/cart"===i&&e.length>1&&!b&&!_&&(0,r.createElement)(on,{className:"wc-block-components-notice",isDismissible:!1,status:"warning"},(0,l.__)("Multiple shipments must have the same pickup location","woocommerce")),(0,r.createElement)(Rt.ExperimentalOrderShippingPackages.Slot,{...h}),(0,r.createElement)(Rt.ExperimentalOrderShippingPackages,null,(0,r.createElement)(dc,{packages:e,noResultsMessage:s,renderOption:a})))},pc=e=>{const t=(0,v.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10),o=0===t?(0,r.createElement)("span",{className:"wc-block-checkout__shipping-option--free"},(0,l.__)("Free","woocommerce")):(0,r.createElement)(Ht.FormattedMonetaryAmount,{currency:(0,ar.getCurrencyFromPriceResponse)(e),value:t});return{label:(0,Pe.decodeEntities)(e.name),value:e.rate_id,description:(0,Pe.decodeEntities)(e.description),secondaryLabel:o,secondaryDescription:(0,Pe.decodeEntities)(e.delivery_time)}},hc=()=>(0,r.createElement)("p",{role:"status","aria-live":"polite",className:"wc-block-components-shipping-rates-control__no-shipping-address-message"},(0,l.__)("Enter a shipping address to view shipping options.","woocommerce")),_c=({noShippingPlaceholder:e=null})=>{const{isEditor:t}=w(),{shippingRates:o,needsShipping:n,isLoadingRates:c,hasCalculatedShipping:s,isCollectable:a}=st(),{shippingAddress:i}=Kt(),m=(0,d.useMemo)((()=>a?o.map((e=>({...e,shipping_rates:e.shipping_rates.filter((e=>!We(e.method_id)))}))):o),[o,a]);if(!n)return null;const u=qe(o);if(!s&&!u)return(0,r.createElement)(hc,null);const p=Oe(i);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ht.StoreNoticesContainer,{context:ve.SHIPPING_METHODS}),t&&!u?e:(0,r.createElement)(uc,{noResultsMessage:(0,r.createElement)(r.Fragment,null,p?(0,r.createElement)(on,{isDismissible:!1,className:"wc-block-components-shipping-rates-control__no-results-notice",status:"warning"},(0,l.__)("No shipping options are available for this address. Please verify the address is correct or try a different address.","woocommerce")):(0,r.createElement)(hc,null)),renderOption:pc,collapsible:!1,shippingRates:m,isLoadingRates:c,context:"woocommerce/checkout"}))};o(2255);const gc={...Ao({defaultTitle:(0,l.__)("Shipping options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};o(1299),(0,i.registerBlockType)("woocommerce/checkout-shipping-methods-block",{icon:{src:(0,r.createElement)(a.A,{icon:Xn.A,className:"wc-block-editor-components-block-icon"})},attributes:gc,edit:({attributes:e,setAttributes:t})=>{const o=(0,v.getSetting)("globalShippingMethods"),c=(0,v.getSetting)("activeShippingZones"),{showShippingMethods:s}=Ut();return s?(0,r.createElement)($t,{attributes:e,setAttributes:t,className:(0,n.A)("wc-block-checkout__shipping-option",null==e?void 0:e.className)},(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Shipping Calculations","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("Options that control shipping can be managed in your store settings.","woocommerce")),(0,r.createElement)(Tt.ExternalLink,{href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&section=options`},(0,l.__)("Manage shipping options","woocommerce"))," "),o.length>0&&(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Methods","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("The following shipping integrations are active on your store.","woocommerce")),o.map((e=>(0,r.createElement)(Ur,{key:e.id,href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&section=${e.id}`,title:e.title,description:e.description}))),(0,r.createElement)(Tt.ExternalLink,{href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=shipping`},(0,l.__)("Manage shipping methods","woocommerce"))),c.length&&(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Shipping Zones","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("Shipping Zones can be made managed in your store settings.","woocommerce")),c.map((e=>(0,r.createElement)(Ur,{key:e.id,href:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&zone_id=${e.id}`,title:e.title,description:e.description}))))),(0,r.createElement)(Qt,null,(0,r.createElement)(_c,{noShippingPlaceholder:(0,r.createElement)(Dn,{icon:Xn.A,label:(0,l.__)("Shipping options","woocommerce"),description:(0,l.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.","woocommerce"),buttonLabel:(0,l.__)("Configure Shipping Options","woocommerce"),buttonHref:`${v.ADMIN_URL}admin.php?page=wc-settings&tab=shipping`})})),(0,r.createElement)(zt,{block:Rt.innerBlockAreas.SHIPPING_METHODS})):null},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(Wt,null))});const Ec=({title:e,setSelectedOption:t,selectedOption:o,pickupLocations:n,onSelectRate:c,renderPickupLocation:s,packageCount:a})=>{const i=(0,E.useSelect)((e=>{var t,o,r;return null===(t=e(oe.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-local-pickup-select .wc-block-components-radio-control").length>1;return(0,r.createElement)("div",{className:"wc-block-components-local-pickup-select"},!(!i||!e)&&(0,r.createElement)("div",null,e),(0,r.createElement)(Ht.RadioControl,{onChange:e=>{t(e),c(e)},highlightChecked:!0,selected:o,options:n.map((e=>s(e,a)))}))};function kc(e){let t,o,r,n=[];for(let c=0;c<e.length;c++)t=e.substring(c),o=t.match(/^&[a-z0-9#]+;/),o?(r=o[0],n.push(r),c+=r.length-1):n.push(e[c]);return n}const wc=(e,t,o="...")=>{const r=function(e,t){const o=(t=t||{}).limit||100,r=void 0===t.preserveTags||t.preserveTags,n=void 0!==t.wordBreak&&t.wordBreak,c=t.suffix||"...",s=t.moreLink||"",a=t.moreText||"»",i=t.preserveWhiteSpace||!1,l=e.replace(/</g,"\n<").replace(/>/g,">\n").replace(/\n\n/g,"\n").replace(/^\n/g,"").replace(/\n$/g,"").split("\n");let m,d,u,p,h,_,g=0,E=[],k=!1;for(let e=0;e<l.length;e++){if(m=l[e],p=i?m:m.replace(/[ ]+/g," "),!m.length)continue;const t=kc(p);if("<"!==m[0])if(g>=o)m="";else if(g+t.length>=o){if(d=o-g," "===t[d-1])for(;d&&(d-=1," "===t[d-1]););else u=t.slice(d).indexOf(" "),n||(-1!==u?d+=u:d=m.length);m=t.slice(0,d).join("")+c,s&&(m+='<a href="'+s+'" style="display:inline">'+a+"</a>"),g=o,k=!0}else g+=t.length;else if(r){if(g>=o)if(h=m.match(/[a-zA-Z]+/),_=h?h[0]:"",_)if("</"!==m.substring(0,2))E.push(_),m="";else{for(;E[E.length-1]!==_&&E.length;)E.pop();E.length&&(m=""),E.pop()}else m=""}else m="";l[e]=m}return{html:l.join("\n").replace(/\n/g,""),more:k}}(e,{suffix:o,limit:t});return r.html},bc=(e,t,o)=>(t<=o?e.start=e.middle+1:e.end=e.middle-1,e),yc=(e,t,o,r)=>{const n=((e,t,o)=>{let r={start:0,middle:0,end:e.length};for(;r.start<=r.end;)r.middle=Math.floor((r.start+r.end)/2),t.innerHTML=wc(e,r.middle),r=bc(r,t.clientHeight,o);return r.middle})(e,t,o);return wc(e,n-r.length,r)},vc={className:"read-more-content",ellipsis:"&hellip;",lessText:(0,l.__)("Read less","woocommerce"),maxLines:3,moreText:(0,l.__)("Read more","woocommerce")};class fc extends d.Component{constructor(e){super(e),(0,O.A)(this,"reviewSummary",void 0),(0,O.A)(this,"reviewContent",void 0),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=(0,d.createRef)(),this.reviewSummary=(0,d.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const o=(this.reviewSummary.current.clientHeight+1)*e+1,r=this.reviewContent.current.clientHeight+1>o;this.setState({clampEnabled:r}),r&&this.setState({summary:yc(this.reviewContent.current.innerHTML,this.reviewSummary.current,o,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:o,moreText:n}=this.props,c=e?o:n;if(c)return(0,r.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:o,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?(0,r.createElement)("div",{className:e},(0,r.createElement)("div",{ref:this.reviewContent},t)):(0,r.createElement)("div",{className:e},(!c||null===n)&&(0,r.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:o}}),(c||null===n)&&(0,r.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}(0,O.A)(fc,"defaultProps",vc);const Cc=fc,Sc=(e,t)=>{const o=(0,v.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):e.price,n=(e=>{if(null!=e&&e.meta_data){const t=e.meta_data.find((e=>"pickup_location"===e.key));return t?t.value:""}return""})(e),c=(e=>{if(null!=e&&e.meta_data){const t=e.meta_data.find((e=>"pickup_address"===e.key));return t?t.value:""}return""})(e),s=(e=>{if(null!=e&&e.meta_data){const t=e.meta_data.find((e=>"pickup_details"===e.key));return t?t.value:""}return""})(e);let i=(0,r.createElement)("em",null,(0,l.__)("free","woocommerce"));return parseInt(o,10)>0&&(i=1===t?(0,r.createElement)(Ht.FormattedMonetaryAmount,{currency:(0,ar.getCurrencyFromPriceResponse)(e),value:o}):(0,d.createInterpolateElement)(/* translators: <price/> is the price of the package, <packageCount/> is the number of packages. These must appear in the translated string. */ /* translators: <price/> is the price of the package, <packageCount/> is the number of packages. These must appear in the translated string. */
(0,l._n)("<price/> x <packageCount/> package","<price/> x <packageCount/> packages",t,"woocommerce"),{price:(0,r.createElement)(Ht.FormattedMonetaryAmount,{currency:(0,ar.getCurrencyFromPriceResponse)(e),value:o}),packageCount:(0,r.createElement)(r.Fragment,null,t)})),{value:e.rate_id,label:n?(0,Pe.decodeEntities)(n):(0,Pe.decodeEntities)(e.name),secondaryLabel:i,description:c?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.A,{icon:Vt.A,className:"wc-block-editor-components-block-icon"}),(0,Pe.decodeEntities)(c)):void 0,secondaryDescription:(0,r.createElement)(Cc,{maxLines:2},(0,Pe.decodeEntities)(s))}},Pc=()=>{const{shippingRates:e,selectShippingRate:t}=st(),o=(0,d.useMemo)((()=>{var t;return((null===(t=e[0])||void 0===t?void 0:t.shipping_rates)||[]).filter(ze)}),[e]),[n,c]=(0,d.useState)((()=>{var e;return(null===(e=o.find((e=>e.selected)))||void 0===e?void 0:e.rate_id)||""})),s=(0,d.useCallback)((e=>{t(e)}),[t]),{extensions:a,receiveCart:i,...l}=He(),m={extensions:a,cart:l,components:{ShippingRatesControlPackage:mc,LocalPickupSelect:Ec},renderPickupLocation:Sc};(0,d.useEffect)((()=>{!n&&o[0]&&n!==o[0].rate_id&&(c(o[0].rate_id),s(o[0].rate_id))}),[o,n]);const u=qe(e);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Rt.ExperimentalOrderLocalPickupPackages.Slot,{...m}),(0,r.createElement)(Rt.ExperimentalOrderLocalPickupPackages,null,(0,r.createElement)(Ec,{title:e[0].name,setSelectedOption:c,onSelectRate:s,selectedOption:n,renderPickupLocation:Sc,pickupLocations:o,packageCount:u})))},Ac={...Ao({defaultTitle:(0,l.__)("Pickup locations","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};o(3425),(0,i.registerBlockType)("woocommerce/checkout-pickup-options-block",{icon:{src:(0,r.createElement)(a.A,{icon:Qn.A,className:"wc-block-editor-components-block-icon"})},attributes:Ac,edit:({attributes:e,setAttributes:t})=>{const{prefersCollection:o}=(0,E.useSelect)((e=>({prefersCollection:e(oe.CHECKOUT_STORE_KEY).prefersCollection()}))),{className:c}=e;return o&&V?(0,r.createElement)($t,{attributes:e,setAttributes:t,className:(0,n.A)("wc-block-checkout__shipping-method",c)},(0,r.createElement)(Pc,null),(0,r.createElement)(zt,{block:Rt.innerBlockAreas.PICKUP_LOCATION})):null},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(Wt,null))});const Nc=({className:e=""})=>{const{cartTotals:t}=He(),o=(0,ar.getCurrencyFromPriceResponse)(t);return(0,r.createElement)(Ht.TotalsWrapper,{className:e},(0,r.createElement)(Ht.Subtotal,{currency:o,values:t}))};(0,i.registerBlockType)("woocommerce/checkout-order-summary-subtotal-block",{icon:{src:(0,r.createElement)(a.A,{icon:_r,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,m.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Nc,{className:t}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});const Tc=({className:e=""})=>{const{cartFees:t,cartTotals:o}=He(),n=(0,ar.getCurrencyFromPriceResponse)(o);return(0,r.createElement)(Ht.TotalsWrapper,{className:e},(0,r.createElement)(Ht.TotalsFees,{currency:n,cartFees:t}))};(0,i.registerBlockType)("woocommerce/checkout-order-summary-fee-block",{icon:{src:(0,r.createElement)(a.A,{icon:_r,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,m.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Tc,{className:t}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});const Rc=()=>{const{extensions:e,receiveCart:t,...o}=He(),n={extensions:e,cart:o,context:"woocommerce/checkout"};return(0,r.createElement)(Rt.ExperimentalDiscountsMeta.Slot,{...n})},xc=({className:e=""})=>{const{cartTotals:t,cartCoupons:o}=He(),{removeCoupon:n,isRemovingCoupon:c}=hn("wc/checkout"),s=(0,ar.getCurrencyFromPriceResponse)(t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ht.TotalsWrapper,{className:e},(0,r.createElement)(wr,{cartCoupons:o,currency:s,isRemovingCoupon:c,removeCoupon:n,values:t})),(0,r.createElement)(Rc,null))};(0,i.registerBlockType)("woocommerce/checkout-order-summary-discount-block",{icon:{src:(0,r.createElement)(a.A,{icon:_r,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,m.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(xc,{className:t}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});const Ic=({className:e=""})=>{const{cartNeedsShipping:t,shippingRates:o,shippingAddress:n}=He(),c=(0,E.useSelect)((e=>e(oe.CHECKOUT_STORE_KEY).prefersCollection()));if(!t)return null;const s=(e=>!!Ge(e)&&e.every((e=>e.shipping_rates.every((e=>!e.selected||ze(e))))))(((e,t)=>e.map((e=>({...e,shipping_rates:e.shipping_rates.filter((e=>{const o=We(e.method_id);return t?o:!o}))}))))(o,null!=c&&c)),a=Oe(n,["state","country","postcode","city"]);return(0,r.createElement)(Rt.TotalsWrapper,{className:e},(0,r.createElement)(Pr,{label:s?(0,l.__)("Collection","woocommerce"):(0,l.__)("Delivery","woocommerce"),placeholder:(0,r.createElement)("span",{className:"wc-block-components-shipping-placeholder__value"},a?(0,l.__)("No available delivery option","woocommerce"):(0,l.__)("Enter address to calculate","woocommerce"))}))};(0,i.registerBlockType)("woocommerce/checkout-order-summary-shipping-block",{icon:{src:(0,r.createElement)(a.A,{icon:_r,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,m.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Qt,null,(0,r.createElement)(Ic,{className:t})))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});var Oc=o(8848);const Mc=({className:e=""})=>{const t=(0,v.getSetting)("couponsEnabled",!0),{applyCoupon:o,isApplyingCoupon:n}=hn("wc/checkout");return t?(0,r.createElement)(Ht.TotalsWrapper,{className:e},(0,r.createElement)(Er,{onSubmit:o,isLoading:n,instanceId:"coupon"})):null};(0,i.registerBlockType)("woocommerce/checkout-order-summary-coupon-form-block",{icon:{src:(0,r.createElement)(a.A,{icon:Oc.A,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,m.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Qt,null,(0,r.createElement)(Mc,{className:t})))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});const Bc=({className:e,showRateAfterTaxName:t})=>{const{cartTotals:o}=He();if((0,v.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(o.total_tax,10)<=0)return null;const n=(0,ar.getCurrencyFromPriceResponse)(o);return(0,r.createElement)(Ht.TotalsWrapper,{className:e},(0,r.createElement)(Ht.TotalsTaxes,{showRateAfterTaxName:t,currency:n,values:o}))},Fc={showRateAfterTaxName:{type:"boolean",default:(0,v.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!0}}};(0,i.registerBlockType)("woocommerce/checkout-order-summary-taxes-block",{icon:{src:(0,r.createElement)(a.A,{icon:_r,className:"wc-block-editor-components-block-icon"})},attributes:Fc,edit:({attributes:e,setAttributes:t})=>{const{className:o,showRateAfterTaxName:n}=e,c=(0,m.useBlockProps)(),s=(0,v.getSetting)("taxesEnabled"),a=(0,v.getSetting)("displayItemizedTaxes",!1),i=(0,v.getSetting)("displayCartPricesIncludingTax",!1);return(0,r.createElement)("div",{...c},(0,r.createElement)(m.InspectorControls,null,s&&a&&!i&&(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Taxes","woocommerce")},(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Show rate after tax name","woocommerce"),help:(0,l.__)("Show the percentage rate alongside each tax line in the summary.","woocommerce"),checked:n,onChange:()=>t({showRateAfterTaxName:!n})}))),(0,r.createElement)(Bc,{className:o,showRateAfterTaxName:n}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})});const Dc=(0,r.createElement)(c.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"}));o(4567);const Lc=({currency:e,maxPrice:t,minPrice:o,priceClassName:c,priceStyle:s={}})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,l.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,l.__)("Price between %1$s and %2$s","woocommerce"),(0,ar.formatPrice)(o),(0,ar.formatPrice)(t))),(0,r.createElement)("span",{"aria-hidden":!0},(0,r.createElement)(Ht.FormattedMonetaryAmount,{className:(0,n.A)("wc-block-components-product-price__value",c),currency:e,value:o,style:s})," — ",(0,r.createElement)(Ht.FormattedMonetaryAmount,{className:(0,n.A)("wc-block-components-product-price__value",c),currency:e,value:t,style:s}))),Yc=({currency:e,regularPriceClassName:t,regularPriceStyle:o,regularPrice:c,priceClassName:s,priceStyle:a,price:i})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Previous price:","woocommerce")),(0,r.createElement)(Ht.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("del",{className:(0,n.A)("wc-block-components-product-price__regular",t),style:o},e),value:c}),(0,r.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Discounted price:","woocommerce")),(0,r.createElement)(Ht.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("ins",{className:(0,n.A)("wc-block-components-product-price__value","is-discounted",s),style:a},e),value:i})),jc=({align:e,className:t,currency:o,format:c="<price/>",maxPrice:s,minPrice:a,price:i,priceClassName:l,priceStyle:m,regularPrice:u,regularPriceClassName:p,regularPriceStyle:h,style:_})=>{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&&i&&i<u;let k=(0,r.createElement)("span",{className:(0,n.A)("wc-block-components-product-price__value",l)});return E?k=(0,r.createElement)(Yc,{currency:o,price:i,priceClassName:l,priceStyle:m,regularPrice:u,regularPriceClassName:p,regularPriceStyle:h}):void 0!==a&&void 0!==s?k=(0,r.createElement)(Lc,{currency:o,maxPrice:s,minPrice:a,priceClassName:l,priceStyle:m}):i&&(k=(0,r.createElement)(Ht.FormattedMonetaryAmount,{className:(0,n.A)("wc-block-components-product-price__value",l),currency:o,value:i,style:m})),(0,r.createElement)("span",{className:g,style:_},(0,d.createInterpolateElement)(c,{price:k}))};o(6625);const Vc=({className:e="",disabled:t=!1,name:o,permalink:c="",target:s,rel:a,style:i,onClick:l,...m})=>{const d=(0,n.A)("wc-block-components-product-name",e);if(t){const e=m;return(0,r.createElement)("span",{className:d,...e,dangerouslySetInnerHTML:{__html:(0,Pe.decodeEntities)(o)}})}return(0,r.createElement)("a",{className:d,href:c,target:s,...m,dangerouslySetInnerHTML:{__html:(0,Pe.decodeEntities)(o)},style:i})};var Kc=o(131);o(9507);const Uc=({children:e,className:t})=>(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-product-badge",t)},e),Hc=()=>(0,r.createElement)(Uc,{className:"wc-block-components-product-backorder-badge"},(0,l.__)("Available on backorder","woocommerce")),qc=({image:e={},fallbackAlt:t=""})=>{const o=e.thumbnail?{src:e.thumbnail,alt:(0,Pe.decodeEntities)(e.alt)||t||"Product Image"}:{src:v.PLACEHOLDER_IMG_SRC,alt:""};return(0,r.createElement)("img",{...o,alt:o.alt})},$c=({lowStockRemaining:e})=>e?(0,r.createElement)(Uc,{className:"wc-block-components-product-low-stock-badge"},(0,l.sprintf)(/* translators: %d stock amount (number of items in stock for product) */ /* translators: %d stock amount (number of items in stock for product) */
(0,l.__)("%d left in stock","woocommerce"),e)):null;var zc=o(1194);o(4982);const Wc=({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,zc.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,Pe.decodeEntities)(t),":")," "),(0,r.createElement)("span",{className:"wc-block-components-product-details__value"},(0,Pe.decodeEntities)(e.display||e.value)))}))):null,Gc=window.wp.wordcount,Zc=({source:e,maxLength:t=15,countType:o="words",className:n="",style:c={}})=>{const s=(0,d.useMemo)((()=>((e,t=15,o="words")=>{const r=(0,Hr.autop)(e);if((0,Gc.count)(r,o)<=t)return r;const n=(e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)})(r);return(0,Gc.count)(n,o)<=t?n:"words"===o?zr(n,t):Wr(n,t,"characters_including_spaces"===o)})(e,t,o)),[e,t,o]);return(0,r.createElement)(d.RawHTML,{style:c,className:n},s)},Jc=({className:e,shortDescription:t="",fullDescription:o=""})=>{const n=t||o;return n?(0,r.createElement)(Zc,{className:e,source:n,maxLength:15,countType:M.wordCountType||"words"}):null};o(401);const Xc=({shortDescription:e="",fullDescription:t="",itemData:o=[],variation:n=[]})=>(0,r.createElement)("div",{className:"wc-block-components-product-metadata"},(0,r.createElement)(Jc,{className:"wc-block-components-product-metadata__description",shortDescription:e,fullDescription:t}),(0,r.createElement)(Wc,{details:o}),(0,r.createElement)(Wc,{details:n.map((({attribute:e="",value:t})=>({key:e,value:t})))})),Qc=({cartItem:e,disableProductDescriptions:t})=>{const{images:o,low_stock_remaining:c,show_backorder_badge:s,name:a,permalink:i,prices:m,quantity:u,short_description:p,description:h,item_data:_,variation:g,totals:E,extensions:k}=e,{receiveCart:w,...b}=He(),y=(0,d.useMemo)((()=>({context:"summary",cartItem:e,cart:b})),[e,b]),f=(0,ar.getCurrencyFromPriceResponse)(m),C=(0,Rt.applyCheckoutFilter)({filterName:"itemName",defaultValue:a,extensions:k,arg:y}),S=(0,Kc.A)({amount:parseInt(m.raw_prices.regular_price,10),precision:(0,be.isString)(m.raw_prices.precision)?parseInt(m.raw_prices.precision,10):m.raw_prices.precision}).convertPrecision(f.minorUnit).getAmount(),P=(0,Kc.A)({amount:parseInt(m.raw_prices.price,10),precision:(0,be.isString)(m.raw_prices.precision)?parseInt(m.raw_prices.precision,10):m.raw_prices.precision}).convertPrecision(f.minorUnit).getAmount(),A=(0,ar.getCurrencyFromPriceResponse)(E);let N=parseInt(E.line_subtotal,10);(0,v.getSetting)("displayCartPricesIncludingTax",!1)&&(N+=parseInt(E.line_subtotal_tax,10));const T=(0,Kc.A)({amount:N,precision:A.minorUnit}).getAmount(),R=(0,Rt.applyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:k,arg:y,validation:Rt.productPriceValidation}),x=(0,Rt.applyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:k,arg:y,validation:Rt.productPriceValidation}),I=(0,Rt.applyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:k,arg:y}),O=t?{itemData:_,variation:g}:{itemData:_,variation:g,shortDescription:p,fullDescription:h};return(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-order-summary-item",I)},(0,r.createElement)("div",{className:"wc-block-components-order-summary-item__image"},(0,r.createElement)("div",{className:"wc-block-components-order-summary-item__quantity"},(0,r.createElement)(Ht.Label,{label:u.toString(),screenReaderLabel:(0,l.sprintf)(/* translators: %d number of products of the same type in the cart */ /* translators: %d number of products of the same type in the cart */
(0,l._n)("%d item","%d items",u,"woocommerce"),u)})),(0,r.createElement)(qc,{image:o.length?o[0]:{},fallbackAlt:C})),(0,r.createElement)("div",{className:"wc-block-components-order-summary-item__description"},(0,r.createElement)(Vc,{disabled:!0,name:C,permalink:i}),(0,r.createElement)(jc,{currency:f,price:P,regularPrice:S,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:R}),s?(0,r.createElement)(Hc,null):!!c&&(0,r.createElement)($c,{lowStockRemaining:c}),(0,r.createElement)(Xc,{...O})),(0,r.createElement)("span",{className:"screen-reader-text"},(0,l.sprintf)(/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */ /* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */
(0,l._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",u,"woocommerce"),u,C,(0,ar.formatPrice)(T,A))),(0,r.createElement)("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},(0,r.createElement)(jc,{currency:A,format:x,price:T})))};o(5415);const es=({cartItems:e=[],disableProductDescriptions:t=!1})=>{const{isLarge:o,hasContainerWidth:c}=h();return c?(0,r.createElement)("div",{className:(0,n.A)("wc-block-components-order-summary",{"is-large":o})},(0,r.createElement)("div",{className:"wc-block-components-order-summary__content"},e.map((e=>(0,r.createElement)(Qc,{disableProductDescriptions:t,key:e.key,cartItem:e}))))):null},ts=({className:e="",disableProductDescriptions:t=!1})=>{const{cartItems:o}=He();return(0,r.createElement)(Ht.TotalsWrapper,{className:e},(0,r.createElement)(es,{cartItems:o,disableProductDescriptions:t}))};(0,i.registerBlockType)("woocommerce/checkout-order-summary-cart-items-block",{icon:{src:(0,r.createElement)(a.A,{icon:Dc,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{className:o,disableProductDescriptions:n}=e,c=(0,m.useBlockProps)();return(0,r.createElement)("div",{...c},(()=>{const{experimentalBlocksEnabled:e}=(0,v.getSetting)("wcBlocksConfig",{experimentalBlocksEnabled:!1});return e})()&&(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Settings","woocommerce")},(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Disable product descriptions","woocommerce"),help:(0,l.__)("Disable display of product descriptions.","woocommerce"),checked:n,onChange:()=>t({disableProductDescriptions:!n})}))),(0,r.createElement)(ts,{disableProductDescriptions:n,className:o}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()})}),o(5681),(0,i.registerBlockType)("woocommerce/checkout-order-summary-totals-block",{icon:{src:(0,r.createElement)(a.A,{icon:_r,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,m.useBlockProps)(),o=Lt(Rt.innerBlockAreas.CHECKOUT_ORDER_SUMMARY_TOTALS),n=[["woocommerce/checkout-order-summary-subtotal-block",{},[]],["woocommerce/checkout-order-summary-fee-block",{},[]],["woocommerce/checkout-order-summary-discount-block",{},[]],["woocommerce/checkout-order-summary-shipping-block",{},[]],["woocommerce/checkout-order-summary-taxes-block",{},[]]];return Yt({clientId:e,registeredBlocks:o,defaultTemplate:n}),(0,r.createElement)("div",{...t},(0,r.createElement)(m.InnerBlocks,{allowedBlocks:o,template:n}))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save()},(0,r.createElement)(m.InnerBlocks.Content,null))}),o(6201);var os=o(8558);const rs=(e,t=!0)=>{t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},ns=({attributes:e,setAttributes:t})=>{const{hasDarkControls:o}=e;return(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Style","woocommerce")},(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Dark mode inputs","woocommerce"),help:(0,l.__)("Inputs styled specifically for use on dark background colors.","woocommerce"),checked:o,onChange:()=>t({hasDarkControls:!o})})))},cs=window.wp.editor,ss=window.wp.coreData;function as({block:e}){const t="checkout"===e?F:Y,o="checkout"===e?"woocommerce_checkout_page_id":"woocommerce_cart_page_id",{saveEntityRecord:n}=(0,E.useDispatch)(ss.store),{editPost:c,savePost:s}=(0,E.useDispatch)(cs.store),{slug:a,postPublished:i,currentPostId:m}=(0,E.useSelect)((o=>{var r;const{getEntityRecord:n}=o(ss.store),{isCurrentPostPublished:c,getCurrentPostId:s}=o(cs.store);return{slug:(null===(r=n("postType","page",t))||void 0===r?void 0:r.slug)||e,postPublished:c(),currentPostId:s()}}),[]),[u,p]=(0,d.useState)("pristine"),h=(0,d.useCallback)((()=>{p("updating"),Promise.resolve().then((()=>vt()({path:`/wc/v3/settings/advanced/${o}`,method:"GET"}))).catch((e=>{"rest_setting_setting_invalid"===e.code&&p("error")})).then((()=>{if(!i)return c({status:"publish"}),s()})).then((()=>vt()({path:`/wc/v3/settings/advanced/${o}`,method:"POST",data:{value:m.toString()}}))).then((()=>{if(0!==t)return n("postType","page",{id:t,slug:`${a}-2`})})).then((()=>c({slug:a}))).then((()=>s())).then((()=>p("updated")))}),[i,c,s,o,m,t,n,a]);let _;return _="checkout"===e?(0,d.createInterpolateElement)((0,l.__)("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:h},(0,l.__)("update your page settings","woocommerce"))}):(0,d.createInterpolateElement)((0,l.__)("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:h},(0,l.__)("update your page settings","woocommerce"))}),"string"==typeof pagenow&&"site-editor"===pagenow||m===t||"dismissed"===u?null:(0,r.createElement)(Tt.Notice,{className:"wc-default-page-notice",status:"updated"===u?"success":"info",onRemove:()=>p("dismissed"),spokenMessage:"updated"===u?(0,l.__)("Page settings updated","woocommerce"):_},"updated"===u?(0,l.__)("Page settings updated","woocommerce"):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,_)))}o(4688);const is=[],ls=e=>{const[t,o,r]=(()=>{const e={};(0,v.getSetting)("incompatibleExtensions")&&(0,v.getSetting)("incompatibleExtensions").forEach((t=>{e[t.id]=t.title}));const t=Object.keys(e),o=t.length;return[e,t,o]})(),[n,c,s]=(()=>{const{incompatiblePaymentMethods:e}=(0,E.useSelect)((e=>{const{getIncompatiblePaymentMethods:t}=e(yn);return{incompatiblePaymentMethods:t()}}),[]),t=Object.keys(e);return[e,t,t.length]})(),a={...t,...n},i=[...o,...c],l=r+s,[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",is),[p,h]=(0,d.useState)(!1),_=m.some((t=>{return Object.keys(t).includes(e)&&(o=t[e],r=i,o.length===r.length&&new Set([...o,...r]).size===o.length);var o,r})),g=0===l||_;return(0,d.useEffect)((()=>{h(!g),g||_||u((t=>t.reduce(((t,o)=>(Object.keys(o).includes(e)||t.push(o),t)),[])))}),[g,_,u,e]),[p,()=>{const t=new Set(m);t.add({[e]:i}),u([...t])},(k=a,Object.fromEntries(Object.entries(k).sort((([,e],[,t])=>e.localeCompare(t))))),l];var k},ms=window.wp.notices;var ds=o(4922),us=o.n(ds);const ps=!1;us()("wc-admin:tracks:stats");const hs=us()("wc-admin:tracks");function _s(e,t){return hs("recordevent %s %o","wcadmin_"+e,t,{_tqk:window._tkq,shouldRecord:!(ps||!window._tkq||!window.wcTracks||!window.wcTracks.isEnabled)}),!(!window.wcTracks||"function"!=typeof window.wcTracks.recordEvent)&&(ps?(window.wcTracks.validateEvent(e,t),!1):void window.wcTracks.recordEvent(e,t))}const gs=({blocks:e,findCondition:t})=>{for(const o of e){if(t(o))return o;if(o.innerBlocks){const e=gs({blocks:o.innerBlocks,findCondition:t});if(e)return e}}},Es=({blockType:e="woocommerce/cart"})=>"woocommerce/cart"===e?(0,r.createElement)("p",null,(0,l.__)("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,l.__)("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,l.__)("Customizations and updates to the block","woocommerce")),(0,r.createElement)("li",null,(0,l.__)("Additional local pickup options created for the new checkout","woocommerce"))));function ks({block:e,clientId:t,type:o}){const{createInfoNotice:n}=(0,E.useDispatch)(ms.store),{replaceBlock:c,selectBlock:s}=(0,E.useDispatch)(m.store),[a,u]=(0,d.useState)(!1),p=()=>u(!1),{undo:h}=(0,E.useDispatch)(ss.store),[,,_,g]=ls(e),k="woocommerce/cart"===e,w=k?(0,l.__)("Switch to classic cart","woocommerce"):(0,l.__)("Switch to classic checkout","woocommerce"),b=k?(0,l.__)("Switched to classic cart.","woocommerce"):(0,l.__)("Switched to classic checkout.","woocommerce"),y=k?"cart":"checkout",v={shortcode:y,notice:"incompatible"===o?"incompatible_notice":"generic_notice",incompatible_extensions_count:g,incompatible_extensions_names:JSON.stringify(_)},{getBlocks:f}=(0,E.useSelect)((e=>({getBlocks:e(m.store).getBlocks})),[]),C=()=>{h(),_s("switch_to_classic_shortcode_undo",v)};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Tt.Button,{variant:"secondary",onClick:()=>{_s("switch_to_classic_shortcode_click",v),u(!0)}},w),a&&(0,r.createElement)(Tt.Modal,{size:"medium",title:w,onRequestClose:p,className:"wc-blocks-switch-to-classic-shortcode-modal-content"},(0,r.createElement)(Es,{blockType:e}),(0,r.createElement)(Tt.TabbableContainer,{className:"wc-blocks-switch-to-classic-shortcode-modal-actions"},(0,r.createElement)(Tt.Button,{variant:"primary",isDestructive:!0,onClick:()=>{c(t,(0,i.createBlock)("woocommerce/classic-shortcode",{shortcode:y})),_s("switch_to_classic_shortcode_confirm",v),(()=>{const e=gs({blocks:f(),findCondition:e=>"woocommerce/classic-shortcode"===e.name});e&&s(e.clientId)})(),n(b,{actions:[{label:(0,l.__)("Undo","woocommerce"),onClick:C}],type:"snackbar"}),p()}},(0,l.__)("Switch","woocommerce"))," ",(0,r.createElement)(Tt.Button,{variant:"secondary",onClick:()=>{_s("switch_to_classic_shortcode_cancel",v),p()}},(0,l.__)("Cancel","woocommerce")))))}function ws({block:e,clientId:t}){const[o,n,c,s]=ls(e);if(!o)return null;const i=(0,r.createElement)(r.Fragment,null,s>1?(0,d.createInterpolateElement)((0,l.__)("Some active extensions do not yet support this block. This may impact the shopper experience. <a>Learn more</a>","woocommerce"),{a:(0,r.createElement)(Tt.ExternalLink,{href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/"})}):(0,d.createInterpolateElement)((0,l.sprintf)(
// translators: %s is the name of the extension.
// translators: %s is the name of the extension.
(0,l.__)("<strong>%s</strong> does not yet support this block. This may impact the shopper experience. <a>Learn more</a>","woocommerce"),Object.values(c)[0]),{strong:(0,r.createElement)("strong",null),a:(0,r.createElement)(Tt.ExternalLink,{href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/"})})),m=Object.entries(c),u=m.length-2;return(0,r.createElement)(Tt.Notice,{className:"wc-blocks-incompatible-extensions-notice",status:"warning",onRemove:n,spokenMessage:i},(0,r.createElement)("div",{className:"wc-blocks-incompatible-extensions-notice__content"},(0,r.createElement)(a.A,{className:"wc-blocks-incompatible-extensions-notice__warning-icon",icon:(0,r.createElement)(Kr,null)}),(0,r.createElement)("div",null,(0,r.createElement)("p",null,i),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,l.sprintf)(
// translators: %s is the number of incompatible extensions.
// translators: %s is the number of incompatible extensions.
(0,l._n)("%s more incompatibility","%s more incompatibilities",u,"woocommerce"),u)),(0,r.createElement)(a.A,{icon:eo.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)(ks,{block:e,clientId:t,type:"incompatible"}))))}o(7840),o(8831);var bs=o(361);o(1598);const ys=({text:e,title:t=(0,l.__)("Feedback?","woocommerce"),url:o})=>{const[n,c]=(0,d.useState)(!1);return(0,d.useEffect)((()=>{c(!0)}),[]),(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)("div",{className:"wc-block-feedback-prompt"},(0,r.createElement)(a.A,{icon:bs.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,l.__)("Give us your feedback.","woocommerce"),(0,r.createElement)(a.A,{icon:Br.A,size:16}))))},vs=()=>(0,r.createElement)(ys,{text:(0,l.__)("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"}),fs=(0,u.createHigherOrderComponent)((e=>t=>{const{clientId:o,name:n,isSelected:c}=t,{isCart:s,isCheckout:a,parentId:i}=(0,E.useSelect)((e=>{const{getBlockParentsByBlockName:t,getBlockName:r}=e(m.store),n=t(o,["woocommerce/cart","woocommerce/checkout"]).reduce(((e,t)=>(e[r(t)]=t,e)),{}),c=r(o),s=Object.keys(n).includes("woocommerce/cart"),a=Object.keys(n).includes("woocommerce/checkout"),i="woocommerce/cart"===c||s,l=i?"woocommerce/cart":"woocommerce/checkout";return{isCart:i,isCheckout:"woocommerce/checkout"===c||a,parentId:c===l?o:n[l]}}));return n.startsWith("woocommerce/")&&c&&(s||a)?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(ws,{block:s?"woocommerce/cart":"woocommerce/checkout",clientId:i}),(0,r.createElement)(as,{block:a?"checkout":"cart"}),(0,r.createElement)(vs,null)),(0,r.createElement)(e,{key:"edit",...t})):(0,r.createElement)(e,{key:"edit",...t})}),"withSidebarNotices");(0,nt.hasFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice")||(0,nt.addFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice",fs,11),(0,nt.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||(0,E.subscribe)((()=>{var e,t,o,r;const n=(0,E.select)(m.store);if(!n)return;const c=n.getSelectedBlock();c&&(rs("wc-lock-selected-block--remove",!(null==c||null===(e=c.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),rs("wc-lock-selected-block--move",!(null==c||null===(o=c.attributes)||void 0===o||null===(r=o.lock)||void 0===r||!r.move)))}));const Cs=["woocommerce/checkout-fields-block","woocommerce/checkout-totals-block"],Ss={hasDarkControls:{type:"boolean",default:(0,v.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:(0,v.getSetting)("displayCartPricesIncludingTax",!1)}},Ps={showOrderNotes:{type:"boolean",default:!0},showPolicyLinks:{type:"boolean",default:!0},showReturnToCart:{type:"boolean",default:!0},cartPageId:{type:"number",default:0}},As=JSON.parse('{"name":"woocommerce/checkout","version":"1.0.0","title":"Checkout","description":"Display a checkout form so your customers can submit orders.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":["wide"],"html":false,"multiple":false},"example":{"attributes":{"isPreview":true},"viewportWidth":800},"attributes":{"isPreview":{"type":"boolean","default":false,"save":false},"showCompanyField":{"type":"boolean","default":false},"requireCompanyField":{"type":"boolean","default":false},"showApartmentField":{"type":"boolean","default":true},"requireApartmentField":{"type":"boolean","default":false},"showPhoneField":{"type":"boolean","default":true},"requirePhoneField":{"type":"boolean","default":false},"align":{"type":"string","default":"wide"},"showFormStepNumbers":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),Ns={icon:{src:(0,r.createElement)(a.A,{icon:s,className:"wc-block-editor-components-block-icon"})},attributes:{...As.attributes,...Ss,...Ps},edit:({clientId:e,attributes:t,setAttributes:o})=>{const{showCompanyField:c,requireCompanyField:s,showApartmentField:a,requireApartmentField:u,showPhoneField:p,requirePhoneField:h,showOrderNotes:_,showPolicyLinks:k,showReturnToCart:w,showRateAfterTaxName:y,cartPageId:v,isPreview:f=!1,showFormStepNumbers:C=!1}=t,S=(0,d.useRef)((0,Re.getQueryArg)(window.location.href,"focus"));(0,d.useEffect)((()=>{"checkout"!==S.current||(0,E.select)("core/block-editor").hasSelectedBlock()||((0,E.dispatch)("core/block-editor").selectBlock(e),(0,E.dispatch)("core/interface").enableComplementaryArea("core/edit-site","edit-site/block-inspector"))}),[e]);const P=e=>{const r={};r[e]=!t[e],o(r)},A=((e={})=>{const t=(0,d.useRef)(),o=(0,m.useBlockProps)({ref:t,...e});return(({ref:e})=>{const t=(0,nt.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!==os.BACKSPACE&&t!==os.DELETE)return;if((0,Zt.isTextField)(o))return;const r=o;if(void 0===r.dataset.block)return;const n=(e=>{var t,o,r,n,c;if(!e)return!1;const{getBlock:s}=(0,E.select)(m.store),a=s(e);if("boolean"==typeof(null==a||null===(t=a.attributes)||void 0===t||null===(o=t.lock)||void 0===o?void 0:o.remove))return a.attributes.lock.remove;const l=(0,i.getBlockType)(a.name);var d,u,p;return"boolean"==typeof(null==l||null===(r=l.attributes)||void 0===r||null===(n=r.lock)||void 0===n||null===(c=n.default)||void 0===c?void 0:c.remove)&&(null==l||null===(d=l.attributes)||void 0===d||null===(u=d.lock)||void 0===u||null===(p=u.default)||void 0===p?void 0:p.remove)})(r.dataset.block);n&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}}),[o,t])})({ref:t}),o})();return(0,r.createElement)("div",{...A},(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(ns,{attributes:t,setAttributes:o})),(0,r.createElement)(b,{isPreview:f,previewData:{previewCart:rt,previewSavedPaymentMethods:Nt}},(0,r.createElement)(Rt.SlotFillProvider,null,(0,r.createElement)(At,null,(0,r.createElement)(g,{className:(0,n.A)("wc-block-checkout",{"has-dark-controls":t.hasDarkControls})},(0,r.createElement)(Mt.Provider,{value:{addressFieldControls:()=>(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Form Step Options","woocommerce")},(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Show form step numbers","woocommerce"),checked:C,onChange:()=>o({showFormStepNumbers:!C})})),(0,r.createElement)(Tt.PanelBody,{title:(0,l.__)("Address Fields","woocommerce")},(0,r.createElement)("p",{className:"wc-block-checkout__controls-text"},(0,l.__)("Show or hide fields in the checkout address forms.","woocommerce")),(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Company","woocommerce"),checked:c,onChange:()=>P("showCompanyField")}),c&&(0,r.createElement)(Tt.RadioControl,{selected:s,options:[{label:(0,l.__)("Optional","woocommerce"),value:!1},{label:(0,l.__)("Required","woocommerce"),value:!0}],onChange:()=>P("requireCompanyField"),className:"components-base-control--nested wc-block-components-require-company-field"}),(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Address line 2","woocommerce"),checked:a,onChange:()=>P("showApartmentField")}),a&&(0,r.createElement)(Tt.RadioControl,{selected:u,options:[{label:(0,l.__)("Optional","woocommerce"),value:!1},{label:(0,l.__)("Required","woocommerce"),value:!0}],onChange:()=>P("requireApartmentField"),className:"components-base-control--nested wc-block-components-require-apartment-field"}),(0,r.createElement)(Tt.ToggleControl,{label:(0,l.__)("Phone","woocommerce"),checked:p,onChange:()=>P("showPhoneField")}),p&&(0,r.createElement)(Tt.RadioControl,{selected:h,options:[{label:(0,l.__)("Optional","woocommerce"),value:!1},{label:(0,l.__)("Required","woocommerce"),value:!0}],onChange:()=>P("requirePhoneField"),className:"components-base-control--nested wc-block-components-require-phone-field"})))}},(0,r.createElement)(Ot.Provider,{value:{showApartmentField:a,showCompanyField:c,showPhoneField:p,requireApartmentField:u,requireCompanyField:s,requirePhoneField:h,showOrderNotes:_,showPolicyLinks:k,showReturnToCart:w,cartPageId:v,showRateAfterTaxName:y,showFormStepNumbers:C}},(0,r.createElement)(m.InnerBlocks,{allowedBlocks:Cs,template:[["woocommerce/checkout-totals-block",{},[]],["woocommerce/checkout-fields-block",{},[]]],templateLock:"insert"}))))))))},save:()=>(0,r.createElement)("div",{...m.useBlockProps.save({className:"wc-block-checkout is-loading"})},(0,r.createElement)(m.InnerBlocks.Content,null)),transforms:{to:[{type:"block",blocks:["woocommerce/classic-shortcode"],transform:e=>(0,i.createBlock)("woocommerce/classic-shortcode",{shortcode:"checkout",align:e.align},[])}]},deprecated:[{attributes:{...As.attributes,...Ss,...Ps},save:({attributes:e})=>(0,r.createElement)("div",{className:(0,n.A)("is-loading",e.className)}),migrate:e=>{const{showOrderNotes:t,showPolicyLinks:o,showReturnToCart:r,cartPageId:n}=e;return[e,[(0,i.createBlock)("woocommerce/checkout-fields-block",{},[(0,i.createBlock)("woocommerce/checkout-express-payment-block",{},[]),(0,i.createBlock)("woocommerce/checkout-contact-information-block",{},[]),(0,i.createBlock)("woocommerce/checkout-shipping-address-block",{},[]),(0,i.createBlock)("woocommerce/checkout-billing-address-block",{},[]),(0,i.createBlock)("woocommerce/checkout-shipping-methods-block",{},[]),(0,i.createBlock)("woocommerce/checkout-payment-block",{},[]),(0,i.createBlock)("woocommerce/checkout-additional-information-block",{},[]),!!t&&(0,i.createBlock)("woocommerce/checkout-order-note-block",{},[]),!!o&&(0,i.createBlock)("woocommerce/checkout-terms-block",{},[]),(0,i.createBlock)("woocommerce/checkout-actions-block",{showReturnToCart:r,cartPageId:n},[])].filter(Boolean)),(0,i.createBlock)("woocommerce/checkout-totals-block",{})]]},isEligible:(e,t)=>!t.some((e=>"woocommerce/checkout-fields-block"===e.name))},{save:({attributes:e})=>(0,r.createElement)("div",{className:(0,n.A)("is-loading",e.className)}),isEligible:(e,t)=>{const o=t.find((e=>"woocommerce/checkout-fields-block"===e.name));return!!o&&!o.innerBlocks.some((e=>"woocommerce/checkout-additional-information-block"===e.name))},migrate:(e,t)=>{const o=t.findIndex((e=>"woocommerce/checkout-fields-block"===e.name));if(-1===o)return!1;const r=t[o],n=r.innerBlocks.findIndex((e=>"wp-block-woocommerce-checkout-payment-block"===e.name));return-1!==n&&(t[o]=r.innerBlocks.slice(0,n).concat((0,i.createBlock)("woocommerce/checkout-additional-information-block",{},[])).concat(t.slice(n+1,t.length)),[e,t])}}]};(0,i.registerBlockType)(As,Ns)},9407:()=>{},2080:()=>{},5684:()=>{},5415:()=>{},3091:()=>{},4957:()=>{},777:()=>{},9507:()=>{},4982:()=>{},401:()=>{},8337:()=>{},7051:()=>{},2867:()=>{},3048:()=>{},265:()=>{},7919:()=>{},780:()=>{},2931:()=>{},8375:()=>{},9345:()=>{},6625:()=>{},4567:()=>{},5452:()=>{},1221:()=>{},8824:()=>{},9569:()=>{},1637:()=>{},181:()=>{},1094:()=>{},7259:()=>{},6664:()=>{},149:()=>{},5089:()=>{},9865:()=>{},6619:()=>{},377:()=>{},7797:()=>{},1407:()=>{},5681:()=>{},3425:()=>{},7694:()=>{},2255:()=>{},1299:()=>{},8845:()=>{},5609:()=>{},7765:()=>{},6201:()=>{},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}},n={};function c(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e].call(o.exports,o,o.exports,c),o.exports}c.m=r,e=[],c.O=(t,o,r,n)=>{if(!o){var s=1/0;for(m=0;m<e.length;m++){for(var[o,r,n]=e[m],a=!0,i=0;i<o.length;i++)(!1&n||s>=n)&&Object.keys(c.O).every((e=>c.O[e](o[i])))?o.splice(i--,1):(a=!1,n<s&&(s=n));if(a){e.splice(m--,1);var l=r();void 0!==l&&(t=l)}}return t}n=n||0;for(var m=e.length;m>0&&e[m-1][2]>n;m--)e[m]=e[m-1];e[m]=[o,r,n]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,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 n=Object.create(null);c.r(n);var s={};t=t||[null,o({}),o([]),o(o)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=o(a))Object.getOwnPropertyNames(a).forEach((t=>s[t]=()=>e[t]));return s.default=()=>e,c.d(n,s),n},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.j=251,(()=>{var e={251:0};c.O.j=t=>0===e[t];var t=(t,o)=>{var r,n,[s,a,i]=o,l=0;if(s.some((t=>0!==e[t]))){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);if(i)var m=i(c)}for(t&&t(o);l<s.length;l++)n=s[l],c.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return c.O(m)},o=self.webpackChunkwebpackWcBlocksMainJsonp=self.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var s=c.O(void 0,[94],(()=>c(2817)));s=c.O(s),((this.wc=this.wc||{}).blocks=this.wc.blocks||{}).checkout=s})();

Youez - 2016 - github.com/yon3zu
LinuXploit