import{proxyCustomElement,HTMLElement,h,Fragment}from"@stencil/core/internal/client";import{o as openWormhole}from"./consumer.js";import{d as defineCustomElement$2}from"./sc-format-number2.js";import{d as defineCustomElement$1}from"./sc-line-item2.js";const scLineItemTaxCss=":host{display:block}",ScLineItemTaxStyle0=scLineItemTaxCss,ScLineItemTax=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.order=void 0,this.loading=void 0}renderLabel(){var e,t,n;let i=wp.i18n.sprintf(wp.i18n.__("Estimated %s","surecart"),(null===(e=null==this?void 0:this.order)||void 0===e?void 0:e.tax_label)||"");return"calculated"===(null===(t=null==this?void 0:this.order)||void 0===t?void 0:t.tax_status)&&(i=(null===(n=this.order)||void 0===n?void 0:n.tax_label)||""),h(Fragment,null,`${wp.i18n.__("Tax:","surecart")} ${i}`,this.renderPercent())}renderPercent(){var e;return(null===(e=this.order)||void 0===e?void 0:e.tax_percent)?h(Fragment,null,"(",this.order.tax_percent,"%",")"):""}render(){var e,t,n,i,r,s,o;return(null===(e=null==this?void 0:this.order)||void 0===e?void 0:e.tax_amount)?h("sc-line-item",null,h("span",{slot:"description"},this.renderLabel()),(null===(t=this.order)||void 0===t?void 0:t.tax_exclusive_amount)&&h("span",{slot:"price"},h("sc-format-number",{type:"currency",currency:(null===(n=null==this?void 0:this.order)||void 0===n?void 0:n.currency)||"usd",value:null===(i=null==this?void 0:this.order)||void 0===i?void 0:i.tax_exclusive_amount})),(null===(r=this.order)||void 0===r?void 0:r.tax_inclusive_amount)&&h("span",{slot:"price-description"},"(",h("sc-format-number",{type:"currency",currency:(null===(s=null==this?void 0:this.order)||void 0===s?void 0:s.currency)||"usd",value:null===(o=null==this?void 0:this.order)||void 0===o?void 0:o.tax_inclusive_amount})," ",wp.i18n.__("included","surecart"),")")):null}static get style(){return ScLineItemTaxStyle0}},[1,"sc-line-item-tax",{order:[16],loading:[4]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-line-item-tax","sc-format-number","sc-line-item"].forEach((e=>{switch(e){case"sc-line-item-tax":customElements.get(e)||customElements.define(e,ScLineItemTax);break;case"sc-format-number":customElements.get(e)||defineCustomElement$2();break;case"sc-line-item":customElements.get(e)||defineCustomElement$1()}}))}openWormhole(ScLineItemTax,["order","loading"],!1);export{ScLineItemTax as S,defineCustomElement as d};