{"version":3,"sources":["../src/components/calendar.tsx"],"sourcesContent":["import {\n  addMonths,\n  addYears,\n  format,\n  FormatOptions,\n  isDate,\n  isSameMonth,\n  isSameYear,\n  Locale,\n  subMonths,\n  subYears,\n} from \"date-fns\";\nimport { FC, useEffect, useRef, useState } from \"react\";\nimport {\n  DateLib,\n  DateRange,\n  DayPicker,\n  DayPickerProps,\n  defaultDateLib,\n  isDateAfterType,\n  isDateBeforeType,\n  isDateInterval,\n  isDateRange,\n  isDatesArray,\n  isDayOfWeekType,\n  Matcher,\n  rangeIncludesDate,\n} from \"react-day-picker\";\nimport { ChevronLeftIcon } from \"../icons/chevron-left\";\nimport { ChevronRightIcon } from \"../icons/chevron-right\";\nimport { clx } from \"../utils\";\nimport { Button, button_cva as buttonVariants } from \"./button\";\n\ntype CalendarProps = DayPickerProps & {\n  maxYear?: number;\n  minYear?: number;\n  yearOrder?: \"asc\" | \"desc\";\n  daterange?: \"from\" | \"to\";\n};\n\nconst Calendar: FC<CalendarProps> = ({\n  className,\n  classNames,\n  locale,\n  maxYear = 2099,\n  month: _month,\n  minYear = 1900,\n  showOutsideDays = true,\n  yearOrder = \"asc\",\n  ...props\n}) => {\n  const [view, setView] = useState<\"day\" | \"month\" | \"year\">(\"day\");\n\n  const today = new Date();\n  const [month, setMonth] = useState<Date>(_month ?? today);\n\n  const thisYear = _month?.getFullYear() ?? today.getFullYear();\n  const [year, setYear] = useState<number>(thisYear);\n\n  const yearRef = useRef<HTMLButtonElement>(null);\n  useEffect(() => {\n    if (view === \"year\")\n      if (yearRef && yearRef.current)\n        yearRef.current.scrollIntoView({\n          block: \"center\",\n        });\n  }, [view]);\n\n  const formatDate = (date: Date, formatStr: string, options?: FormatOptions) =>\n    format(date, formatStr, {\n      ...options,\n      locale: locale as Locale,\n    });\n\n  return (\n    <DayPicker\n      showOutsideDays={showOutsideDays}\n      month={month}\n      onMonthChange={setMonth}\n      className={clx(\n        \"pb-4.5 w-full p-3\",\n        view === \"day\" ? \"sm:w-fit\" : \"h-[342px]\",\n        className,\n      )}\n      classNames={{\n        months: \"relative flex flex-col h-full\",\n        month: \"flex flex-col h-full gap-y-1.5\",\n        month_caption: \"\",\n        caption_label: \"text-sm font-medium\",\n        nav: \"absolute right-0 flex gap-2 items-center\",\n        button_previous: buttonVariants({\n          variant: \"default-outline\",\n          iconOnly: true,\n          className: \"size-8\",\n        }),\n        button_next: buttonVariants({\n          variant: \"default-outline\",\n          iconOnly: true,\n          className: \"size-8\",\n        }),\n        chevron: \"size-4\",\n        month_grid: \"w-full border-collapse space-y-1\",\n        weekdays: \"\",\n        weekday: \"text-txt-black-500 font-normal sm:w-10 text-body-xs py-2\",\n        week: \"w-full mt-1.5\",\n        day: \"aspect-square p-0\",\n        day_button: clx(\n          buttonVariants({ variant: \"default-ghost\" }),\n          \"aspect-square h-full w-full font-normal justify-center disabled:bg-transparent\",\n          \"[.selected:not(.in-range)_&]:bg-primary-600 [.selected:not(.in-range)_&]:text-white\",\n          \"[.today:not(.selected)_&]:text-txt-primary [.today:selected)_&]:text-white\",\n        ),\n        selected: clx(\n          \"selected\",\n          props.mode === \"single\"\n            ? \"*:bg-primary-600 *:text-white *:hover:bg-primary-600 *:hover:text-white *:focus:bg-primary-600 *:focus:text-white\"\n            : \"\",\n        ),\n        today: \"today\",\n        outside: \"text-txt-black-900 opacity-50\",\n        disabled: \"\",\n        range_start:\n          \"rounded-l-md bg-bg-primary-100 *:bg-primary-600 *:text-white *:hover:bg-primary-600 *:hover:text-white *:focus:bg-primary-600 *:focus:text-white\",\n        range_middle:\n          \"in-range bg-bg-primary-100 *:hover:bg-bg-primary-200 *:focus:bg-bg-primary-200\",\n        range_end:\n          \"rounded-r-md bg-bg-primary-100 *:bg-primary-600 *:text-white *:hover:bg-primary-600 *:hover:text-white *:focus:bg-primary-600 *:focus:text-white\",\n        hidden: \"invisible\",\n        ...classNames,\n      }}\n      components={{\n        Chevron(props) {\n          if (props.orientation === \"left\") {\n            return <ChevronLeftIcon {...props} />;\n          }\n          return <ChevronRightIcon {...props} />;\n        },\n        CaptionLabel(props) {\n          const toggle = (monthOrYear: \"month\" | \"year\", formatStr: string) => (\n            <Button\n              variant={view === monthOrYear ? \"unset\" : \"default-ghost\"}\n              className={clx(\n                \"px-1.5 py-1 text-base font-semibold\",\n                view === monthOrYear\n                  ? \"text-txt-primary bg-bg-primary-50 ring-fr-primary focus:ring\"\n                  : \"border-none\",\n              )}\n              onClick={() =>\n                setView(view === monthOrYear ? \"day\" : monthOrYear)\n              }\n            >\n              {formatDate(month, formatStr)}\n            </Button>\n          );\n\n          return (\n            <span\n              {...props}\n              className=\"text-bg-black-400 relative flex w-fit select-none items-center gap-0.5\"\n            >\n              {toggle(\"month\", \"LLLL\")}/{toggle(\"year\", \"yyy\")}\n            </span>\n          );\n        },\n        MonthGrid(tableProps) {\n          return view === \"day\" ? (\n            <table {...tableProps} />\n          ) : view === \"month\" ? (\n            <table role=\"grid\" className=\"table h-full\">\n              <tbody>\n                {[0, 1, 2, 3].map((row_index) => (\n                  <tr>\n                    {[0, 1, 2].map((col_index) => {\n                      const date = new Date();\n                      date.setHours(0, 0, 0, 0);\n\n                      let selected_date = date;\n                      if (props.mode !== undefined)\n                        selected_date = getSelectedDate(\n                          props.selected,\n                          props.daterange,\n                        );\n\n                      const i = row_index * 3 + col_index;\n\n                      date.setFullYear(year, i, selected_date.getDate());\n\n                      const isSelected =\n                        month.getMonth() === i && month.getFullYear() === year;\n\n                      return (\n                        <td role=\"gridcell\">\n                          <Button\n                            data-selected={isSelected}\n                            variant={\n                              isSelected ? \"primary-fill\" : \"default-ghost\"\n                            }\n                            disabled={\n                              props.disabled\n                                ? dateMatchers(\"month\", date, props.disabled)\n                                : false\n                            }\n                            className=\"h-full w-full justify-center disabled:data-[selected=false]:bg-transparent\"\n                            onClick={(e) => {\n                              setMonth(date);\n                              setView(\"day\");\n\n                              if (props.mode !== undefined && props.onSelect) {\n                                if (props.mode === \"single\")\n                                  props.onSelect(date, date, {}, e);\n                                if (props.mode === \"range\") {\n                                  if (props.selected) {\n                                    const { from, to } = props.selected;\n                                    props.onSelect(\n                                      props.daterange === \"from\"\n                                        ? { from: date, to }\n                                        : { from, to: date },\n                                      date,\n                                      {},\n                                      e,\n                                    );\n                                  } else\n                                    props.onSelect(\n                                      props.daterange === \"from\"\n                                        ? { from: date, to: undefined }\n                                        : { from: undefined, to: date },\n                                      date,\n                                      {},\n                                      e,\n                                    );\n                                }\n                              }\n                            }}\n                          >\n                            {formatDate(date, \"MMM\")}\n                          </Button>\n                        </td>\n                      );\n                    })}\n                  </tr>\n                ))}\n              </tbody>\n            </table>\n          ) : (\n            <div className=\"overflow-y-auto\">\n              <table role=\"grid\" className=\"w-full\">\n                <tbody>\n                  {Array(Math.ceil((maxYear - minYear) / 3))\n                    .fill(null)\n                    .map((_, row_index) => (\n                      <tr>\n                        {[0, 1, 2].map((col_index) => {\n                          const i = row_index * 3 + col_index;\n\n                          const displayYear =\n                            yearOrder === \"asc\" ? minYear + i : maxYear - i;\n                          const isSelected =\n                            month.getFullYear() === displayYear;\n\n                          const date = new Date();\n                          date.setHours(0, 0, 0, 0);\n\n                          let selected_date = date;\n\n                          if (props.mode !== undefined)\n                            selected_date = getSelectedDate(\n                              props.selected,\n                              props.daterange,\n                            );\n\n                          date.setFullYear(\n                            displayYear,\n                            selected_date.getMonth(),\n                            selected_date.getDate(),\n                          );\n\n                          return (\n                            <td role=\"gridcell\">\n                              <Button\n                                ref={isSelected ? yearRef : null}\n                                data-selected-date={date}\n                                data-selected={isSelected}\n                                variant={\n                                  isSelected ? \"primary-fill\" : \"default-ghost\"\n                                }\n                                className=\"h-full min-h-11 w-full justify-center disabled:data-[selected=false]:bg-transparent\"\n                                disabled={\n                                  props.disabled\n                                    ? dateMatchers(\"year\", date, props.disabled)\n                                    : false\n                                }\n                                onClick={(e) => {\n                                  setYear(displayYear);\n                                  month.setFullYear(displayYear);\n                                  setMonth(month);\n                                  setView(\"month\");\n\n                                  if (\n                                    props.mode !== undefined &&\n                                    props.onSelect\n                                  ) {\n                                    if (props.mode === \"single\")\n                                      props.onSelect(date, date, {}, e);\n                                    if (props.mode === \"range\") {\n                                      if (props.selected) {\n                                        const { from, to } = props.selected;\n                                        props.onSelect(\n                                          props.daterange === \"from\"\n                                            ? { from: date, to }\n                                            : { from, to: date },\n                                          date,\n                                          {},\n                                          e,\n                                        );\n                                      } else\n                                        props.onSelect(\n                                          props.daterange === \"from\"\n                                            ? { from: date, to: undefined }\n                                            : { from: undefined, to: date },\n                                          date,\n                                          {},\n                                          e,\n                                        );\n                                    }\n                                  }\n                                }}\n                              >\n                                {displayYear}\n                              </Button>\n                            </td>\n                          );\n                        })}\n                      </tr>\n                    ))}\n                </tbody>\n              </table>\n            </div>\n          );\n        },\n        NextMonthButton(props) {\n          return view === \"day\" ? (\n            <Button\n              {...props}\n              onClick={() => {\n                const date = addMonths(month, 1);\n                setMonth(date);\n                setYear(date.getFullYear());\n              }}\n              disabled={addMonths(month, 1).getFullYear() > maxYear}\n            />\n          ) : view === \"month\" ? (\n            <Button\n              {...props}\n              aria-label=\"Go to the Next Year\"\n              onClick={() => {\n                const date = addYears(month, 1);\n                setMonth(date);\n                setYear(year + 1);\n              }}\n              disabled={year >= maxYear}\n            />\n          ) : (\n            <></>\n          );\n        },\n        PreviousMonthButton(props) {\n          return view === \"day\" ? (\n            <Button\n              {...props}\n              onClick={() => {\n                const date = subMonths(month, 1);\n                setMonth(date);\n                setYear(date.getFullYear());\n              }}\n              disabled={subMonths(month, 1).getFullYear() < minYear}\n            />\n          ) : view === \"month\" ? (\n            <Button\n              {...props}\n              aria-label=\"Go to the Previous Year\"\n              onClick={() => {\n                const date = subYears(month, 1);\n                setMonth(date);\n                setYear(year - 1);\n              }}\n              disabled={year <= minYear}\n            />\n          ) : (\n            <></>\n          );\n        },\n      }}\n      formatters={{\n        formatWeekdayName: (date, options) => formatDate(date, \"ccc\", options),\n      }}\n      {...props}\n    />\n  );\n};\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n\nfunction dateMatchers(\n  view: \"month\" | \"year\",\n  date: Date,\n  matchers: Matcher | Matcher[],\n  dateLib: DateLib = defaultDateLib,\n): boolean {\n  const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;\n  const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;\n  return matchersArr.some((matcher: Matcher) => {\n    if (typeof matcher === \"boolean\") {\n      return matcher;\n    }\n    if (isDate(matcher)) {\n      return isSameDay(date, matcher);\n    }\n    if (isDatesArray(matcher, dateLib)) {\n      return matcher.includes(date);\n    }\n    if (isDateRange(matcher)) {\n      if (view === \"month\") {\n        if (isSameMonth(date, matcher.from!)) return false;\n        if (isSameMonth(date, matcher.to!)) return false;\n      }\n      if (view === \"year\") {\n        if (isSameYear(date, matcher.from!)) return false;\n        if (isSameYear(date, matcher.to!)) return false;\n      }\n      return rangeIncludesDate(matcher, date, false, dateLib);\n    }\n    if (isDayOfWeekType(matcher)) {\n      if (!Array.isArray(matcher.dayOfWeek)) {\n        return matcher.dayOfWeek === date.getDay();\n      }\n      return matcher.dayOfWeek.includes(date.getDay());\n    }\n    if (isDateInterval(matcher)) {\n      const diffBefore = differenceInCalendarDays(matcher.before, date);\n      const diffAfter = differenceInCalendarDays(matcher.after, date);\n      const isDayBefore = diffBefore > 0;\n      const isDayAfter = diffAfter < 0;\n      const isClosedInterval = isAfter(matcher.before, matcher.after);\n      if (view === \"month\") {\n        if (isSameMonth(date, matcher.before)) return false;\n        if (isSameMonth(date, matcher.after)) return false;\n      }\n      if (view === \"year\") {\n        if (isSameYear(date, matcher.before)) return false;\n        if (isSameYear(date, matcher.after)) return false;\n      }\n      if (isClosedInterval) {\n        return isDayAfter && isDayBefore;\n      } else {\n        return isDayBefore || isDayAfter;\n      }\n    }\n    if (isDateAfterType(matcher)) {\n      if (view === \"month\" && isSameMonth(date, matcher.after)) return false;\n      if (view === \"year\" && isSameYear(date, matcher.after)) return false;\n      return differenceInCalendarDays(date, matcher.after) > 0;\n    }\n    if (isDateBeforeType(matcher)) {\n      if (view === \"month\" && isSameMonth(matcher.before, date)) return false;\n      if (view === \"year\" && isSameYear(matcher.before, date)) return false;\n      return differenceInCalendarDays(matcher.before, date) > 0;\n    }\n    if (typeof matcher === \"function\") {\n      return matcher(date);\n    }\n    return false;\n  });\n}\n\nfunction getSelectedDate(\n  selected?: Date | Date[] | DateRange,\n  daterange?: \"from\" | \"to\",\n): Date {\n  const date = new Date();\n  if (selected === undefined) return date;\n  if (isDate(selected)) return selected;\n  if (isDateRange(selected)) {\n    if (daterange === \"from\" && selected.from) return selected.from;\n    if (daterange === \"to\" && selected.to) return selected.to;\n    return date;\n  }\n  if (selected.length > 0 && selected[0]) return selected[0];\n  return date;\n}\n"],"mappings":"kOAAA,OACE,aAAAA,EACA,YAAAC,EACA,UAAAC,GAEA,UAAAC,EACA,eAAAC,EACA,cAAAC,EAEA,aAAAC,EACA,YAAAC,OACK,WACP,OAAa,aAAAC,GAAW,UAAAC,GAAQ,YAAAC,MAAgB,QAChD,OAGE,aAAAC,GAEA,kBAAAC,GACA,mBAAAC,GACA,oBAAAC,GACA,kBAAAC,GACA,eAAAC,EACA,gBAAAC,GACA,mBAAAC,GAEA,qBAAAC,OACK,mBA0GY,OAqOP,YAAAC,EArOO,OAAAC,EAuBP,QAAAC,OAvBO,oBA7FnB,IAAMC,GAA+BC,GAU/B,CAV+B,IAAAC,EAAAD,EACnC,WAAAE,EACA,WAAAC,EACA,OAAAC,EACA,QAAAC,EAAU,KACV,MAAOC,EACP,QAAAC,EAAU,KACV,gBAAAC,EAAkB,GAClB,UAAAC,EAAY,KAhDd,EAwCqCR,EAShCS,EAAAC,EATgCV,EAShC,CARH,YACA,aACA,SACA,UACA,QACA,UACA,kBACA,cAhDF,IAAAD,EAmDE,GAAM,CAACY,EAAMC,CAAO,EAAIC,EAAmC,KAAK,EAE1DC,EAAQ,IAAI,KACZ,CAACC,EAAOC,CAAQ,EAAIH,EAAeR,GAAA,KAAAA,EAAUS,CAAK,EA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,EAAYc,CAAQ,EAClBC,IAAc,QAAUD,EAAS,KAAaA,EAAS,KACvDC,IAAc,MAAQD,EAAS,GAAWA,EAAS,GAChDzB,EAELyB,EAAS,OAAS,GAAKA,EAAS,CAAC,EAAUA,EAAS,CAAC,EAClDzB,CACT","names":["addMonths","addYears","format","isDate","isSameMonth","isSameYear","subMonths","subYears","useEffect","useRef","useState","DayPicker","defaultDateLib","isDateAfterType","isDateBeforeType","isDateInterval","isDateRange","isDatesArray","isDayOfWeekType","rangeIncludesDate","Fragment","jsx","jsxs","Calendar","_a","_b","className","classNames","locale","maxYear","_month","minYear","showOutsideDays","yearOrder","props","__objRest","view","setView","useState","today","month","setMonth","thisYear","year","setYear","yearRef","useRef","useEffect","formatDate","date","formatStr","options","format","__spreadProps","__spreadValues","DayPicker","clx","button_cva","ChevronLeftIcon","ChevronRightIcon","toggle","monthOrYear","Button","tableProps","row_index","col_index","selected_date","getSelectedDate","i","isSelected","dateMatchers","e","from","to","_","displayYear","addMonths","addYears","subMonths","subYears","dateMatchers","view","date","matchers","dateLib","defaultDateLib","matchersArr","isSameDay","differenceInCalendarDays","isAfter","matcher","isDate","isDatesArray","isDateRange","isSameMonth","isSameYear","rangeIncludesDate","isDayOfWeekType","isDateInterval","diffBefore","diffAfter","isDayBefore","isDayAfter","isClosedInterval","isDateAfterType","isDateBeforeType","getSelectedDate","selected","daterange"]}