"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/jsx-runtime.js"),h=require("react"),a=require("./styles.js"),c=require("../../dateUtils.js"),u=require("../calendar/utils.js");function l(t){return t&&t.__esModule?t:{default:t}}var x=l(h);const D=x.default.forwardRef((t,r)=>{const{disabled:n=!1}=t;function s(){if(!n){const i=u.getPrevMonth(t.currentMonth),d=u.getNextMonth(t.currentMonth);t.day.getMonth()===i?t.onChange(t.day,i):t.day.getMonth()===d?t.onChange(t.day,d):t.onChange(t.day)}}function y(){return t.isStartDay&&t.isEndDay}return e.jsxRuntimeExports.jsx(a.Wrapper,{isInRange:t.isInRange&&t.selection!=="single-date"&&!y(),isStartDay:t.isStartDay,isEndDay:t.isEndDay,onClick:s,disabled:n,children:e.jsxRuntimeExports.jsxs(a.DayNum,{ref:r||void 0,isStartEndDay:t.isStartDay||t.isEndDay,isToday:c.getIsToday(t.day),isCurrentMonth:t.day.getMonth()===t.currentMonth||t.currentMonth===12,disabled:n,width:t.width,tabIndex:t.hasFocus?0:-1,children:[e.jsxRuntimeExports.jsx("span",{children:t.day.getDate()}),t.hasEvent&&e.jsxRuntimeExports.jsx(a.Event,{isStartEnd:t.isStartDay||t.isEndDay})]})})});exports.Day=D;
