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BAAiB,CAAA,GAAA,gBAAQ,EAAE,MAAM,MAAM,gBAAgB,CAAC,GAAG;IAC7D;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,iBAAiB,OAAO,aAAa;QACrC,kBAAkB;QAClB,QAAQ;kBACN;uBACA;4BACA;4BACA;8BACA;4BACA;YACA,SAAS;YACT,GAAG,MAAM;QACX;IACF;IAEA,IAAI,YAAY;QACd,gBAAgB,OAAO,SAAS,IAAI;QACpC,gBAAgB,aAAa;QAC7B,gBAAgB,OAAO,SAAS,IAAI;QACpC,oBAAoB,OAAO,aAAa,IAAI;QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;QACpC,cAAc,WAAW;IAC3B;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IAEvD,qBACE,gCAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QAAE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAG3G","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaCalendarProps, useCalendar, useCalendarCell, useCalendarGrid} from 'react-aria/useCalendar';\n\nimport {AriaRangeCalendarProps, useRangeCalendar} from 'react-aria/useRangeCalendar';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState} from 'react-stately/useCalendarState';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  DOMProps,\n  DOMRenderProps,\n  Provider,\n  RenderProps,\n  SlotProps,\n  StyleProps,\n  useContextProps,\n  useRenderProps,\n  useSlottedContext\n} from './utils';\nimport {DateValue, useRangeCalendarState} from 'react-stately/useRangeCalendarState';\nimport {DOMAttributes, FocusableElement, forwardRefType, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {HeadingContext} from './Heading';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {RangeCalendarState} from 'react-stately/useRangeCalendarState';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\nimport {useCalendarState} from 'react-stately/useCalendarState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface CalendarRenderProps {\n  /**\n   * Whether the calendar is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * State of the calendar.\n   */\n  state: CalendarState,\n  /**\n   * Whether the calendar is invalid.\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n  /**\n   * State of the range calendar.\n   */\n  state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps, 'div'>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-Calendar'\n   */\n  className?: ClassNameOrFunction<CalendarRenderProps>,\n  /**\n   * The amount of days that will be displayed at once. This affects how pagination works.\n   * @default {months: 1}\n   */\n  visibleDuration?: DateDuration,\n  /**\n   * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n   * object for a given calendar identifier. If not provided, the `createCalendar` function\n   * from `@internationalized/date` will be used.\n   */\n  createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps, 'div'>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-RangeCalendar'\n   */\n  className?: ClassNameOrFunction<RangeCalendarRenderProps>,\n  /**\n   * The amount of days that will be displayed at once. This affects how pagination works.\n   * @default {months: 1}\n   */\n  visibleDuration?: DateDuration,\n  /**\n   * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n   * object for a given calendar identifier. If not provided, the `createCalendar` function\n   * from `@internationalized/date` will be used.\n   */\n  createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, CalendarContext);\n  let {locale} = useLocale();\n  let state = useCalendarState({\n    ...props,\n    locale,\n    createCalendar: props.createCalendar || createCalendar\n  });\n\n  let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      state,\n      isDisabled: props.isDisabled || false,\n      isInvalid: state.isValueInvalid\n    },\n    defaultClassName: 'react-aria-Calendar'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(DOMProps, renderProps, calendarProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-disabled={props.isDisabled || undefined}\n      data-invalid={state.isValueInvalid || undefined}>\n      <Provider\n        values={[\n          [ButtonContext, {\n            slots: {\n              previous: prevButtonProps,\n              next: nextButtonProps\n            }\n          }],\n          [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n          [CalendarStateContext, state],\n          [CalendarContext, props as CalendarProps<any>],\n          [TextContext, {\n            slots: {\n              errorMessage: errorMessageProps\n            }\n          }]\n        ]}>\n        {/* Add a screen reader only description of the entire visible range rather than\n          * a separate heading above each month grid. This is placed first in the DOM order\n          * so that it is the first thing a touch screen reader user encounters.\n          * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n          * elements, so the aria-label of the Calendar is included here as well. */}\n        <VisuallyHidden>\n          <h2>{calendarProps['aria-label']}</h2>\n        </VisuallyHidden>\n        {renderProps.children}\n        {/* For touch screen readers, add a visually hidden next button after the month grid\n          * so it's easy to navigate after reaching the end without going all the way\n          * back to the start of the month. */}\n        <VisuallyHidden>\n          <button\n            aria-label={nextButtonProps['aria-label']}\n            disabled={nextButtonProps.isDisabled}\n            onClick={() => state.focusNextPage()}\n            tabIndex={-1} />\n        </VisuallyHidden>\n      </Provider>\n    </dom.div>\n  );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n  let {locale} = useLocale();\n  let state = useRangeCalendarState({\n    ...props,\n    locale,\n    createCalendar: props.createCalendar || createCalendar\n  });\n\n  let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n    props,\n    state,\n    ref\n  );\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      state,\n      isDisabled: props.isDisabled || false,\n      isInvalid: state.isValueInvalid\n    },\n    defaultClassName: 'react-aria-RangeCalendar'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(renderProps, DOMProps, calendarProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-disabled={props.isDisabled || undefined}\n      data-invalid={state.isValueInvalid || undefined}>\n      <Provider\n        values={[\n          [ButtonContext, {\n            slots: {\n              previous: prevButtonProps,\n              next: nextButtonProps\n            }\n          }],\n          [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n          [RangeCalendarStateContext, state],\n          [RangeCalendarContext, props as RangeCalendarProps<any>],\n          [TextContext, {\n            slots: {\n              errorMessage: errorMessageProps\n            }\n          }]\n        ]}>\n        {/* Add a screen reader only description of the entire visible range rather than\n          * a separate heading above each month grid. This is placed first in the DOM order\n          * so that it is the first thing a touch screen reader user encounters.\n          * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n          * elements, so the aria-label of the Calendar is included here as well. */}\n        <VisuallyHidden>\n          <h2>{calendarProps['aria-label']}</h2>\n        </VisuallyHidden>\n        {renderProps.children}\n        {/* For touch screen readers, add a visually hidden next button after the month grid\n          * so it's easy to navigate after reaching the end without going all the way\n          * back to the start of the month. */}\n        <VisuallyHidden>\n          <button\n            aria-label={nextButtonProps['aria-label']}\n            disabled={nextButtonProps.isDisabled}\n            onClick={() => state.focusNextPage()}\n            tabIndex={-1} />\n        </VisuallyHidden>\n      </Provider>\n    </dom.div>\n  );\n});\n\nexport interface CalendarCellRenderProps {\n  /** The date that the cell represents. */\n  date: CalendarDate,\n  /** The day number formatted according to the current locale. */\n  formattedDate: string,\n  /**\n   * Whether the cell is currently hovered with a mouse.\n   * @selector [data-hovered]\n   */\n  isHovered: boolean,\n  /**\n   * Whether the cell is currently being pressed.\n   * @selector [data-pressed]\n   */\n  isPressed: boolean,\n  /**\n   * Whether the cell is selected.\n   * @selector [data-selected]\n   */\n  isSelected: boolean,\n  /**\n   * Whether the cell is the first date in a range selection.\n   * @selector [data-selection-start]\n   */\n  isSelectionStart: boolean,\n  /**\n   * Whether the cell is the last date in a range selection.\n   * @selector [data-selection-end]\n   */\n  isSelectionEnd: boolean,\n  /**\n   * Whether the cell is focused.\n   * @selector [data-focused]\n   */\n  isFocused: boolean,\n  /**\n   * Whether the cell is keyboard focused.\n   * @selector [data-focus-visible]\n   */\n  isFocusVisible: boolean,\n  /**\n   * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n   * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n   * displayed with a dimmed appearance.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * Whether the cell is outside the visible range of the calendar.\n   * For example, dates before the first day of a month in the same week.\n   * @selector [data-outside-visible-range]\n   */\n  isOutsideVisibleRange: boolean,\n  /**\n   * Whether the cell is outside the current month.\n   * @selector [data-outside-month]\n   */\n  isOutsideMonth: boolean,\n  /**\n   * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n   * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n   * are unavailable, such as a different color or a strikethrough.\n   *\n   * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n   * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n   *\n   * @selector [data-unavailable]\n   */\n  isUnavailable: boolean,\n  /**\n   * Whether the cell is part of an invalid selection.\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean,\n  /**\n   * Whether the cell is today.\n   * @selector [data-today]\n   */\n  isToday: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps, DOMRenderProps<'table', undefined>, GlobalDOMAttributes<HTMLTableElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n   * @default 'react-aria-CalendarGrid'\n   */\n  className?: string,\n  /**\n   * Either a function to render calendar cells for each date in the month,\n   * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n   * when additional customization is needed.\n   */\n  children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n  /**\n   * An offset from the beginning of the visible date range that this\n   * CalendarGrid should display. Useful when displaying more than one\n   * month at a time.\n   */\n  offset?: DateDuration,\n  /**\n   * The style of weekday names to display in the calendar grid header,\n   * e.g. single letter, abbreviation, or full day name.\n   * @default \"narrow\"\n   */\n  weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n  headerProps: DOMAttributes<FocusableElement>,\n  weekDays: string[],\n  startDate: CalendarDate,\n  weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n  let calendarState = useContext(CalendarStateContext);\n  let rangeCalendarState = useContext(RangeCalendarStateContext);\n  let calenderProps = useSlottedContext(CalendarContext)!;\n  let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n  let state = calendarState ?? rangeCalendarState!;\n  let startDate = state.visibleRange.start;\n  if (props.offset) {\n    startDate = startDate.add(props.offset);\n  }\n\n  let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n  let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n    startDate,\n    endDate: endOfMonth(startDate),\n    weekdayStyle: props.weekdayStyle,\n    firstDayOfWeek\n  }, state);\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n      <dom.table\n        render={props.render}\n        {...mergeProps(DOMProps, gridProps)}\n        ref={ref}\n        style={props.style}\n        cellPadding={0}\n        className={props.className ?? 'react-aria-CalendarGrid'}>\n        {typeof props.children !== 'function'\n          ? props.children\n          : (<>\n            <CalendarGridHeaderForwardRef>\n              {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n            </CalendarGridHeaderForwardRef>\n            <CalendarGridBodyForwardRef>\n              {props.children}\n            </CalendarGridBodyForwardRef>\n          </>)\n        }\n      </dom.table>\n    </InternalCalendarGridContext.Provider>\n  );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps, DOMRenderProps<'thead', undefined>, GlobalDOMAttributes<HTMLTableSectionElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n   * @default 'react-aria-CalendarGridHeader'\n   */\n  className?: string,\n  /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n  children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n  let {children, style, className} = props;\n  let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.thead\n      render={props.render}\n      {...mergeProps(DOMProps, headerProps)}\n      ref={ref}\n      style={style}\n      className={className ?? 'react-aria-CalendarGridHeader'}>\n      <tr>\n        {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n      </tr>\n    </dom.thead>\n  );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps, DOMRenderProps<'th', undefined>, GlobalDOMAttributes<HTMLTableHeaderCellElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n   * @default 'react-aria-CalendarHeaderCell'\n   */\n  className?: string\n}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n  let {children, style, className} = props;\n  let DOMProps = filterDOMProps(props, {global: true});\n  return (\n    <dom.th\n      render={props.render}\n      {...DOMProps}\n      ref={ref}\n      style={style}\n      className={className || 'react-aria-CalendarHeaderCell'}>\n      {children}\n    </dom.th>\n  );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps, DOMRenderProps<'tbody', undefined>, GlobalDOMAttributes<HTMLTableSectionElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n   * @default 'react-aria-CalendarGridBody'\n   */\n  className?: string,\n  /** A function to render a `<CalendarCell>` for a given date. */\n  children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n  let {children, style, className} = props;\n  let calendarState = useContext(CalendarStateContext);\n  let rangeCalendarState = useContext(RangeCalendarStateContext);\n  let state = calendarState ?? rangeCalendarState!;\n  let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.tbody\n      render={props.render}\n      {...DOMProps}\n      ref={ref}\n      style={style}\n      className={className ?? 'react-aria-CalendarGridBody'}>\n      {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n        <tr key={weekIndex}>\n          {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n            date\n              ? React.cloneElement(children(date), {key: i})\n              : <td key={i} />\n          ))}\n        </tr>\n      ))}\n    </dom.tbody>\n  );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps, 'div'>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-CalendarCell'\n   */\n  className?: ClassNameOrFunction<CalendarCellRenderProps>,\n  /** The date to render in the cell. */\n  date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n  let calendarState = useContext(CalendarStateContext);\n  let rangeCalendarState = useContext(RangeCalendarStateContext);\n  let state = calendarState ?? rangeCalendarState!;\n  let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n  let isOutsideMonth = !isSameMonth(currentMonth, date);\n  let istoday = isToday(date, state.timeZone);\n\n  let buttonRef = useRef<HTMLDivElement>(null);\n  let {cellProps, buttonProps, ...states} = useCalendarCell(\n    {date, isOutsideMonth},\n    state,\n    buttonRef\n  );\n\n  let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n  let {focusProps, isFocusVisible} = useFocusRing();\n  isFocusVisible &&= states.isFocused;\n  let isSelectionStart = false;\n  let isSelectionEnd = false;\n  if ('highlightedRange' in state && state.highlightedRange) {\n    isSelectionStart = isSameDay(date, state.highlightedRange.start);\n    isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n  }\n\n  let renderProps = useRenderProps({\n    ...otherProps,\n    defaultChildren: states.formattedDate,\n    defaultClassName: 'react-aria-CalendarCell',\n    values: {\n      date,\n      isHovered,\n      isOutsideMonth,\n      isFocusVisible,\n      isSelectionStart,\n      isSelectionEnd,\n      isToday: istoday,\n      ...states\n    }\n  });\n\n  let dataAttrs = {\n    'data-focused': states.isFocused || undefined,\n    'data-hovered': isHovered || undefined,\n    'data-pressed': states.isPressed || undefined,\n    'data-unavailable': states.isUnavailable || undefined,\n    'data-disabled': states.isDisabled || undefined,\n    'data-focus-visible': isFocusVisible || undefined,\n    'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n    'data-outside-month': isOutsideMonth || undefined,\n    'data-selected': states.isSelected || undefined,\n    'data-selection-start': isSelectionStart || undefined,\n    'data-selection-end': isSelectionEnd || undefined,\n    'data-invalid': states.isInvalid || undefined,\n    'data-today': istoday || undefined\n  };\n\n  let DOMProps = filterDOMProps(otherProps, {global: true});\n\n  return (\n    <td {...cellProps} ref={ref}>\n      <dom.div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n    </td>\n  );\n});\n"],"names":[],"version":3,"file":"Calendar.mjs.map"}