text: 'use strict';
  
  Object.defineProperty(exports, '__esModule', { value: true });
  
  var vue = require('vue');
  var dayjs = require('dayjs');
  require('../../../../hooks/index.js');
  require('../../../time-picker/index.js');
  var dom = require('../../../../utils/dom.js');
  var util = require('../../../../utils/util.js');
  var dateUtils = require('../../../time-picker/src/common/date-utils.js');
  var index = require('../../../../hooks/use-locale/index.js');
  
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
  
  const datesInYear = (year, lang) => {
    const firstDay = dayjs__default["default"](String(year)).locale(lang).startOf("year");
    const lastDay = firstDay.endOf("year");
    const numOfDays = lastDay.dayOfYear();
    return dateUtils.rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
  };
  var script = vue.defineComponent({
    props: {
      disabledDate: {
        type: Function
      },
      parsedValue: {
        type: Object
      },
      date: {
        type: Object
      }
    },
    emits: ["pick"],
    setup(props, ctx) {
      const { lang } = index.useLocaleInject();
      const startYear = vue.computed(() => {
        return Math.floor(props.date.year() / 10) * 10;
      });
      const getCellStyle = (year) => {
        const style = {};
        const today = dayjs__default["default"]().locale(lang.value);
        style.disabled = props.disabledDate ? datesInYear(year, lang.value).every(props.disabledDate) : false;
        style.current = util.coerceTruthyValueToArray(props.parsedValue).findIndex((_) => _.year() === year) >= 0;
        style.today = today.year() === year;
        return style;
      };
      const handleYearTableClick = (event) => {
        const target = event.target;
        if (target.tagName === "A") {
          if (dom.hasClass(target.parentNode, "disabled"))
            return;
          const year = target.textContent || target.innerText;
          ctx.emit("pick", Number(year));
        }
      };
      return {
        startYear,
        getCellStyle,
        handleYearTableClick
      };
    }
  });
  
  exports["default"] = script;
  //# sourceMappingURL=basic-year-table.vue_vue_type_script_lang.js.map
  