import{r as i,h as e,F as o}from"./p-9add63ef.js";import"./p-338ab6f8.js";import{s as l}from"./p-71d77b7d.js";import"./p-b3860daf.js";import"./p-2b28ea49.js";import"./p-13f5e4e1.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-efa47a7e.js";import"./p-445fd8b4.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(e){i(this,e)}renderAmountDue(){var i,e;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:!!((e=l===null||l===void 0?void 0:l.line_item)===null||e===void 0?void 0:e.trial_amount)?wp.i18n.__("Trial","surecart"):wp.i18n.__("Free","surecart")}getCurrencyToDisplay(){var i,e,o,d,s,r,a;return((o=(e=(i=l===null||l===void 0?void 0:l.line_item)===null||i===void 0?void 0:i.total_default_currency_display_amount)===null||e===void 0?void 0:e.toLowerCase())===null||o===void 0?void 0:o.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 t=l===null||l===void 0?void 0:l.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=l===null||l===void 0?void 0:l.line_item)===null||i===void 0?void 0:i.total_amount)){return null}return e(o,null,e("sc-divider",null),e("sc-line-item",{style:{"--price-size":"var(--sc-font-size-x-large)"}},e("span",{slot:"title"},e("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()))),e("span",{slot:"price"},this.getCurrencyToDisplay()&&e("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)),e("sc-line-item",null,e("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,o,d,s,r,a,n;return e("sc-summary",{key:"0739e9a5e58f06809010600ee86477fc0b6445cd","open-text":"Total","closed-text":"Total",collapsible:true,collapsed:true},!!((i=l.line_item)===null||i===void 0?void 0:i.id)&&e("span",{key:"b32507711695115f0153a8ee1845b60206fff5cb",slot:"price"},this.renderAmountDue()),e("sc-divider",{key:"540e49f003316e25de41c89a9aae25c92fc3eb19"}),e("sc-line-item",{key:"42685d605e95d41c0cec77d90e38b4faa6ac4e62"},e("span",{key:"62b4150b6662b7d1ccdf289ef4c8750b7099f3a8",slot:"description"},wp.i18n.__("Subtotal","surecart")),e("span",{key:"4e2d9964124462f81f134ac3e4372afe71dda97e",slot:"price"},(o=l.line_item)===null||o===void 0?void 0:o.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=>e("sc-line-item",null,e("span",{slot:"description"},i.description," ",`(${wp.i18n.__("one time","surecart")})`),e("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)&&e("sc-line-item",{key:"19e1a9d0655108d70503d86b215411c00487d6e4"},e("span",{key:"e2eafc99985ade97f4e11f95d4a6789d3fb78116",slot:"description"},wp.i18n.__("Tax","surecart")),e("span",{key:"9f0a4cf920bc02c09e1821f26626bbce40a48737",slot:"price"},(a=l.line_item)===null||a===void 0?void 0:a.tax_display_amount)),e("sc-divider",{key:"6545d8c687d93a4a36665089c25aa9d308a86a89"}),e("sc-line-item",{key:"8b83c46bf4aca2026ed11cce8f2e2c90bb14dc57",style:{"--price-size":"var(--sc-font-size-x-large)"}},e("span",{key:"e2543cabacdde57f186326db3526cbaadc3181fe",slot:"title"},wp.i18n.__("Total","surecart")),e("span",{key:"753e87177fd456753ed4ac3f306aa4b1a5193737",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-791f9dc3.entry.js.map