'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-cd6fab62.js');
const consumer = require('./consumer-1372755b.js');
const defaultI18n = require('./default-i18n-072e75d7.js');
require('./index-20b57ec7.js');
require('./_commonjsHelpers-537d719a.js');

const scCardCss = ":host{display:block;--overflow:visible}.card{font-family:var(--sc-font-sans);overflow:var(--overflow)}.card:not(.card--borderless){padding:var(--sc-spacing-large);background:var(--sc-color-white);border:1px solid var(--sc-color-gray-300);border-radius:var(--sc-input-border-radius-medium);box-shadow:var(--sc-shadow-small)}.card:not(.card--borderless).card--no-padding{padding:0}.title--divider{display:none}.card--has-title-slot .card--title{font-weight:var(--sc-font-weight-bold);line-height:var(--sc-line-height-dense)}.card--has-title-slot .title--divider{display:block}::slotted(*){margin-bottom:var(--sc-form-row-spacing)}::slotted(*:first-child){margin-top:0}::slotted(*:last-child){margin-bottom:0 !important}";

const ScCard = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.handleSlotChange();
  }
  handleSlotChange() {
    this.hasTitleSlot = !!this.el.querySelector('[slot="title"]');
  }
  render() {
    return (index.h("div", { part: "base", class: {
        'card': true,
        'card--borderless': this.borderless,
        'card--no-padding': this.noPadding,
        // 'card--has-title-slot': this.hasTitleSlot,
      } }, index.h("slot", null)));
  }
  get el() { return index.getElement(this); }
};
consumer.openWormhole(ScCard, ['loading'], false);
ScCard.style = scCardCss;

const scDashboardModuleCss = ":host{display:block;position:relative}.dashboard-module{display:grid;gap:var(--sc-dashboard-module-spacing, 1em)}.heading{font-family:var(--sc-font-sans);display:flex;flex-wrap:wrap;gap:2em;align-items:center;justify-content:space-between}.heading__text{display:grid;flex:1;gap:calc(var(--sc-dashboard-module-spacing, 1em) / 2)}.heading__title{font-size:var(--sc-dashbaord-module-heading-size, var(--sc-font-size-x-large));font-weight:var(--sc-dashbaord-module-heading-weight, var(--sc-font-weight-bold));line-height:var(--sc-dashbaord-module-heading-line-height, var(--sc-line-height-dense))}.heading__description{font-size:var(--sc-font-size-normal);line-height:var(--sc-line-height-dense);color:var(--sc-color-gray-500)}";

const ScDashboardModule = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    return (index.h("div", { class: "dashboard-module" }, !!this.error && (index.h("sc-alert", { open: !!this.error, type: "danger" }, index.h("span", { slot: "title" }, defaultI18n.__('Error', 'surecart')), this.error)), index.h("div", { class: "heading" }, index.h("div", { class: "heading__text" }, index.h("div", { class: "heading__title", part: "heading-title" }, index.h("slot", { name: "heading" }, this.heading)), index.h("div", { class: "heading__description", part: "heading-description" }, index.h("slot", { name: "description" }))), index.h("slot", { name: "end" })), index.h("slot", null)));
  }
};
ScDashboardModule.style = scDashboardModuleCss;

exports.sc_card = ScCard;
exports.sc_dashboard_module = ScDashboardModule;
