(globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[2388],{1308:(e,r,c)=>{"use strict";c.r(r),c.d(r,{Block:()=>m,convertAdminPriceToStoreApiFormat:()=>u,default:()=>d});var t=c(4921),s=c(6711),o=c(910),a=c(415),n=c(371),i=c(1616),l=c(5703),p=c(790);const u=(e,r,c="0")=>{const t=10**r.minorUnit;return Math.round(Number.parseFloat(e??c)*t).toString()},m=e=>{const{className:r,textAlign:c,isDescendentOfSingleProductTemplate:i,isAdmin:m,product:d,isExperimentalWcRestApiV4Enabled:y}=e,{parentName:g,parentClassName:_}=(0,a.useInnerBlockLayoutContext)(),{product:x}=(0,a.useProductDataContext)(y?{isAdmin:m,product:d}:void 0),N="woocommerce/all-products"===g,f="woocommerce/add-to-cart-with-options-grouped-product-item"===g,b=(0,n.p)(e);let h={className:"",style:{}};N&&(h=b);const P=i&&!f||!x,k=(0,t.A)("wc-block-components-product-price",r,h.className,{[`${_}__product-price`]:_});if(!x?.id&&!i){const e=(0,p.jsx)(s.A,{align:c,className:k});return N?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:e}):e}let v=x?.prices??{};const S=P?(0,o.getCurrencyFromPriceResponse)():(0,o.getCurrencyFromPriceResponse)(v);y&&(v={price:u(x?.price,S),...x?.sale_price?{sale_price:u(x?.sale_price,S)}:{},...x?.regular_price?{regular_price:u(x?.regular_price,S)}:{},currency_minor_unit:l.SITE_CURRENCY.minorUnit,price_range:x?.max_price&&x?.min_price?{min_amount:u(x.min_price,S),max_amount:u(x.max_price,S)}:null});const A="5000",j=v.price!==v.regular_price,w=(0,t.A)({[`${_}__product-price__value`]:_,[`${_}__product-price__value--on-sale`]:j}),C=(0,p.jsx)(s.A,{align:c,className:k,style:h.style,regularPriceStyle:h.style,priceStyle:h.style,priceClassName:w,currency:S,price:P?A:v.price,minPrice:v?.price_range?.min_amount,maxPrice:v?.price_range?.max_amount,regularPrice:P?A:v.regular_price,regularPriceClassName:(0,t.A)({[`${_}__product-price__regular`]:_})});return N?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:C}):C},d=e=>e.isDescendentOfSingleProductTemplate?(0,p.jsx)(m,{...e}):(0,i.withProductDataContext)(m)(e)},6711:(e,r,c)=>{"use strict";c.d(r,{A:()=>u});var t=c(7723),s=c(4656),o=c(4921),a=c(910),n=c(6087),i=(c(8501),c(790));const l=({currency:e,maxPrice:r,minPrice:c,priceClassName:n,priceStyle:l={}})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,t.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,t.__)("Price between %1$s and %2$s","woocommerce"),(0,a.formatPrice)(c),(0,a.formatPrice)(r))}),(0,i.jsxs)("span",{"aria-hidden":!0,children:[(0,i.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",n),currency:e,value:c,style:l})," — ",(0,i.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",n),currency:e,value:r,style:l})]})]}),p=({currency:e,regularPriceClassName:r,regularPriceStyle:c,regularPrice:a,priceClassName:n,priceStyle:l,price:p})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,t.__)("Previous price:","woocommerce")}),(0,i.jsx)(s.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,i.jsx)("del",{className:(0,o.A)("wc-block-components-product-price__regular",r),style:c,children:e}),value:a}),(0,i.jsx)("span",{className:"screen-reader-text",children:(0,t.__)("Discounted price:","woocommerce")}),(0,i.jsx)(s.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,i.jsx)("ins",{className:(0,o.A)("wc-block-components-product-price__value","is-discounted",n),style:l,children:e}),value:p})]}),u=({align:e,className:r,currency:c,format:t="<price/>",maxPrice:a,minPrice:u,price:m,priceClassName:d,priceStyle:y,regularPrice:g,regularPriceClassName:_,regularPriceStyle:x,style:N})=>{const f=(0,o.A)(r,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});t.includes("<price/>")||(t="<price/>",console.error("Price formats need to include the `<price/>` tag."));const b=void 0!==g&&void 0!==m&&m<g;let h=(0,i.jsx)("span",{className:(0,o.A)("wc-block-components-product-price__value",d)});return b?h=(0,i.jsx)(p,{currency:c,price:m,priceClassName:d,priceStyle:y,regularPrice:g,regularPriceClassName:_,regularPriceStyle:x}):void 0!==u&&void 0!==a?h=(0,i.jsx)(l,{currency:c,maxPrice:a,minPrice:u,priceClassName:d,priceStyle:y}):(m||0===m)&&(h=(0,i.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",d),currency:c,value:m,style:y})),(0,i.jsx)("span",{className:f,style:N,children:(0,n.createInterpolateElement)(t,{price:h})})}},371:(e,r,c)=>{"use strict";c.d(r,{p:()=>n});var t=c(4921),s=c(3993),o=c(219),a=c(17);const n=e=>{const r=(e=>{const r=(0,s.isObject)(e)?e:{style:{}};let c=r.style;return(0,s.isString)(c)&&(c=JSON.parse(c)||{}),(0,s.isObject)(c)||(c={}),{...r,style:c}})(e),c=(0,a.BK)(r),n=(0,a.aR)(r),i=(0,a.fo)(r),l=(0,o.x)(r);return{className:(0,t.A)(l.className,c.className,n.className,i.className),style:{...l.style,...c.style,...n.style,...i.style}}}},219:(e,r,c)=>{"use strict";c.d(r,{x:()=>s});var t=c(3993);const s=e=>{const r=(0,t.isObject)(e.style.typography)?e.style.typography:{},c=(0,t.isString)(r.fontFamily)?r.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:c,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:r.fontSize,fontStyle:r.fontStyle,fontWeight:r.fontWeight,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,textDecoration:r.textDecoration,textTransform:r.textTransform}}}},17:(e,r,c)=>{"use strict";c.d(r,{BK:()=>l,aR:()=>p,fo:()=>u});var t=c(4921),s=c(7356),o=c(9786),a=c(3993);function n(e={}){const r={};return(0,o.getCSSRules)(e,{selector:""}).forEach((e=>{r[e.key]=e.value})),r}function i(e,r){return e&&r?`has-${(0,s.c)(r)}-${e}`:""}function l(e){const{backgroundColor:r,textColor:c,gradient:s,style:o}=e,l=i("background-color",r),p=i("color",c),u=function(e){if(e)return`has-${e}-gradient-background`}(s),m=u||o?.color?.gradient;return{className:(0,t.A)(p,u,{[l]:!m&&!!l,"has-text-color":c||o?.color?.text,"has-background":r||o?.color?.background||s||o?.color?.gradient,"has-link-color":(0,a.isObject)(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:n({color:o?.color||{}})}}function p(e){const r=e.style?.border||{};return{className:function(e){const{borderColor:r,style:c}=e,s=r?i("border-color",r):"";return(0,t.A)({"has-border-color":!!r||!!c?.border?.color,[s]:!!s})}(e),style:n({border:r})}}function u(e){return{className:void 0,style:n({spacing:e.style?.spacing||{}})}}},8501:()=>{}}]);