import{r as i,h as e,H as s,F as t}from"./p-e97fde0a.js";import{i as r}from"./p-4df6e0c5.js";import"./p-3f6362a4.js";const a=":host{display:block}.price{display:inline-flex;flex-direction:column;gap:var(--sc-spacing-xxx-small);text-align:var(--sc-product-price-alignment, left);justify-content:var(--sc-product-price-alignment, left)}.price__amounts{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:var(--sc-spacing-xx-small);justify-content:var(--sc-product-price-alignment, left);text-align:var(--sc-product-price-alignment, left)}.price__scratch{text-decoration:line-through;opacity:0.75}.price__interval{font-size:min(var(--sc-font-size-small), 16px);opacity:0.75}.price__details{font-size:min(var(--sc-font-size-small), 16px);opacity:0.75}.price__sale-badge{font-size:min(1em, 14px);align-self:center}";const n=a;const l=class{constructor(e){i(this,e);this.currency=undefined;this.amount=undefined;this.scratchAmount=undefined;this.scratchDisplayAmount=undefined;this.displayAmount=undefined;this.saleText=undefined;this.adHoc=undefined;this.recurringPeriodCount=undefined;this.recurringIntervalCount=undefined;this.recurringInterval=undefined;this.setupFeeAmount=undefined;this.setupFeeText=undefined;this.trialDurationDays=undefined;this.setupFeeName=undefined}render(){if(this.adHoc){return e(s,{role:"paragraph"},wp.i18n.__("Custom Amount","surecart"))}return e(s,{role:"paragraph"},e("div",{class:"price",id:"price"},e("div",{class:"price__amounts"},!!this.scratchAmount&&this.scratchAmount>this.amount&&e(t,null,this.scratchAmount===0?wp.i18n.__("Free","surecart"):e(t,null,e("sc-visually-hidden",null,wp.i18n.__("The price was","surecart")," "),!!this.scratchDisplayAmount?e("span",{class:"price__scratch"},this.scratchDisplayAmount):e("sc-format-number",{class:"price__scratch",part:"price__scratch",type:"currency",currency:this.currency,value:this.scratchAmount}),e("sc-visually-hidden",null," ",wp.i18n.__("now discounted to","surecart")))),this.amount===0?wp.i18n.__("Free","surecart"):this.displayAmount?this.displayAmount:e("sc-format-number",{class:"price__amount",type:"currency",value:this.amount,currency:this.currency}),e("div",{class:"price__interval"},this.recurringPeriodCount&&1<this.recurringPeriodCount&&e("sc-visually-hidden",null," ",wp.i18n.__("This is a repeating price. Payment will happen","surecart")," ",r({recurring_interval_count:this.recurringIntervalCount,recurring_interval:this.recurringInterval,recurring_period_count:this.recurringPeriodCount},{showOnce:true,abbreviate:false,labels:{interval:wp.i18n.__("every","surecart"),period:wp.i18n.__("for","surecart")}})),e("span",{"aria-hidden":"true"},r({recurring_interval_count:this.recurringIntervalCount,recurring_interval:this.recurringInterval,recurring_period_count:this.recurringPeriodCount},{showOnce:true,abbreviate:false,labels:{interval:"/",period:wp.i18n.__("for","surecart")}}))),!!this.scratchAmount&&e("sc-tag",{type:"primary",pill:true,class:"price__sale-badge"},this.saleText||e(t,null,e("sc-visually-hidden",null,wp.i18n.__("This product is available for sale.","surecart")," "),e("span",{"aria-hidden":"true"},wp.i18n.__("Sale","surecart"))))),(!!(this===null||this===void 0?void 0:this.trialDurationDays)||!!(this===null||this===void 0?void 0:this.setupFeeAmount))&&e("div",{class:"price__details"},!!(this===null||this===void 0?void 0:this.trialDurationDays)&&e(t,null,e("sc-visually-hidden",null,wp.i18n.sprintf(wp.i18n.__("You have a %d-day trial before payment becomes necessary.","surecart"),this===null||this===void 0?void 0:this.trialDurationDays)),e("span",{class:"price__trial","aria-hidden":"true"},wp.i18n.sprintf(wp.i18n._n("Starting in %s day.","Starting in %s days.",this===null||this===void 0?void 0:this.trialDurationDays,"surecart"),this===null||this===void 0?void 0:this.trialDurationDays))),!!(this===null||this===void 0?void 0:this.setupFeeAmount)&&e("span",{class:"price__setup-fee"},e("sc-visually-hidden",null,wp.i18n.__("This product has","surecart")," ")," ",this.setupFeeText?this.setupFeeText:e(t,null,e("sc-format-number",{type:"currency",value:this===null||this===void 0?void 0:this.setupFeeAmount,currency:this.currency}),(this===null||this===void 0?void 0:this.setupFeeName)||wp.i18n.__("Setup Fee","surecart"))))))}};l.style=n;export{l as sc_price};
//# sourceMappingURL=p-df0fc918.entry.js.map