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aultOptions.js","../node_modules/date-fns/_lib/format/lightFormatters.js","../node_modules/date-fns/_lib/format/longFormatters.js","../node_modules/date-fns/_lib/getRoundingMethod.js","../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../node_modules/date-fns/_lib/normalizeDates.js","../node_modules/date-fns/_lib/protectedTokens.js","../node_modules/date-fns/add.js","../node_modules/date-fns/addDays.js","../node_modules/date-fns/addHours.js","../node_modules/date-fns/addMilliseconds.js","../node_modules/date-fns/addMinutes.js","../node_modules/date-fns/addMonths.js","../node_modules/date-fns/addSeconds.js","../node_modules/date-fns/addWeeks.js","../node_modules/date-fns/addYears.js","../node_modules/date-fns/max.js","../node_modules/date-fns/min.js","../node_modules/date-fns/clamp.js","../node_modules/date-fns/compareAsc.js","../node_modules/date-fns/constants.js","../node_modules/date-fns/constructFrom.js","../node_modules/date-fns/differenceInCalendarDays.js","../node_modules/date-fns/differenceInDays.js","../node_modules/date-fns/differenceInMilliseconds.js","../node_modules/date-fns/differenceInMinutes.js","../node_modules/date-fns/differenceInCalendarMonths.js","../node_modules/date-fns/isLastDayOfMonth.js","../node_modules/date-fns/differenceInMonths.js","../node_modules/date-fns/_lib/normalizeInterval.js","../node_modules/date-fns/eachDayOfInterval.js","../node_modules/date-fns/endOfDay.js","../node_modules/date-fns/endOfMonth.js","../node_modules/date-fns/endOfWeek.js","../node_modules/date-fns/endOfYear.js","../node_modules/date-fns/getDayOfYear.js","../node_modules/date-fns/_lib/format/formatters.js","../node_modules/date-fns/format.js","../node_modules/date-fns/constructNow.js","../node_modules/date-fns/formatDistanceStrict.js","../node_modules/date-fns/formatDistanceToNowStrict.js","../node_modules/date-fns/formatISO.js","../node_modules/date-fns/getDate.js","../node_modules/date-fns/getDaysInMonth.js","../node_modules/date-fns/getHours.js","../node_modules/date-fns/startOfISOWeekYear.js","../node_modules/date-fns/getISOWeek.js","../node_modules/date-fns/getISOWeekYear.js","../node_modules/date-fns/getMilliseconds.js","../node_modules/date-fns/getMinutes.js","../node_modules/date-fns/getMonth.js","../node_modules/date-fns/getSeconds.js","../node_modules/date-fns/startOfWeekYear.js","../node_modules/date-fns/getWeek.js","../node_modules/date-fns/getWeekYear.js","../node_modules/date-fns/getYear.js","../node_modules/date-fns/isAfter.js","../node_modules/date-fns/isBefore.js","../node_modules/date-fns/isEqual.js","../node_modules/date-fns/isPast.js","../node_modules/date-fns/isSameDay.js","../node_modules/date-fns/startOfHour.js","../node_modules/date-fns/isSameHour.js","../node_modules/date-fns/isSameMonth.js","../node_modules/date-fns/isSameYear.js","../node_modules/date-fns/isDate.js","../node_modules/date-fns/isValid.js","../node_modules/date-fns/isWithinInterval.js","../node_modules/date-fns/lightFormat.js","../node_modules/date-fns/locale/_lib/buildFormatLongFn.js","../node_modules/date-fns/locale/_lib/buildLocalizeFn.js","../node_modules/date-fns/locale/_lib/buildMatchFn.js","../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js","../node_modules/date-fns/locale/en-GB/_lib/formatLong.js","../node_modules/date-fns/locale/en-GB.js","../node_modules/date-fns/locale/en-US/_lib/formatLong.js","../node_modules/date-fns/locale/en-US.js","../node_modules/date-fns/locale/en-US/_lib/formatDistance.js","../node_modules/date-fns/locale/en-US/_lib/formatRelative.js","../node_modules/date-fns/locale/en-US/_lib/localize.js","../node_modules/date-fns/locale/en-US/_lib/match.js","../node_modules/date-fns/locale/fi/_lib/formatDistance.js","../node_modules/date-fns/locale/fi/_lib/formatLong.js","../node_modules/date-fns/locale/fi/_lib/formatRelative.js","../node_modules/date-fns/locale/fi/_lib/localize.js","../node_modules/date-fns/locale/fi/_lib/match.js","../node_modules/date-fns/locale/fi.js","../node_modules/date-fns/getDay.js","../node_modules/date-fns/nextDay.js","../node_modules/date-fns/nextSaturday.js","../node_modules/date-fns/getDefaultOptions.js","../node_modules/date-fns/transpose.js","../node_modules/date-fns/parse/_lib/Setter.js","../node_modules/date-fns/parse/_lib/Parser.js","../node_modules/date-fns/parse/_lib/parsers/EraParser.js","../node_modules/date-fns/parse/_lib/constants.js","../node_modules/date-fns/parse/_lib/utils.js","../node_modules/date-fns/parse/_lib/parsers/YearParser.js","../node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js","../node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js","../node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js","../node_modules/date-fns/parse/_lib/parsers/QuarterParser.js","../node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js","../node_modules/date-fns/parse/_lib/parsers/MonthParser.js","../node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js","../node_modules/date-fns/setWeek.js","../node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js","../node_modules/date-fns/setISOWeek.js","../node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js","../node_modules/date-fns/parse/_lib/parsers/DateParser.js","../node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js","../node_modules/date-fns/setDay.js","../node_modules/date-fns/parse/_lib/parsers/DayParser.js","../node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js","../node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js","../node_modules/date-fns/getISODay.js","../node_modules/date-fns/setISODay.js","../node_modules/date-fns/parse/_lib/parsers/ISODayParser.js","../node_modules/date-fns/parse/_lib/parsers/AMPMParser.js","../node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js","../node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js","../node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js","../node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js","../node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js","../node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js","../node_modules/date-fns/parse/_lib/parsers/MinuteParser.js","../node_modules/date-fns/parse/_lib/parsers/SecondParser.js","../node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js","../node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js","../node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js","../node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js","../node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js","../node_modules/date-fns/parse/_lib/parsers.js","../node_modules/date-fns/parse.js","../node_modules/date-fns/parseISO.js","../node_modules/date-fns/setDate.js","../node_modules/date-fns/setHours.js","../node_modules/date-fns/setMilliseconds.js","../node_modules/date-fns/setMinutes.js","../node_modules/date-fns/setMonth.js","../node_modules/date-fns/setSeconds.js","../node_modules/date-fns/setYear.js","../node_modules/date-fns/startOfDay.js","../node_modules/date-fns/startOfISOWeek.js","../node_modules/date-fns/startOfMonth.js","../node_modules/date-fns/startOfWeek.js","../node_modules/date-fns/startOfYear.js","../node_modules/date-fns/sub.js","../node_modules/date-fns/subDays.js","../node_modules/date-fns/subMonths.js","../node_modules/date-fns/subYears.js","../node_modules/date-fns/toDate.js"],"sourcesContent":["export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.js\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { addDays } from \"./addDays.js\";\nimport { addMonths } from \"./addMonths.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link add} function options.\n */\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.\n *\n * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.\n * @param options - An object with options\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport function add(date, duration, options) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n } = duration;\n\n // Add years and months\n const _date = toDate(date, options?.in);\n const dateWithMonths =\n months || years ? addMonths(_date, months + years * 12) : _date;\n\n // Add weeks and days\n const dateWithDays =\n days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes, and seconds\n const minutesToAdd = minutes + hours * 60;\n const secondsToAdd = seconds + minutesToAdd * 60;\n const msToAdd = secondsToAdd * 1000;\n\n return constructFrom(options?.in || date, +dateWithDays + msToAdd);\n}\n\n// Fallback for modularized imports:\nexport default add;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addDays} function options.\n */\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n * @param options - An object with options\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n if (!amount) return _date;\n\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","import { addMilliseconds } from \"./addMilliseconds.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link addHours} function options.\n */\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be added\n * @param options - An object with options\n *\n * @returns The new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport function addHours(date, amount, options) {\n return addMilliseconds(date, amount * millisecondsInHour, options);\n}\n\n// Fallback for modularized imports:\nexport default addHours;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMilliseconds} function options.\n */\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of milliseconds to be added.\n * @param options - The options object\n *\n * @returns The new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount, options) {\n return constructFrom(options?.in || date, +toDate(date) + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;\n","import { millisecondsInMinute } from \"./constants.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMinutes} function options.\n */\n\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of minutes to be added.\n * @param options - An object with options\n *\n * @returns The new date with the minutes added\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nexport function addMinutes(date, amount, options) {\n const _date = toDate(date, options?.in);\n _date.setTime(_date.getTime() + amount * millisecondsInMinute);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addMinutes;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMonths} function options.\n */\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n * @param options - The options object\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n","import { addMilliseconds } from \"./addMilliseconds.js\";\n\n/**\n * The {@link addSeconds} function options.\n */\n\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be added.\n * @param options - An object with options\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport function addSeconds(date, amount, options) {\n return addMilliseconds(date, amount * 1000, options);\n}\n\n// Fallback for modularized imports:\nexport default addSeconds;\n","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link addWeeks} function options.\n */\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of weeks to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n * @param options - An object with options\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount, options) {\n return addDays(date, amount * 7, options);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addYears} function options.\n */\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n * @param options - The options\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount, options) {\n return addMonths(date, amount * 12, options);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link max} function options.\n */\n\n/**\n * @name max\n * @category Common Helpers\n * @summary Return the latest of the given dates.\n *\n * @description\n * Return the latest of the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dates - The dates to compare\n *\n * @returns The latest of the dates\n *\n * @example\n * // Which of these dates is the latest?\n * const result = max([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Sun Jul 02 1995 00:00:00\n */\nexport function max(dates, options) {\n let result;\n let context = options?.in;\n\n dates.forEach((date) => {\n // Use the first date object as the context function\n if (!context && typeof date === \"object\")\n context = constructFrom.bind(null, date);\n\n const date_ = toDate(date, context);\n if (!result || result < date_ || isNaN(+date_)) result = date_;\n });\n\n return constructFrom(context, result || NaN);\n}\n\n// Fallback for modularized imports:\nexport default max;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link min} function options.\n */\n\n/**\n * @name min\n * @category Common Helpers\n * @summary Returns the earliest of the given dates.\n *\n * @description\n * Returns the earliest of the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dates - The dates to compare\n *\n * @returns The earliest of the dates\n *\n * @example\n * // Which of these dates is the earliest?\n * const result = min([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Wed Feb 11 1987 00:00:00\n */\nexport function min(dates, options) {\n let result;\n let context = options?.in;\n\n dates.forEach((date) => {\n // Use the first date object as the context function\n if (!context && typeof date === \"object\")\n context = constructFrom.bind(null, date);\n\n const date_ = toDate(date, context);\n if (!result || result > date_ || isNaN(+date_)) result = date_;\n });\n\n return constructFrom(context, result || NaN);\n}\n\n// Fallback for modularized imports:\nexport default min;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { max } from \"./max.js\";\nimport { min } from \"./min.js\";\n\n/**\n * The {@link clamp} function options.\n */\n\n/**\n * The {@link clamp} function result type. It resolves the proper data type.\n * It uses the first argument date object type, starting from the date argument,\n * then the start interval date, and finally the end interval date. If\n * a context function is passed, it uses the context function return type.\n */\n\n/**\n * @name clamp\n * @category Interval Helpers\n * @summary Return a date bounded by the start and the end of the given interval.\n *\n * @description\n * Clamps a date to the lower bound with the start of the interval and the upper\n * bound with the end of the interval.\n *\n * - When the date is less than the start of the interval, the start is returned.\n * - When the date is greater than the end of the interval, the end is returned.\n * - Otherwise the date is returned.\n *\n * @typeParam DateType - Date argument type.\n * @typeParam IntervalType - Interval argument type.\n * @typeParam Options - Options type.\n *\n * @param date - The date to be bounded\n * @param interval - The interval to bound to\n * @param options - An object with options\n *\n * @returns The date bounded by the start and the end of the interval\n *\n * @example\n * // What is Mar 21, 2021 bounded to an interval starting at Mar 22, 2021 and ending at Apr 01, 2021\n * const result = clamp(new Date(2021, 2, 21), {\n * start: new Date(2021, 2, 22),\n * end: new Date(2021, 3, 1),\n * })\n * //=> Mon Mar 22 2021 00:00:00\n */\nexport function clamp(date, interval, options) {\n const [date_, start, end] = normalizeDates(\n options?.in,\n date,\n interval.start,\n interval.end,\n );\n\n return min([max([date_, start], options), end], options);\n}\n\n// Fallback for modularized imports:\nexport default clamp;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const diff = +toDate(dateLeft) - +toDate(dateRight);\n\n if (diff < 0) return -1;\n else if (diff > 0) return 1;\n\n // Return 0 if diff is 0; return NaN if diff is NaN\n return diff;\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\n\n/**\n * The {@link differenceInDays} function options.\n */\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full days according to the local timezone\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n *\n * @example\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n * //=> 92\n */\nexport function differenceInDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const sign = compareLocalAsc(laterDate_, earlierDate_);\n const difference = Math.abs(\n differenceInCalendarDays(laterDate_, earlierDate_),\n );\n\n laterDate_.setDate(laterDate_.getDate() - sign * difference);\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastDayNotFull = Number(\n compareLocalAsc(laterDate_, earlierDate_) === -sign,\n );\n\n const result = sign * (difference - isLastDayNotFull);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(laterDate, earlierDate) {\n const diff =\n laterDate.getFullYear() - earlierDate.getFullYear() ||\n laterDate.getMonth() - earlierDate.getMonth() ||\n laterDate.getDate() - earlierDate.getDate() ||\n laterDate.getHours() - earlierDate.getHours() ||\n laterDate.getMinutes() - earlierDate.getMinutes() ||\n laterDate.getSeconds() - earlierDate.getSeconds() ||\n laterDate.getMilliseconds() - earlierDate.getMilliseconds();\n\n if (diff < 0) return -1;\n if (diff > 0) return 1;\n\n // Return 0 if diff is 0; return NaN if diff is NaN\n return diff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInDays;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { millisecondsInMinute } from \"./constants.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { endOfDay } from \"./endOfDay.js\";\nimport { endOfMonth } from \"./endOfMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n return +endOfDay(_date, options) === +endOfMonth(_date, options);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.js\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.js\";\n\n/**\n * The {@link differenceInMonths} function options.\n */\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(laterDate, earlierDate, options) {\n const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n laterDate,\n earlierDate,\n );\n\n const sign = compareAsc(workingLaterDate, earlierDate_);\n const difference = Math.abs(\n differenceInCalendarMonths(workingLaterDate, earlierDate_),\n );\n\n if (difference < 1) return 0;\n\n if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)\n workingLaterDate.setDate(30);\n\n workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);\n\n let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;\n\n if (\n isLastDayOfMonth(laterDate_) &&\n difference === 1 &&\n compareAsc(laterDate_, earlierDate_) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n const result = sign * (difference - +isLastMonthNotFull);\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","import { normalizeDates } from \"./normalizeDates.js\";\n\nexport function normalizeInterval(context, interval) {\n const [start, end] = normalizeDates(context, interval.start, interval.end);\n return { start, end };\n}\n","import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { constructFrom } from \"./constructFrom.js\";\n\n/**\n * The {@link eachDayOfInterval} function options.\n */\n\n/**\n * The {@link eachDayOfInterval} function result type. It resolves the proper data type.\n * It uses the first argument date object type, starting from the date argument,\n * then the start interval date, and finally the end interval date. If\n * a context function is passed, it uses the context function return type.\n */\n\n/**\n * @name eachDayOfInterval\n * @category Interval Helpers\n * @summary Return the array of dates within the specified time interval.\n *\n * @description\n * Return the array of dates within the specified time interval.\n *\n * @typeParam IntervalType - Interval type.\n * @typeParam Options - Options type.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of days from the day of the interval start to the day of the interval end\n *\n * @example\n * // Each day between 6 October 2014 and 10 October 2014:\n * const result = eachDayOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 9, 10)\n * })\n * //=> [\n * // Mon Oct 06 2014 00:00:00,\n * // Tue Oct 07 2014 00:00:00,\n * // Wed Oct 08 2014 00:00:00,\n * // Thu Oct 09 2014 00:00:00,\n * // Fri Oct 10 2014 00:00:00\n * // ]\n */\nexport function eachDayOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n\n let step = options?.step ?? 1;\n if (!step) return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n\n const dates = [];\n\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setDate(date.getDate() + step);\n date.setHours(0, 0, 0, 0);\n }\n\n return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachDayOfInterval;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfDay} function options.\n */\n\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport function endOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfDay;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfMonth} function options.\n */\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfWeek} function options.\n */\n\n/**\n * @name endOfWeek\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a week\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport function endOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n\n _date.setDate(_date.getDate() + diff);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfWeek;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfYear} function options.\n */\n\n/**\n * @name endOfYear\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The end of a year\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\nexport function endOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n _date.setFullYear(year + 1, 0, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfYear;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { startOfYear } from \"./startOfYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDayOfYear} function options.\n */\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { getDayOfYear } from \"../../getDayOfYear.js\";\nimport { getISOWeek } from \"../../getISOWeek.js\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.js\";\nimport { getWeek } from \"../../getWeek.js\";\nimport { getWeekYear } from \"../../getWeekYear.js\";\n\nimport { addLeadingZeros } from \"../addLeadingZeros.js\";\nimport { lightFormatters } from \"./lightFormatters.js\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(+date / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n return addLeadingZeros(+date, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday(\n * date: DateArg,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","import { constructNow } from \"./constructNow.js\";\n\nimport { formatDistanceStrict } from \"./formatDistanceStrict.js\";\n\n/**\n * The {@link formatDistanceToNowStrict} function options.\n */\n\n/**\n * @name formatDistanceToNowStrict\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNowStrict(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNowStrict(\n * new Date(2015, 0, 1, 0, 0, 15)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNowStrict(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in 1 year'\n *\n * @example\n * // If today is 28 January 2015,\n * // what is the distance to 1 January 2015, in months, rounded up??\n * const result = formatDistanceToNowStrict(new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNowStrict(\n * new Date(2016, 0, 1),\n * {locale: eoLocale}\n * )\n * //=> '1 jaro'\n */\nexport function formatDistanceToNowStrict(date, options) {\n return formatDistanceStrict(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNowStrict;\n","import { addLeadingZeros } from \"./_lib/addLeadingZeros.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link formatISO} function options.\n */\n\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param date - The original date\n * @param options - An object with options.\n *\n * @returns The formatted date string (in local time zone)\n *\n * @throws `date` must not be Invalid Date\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport function formatISO(date, options) {\n const date_ = toDate(date, options?.in);\n\n if (isNaN(+date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const format = options?.format ?? \"extended\";\n const representation = options?.representation ?? \"complete\";\n\n let result = \"\";\n let tzOffset = \"\";\n\n const dateDelimiter = format === \"extended\" ? \"-\" : \"\";\n const timeDelimiter = format === \"extended\" ? \":\" : \"\";\n\n // Representation is either 'date' or 'complete'\n if (representation !== \"time\") {\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = addLeadingZeros(date_.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== \"date\") {\n // Add the timezone.\n const offset = date_.getTimezoneOffset();\n\n if (offset !== 0) {\n const absoluteOffset = Math.abs(offset);\n const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n const sign = offset < 0 ? \"+\" : \"-\";\n\n tzOffset = `${sign}${hourOffset}:${minuteOffset}`;\n } else {\n tzOffset = \"Z\";\n }\n\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n const separator = result === \"\" ? \"\" : \"T\";\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n const time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = `${result}${separator}${time}${tzOffset}`;\n }\n\n return result;\n}\n\n// Fallback for modularized imports:\nexport default formatISO;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDate} function options.\n */\n\n/**\n * @name getDate\n * @category Day Helpers\n * @summary Get the day of the month of the given date.\n *\n * @description\n * Get the day of the month of the given date.\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The day of month\n *\n * @example\n * // Which day of the month is 29 February 2012?\n * const result = getDate(new Date(2012, 1, 29))\n * //=> 29\n */\nexport function getDate(date, options) {\n return toDate(date, options?.in).getDate();\n}\n\n// Fallback for modularized imports:\nexport default getDate;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDaysInMonth} function options.\n */\n\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date, considering the context if provided.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The number of days in a month\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\nexport function getDaysInMonth(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const monthIndex = _date.getMonth();\n const lastDayOfMonth = constructFrom(_date, 0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}\n\n// Fallback for modularized imports:\nexport default getDaysInMonth;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getHours} function options.\n */\n\n/**\n * @name getHours\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The hours\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * const result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\nexport function getHours(date, options) {\n return toDate(date, options?.in).getHours();\n}\n\n// Fallback for modularized imports:\nexport default getHours;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getISOWeekYear } from \"./getISOWeekYear.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\n\n/**\n * The {@link startOfISOWeekYear} function options.\n */\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeek} function options.\n */\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeekYear} function options.\n */\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name getMilliseconds\n * @category Millisecond Helpers\n * @summary Get the milliseconds of the given date.\n *\n * @description\n * Get the milliseconds of the given date.\n *\n * @param date - The given date\n *\n * @returns The milliseconds\n *\n * @example\n * // Get the milliseconds of 29 February 2012 11:45:05.123:\n * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 123\n */\nexport function getMilliseconds(date) {\n return toDate(date).getMilliseconds();\n}\n\n// Fallback for modularized imports:\nexport default getMilliseconds;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getMinutes} function options.\n */\n\n/**\n * @name getMinutes\n * @category Minute Helpers\n * @summary Get the minutes of the given date.\n *\n * @description\n * Get the minutes of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The minutes\n *\n * @example\n * // Get the minutes of 29 February 2012 11:45:05:\n * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 45\n */\nexport function getMinutes(date, options) {\n return toDate(date, options?.in).getMinutes();\n}\n\n// Fallback for modularized imports:\nexport default getMinutes;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getMonth} function options.\n */\n\n/**\n * @name getMonth\n * @category Month Helpers\n * @summary Get the month of the given date.\n *\n * @description\n * Get the month of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The month index (0-11)\n *\n * @example\n * // Which month is 29 February 2012?\n * const result = getMonth(new Date(2012, 1, 29))\n * //=> 1\n */\nexport function getMonth(date, options) {\n return toDate(date, options?.in).getMonth();\n}\n\n// Fallback for modularized imports:\nexport default getMonth;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name getSeconds\n * @category Second Helpers\n * @summary Get the seconds of the given date.\n *\n * @description\n * Get the seconds of the given date.\n *\n * @param date - The given date\n *\n * @returns The seconds\n *\n * @example\n * // Get the seconds of 29 February 2012 11:45:05.123:\n * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 5\n */\nexport function getSeconds(date) {\n return toDate(date).getSeconds();\n}\n\n// Fallback for modularized imports:\nexport default getSeconds;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getWeekYear } from \"./getWeekYear.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (+_date >= +startOfNextYear) {\n return year + 1;\n } else if (+_date >= +startOfThisYear) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getYear} function options.\n */\n\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The year\n *\n * @example\n * // Which year is 2 July 2014?\n * const result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\nexport function getYear(date, options) {\n return toDate(date, options?.in).getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default getYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nexport function isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n\n// Fallback for modularized imports:\nexport default isEqual;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isPast\n * @category Common Helpers\n * @summary Is the given date in the past?\n * @pure false\n *\n * @description\n * Is the given date in the past?\n *\n * @param date - The date to check\n *\n * @returns The date is in the past\n *\n * @example\n * // If today is 6 October 2014, is 2 July 2014 in the past?\n * const result = isPast(new Date(2014, 6, 2))\n * //=> true\n */\nexport function isPast(date) {\n return +toDate(date) < Date.now();\n}\n\n// Fallback for modularized imports:\nexport default isPast;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link isSameDay} function options.\n */\n\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day (and year and month)?\n *\n * @description\n * Are the given dates in the same day (and year and month)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same day (and year and month)\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n *\n * @example\n * // Are 4 September and 4 October in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))\n * //=> false\n *\n * @example\n * // Are 4 September, 2014 and 4 September, 2015 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))\n * //=> false\n */\nexport function isSameDay(laterDate, earlierDate, options) {\n const [dateLeft_, dateRight_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return +startOfDay(dateLeft_) === +startOfDay(dateRight_);\n}\n\n// Fallback for modularized imports:\nexport default isSameDay;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfHour} function options.\n */\n\n/**\n * @name startOfHour\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an hour\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * const result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\nexport function startOfHour(date, options) {\n const _date = toDate(date, options?.in);\n _date.setMinutes(0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfHour;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfHour } from \"./startOfHour.js\";\n\n/**\n * The {@link isSameHour} function options.\n */\n\n/**\n * @name isSameHour\n * @category Hour Helpers\n * @summary Are the given dates in the same hour (and same day)?\n *\n * @description\n * Are the given dates in the same hour (and same day)?\n *\n * @param dateLeft - The first date to check\n * @param dateRight - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same hour (and same day)\n *\n * @example\n * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?\n * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30))\n * //=> true\n *\n * @example\n * // Are 4 September 2014 06:00:00 and 5 September 06:00:00 in the same hour?\n * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 5, 6, 0))\n * //=> false\n */\nexport function isSameHour(dateLeft, dateRight, options) {\n const [dateLeft_, dateRight_] = normalizeDates(\n options?.in,\n dateLeft,\n dateRight,\n );\n return +startOfHour(dateLeft_) === +startOfHour(dateRight_);\n}\n\n// Fallback for modularized imports:\nexport default isSameHour;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link isSameMonth} function options.\n */\n\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month (and year)?\n *\n * @description\n * Are the given dates in the same month (and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same month (and year)\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n *\n * @example\n * // Are 2 September 2014 and 25 September 2015 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))\n * //=> false\n */\nexport function isSameMonth(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return (\n laterDate_.getFullYear() === earlierDate_.getFullYear() &&\n laterDate_.getMonth() === earlierDate_.getMonth()\n );\n}\n\n// Fallback for modularized imports:\nexport default isSameMonth;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link isSameYear} function options.\n */\n\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same year\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\nexport function isSameYear(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return laterDate_.getFullYear() === earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default isSameYear;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { isDate } from \"./isDate.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertible into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n return !((!isDate(date) && typeof date !== \"number\") || isNaN(+toDate(date)));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link isWithinInterval} function options.\n */\n\n/**\n * @name isWithinInterval\n * @category Interval Helpers\n * @summary Is the given date within the interval?\n *\n * @description\n * Is the given date within the interval? (Including start and end.)\n *\n * @param date - The date to check\n * @param interval - The interval to check\n * @param options - An object with options\n *\n * @returns The date is within the interval\n *\n * @example\n * // For the date within the interval:\n * isWithinInterval(new Date(2014, 0, 3), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * // => true\n *\n * @example\n * // For the date outside of the interval:\n * isWithinInterval(new Date(2014, 0, 10), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * // => false\n *\n * @example\n * // For date equal to the interval start:\n * isWithinInterval(date, { start, end: date })\n * // => true\n *\n * @example\n * // For date equal to the interval end:\n * isWithinInterval(date, { start: date, end })\n * // => true\n */\nexport function isWithinInterval(date, interval, options) {\n const time = +toDate(date, options?.in);\n const [startTime, endTime] = [\n +toDate(interval.start, options?.in),\n +toDate(interval.end, options?.in),\n ].sort((a, b) => a - b);\n\n return time >= startTime && time <= endTime;\n}\n\n// Fallback for modularized imports:\nexport default isWithinInterval;\n","import { lightFormatters } from \"./_lib/format/lightFormatters.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { lightFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp = /(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @private\n */\n\n/**\n * @name lightFormat\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. Unlike `format`,\n * `lightFormat` doesn't use locales and outputs date using the most popular tokens.\n *\n * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples |\n * |---------------------------------|---------|-----------------------------------|\n * | AM, PM | a..aaa | AM, PM |\n * | | aaaa | a.m., p.m. |\n * | | aaaaa | a, p |\n * | Calendar year | y | 44, 1, 1900, 2017 |\n * | | yy | 44, 01, 00, 17 |\n * | | yyy | 044, 001, 000, 017 |\n * | | yyyy | 0044, 0001, 1900, 2017 |\n * | Month (formatting) | M | 1, 2, ..., 12 |\n * | | MM | 01, 02, ..., 12 |\n * | Day of month | d | 1, 2, ..., 31 |\n * | | dd | 01, 02, ..., 31 |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 |\n * | | hh | 01, 02, ..., 11, 12 |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 |\n * | | HH | 00, 01, 02, ..., 23 |\n * | Minute | m | 0, 1, ..., 59 |\n * | | mm | 00, 01, ..., 59 |\n * | Second | s | 0, 1, ..., 59 |\n * | | ss | 00, 01, ..., 59 |\n * | Fraction of second | S | 0, 1, ..., 9 |\n * | | SS | 00, 01, ..., 99 |\n * | | SSS | 000, 001, ..., 999 |\n * | | SSSS | ... |\n *\n * @param date - The original date\n * @param format - The string of tokens\n *\n * @returns The formatted date string\n *\n * @throws `Invalid time value` if the date is invalid\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd')\n * //=> '2014-02-11'\n */\nexport function lightFormat(date, formatStr) {\n const date_ = toDate(date);\n\n if (!isValid(date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const tokens = formatStr.match(formattingTokensRegExp);\n\n // The only case when formattingTokensRegExp doesn't match the string is when it's empty\n if (!tokens) return \"\";\n\n const result = tokens\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = lightFormatters[firstCharacter];\n if (formatter) {\n return formatter(date_, substring);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matches = input.match(escapedStringRegExp);\n if (!matches) return input;\n return matches[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default lightFormat;\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // [TODO] -- I challenge you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // [TODO] -- I challenge you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // [TODO] I challenge you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, d MMMM yyyy\",\n long: \"d MMMM yyyy\",\n medium: \"d MMM yyyy\",\n short: \"dd/MM/yyyy\",\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\nimport { formatLong } from \"./en-GB/_lib/formatLong.js\";\n\n/**\n * @category Locales\n * @summary English locale (United Kingdom).\n * @language English\n * @iso-639-2 eng\n * @author Alex [@glintik](https://github.com/glintik)\n */\nexport const enGB = {\n code: \"en-GB\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 4,\n },\n};\n\n// Fallback for modularized imports:\nexport default enGB;\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","function futureSeconds(text) {\n return text.replace(/sekuntia?/, \"sekunnin\");\n}\n\nfunction futureMinutes(text) {\n return text.replace(/minuuttia?/, \"minuutin\");\n}\n\nfunction futureHours(text) {\n return text.replace(/tuntia?/, \"tunnin\");\n}\n\nfunction futureDays(text) {\n return text.replace(/päivää?/, \"päivän\");\n}\n\nfunction futureWeeks(text) {\n return text.replace(/(viikko|viikkoa)/, \"viikon\");\n}\n\nfunction futureMonths(text) {\n return text.replace(/(kuukausi|kuukautta)/, \"kuukauden\");\n}\n\nfunction futureYears(text) {\n return text.replace(/(vuosi|vuotta)/, \"vuoden\");\n}\n\nconst formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"alle sekunti\",\n other: \"alle {{count}} sekuntia\",\n futureTense: futureSeconds,\n },\n\n xSeconds: {\n one: \"sekunti\",\n other: \"{{count}} sekuntia\",\n futureTense: futureSeconds,\n },\n\n halfAMinute: {\n one: \"puoli minuuttia\",\n other: \"puoli minuuttia\",\n futureTense: (_text) => \"puolen minuutin\",\n },\n\n lessThanXMinutes: {\n one: \"alle minuutti\",\n other: \"alle {{count}} minuuttia\",\n futureTense: futureMinutes,\n },\n\n xMinutes: {\n one: \"minuutti\",\n other: \"{{count}} minuuttia\",\n futureTense: futureMinutes,\n },\n\n aboutXHours: {\n one: \"noin tunti\",\n other: \"noin {{count}} tuntia\",\n futureTense: futureHours,\n },\n\n xHours: {\n one: \"tunti\",\n other: \"{{count}} tuntia\",\n futureTense: futureHours,\n },\n\n xDays: {\n one: \"päivä\",\n other: \"{{count}} päivää\",\n futureTense: futureDays,\n },\n\n aboutXWeeks: {\n one: \"noin viikko\",\n other: \"noin {{count}} viikkoa\",\n futureTense: futureWeeks,\n },\n\n xWeeks: {\n one: \"viikko\",\n other: \"{{count}} viikkoa\",\n futureTense: futureWeeks,\n },\n\n aboutXMonths: {\n one: \"noin kuukausi\",\n other: \"noin {{count}} kuukautta\",\n futureTense: futureMonths,\n },\n\n xMonths: {\n one: \"kuukausi\",\n other: \"{{count}} kuukautta\",\n futureTense: futureMonths,\n },\n\n aboutXYears: {\n one: \"noin vuosi\",\n other: \"noin {{count}} vuotta\",\n futureTense: futureYears,\n },\n\n xYears: {\n one: \"vuosi\",\n other: \"{{count}} vuotta\",\n futureTense: futureYears,\n },\n\n overXYears: {\n one: \"yli vuosi\",\n other: \"yli {{count}} vuotta\",\n futureTense: futureYears,\n },\n\n almostXYears: {\n one: \"lähes vuosi\",\n other: \"lähes {{count}} vuotta\",\n futureTense: futureYears,\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n const tokenValue = formatDistanceLocale[token];\n const result =\n count === 1\n ? tokenValue.one\n : tokenValue.other.replace(\"{{count}}\", String(count));\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return tokenValue.futureTense(result) + \" kuluttua\";\n } else {\n return result + \" sitten\";\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"eeee d. MMMM y\",\n long: \"d. MMMM y\",\n medium: \"d. MMM y\",\n short: \"d.M.y\",\n};\n\nconst timeFormats = {\n full: \"HH.mm.ss zzzz\",\n long: \"HH.mm.ss z\",\n medium: \"HH.mm.ss\",\n short: \"HH.mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'klo' {{time}}\",\n long: \"{{date}} 'klo' {{time}}\",\n medium: \"{{date}} {{time}}\",\n short: \"{{date}} {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'viime' eeee 'klo' p\",\n yesterday: \"'eilen klo' p\",\n today: \"'tänään klo' p\",\n tomorrow: \"'huomenna klo' p\",\n nextWeek: \"'ensi' eeee 'klo' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"eaa.\", \"jaa.\"],\n abbreviated: [\"eaa.\", \"jaa.\"],\n wide: [\"ennen ajanlaskun alkua\", \"jälkeen ajanlaskun alun\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1. kvartaali\", \"2. kvartaali\", \"3. kvartaali\", \"4. kvartaali\"],\n};\n\nconst monthValues = {\n narrow: [\"T\", \"H\", \"M\", \"H\", \"T\", \"K\", \"H\", \"E\", \"S\", \"L\", \"M\", \"J\"],\n abbreviated: [\n \"tammi\",\n \"helmi\",\n \"maalis\",\n \"huhti\",\n \"touko\",\n \"kesä\",\n \"heinä\",\n \"elo\",\n \"syys\",\n \"loka\",\n \"marras\",\n \"joulu\",\n ],\n\n wide: [\n \"tammikuu\",\n \"helmikuu\",\n \"maaliskuu\",\n \"huhtikuu\",\n \"toukokuu\",\n \"kesäkuu\",\n \"heinäkuu\",\n \"elokuu\",\n \"syyskuu\",\n \"lokakuu\",\n \"marraskuu\",\n \"joulukuu\",\n ],\n};\n\nconst formattingMonthValues = {\n narrow: monthValues.narrow,\n abbreviated: monthValues.abbreviated,\n wide: [\n \"tammikuuta\",\n \"helmikuuta\",\n \"maaliskuuta\",\n \"huhtikuuta\",\n \"toukokuuta\",\n \"kesäkuuta\",\n \"heinäkuuta\",\n \"elokuuta\",\n \"syyskuuta\",\n \"lokakuuta\",\n \"marraskuuta\",\n \"joulukuuta\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"K\", \"T\", \"P\", \"L\"],\n short: [\"su\", \"ma\", \"ti\", \"ke\", \"to\", \"pe\", \"la\"],\n abbreviated: [\"sunn.\", \"maan.\", \"tiis.\", \"kesk.\", \"torst.\", \"perj.\", \"la\"],\n\n wide: [\n \"sunnuntai\",\n \"maanantai\",\n \"tiistai\",\n \"keskiviikko\",\n \"torstai\",\n \"perjantai\",\n \"lauantai\",\n ],\n};\n\nconst formattingDayValues = {\n narrow: dayValues.narrow,\n short: dayValues.short,\n abbreviated: dayValues.abbreviated,\n wide: [\n \"sunnuntaina\",\n \"maanantaina\",\n \"tiistaina\",\n \"keskiviikkona\",\n \"torstaina\",\n \"perjantaina\",\n \"lauantaina\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"ap\",\n pm: \"ip\",\n midnight: \"keskiyö\",\n noon: \"keskipäivä\",\n morning: \"ap\",\n afternoon: \"ip\",\n evening: \"illalla\",\n night: \"yöllä\",\n },\n abbreviated: {\n am: \"ap\",\n pm: \"ip\",\n midnight: \"keskiyö\",\n noon: \"keskipäivä\",\n morning: \"ap\",\n afternoon: \"ip\",\n evening: \"illalla\",\n night: \"yöllä\",\n },\n wide: {\n am: \"ap\",\n pm: \"ip\",\n midnight: \"keskiyöllä\",\n noon: \"keskipäivällä\",\n morning: \"aamupäivällä\",\n afternoon: \"iltapäivällä\",\n evening: \"illalla\",\n night: \"yöllä\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n return number + \".\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n formattingValues: formattingMonthValues,\n defaultFormattingWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayValues,\n defaultFormattingWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(\\.)/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(e|j)/i,\n abbreviated: /^(eaa.|jaa.)/i,\n wide: /^(ennen ajanlaskun alkua|jälkeen ajanlaskun alun)/i,\n};\nconst parseEraPatterns = {\n any: [/^e/i, /^j/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234]\\.? kvartaali/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[thmkeslj]/i,\n abbreviated:\n /^(tammi|helmi|maalis|huhti|touko|kesä|heinä|elo|syys|loka|marras|joulu)/i,\n wide: /^(tammikuu|helmikuu|maaliskuu|huhtikuu|toukokuu|kesäkuu|heinäkuu|elokuu|syyskuu|lokakuu|marraskuu|joulukuu)(ta)?/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^t/i,\n /^h/i,\n /^m/i,\n /^h/i,\n /^t/i,\n /^k/i,\n /^h/i,\n /^e/i,\n /^s/i,\n /^l/i,\n /^m/i,\n /^j/i,\n ],\n\n any: [\n /^ta/i,\n /^hel/i,\n /^maa/i,\n /^hu/i,\n /^to/i,\n /^k/i,\n /^hei/i,\n /^e/i,\n /^s/i,\n /^l/i,\n /^mar/i,\n /^j/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtkpl]/i,\n short: /^(su|ma|ti|ke|to|pe|la)/i,\n abbreviated: /^(sunn.|maan.|tiis.|kesk.|torst.|perj.|la)/i,\n wide: /^(sunnuntai|maanantai|tiistai|keskiviikko|torstai|perjantai|lauantai)(na)?/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^k/i, /^t/i, /^p/i, /^l/i],\n any: [/^s/i, /^m/i, /^ti/i, /^k/i, /^to/i, /^p/i, /^l/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow:\n /^(ap|ip|keskiyö|keskipäivä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,\n any: /^(ap|ip|keskiyöllä|keskipäivällä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^ap/i,\n pm: /^ip/i,\n midnight: /^keskiyö/i,\n noon: /^keskipäivä/i,\n morning: /aamupäivällä/i,\n afternoon: /iltapäivällä/i,\n evening: /illalla/i,\n night: /yöllä/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./fi/_lib/formatDistance.js\";\nimport { formatLong } from \"./fi/_lib/formatLong.js\";\nimport { formatRelative } from \"./fi/_lib/formatRelative.js\";\nimport { localize } from \"./fi/_lib/localize.js\";\nimport { match } from \"./fi/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary Finnish locale.\n * @language Finnish\n * @iso-639-2 fin\n * @author Pyry-Samuli Lahti [@Pyppe](https://github.com/Pyppe)\n * @author Edo Rivai [@mikolajgrzyb](https://github.com/mikolajgrzyb)\n * @author Samu Juvonen [@sjuvonen](https://github.com/sjuvonen)\n */\nexport const fi = {\n code: \"fi\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 4,\n },\n};\n\n// Fallback for modularized imports:\nexport default fi;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDay} function options.\n */\n\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of week, 0 represents Sunday\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * const result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nexport function getDay(date, options) {\n return toDate(date, options?.in).getDay();\n}\n\n// Fallback for modularized imports:\nexport default getDay;\n","import { addDays } from \"./addDays.js\";\nimport { getDay } from \"./getDay.js\";\n\n/**\n * The {@link nextDay} function options.\n */\n\n/**\n * @name nextDay\n * @category Weekday Helpers\n * @summary When is the next day of the week? 0-6 the day of the week, 0 represents Sunday.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to check\n * @param day - Day of the week\n * @param options - An object with options\n *\n * @returns The date is the next day of the week\n *\n * @example\n * // When is the next Monday after Mar, 20, 2020?\n * const result = nextDay(new Date(2020, 2, 20), 1)\n * //=> Mon Mar 23 2020 00:00:00\n *\n * @example\n * // When is the next Tuesday after Mar, 21, 2020?\n * const result = nextDay(new Date(2020, 2, 21), 2)\n * //=> Tue Mar 24 2020 00:00:00\n */\nexport function nextDay(date, day, options) {\n let delta = day - getDay(date, options);\n if (delta <= 0) delta += 7;\n\n return addDays(date, delta, options);\n}\n\n// Fallback for modularized imports:\nexport default nextDay;\n","import { nextDay } from \"./nextDay.js\";\n\n/**\n * The {@link nextSaturday} function options.\n */\n\n/**\n * @name nextSaturday\n * @category Weekday Helpers\n * @summary When is the next Saturday?\n *\n * @description\n * When is the next Saturday?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to start counting from\n * @param options - An object with options\n *\n * @returns The next Saturday\n *\n * @example\n * // When is the next Saturday after Mar, 22, 2020?\n * const result = nextSaturday(new Date(2020, 2, 22))\n * //=> Sat Mar 28 2020 00:00:00\n */\nexport function nextSaturday(date, options) {\n return nextDay(date, 6, options);\n}\n\n// Fallback for modularized imports:\nexport default nextSaturday;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.js\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam InputDate - The input `Date` type derived from the passed argument.\n * @typeParam ResultDate - The result `Date` type derived from the passed constructor.\n *\n * @param date - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(date, constructor) {\n const date_ = isConstructor(constructor)\n ? new constructor(0)\n : constructFrom(constructor, 0);\n date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n date_.setHours(\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n );\n return date_;\n}\n\nfunction isConstructor(constructor) {\n return (\n typeof constructor === \"function\" &&\n constructor.prototype?.constructor === constructor\n );\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { constructFrom } from \"../../constructFrom.js\";\nimport { transpose } from \"../../transpose.js\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n\n constructor(context, reference) {\n super();\n this.context = context || ((date) => constructFrom(reference, date));\n }\n\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, this.context));\n }\n}\n","import { ValueSetter } from \"./Setter.js\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","import { Parser } from \"../Parser.js\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.js\";\n\nimport { numericPatterns } from \"./constants.js\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.js\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.js\";\n\nimport { startOfWeek } from \"../../../startOfWeek.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.js\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.js\";\nimport { constructFrom } from \"../../../constructFrom.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigitsSigned } from \"../utils.js\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { parseNDigitsSigned } from \"../utils.js\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { parseNDigits } from \"../utils.js\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { parseNDigits } from \"../utils.js\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const date_ = toDate(date, options?.in);\n const diff = getWeek(date_, options) - week;\n date_.setDate(date_.getDate() - diff * 7);\n return toDate(date_, options?.in);\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setWeek } from \"../../../setWeek.js\";\nimport { startOfWeek } from \"../../../startOfWeek.js\";\nimport { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setISOWeek} function options.\n */\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The `Date` type of the context function.\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week, options) {\n const _date = toDate(date, options?.in);\n const diff = getISOWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { setISOWeek } from \"../../../setISOWeek.js\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.js\";\nimport { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.js\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.js\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { addDays } from \"./addDays.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const date_ = toDate(date, options?.in);\n const currentDay = date_.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(date_, diff, options);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { setDay } from \"../../../setDay.js\";\nimport { Parser } from \"../Parser.js\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { mapValue, parseNDigits } from \"../utils.js\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { mapValue, parseNDigits } from \"../utils.js\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISODay} function options.\n */\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date, options) {\n const day = toDate(date, options?.in).getDay();\n return day === 0 ? 7 : day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { addDays } from \"./addDays.js\";\nimport { getISODay } from \"./getISODay.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setISODay} function options.\n */\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday, etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day, options) {\n const date_ = toDate(date, options?.in);\n const currentDay = getISODay(date_, options);\n const diff = day - currentDay;\n return addDays(date_, diff, options);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { setISODay } from \"../../../setISODay.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { mapValue, parseNDigits } from \"../utils.js\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { dayPeriodEnumToHours } from \"../utils.js\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { dayPeriodEnumToHours } from \"../utils.js\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { dayPeriodEnumToHours } from \"../utils.js\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseNDigits, parseNumericPattern } from \"../utils.js\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.js\";\n\nimport { mapValue, parseNDigits } from \"../utils.js\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.trunc(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { timezonePatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseTimezonePattern } from \"../utils.js\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { timezonePatterns } from \"../constants.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseTimezonePattern } from \"../utils.js\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseAnyDigitsSigned } from \"../utils.js\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.js\";\nimport { Parser } from \"../Parser.js\";\n\nimport { parseAnyDigitsSigned } from \"../utils.js\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { EraParser } from \"./parsers/EraParser.js\";\nimport { YearParser } from \"./parsers/YearParser.js\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.js\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.js\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.js\";\nimport { QuarterParser } from \"./parsers/QuarterParser.js\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.js\";\nimport { MonthParser } from \"./parsers/MonthParser.js\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.js\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.js\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.js\";\nimport { DateParser } from \"./parsers/DateParser.js\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.js\";\nimport { DayParser } from \"./parsers/DayParser.js\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.js\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.js\";\nimport { ISODayParser } from \"./parsers/ISODayParser.js\";\nimport { AMPMParser } from \"./parsers/AMPMParser.js\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.js\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.js\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.js\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.js\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.js\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.js\";\nimport { MinuteParser } from \"./parsers/MinuteParser.js\";\nimport { SecondParser } from \"./parsers/SecondParser.js\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.js\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.js\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.js\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.js\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.js\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getDefaultOptions } from \"./getDefaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\nimport { DateTimezoneSetter } from \"./parse/_lib/Setter.js\";\nimport { parsers } from \"./parse/_lib/parsers.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { longFormatters, parsers };\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangeably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (!formatStr)\n return dateStr ? invalidDate() : toDate(referenceDate, options?.in);\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will try to use the context or\n // the reference date and fallback to the system time zone.\n const setters = [new DateTimezoneSetter(options?.in, referenceDate)];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return invalidDate();\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return invalidDate();\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return invalidDate();\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate, options?.in);\n\n if (isNaN(+date)) return invalidDate();\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return invalidDate();\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return date;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n} from \"./constants.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link parseISO} function options.\n */\n\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n * @param options - An object with options\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * const result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * const result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\nexport function parseISO(argument, options) {\n const invalidDate = () => constructFrom(options?.in, NaN);\n\n const additionalDigits = options?.additionalDigits ?? 2;\n const dateStrings = splitDateString(argument);\n\n let date;\n if (dateStrings.date) {\n const parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n\n if (!date || isNaN(+date)) return invalidDate();\n\n const timestamp = +date;\n let time = 0;\n let offset;\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (isNaN(time)) return invalidDate();\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n if (isNaN(offset)) return invalidDate();\n } else {\n const tmpDate = new Date(timestamp + time);\n const result = toDate(0, options?.in);\n result.setFullYear(\n tmpDate.getUTCFullYear(),\n tmpDate.getUTCMonth(),\n tmpDate.getUTCDate(),\n );\n result.setHours(\n tmpDate.getUTCHours(),\n tmpDate.getUTCMinutes(),\n tmpDate.getUTCSeconds(),\n tmpDate.getUTCMilliseconds(),\n );\n return result;\n }\n\n return toDate(timestamp + time + offset, options?.in);\n}\n\nconst patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/,\n};\n\nconst dateRegex =\n /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nconst timeRegex =\n /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nconst timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n\nfunction splitDateString(dateString) {\n const dateStrings = {};\n const array = dateString.split(patterns.dateTimeDelimiter);\n let timeString;\n\n // The regex match should only return at maximum two array elements.\n // [date], [time], or [date, time].\n if (array.length > 2) {\n return dateStrings;\n }\n\n if (/:/.test(array[0])) {\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(\n dateStrings.date.length,\n dateString.length,\n );\n }\n }\n\n if (timeString) {\n const token = patterns.timezone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], \"\");\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n\n return dateStrings;\n}\n\nfunction parseYear(dateString, additionalDigits) {\n const regex = new RegExp(\n \"^(?:(\\\\d{4}|[+-]\\\\d{\" +\n (4 + additionalDigits) +\n \"})|(\\\\d{2}|[+-]\\\\d{\" +\n (2 + additionalDigits) +\n \"})$)\",\n );\n\n const captures = dateString.match(regex);\n // Invalid ISO-formatted year\n if (!captures) return { year: NaN, restDateString: \"\" };\n\n const year = captures[1] ? parseInt(captures[1]) : null;\n const century = captures[2] ? parseInt(captures[2]) : null;\n\n // either year or century is null, not both\n return {\n year: century === null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length),\n };\n}\n\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return new Date(NaN);\n\n const captures = dateString.match(dateRegex);\n // Invalid ISO-formatted string\n if (!captures) return new Date(NaN);\n\n const isWeekDate = !!captures[4];\n const dayOfYear = parseDateUnit(captures[1]);\n const month = parseDateUnit(captures[2]) - 1;\n const day = parseDateUnit(captures[3]);\n const week = parseDateUnit(captures[4]);\n const dayOfWeek = parseDateUnit(captures[5]) - 1;\n\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n const date = new Date(0);\n if (\n !validateDate(year, month, day) ||\n !validateDayOfYearDate(year, dayOfYear)\n ) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\n\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\n\nfunction parseTime(timeString) {\n const captures = timeString.match(timeRegex);\n if (!captures) return NaN; // Invalid ISO-formatted time\n\n const hours = parseTimeUnit(captures[1]);\n const minutes = parseTimeUnit(captures[2]);\n const seconds = parseTimeUnit(captures[3]);\n\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n\n return (\n hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000\n );\n}\n\nfunction parseTimeUnit(value) {\n return (value && parseFloat(value.replace(\",\", \".\"))) || 0;\n}\n\nfunction parseTimezone(timezoneString) {\n if (timezoneString === \"Z\") return 0;\n\n const captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n\n const sign = captures[1] === \"+\" ? -1 : 1;\n const hours = parseInt(captures[2]);\n const minutes = (captures[3] && parseInt(captures[3])) || 0;\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);\n}\n\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n const date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n const fourthOfJanuaryDay = date.getUTCDay() || 7;\n const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\n\n// Validation functions\n\n// February is null to handle the leap year (using ||)\nconst daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n\nfunction validateDate(year, month, date) {\n return (\n month >= 0 &&\n month <= 11 &&\n date >= 1 &&\n date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))\n );\n}\n\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\n\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\n\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n\n return (\n seconds >= 0 &&\n seconds < 60 &&\n minutes >= 0 &&\n minutes < 60 &&\n hours >= 0 &&\n hours < 25\n );\n}\n\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}\n\n// Fallback for modularized imports:\nexport default parseISO;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setDate} function options.\n */\n\n/**\n * @name setDate\n * @category Day Helpers\n * @summary Set the day of the month to the given date.\n *\n * @description\n * Set the day of the month to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param dayOfMonth - The day of the month of the new date\n * @param options - The options\n *\n * @returns The new date with the day of the month set\n *\n * @example\n * // Set the 30th day of the month to 1 September 2014:\n * const result = setDate(new Date(2014, 8, 1), 30)\n * //=> Tue Sep 30 2014 00:00:00\n */\nexport function setDate(date, dayOfMonth, options) {\n const _date = toDate(date, options?.in);\n _date.setDate(dayOfMonth);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setDate;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setHours} function options.\n */\n\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param hours - The hours of the new date\n * @param options - An object with options\n *\n * @returns The new date with the hours set\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nexport function setHours(date, hours, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(hours);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMilliseconds} function options.\n */\n\n/**\n * @name setMilliseconds\n * @category Millisecond Helpers\n * @summary Set the milliseconds to the given date.\n *\n * @description\n * Set the milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param milliseconds - The milliseconds of the new date\n * @param options - The options\n *\n * @returns The new date with the milliseconds set\n *\n * @example\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\n * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n * //=> Mon Sep 01 2014 11:30:40.300\n */\nexport function setMilliseconds(date, milliseconds, options) {\n const _date = toDate(date, options?.in);\n _date.setMilliseconds(milliseconds);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setMilliseconds;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMinutes} function options.\n */\n\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param minutes - The minutes of the new date\n * @param options - An object with options\n *\n * @returns The new date with the minutes set\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\nexport function setMinutes(date, minutes, options) {\n const date_ = toDate(date, options?.in);\n date_.setMinutes(minutes);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default setMinutes;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getDaysInMonth } from \"./getDaysInMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMonth} function options.\n */\n\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param month - The month index to set (0-11)\n * @param options - The options\n *\n * @returns The new date with the month set\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nexport function setMonth(date, month, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const day = _date.getDate();\n\n const midMonth = constructFrom(options?.in || date, 0);\n midMonth.setFullYear(year, month, 15);\n midMonth.setHours(0, 0, 0, 0);\n const daysInMonth = getDaysInMonth(midMonth);\n\n // Set the earlier date, allows to wrap Jan 31 to Feb 28\n _date.setMonth(month, Math.min(day, daysInMonth));\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setMonth;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setSeconds} function options.\n */\n\n/**\n * @name setSeconds\n * @category Second Helpers\n * @summary Set the seconds to the given date, with context support.\n *\n * @description\n * Set the seconds to the given date, with an optional context for time zone specification.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param seconds - The seconds of the new date\n * @param options - An object with options\n *\n * @returns The new date with the seconds set\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\nexport function setSeconds(date, seconds, options) {\n const _date = toDate(date, options?.in);\n _date.setSeconds(seconds);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setSeconds;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setYear} function options.\n */\n\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param year - The year of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the year set\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nexport function setYear(date, year, options) {\n const date_ = toDate(date, options?.in);\n\n // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n if (isNaN(+date_)) return constructFrom(options?.in || date, NaN);\n\n date_.setFullYear(year);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default setYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfISOWeek} function options.\n */\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfMonth} function options.\n */\n\n/**\n * @name startOfMonth\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date. The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.\n * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,\n * or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a month\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n _date.setDate(1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfMonth;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfYear} function options.\n */\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setFullYear(date_.getFullYear(), 0, 1);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { subDays } from \"./subDays.js\";\nimport { subMonths } from \"./subMonths.js\";\n\n/**\n * The {@link sub} function options.\n */\n\n/**\n * @name sub\n * @category Common Helpers\n * @summary Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date.\n *\n * @description\n * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be subtracted\n * @param options - An object with options\n *\n * | Key | Description |\n * |---------|------------------------------------|\n * | years | Amount of years to be subtracted |\n * | months | Amount of months to be subtracted |\n * | weeks | Amount of weeks to be subtracted |\n * | days | Amount of days to be subtracted |\n * | hours | Amount of hours to be subtracted |\n * | minutes | Amount of minutes to be subtracted |\n * | seconds | Amount of seconds to be subtracted |\n *\n * All values default to 0\n *\n * @returns The new date with the seconds subtracted\n *\n * @example\n * // Subtract the following duration from 15 June 2017 15:29:20\n * const result = sub(new Date(2017, 5, 15, 15, 29, 20), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30\n * })\n * //=> Mon Sep 1 2014 10:19:50\n */\nexport function sub(date, duration, options) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n } = duration;\n\n const withoutMonths = subMonths(date, months + years * 12, options);\n const withoutDays = subDays(withoutMonths, days + weeks * 7, options);\n\n const minutesToSub = minutes + hours * 60;\n const secondsToSub = seconds + minutesToSub * 60;\n const msToSub = secondsToSub * 1000;\n\n return constructFrom(options?.in || date, +withoutDays - msToSub);\n}\n\n// Fallback for modularized imports:\nexport default sub;\n","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link subDays} function options.\n */\n\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the days subtracted\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nexport function subDays(date, amount, options) {\n return addDays(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subDays;\n","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The subMonths function options.\n */\n\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the months subtracted\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function subMonths(date, amount, options) {\n return addMonths(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subMonths;\n","import { addYears } from \"./addYears.js\";\n\n/**\n * The {@link subYears} function options.\n */\n\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the years subtracted\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * const result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nexport function subYears(date, amount, options) {\n return addYears(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subYears;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n"],"names":["addLeadingZeros","number","targetLength","sign","output","defaultOptions","getDefaultOptions","setDefaultOptions","newOptions","lightFormatters","date","token","signedYear","year","month","dayPeriodEnumValue","numberOfDigits","milliseconds","fractionalSeconds","dateLongFormatter","pattern","formatLong","timeLongFormatter","longFormatters","matchResult","datePattern","timePattern","dateTimeFormat","getRoundingMethod","method","result","getTimezoneOffsetInMilliseconds","_date","utcDate","normalizeDates","context","dates","normalize","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","format","input","_message","message","subject","add","duration","options","years","months","weeks","days","hours","minutes","seconds","dateWithMonths","dateWithDays","minutesToAdd","msToAdd","addDays","amount","addHours","addMilliseconds","addMinutes","addMonths","dayOfMonth","endOfDesiredMonth","daysInMonth","addSeconds","addWeeks","addYears","max","constructFrom","date_","toDate","min","clamp","interval","start","end","compareAsc","dateLeft","dateRight","diff","daysInWeek","daysInYear","minTime","millisecondsInWeek","millisecondsInDay","millisecondsInMinute","millisecondsInHour","millisecondsInSecond","minutesInYear","minutesInMonth","minutesInDay","minutesInHour","monthsInQuarter","monthsInYear","quartersInYear","secondsInHour","secondsInMinute","secondsInDay","secondsInWeek","secondsInQuarter","constructFromSymbol","value","differenceInCalendarDays","laterDate","earlierDate","laterDate_","earlierDate_","laterStartOfDay","earlierStartOfDay","laterTimestamp","earlierTimestamp","differenceInDays","compareLocalAsc","difference","isLastDayNotFull","differenceInMilliseconds","differenceInMinutes","differenceInCalendarMonths","yearsDiff","monthsDiff","isLastDayOfMonth","endOfDay","endOfMonth","differenceInMonths","workingLaterDate","isLastMonthNotFull","normalizeInterval","eachDayOfInterval","reversed","endTime","step","endOfWeek","weekStartsOn","day","endOfYear","getDayOfYear","startOfYear","dayPeriodEnum","formatters","localize","era","signedWeekYear","getWeekYear","weekYear","twoDigitYear","isoWeekYear","getISOWeekYear","quarter","week","getWeek","isoWeek","getISOWeek","dayOfYear","dayOfWeek","localDayOfWeek","isoDayOfWeek","_localize","timezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","formatTimezoneShort","timestamp","offset","delimiter","absOffset","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","locale","firstWeekContainsDate","originalDate","isValid","parts","substring","firstCharacter","longFormatter","cleanEscapedString","formatterOptions","part","formatter","matched","constructNow","formatDistanceStrict","comparison","localizeOptions","roundingMethod","dstNormalizedMinutes","defaultUnit","unit","roundedMinutes","formatDistanceToNowStrict","formatISO","representation","tzOffset","dateDelimiter","timeDelimiter","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","getDate","getDaysInMonth","monthIndex","lastDayOfMonth","getHours","startOfISOWeekYear","fourthOfJanuary","startOfISOWeek","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getMilliseconds","getMinutes","getMonth","getSeconds","startOfWeekYear","firstWeek","startOfWeek","firstWeekOfNextYear","firstWeekOfThisYear","getYear","isAfter","dateToCompare","isBefore","isEqual","leftDate","rightDate","isPast","isSameDay","dateLeft_","dateRight_","startOfHour","isSameHour","isSameMonth","isSameYear","isDate","isWithinInterval","startTime","a","b","lightFormat","tokens","matches","buildFormatLongFn","args","width","buildLocalizeFn","valuesArray","defaultWidth","index","buildMatchFn","string","matchPattern","matchedString","parsePatterns","key","findIndex","findKey","rest","object","predicate","array","buildMatchPatternFn","parseResult","dateFormats","timeFormats","dateTimeFormats","enGB","formatDistance","formatRelative","match","enUS","formatDistanceLocale","count","tokenValue","formatRelativeLocale","_baseDate","_options","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","dirtyNumber","rem100","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","futureSeconds","text","futureMinutes","futureHours","futureDays","futureWeeks","futureMonths","futureYears","_text","formattingMonthValues","formattingDayValues","fi","getDay","nextDay","delta","nextSaturday","transpose","constructor","isConstructor","TIMEZONE_UNIT_PRIORITY","Setter","_utcDate","ValueSetter","validateValue","setValue","priority","subPriority","flags","DateTimezoneSetter","reference","Parser","dateString","_value","EraParser","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","parseNDigitsSigned","dayPeriodEnumToHours","dayPeriod","normalizeTwoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","rangeEndCentury","isPreviousCentury","isLeapYearIndex","YearParser","valueCallback","normalizedTwoDigitYear","LocalWeekYearParser","ISOWeekYearParser","_flags","firstWeekOfYear","ExtendedYearParser","QuarterParser","StandAloneQuarterParser","MonthParser","StandAloneMonthParser","setWeek","LocalWeekParser","setISOWeek","ISOWeekParser","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","DateParser","isLeapYear","DayOfYearParser","setDay","currentDay","dayIndex","DayParser","LocalDayParser","wholeWeekDays","StandAloneLocalDayParser","getISODay","setISODay","ISODayParser","AMPMParser","AMPMMidnightParser","DayPeriodParser","Hour1to12Parser","isPM","Hour0to23Parser","Hour0To11Parser","Hour1To24Parser","MinuteParser","SecondParser","FractionOfSecondParser","ISOTimezoneWithZParser","ISOTimezoneParser","TimestampSecondsParser","TimestampMillisecondsParser","parsers","notWhitespaceRegExp","parse","dateStr","referenceDate","invalidDate","subFnOptions","setters","usedTokens","parser","incompatibleTokens","incompatibleToken","usedToken","uniquePrioritySetters","setter","setterArray","parseISO","argument","additionalDigits","dateStrings","splitDateString","parseYearResult","parseYear","parseDate","parseTime","parseTimezone","tmpDate","patterns","dateRegex","timeRegex","timezoneRegex","timeString","regex","captures","century","isWeekDate","parseDateUnit","validateWeekDate","dayOfISOWeekYear","validateDate","validateDayOfYearDate","parseTimeUnit","validateTime","timezoneString","validateTimezone","fourthOfJanuaryDay","daysInMonths","_year","_hours","setDate","setHours","setMilliseconds","setMinutes","setMonth","midMonth","setSeconds","setYear","startOfDay","startOfMonth","sub","withoutMonths","withoutDays","minutesToSub","msToSub","subDays","subMonths","subYears"],"sourceRoot":""}