var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarGroupRowHeader.tsx
var BookingCalendarGroupRowHeader_exports = {};
__export(BookingCalendarGroupRowHeader_exports, {
  BookingCalendarGroupRowHeader: () => BookingCalendarGroupRowHeader
});
module.exports = __toCommonJS(BookingCalendarGroupRowHeader_exports);
var import_react = __toESM(require("react"));
var import_icons = require("@ant-design/icons");
var STICKY_GROUP_SHELL = "sticky left-0 z-30 flex h-full min-h-0 w-[132px] min-w-[132px] max-w-[132px] items-center border-b px-2 py-1 shadow-[8px_0_16px_rgba(0,0,0,0.08)]";
var STICKY_GROUP_LIGHT = "border-slate-200 bg-gradient-to-b from-slate-100 to-slate-50";
var STICKY_GROUP_DARK = "border-zinc-800/80 bg-gradient-to-b from-[#252038] to-[#1a1628]";
function BookingCalendarGroupRowHeader(props) {
  const {
    isLight,
    view,
    row,
    renderResourceCell,
    setCollapsedGroups,
    style
  } = props;
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      className: `${STICKY_GROUP_SHELL} ${isLight ? STICKY_GROUP_LIGHT : STICKY_GROUP_DARK}`,
      style
    },
    renderResourceCell ? renderResourceCell({
      view,
      row: {
        kind: "group",
        id: row.id,
        label: row.label,
        count: row.count,
        collapsed: row.collapsed
      },
      isLight,
      onToggleGroup: (label) => setCollapsedGroups((prev) => ({
        ...prev,
        [label]: !prev[label]
      }))
    }) : /* @__PURE__ */ import_react.default.createElement(
      "button",
      {
        type: "button",
        "aria-expanded": !row.collapsed,
        onClick: () => setCollapsedGroups((prev) => ({
          ...prev,
          [row.label]: !prev[row.label]
        })),
        className: `flex w-full min-h-0 items-center gap-2 rounded-lg px-1 py-0.5 text-left transition-colors ${isLight ? "" : "active:bg-white/[0.07]"}`
      },
      /* @__PURE__ */ import_react.default.createElement(
        import_icons.DownOutlined,
        {
          style: { fontSize: 14 },
          className: `shrink-0 self-center transition-transform duration-200 ${isLight ? "text-slate-500" : "text-zinc-500"} ${row.collapsed ? "-rotate-90" : "rotate-0"}`,
          "aria-hidden": true
        }
      ),
      /* @__PURE__ */ import_react.default.createElement("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-1.5" }, /* @__PURE__ */ import_react.default.createElement(
        "span",
        {
          className: `pisell-rb-cal-week-resource-name min-w-0 flex-1 truncate text-[13px] font-semibold leading-snug ${isLight ? "text-slate-800" : "text-zinc-100"}`
        },
        row.label
      ), /* @__PURE__ */ import_react.default.createElement(
        "span",
        {
          className: `shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${isLight ? "bg-violet-100 text-violet-800" : "bg-zinc-800/90 text-zinc-300 ring-1 ring-zinc-600/40"}`
        },
        row.count
      ))
    )
  );
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  BookingCalendarGroupRowHeader
});
