"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=require("vue"),r=require("./index.js"),v=require("../../RangeContext.js"),T=require("../../hooks/useCellClassName.js"),U=require("../../hooks/useMergeProps.js"),c=require("../../utils/dateUtil.js"),q=require("../PanelBody.js"),s=3,C=4;function o(i){const n=U.default(i),{prefixCls:Y,value:d,viewDate:u,locale:g,generateConfig:e}=n,{rangedValue:f,hoverRangedValue:N}=v.useInjectRange(),_=`${Y}-cell`,E=e.getYear(u),l=Math.floor(E/r.YEAR_DECADE_COUNT)*r.YEAR_DECADE_COUNT,m=l+r.YEAR_DECADE_COUNT-1,A=e.setYear(u,l-Math.ceil((s*C-r.YEAR_DECADE_COUNT)/2)),R=t=>{const a=e.getYear(t);return l<=a&&a<=m},D=T.default({cellPrefixCls:_,value:d,generateConfig:e,rangedValue:f.value,hoverRangedValue:N.value,isSameCell:(t,a)=>c.isSameYear(e,t,a),isInView:R,offsetCell:(t,a)=>e.addYear(t,a)});return O.createVNode(q.default,{...n,rowNum:C,colNum:s,baseDate:A,getCellText:e.getYear,getCellClassName:D,getCellDate:e.addYear,titleCell:t=>c.formatValue(t,{locale:g,format:"YYYY",generateConfig:e})},null)}o.displayName="YearBody";o.inheritAttrs=!1;exports.YEAR_COL_COUNT=s;exports.default=o;
