import x from "../../../../@babel/runtime/helpers/esm/extends.mjs";
import * as u from "react";
import R from "../../hooks/useCellClassName.mjs";
import V from "../../RangeContext.mjs";
import { isSameMonth as w, formatValue as C } from "../../utils/dateUtil.mjs";
import O from "../PanelBody.mjs";
var T = 3, _ = 4;
function b(l) {
  var f = l.prefixCls, a = l.locale, m = l.value, g = l.viewDate, e = l.generateConfig, r = l.cellRender, i = u.useContext(V), c = i.rangedValue, s = i.hoverRangedValue, d = "".concat(f, "-cell"), h = R({
    cellPrefixCls: d,
    value: m,
    generateConfig: e,
    rangedValue: c,
    hoverRangedValue: s,
    isSameCell: function(t, n) {
      return w(e, t, n);
    },
    isInView: function() {
      return !0;
    },
    offsetCell: function(t, n) {
      return e.addMonth(t, n);
    }
  }), v = a.shortMonths || (e.locale.getShortMonths ? e.locale.getShortMonths(a.locale) : []), M = e.setMonth(g, 0), N = r ? function(o, t) {
    return r(o, {
      originNode: t,
      locale: a,
      today: e.getNow(),
      type: "month"
    });
  } : void 0;
  return /* @__PURE__ */ u.createElement(O, x({}, l, {
    rowNum: _,
    colNum: T,
    baseDate: M,
    getCellNode: N,
    getCellText: function(t) {
      return a.monthFormat ? C(t, {
        locale: a,
        format: a.monthFormat,
        generateConfig: e
      }) : v[e.getMonth(t)];
    },
    getCellClassName: h,
    getCellDate: e.addMonth,
    titleCell: function(t) {
      return C(t, {
        locale: a,
        format: "YYYY-MM",
        generateConfig: e
      });
    }
  }));
}
export {
  T as MONTH_COL_COUNT,
  b as default
};
