(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[74],{111:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(26),c=n(20);const s=t=>Object(r.a)(t)?JSON.parse(t)||{}:Object(c.a)(t)?t:{}},20:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return c}));const r=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function c(t,e){return r(t)&&e in t}},280:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(55),c=n(20),s=n(111);const o=t=>{const e=Object(c.a)(t)?t:{},n=Object(s.a)(e.style);return Object(r.__experimentalUseColorProps)({...e,style:n})}},286:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(20),c=n(26),s=n(111);const o=t=>{const e=Object(r.a)(t)?t:{},n=Object(s.a)(e.style),o=Object(r.a)(n.typography)?n.typography:{},a=Object(c.a)(o.fontFamily)?o.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:a,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,textDecoration:o.textDecoration,textTransform:o.textTransform}}}},297:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(55),c=n(20),s=n(111);const o=t=>{if("function"!=typeof r.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(c.a)(t)?t:{},n=Object(s.a)(e.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...e,style:n})}},359:function(t,e){},392:function(t,e,n){"use strict";n.r(e),n.d(e,"Block",(function(){return g}));var r=n(0),c=n(1),s=n(5),o=n.n(s),a=n(58),i=n(280),u=n(286),l=n(297),b=n(142),f=n(106);n(359);const p=t=>{const{rating:e,reviews:n,parentClassName:s}=t,a={width:e/5*100+"%"},i=Object(c.sprintf)(
/* translators: %f is referring to the average rating value */
Object(c.__)("Rated %f out of 5","woocommerce"),e),u={__html:Object(c.sprintf)(
/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
Object(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",n,"woocommerce"),Object(c.sprintf)('<strong class="rating">%f</strong>',e),Object(c.sprintf)('<span class="rating">%d</span>',n))};return Object(r.createElement)("div",{className:o()("wc-block-components-product-rating__stars",s+"__product-rating__stars"),role:"img","aria-label":i},Object(r.createElement)("span",{style:a,dangerouslySetInnerHTML:u}))},d=t=>{const{href:e}=t,n=Object(c.__)("Add review","woocommerce");return e?Object(r.createElement)("a",{className:"wc-block-components-product-rating__link",href:e},n):null},g=t=>{const{textAlign:e}=t,{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:c}=Object(a.useProductDataContext)(),s=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(c),b=Object(i.a)(t),g=Object(u.a)(t),O=Object(l.a)(t),j=(t=>{const e=Object(f.a)(t.review_count)?t.review_count:parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(c),m=(t=>{const{permalink:e}=t;return e+"#reviews"})(c),y=o()(b.className,"wc-block-components-product-rating",{[n+"__product-rating"]:n,["has-text-align-"+e]:e}),_=j?Object(r.createElement)(p,{rating:s,reviews:j,parentClassName:n}):Object(r.createElement)(d,{href:m});return Object(r.createElement)("div",{className:y,style:{...b.style,...g.style,...O.style}},_)};e.default=Object(b.withProductDataContext)(g)}}]);