(self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp=self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp||[]).push([[3819],{6838:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>O});var c=a(1609),s=a(8645),n=a(2796),o=a(6087),r=a(7723),l=a(851),i=a(5703),d=a(2150),m=a(1616),u=a(9499),p=a(8537),g=a(4656);a(6007);const _=(0,m.withProductDataContext)((e=>{const{className:t,align:a}=e,s=(0,d.p)(e),{parentClassName:o}=(0,n.useInnerBlockLayoutContext)(),{product:i}=(0,n.useProductDataContext)();if(!(i.id&&i.on_sale||e.isDescendentOfSingleProductTemplate))return null;const m="string"==typeof a?`wc-block-components-product-sale-badge--align-${a}`:"";return(0,c.createElement)("div",{className:(0,l.A)("wc-block-components-product-sale-badge",t,m,{[`${o}__product-onsale`]:o},s.className),style:s.style},(0,c.createElement)(g.Label,{label:(0,r.__)("Sale","woocommerce"),screenReaderLabel:(0,r.__)("Product on sale","woocommerce")}))}));a(5183);let w=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({});const N=e=>(0,c.createElement)("img",{...e,src:i.PLACEHOLDER_IMG_SRC,alt:e.alt,width:void 0,height:void 0}),k=({image:e,loaded:t,showFullSize:a,fallbackAlt:s,width:n,scale:r,height:l,aspectRatio:i})=>{const{thumbnail:d,src:m,srcset:u,sizes:p,alt:g}=e||{},_={alt:g||s,hidden:!t,src:d,...a&&{src:m,srcSet:u,sizes:p}},w={height:l,width:n,objectFit:r,aspectRatio:i};return(0,c.createElement)(o.Fragment,null,_.src&&(0,c.createElement)("img",{style:w,"data-testid":"product-image",..._}),!e&&(0,c.createElement)(N,{style:w,alt:_.alt}))},v=e=>{const{className:t,imageSizing:a=w.SINGLE,showProductLink:s=!0,showSaleBadge:i,saleBadgeAlign:m="right",height:g,width:v,scale:b,aspectRatio:h,...E}=e,y=(0,d.p)(e),{parentClassName:C}=(0,n.useInnerBlockLayoutContext)(),{product:P,isLoading:f}=(0,n.useProductDataContext)(),{dispatchStoreEvent:A}=(0,u.y)();if(!P.id)return(0,c.createElement)("div",{className:(0,l.A)(t,"wc-block-components-product-image",{[`${C}__product-image`]:C},y.className),style:y.style},(0,c.createElement)(N,null));const L=!!P.images.length,x=L?P.images[0]:null,$=s?"a":o.Fragment,S=(0,r.sprintf)(/* translators: %s is referring to the product name */ /* translators: %s is referring to the product name */
(0,r.__)("Link to %s","woocommerce"),P.name),R={href:P.permalink,...!L&&{"aria-label":S},onClick:()=>{A("product-view-link",{product:P})}};return delete E.style,(0,c.createElement)("div",{className:(0,l.A)(t,"wc-block-components-product-image",{[`${C}__product-image`]:C},y.className),style:y.style},(0,c.createElement)($,{...s&&R},!!i&&(0,c.createElement)(_,{align:m,...E}),(0,c.createElement)(k,{fallbackAlt:(0,p.decodeEntities)(P.name),image:x,loaded:!f,showFullSize:a!==w.THUMBNAIL,width:v,height:g,scale:b,aspectRatio:h})))};(0,m.withProductDataContext)(v);var b=a(7702);a(7128);const h=({children:e,headingLevel:t,elementType:a=`h${t}`,...s})=>(0,c.createElement)(a,{...s},e),E=e=>{const{className:t,headingLevel:a=2,showProductLink:s=!0,linkTarget:o,align:r}=e,i=(0,d.p)(e),{parentClassName:m}=(0,n.useInnerBlockLayoutContext)(),{product:p}=(0,n.useProductDataContext)(),{dispatchStoreEvent:g}=(0,u.y)();return p.id?(0,c.createElement)(h,{headingLevel:a,className:(0,l.A)(t,i.className,"wc-block-components-product-title",{[`${m}__product-title`]:m,[`wc-block-components-product-title--align-${r}`]:r}),style:i.style},(0,c.createElement)(b.A,{disabled:!s,name:p.name,permalink:p.permalink,target:o,onClick:()=>{g("product-view-link",{product:p})}})):(0,c.createElement)(h,{headingLevel:a,className:(0,l.A)(t,i.className,"wc-block-components-product-title",{[`${m}__product-title`]:m,[`wc-block-components-product-title--align-${r}`]:r}),style:i.style})};(0,m.withProductDataContext)(E);var y=a(3993);const C=e=>({width:e/5*100+"%"}),P=({className:e,parentClassName:t})=>{const a=C(0);return(0,c.createElement)("div",{className:(0,l.A)(`${e}__norating-container`,`${t}-product-rating__norating-container`)},(0,c.createElement)("div",{className:`${e}__norating`,role:"img"},(0,c.createElement)("span",{style:a})),(0,c.createElement)("span",null,(0,r.__)("No Reviews","woocommerce")))},f=e=>{const{className:t,rating:a,reviews:s,parentClassName:n}=e,o=C(a),i=(0,r.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */
(0,r.__)("Rated %f out of 5","woocommerce"),a),d={__html:(0,r.sprintf)(/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
(0,r._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",s,"woocommerce"),(0,r.sprintf)('<strong class="rating">%f</strong>',a),(0,r.sprintf)('<span class="rating">%d</span>',s))};return(0,c.createElement)("div",{className:(0,l.A)(`${t}__stars`,`${n}__product-rating__stars`),role:"img","aria-label":i},(0,c.createElement)("span",{style:o,dangerouslySetInnerHTML:d}))},A=e=>{const{className:t,reviews:a}=e,s=(0,r.sprintf)(/* translators: %s is referring to the total of reviews for a product */ /* translators: %s is referring to the total of reviews for a product */
(0,r._n)("(%s customer review)","(%s customer reviews)",a,"woocommerce"),a);return(0,c.createElement)("span",{className:`${t}__reviews_count`},s)},L=e=>{const{className:t="wc-block-components-product-rating",showReviewCount:a,showMockedReviews:s,parentClassName:n="",rating:o,reviews:r,styleProps:i,textAlign:d}=e,m=(0,l.A)(i.className,t,{[`${n}__product-rating`]:n,[`has-text-align-${d}`]:d}),u=s&&(0,c.createElement)(P,{className:t,parentClassName:n}),p=r?(0,c.createElement)(f,{className:t,rating:o,reviews:r,parentClassName:n}):u,g=r&&a;return(0,c.createElement)("div",{className:m,style:i.style},(0,c.createElement)("div",{className:`${t}__container`},p,g?(0,c.createElement)(A,{className:t,reviews:r}):null))};a(7195);const x=e=>{const{textAlign:t="",shouldDisplayMockedReviewsWhenProductHasNoReviews:a}=e,s=(0,d.p)(e),{parentClassName:o}=(0,n.useInnerBlockLayoutContext)(),{product:r}=(0,n.useProductDataContext)(),l=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(r),i=(e=>{const t=(0,y.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(r);return(0,c.createElement)(L,{className:"wc-block-components-product-rating-stars",showMockedReviews:a,styleProps:s,parentClassName:o,reviews:i,rating:l,textAlign:t})};(0,m.withProductDataContext)(x);var $=a(8834),S=a(910);const R=e=>{var t,a;const{className:s,textAlign:o,isDescendentOfSingleProductTemplate:r}=e,i=(0,d.p)(e),{parentName:m,parentClassName:u}=(0,n.useInnerBlockLayoutContext)(),{product:p}=(0,n.useProductDataContext)(),g="woocommerce/all-products"===m,_=(0,l.A)("wc-block-components-product-price",s,i.className,{[`${u}__product-price`]:u});if(!p.id&&!r){const e=(0,c.createElement)($.A,{align:o,className:_});return g?(0,c.createElement)("div",{className:"wp-block-woocommerce-product-price"},e):e}const w=p.prices,N=r?(0,S.getCurrencyFromPriceResponse)():(0,S.getCurrencyFromPriceResponse)(w),k="5000",v=w.price!==w.regular_price,b=(0,l.A)({[`${u}__product-price__value`]:u,[`${u}__product-price__value--on-sale`]:v}),h=(0,c.createElement)($.A,{align:o,className:_,style:i.style,regularPriceStyle:i.style,priceStyle:i.style,priceClassName:b,currency:N,price:r?k:w.price,minPrice:null==w||null===(t=w.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==w||null===(a=w.price_range)||void 0===a?void 0:a.max_amount,regularPrice:r?k:w.regular_price,regularPriceClassName:(0,l.A)({[`${u}__product-price__regular`]:u})});return g?(0,c.createElement)("div",{className:"wp-block-woocommerce-product-price"},h):h};var D=a(3564),I=a(2516);a(1546);const B=({product:e,className:t,style:a})=>{const{id:s,permalink:n,add_to_cart:o,has_options:d,is_purchasable:m,is_in_stock:g}=e,{dispatchStoreEvent:_}=(0,u.y)(),{cartQuantity:w,addingToCart:N,addToCart:k}=(0,D.R)(s),v=Number.isFinite(w)&&w>0,b=!d&&m&&g,h=(0,p.decodeEntities)((null==o?void 0:o.description)||""),E=v?(0,r.sprintf)(/* translators: %s number of products in cart. */ /* translators: %s number of products in cart. */
(0,r._n)("%d in cart","%d in cart",w,"woocommerce"),w):(0,p.decodeEntities)((null==o?void 0:o.text)||(0,r.__)("Add to cart","woocommerce")),y=b?"button":"a",C={};return b?C.onClick=async()=>{await k(),_("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=(0,i.getSetting)("productsSettings");t&&(window.location.href=I.Vo)}:(C.href=n,C.rel="nofollow",C.onClick=()=>{_("product-view-link",{product:e})}),(0,c.createElement)(y,{...C,"aria-label":h,disabled:N,className:(0,l.A)(t,"wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",{loading:N,added:v}),style:a},E)},F=({className:e,style:t})=>(0,c.createElement)("button",{className:(0,l.A)("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",e),style:t,disabled:!0}),T=e=>{const{className:t,textAlign:a}=e,s=(0,d.p)(e),{parentClassName:o}=(0,n.useInnerBlockLayoutContext)(),{product:r}=(0,n.useProductDataContext)();return(0,c.createElement)("div",{className:(0,l.A)(t,"wp-block-button","wc-block-components-product-button",{[`${o}__product-add-to-cart`]:o,[`align-${a}`]:a})},r.id?(0,c.createElement)(B,{product:r,style:s.style,className:s.className}):(0,c.createElement)(F,{style:s.style,className:s.className}))},M=((0,m.withProductDataContext)(T),({product:e})=>(0,c.createElement)("div",{className:"cross-sells-product"},(0,c.createElement)(n.InnerBlockLayoutContextProvider,{parentName:"woocommerce/cart-cross-sells-block",parentClassName:"wp-block-cart-cross-sells-product"},(0,c.createElement)(n.ProductDataContextProvider,{isLoading:!1,product:e},(0,c.createElement)("div",null,(0,c.createElement)(v,{className:"",showSaleBadge:!0,productId:e.id,showProductLink:!0,saleBadgeAlign:"left",imageSizing:w.SINGLE,isDescendentOfQueryLoop:!1,scale:"cover",aspectRatio:"1:1"}),(0,c.createElement)(E,{align:"",headingLevel:3,showProductLink:!0}),(0,c.createElement)(x,{isDescendentOfQueryLoop:!1,isDescendentOfSingleProductBlock:!1,productId:e.id,postId:0,shouldDisplayMockedReviewsWhenProductHasNoReviews:!1}),(0,c.createElement)(R,null)),(0,c.createElement)(T,null))))),z=({products:e,columns:t})=>{const a=e.map(((e,a)=>a>=t?null:(0,c.createElement)(M,{isLoading:!1,product:e,key:e.id})));return(0,c.createElement)("div",null,a)};var H=a(7292);const O=({className:e,columns:t})=>{const{crossSellsProducts:a}=(0,s.V)();return void 0===t&&(t=H.attributes.columns.default),(0,c.createElement)(z,{className:e,columns:t,products:a})}},1546:()=>{},5183:()=>{},7195:()=>{},6007:()=>{},7128:()=>{}}]);