import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { _ as __, s as sprintf } from './default-i18n.js';
import './index2.js';
import { o as openWormhole } from './consumer.js';
import { d as defineCustomElement$h } from './sc-alert2.js';
import { d as defineCustomElement$g } from './sc-card2.js';
import { d as defineCustomElement$f } from './sc-dashboard-module2.js';
import { d as defineCustomElement$e } from './sc-divider2.js';
import { d as defineCustomElement$d } from './sc-format-number2.js';
import { d as defineCustomElement$c } from './sc-icon2.js';
import { d as defineCustomElement$b } from './sc-line-item2.js';
import { d as defineCustomElement$a } from './sc-line-item-total2.js';
import { d as defineCustomElement$9 } from './sc-order-confirmation-line-items2.js';
import { d as defineCustomElement$8 } from './sc-order-confirmation-totals2.js';
import { d as defineCustomElement$7 } from './sc-order-status-badge2.js';
import { d as defineCustomElement$6 } from './sc-product-line-item2.js';
import { d as defineCustomElement$5 } from './sc-quantity-select2.js';
import { d as defineCustomElement$4 } from './sc-skeleton2.js';
import { d as defineCustomElement$3 } from './sc-tag2.js';
import { d as defineCustomElement$2 } from './sc-total2.js';

const scOrderConfirmationDetailsCss = ":host{display:block}";

const ScOrderConfirmationDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
  }
  renderOrderStatus() {
    var _a, _b;
    if (((_a = this === null || this === void 0 ? void 0 : this.order) === null || _a === void 0 ? void 0 : _a.status) === 'processing') {
      return h("sc-tag", { type: "warning" }, __('On Hold', 'surecart'));
    }
    return h("sc-order-status-badge", { status: (_b = this.order) === null || _b === void 0 ? void 0 : _b.status });
  }
  render() {
    var _a, _b;
    if (!!this.loading) {
      return (h("sc-dashboard-module", null, h("sc-skeleton", { slot: "heading", style: { width: '120px', display: 'inline-block' } }), h("sc-skeleton", { slot: "end", style: { width: '60px', display: 'inline-block' } }), h("sc-card", null, h("sc-line-item", null, h("sc-skeleton", { style: { 'width': '50px', 'height': '50px', '--border-radius': '0' }, slot: "image" }), h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }), h("sc-skeleton", { slot: "description", style: { width: '60px', display: 'inline-block' } }), h("sc-skeleton", { style: { width: '120px', display: 'inline-block' }, slot: "price" }), h("sc-skeleton", { style: { width: '60px', display: 'inline-block' }, slot: "price-description" })), h("sc-divider", null), h("sc-line-item", null, h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }), h("sc-skeleton", { style: { width: '120px', display: 'inline-block' }, slot: "price" })), h("sc-divider", null), h("sc-line-item", null, h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }), h("sc-skeleton", { style: { width: '120px', display: 'inline-block' }, slot: "price" })))));
    }
    if (!((_a = this.order) === null || _a === void 0 ? void 0 : _a.number))
      return;
    return (h("sc-dashboard-module", { class: "order" }, h("span", { slot: "heading" }, sprintf(__('Order #%s', 'surecart'), (_b = this.order) === null || _b === void 0 ? void 0 : _b.number)), h("span", { slot: "end" }, this.renderOrderStatus()), h("sc-card", null, h("sc-order-confirmation-line-items", null), h("sc-divider", null), h("sc-order-confirmation-totals", null))));
  }
  static get style() { return scOrderConfirmationDetailsCss; }
}, [1, "sc-order-confirmation-details", {
    "order": [16],
    "loading": [4]
  }]);
openWormhole(ScOrderConfirmationDetails$1, ['order', 'loading'], false);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["sc-order-confirmation-details", "sc-alert", "sc-card", "sc-dashboard-module", "sc-divider", "sc-format-number", "sc-icon", "sc-line-item", "sc-line-item-total", "sc-order-confirmation-line-items", "sc-order-confirmation-totals", "sc-order-status-badge", "sc-product-line-item", "sc-quantity-select", "sc-skeleton", "sc-tag", "sc-total"];
  components.forEach(tagName => { switch (tagName) {
    case "sc-order-confirmation-details":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, ScOrderConfirmationDetails$1);
      }
      break;
    case "sc-alert":
      if (!customElements.get(tagName)) {
        defineCustomElement$h();
      }
      break;
    case "sc-card":
      if (!customElements.get(tagName)) {
        defineCustomElement$g();
      }
      break;
    case "sc-dashboard-module":
      if (!customElements.get(tagName)) {
        defineCustomElement$f();
      }
      break;
    case "sc-divider":
      if (!customElements.get(tagName)) {
        defineCustomElement$e();
      }
      break;
    case "sc-format-number":
      if (!customElements.get(tagName)) {
        defineCustomElement$d();
      }
      break;
    case "sc-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$c();
      }
      break;
    case "sc-line-item":
      if (!customElements.get(tagName)) {
        defineCustomElement$b();
      }
      break;
    case "sc-line-item-total":
      if (!customElements.get(tagName)) {
        defineCustomElement$a();
      }
      break;
    case "sc-order-confirmation-line-items":
      if (!customElements.get(tagName)) {
        defineCustomElement$9();
      }
      break;
    case "sc-order-confirmation-totals":
      if (!customElements.get(tagName)) {
        defineCustomElement$8();
      }
      break;
    case "sc-order-status-badge":
      if (!customElements.get(tagName)) {
        defineCustomElement$7();
      }
      break;
    case "sc-product-line-item":
      if (!customElements.get(tagName)) {
        defineCustomElement$6();
      }
      break;
    case "sc-quantity-select":
      if (!customElements.get(tagName)) {
        defineCustomElement$5();
      }
      break;
    case "sc-skeleton":
      if (!customElements.get(tagName)) {
        defineCustomElement$4();
      }
      break;
    case "sc-tag":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "sc-total":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}
defineCustomElement$1();

const ScOrderConfirmationDetails = ScOrderConfirmationDetails$1;
const defineCustomElement = defineCustomElement$1;

export { ScOrderConfirmationDetails, defineCustomElement };
