import{r as i,h as o,H as d}from"./p-e97fde0a.js";import{s as l}from"./p-863940e9.js";import"./p-5a8e136a.js";import{s as n}from"./p-86fd1a31.js";import"./p-03631502.js";import"./p-13f5e4e1.js";import"./p-3f6362a4.js";import"./p-ec182234.js";import"./p-9dbc54d6.js";import"./p-93127aa7.js";import"./p-830ab1a3.js";import"./p-fd1598d9.js";import"./p-bc8d627e.js";import"./p-dd3464cd.js";import"./p-401e165e.js";import"./p-d3366af3.js";import"./p-1f60f497.js";const r=":host{display:block}";const t=r;const v=class{constructor(o){i(this,o);this.prices=undefined;this.saleText=undefined;this.productId=undefined}renderRange(){var i;return(i=l[this.productId])===null||i===void 0?void 0:i.range_display_amount}renderVariantPrice(i){var o,d;const n=(d=(o=l[this.productId])===null||o===void 0?void 0:o.variants)===null||d===void 0?void 0:d.find((o=>(o===null||o===void 0?void 0:o.id)===(i===null||i===void 0?void 0:i.id)));return this.renderPrice(l[this.productId].selectedPrice,n)}renderPrice(i,d=null){var l,r,t,v,s,u;const e=(r=(l=d===null||d===void 0?void 0:d.display_amount)!==null&&l!==void 0?l:i===null||i===void 0?void 0:i.display_amount)!==null&&r!==void 0?r:"";const p=((t=n===null||n===void 0?void 0:n.line_item)===null||t===void 0?void 0:t.subtotal_with_upsell_discount_amount)||(i===null||i===void 0?void 0:i.amount);const a=(v=n===null||n===void 0?void 0:n.line_item)===null||v===void 0?void 0:v.subtotal_with_upsell_discount_display_amount;const c=a?a:e;const m=((s=n===null||n===void 0?void 0:n.line_item)===null||s===void 0?void 0:s.subtotal_amount)||(i===null||i===void 0?void 0:i.scratch_amount);const h=(u=n===null||n===void 0?void 0:n.line_item)===null||u===void 0?void 0:u.subtotal_display_amount;const f=h?h:i===null||i===void 0?void 0:i.scratch_display_amount;return o("sc-price",{currency:i===null||i===void 0?void 0:i.currency,amount:p,displayAmount:c,scratchAmount:m,scratchDisplayAmount:f,saleText:this.saleText,adHoc:i===null||i===void 0?void 0:i.ad_hoc,trialDurationDays:i===null||i===void 0?void 0:i.trial_duration_days,setupFeeText:i===null||i===void 0?void 0:i.setup_fee_text,setupFeeAmount:(i===null||i===void 0?void 0:i.setup_fee_enabled)?i===null||i===void 0?void 0:i.setup_fee_amount:null,setupFeeName:(i===null||i===void 0?void 0:i.setup_fee_enabled)?i===null||i===void 0?void 0:i.setup_fee_name:null,recurringPeriodCount:i===null||i===void 0?void 0:i.recurring_period_count,recurringInterval:i===null||i===void 0?void 0:i.recurring_interval,recurringIntervalCount:i===null||i===void 0?void 0:i.recurring_interval_count})}render(){return o(d,{key:"f60b38c183a708193b1df4b1b601e33d0bfeedd9",role:"paragraph"},(()=>{var i,d,n,r,t;if((i=l[this.productId])===null||i===void 0?void 0:i.selectedVariant){return this.renderVariantPrice((d=l[this.productId])===null||d===void 0?void 0:d.selectedVariant)}if((n=l[this.productId])===null||n===void 0?void 0:n.selectedPrice){return this.renderPrice(l[this.productId].selectedPrice)}if((t=(r=l[this.productId])===null||r===void 0?void 0:r.prices)===null||t===void 0?void 0:t.length){return this.renderRange()}return o("slot",null)})())}};v.style=t;export{v as sc_product_price};
//# sourceMappingURL=p-de8491fd.entry.js.map