import{r as i,h as o,F as e}from"./p-e97fde0a.js";import"./p-9960b1ec.js";import{s as l}from"./p-86fd1a31.js";import"./p-7d44e2d5.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-0d462000.js";import"./p-dd3464cd.js";import"./p-401e165e.js";import"./p-d3366af3.js";import"./p-1f60f497.js";const d=":host{display:block}sc-divider{margin:16px 0 !important}.conversion-description{color:var(--sc-color-gray-500);font-size:var(--sc-font-size-small);margin-right:var(--sc-spacing-xx-small)}";const s=d;const r=class{constructor(o){i(this,o)}renderAmountDue(){var i,o;return l.amount_due>0?(i=l===null||l===void 0?void 0:l.line_item)===null||i===void 0?void 0:i.total_display_amount:!!((o=l===null||l===void 0?void 0:l.line_item)===null||o===void 0?void 0:o.trial_amount)?wp.i18n.__("Trial","surecart"):wp.i18n.__("Free","surecart")}getCurrencyToDisplay(){var i,o,e,d,s,r,a;return((e=(o=(i=l===null||l===void 0?void 0:l.line_item)===null||i===void 0?void 0:i.total_default_currency_display_amount)===null||o===void 0?void 0:o.toLowerCase())===null||e===void 0?void 0:e.includes((s=(d=l===null||l===void 0?void 0:l.line_item)===null||d===void 0?void 0:d.currency)===null||s===void 0?void 0:s.toLowerCase()))?"":(a=(r=l===null||l===void 0?void 0:l.line_item)===null||r===void 0?void 0:r.currency)===null||a===void 0?void 0:a.toUpperCase()}renderConversion(){var i,d,s,r,a,n;const c=l===null||l===void 0?void 0:l.checkout;if(!(c===null||c===void 0?void 0:c.show_converted_total)){return null}if((c===null||c===void 0?void 0:c.currency)===(c===null||c===void 0?void 0:c.current_currency)){return null}if(!((i=l===null||l===void 0?void 0:l.line_item)===null||i===void 0?void 0:i.total_amount)){return null}return o(e,null,o("sc-divider",null),o("sc-line-item",{style:{"--price-size":"var(--sc-font-size-x-large)"}},o("span",{slot:"title"},o("slot",{name:"charge-amount-description"},wp.i18n.sprintf(wp.i18n.__("Payment Total","surecart"),(s=(d=l===null||l===void 0?void 0:l.line_item)===null||d===void 0?void 0:d.currency)===null||s===void 0?void 0:s.toUpperCase()))),o("span",{slot:"price"},this.getCurrencyToDisplay()&&o("span",{class:"currency-label"},this.getCurrencyToDisplay()),(r=l===null||l===void 0?void 0:l.line_item)===null||r===void 0?void 0:r.total_default_currency_display_amount)),o("sc-line-item",null,o("span",{slot:"description",class:"conversion-description"},wp.i18n.sprintf(wp.i18n.__("Your payment will be processed in %s.","surecart"),(n=(a=l===null||l===void 0?void 0:l.line_item)===null||a===void 0?void 0:a.currency)===null||n===void 0?void 0:n.toUpperCase()))))}render(){var i,e,d,s,r,a,n;return o("sc-summary",{key:"f2a9a789c5ab146aa85b10ccb620ed5f747d88ec","open-text":"Total","closed-text":"Total",collapsible:true,collapsed:true},!!((i=l.line_item)===null||i===void 0?void 0:i.id)&&o("span",{key:"183566a39c2765e17de88d985d1f93eb335c18c7",slot:"price"},this.renderAmountDue()),o("sc-divider",{key:"8322051ddcfcf14fdce826ca43b8fd717920999e"}),o("sc-line-item",{key:"de33cabc82f633851da4bae515fcf9642176ea2e"},o("span",{key:"25a1a714932dd6bce87691fdeb745f0aecf60c2a",slot:"description"},wp.i18n.__("Subtotal","surecart")),o("span",{key:"c60058156150311acac7727e2e006e7356e19d59",slot:"price"},(e=l.line_item)===null||e===void 0?void 0:e.subtotal_display_amount)),(((s=(d=l===null||l===void 0?void 0:l.line_item)===null||d===void 0?void 0:d.fees)===null||s===void 0?void 0:s.data)||[]).filter((i=>i.fee_type==="upsell")).map((i=>o("sc-line-item",null,o("span",{slot:"description"},i.description," ",`(${wp.i18n.__("one time","surecart")})`),o("span",{slot:"price"},i===null||i===void 0?void 0:i.display_amount)))),!!((r=l.line_item)===null||r===void 0?void 0:r.tax_amount)&&o("sc-line-item",{key:"0830506eb419cf4f91d7b9ae97bde09a1ec85c48"},o("span",{key:"6bb33b6d66a3daf7ed274996a2910b44b4d158b0",slot:"description"},wp.i18n.__("Tax","surecart")),o("span",{key:"7f0fd638d841715fc280f8be94ac572f1141f1ca",slot:"price"},(a=l.line_item)===null||a===void 0?void 0:a.tax_display_amount)),o("sc-divider",{key:"535d5ebcbd3eb12bbc401dc673e08e8b3dae0fda"}),o("sc-line-item",{key:"f34a3e1b42306842cd8418f91a91c3af33d70aa5",style:{"--price-size":"var(--sc-font-size-x-large)"}},o("span",{key:"42cd6bd3e4ac3210e2a2a08b35b0b9fd942292bd",slot:"title"},wp.i18n.__("Total","surecart")),o("span",{key:"68ca302cb45dec0716b10b8215c0cd582a606167",slot:"price"},(n=l.line_item)===null||n===void 0?void 0:n.total_display_amount)),this.renderConversion())}};r.style=s;export{r as sc_upsell_totals};
//# sourceMappingURL=p-70d46036.entry.js.map