31 lines
145 KiB
JavaScript
31 lines
145 KiB
JavaScript
|
(()=>{var e,t={9932:(e,t,o)=>{"use strict";o.r(t);var r=o(9196),c=o(5736),n=o(4184),s=o.n(n);const a=window.wp.blockEditor;var l=o(444);const i=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));var u=o(1984);const d=window.wp.blocks;var p=o(4942),m=o(9307);const g=window.wc.wcSettings;var _,h,b,k,w,E,y,v,f,C;const S=(0,g.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),N=S.pluginUrl+"images/",P=(S.pluginUrl,S.buildPhase),x=null===(_=g.STORE_PAGES.shop)||void 0===_?void 0:_.permalink,R=null===(h=g.STORE_PAGES.checkout)||void 0===h?void 0:h.id,T=(null===(b=g.STORE_PAGES.checkout)||void 0===b||b.permalink,null===(k=g.STORE_PAGES.privacy)||void 0===k||k.permalink,null===(w=g.STORE_PAGES.privacy)||void 0===w||w.title,null===(E=g.STORE_PAGES.terms)||void 0===E||E.permalink,null===(y=g.STORE_PAGES.terms)||void 0===y||y.title,null===(v=g.STORE_PAGES.cart)||void 0===v?void 0:v.id),I=null===(f=g.STORE_PAGES.cart)||void 0===f?void 0:f.permalink,A=(null!==(C=g.STORE_PAGES.myaccount)&&void 0!==C&&C.permalink?g.STORE_PAGES.myaccount.permalink:(0,g.getSetting)("wpLoginUrl","/wp-login.php"),(0,g.getSetting)("localPickupEnabled",!1)),B=(0,g.getSetting)("countries",{}),M=(0,g.getSetting)("countryData",{}),O=Object.fromEntries(Object.keys(M).filter((e=>!0===M[e].allowBilling)).map((e=>[e,B[e]||""]))),D=Object.fromEntries(Object.keys(M).filter((e=>!0===M[e].allowBilling)).map((e=>[e,M[e].states||[]]))),L=Object.fromEntries(Object.keys(M).filter((e=>!0===M[e].allowShipping)).map((e=>[e,B[e]||""]))),F=Object.fromEntries(Object.keys(M).filter((e=>!0===M[e].allowShipping)).map((e=>[e,M[e].states||[]]))),V=Object.fromEntries(Object.keys(M).map((e=>[e,M[e].locale||[]]))),Y=()=>P>1,U=({imageUrl:e=`${N}/block-error.svg`,header:t=(0,c.__)("Oops!","woocommerce"),text:o=(0,c.__)("There was an error loading the content.","woocommerce"),errorMessage:n,errorMessagePrefix:s=(0,c.__)("Error:","woocommerce"),button:a,showErrorBlock:l=!0})=>l?(0,r.createElement)("div",{className:"wc-block-error wc-block-components-error"},e&&(0,r.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:e,alt:""}),(0,r.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},t&&(0,r.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},t),o&&(0,r.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},o),n&&(0,r.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",n),a&&(0,r.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},a))):null;o(4578);class $ extends m.Component{constructor(...e){super(...e),(0,p.Z)(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:o=!0,showErrorBlock:c=!0,text:n,errorMessagePrefix:s,renderError:a,button:l}=this.props,{errorMessage:i,hasError:u}=this.state;return u?"function"==typeof a?a({errorMessage:i}):(0,r.createElement)(U,{showErrorBlock:c,errorMessage:o?i:null,header:e,imageUrl:t,text:n,errorMessagePrefix:s,button:l}):this.props.children}}const j=$,z=window.wp.data,K=(0,m.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})}),H=()=>(0,m.useContext)(K),q=({children:e,currentPostId:t=0,prev
|
|||
|
(0,c.__)("%s (optional)","woocommerce"),e.label)),e.priority&&(we(e.priority)&&(t.index=e.priority),Ee(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},ve=Object.entries(V).map((([e,t])=>[e,Object.entries(t).map((([e,t])=>[e,ye(t)])).reduce(((e,[t,o])=>(e[t]=o,e)),{})])).reduce(((e,[t,o])=>(e[t]=o,e)),{}),fe=(e,t,o="")=>{const r=o&&void 0!==ve[o]?ve[o]:{};return e.map((e=>({key:e,...g.defaultAddressFields[e]||{},...r[e]||{},...t[e]||{}}))).sort(((e,t)=>e.index-t.index))},Ce=window.wp.url,Se=e=>{const t=Object.keys(g.defaultAddressFields),o=fe(t,{},e.country),r=Object.assign({},e);return o.forEach((({key:t="",hidden:o=!1})=>{o&&((e,t)=>e in t)(t,e)&&(r[t]="")})),r},Ne=e=>{if(0===Object.values(e).length)return null;const t="string"==typeof L[e.country]?(0,ke.decodeEntities)(L[e.country]):"",o="object"==typeof F[e.country]&&"string"==typeof F[e.country][e.state]?(0,ke.decodeEntities)(F[e.country][e.state]):e.state,r=[];r.push(e.postcode.toUpperCase()),r.push(e.city),r.push(o),r.push(t);return r.filter(Boolean).join(", ")||null},Pe=window.CustomEvent||null,xe=(e,t,o=!1,r=!1)=>{if("function"!=typeof jQuery)return()=>{};const c=()=>{((e,{bubbles:t=!1,cancelable:o=!1,element:r,detail:c={}})=>{if(!Pe)return;r||(r=document.body);const n=new Pe(e,{bubbles:t,cancelable:o,detail:c});r.dispatchEvent(n)})(t,{bubbles:o,cancelable:r})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)},Re=e=>{const t=null==e?void 0:e.detail;t&&t.preserveCartData||(0,z.dispatch)(W.CART_STORE_KEY).invalidateResolutionForStore()},Te=e=>{(null!=e&&e.persisted||"back_forward"===(window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:""))&&(0,z.dispatch)(W.CART_STORE_KEY).invalidateResolutionForStore()},Ie=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},Ae={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},Be={...Ae,email:""},Me={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:W.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},Oe=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,ke.decodeEntities)(t)]))),De={cartCoupons:W.EMPTY_CART_COUPONS,cartItems:W.EMPTY_CART_ITEMS,cartFees:W.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:W.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:W.EMPTY_CART_ITEM_ERRORS,cartTotals:Me,cartIsLoading:!0,cartErrors:W.EMPTY_CART_ERRORS,billingAddress:Be,shippingAddress:Ae,shippingRates:W.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentMethods:W.EMPTY_PAYMENT_METHODS,paymentRequirements:W.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},receiveCartContents:()=>{},extensions:W.EMPTY_EXTENSIONS},Le=(e={shouldSelect:!0})=>{const{isEditor:t,previewData:o}=H(),r=null==o?void 0:o.previewCart,{shouldSelect:c}=e,n=(0,m.useRef)();(0,m.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",Re),document.body.addEventListener("wc-blocks_removed_from_cart",Re),window.addEventListener("pageshow",Te);const t=xe("added_to_cart","wc-blocks_added_to_cart"),o=xe("removed_from_cart","wc-blocks_removed_from_cart");window.wcBlocksStoreCartListeners.count=1,window.wcBlocksStoreCartListeners.remove=()=>{document.body.removeEventListener("wc-blocks_added_to_cart",Re),document.body.removeEventListener("wc-blocks_removed_from_cart",Re),window.removeEventListener("pageshow",Te),t(),o()}})(),Ie)),[])
|
|||
|
(0,c.__)("Quantity of %s in your cart.","woocommerce"),i)}),(0,r.createElement)("button",{ref:g,"aria-label":(0,c.sprintf)(/* translators: %s refers to the item name in the cart. */
|
|||
|
(0,c.__)("Reduce quantity of %s","woocommerce"),i),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:!b,onClick:()=>{const e=t-l;a(e),(0,Ot.speak)((0,c.sprintf)(/* translators: %s refers to the item's new quantity in the cart. */
|
|||
|
(0,c.__)("Quantity reduced to %s.","woocommerce"),e)),w(e)}},"-"),(0,r.createElement)("button",{ref:_,"aria-label":(0,c.sprintf)(/* translators: %s refers to the item's name in the cart. */
|
|||
|
(0,c.__)("Increase quantity of %s","woocommerce"),i),disabled:!k,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=t+l;a(e),(0,Ot.speak)((0,c.sprintf)(/* translators: %s refers to the item's new quantity in the cart. */
|
|||
|
(0,c.__)("Quantity increased to %s.","woocommerce"),e)),w(e)}},"+"))},Ft=window.wc.blocksComponents,Vt=window.wc.priceFormat;o(5138);const Yt=({currency:e,maxPrice:t,minPrice:o,priceClassName:n,priceStyle:a={}})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,c.sprintf)(/* translators: %1$s min price, %2$s max price */
|
|||
|
(0,c.__)("Price between %1$s and %2$s","woocommerce"),(0,Vt.formatPrice)(o),(0,Vt.formatPrice)(t))),(0,r.createElement)("span",{"aria-hidden":!0},(0,r.createElement)(Ft.FormattedMonetaryAmount,{className:s()("wc-block-components-product-price__value",n),currency:e,value:o,style:a})," — ",(0,r.createElement)(Ft.FormattedMonetaryAmount,{className:s()("wc-block-components-product-price__value",n),currency:e,value:t,style:a}))),Ut=({currency:e,regularPriceClassName:t,regularPriceStyle:o,regularPrice:n,priceClassName:a,priceStyle:l,price:i})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,c.__)("Previous price:","woocommerce")),(0,r.createElement)(Ft.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("del",{className:s()("wc-block-components-product-price__regular",t),style:o},e),value:n}),(0,r.createElement)("span",{className:"screen-reader-text"},(0,c.__)("Discounted price:","woocommerce")),(0,r.createElement)(Ft.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",a),style:l},e),value:i})),$t=({align:e,className:t,currency:o,format:c="<price/>",maxPrice:n,minPrice:a,price:l,priceClassName:i,priceStyle:u,regularPrice:d,regularPriceClassName:p,regularPriceStyle:g,style:_})=>{const h=s()(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 b=d&&l&&l<d;let k=(0,r.createElement)("span",{className:s()("wc-block-components-product-price__value",i)});return b?k=(0,r.createElement)(Ut,{currency:o,price:l,priceClassName:i,priceStyle:u,regularPrice:d,regularPriceClassName:p,regularPriceStyle:g}):void 0!==a&&void 0!==n?k=(0,r.createElement)(Yt,{currency:o,maxPrice:n,minPrice:a,priceClassName:i,priceStyle:u}):l&&(k=(0,r.createElement)(Ft.FormattedMonetaryAmount,{className:s()("wc-block-components-product-price__value",i),currency:o,value:l,style:u})),(0,r.createElement)("span",{className:h,style:_},(0,m.createInterpolateElement)(c,{price:k}))};o(5641);const jt=({className:e="",disabled:t=!1,name:o,permalink:c="",target:n,rel:a,style:l,onClick:i,...u})=>{const d=s()("wc-block-components-product-name",e);if(t){const e=u;return(0,r.createElement)("span",{className:d,...e,dangerouslySetInnerHTML:{__html:(0,ke.decodeEntities)(o)}})}return(0,r.createElement)("a",{className:d,href:c,target:n,...u,dangerouslySetInnerHTML:{__html:(0,ke.decodeEntities)(o)},style:l})};var zt=o(8508);o(6315);const Kt=({children:e,className:t})=>(0,r.createElement)("div",{className:s()("wc-block-components-product-badge",t)},e),Ht=()=>(0,r.createElement)(Kt,{className:"wc-block-components-product-backorder-badge"},(0,c.__)("Available on backorder","woocommerce")),qt=({image:e={},fallbackAlt:t=""})=>{const o=e.thumbnail?{src:e.thumbnail,alt:(0,ke.decodeEntities)(e.alt)||t||"Product Image"}:{src:g.PLACEHOLDER_IMG_SRC,alt:""};return(0,r.createElement)("img",{...o,alt:o.alt})},Zt=({lowStockRemaining:e})=>e?(0,r.createElement)(Kt,{className:"wc-block-components-product-low-stock-badge"},(0,c.sprintf)(/* translators: %d stock amount (number of items in stock for product) */
|
|||
|
(0,c.__)("%d left in stock","woocommerce"),e)):null;var Wt=o(9784);o(7984);const Gt=({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,Wt.o)(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,ke.decodeEntities)(t),":")," "),(0,r.createElement)("span",{className:"wc-block-components-product-details__value"},(0,ke.decodeEntities)(e.display||e.value)))}))):null,Qt=window.wp.autop,Xt=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),Jt=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,eo=window.wp.wordcount,to=({source:e,maxLength:t=15,countType:o="words",className:c="",style:n={}})=>{const s=(0,m.useMemo)((()=>((e,t=15,o="words")=>{const r=(0,Qt.autop)(e);if((0,eo.count)(r,o)<=t)return r;const c=(e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)})(r);return(0,eo.count)(c,o)<=t?c:"words"===o?((e,t,o="…",r=!0)=>{const c=Xt(e),n=c.split(" ").splice(0,t).join(" ");return n===c?r?(0,Qt.autop)(c):c:r?(0,Qt.autop)(Jt(n,o)):Jt(n,o)})(c,t):((e,t,o=!0,r="…",c=!0)=>{const n=Xt(e),s=n.slice(0,t);if(s===n)return c?(0,Qt.autop)(n):n;if(o)return(0,Qt.autop)(Jt(s,r));const a=s.match(/([\s]+)/g),l=a?a.length:0,i=n.slice(0,t+l);return c?(0,Qt.autop)(Jt(i,r)):Jt(i,r)})(c,t,"characters_including_spaces"===o)})(e,t,o)),[e,t,o]);return(0,r.createElement)(m.RawHTML,{style:n,className:c},s)},oo=({className:e,shortDescription:t="",fullDescription:o=""})=>{const c=t||o;return c?(0,r.createElement)(to,{className:e,source:c,maxLength:15,countType:S.wordCountType||"words"}):null};o(9889);const ro=({shortDescription:e="",fullDescription:t="",itemData:o=[],variation:c=[]})=>(0,r.createElement)("div",{className:"wc-block-components-product-metadata"},(0,r.createElement)(oo,{className:"wc-block-components-product-metadata__description",shortDescription:e,fullDescription:t}),(0,r.createElement)(Gt,{details:o}),(0,r.createElement)(Gt,{details:c.map((({attribute:e="",value:t})=>({key:e,value:t})))})),co=({currency:e,saleAmount:t,format:o="<price/>"})=>{if(!t||t<=0)return null;o.includes("<price/>")||(o="<price/>",console.error("Price formats need to include the `<price/>` tag."));const n=(0,c.sprintf)(/* translators: %s will be replaced by the discount amount */
|
|||
|
(0,c.__)("Save %s","woocommerce"),o);return(0,r.createElement)(Kt,{className:"wc-block-components-sale-badge"},(0,m.createInterpolateElement)(n,{price:(0,r.createElement)(Ft.FormattedMonetaryAmount,{currency:e,value:t})}))},no=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),so=e=>(0,wt.mustContain)(e,"<price/>"),ao=(0,m.forwardRef)((({lineItem:e,onRemove:t=(()=>{}),tabIndex:o},n)=>{const{name:a="",catalog_visibility:l="visible",short_description:i="",description:u="",low_stock_remaining:d=null,show_backorder_badge:p=!1,quantity_limits:_={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:h=!1,permalink:b="",images:k=[],variation:w=[],item_data:E=[],prices:y={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:v={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:f}=e,{quantity:C,setItemQuantity:S,removeItem:N,isPendingDelete:P}=(e=>{const t={key:"",quantity:1};(e=>Fe(e)&&Ve(e,"key")&&Ve(e,"quantity")&&Ee(e.key)&&we(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:o="",quantity:r=1}=t,{cartErrors:c}=Le(),{__internalIncrementCalculating:n,__internalDecrementCalculating:s}=(0,z.useDispatch)(W.CHECKOUT_STORE_KEY),[a,l]=(0,m.useState)(r),[i]=(0,At.Nr)(a,400),u=rt(i),{removeItemFromCart:d,changeCartItemQuantity:p}=(0,z.useDispatch)(W.CART_STORE_KEY);(0,m.useEffect)((()=>l(r)),[r]);const g=(0,z.useSelect)((e=>{if(!o)return{quantity:!1,delete:!1};const t=e(W.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(o),delete:t.isItemPendingDelete(o)}}),[o]),_=(0,m.useCallback)((()=>o?d(o).catch((e=>{(0,W.processErrorResponse)(e)})):Promise.resolve(!1)),[o,d]);return(0,m.useEffect)((()=>{o&&we(u)&&Number.isFinite(u)&&u!==i&&p(o,i).catch((e=>{(0,W.processErrorResponse)(e)}))}),[o,p,i,u]),(0,m.useEffect)((()=>(g.delete?n():s(),()=>{g.delete&&s()})),[s,n,g.delete]),(0,m.useEffect)((()=>(g.quantity||i!==a?n():s(),()=>{(g.quantity||i!==a)&&s()})),[n,s,g.quantity,i,a]),{isPendingDelete:g.delete,quantity:a,setItemQuantity:l,removeItem:_,cartItemQuantityErrors:c}})(e),{dispatchStoreEvent:x}=We(),{receiveCart:R,...T}=Le(),I=(0,m.useMemo)((()=>({context:"cart",cartItem:e,cart:T})),[e,T]),A=(0,Vt.getCurrencyFromPriceResponse)(y),B=(0,wt.applyCheckoutFilter)({filterName:"itemName",defaultValue:a,extensions:f,arg:I}),M=(0,zt.Z)({amount:parseInt(y.raw_prices.regular_price,10),precision:y.raw_prices.precision}),O=(0,zt.Z)({amount:parseInt(y.raw_prices.price,10),precision:y.raw_prices.precision}),D=M.subtract(O),L=D.multiply(C),F=(0,Vt.getCurrencyFromPriceResponse)(v);let V=parseInt(v.line_subtotal,10);(0,g.getSetting)("displayCartPricesIncludingTax",!1)&&(V+=parseInt(v.line_subtotal_tax,10));const Y=(0,zt.Z)({amount:V,precision:F.minorUnit}),U=k.length?k[0]:{},$="hidden"===l||"search"===l,j=(0,wt.applyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:f,arg:I}),K=(0,wt.applyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:f,arg:I,validation:so}),H=(0,wt.applyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:f,arg:I,validation:so}),q=(0,wt.applyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:f,arg:I,validation:so}),Z=(0,wt.applyCheckoutFilter)({filterName:"showRemoveItemLink",defaultValue:!0,extensions:f,arg:I});return(0,r.createElement)("tr",{className:s()("wc-block-cart-items__row",j,{"is-disabled":P}),ref:n,tabIndex:o},(0,r.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Ve(U,"alt")||!U.alt},$?(0,r.createElement)(qt,{image:U,fallbackAlt:B}):(0,r.createElement)("a",{href:b,tabIndex:-1},(0,r.createElement)(qt,{image:U,fallbackAlt:B}))),(0,r.createElement)("td",{c
|
|||
|
(0,c.__)("Remove %s from cart","woocommerce"),B),onClick:()=>{t(),N(),x("cart-remove-item",{product:e,quantity:C}),(0,Ot.speak)((0,c.sprintf)(/* translators: %s refers to the item name in the cart. */
|
|||
|
(0,c.__)("%s has been removed from your cart.","woocommerce"),B))},disabled:P},(0,c.__)("Remove item","woocommerce"))))),(0,r.createElement)("td",{className:"wc-block-cart-item__total"},(0,r.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},(0,r.createElement)($t,{currency:F,format:K,price:Y.getAmount()}),C>1&&(0,r.createElement)(co,{currency:A,saleAmount:no(L,A),format:q}))))}));o(6294);const lo=[...Array(3)].map(((_x,e)=>(0,r.createElement)(ao,{lineItem:{},key:e}))),io=e=>{const t={};return e.forEach((({key:e})=>{t[e]=(0,m.createRef)()})),t},uo=({lineItems:e=[],isLoading:t=!1,className:o})=>{const n=(0,m.useRef)(null),a=(0,m.useRef)(io(e));(0,m.useEffect)((()=>{a.current=io(e)}),[e]);const l=e=>()=>{null!=a&&a.current&&e&&a.current[e].current instanceof HTMLElement?a.current[e].current.focus():n.current instanceof HTMLElement&&n.current.focus()},i=t?lo:e.map(((t,o)=>{const c=e.length>o+1?e[o+1].key:null;return(0,r.createElement)(ao,{key:t.key,lineItem:t,onRemove:l(c),ref:a.current[t.key],tabIndex:-1})}));return(0,r.createElement)("table",{className:s()("wc-block-cart-items",o),ref:n,tabIndex:-1},(0,r.createElement)("thead",null,(0,r.createElement)("tr",{className:"wc-block-cart-items__header"},(0,r.createElement)("th",{className:"wc-block-cart-items__header-image"},(0,r.createElement)("span",null,(0,c.__)("Product","woocommerce"))),(0,r.createElement)("th",{className:"wc-block-cart-items__header-product"},(0,r.createElement)("span",null,(0,c.__)("Details","woocommerce"))),(0,r.createElement)("th",{className:"wc-block-cart-items__header-total"},(0,r.createElement)("span",null,(0,c.__)("Total","woocommerce"))))),(0,r.createElement)("tbody",null,i))},po=({className:e})=>{const{cartItems:t,cartIsLoading:o}=Le();return(0,r.createElement)(uo,{className:e,lineItems:t,isLoading:o})};(0,d.registerBlockType)("woocommerce/cart-line-items-block",{icon:{src:(0,r.createElement)(u.Z,{icon:Rt.Z,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Mt,null,(0,r.createElement)(po,{className:t})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})}),(0,d.registerBlockType)("woocommerce/cart-cross-sells-block",{icon:{src:(0,r.createElement)(u.Z,{icon:Rt.Z,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=(0,a.useBlockProps)({className:"wc-block-cart__cross-sells"}),t=[["core/heading",{content:(0,c.__)("You may be interested in…","woocommerce"),level:2,fontSize:"large"},[]],["woocommerce/cart-cross-sells-products-block",{},[]]];return(0,r.createElement)("div",{...e},(0,r.createElement)(a.InnerBlocks,{template:t,templateLock:!1}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});const mo=window.wp.components,go=window.wc.wcBlocksSharedContext,_o=window.wp.styleEngine;function ho(e={}){const t={};return(0,_o.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function bo(e,t){return e&&t?`has-${(0,Wt.o)(t)}-${e}`:""}const ko=e=>{const t=(e=>{const t=Fe(e)?e:{style:{}};let o=t.style;return Ee(o)&&(o=JSON.parse(o)||{}),Fe(o)||(o={}),{...t,style:o}})(e),o=function(e){var t,o,r,c,n,a,l;const{backgroundColor:i,textColor:u,gradient:d,style:p}=e,m=bo("background-color",i),g=bo("color",u),_=function(e){if(e)return`has-${e}-gradient-background`}(d),h=_||(null==p||null===(t=p.color)||void 0===t?void 0:t.gradient);return{className:s()(g,_,{[m]:!h&&!!m,"has-text-color":u||(null==p||null===(o=p.color)||void 0===o?void 0:o.text),"has-background":i||(null==p||null===(r=p.color)||void 0===r?void 0:r.background)||d||(null==p||null===(c=p.color)||void 0===c?void 0:c.gradient),"has-link-color":Fe(null==p||null===(n=p.elements)||void 0===n?void 0:n.link)?null==p||null===(a=p.elements)||void 0===a||null===(l=a.link)||void 0===l?void 0:l.color:void 0}),style:ho({color:(null==p?void 0:p.color)||{}})}}(t),r=function(e){var t;const o=(null===(t=e.style)||void 0===t?void 0:t.border)||{},r
|
|||
|
(0,c.__)("Link to %s","woocommerce"),b.name),C={href:b.permalink,...!E&&{"aria-label":f},onClick:()=>{w("product-view-link",{product:b})}};return(0,r.createElement)("div",{className:s()(t,"wc-block-components-product-image",{[`${h}__product-image`]:h},_.className),style:_.style},(0,r.createElement)(v,{...n&&C},!!a&&(0,r.createElement)(yo,{align:l,...g}),(0,r.createElement)(Co,{fallbackAlt:b.name,image:y,loaded:!k,showFullSize:o!==vo.THUMBNAIL,width:u,height:i,scale:d,aspectRatio:p})))};(0,wo.withProductDataContext)(So),o(5160);const No=({children:e,headingLevel:t,elementType:o=`h${t}`,...c})=>(0,r.createElement)(o,{...c},e),Po=e=>{const{className:t,headingLevel:o=2,showProductLink:c=!0,linkTarget:n,align:a}=e,l=ko(e),{parentClassName:i}=(0,go.useInnerBlockLayoutContext)(),{product:u}=(0,go.useProductDataContext)(),{dispatchStoreEvent:d}=We();return u.id?(0,r.createElement)(No,{headingLevel:o,className:s()(t,l.className,"wc-block-components-product-title",{[`${i}__product-title`]:i,[`wc-block-components-product-title--align-${a}`]:a&&Y()}),style:Y()?l.style:{}},(0,r.createElement)(jt,{disabled:!c,name:u.name,permalink:u.permalink,target:n,onClick:()=>{d("product-view-link",{product:u})}})):(0,r.createElement)(No,{headingLevel:o,className:s()(t,l.className,"wc-block-components-product-title",{[`${i}__product-title`]:i,[`wc-block-components-product-title--align-${a}`]:a&&Y()}),style:Y()?l.style:{}})};(0,wo.withProductDataContext)(Po),o(402);const xo=e=>({width:e/5*100+"%"}),Ro=({parentClassName:e})=>{const t=xo(0);return(0,r.createElement)("div",{className:s()("wc-block-components-product-rating__norating-container",`${e}-product-rating__norating-container`)},(0,r.createElement)("div",{className:"wc-block-components-product-rating__norating",role:"img"},(0,r.createElement)("span",{style:t})),(0,r.createElement)("span",null,(0,c.__)("No Reviews","woocommerce")))},To=e=>{const{rating:t,reviews:o,parentClassName:n}=e,a=xo(t),l=(0,c.sprintf)(/* translators: %f is referring to the average rating value */
|
|||
|
(0,c.__)("Rated %f out of 5","woocommerce"),t),i={__html:(0,c.sprintf)(/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
|
|||
|
(0,c._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",o,"woocommerce"),(0,c.sprintf)('<strong class="rating">%f</strong>',t),(0,c.sprintf)('<span class="rating">%d</span>',o))};return(0,r.createElement)("div",{className:s()("wc-block-components-product-rating__stars",`${n}__product-rating__stars`),role:"img","aria-label":l},(0,r.createElement)("span",{style:a,dangerouslySetInnerHTML:i}))},Io=e=>{const{reviews:t}=e,o=(0,c.sprintf)(/* translators: %s is referring to the total of reviews for a product */
|
|||
|
(0,c._n)("(%s customer review)","(%s customer reviews)",t,"woocommerce"),t);return(0,r.createElement)("span",{className:"wc-block-components-product-rating__reviews_count"},o)},Ao=e=>{const{textAlign:t,isDescendentOfSingleProductBlock:o,shouldDisplayMockedReviewsWhenProductHasNoReviews:c}=e,n=ko(e),{parentClassName:a}=(0,go.useInnerBlockLayoutContext)(),{product:l}=(0,go.useProductDataContext)(),i=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(l),u=(e=>{const t=we(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(l),d=s()(n.className,"wc-block-components-product-rating",{[`${a}__product-rating`]:a,[`has-text-align-${t}`]:t}),p=c?(0,r.createElement)(Ro,{parentClassName:a}):null,m=u?(0,r.createElement)(To,{rating:i,reviews:u,parentClassName:a}):p;if(u||c)return(0,r.createElement)("div",{className:d,style:n.style},(0,r.createElement)("div",{className:"wc-block-components-product-rating__container"},m,u&&o?(0,r.createElement)(Io,{reviews:u}):null))},Bo=((0,wo.withProductDataContext)(Ao),e=>{var t,o;const{className:c,textAlign:n,isDescendentOfSingleProductTemplate:a}=e,l=ko(e),{parentName:i,parentClassName:u}=(0,go.useInnerBlockLayoutContext)(),{product:d}=(0,go.useProductDataContext)(),p="woocommerce/all-products"===i,m=s()("wc-block-components-product-price",c,l.className,{[`${u}__product-price`]:u});if(!d.id&&!a){const e=(0,r.createElement)($t,{align:n,className:m});return p?(0,r.createElement)("div",{className:"wp-block-woocommerce-product-price"},e):e}const g=d.prices,_=a?(0,Vt.getCurrencyFromPriceResponse)():(0,Vt.getCurrencyFromPriceResponse)(g),h="5000",b=g.price!==g.regular_price,k=s()({[`${u}__product-price__value`]:u,[`${u}__product-price__value--on-sale`]:b}),w=(0,r.createElement)($t,{align:n,className:m,style:l.style,regularPriceStyle:l.style,priceStyle:l.style,priceClassName:k,currency:_,price:a?h:g.price,minPrice:null==g||null===(t=g.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==g||null===(o=g.price_range)||void 0===o?void 0:o.max_amount,regularPrice:a?h:g.regular_price,regularPriceClassName:s()({[`${u}__product-price__regular`]:u})});return p?(0,r.createElement)("div",{className:"wp-block-woocommerce-product-price"},w):w}),Mo=(e,t)=>{const o=e.find((({id:e})=>e===t));return o?o.quantity:0};o(1464);const Oo=({product:e,className:t,style:o})=>{const{id:n,permalink:a,add_to_cart:l,has_options:i,is_purchasable:u,is_in_stock:d}=e,{dispatchStoreEvent:p}=We(),{cartQuantity:_,addingToCart:h,addToCart:b}=(e=>{const{addItemToCart:t}=(0,z.useDispatch)(W.CART_STORE_KEY),{cartItems:o,cartIsLoading:r}=Le(),{createErrorNotice:c,removeNotice:n}=(0,z.useDispatch)("core/notices"),[s,a]=(0,m.useState)(!1),l=(0,m.useRef)(Mo(o,e));return(0,m.useEffect)((()=>{const t=Mo(o,e);t!==l.current&&(l.current=t)}),[o,e]),{cartQuantity:Number.isFinite(l.current)?l.current:0,addingToCart:s,cartIsLoading:r,addToCart:(o=1)=>(a(!0),t(e,o).then((()=>{n("add-to-cart")})).catch((e=>{c((0,ke.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})})).finally((()=>{a(!1)})))}})(n),k=Number.isFinite(_)&&_>0,w=!i&&u&&d,E=(0,ke.decodeEntities)((null==l?void 0:l.description)||""),y=k?(0,c.sprintf)(/* translators: %s number of products in cart. */
|
|||
|
(0,c._n)("%d in cart","%d in cart",_,"woocommerce"),_):(0,ke.decodeEntities)((null==l?void 0:l.text)||(0,c.__)("Add to cart","woocommerce")),v=w?"button":"a",f={};return w?f.onClick=async()=>{await b(),p("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=(0,g.getSetting)("productsSettings");t&&(window.location.href=I)}:(f.href=a,f.rel="nofollow",f.onClick=()=>{p("product-view-link",{product:e})}),(0,r.createElement)(v,{...f,"aria-label":E,disabled:h,className:s()(t,"wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",{loading:h,added:k}),style:o},y)},Do=({className:e,style:t})=>(0,r.createElement)("button",{className:s()("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",e),style:t,disabled:!0}),Lo=e=>{const{className:t,textAlign:o}=e,c=ko(e),{parentClassName:n}=(0,go.useInnerBlockLayoutContext)(),{product:a}=(0,go.useProductDataContext)();return(0,r.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button",{[`${n}__product-add-to-cart`]:n,[`align-${o}`]:o})},a.id?(0,r.createElement)(Oo,{product:a,style:c.style,className:c.className}):(0,r.createElement)(Do,{style:c.style,className:c.className}))},Fo=((0,wo.withProductDataContext)(Lo),({product:e})=>(0,r.createElement)("div",{className:"cross-sells-product"},(0,r.createElement)(go.InnerBlockLayoutContextProvider,{parentName:"woocommerce/cart-cross-sells-block",parentClassName:"wp-block-cart-cross-sells-product"},(0,r.createElement)(go.ProductDataContextProvider,{isLoading:!1,product:e},(0,r.createElement)("div",null,(0,r.createElement)(So,{className:"",showSaleBadge:!1,productId:e.id,showProductLink:!1,saleBadgeAlign:"left",imageSizing:vo.SINGLE,isDescendentOfQueryLoop:!1}),(0,r.createElement)(Po,{align:"",headingLevel:3,showProductLink:!0}),(0,r.createElement)(Ao,null),(0,r.createElement)(Eo,{productId:e.id,align:"left"}),(0,r.createElement)(Bo,null)),(0,r.createElement)(Lo,null))))),Vo=({products:e,columns:t})=>{const o=e.map(((e,o)=>o>=t?null:(0,r.createElement)(Fo,{isLoading:!1,product:e,key:e.id})));return(0,r.createElement)("div",null,o)},Yo={Z:3},Uo=({className:e,columns:t})=>{const{crossSellsProducts:o}=Le();return void 0===t&&(t=Yo.Z),(0,r.createElement)(Vo,{className:e,columns:t,products:o})};o(7995),o(8584),(0,d.registerBlockType)("woocommerce/cart-cross-sells-products-block",{icon:{src:(0,r.createElement)(u.Z,{icon:Rt.Z,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{className:o,columns:n}=e,s=(0,a.useBlockProps)();return(0,r.createElement)("div",{...s},(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(mo.PanelBody,{title:(0,c.__)("Settings","woocommerce")},(0,r.createElement)(mo.RangeControl,{label:(0,c.__)("Cross-Sells products to show","woocommerce"),value:n,onChange:e=>t({columns:e}),min:(0,g.getSetting)("minColumns",1),max:(0,g.getSetting)("maxColumns",6)}))),(0,r.createElement)(Mt,null,(0,r.createElement)(Uo,{columns:n,className:o})))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});const $o=(0,m.forwardRef)((({children:e,className:t=""},o)=>(0,r.createElement)("div",{ref:o,className:s()("wc-block-components-sidebar",t)},e)));function jo(e){const t=(0,m.useRef)(e);return ze()(e,t.current)||(t.current=e),t.current}o(8438),(0,d.registerBlockType)("woocommerce/cart-totals-block",{icon:{src:(0,r.createElement)(u.Z,{icon:Rt.Z,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)({className:"wc-block-cart__sidebar"}),o=Nt(wt.innerBlockAreas.CART_TOTALS),c=[["woocommerce/cart-order-summary-block",{},[]],["woocommerce/cart-express-payment-block",{},[]],["woocommerce/proceed-to-checkout-block",{},[]],["woocommerce/cart-accepted-payment-methods-block",{},[]]];return Pt({clientId:e,registeredBlocks:o,defaultTemplate:c}),(0,r.createElement)($o,{...t},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:o,template:c,templateL
|
|||
|
(0,c.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((e=>(s({coupon:{message:(0,ke.decodeEntities)(e.message),hidden:!1}}),Promise.resolve(!1)))),removeCoupon:t=>u(t).then((()=>((0,wt.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&n("info",(0,c.sprintf)(/* translators: %s coupon code. */
|
|||
|
(0,c.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((t=>(r(t.message,{id:"coupon-form",context:e}),Promise.resolve(!1)))),isApplyingCoupon:a,isRemovingCoupon:l}},cr=(e,t)=>{const o=[],r=(t,o)=>{const r=o+"_tax",c=Ve(e,o)&&Ee(e[o])?parseInt(e[o],10):0;return{key:o,label:t,value:c,valueWithTax:c+(Ve(e,r)&&Ee(e[r])?parseInt(e[r],10):0)}};return o.push(r((0,c.__)("Subtotal:","woocommerce"),"total_items")),o.push(r((0,c.__)("Fees:","woocommerce"),"total_fees")),o.push(r((0,c.__)("Discount:","woocommerce"),"total_discount")),o.push({key:"total_tax",label:(0,c.__)("Taxes:","woocommerce"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&o.push(r((0,c.__)("Shipping:","woocommerce"),"total_shipping")),o},nr=({isEditor:e,children:t})=>{const[o]=(0,m.useState)(""),[n]=(0,m.useState)(!1);if(n){let t=(0,c.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(e||g.CURRENT_USER_IS_ADMIN)&&(t=o||(0,c.__)("There was an error with this payment method. Please verify it's configured correctly.","woocommerce"));const n=[{id:"0",content:t,isDismissible:!1,status:"error"}];return(0,r.createElement)(Ft.StoreNoticesContainer,{additionalNotices:n,context:ge.PAYMENTS})}return(0,r.createElement)(r.Fragment,null,t)},sr="wc/store/payment",ar=()=>{const{isEditor:e}=H(),{activePaymentMethod:t,paymentMethodData:o}=(0,z.useSelect)((e=>{const t=e(sr);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData()}})),{__internalSetActivePaymentMethod:n,__internalSetExpressPaymentStarted:s,__internalSetPaymentIdle:a,__internalSetPaymentError:l,__internalSetPaymentMethodData:i,__internalSetExpressPaymentError:u}=(0,z.useDispatch)(sr),{paymentMethods:d}=Ko(),p=(()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:o,onCheckoutAfterProcessingWithError:r,onSubmit:n,onCheckoutSuccess:s,onCheckoutFail:a,onCheckoutValidation:l}=it(),{isCalculating:i,isComplete:u,isIdle:d,isProcessing:p,customerId:_}=(0,z.useSelect)((e=>{const t=e(W.CHECKOUT_STORE_KEY);return{isComplete:t.isComplete(),isIdle:t.isIdle(),isProcessing:t.isProcessing(),customerId:t.getCustomerId(),isCalculating:t.isCalculating()}})),{paymentStatus:h,activePaymentMethod:b,shouldSavePayment:k}=(0,z.useSelect)((e=>{const t=e(W.PAYMENT_STORE_KEY);return{paymentStatus:{get isPristine(){return Q()("isPristine",{since:"9.6.0",alternative:"isIdle",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentIdle()},isIdle:t.isPaymentIdle(),isStarted:t.isExpressPaymentStarted(),isProcessing:t.isPaymentProcessing(),get isFinished(){return Q()("isFinished",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()||t.isPaymentReady()},hasError:t.hasPaymentError(),get hasFailed(){return Q()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()},get isSuccessful(){return Q()("isSuccessful",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentReady()},isReady:t.isPaymentReady(),isDoingExpressPayment:t.isExpressPaymentMethodActive()},activePaymentMethod:t.getActivePaymentMethod(),shouldSavePayment:t.getShouldSavePaymentMethod()}})),{__internalSetExpressPaymentError:w}=(0,z.useDispatch)(W.PAYMENT_STORE_KEY),{onPaymentProcessing:E,onPaymentSetup:y}=(0,m.useContext)(oe),{shippingErrorStatus:v,shippingErrorTypes:f,onShippingRateSuccess:C,onShippingRateFail:S,onShippingRateSelectSuccess:N,onShippingRateSelectFail:P}=tt(),{shippingRates:x,isLoadingRates:R,selectedRates:T,isSelectingRate:I,selectShippingRate:A,needsShipping:B}=Ge(),{billingAddress:M,shippingAddress:O}=(0,z.useSelect)((e=>e(W.CART_STORE_KEY).getCustomerData())),{setShippingAddress:D}=(0,z.useDispatch)(W.C
|
|||
|
(0,c.__)('<a href="%s">Browse store</a>',"woocommerce"),x),dropCap:!1}]:null,vr=[["core/heading",{textAlign:"center",content:(0,c.__)("Your cart is currently empty!","woocommerce"),level:2,className:"with-empty-cart-icon wc-block-cart__empty-cart__title"}],yr,["core/separator",{className:"is-style-dots"}],["core/heading",{textAlign:"center",content:(0,c.__)("New in store","woocommerce"),level:2}],["woocommerce/product-new",{columns:4,rows:1}]].filter(Boolean);o(4974),(0,d.registerBlockType)("woocommerce/empty-cart-block",{icon:{src:(0,r.createElement)(u.Z,{icon:Er,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)(),{currentView:o}=H(),c=Nt(wt.innerBlockAreas.EMPTY_CART);return Pt({clientId:e,registeredBlocks:c,defaultTemplate:vr}),(0,r.createElement)("div",{...t,hidden:"woocommerce/empty-cart-block"!==o},(0,r.createElement)(a.InnerBlocks,{template:vr,templateLock:!1,renderAppender:a.InnerBlocks.ButtonBlockAppender}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()},(0,r.createElement)(a.InnerBlocks.Content,null))});const fr=e=>Object.values(e).reduce(((e,t)=>(null!==t.icons&&(e=e.concat(t.icons)),e)),[]),Cr=({className:e})=>{const{paymentMethods:t}=zo(!1);return(0,r.createElement)(or,{className:e,icons:fr(t)})};(0,d.registerBlockType)("woocommerce/cart-accepted-payment-methods-block",{icon:{src:(0,r.createElement)(u.Z,{icon:Go.Z,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e})=>{const{className:t}=e,o=(0,a.useBlockProps)();return(0,r.createElement)("div",{...o},(0,r.createElement)(Cr,{className:t}))},save:()=>(0,r.createElement)("div",{...a.useBlockProps.save()})});const Sr=(0,r.createElement)(l.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(5454);const Nr=(0,yt.withInstanceId)((({instanceId:e,isLoading:t=!1,onSubmit:o,displayCouponForm:n=!1})=>{const[a,l]=(0,m.useState)(""),[i,u]=(0,m.useState)(!n),d=`wc-block-components-totals-coupon__input-${e}`,p=s()("wc-block-components-totals-coupon__content",{"screen-reader-text":i}),{validationErrorId:g}=(0,z.useSelect)((e=>({validationErrorId:e(W.VALIDATION_STORE_KEY).getValidationErrorId(d)})));return(0,r.createElement)("div",{className:"wc-block-components-totals-coupon"},i?(0,r.createElement)("a",{role:"button",href:"#wc-block-components-totals-coupon__form",className:"wc-block-components-totals-coupon-link","aria-label":(0,c.__)("Add a coupon","woocommerce"),onClick:e=>{e.preventDefault(),u(!1)}},(0,c.__)("Add a coupon","woocommerce")):(0,r.createElement)(Ho,{screenReaderLabel:(0,c.__)("Applying coupon…","woocommerce"),isLoading:t,showSpinner:!1},(0,r.createElement)("div",{className:p},(0,r.createElement)("form",{className:"wc-block-components-totals-coupon__form",id:"wc-block-components-totals-coupon__form"},(0,r.createElement)(Ft.ValidatedTextInput,{id:d,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:(0,c.__)("Enter code","woocommerce"),value:a,ariaDescribedBy:g,onChange:e=>{l(e)},focusOnMount:!0,validateOnMount:!1,showError:!1}),(0,r.createElement)(hr,{className:"wc-block-components-totals-coupon__button",disabled:t||!a,showSpinner:t,onClick:e=>{var t;e.preventDefault(),void 0!==o?null===(t=o(a))||void 0===t||t.then((e=>{e&&(l(""),u(!0))})):(l(""),u(!0))},type:"submit"},(0,c.__)("Apply","woocommerce"))),(0,r.createElement)(Ft.ValidationInputError,{propertyName:"coupon",elementId:d}))))}));o(
|
|||
|
(0,c.__)("Coupon: %s","woocommerce"),e.label),disabled:o,onRemove:()=>{n(e.code)},radius:"large",ariaLabel:(0,c.sprintf)(/* translators: %s is a coupon code. */
|
|||
|
(0,c.__)('Remove coupon "%s"',"woocommerce"),e.label)}))))),label:d?(0,c.__)("Discount","woocommerce"):(0,c.__)("Coupons","woocommerce"),value:d?-1*d:"-"})};o(6305);const Rr=({currency:e,values:t,className:o})=>{const n=(0,g.getSetting)("taxesEnabled",!0)&&(0,g.getSetting)("displayCartPricesIncludingTax",!1),{total_price:a,total_tax:l,tax_lines:i}=t,{receiveCart:u,...d}=Le(),p=(0,wt.applyCheckoutFilter)({filterName:"totalLabel",defaultValue:(0,c.__)("Total","woocommerce"),extensions:d.extensions,arg:{cart:d}}),_=parseInt(l,10),h=i&&i.length>0?(0,c.sprintf)(/* translators: %s is a list of tax rates */
|
|||
|
(0,c.__)("Including %s","woocommerce"),i.map((({name:t,price:o})=>`${(0,Vt.formatPrice)(o,e)} ${t}`)).join(", ")):(0,c.__)("Including <TaxAmount/> in taxes","woocommerce");return(0,r.createElement)(Ft.TotalsItem,{className:s()("wc-block-components-totals-footer-item",o),currency:e,label:p,value:parseInt(a,10),description:n&&0!==_&&(0,r.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},(0,m.createInterpolateElement)(h,{TaxAmount:(0,r.createElement)(Ft.FormattedMonetaryAmount,{className:"wc-block-components-totals-footer-item-tax-value",currency:e,value:_})}))})},Tr=({selectedShippingRates:e})=>(0,r.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},(0,ke.decodeEntities)(e.filter(((t,o)=>e.indexOf(t)===o)).join(", ")));o(7866);var Ir=o(5287);o(5821);const Ar=(0,yt.withInstanceId)((({id:e,className:t,label:o,onChange:n,options:a,value:l,required:i=!1,errorMessage:u=(0,c.__)("Please select a value.","woocommerce"),errorId:d,instanceId:p="0",autoComplete:g="off"})=>{const _=(0,m.useRef)(null),h=e||"control-"+p,b=d||h,{setValidationErrors:k,clearValidationError:w}=(0,z.useDispatch)(W.VALIDATION_STORE_KEY),E=(0,z.useSelect)((e=>e(W.VALIDATION_STORE_KEY).getValidationError(b)));return(0,m.useEffect)((()=>(!i||l?w(b):k({[b]:{message:u,hidden:!0}}),()=>{w(b)})),[w,l,b,u,i,k]),(0,r.createElement)("div",{id:h,className:s()("wc-block-components-combobox",t,{"is-active":l,"has-error":(null==E?void 0:E.message)&&!(null!=E&&E.hidden)}),ref:_},(0,r.createElement)(Ir.Z,{className:"wc-block-components-combobox-control",label:o,onChange:n,onFilterValueChange:e=>{if(e.length){const t=Fe(_.current)?_.current.ownerDocument.activeElement:void 0;if(t&&Fe(_.current)&&_.current.contains(t))return;const o=e.toLocaleUpperCase(),r=a.find((e=>e.value.toLocaleUpperCase()===o));if(r)return void n(r.value);const c=a.find((e=>e.label.toLocaleUpperCase().startsWith(o)));c&&n(c.value)}},options:a,value:l||"",allowReset:!1,autoComplete:g,"aria-invalid":(null==E?void 0:E.message)&&!(null!=E&&E.hidden)}),(0,r.createElement)(Ft.ValidationInputError,{propertyName:b}))}));o(7775);const Br=({className:e,countries:t,id:o,label:n,onChange:a,value:l="",autoComplete:i="off",required:u=!1,errorId:d,errorMessage:p=(0,c.__)("Please select a country","woocommerce")})=>{const g=(0,m.useMemo)((()=>Object.entries(t).map((([e,t])=>({value:e,label:(0,ke.decodeEntities)(t)})))),[t]);return(0,r.createElement)("div",{className:s()(e,"wc-block-components-country-input")},(0,r.createElement)(Ar,{id:o,label:n,onChange:a,options:g,value:l,errorId:d,errorMessage:p,required:u,autoComplete:i}))},Mr=e=>(0,r.createElement)(Br,{countries:O,...e}),Or=e=>(0,r.createElement)(Br,{countries:L,...e});o(8410);const Dr=(e,t)=>{const o=t.find((t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()));return o?o.value:""},Lr=({className:e,id:t,states:o,country:n,label:a,onChange:l,autoComplete:i="off",value:u="",required:d=!1,errorId:p=""})=>{const g=o[n],_=(0,m.useMemo)((()=>g?Object.keys(g).map((e=>({value:e,label:(0,ke.decodeEntities)(g[e])}))):[]),[g]),h=(0,m.useCallback)((e=>{const t=_.length>0?Dr(e,_):e;t!==u&&l(t)}),[l,_,u]),b=(0,m.useRef)(u);return(0,m.useEffect)((()=>{b.current!==u&&(b.current=u)}),[u]),(0,m.useEffect)((()=>{if(_.length>0&&b.current){const e=Dr(b.current,_);e!==b.current&&h(e)}}),[_,h]),_.length>0?(0,r.createElement)(Ar,{className:s()(e,"wc-block-components-state-input"),id:t,label:a,onChange:h,options:_,value:u,errorMessage:(0,c.__)("Please select a state.","woocommerce"),errorId:p,required:d,autoComplete:i}):(0,r.createElement)(Ft.ValidatedTextInput,{className:e,id:t,label:a,onChange:h,autoComplete:i,value:u,required:d})},Fr=e=>(0,r.createElement)(Lr,{states:D,...e}),Vr=e=>(0,r.createElement)(Lr,{states:F,...e}),Yr=Object.keys(g.defaultAddressFields),Ur=({id:e="",fields:t=Yr,fieldConfig:o={},onChange:n,type:s="shipping",values:a})=>{const l=(0,yt.useInstanceId)(Ur),i=jo(t),u=jo(o),d=jo(a.country),p=(0,m.useMemo)((()=>{const e
|
|||
|
(0,c.__)("Collection from %s","woocommerce"),e)+" ")},Zr=({formattedLocation:e})=>e?(0,r.createElement)("span",{className:"wc-block-components-shipping-address"},(0,c.sprintf)(/* translators: %s location. */
|
|||
|
(0,c.__)("Shipping to %s","woocommerce"),e)+" "):null,Wr=({showCalculator:e,isShippingCalculatorOpen:t,setIsShippingCalculatorOpen:o,shippingAddress:n})=>{const{isEditor:s}=H(),a=(0,z.useSelect)((e=>e(W.CHECKOUT_STORE_KEY).prefersCollection()));if(!Ne(n)&&!s)return null;const l=Ne(n);return(0,r.createElement)(r.Fragment,null,a?(0,r.createElement)(qr,null):(0,r.createElement)(Zr,{formattedLocation:l}),e&&(0,r.createElement)(Kr,{label:(0,c.__)("Change address","woocommerce"),isShippingCalculatorOpen:t,setIsShippingCalculatorOpen:o}))};var Gr=o(5202),Qr=(o(1365),o(8184)),Xr=o(5430),Jr=o(5045);const ec=e=>{switch(e){case"success":case"warning":case"info":case"default":return"polite";default:return"assertive"}},tc=e=>{switch(e){case"success":return Qr.Z;case"warning":case"info":case"error":return Xr.Z;default:return Jr.Z}},oc=({className:e,status:t="default",children:o,spokenMessage:n=o,onRemove:a=(()=>{}),isDismissible:l=!0,politeness:i=ec(t),summary:d})=>(((e,t)=>{const o="string"==typeof e?e:(0,m.renderToString)(e);(0,m.useEffect)((()=>{o&&(0,Ot.speak)(o,t)}),[o,t])})(n,i),(0,r.createElement)("div",{className:s()(e,"wc-block-components-notice-banner","is-"+t,{"is-dismissible":l})},(0,r.createElement)(u.Z,{icon:tc(t)}),(0,r.createElement)("div",{className:"wc-block-components-notice-banner__content"},d&&(0,r.createElement)("p",{className:"wc-block-components-notice-banner__summary"},d),o),!!l&&(0,r.createElement)(hr,{className:"wc-block-components-notice-banner__dismiss",icon:Gr.Z,label:(0,c.__)("Dismiss this notice","woocommerce"),onClick:e=>{"function"==typeof(null==e?void 0:e.preventDefault)&&e.preventDefault&&e.preventDefault(),a()},showTooltip:!1})));var rc=o(7856),cc=o.n(rc);const nc=["a","b","em","i","strong","p","br"],sc=["target","href","rel","name","download"],ac=(e,t)=>{const o=(null==t?void 0:t.tags)||nc,r=(null==t?void 0:t.attr)||sc;return cc().sanitize(e,{ALLOWED_TAGS:o,ALLOWED_ATTR:r})},lc=e=>{const t=(0,g.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:(0,ke.decodeEntities)(e.name),value:e.rate_id,description:(0,r.createElement)(r.Fragment,null,Number.isFinite(t)&&(0,r.createElement)(Ft.FormattedMonetaryAmount,{currency:(0,Vt.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,(0,ke.decodeEntities)(e.delivery_time))}},ic=({className:e="",noResultsMessage:t,onSelectRate:o,rates:c,renderOption:n=lc,selectedRate:s,disabled:a=!1})=>{const l=(null==s?void 0:s.rate_id)||"",i=rt(l),[u,d]=(0,m.useState)((()=>{var e;return l||(null===(e=c[0])||void 0===e?void 0:e.rate_id)}));if((0,m.useEffect)((()=>{l&&l!==i&&l!==u&&d(l)}),[l,u,i]),(0,m.useEffect)((()=>{u&&o(u)}),[o,u]),0===c.length)return t;if(c.length>1)return(0,r.createElement)(Ft.RadioControl,{className:e,onChange:e=>{d(e),o(e)},disabled:a,selected:u,options:c.map(n)});const{label:p,secondaryLabel:g,description:_,secondaryDescription:h}=n(c[0]);return(0,r.createElement)(Ft.RadioControlOptionLayout,{label:p,secondaryLabel:g,description:_,secondaryDescription:h})};o(6125);const uc=({packageId:e,className:t="",noResultsMessage:o,renderOption:n,packageData:a,collapsible:l,showItems:i})=>{const{selectShippingRate:u,isSelectingRate:d}=Ge(),p=document.querySelectorAll(".wc-block-components-shipping-rates-control__package").length>1,g=null!=i?i:p,_=null!=l?l:p,h=(0,r.createElement)(r.Fragment,null,(_||g)&&(0,r.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title",dangerouslySetInnerHTML:{__html:ac(a.name)}}),g&&(0,r.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(a.items).map((e=>{const t=(0,ke.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)(Ft.Label,{label:o>1?`${t} × ${o}`:`${t}`,screenReaderLabel:(0,c.sprintf)(/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
|
|||
|
(0,c._n)("%1$s (%2$d unit)","%1$s (%2$d units)",o,"woocommerce"),t,o)}))})))),b=(0,m.useCallback)((t=>{u(t,e)}),[e,u]),k={className:t,noResultsMessage:o,rates:a.shipping_rates,onSelectRate:b,selectedRate:a.shipping_rates.find((e=>e.selected)),renderOption:n,disabled:d};return _?(0,r.createElement)(Ft.Panel,{className:s()("wc-block-components-shipping-rates-control__package",t,{"wc-block-components-shipping-rates-control__package--disabled":d}),initialOpen:!1,title:h},(0,r.createElement)(ic,{...k})):(0,r.createElement)("div",{className:s()("wc-block-components-shipping-rates-control__package",t,{"wc-block-components-shipping-rates-control__package--disabled":d})},h,(0,r.createElement)(ic,{...k}))},dc=({packages:e,showItems:t,collapsible:o,noResultsMessage:c,renderOption:n})=>e.length?(0,r.createElement)(r.Fragment,null,e.map((({package_id:e,...s})=>(0,r.createElement)(uc,{key:e,packageId:e,packageData:s,collapsible:o,showItems:t,noResultsMessage:c,renderOption:n})))):null,pc=({shippingRates:e,isLoadingRates:t,className:o,collapsible:n,showItems:s,noResultsMessage:a,renderOption:l,context:i})=>{(0,m.useEffect)((()=>{var o,r;t||(o=(e=>e.length)(e),r=(e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0))(e),1===o?(0,Ot.speak)((0,c.sprintf)(/* translators: %d number of shipping options found. */
|
|||
|
(0,c._n)("%d shipping option was found.","%d shipping options were found.",r,"woocommerce"),r)):(0,Ot.speak)((0,c.sprintf)(/* translators: %d number of shipping packages packages. */
|
|||
|
(0,c._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",o,"woocommerce"),o)+" "+(0,c.sprintf)(/* translators: %d number of shipping options available. */
|
|||
|
(0,c._n)("%d shipping option was found","%d shipping options were found",r,"woocommerce"),r)))}),[t,e]);const{extensions:u,receiveCart:d,...p}=Le(),g={className:o,collapsible:n,showItems:s,noResultsMessage:a,renderOption:l,extensions:u,cart:p,components:{ShippingRatesControlPackage:uc},context:i},{isEditor:_}=H(),{hasSelectedLocalPickup:h,selectedRates:b}=Ge(),k=Fe(b)?Object.values(b):[],w=k.every((e=>e===k[0]));return(0,r.createElement)(Ho,{isLoading:t,screenReaderLabel:(0,c.__)("Loading shipping rates…","woocommerce"),showSpinner:!0},h&&"woocommerce/cart"===i&&e.length>1&&!w&&!_&&(0,r.createElement)(oc,{className:"wc-block-components-notice",isDismissible:!1,status:"warning"},(0,c.__)("Multiple shipments must have the same pickup location","woocommerce")),(0,r.createElement)(wt.ExperimentalOrderShippingPackages.Slot,{...g}),(0,r.createElement)(wt.ExperimentalOrderShippingPackages,null,(0,r.createElement)(dc,{packages:e,noResultsMessage:a,renderOption:l})))},mc=({hasRates:e,shippingRates:t,isLoadingRates:o,isAddressComplete:n})=>{const s=e?(0,c.__)("Shipping options","woocommerce"):(0,c.__)("Choose a shipping option","woocommerce");return(0,r.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},(0,r.createElement)("legend",{className:"screen-reader-text"},s),(0,r.createElement)(pc,{className:"wc-block-components-totals-shipping__options",noResultsMessage:(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(oc,{isDismissible:!1,className:"wc-block-components-shipping-rates-control__no-results-notice",status:"warning"},(0,c.__)("There are no shipping options available. Please check your shipping address.","woocommerce"))),shippingRates:t,isLoadingRates:o,context:"woocommerce/cart"}))};o(5092);const gc=({currency:e,values:t,showCalculator:o=!0,showRateSelector:n=!0,isCheckout:a=!1,className:l})=>{const[i,u]=(0,m.useState)(!1),{shippingAddress:d,cartHasCalculatedShipping:p,shippingRates:_,isLoadingRates:h}=Le(),b=(e=>(0,g.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.total_shipping,10)+parseInt(e.total_shipping_tax,10):parseInt(e.total_shipping,10))(t),k=_.some((e=>e.shipping_rates.length))||b>0,w=o&&i,E=(0,z.useSelect)((e=>e(W.CHECKOUT_STORE_KEY).prefersCollection())),y=_.flatMap((e=>e.shipping_rates.filter((e=>E&&Ue(e)&&e.selected||!E&&e.selected)).flatMap((e=>e.name)))),v=(e=>!!e.city&&!!e.country)(d),f=((e,t,o)=>!e||!t&&o.some((e=>!e.shipping_rates.some((e=>!$e(e.method_id))))))(k,E,_);return(0,r.createElement)("div",{className:s()("wc-block-components-totals-shipping",l)},(0,r.createElement)(Ft.TotalsItem,{label:(0,c.__)("Shipping","woocommerce"),value:!f&&p?b:(!v||a)&&(0,r.createElement)(Hr,{showCalculator:o,isCheckout:a,isShippingCalculatorOpen:i,setIsShippingCalculatorOpen:u}),description:!f&&p||v&&!a?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Tr,{selectedShippingRates:y}),(0,r.createElement)(Wr,{shippingAddress:d,showCalculator:o,isShippingCalculatorOpen:i,setIsShippingCalculatorOpen:u})):null,currency:e}),w&&(0,r.createElement)(zr,{onUpdate:()=>{u(!1)},onCancel:()=>{u(!1)}}),n&&p&&!w&&(0,r.createElement)(mc,{hasRates:k,shippingRates:_,isLoadingRates:h,isAddressComplete:v}))},_c=()=>{const{extensions:e,receiveCart:t,...o}=Le(),c={extensions:e,cart:o,context:"woocommerce/cart"};return(0,r.createElement)(wt.ExperimentalOrderMeta.Slot,{...c})};(0,d.registerBlockType)("woocommerce/cart-order-summary-block",{icon:{src:(0,r.createElement)(u.Z,{icon:Sr,className:"wc-block-editor-components-block-icon"})},edit:({clientId:e})=>{const t=(0,a.useBlockProps)(),{cartTotals:o}=Le(),n=(0,Vt.getCurrencyFromPriceResponse)(o),s=Nt(wt.innerBlockAreas.CART_ORDER_SUMMARY),l=[["woocommerce/cart-order-summary-heading-block",{content:(0,c.__)("Cart totals","woocommerce")},[]],["woocommerce/cart-order-summary-coupon-form-block",{},[]],["woocommerce/cart-order-summary-subtotal-block",{},[]],["woocommerce/cart-order-summary-fee-block",{},[]],["woocommerce/cart-order-summary-discount-block",{},[]],["woocommerce/cart-order-summary-shipping-block",{},[]],["woocommerce/cart-orde
|
|||
|
// translators: %s is the name of the extension.
|
|||
|
(0,c.__)("<strong>%s</strong> does not yet support this block. This may impact the shopper experience. <a>Learn more</a>","woocommerce"),Object.values(l)[0]),{strong:(0,r.createElement)("strong",null),a:(0,r.createElement)(mo.ExternalLink,{href:"https://woocommerce.com/document/cart-checkout-blocks-support-status/"})}));return(0,r.createElement)(mo.Notice,{className:"wc-blocks-incompatible-extensions-notice",status:"warning",onRemove:s,spokenMessage:C},(0,r.createElement)("div",{className:"wc-blocks-incompatible-extensions-notice__content"},(0,r.createElement)(u.Z,{className:"wc-blocks-incompatible-extensions-notice__warning-icon",icon:(0,r.createElement)(Oc,null)}),(0,r.createElement)("div",null,(0,r.createElement)("p",null,C),i>1&&(0,r.createElement)("ul",null,Object.entries(l).map((([e,t])=>(0,r.createElement)("li",{key:e,className:"wc-blocks-incompatible-extensions-notice__element"},t)))),(0,r.createElement)(mo.Button,{variant:"secondary",onClick:()=>{(0,Lc.Ny)("switch_to_classic_shortcode_click",{shortcode:"woocommerce/checkout"===t?"checkout":"cart"}),_(!0)}},v),p&&(0,r.createElement)(mo.Modal,{size:"medium",title:v,onRequestClose:h,className:"wc-blocks-incompatible-extensions-notice-modal-content"},(0,r.createElement)(Yc,{blockType:t}),(0,r.createElement)(mo.TabbableContainer,{className:"wc-blocks-incompatible-extensions-notice-modal-actions"},(0,r.createElement)(mo.Button,{variant:"primary",isDestructive:!0,onClick:()=>{k(o,(0,d.createBlock)("woocommerce/classic-shortcode",{shortcode:"woocommerce/checkout"===t?"checkout":"cart"})),(0,Lc.Ny)("switch_to_classic_shortcode_confirm",{shortcode:"woocommerce/checkout"===t?"checkout":"cart"}),(()=>{const e=Fc({blocks:y(),findCondition:e=>"woocommerce/classic-shortcode"===e.name});e&&w(e.clientId)})(),b(f,{actions:[{label:(0,c.__)("Undo","woocommerce"),onClick:()=>{E(),(0,Lc.Ny)("switch_to_classic_shortcode_undo",{shortcode:"woocommerce/checkout"===t?"checkout":"cart"})}}],type:"snackbar"}),h()}},(0,c.__)("Switch","woocommerce"))," ",(0,r.createElement)(mo.Button,{variant:"secondary",onClick:()=>{(0,Lc.Ny)("switch_to_classic_shortcode_cancel",{shortcode:"woocommerce/checkout"===t?"checkout":"cart"}),h()}},(0,c.__)("Cancel","woocommerce")))))))}o(1128);var $c=o(7286),jc=o(6755);o(4662);const zc=({text:e,title:t=(0,c.__)("Feedback?","woocommerce"),url:o})=>{const[n,s]=(0,m.useState)(!1);return(0,m.useEffect)((()=>{s(!0)}),[]),(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)("div",{className:"wc-block-feedback-prompt"},(0,r.createElement)(u.Z,{icon:$c.Z}),(0,r.createElement)("h2",{className:"wc-block-feedback-prompt__title"},t),(0,r.createElement)("p",{className:"wc-block-feedback-prompt__text"},e),(0,r.createElement)("a",{href:o,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},(0,c.__)("Give us your feedback.","woocommerce"),(0,r.createElement)(u.Z,{icon:jc.Z,size:16}))))},Kc=()=>(0,r.createElement)(zc,{text:(0,c.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.","woocommerce"),url:"https://github.com/woocommerce/woocommerce/discussions/new?category=checkout-flow&labels=type%3A+product%20feedback"}),Hc=(0,yt.createHigherOrderComponent)((e=>t=>{const{clientId:o,name:c,isSelected:n}=t,[s,l]=(0,m.useState)(!0),{isCart:i,isCheckout:u,isPaymentMethodsBlock:d,hasPaymentMethods:p,parentId:g}=(0,z.useSelect)((e=>{const{getBlockParentsByBlockName:t,getBlockName:r}=e(a.store),c=t(o,["woocommerce/cart","woocommerce/checkout"]).reduce(((e,t)=>(e[r(t)]=t,e)),{}),n=r(o),s=Object.keys(c).includes("woocommerce/cart"),l=Object.keys(c).includes("woocommerce/checkout"),i="woocommerce/cart"===n||s,u=i?"woocommerce/cart":"woocommerce/checkout";return{isCart:i,isCheckout:"woocommerce/checkout"===n||l,parentId:n===u?o:c[u],isPaymentMethodsBlock:"woocommerce/checkout-payment-block"===n,hasPaymentMethods:e(W.PAYMENT_STORE_KEY).paymentMethodsInitialized()&&Object.keys(e(W.PAYMENT_STORE_KEY).getAvailablePaymentMethods()).length>0}}));return c.startsWith("wooco
|