File "product-price-frontend.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/woocommerce/assets/client/blocks/product-price-frontend.js
File size: 6.14 KB
MIME-type: text/plain
Charset: utf-8

(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[388],{2258:(e,r,c)=>{"use strict";c.r(r),c.d(r,{Block:()=>g,default:()=>v});var t=c(1609),l=c(851),n=c(7723),o=c(4656),a=c(8529),s=c(6087);c(4567);const i=({currency:e,maxPrice:r,minPrice:c,priceClassName:s,priceStyle:i={}})=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"screen-reader-text"},(0,n.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,n.__)("Price between %1$s and %2$s","woocommerce"),(0,a.formatPrice)(c),(0,a.formatPrice)(r))),(0,t.createElement)("span",{"aria-hidden":!0},(0,t.createElement)(o.FormattedMonetaryAmount,{className:(0,l.A)("wc-block-components-product-price__value",s),currency:e,value:c,style:i})," — ",(0,t.createElement)(o.FormattedMonetaryAmount,{className:(0,l.A)("wc-block-components-product-price__value",s),currency:e,value:r,style:i}))),u=({currency:e,regularPriceClassName:r,regularPriceStyle:c,regularPrice:a,priceClassName:s,priceStyle:i,price:u})=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Previous price:","woocommerce")),(0,t.createElement)(o.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,t.createElement)("del",{className:(0,l.A)("wc-block-components-product-price__regular",r),style:c},e),value:a}),(0,t.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Discounted price:","woocommerce")),(0,t.createElement)(o.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,t.createElement)("ins",{className:(0,l.A)("wc-block-components-product-price__value","is-discounted",s),style:i},e),value:u})),m=({align:e,className:r,currency:c,format:n="<price/>",maxPrice:a,minPrice:m,price:p,priceClassName:d,priceStyle:y,regularPrice:g,regularPriceClassName:v,regularPriceStyle:N,style:_})=>{const f=(0,l.A)(r,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});n.includes("<price/>")||(n="<price/>",console.error("Price formats need to include the `<price/>` tag."));const b=g&&p&&p<g;let P=(0,t.createElement)("span",{className:(0,l.A)("wc-block-components-product-price__value",d)});return b?P=(0,t.createElement)(u,{currency:c,price:p,priceClassName:d,priceStyle:y,regularPrice:g,regularPriceClassName:v,regularPriceStyle:N}):void 0!==m&&void 0!==a?P=(0,t.createElement)(i,{currency:c,maxPrice:a,minPrice:m,priceClassName:d,priceStyle:y}):p&&(P=(0,t.createElement)(o.FormattedMonetaryAmount,{className:(0,l.A)("wc-block-components-product-price__value",d),currency:c,value:p,style:y})),(0,t.createElement)("span",{className:f,style:_},(0,s.createInterpolateElement)(n,{price:P}))};var p=c(2796),d=c(3249),y=c(1616);const g=e=>{var r,c;const{className:n,textAlign:o,isDescendentOfSingleProductTemplate:s}=e,i=(0,d.p)(e),{parentName:u,parentClassName:y}=(0,p.useInnerBlockLayoutContext)(),{product:g}=(0,p.useProductDataContext)(),v="woocommerce/all-products"===u,N=(0,l.A)("wc-block-components-product-price",n,i.className,{[`${y}__product-price`]:y});if(!g.id&&!s){const e=(0,t.createElement)(m,{align:o,className:N});return v?(0,t.createElement)("div",{className:"wp-block-woocommerce-product-price"},e):e}const _=g.prices,f=s?(0,a.getCurrencyFromPriceResponse)():(0,a.getCurrencyFromPriceResponse)(_),b="5000",P=_.price!==_.regular_price,k=(0,l.A)({[`${y}__product-price__value`]:y,[`${y}__product-price__value--on-sale`]:P}),S=(0,t.createElement)(m,{align:o,className:N,style:i.style,regularPriceStyle:i.style,priceStyle:i.style,priceClassName:k,currency:f,price:s?b:_.price,minPrice:null==_||null===(r=_.price_range)||void 0===r?void 0:r.min_amount,maxPrice:null==_||null===(c=_.price_range)||void 0===c?void 0:c.max_amount,regularPrice:s?b:_.regular_price,regularPriceClassName:(0,l.A)({[`${y}__product-price__regular`]:y})});return v?(0,t.createElement)("div",{className:"wp-block-woocommerce-product-price"},S):S},v=e=>e.isDescendentOfSingleProductTemplate?(0,t.createElement)(g,{...e}):(0,y.withProductDataContext)(g)(e)},3249:(e,r,c)=>{"use strict";c.d(r,{p:()=>i});var t=c(851),l=c(3993),n=c(1194),o=c(9786);function a(e={}){const r={};return(0,o.getCSSRules)(e,{selector:""}).forEach((e=>{r[e.key]=e.value})),r}function s(e,r){return e&&r?`has-${(0,n.c)(r)}-${e}`:""}const i=e=>{const r=(e=>{const r=(0,l.isObject)(e)?e:{style:{}};let c=r.style;return(0,l.isString)(c)&&(c=JSON.parse(c)||{}),(0,l.isObject)(c)||(c={}),{...r,style:c}})(e),c=function(e){var r,c,n,o,i,u,m;const{backgroundColor:p,textColor:d,gradient:y,style:g}=e,v=s("background-color",p),N=s("color",d),_=function(e){if(e)return`has-${e}-gradient-background`}(y),f=_||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient);return{className:(0,t.A)(N,_,{[v]:!f&&!!v,"has-text-color":d||(null==g||null===(c=g.color)||void 0===c?void 0:c.text),"has-background":p||(null==g||null===(n=g.color)||void 0===n?void 0:n.background)||y||(null==g||null===(o=g.color)||void 0===o?void 0:o.gradient),"has-link-color":(0,l.isObject)(null==g||null===(i=g.elements)||void 0===i?void 0:i.link)?null==g||null===(u=g.elements)||void 0===u||null===(m=u.link)||void 0===m?void 0:m.color:void 0}),style:a({color:(null==g?void 0:g.color)||{}})}}(r),n=function(e){var r;const c=(null===(r=e.style)||void 0===r?void 0:r.border)||{};return{className:function(e){var r;const{borderColor:c,style:l}=e,n=c?s("border-color",c):"";return(0,t.A)({"has-border-color":!!c||!(null==l||null===(r=l.border)||void 0===r||!r.color),[n]:!!n})}(e),style:a({border:c})}}(r),o=function(e){var r;return{className:void 0,style:a({spacing:(null===(r=e.style)||void 0===r?void 0:r.spacing)||{}})}}(r),i=(e=>{const r=(0,l.isObject)(e.style.typography)?e.style.typography:{},c=(0,l.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}}})(r);return{className:(0,t.A)(i.className,c.className,n.className,o.className),style:{...i.style,...c.style,...n.style,...o.style}}}},4567:()=>{}}]);