{"version":3,"file":"index.732c4f8a.js","sources":["../../vite/modulepreload-polyfill","../../lib/DatePicker/DatePickerEntry.jsx","../../lib/DatePicker/DatePicker.jsx","../../src/App.jsx","../../src/main.jsx"],"sourcesContent":["const p = function polyfill() {\n const relList = document.createElement('link').relList;\n if (relList && relList.supports && relList.supports('modulepreload')) {\n return;\n }\n for (const link of document.querySelectorAll('link[rel=\"modulepreload\"]')) {\n processPreload(link);\n }\n new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== 'childList') {\n continue;\n }\n for (const node of mutation.addedNodes) {\n if (node.tagName === 'LINK' && node.rel === 'modulepreload')\n processPreload(node);\n }\n }\n }).observe(document, { childList: true, subtree: true });\n function getFetchOpts(script) {\n const fetchOpts = {};\n if (script.integrity)\n fetchOpts.integrity = script.integrity;\n if (script.referrerpolicy)\n fetchOpts.referrerPolicy = script.referrerpolicy;\n if (script.crossorigin === 'use-credentials')\n fetchOpts.credentials = 'include';\n else if (script.crossorigin === 'anonymous')\n fetchOpts.credentials = 'omit';\n else\n fetchOpts.credentials = 'same-origin';\n return fetchOpts;\n }\n function processPreload(link) {\n if (link.ep)\n // ep marker = processed\n return;\n link.ep = true;\n // prepopulate the load record\n const fetchOpts = getFetchOpts(link);\n fetch(link.href, fetchOpts);\n }\n};__VITE_IS_MODERN__&&p();","import React from 'react';\nimport classNames from 'classnames';\nimport styles from './DatePicker.module.scss';\n\nexport default function DatePickerEntry ({\n label,\n type = 'radio',\n value, \n description,\n active,\n name,\n selected,\n disabled,\n ...props\n}) {\n\n return ;\n}\n","import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport styles from './DatePicker.module.scss';\nimport {\n startOfMonth,\n endOfMonth,\n eachDayOfInterval,\n isSameMonth,\n endOfWeek,\n startOfWeek,\n intlFormat,\n format,\n subMonths,\n addMonths,\n isToday,\n isSameDay,\n isBefore,\n isAfter\n} from 'date-fns';\nimport DatePickerEntry from './DatePickerEntry';\n\nexport default function DatePicker ({ defaultValue = [], onChange, minDate, maxDate, maxSelections = 2 }) {\n const [activeMonth, setActiveMonth] = useState(new Date());\n const [selectedDates, setSelectedDates] = useState(defaultValue);\n\n const onSelect = (date) => {\n if (isDayDisabled(date)) return;\n if (\n selectedDates.filter(e => isSameDay(e, date)).length == 0 && \n selectedDates.length < maxSelections\n ) {\n setSelectedDates(prevSelected => [...prevSelected, date]);\n } else {\n setSelectedDates(prevSelected => prevSelected.filter(e => !isSameDay(e, date)));\n }\n };\n useEffect(() => {\n if (onChange && typeof onChange == 'function') {\n onChange(selectedDates);\n }\n }, [selectedDates]);\n\n const isDayDisabled = (day) => {\n return !isSameMonth(activeMonth, day) ||\n minDate && isBefore(day, minDate) ||\n maxDate && isAfter(day, maxDate);\n };\n\n return
{JSON.stringify(d)}
)\n }\n