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