import{r as i,h as o,F as l}from"./p-9add63ef.js";import"./p-15daaf77.js";import{s as e}from"./p-71d77b7d.js";import"./p-38b12af4.js";import"./p-2b28ea49.js";import"./p-07a2074d.js";import"./p-3f6362a4.js";import"./p-ec182234.js";import"./p-dd24e53c.js";import"./p-fb28f84f.js";import"./p-830ab1a3.js";import"./p-1365bb41.js";import"./p-0d4dd694.js";import"./p-8dccb656.js";import"./p-259c3935.js";import"./p-401e165e.js";import"./p-d3366af3.js";import"./p-78468e45.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 e.amount_due>0?(i=e===null||e===void 0?void 0:e.line_item)===null||i===void 0?void 0:i.total_display_amount:!!((o=e===null||e===void 0?void 0:e.line_item)===null||o===void 0?void 0:o.trial_amount)?wp.i18n.__("Trial","surecart"):wp.i18n.__("Free","surecart")}getCurrencyToDisplay(){var i,o,l,d,s,r,n;return((l=(o=(i=e===null||e===void 0?void 0:e.line_item)===null||i===void 0?void 0:i.total_default_currency_display_amount)===null||o===void 0?void 0:o.toLowerCase())===null||l===void 0?void 0:l.includes((s=(d=e===null||e===void 0?void 0:e.line_item)===null||d===void 0?void 0:d.currency)===null||s===void 0?void 0:s.toLowerCase()))?"":(n=(r=e===null||e===void 0?void 0:e.line_item)===null||r===void 0?void 0:r.currency)===null||n===void 0?void 0:n.toUpperCase()}renderConversion(){var i,d,s,r,n,a;const t=e===null||e===void 0?void 0:e.checkout;if(!(t===null||t===void 0?void 0:t.show_converted_total)){return null}if((t===null||t===void 0?void 0:t.currency)===(t===null||t===void 0?void 0:t.current_currency)){return null}if(!((i=e===null||e===void 0?void 0:e.line_item)===null||i===void 0?void 0:i.total_amount)){return null}return o(l,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=e===null||e===void 0?void 0:e.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=e===null||e===void 0?void 0:e.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"),(a=(n=e===null||e===void 0?void 0:e.line_item)===null||n===void 0?void 0:n.currency)===null||a===void 0?void 0:a.toUpperCase()))))}render(){var i,l,d,s,r,n,a;return o("sc-summary",{key:"747b67d7ad42320d6adb06cc5ae4fe436fe4a235","open-text":"Total","closed-text":"Total",collapsible:true,collapsed:true},!!((i=e.line_item)===null||i===void 0?void 0:i.id)&&o("span",{key:"196450bc06fc13b019597a2a43f8f828451a6a48",slot:"price"},this.renderAmountDue()),o("sc-divider",{key:"75928d2ebbcf0182a73d99bec267a037c74bb735"}),o("sc-line-item",{key:"85ecf7678ac9745cd476a5b5955de119d3d9ffbf"},o("span",{key:"48b1d5f1e2531fd0063381daab4474d996c6adb2",slot:"description"},wp.i18n.__("Subtotal","surecart")),o("span",{key:"9868f8f7e434781799d6efa348843ced7e688d08",slot:"price"},(l=e.line_item)===null||l===void 0?void 0:l.subtotal_display_amount)),(((s=(d=e===null||e===void 0?void 0:e.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=e.line_item)===null||r===void 0?void 0:r.tax_amount)&&o("sc-line-item",{key:"d63bab2a8923f2ca489a06a9de404c212df04664"},o("span",{key:"ff98910f35dc395785b8143a5bcda2927c786146",slot:"description"},wp.i18n.__("Tax","surecart")),o("span",{key:"74b6f6a9d2ddeb60c16b9cf0996732e1770e06e9",slot:"price"},(n=e.line_item)===null||n===void 0?void 0:n.tax_display_amount)),o("sc-divider",{key:"b2f92fd9d64201ce657af3f19453e08cc09388a3"}),o("sc-line-item",{key:"b06804f6fea2d1a420ff84996f52fff18fe18ebe",style:{"--price-size":"var(--sc-font-size-x-large)"}},o("span",{key:"fc7f52b8e713f67f465c962642a5053bcbe1b2bd",slot:"title"},wp.i18n.__("Total","surecart")),o("span",{key:"257336b340f5c54be8b442af8653b5a7ce7b5f6a",slot:"price"},(a=e.line_item)===null||a===void 0?void 0:a.total_display_amount)),this.renderConversion())}};r.style=s;export{r as sc_upsell_totals};
//# sourceMappingURL=p-1cf4d4cd.entry.js.map