import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{o as openWormhole}from"./consumer.js";import{d as defineCustomElement$1}from"./sc-format-number2.js";const scTotalCss=":host{display:block}.total-amount{display:inline-block}",ScTotalStyle0=scTotalCss,ScTotal=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.order_key={total:"total_amount",subtotal:"subtotal_amount",amount_due:"amount_due"},this.total="amount_due",this.order=void 0}render(){var t,e,o,s,r;if((null===(t=this.order)||void 0===t?void 0:t.currency)&&(null===(s=null===(o=null===(e=this.order)||void 0===e?void 0:e.line_items)||void 0===o?void 0:o.data)||void 0===s?void 0:s.length))return h("sc-format-number",{type:"currency",currency:this.order.currency,value:null===(r=this.order)||void 0===r?void 0:r[this.order_key[this.total]]})}static get style(){return ScTotalStyle0}},[0,"sc-total",{total:[1],order:[16]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-total","sc-format-number"].forEach((t=>{switch(t){case"sc-total":customElements.get(t)||customElements.define(t,ScTotal);break;case"sc-format-number":customElements.get(t)||defineCustomElement$1()}}))}openWormhole(ScTotal,["order"],!1);export{ScTotal as S,defineCustomElement as d};