import { defineComponent as f, openBlock as l, createElementBlock as r, normalizeStyle as g, unref as s, normalizeClass as u, renderSlot as v, Fragment as d, createElementVNode as n, createCommentVNode as k } from "vue";
import { useTheme as b } from "../../composables/useTheme.js";
const c = {
  key: 2,
  d: "m3 9l4-4l4 4M7 5v14m14-4l-4 4l-4-4m4 4V5"
}, i = {
  sort: [1, -1, void 0],
  textAlign: ["left", "center", "right", "justify"]
}, h = {
  sort: {
    type: Number,
    validator: (o) => i.sort.includes(o)
  },
  sortable: Boolean,
  textAlign: {
    type: String,
    default: "left",
    validator: (o) => i.textAlign.includes(o)
  }
}, x = { name: "XTableHeader", validators: i }, N = /* @__PURE__ */ f({
  ...x,
  props: h,
  setup(o) {
    const p = o, { styles: m, classes: a, className: y } = b("TableHeader", {}, p);
    return (t, e) => (l(), r("th", {
      style: g(s(m)),
      class: u([s(y), s(a).th, "group/th"])
    }, [
      v(t.$slots, "default"),
      t.sortable ? (l(), r("svg", {
        key: 0,
        class: u([
          s(a).sortIcon,
          [t.sort && [1, -1].includes(t.sort) ? "" : "invisible group-hover/th:visible"]
        ]),
        width: "24",
        height: "24",
        viewBox: "0 0 24 24",
        stroke: "currentColor",
        "stroke-linejoin": "round",
        "stroke-linecap": "round",
        fill: "none",
        role: "presentation"
      }, [
        t.sort === -1 ? (l(), r(d, { key: 0 }, [
          e[0] || (e[0] = n("line", {
            x1: "12",
            y1: "5",
            x2: "12",
            y2: "19"
          }, null, -1)),
          e[1] || (e[1] = n("polyline", { points: "19 12 12 19 5 12" }, null, -1))
        ], 64)) : t.sort === 1 ? (l(), r(d, { key: 1 }, [
          e[2] || (e[2] = n("line", {
            x1: "12",
            y1: "19",
            x2: "12",
            y2: "5"
          }, null, -1)),
          e[3] || (e[3] = n("polyline", { points: "5 12 12 5 19 12" }, null, -1))
        ], 64)) : (l(), r("path", c))
      ], 2)) : k("", !0)
    ], 6));
  }
});
export {
  N as default
};
