"use strict";(globalThis.webpackChunkwebpackWcBlocksFrontendJsonp=globalThis.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[553],{7924:(e,t,o)=>{o.r(t),o.d(t,{Block:()=>m,default:()=>y});var r=o(7723),s=o(4921),n=o(2796),c=o(3754),l=o(1616),a=o(3993),i=o(6427),u=o(790);const d=e=>{const{reviews:t}=e,o=t?(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)",t,"woocommerce"),t):(0,r.__)("(X customer reviews)","woocommerce");return(0,u.jsx)("span",{className:"wc-block-components-product-rating-counter__reviews_count",children:(0,u.jsx)(i.Disabled,{children:(0,u.jsx)("a",{href:"/",children:o})})})},m=e=>{const{textAlign:t,shouldDisplayMockedReviewsWhenProductHasNoReviews:o}=e,r=(0,c.p)(e),{parentClassName:l}=(0,n.useInnerBlockLayoutContext)(),{product:i}=(0,n.useProductDataContext)(),m=(e=>{const t=(0,a.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(i),y=(0,s.A)(r.className,"wc-block-components-product-rating-counter",{[`${l}__product-rating`]:l,[`has-text-align-${t}`]:t});if(m||o)return(0,u.jsx)("div",{className:y,style:r.style,children:(0,u.jsx)("div",{className:"wc-block-components-product-rating-counter__container",children:(0,u.jsx)(d,{reviews:m})})})},y=(0,l.withProductDataContext)(m)},3754:(e,t,o)=>{o.d(t,{p:()=>i});var r=o(4921),s=o(3993),n=o(7356),c=o(9786);function l(e={}){const t={};return(0,c.getCSSRules)(e,{selector:""}).forEach(e=>{t[e.key]=e.value}),t}function a(e,t){return e&&t?`has-${(0,n.c)(t)}-${e}`:""}const i=e=>{const t=(e=>{const t=(0,s.isObject)(e)?e:{style:{}};let o=t.style;return(0,s.isString)(o)&&(o=JSON.parse(o)||{}),(0,s.isObject)(o)||(o={}),{...t,style:o}})(e),o=function(e){const{backgroundColor:t,textColor:o,gradient:n,style:c}=e,i=a("background-color",t),u=a("color",o),d=function(e){if(e)return`has-${e}-gradient-background`}(n),m=d||c?.color?.gradient;return{className:(0,r.A)(u,d,{[i]:!m&&!!i,"has-text-color":o||c?.color?.text,"has-background":t||c?.color?.background||n||c?.color?.gradient,"has-link-color":(0,s.isObject)(c?.elements?.link)?c?.elements?.link?.color:void 0}),style:l({color:c?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:o}=e,s=t?a("border-color",t):"";return(0,r.A)({"has-border-color":!!t||!!o?.border?.color,[s]:!!s})}(e),style:l({border:t})}}(t),c=function(e){return{className:void 0,style:l({spacing:e.style?.spacing||{}})}}(t),i=(e=>{const t=(0,s.isObject)(e.style.typography)?e.style.typography:{},o=(0,s.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:o,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:(0,r.A)(i.className,o.className,n.className,c.className),style:{...i.style,...o.style,...n.style,...c.style}}}}}]);