import { jsx as o } from "react/jsx-runtime";
import m from "../../../checkbox/Checkbox.js";
import d from "../../../../utils/classNames.js";
import { getVerticalAlignClassName as p } from "../../shared/getAlignClassName.js";
import { resolveAriaSpan as g } from "../../shared/resolveTableAria.js";
const w = (n) => {
  const {
    isAllSelected: l,
    isSomeRowsSelected: i,
    onToggleAllSelection: r,
    disabled: c,
    rowCount: t,
    selectionHeaderContent: a,
    selectionCheckboxVerticalAlignment: s
  } = n;
  return /* @__PURE__ */ o(
    "div",
    {
      className: d(
        "table-head-cell table-selection-cell table-align-center",
        p(s),
        a && "table-selection-cell-custom-content"
      ),
      role: "columnheader",
      "aria-colindex": 1,
      "aria-rowindex": 1,
      "aria-rowspan": g(t),
      style: { gridColumn: "1 / span 1", gridRow: `1 / span ${t}` },
      children: /* @__PURE__ */ o(
        "div",
        {
          className: "table-selection-control",
          onClick: (e) => e.stopPropagation(),
          onKeyDown: (e) => e.stopPropagation(),
          children: a ?? /* @__PURE__ */ o(
            m,
            {
              checked: l,
              disabled: c,
              indeterminate: !l && !!i,
              onChange: () => r?.()
            }
          )
        }
      )
    }
  );
};
export {
  w as default
};
//# sourceMappingURL=TableHeaderSelectionCell.js.map
