import { jsx as f } from "@emotion/react/jsx-runtime";
import { CellBackgroundWrapperStyled as c } from "../../../../slots/DataGridSlot.js";
const d = (e, r, n) => e instanceof Map ? e.get(`${r}|${n}`) : e(r, n), g = (e) => {
  const r = /* @__PURE__ */ new Map();
  return e && e.forEach(({ rowKey: n, columnKey: a, color: t }) => {
    r.set(`${n}|${a}`, t);
  }), r;
}, k = (e, r, n, a) => !r || r instanceof Map && r.size === 0 ? e : e.map((t) => {
  const o = t.renderCell;
  return {
    ...t,
    // Mantener todas las propiedades originales de la columna
    /**
     * Reemplazar renderCell con nuestra versión que agrega el color
     */
    renderCell: (i) => {
      const C = n(i.row), l = d(r, C, t.key), s = o ? o(i) : i.row[t.key];
      return l ? /* @__PURE__ */ f(
        c,
        {
          ownerState: {
            cellBackgroundColor: l,
            currentRowHeightVariant: a
          },
          children: s
        }
      ) : s;
    }
  };
});
export {
  g as createRowCellsBackgroundMap,
  k as processColumnsWithRowCellsBackground
};
