import { n as c, C as n } from "../chunks/lib-cortex-element.CVMmyPMC.js";
import { c as h } from "../chunks/component.styles.CRO4Odto.js";
import { c as p } from "../chunks/custom-element.L4WJXn1j.js";
import { H as b } from "../chunks/slot.j5oheLJC.js";
import { i as v, x as m } from "../chunks/lit-element.jLBm65_O.js";
import { e as g } from "../chunks/class-map.BiVq-cVR.js";
const f = v`:host{--border-color:var(--cx-color-neutral-200);--border-radius:var(--cx-border-radius-x-large);--box-shadow:var(--cx-shadow-x-small);--image-border-radius:var(--cx-border-radius-x-large);--border-width:1px;--padding:var(--cx-spacing-large);width:var(--card-width,auto);height:var(--card-height,auto);display:inline-block}.card{background-color:var(--cx-panel-background-color);box-shadow:var(--box-shadow);border:solid var(--border-width) var(--border-color);border-radius:var(--border-radius);padding:var(--padding);flex-direction:column;width:100%;height:100%;display:flex;position:relative;overflow:auto}.card--interactive{--border-color:var(--cx-color-primary-300);box-shadow:none;cursor:pointer;transition:box-shadow .2s ease-in-out}.card--interactive:hover{box-shadow:var(--cx-shadow-medium)}.card--disabled:before{content:"";background-color:rgb(from var(--cx-color-neutral-0) r g b / 50%);z-index:1;width:100%;height:100%;position:absolute;top:0;left:0}.card__image{background-color:var(--cx-color-neutral-100);border-radius:var(--image-border-radius);margin:calc(-1 * var(--border-width));margin-bottom:var(--padding);flex-shrink:0;justify-content:center;align-items:center;display:flex;overflow:hidden}.card__image::slotted(img){width:100%;height:auto;display:block}.card:not(.card--has-image) .card__image{display:none}.card__header{border-bottom:solid var(--header-border-width,var(--border-width)) var(--border-color);padding-bottom:var(--padding);margin-bottom:var(--padding);display:block}.card:not(.card--has-header) .card__header{display:none}.card__title{font-size:var(--cx-font-size-large);font-weight:var(--cx-font-weight-bold);display:block}.card:not(.card--has-title) .card__title{display:none}.card__body{width:100%;display:block}.card--has-footer .card__footer{border-top:solid var(--border-width) var(--border-color);padding-top:var(--padding);margin-top:var(--padding);display:block}.card:not(.card--has-footer) .card__footer{display:none}`;
var u = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, l = (o, e, d, t) => {
  for (var r = t > 1 ? void 0 : t ? _(e, d) : e, i = o.length - 1, s; i >= 0; i--)
    (s = o[i]) && (r = (t ? s(e, d, r) : s(r)) || r);
  return t && r && u(e, d, r), r;
};
let a = class extends n {
  constructor() {
    super(...arguments), this.interactive = !1, this.disabled = !1, this.hasSlotController = new b(
      this,
      "footer",
      "header",
      "image"
    );
  }
  handleClick(o) {
    this.disabled && o.preventDefault();
  }
  render() {
    return m`<div part="base" class=${g({
      card: !0,
      "card--disabled": this.disabled,
      "card--has-footer": this.hasSlotController.test("footer"),
      "card--has-header": this.hasSlotController.test("header"),
      "card--has-image": this.hasSlotController.test("image"),
      "card--has-title": this.hasSlotController.test("title"),
      "card--interactive": this.interactive
    })} @click=${this.handleClick}><slot name="image" part="image" class="card__image"></slot><slot name="header" part="header" class="card__header"></slot><slot name="title" part="title" class="card__title"></slot><slot part="body" class="card__body"></slot><slot name="footer" part="footer" class="card__footer"></slot></div>`;
  }
};
a.styles = [h, f];
l([
  c({ reflect: !0, type: Boolean })
], a.prototype, "interactive", 2);
l([
  c({ reflect: !0, type: Boolean })
], a.prototype, "disabled", 2);
a = l([
  p("cx-card")
], a);
export {
  a as default
};
