'use strict';

var chunkCUFFPIPP_cjs = require('./chunk-CUFFPIPP.cjs');
var classnames = require('classnames');
var React = require('react');
var reactDayPicker = require('react-day-picker');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var classnames__default = /*#__PURE__*/_interopDefault(classnames);
var React__default = /*#__PURE__*/_interopDefault(React);

var CLASS_NAMES2 = {
  ...chunkCUFFPIPP_cjs.CLASS_NAMES,
  day_range_start: classnames__default.default(chunkCUFFPIPP_cjs.DateCalendar_default.calendarRangeEndpoint, chunkCUFFPIPP_cjs.DateCalendar_default.calendarRangeStart),
  day_range_middle: chunkCUFFPIPP_cjs.DateCalendar_default.calendarRangeMiddle,
  day_range_end: classnames__default.default(chunkCUFFPIPP_cjs.DateCalendar_default.calendarRangeEndpoint, chunkCUFFPIPP_cjs.DateCalendar_default.calendarRangeEnd)
};
function DateRangeCalendar({
  selected,
  onSelect,
  min,
  max,
  footer
}) {
  const disabled = React.useMemo(() => chunkCUFFPIPP_cjs.buildDisabledMatchers(min, max), [min, max]);
  const fromYear = min != null ? min.getFullYear() : chunkCUFFPIPP_cjs.DEFAULT_FROM_YEAR;
  const toYear = max != null ? max.getFullYear() : chunkCUFFPIPP_cjs.DEFAULT_TO_YEAR;
  const calendarFooter = footer == null ? void 0 : /* @__PURE__ */ React__default.default.createElement("div", {
    className: chunkCUFFPIPP_cjs.DateCalendar_default.calendarRangeFooter
  }, footer);
  return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactDayPicker.DayPicker, {
    mode: "range",
    selected,
    onSelect,
    disabled,
    defaultMonth: selected?.from,
    classNames: CLASS_NAMES2,
    components: chunkCUFFPIPP_cjs.CALENDAR_COMPONENTS,
    captionLayout: "dropdown-buttons",
    fromYear,
    toYear,
    numberOfMonths: 2,
    pagedNavigation: true
  }), calendarFooter);
}

exports.DateRangeCalendar = DateRangeCalendar;
//# sourceMappingURL=chunk-J4W4E3ZR.cjs.map
//# sourceMappingURL=chunk-J4W4E3ZR.cjs.map