import C from "../../../@babel/runtime/helpers/esm/defineProperty.mjs";
import A from "../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import F from "../../../classnames/index.mjs";
import * as a from "react";
import G from "../PanelContext.mjs";
import { getCellDateDisabled as H } from "../utils/dateUtil.mjs";
import { getLastDay as I } from "../utils/timeUtil.mjs";
function X(e) {
  for (var m = e.prefixCls, P = e.disabledDate, R = e.onSelect, v = e.picker, S = e.rowNum, p = e.colNum, N = e.prefixColumn, f = e.rowClassName, T = e.baseDate, $ = e.getCellClassName, g = e.getCellText, b = e.getCellNode, w = e.getCellDate, D = e.generateConfig, E = e.titleCell, x = e.headerCells, i = a.useContext(G), y = i.onDateMouseEnter, M = i.onDateMouseLeave, B = i.mode, l = "".concat(m, "-cell"), h = [], r = 0; r < S; r += 1) {
    for (var u = [], d = void 0, q = function() {
      var n, z = r * p + o, t = w(T, z), s = H({
        cellDate: t,
        mode: B,
        disabledDate: P,
        generateConfig: D
      });
      o === 0 && (d = t, N && u.push(N(d)));
      var c = E && E(t), k = /* @__PURE__ */ a.createElement("div", {
        className: "".concat(l, "-inner")
      }, g(t));
      u.push(/* @__PURE__ */ a.createElement("td", {
        key: o,
        title: c,
        className: F(l, A((n = {}, C(n, "".concat(l, "-disabled"), s), C(n, "".concat(l, "-start"), g(t) === 1 || v === "year" && Number(c) % 10 === 0), C(n, "".concat(l, "-end"), c === I(D, t) || v === "year" && Number(c) % 10 === 9), n), $(t))),
        onClick: function() {
          s || R(t);
        },
        onMouseEnter: function() {
          !s && y && y(t);
        },
        onMouseLeave: function() {
          !s && M && M(t);
        }
      }, b ? b(t, k) : k));
    }, o = 0; o < p; o += 1)
      q();
    h.push(/* @__PURE__ */ a.createElement("tr", {
      key: r,
      className: f && f(d)
    }, u));
  }
  return /* @__PURE__ */ a.createElement("div", {
    className: "".concat(m, "-body")
  }, /* @__PURE__ */ a.createElement("table", {
    className: "".concat(m, "-content")
  }, x && /* @__PURE__ */ a.createElement("thead", null, /* @__PURE__ */ a.createElement("tr", null, x)), /* @__PURE__ */ a.createElement("tbody", null, h)));
}
export {
  X as default
};
