(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[578],{9549:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Block:()=>p,default:()=>g});var o=n(1609),r=n(7723),s=n(851),a=n(2796),l=n(3249),c=n(1616),i=n(3993);n(7195);const u=t=>({width:t/5*100+"%"}),d=({parentClassName:t})=>{const e=u(0);return(0,o.createElement)("div",{className:(0,s.A)("wc-block-components-product-rating-stars__norating-container",`${t}-product-rating-stars__norating-container`)},(0,o.createElement)("div",{className:"wc-block-components-product-rating-stars__norating",role:"img"},(0,o.createElement)("span",{style:e})),(0,o.createElement)("span",null,(0,r.__)("No Reviews","woocommerce")))},m=t=>{const{rating:e,reviews:n,parentClassName:a}=t,l=u(e),c=(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"),e),i={__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",n,"woocommerce"),(0,r.sprintf)('<strong class="rating">%f</strong>',e),(0,r.sprintf)('<span class="rating">%d</span>',n))};return(0,o.createElement)("div",{className:(0,s.A)("wc-block-components-product-rating-stars__stars",`${a}__product-rating-stars__stars`),role:"img","aria-label":c},(0,o.createElement)("span",{style:l,dangerouslySetInnerHTML:i}))},p=t=>{const{textAlign:e,shouldDisplayMockedReviewsWhenProductHasNoReviews:n}=t,r=(0,l.p)(t),{parentClassName:c}=(0,a.useInnerBlockLayoutContext)(),{product:u}=(0,a.useProductDataContext)(),p=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(u),g=(t=>{const e=(0,i.isNumber)(t.review_count)?t.review_count:parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(u),v=(0,s.A)(r.className,"wc-block-components-product-rating-stars",{[`${c}__product-rating`]:c,[`has-text-align-${e}`]:e}),f=n?(0,o.createElement)(d,{parentClassName:c}):null,y=g?(0,o.createElement)(m,{rating:p,reviews:g,parentClassName:c}):f;return(0,o.createElement)("div",{className:v,style:r.style},(0,o.createElement)("div",{className:"wc-block-components-product-rating-stars__container"},y))},g=(0,c.withProductDataContext)(p)},3249:(t,e,n)=>{"use strict";n.d(e,{p:()=>i});var o=n(851),r=n(3993),s=n(1194),a=n(9786);function l(t={}){const e={};return(0,a.getCSSRules)(t,{selector:""}).forEach((t=>{e[t.key]=t.value})),e}function c(t,e){return t&&e?`has-${(0,s.c)(e)}-${t}`:""}const i=t=>{const e=(t=>{const e=(0,r.isObject)(t)?t:{style:{}};let n=e.style;return(0,r.isString)(n)&&(n=JSON.parse(n)||{}),(0,r.isObject)(n)||(n={}),{...e,style:n}})(t),n=function(t){var e,n,s,a,i,u,d;const{backgroundColor:m,textColor:p,gradient:g,style:v}=t,f=c("background-color",m),y=c("color",p),b=function(t){if(t)return`has-${t}-gradient-background`}(g),_=b||(null==v||null===(e=v.color)||void 0===e?void 0:e.gradient);return{className:(0,o.A)(y,b,{[f]:!_&&!!f,"has-text-color":p||(null==v||null===(n=v.color)||void 0===n?void 0:n.text),"has-background":m||(null==v||null===(s=v.color)||void 0===s?void 0:s.background)||g||(null==v||null===(a=v.color)||void 0===a?void 0:a.gradient),"has-link-color":(0,r.isObject)(null==v||null===(i=v.elements)||void 0===i?void 0:i.link)?null==v||null===(u=v.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:l({color:(null==v?void 0:v.color)||{}})}}(e),s=function(t){var e;const n=(null===(e=t.style)||void 0===e?void 0:e.border)||{};return{className:function(t){var e;const{borderColor:n,style:r}=t,s=n?c("border-color",n):"";return(0,o.A)({"has-border-color":!!n||!(null==r||null===(e=r.border)||void 0===e||!e.color),[s]:!!s})}(t),style:l({border:n})}}(e),a=function(t){var e;return{className:void 0,style:l({spacing:(null===(e=t.style)||void 0===e?void 0:e.spacing)||{}})}}(e),i=(t=>{const e=(0,r.isObject)(t.style.typography)?t.style.typography:{},n=(0,r.isString)(e.fontFamily)?e.fontFamily:"";return{className:t.fontFamily?`has-${t.fontFamily}-font-family`:n,style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,textDecoration:e.textDecoration,textTransform:e.textTransform}}})(e);return{className:(0,o.A)(i.className,n.className,s.className,a.className),style:{...i.style,...n.style,...s.style,...a.style}}}},7195:()=>{}}]);