import y from "../../../../@babel/runtime/helpers/esm/extends.mjs";
import N from "../../../../@babel/runtime/helpers/esm/defineProperty.mjs";
import * as A from "react";
import { DECADE_UNIT_DIFF as l, DECADE_DISTANCE_COUNT as n } from "./constant.mjs";
import w from "../PanelBody.mjs";
var u = 3, v = 4;
function R(r) {
  var C = l - 1, g = r.prefixCls, D = r.viewDate, t = r.generateConfig, i = r.cellRender, s = r.locale, f = "".concat(g, "-cell"), m = t.getYear(D), _ = Math.floor(m / l) * l, o = Math.floor(m / n) * n, E = o + n - 1, Y = t.setYear(D, o - Math.ceil((u * v * l - n) / 2)), T = function(a) {
    var e, d = t.getYear(a), x = d + C;
    return e = {}, N(e, "".concat(f, "-in-view"), o <= d && x <= E), N(e, "".concat(f, "-selected"), d === _), e;
  }, b = i ? function(c, a) {
    return i(c, {
      originNode: a,
      today: t.getNow(),
      type: "decade",
      locale: s
    });
  } : void 0;
  return /* @__PURE__ */ A.createElement(w, y({}, r, {
    rowNum: v,
    colNum: u,
    baseDate: Y,
    getCellNode: b,
    getCellText: function(a) {
      var e = t.getYear(a);
      return "".concat(e, "-").concat(e + C);
    },
    getCellClassName: T,
    getCellDate: function(a, e) {
      return t.addYear(a, e * l);
    }
  }));
}
export {
  u as DECADE_COL_COUNT,
  R as default
};
