import { r as f, c as u, h as e, H as h, g as b } from "./index.61732cef.js";
import { c as p } from "./index-orsBiyT_.fc4357c3.js";
import { v } from "./v4-DD3477fe.2624487e.js";
import "react";
import "react-dom";
const _ = () => ":host{display:block;width:100%}:host *{box-sizing:border-box}.data-cell{display:flex;align-items:center;gap:var(--s-space-8);width:100%;padding:var(--s-space-12) var(--s-space-16);background-color:var(--s-surface-raised-50-default);border-radius:var(--swirl-data-cell-border-radius, var(--s-border-radius-l))}.data-cell--interactive{cursor:pointer}.data-cell--intent-default{background-color:var(--swirl-tag-background-default)}.data-cell--intent-info{background-color:var(--s-surface-info-subdued)}.data-cell--intent-critical{background-color:var(--s-surface-critical-subdued)}.data-cell--intent-warning{background-color:var(--s-surface-warning-subdued)}.data-cell--intent-success{background-color:var(--s-surface-success-subdued)}.data-cell--intent-special{background-color:var(--s-decorative-grape-surface-subdued)}.data-cell--intent-translucent{background-color:var(--s-surface-on-image-default)}.data-cell--vertical{align-items:center}.data-cell__media{flex-shrink:0;display:flex;align-items:center}.data-cell__media ::slotted(swirl-avatar){--swirl-avatar-background-color:var(--s-surface-default)}.data-cell__content{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:var(--s-space-24)}.data-cell--no-label .data-cell__content,.data-cell--no-label .data-cell__value-wrapper,.data-cell--no-label .data-cell__input{width:100%}.data-cell--vertical .data-cell__content{flex-direction:column;align-items:flex-start;gap:var(--s-space-4)}.data-cell__label-wrapper{flex-shrink:0;min-width:0}.data-cell:not(.data-cell--vertical) .data-cell__label-wrapper{width:calc(160px + var(--s-space-4) + 16px)}.data-cell__label{display:block;font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);color:var(--s-text-subdued);font-weight:var(--s-font-weight-normal)}.data-cell:not(.data-cell--vertical) .data-cell__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}.data-cell__tooltip swirl-icon-info{flex-shrink:0;color:var(--s-text-subdued)}.data-cell__value-wrapper{display:flex;align-items:center;gap:var(--s-space-4);flex-shrink:1;min-width:0}.data-cell--vertical .data-cell__value-wrapper{flex-direction:column;align-items:flex-start}.data-cell__value{flex:1;min-width:0;font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);color:var(--s-text-default);font-weight:var(--s-font-weight-semibold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.data-cell--vertical .data-cell__value{white-space:normal;overflow:visible;text-overflow:clip}.data-cell__suffix{flex-shrink:0}.data-cell__input{width:100%}.data-cell__input ::slotted(swirl-form-control){--swirl-form-control-label-background-color:var(       --swirl-data-cell-input-background,       var(--s-surface-default)     )}.data-cell__input ::slotted(swirl-checkbox),.data-cell__input ::slotted(swirl-radio){width:100%}@media (max-width: 767px){.data-cell:not(.data-cell--vertical) .data-cell__content{flex-direction:column;align-items:flex-start;gap:var(--s-space-4)}.data-cell:not(.data-cell--vertical) .data-cell__value-wrapper{flex-direction:column;align-items:flex-start}}", w = class {
  constructor(s) {
    f(this, s), this.valueChange = u(this, "valueChange", 7), this.intent = "default", this.vertical = !1, this.elementId = `data-cell-${v()}`, this.handleRadioClick = (a) => {
      const t = a.target, l = this.el.querySelector('swirl-radio[slot="content"]');
      t.contains(l) && (l == null ? void 0 : l.querySelector('input[type="radio"]')).click();
    }, this.handleClick = (a) => {
      this.handleRadioClick(a), this.valueChange.emit(a);
    };
  }
  render() {
    const s = Boolean(this.el.querySelector('[slot="media"]')), a = Boolean(this.el.querySelector('[slot="suffix"]')), t = Boolean(this.label), l = Boolean(this.el.querySelector('[slot="content"]')), c = Boolean(this.el.querySelector('swirl-checkbox[slot="content"]')), i = Boolean(this.el.querySelector('swirl-radio[slot="content"]')), n = p("data-cell", {
      "data-cell--vertical": this.vertical,
      "data-cell--has-media": s,
      "data-cell--has-suffix": a,
      "data-cell--has-content": l,
      "data-cell--no-label": !t,
      "data-cell--interactive": c || i,
      [`data-cell--intent-${this.intent}`]: this.intent
    }), r = `${this.elementId}-label`, o = `${this.elementId}-value`, d = e("swirl-stack", { key: "9f2409249516a9bbe1305042c127f1835162a8ce", orientation: "horizontal", align: "center", spacing: "4" }, e("span", { key: "2e3988360af729d84c2900b1eb5f7eeb0904253e", class: "data-cell__label", id: r, role: "term" }, this.label), this.tooltip && e("swirl-tooltip", { key: "01d9f35ae9ec42530b3e54075092fc6250642176", class: "data-cell__tooltip", content: this.tooltip, position: "right" }, e("swirl-icon-info", { key: "96adf5bbb572704353235df82f282947b55746c0", size: 16, tabIndex: 0 })));
    return e(h, { key: "0eaf842cef15c5fa1f4d0870167aa7ac7f331159", role: "group" }, e("div", { key: "a9ee5cb7920c880c8cc7ffc3dd3d8ca14a6f1297", class: n, part: "data-cell", onClick: c || i ? this.handleClick : void 0, role: c || i ? "button" : void 0, tabIndex: c || i ? 0 : void 0 }, s && e("div", { key: "27c4ca0f48c7b99670c340b7080b50153c341c09", class: "data-cell__media", "aria-hidden": "true" }, e("slot", { key: "6a8259682c14e52eb1ed8058517c9bd241322945", name: "media" })), e("div", { key: "7301cf8d5b4ee207093db70195909912a72173b2", class: "data-cell__content" }, t && e("div", { key: "86036a405648a2ea2e03468fe3865881718c240f", class: "data-cell__label-wrapper" }, d), (l || this.value || a) && e("div", { key: "ba1cc5a333da5811272f7be4cb6de4f7f347c89b", class: "data-cell__value-wrapper", role: "definition", "aria-labelledby": t ? r : void 0, id: o }, l ? e("div", { class: "data-cell__input" }, e("slot", { name: "content" })) : this.value && e("div", { class: "data-cell__value" }, this.value))), a && e("div", { key: "66e4bfd2a673226e782537c441614b9dc2e41b53", class: "data-cell__suffix" }, e("slot", { key: "d51eccb6f90591e73e32eed64288a4025f9dd529", name: "suffix" }))));
  }
  get el() {
    return b(this);
  }
};
w.style = _();
export {
  w as swirl_data_cell
};
