(globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[2388],{5213:(e,r,c)=>{"use strict";c.r(r),c.d(r,{Block:()=>m,convertAdminPriceToStoreApiFormat:()=>u,default:()=>d});var t=c(4921),s=c(8765),o=c(910),a=c(415),n=c(2721),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(null!=e?e:c)*t).toString()},m=e=>{var r;const{className:c,textAlign:i,isDescendentOfSingleProductTemplate:m,isAdmin:d,product:y,isExperimentalWcRestApiV4Enabled:g}=e,{parentName:_,parentClassName:x}=(0,a.useInnerBlockLayoutContext)(),{product:N}=(0,a.useProductDataContext)(g?{isAdmin:d,product:y}:void 0),f="woocommerce/all-products"===_,b="woocommerce/add-to-cart-with-options-grouped-product-item"===_,h=(0,n.p)(e);let v={className:"",style:{}};f&&(v=h);const P=m&&!b||!N,k=(0,t.A)("wc-block-components-product-price",c,v.className,{[`${x}__product-price`]:x});if(!N?.id&&!m){const e=(0,p.jsx)(s.A,{align:i,className:k});return f?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:e}):e}let S=null!==(r=N?.prices)&&void 0!==r?r:{};const A=P?(0,o.getCurrencyFromPriceResponse)():(0,o.getCurrencyFromPriceResponse)(S);g&&(S={price:u(N?.price,A),...N?.sale_price?{sale_price:u(N?.sale_price,A)}:{},...N?.regular_price?{regular_price:u(N?.regular_price,A)}:{},currency_minor_unit:l.SITE_CURRENCY.minorUnit,price_range:N?.max_price&&N?.min_price?{min_amount:u(N.min_price,A),max_amount:u(N.max_price,A)}:null});const j="5000",w=S.price!==S.regular_price,C=(0,t.A)({[`${x}__product-price__value`]:x,[`${x}__product-price__value--on-sale`]:w}),F=(0,p.jsx)(s.A,{align:i,className:k,style:v.style,regularPriceStyle:v.style,priceStyle:v.style,priceClassName:C,currency:A,price:P?j:S.price,minPrice:S?.price_range?.min_amount,maxPrice:S?.price_range?.max_amount,regularPrice:P?j:S.regular_price,regularPriceClassName:(0,t.A)({[`${x}__product-price__regular`]:x})});return f?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:F}):F},d=e=>e.isDescendentOfSingleProductTemplate?(0,p.jsx)(m,{...e}):(0,i.withProductDataContext)(m)(e)},8765:(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="