(globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[3895],{65:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>w});var o=s(7723),r=s(4921),n=s(6087),c=s(2435),a=s(6004);const l=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),i=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e;var u=s(9446);var d=s(790);const m=["a","b","em","i","strong","p","br","ul","ol","li","h1","h2","h3","h4","h5","h6","pre","blockquote","img"],p=["target","href","rel","name","download","src","class","alt","style"],h=({source:t,maxLength:e=15,countType:s="words",className:o="",style:r={}})=>{const h=(0,n.useMemo)((()=>((t,e=15,s="words")=>{const o=(0,a.autop)(t);if((0,u.count)(o,s)<=e)return o;const r=(t=>{const e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)})(o);return(0,u.count)(r,s)<=e?r:"words"===s?((t,e,s="&hellip;",o=!0)=>{const r=l(t),n=r.split(" ").splice(0,e).join(" ");return n===r?o?(0,a.autop)(r):r:o?(0,a.autop)(i(n,s)):i(n,s)})(r,e):((t,e,s=!0,o="&hellip;",r=!0)=>{const n=l(t),c=n.slice(0,e);if(c===n)return r?(0,a.autop)(n):n;if(s)return(0,a.autop)(i(c,o));const u=c.match(/([\s]+)/g),d=u?u.length:0,m=n.slice(0,e+d);return r?(0,a.autop)(i(m,o)):i(m,o)})(r,e,"characters_including_spaces"===s)})(t,e,s)),[t,e,s]);return(0,d.jsx)(n.RawHTML,{style:r,className:o,children:(0,c.sanitizeHTML)(h,{tags:m,attr:p})})};var y=s(8331),f=s(3993),g=s(415),b=s(371),k=s(1616);s(3608);const x=t=>{const{className:e,showDescriptionIfEmpty:s,summaryLength:n,showLink:c,linkText:a,isDescendantOfAllProducts:l,isDescendentOfSingleProductTemplate:i,product:u,isAdmin:m}=t,{parentClassName:p}=(0,g.useInnerBlockLayoutContext)(),{product:k}=(0,g.useProductDataContext)({product:u,isAdmin:m}),x=(0,b.p)(t),w=(t=>{const{isDescendantOfAllProducts:e,summaryLength:s,showDescriptionIfEmpty:o,showLink:r}=t;return e&&(0,f.isEmpty)(s)&&(0,f.isEmpty)(o)&&(0,f.isEmpty)(r)})(t),N=w?150:n,j=!w&&c,S=k?((t,e)=>{const{short_description:s,description:o}=t;return s||(e&&o?o:"")})(k,!!w||s):"",v=N||1/0,T="wc-block-components-product-summary";return i?(0,d.jsx)("div",{className:T,children:(0,d.jsx)("p",{children:(0,o.__)("This block displays the product summary and all its customizations.","woocommerce")})}):k?S?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{className:(0,r.A)(e,x.className,T,{[`${p}__product-summary`]:p}),source:S,maxLength:v,countType:y.r7.wordCountType||"words",style:x.style}),l&&j&&a&&k?.permalink?(0,d.jsx)("a",{href:`${k.permalink}#tab-description`,children:a}):null]}):l?null:(0,d.jsx)("div",{className:T,children:(0,d.jsx)("p",{children:(0,o.__)("No product summary to show.","woocommerce")})}):(0,d.jsx)("div",{className:(0,r.A)(e,T,{[`${p}__product-summary`]:p})})},w=t=>t.isDescendentOfSingleProductTemplate?(0,d.jsx)(x,{...t}):(0,k.withProductDataContext)(x)(t)},371:(t,e,s)=>{"use strict";s.d(e,{p:()=>a});var o=s(4921),r=s(3993),n=s(219),c=s(17);const a=t=>{const e=(t=>{const e=(0,r.isObject)(t)?t:{style:{}};let s=e.style;return(0,r.isString)(s)&&(s=JSON.parse(s)||{}),(0,r.isObject)(s)||(s={}),{...e,style:s}})(t),s=(0,c.BK)(e),a=(0,c.aR)(e),l=(0,c.fo)(e),i=(0,n.x)(e);return{className:(0,o.A)(i.className,s.className,a.className,l.className),style:{...i.style,...s.style,...a.style,...l.style}}}},219:(t,e,s)=>{"use strict";s.d(e,{x:()=>r});var o=s(3993);const r=t=>{const e=(0,o.isObject)(t.style.typography)?t.style.typography:{},s=(0,o.isString)(e.fontFamily)?e.fontFamily:"";return{className:t.fontFamily?`has-${t.fontFamily}-font-family`:s,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}}}},17:(t,e,s)=>{"use strict";s.d(e,{BK:()=>i,aR:()=>u,fo:()=>d});var o=s(4921),r=s(7356),n=s(9786),c=s(3993);function a(t={}){const e={};return(0,n.getCSSRules)(t,{selector:""}).forEach((t=>{e[t.key]=t.value})),e}function l(t,e){return t&&e?`has-${(0,r.c)(e)}-${t}`:""}function i(t){const{backgroundColor:e,textColor:s,gradient:r,style:n}=t,i=l("background-color",e),u=l("color",s),d=function(t){if(t)return`has-${t}-gradient-background`}(r),m=d||n?.color?.gradient;return{className:(0,o.A)(u,d,{[i]:!m&&!!i,"has-text-color":s||n?.color?.text,"has-background":e||n?.color?.background||r||n?.color?.gradient,"has-link-color":(0,c.isObject)(n?.elements?.link)?n?.elements?.link?.color:void 0}),style:a({color:n?.color||{}})}}function u(t){const e=t.style?.border||{};return{className:function(t){const{borderColor:e,style:s}=t,r=e?l("border-color",e):"";return(0,o.A)({"has-border-color":!!e||!!s?.border?.color,[r]:!!r})}(t),style:a({border:e})}}function d(t){return{className:void 0,style:a({spacing:t.style?.spacing||{}})}}},3608:()=>{}}]);