From 9e81784a41f45917b3f38c87232a2e3ff31ee115 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:23:39 +0000 Subject: [PATCH 1/4] Bump date-fns from 3.6.0 to 4.1.0 Bumps [date-fns](https://github.com/date-fns/date-fns) from 3.6.0 to 4.1.0. - [Release notes](https://github.com/date-fns/date-fns/releases) - [Changelog](https://github.com/date-fns/date-fns/blob/main/CHANGELOG.md) - [Commits](https://github.com/date-fns/date-fns/compare/v3.6.0...v4.1.0) --- updated-dependencies: - dependency-name: date-fns dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e84f57c6..31604c9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@tiobe/install-tics": "^0.6.0", "canonical-path": "^1.0.0", "compare-versions": "^6.1.1", - "date-fns": "^3.6.0", + "date-fns": "^4.1.0", "proxy-agent": "^6.4.0", "semver": "^7.6.3", "underscore": "^1.13.7" @@ -3144,9 +3144,9 @@ } }, "node_modules/date-fns": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", - "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", + "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", "funding": { "type": "github", "url": "https://github.com/sponsors/kossnocorp" diff --git a/package.json b/package.json index a62e5d9f..da2808de 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@tiobe/install-tics": "^0.6.0", "canonical-path": "^1.0.0", "compare-versions": "^6.1.1", - "date-fns": "^3.6.0", + "date-fns": "^4.1.0", "proxy-agent": "^6.4.0", "semver": "^7.6.3", "underscore": "^1.13.7" From 4cb1652909b533c6a28fd460964eda9f2d3cd4cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:07:44 +0000 Subject: [PATCH 2/4] Bump @types/jest from 29.5.12 to 29.5.14 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.12 to 29.5.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e84f57c6..7117ee62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "underscore": "^1.13.7" }, "devDependencies": { - "@types/jest": "^29.5.12", + "@types/jest": "^29.5.14", "@types/node": "^22.5.5", "@types/semver": "^7.5.8", "@types/underscore": "^1.11.15", @@ -1850,9 +1850,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.12", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", - "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, "dependencies": { "expect": "^29.0.0", diff --git a/package.json b/package.json index a62e5d9f..8267b659 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "underscore": "^1.13.7" }, "devDependencies": { - "@types/jest": "^29.5.12", + "@types/jest": "^29.5.14", "@types/node": "^22.5.5", "@types/semver": "^7.5.8", "@types/underscore": "^1.11.15", From 3a10315603d67350635984cd5e5f530e14c384ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:10:58 +0000 Subject: [PATCH 3/4] Bump eslint-plugin-jest from 28.8.0 to 28.9.0 Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 28.8.0 to 28.9.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v28.8.0...v28.9.0) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e84f57c6..3218f436 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "async-listen": "^3.0.1", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-jest": "^28.8.0", + "eslint-plugin-jest": "^28.9.0", "eslint-plugin-prettier": "^5.2.1", "http-proxy": "^1.18.1", "jest": "^29.7.0", @@ -3422,9 +3422,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "28.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.8.0.tgz", - "integrity": "sha512-Tubj1hooFxCl52G4qQu0edzV/+EZzPUeN8p2NnW5uu4fbDs+Yo7+qDVDc4/oG3FbCqEBmu/OC3LSsyiU22oghw==", + "version": "28.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz", + "integrity": "sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" diff --git a/package.json b/package.json index a62e5d9f..3e11ff3a 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "async-listen": "^3.0.1", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-jest": "^28.8.0", + "eslint-plugin-jest": "^28.9.0", "eslint-plugin-prettier": "^5.2.1", "http-proxy": "^1.18.1", "jest": "^29.7.0", From db6f6bd96fca0051ca507dbb10ab8b2e3ac89a15 Mon Sep 17 00:00:00 2001 From: TIOBE <123092508+it-tiobe@users.noreply.github.com> Date: Thu, 5 Dec 2024 12:08:04 +0000 Subject: [PATCH 4/4] Build dist after push to main --- dist/index.js | 53064 ++++++++++++++++++++++++------------------------ 1 file changed, 26911 insertions(+), 26153 deletions(-) diff --git a/dist/index.js b/dist/index.js index e9f7393c..a6acaaba 100644 --- a/dist/index.js +++ b/dist/index.js @@ -193,7 +193,7 @@ exports.createFilesSummary = createFilesSummary; exports.createReviewComments = createReviewComments; exports.createUnpostableAnnotationsDetails = createUnpostableAnnotationsDetails; const os_1 = __nccwpck_require__(22037); -const date_fns_1 = __nccwpck_require__(73314); +const date_fns_1 = __nccwpck_require__(25468); const underscore_1 = __nccwpck_require__(15067); const core_1 = __nccwpck_require__(42186); const enums_1 = __nccwpck_require__(31655); @@ -26093,25333 +26093,4264 @@ exports.dataUriToBuffer = dataUriToBuffer; /***/ }), -/***/ 534: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 28222: +/***/ ((module, exports, __nccwpck_require__) => { -exports.addLeadingZeros = addLeadingZeros; -function addLeadingZeros(number, targetLength) { - const sign = number < 0 ? "-" : ""; - const output = Math.abs(number).toString().padStart(targetLength, "0"); - return sign + output; -} +/* eslint-env browser */ +/** + * This is the web browser implementation of `debug()`. + */ -/***/ }), +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; -/***/ 64092: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); -"use strict"; +/** + * Colors. + */ -Object.defineProperty(exports, "defaultLocale", ({ - enumerable: true, - get: function () { - return _index.enUS; - }, -})); -var _index = __nccwpck_require__(55); +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ -/***/ }), +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } -/***/ 42466: -/***/ ((__unused_webpack_module, exports) => { + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } -"use strict"; + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} -exports.getDefaultOptions = getDefaultOptions; -exports.setDefaultOptions = setDefaultOptions; +/** + * Colorize log arguments if enabled. + * + * @api public + */ -let defaultOptions = {}; +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); -function getDefaultOptions() { - return defaultOptions; -} + if (!this.useColors) { + return; + } -function setDefaultOptions(newOptions) { - defaultOptions = newOptions; -} + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); -/***/ }), + args.splice(lastC, 0, c); +} -/***/ 59892: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); -"use strict"; +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} -exports.formatters = void 0; -var _index = __nccwpck_require__(900); -var _index2 = __nccwpck_require__(66475); -var _index3 = __nccwpck_require__(90308); -var _index4 = __nccwpck_require__(90802); -var _index5 = __nccwpck_require__(87669); +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } -var _index6 = __nccwpck_require__(534); -var _index7 = __nccwpck_require__(26961); + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } -const dayPeriodEnum = { - am: "am", - pm: "pm", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night", -}; + return r; +} -/* - * | | Unit | | Unit | - * |-----|--------------------------------|-----|--------------------------------| - * | a | AM, PM | A* | Milliseconds in day | - * | b | AM, PM, noon, midnight | B | Flexible day period | - * | c | Stand-alone local day of week | C* | Localized hour w/ day period | - * | d | Day of month | D | Day of year | - * | e | Local day of week | E | Day of week | - * | f | | F* | Day of week in month | - * | g* | Modified Julian day | G | Era | - * | h | Hour [1-12] | H | Hour [0-23] | - * | i! | ISO day of week | I! | ISO week of year | - * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | - * | k | Hour [1-24] | K | Hour [0-11] | - * | l* | (deprecated) | L | Stand-alone month | - * | m | Minute | M | Month | - * | n | | N | | - * | o! | Ordinal number modifier | O | Timezone (GMT) | - * | p! | Long localized time | P! | Long localized date | - * | q | Stand-alone quarter | Q | Quarter | - * | r* | Related Gregorian year | R! | ISO week-numbering year | - * | s | Second | S | Fraction of second | - * | t! | Seconds timestamp | T! | Milliseconds timestamp | - * | u | Extended year | U* | Cyclic year | - * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | - * | w | Local week of year | W* | Week of month | - * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | - * | y | Year (abs) | Y | Local week-numbering year | - * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) | +/** + * Localstorage attempts to return the localstorage. * - * Letters marked by * are not implemented but reserved by Unicode standard. + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. * - * Letters marked by ! are non-standard, but implemented by date-fns: - * - `o` modifies the previous token to turn it into an ordinal (see `format` docs) - * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, - * i.e. 7 for Sunday, 1 for Monday, etc. - * - `I` is ISO week of year, as opposed to `w` which is local week of year. - * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. - * `R` is supposed to be used in conjunction with `I` and `i` - * for universal ISO week-numbering date, whereas - * `Y` is supposed to be used in conjunction with `w` and `e` - * for week-numbering date specific to the locale. - * - `P` is long localized date format - * - `p` is long localized time format + * @return {LocalStorage} + * @api private */ -const formatters = (exports.formatters = { - // Era - G: function (date, token, localize) { - const era = date.getFullYear() > 0 ? 1 : 0; - switch (token) { - // AD, BC - case "G": - case "GG": - case "GGG": - return localize.era(era, { width: "abbreviated" }); - // A, B - case "GGGGG": - return localize.era(era, { width: "narrow" }); - // Anno Domini, Before Christ - case "GGGG": - default: - return localize.era(era, { width: "wide" }); - } - }, +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} - // Year - y: function (date, token, localize) { - // Ordinal number - if (token === "yo") { - const signedYear = date.getFullYear(); - // Returns 1 for 1 BC (which is year 0 in JavaScript) - const year = signedYear > 0 ? signedYear : 1 - signedYear; - return localize.ordinalNumber(year, { unit: "year" }); - } +module.exports = __nccwpck_require__(46243)(exports); - return _index7.lightFormatters.y(date, token); - }, +const {formatters} = module.exports; - // Local week-numbering year - Y: function (date, token, localize, options) { - const signedWeekYear = (0, _index5.getWeekYear)(date, options); - // Returns 1 for 1 BC (which is year 0 in JavaScript) - const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ - // Two digit year - if (token === "YY") { - const twoDigitYear = weekYear % 100; - return (0, _index6.addLeadingZeros)(twoDigitYear, 2); - } +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; - // Ordinal number - if (token === "Yo") { - return localize.ordinalNumber(weekYear, { unit: "year" }); - } - // Padding - return (0, _index6.addLeadingZeros)(weekYear, token.length); - }, +/***/ }), - // ISO week-numbering year - R: function (date, token) { - const isoWeekYear = (0, _index3.getISOWeekYear)(date); +/***/ 46243: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Padding - return (0, _index6.addLeadingZeros)(isoWeekYear, token.length); - }, - // Extended year. This is a single number designating the year of this calendar system. - // The main difference between `y` and `u` localizers are B.C. years: - // | Year | `y` | `u` | - // |------|-----|-----| - // | AC 1 | 1 | 1 | - // | BC 1 | 1 | 0 | - // | BC 2 | 2 | -1 | - // Also `yy` always returns the last two digits of a year, - // while `uu` pads single digit years to 2 characters and returns other years unchanged. - u: function (date, token) { - const year = date.getFullYear(); - return (0, _index6.addLeadingZeros)(year, token.length); - }, +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ - // Quarter - Q: function (date, token, localize) { - const quarter = Math.ceil((date.getMonth() + 1) / 3); - switch (token) { - // 1, 2, 3, 4 - case "Q": - return String(quarter); - // 01, 02, 03, 04 - case "QQ": - return (0, _index6.addLeadingZeros)(quarter, 2); - // 1st, 2nd, 3rd, 4th - case "Qo": - return localize.ordinalNumber(quarter, { unit: "quarter" }); - // Q1, Q2, Q3, Q4 - case "QQQ": - return localize.quarter(quarter, { - width: "abbreviated", - context: "formatting", - }); - // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case "QQQQQ": - return localize.quarter(quarter, { - width: "narrow", - context: "formatting", - }); - // 1st quarter, 2nd quarter, ... - case "QQQQ": - default: - return localize.quarter(quarter, { - width: "wide", - context: "formatting", - }); - } - }, +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(80900); + createDebug.destroy = destroy; - // Stand-alone quarter - q: function (date, token, localize) { - const quarter = Math.ceil((date.getMonth() + 1) / 3); - switch (token) { - // 1, 2, 3, 4 - case "q": - return String(quarter); - // 01, 02, 03, 04 - case "qq": - return (0, _index6.addLeadingZeros)(quarter, 2); - // 1st, 2nd, 3rd, 4th - case "qo": - return localize.ordinalNumber(quarter, { unit: "quarter" }); - // Q1, Q2, Q3, Q4 - case "qqq": - return localize.quarter(quarter, { - width: "abbreviated", - context: "standalone", - }); - // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case "qqqqq": - return localize.quarter(quarter, { - width: "narrow", - context: "standalone", - }); - // 1st quarter, 2nd quarter, ... - case "qqqq": - default: - return localize.quarter(quarter, { - width: "wide", - context: "standalone", - }); - } - }, + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); - // Month - M: function (date, token, localize) { - const month = date.getMonth(); - switch (token) { - case "M": - case "MM": - return _index7.lightFormatters.M(date, token); - // 1st, 2nd, ..., 12th - case "Mo": - return localize.ordinalNumber(month + 1, { unit: "month" }); - // Jan, Feb, ..., Dec - case "MMM": - return localize.month(month, { - width: "abbreviated", - context: "formatting", - }); - // J, F, ..., D - case "MMMMM": - return localize.month(month, { - width: "narrow", - context: "formatting", - }); - // January, February, ..., December - case "MMMM": - default: - return localize.month(month, { width: "wide", context: "formatting" }); - } - }, + /** + * The currently active debug mode names, and names to skip. + */ - // Stand-alone month - L: function (date, token, localize) { - const month = date.getMonth(); - switch (token) { - // 1, 2, ..., 12 - case "L": - return String(month + 1); - // 01, 02, ..., 12 - case "LL": - return (0, _index6.addLeadingZeros)(month + 1, 2); - // 1st, 2nd, ..., 12th - case "Lo": - return localize.ordinalNumber(month + 1, { unit: "month" }); - // Jan, Feb, ..., Dec - case "LLL": - return localize.month(month, { - width: "abbreviated", - context: "standalone", - }); - // J, F, ..., D - case "LLLLL": - return localize.month(month, { - width: "narrow", - context: "standalone", - }); - // January, February, ..., December - case "LLLL": - default: - return localize.month(month, { width: "wide", context: "standalone" }); - } - }, + createDebug.names = []; + createDebug.skips = []; - // Local week of year - w: function (date, token, localize, options) { - const week = (0, _index4.getWeek)(date, options); + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; - if (token === "wo") { - return localize.ordinalNumber(week, { unit: "week" }); - } + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; - return (0, _index6.addLeadingZeros)(week, token.length); - }, + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } - // ISO week of year - I: function (date, token, localize) { - const isoWeek = (0, _index2.getISOWeek)(date); + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; - if (token === "Io") { - return localize.ordinalNumber(isoWeek, { unit: "week" }); - } + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; - return (0, _index6.addLeadingZeros)(isoWeek, token.length); - }, + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } - // Day of the month - d: function (date, token, localize) { - if (token === "do") { - return localize.ordinalNumber(date.getDate(), { unit: "date" }); - } + const self = debug; - return _index7.lightFormatters.d(date, token); - }, + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; - // Day of year - D: function (date, token, localize) { - const dayOfYear = (0, _index.getDayOfYear)(date); + args[0] = createDebug.coerce(args[0]); - if (token === "Do") { - return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" }); - } + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } - return (0, _index6.addLeadingZeros)(dayOfYear, token.length); - }, + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); - // Day of week - E: function (date, token, localize) { - const dayOfWeek = date.getDay(); - switch (token) { - // Tue - case "E": - case "EE": - case "EEE": - return localize.day(dayOfWeek, { - width: "abbreviated", - context: "formatting", - }); - // T - case "EEEEE": - return localize.day(dayOfWeek, { - width: "narrow", - context: "formatting", - }); - // Tu - case "EEEEEE": - return localize.day(dayOfWeek, { - width: "short", - context: "formatting", - }); - // Tuesday - case "EEEE": - default: - return localize.day(dayOfWeek, { - width: "wide", - context: "formatting", - }); - } - }, + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); - // Local day of week - e: function (date, token, localize, options) { - const dayOfWeek = date.getDay(); - const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; - switch (token) { - // Numerical value (Nth day of week with current locale or weekStartsOn) - case "e": - return String(localDayOfWeek); - // Padded numerical value - case "ee": - return (0, _index6.addLeadingZeros)(localDayOfWeek, 2); - // 1st, 2nd, ..., 7th - case "eo": - return localize.ordinalNumber(localDayOfWeek, { unit: "day" }); - case "eee": - return localize.day(dayOfWeek, { - width: "abbreviated", - context: "formatting", - }); - // T - case "eeeee": - return localize.day(dayOfWeek, { - width: "narrow", - context: "formatting", - }); - // Tu - case "eeeeee": - return localize.day(dayOfWeek, { - width: "short", - context: "formatting", - }); - // Tuesday - case "eeee": - default: - return localize.day(dayOfWeek, { - width: "wide", - context: "formatting", - }); - } - }, + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); - // Stand-alone local day of week - c: function (date, token, localize, options) { - const dayOfWeek = date.getDay(); - const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; - switch (token) { - // Numerical value (same as in `e`) - case "c": - return String(localDayOfWeek); - // Padded numerical value - case "cc": - return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length); - // 1st, 2nd, ..., 7th - case "co": - return localize.ordinalNumber(localDayOfWeek, { unit: "day" }); - case "ccc": - return localize.day(dayOfWeek, { - width: "abbreviated", - context: "standalone", - }); - // T - case "ccccc": - return localize.day(dayOfWeek, { - width: "narrow", - context: "standalone", - }); - // Tu - case "cccccc": - return localize.day(dayOfWeek, { - width: "short", - context: "standalone", - }); - // Tuesday - case "cccc": - default: - return localize.day(dayOfWeek, { - width: "wide", - context: "standalone", - }); - } - }, + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } - // ISO day of week - i: function (date, token, localize) { - const dayOfWeek = date.getDay(); - const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; - switch (token) { - // 2 - case "i": - return String(isoDayOfWeek); - // 02 - case "ii": - return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length); - // 2nd - case "io": - return localize.ordinalNumber(isoDayOfWeek, { unit: "day" }); - // Tue - case "iii": - return localize.day(dayOfWeek, { - width: "abbreviated", - context: "formatting", - }); - // T - case "iiiii": - return localize.day(dayOfWeek, { - width: "narrow", - context: "formatting", - }); - // Tu - case "iiiiii": - return localize.day(dayOfWeek, { - width: "short", - context: "formatting", - }); - // Tuesday - case "iiii": - default: - return localize.day(dayOfWeek, { - width: "wide", - context: "formatting", - }); - } - }, + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - // AM or PM - a: function (date, token, localize) { - const hours = date.getHours(); - const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } - switch (token) { - case "a": - case "aa": - return localize.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting", - }); - case "aaa": - return localize - .dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting", - }) - .toLowerCase(); - case "aaaaa": - return localize.dayPeriod(dayPeriodEnumValue, { - width: "narrow", - context: "formatting", - }); - case "aaaa": - default: - return localize.dayPeriod(dayPeriodEnumValue, { - width: "wide", - context: "formatting", - }); - } - }, + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); - // AM, PM, midnight, noon - b: function (date, token, localize) { - const hours = date.getHours(); - let dayPeriodEnumValue; - if (hours === 12) { - dayPeriodEnumValue = dayPeriodEnum.noon; - } else if (hours === 0) { - dayPeriodEnumValue = dayPeriodEnum.midnight; - } else { - dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; - } + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } - switch (token) { - case "b": - case "bb": - return localize.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting", - }); - case "bbb": - return localize - .dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting", - }) - .toLowerCase(); - case "bbbbb": - return localize.dayPeriod(dayPeriodEnumValue, { - width: "narrow", - context: "formatting", - }); - case "bbbb": - default: - return localize.dayPeriod(dayPeriodEnumValue, { - width: "wide", - context: "formatting", - }); - } - }, + return debug; + } - // in the morning, in the afternoon, in the evening, at night - B: function (date, token, localize) { - const hours = date.getHours(); - let dayPeriodEnumValue; - if (hours >= 17) { - dayPeriodEnumValue = dayPeriodEnum.evening; - } else if (hours >= 12) { - dayPeriodEnumValue = dayPeriodEnum.afternoon; - } else if (hours >= 4) { - dayPeriodEnumValue = dayPeriodEnum.morning; - } else { - dayPeriodEnumValue = dayPeriodEnum.night; - } + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } - switch (token) { - case "B": - case "BB": - case "BBB": - return localize.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting", - }); - case "BBBBB": - return localize.dayPeriod(dayPeriodEnumValue, { - width: "narrow", - context: "formatting", - }); - case "BBBB": - default: - return localize.dayPeriod(dayPeriodEnumValue, { - width: "wide", - context: "formatting", - }); - } - }, + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; - // Hour [1-12] - h: function (date, token, localize) { - if (token === "ho") { - let hours = date.getHours() % 12; - if (hours === 0) hours = 12; - return localize.ordinalNumber(hours, { unit: "hour" }); - } + createDebug.names = []; + createDebug.skips = []; - return _index7.lightFormatters.h(date, token); - }, + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; - // Hour [0-23] - H: function (date, token, localize) { - if (token === "Ho") { - return localize.ordinalNumber(date.getHours(), { unit: "hour" }); - } + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } - return _index7.lightFormatters.H(date, token); - }, + namespaces = split[i].replace(/\*/g, '.*?'); - // Hour [0-11] - K: function (date, token, localize) { - const hours = date.getHours() % 12; + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } - if (token === "Ko") { - return localize.ordinalNumber(hours, { unit: "hour" }); - } + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } - return (0, _index6.addLeadingZeros)(hours, token.length); - }, + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } - // Hour [1-24] - k: function (date, token, localize) { - let hours = date.getHours(); - if (hours === 0) hours = 24; + let i; + let len; - if (token === "ko") { - return localize.ordinalNumber(hours, { unit: "hour" }); - } + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } - return (0, _index6.addLeadingZeros)(hours, token.length); - }, + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } - // Minute - m: function (date, token, localize) { - if (token === "mo") { - return localize.ordinalNumber(date.getMinutes(), { unit: "minute" }); - } + return false; + } - return _index7.lightFormatters.m(date, token); - }, + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } - // Second - s: function (date, token, localize) { - if (token === "so") { - return localize.ordinalNumber(date.getSeconds(), { unit: "second" }); - } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } - return _index7.lightFormatters.s(date, token); - }, + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } - // Fraction of second - S: function (date, token) { - return _index7.lightFormatters.S(date, token); - }, + createDebug.enable(createDebug.load()); - // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) - X: function (date, token, _localize) { - const timezoneOffset = date.getTimezoneOffset(); + return createDebug; +} - if (timezoneOffset === 0) { - return "Z"; - } +module.exports = setup; - switch (token) { - // Hours and optional minutes - case "X": - return formatTimezoneWithOptionalMinutes(timezoneOffset); - // Hours, minutes and optional seconds without `:` delimiter - // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets - // so this token always has the same output as `XX` - case "XXXX": - case "XX": // Hours and minutes without `:` delimiter - return formatTimezone(timezoneOffset); +/***/ }), - // Hours, minutes and optional seconds with `:` delimiter - // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets - // so this token always has the same output as `XXX` - case "XXXXX": - case "XXX": // Hours and minutes with `:` delimiter - default: - return formatTimezone(timezoneOffset, ":"); - } - }, +/***/ 38237: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) - x: function (date, token, _localize) { - const timezoneOffset = date.getTimezoneOffset(); +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ - switch (token) { - // Hours and optional minutes - case "x": - return formatTimezoneWithOptionalMinutes(timezoneOffset); +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(28222); +} else { + module.exports = __nccwpck_require__(35332); +} - // Hours, minutes and optional seconds without `:` delimiter - // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets - // so this token always has the same output as `xx` - case "xxxx": - case "xx": // Hours and minutes without `:` delimiter - return formatTimezone(timezoneOffset); - // Hours, minutes and optional seconds with `:` delimiter - // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets - // so this token always has the same output as `xxx` - case "xxxxx": - case "xxx": // Hours and minutes with `:` delimiter - default: - return formatTimezone(timezoneOffset, ":"); - } - }, +/***/ }), - // Timezone (GMT) - O: function (date, token, _localize) { - const timezoneOffset = date.getTimezoneOffset(); +/***/ 35332: +/***/ ((module, exports, __nccwpck_require__) => { - switch (token) { - // Short - case "O": - case "OO": - case "OOO": - return "GMT" + formatTimezoneShort(timezoneOffset, ":"); - // Long - case "OOOO": - default: - return "GMT" + formatTimezone(timezoneOffset, ":"); - } - }, +/** + * Module dependencies. + */ - // Timezone (specific non-location) - z: function (date, token, _localize) { - const timezoneOffset = date.getTimezoneOffset(); +const tty = __nccwpck_require__(76224); +const util = __nccwpck_require__(73837); - switch (token) { - // Short - case "z": - case "zz": - case "zzz": - return "GMT" + formatTimezoneShort(timezoneOffset, ":"); - // Long - case "zzzz": - default: - return "GMT" + formatTimezone(timezoneOffset, ":"); - } - }, +/** + * This is the Node.js implementation of `debug()`. + */ - // Seconds timestamp - t: function (date, token, _localize) { - const timestamp = Math.trunc(date.getTime() / 1000); - return (0, _index6.addLeadingZeros)(timestamp, token.length); - }, +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); - // Milliseconds timestamp - T: function (date, token, _localize) { - const timestamp = date.getTime(); - return (0, _index6.addLeadingZeros)(timestamp, token.length); - }, -}); +/** + * Colors. + */ -function formatTimezoneShort(offset, delimiter = "") { - const sign = offset > 0 ? "-" : "+"; - const absOffset = Math.abs(offset); - const hours = Math.trunc(absOffset / 60); - const minutes = absOffset % 60; - if (minutes === 0) { - return sign + String(hours); - } - return ( - sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2) - ); -} +exports.colors = [6, 2, 3, 4, 5, 1]; -function formatTimezoneWithOptionalMinutes(offset, delimiter) { - if (offset % 60 === 0) { - const sign = offset > 0 ? "-" : "+"; - return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2); - } - return formatTimezone(offset, delimiter); -} +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(59318); -function formatTimezone(offset, delimiter = "") { - const sign = offset > 0 ? "-" : "+"; - const absOffset = Math.abs(offset); - const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2); - const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2); - return sign + hours + delimiter + minutes; + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. } +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ -/***/ }), +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); -/***/ 26961: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } -"use strict"; + obj[prop] = val; + return obj; +}, {}); -exports.lightFormatters = void 0; -var _index = __nccwpck_require__(534); +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ -/* - * | | Unit | | Unit | - * |-----|--------------------------------|-----|--------------------------------| - * | a | AM, PM | A* | | - * | d | Day of month | D | | - * | h | Hour [1-12] | H | Hour [0-23] | - * | m | Minute | M | Month | - * | s | Second | S | Fraction of second | - * | y | Year (abs) | Y | | +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. * - * Letters marked by * are not implemented but reserved by Unicode standard. + * @api public */ -const lightFormatters = (exports.lightFormatters = { - // Year - y(date, token) { - // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens - // | Year | y | yy | yyy | yyyy | yyyyy | - // |----------|-------|----|-------|-------|-------| - // | AD 1 | 1 | 01 | 001 | 0001 | 00001 | - // | AD 12 | 12 | 12 | 012 | 0012 | 00012 | - // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | - // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | - // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | +function formatArgs(args) { + const {namespace: name, useColors} = this; - const signedYear = date.getFullYear(); - // Returns 1 for 1 BC (which is year 0 in JavaScript) - const year = signedYear > 0 ? signedYear : 1 - signedYear; - return (0, _index.addLeadingZeros)( - token === "yy" ? year % 100 : year, - token.length, - ); - }, + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; - // Month - M(date, token) { - const month = date.getMonth(); - return token === "M" - ? String(month + 1) - : (0, _index.addLeadingZeros)(month + 1, 2); - }, + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} - // Day of the month - d(date, token) { - return (0, _index.addLeadingZeros)(date.getDate(), token.length); - }, +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} - // AM or PM - a(date, token) { - const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am"; +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ - switch (token) { - case "a": - case "aa": - return dayPeriodEnumValue.toUpperCase(); - case "aaa": - return dayPeriodEnumValue; - case "aaaaa": - return dayPeriodEnumValue[0]; - case "aaaa": - default: - return dayPeriodEnumValue === "am" ? "a.m." : "p.m."; - } - }, +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} - // Hour [1-12] - h(date, token) { - return (0, _index.addLeadingZeros)( - date.getHours() % 12 || 12, - token.length, - ); - }, +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} - // Hour [0-23] - H(date, token) { - return (0, _index.addLeadingZeros)(date.getHours(), token.length); - }, +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ - // Minute - m(date, token) { - return (0, _index.addLeadingZeros)(date.getMinutes(), token.length); - }, +function load() { + return process.env.DEBUG; +} - // Second - s(date, token) { - return (0, _index.addLeadingZeros)(date.getSeconds(), token.length); - }, +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ - // Fraction of second - S(date, token) { - const numberOfDigits = token.length; - const milliseconds = date.getMilliseconds(); - const fractionalSeconds = Math.trunc( - milliseconds * Math.pow(10, numberOfDigits - 3), - ); - return (0, _index.addLeadingZeros)(fractionalSeconds, token.length); - }, -}); +function init(debug) { + debug.inspectOpts = {}; + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} -/***/ }), +module.exports = __nccwpck_require__(46243)(exports); -/***/ 8707: -/***/ ((__unused_webpack_module, exports) => { +const {formatters} = module.exports; -"use strict"; +/** + * Map %o to `util.inspect()`, all on a single line. + */ -exports.longFormatters = void 0; +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; -const dateLongFormatter = (pattern, formatLong) => { - switch (pattern) { - case "P": - return formatLong.date({ width: "short" }); - case "PP": - return formatLong.date({ width: "medium" }); - case "PPP": - return formatLong.date({ width: "long" }); - case "PPPP": - default: - return formatLong.date({ width: "full" }); - } -}; - -const timeLongFormatter = (pattern, formatLong) => { - switch (pattern) { - case "p": - return formatLong.time({ width: "short" }); - case "pp": - return formatLong.time({ width: "medium" }); - case "ppp": - return formatLong.time({ width: "long" }); - case "pppp": - default: - return formatLong.time({ width: "full" }); - } -}; - -const dateTimeLongFormatter = (pattern, formatLong) => { - const matchResult = pattern.match(/(P+)(p+)?/) || []; - const datePattern = matchResult[1]; - const timePattern = matchResult[2]; - - if (!timePattern) { - return dateLongFormatter(pattern, formatLong); - } - - let dateTimeFormat; - - switch (datePattern) { - case "P": - dateTimeFormat = formatLong.dateTime({ width: "short" }); - break; - case "PP": - dateTimeFormat = formatLong.dateTime({ width: "medium" }); - break; - case "PPP": - dateTimeFormat = formatLong.dateTime({ width: "long" }); - break; - case "PPPP": - default: - dateTimeFormat = formatLong.dateTime({ width: "full" }); - break; - } +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ - return dateTimeFormat - .replace("{{date}}", dateLongFormatter(datePattern, formatLong)) - .replace("{{time}}", timeLongFormatter(timePattern, formatLong)); +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; -const longFormatters = (exports.longFormatters = { - p: timeLongFormatter, - P: dateTimeLongFormatter, -}); - /***/ }), -/***/ 21639: -/***/ ((__unused_webpack_module, exports) => { +/***/ 78848: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -exports.getRoundingMethod = getRoundingMethod; - -function getRoundingMethod(method) { - return (number) => { - const round = method ? Math[method] : Math.trunc; - const result = round(number); - // Prevent negative zero - return result === 0 ? 0 : result; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.compile = void 0; +const util_1 = __nccwpck_require__(73837); +const degenerator_1 = __nccwpck_require__(81484); +function compile(qjs, code, returnName, options = {}) { + const compiled = (0, degenerator_1.degenerator)(code, options.names ?? []); + const vm = qjs.newContext(); + // Add functions to global + if (options.sandbox) { + for (const [name, value] of Object.entries(options.sandbox)) { + if (typeof value !== 'function') { + throw new Error(`Expected a "function" for sandbox property \`${name}\`, but got "${typeof value}"`); + } + const fnHandle = vm.newFunction(name, (...args) => { + const result = value(...args.map((arg) => quickJSHandleToHost(vm, arg))); + vm.runtime.executePendingJobs(); + return hostToQuickJSHandle(vm, result); + }); + fnHandle.consume((handle) => vm.setProp(vm.global, name, handle)); + } + } + const fnResult = vm.evalCode(`${compiled};${returnName}`, options.filename); + const fn = vm.unwrapResult(fnResult); + const t = vm.typeof(fn); + if (t !== 'function') { + throw new Error(`Expected a "function" named \`${returnName}\` to be defined, but got "${t}"`); + } + const r = async function (...args) { + let promiseHandle; + let resolvedHandle; + try { + const result = vm.callFunction(fn, vm.undefined, ...args.map((arg) => hostToQuickJSHandle(vm, arg))); + promiseHandle = vm.unwrapResult(result); + const resolvedResultP = vm.resolvePromise(promiseHandle); + vm.runtime.executePendingJobs(); + const resolvedResult = await resolvedResultP; + resolvedHandle = vm.unwrapResult(resolvedResult); + return quickJSHandleToHost(vm, resolvedHandle); + } + catch (err) { + if (err && typeof err === 'object' && 'cause' in err && err.cause) { + if (typeof err.cause === 'object' && + 'stack' in err.cause && + 'name' in err.cause && + 'message' in err.cause && + typeof err.cause.stack === 'string' && + typeof err.cause.name === 'string' && + typeof err.cause.message === 'string') { + // QuickJS Error `stack` does not include the name + + // message, so patch those in to behave more like V8 + err.cause.stack = `${err.cause.name}: ${err.cause.message}\n${err.cause.stack}`; + } + throw err.cause; + } + throw err; + } + finally { + promiseHandle?.dispose(); + resolvedHandle?.dispose(); + } + }; + Object.defineProperty(r, 'toString', { + value: () => compiled, + enumerable: false, + }); + return r; } - +exports.compile = compile; +function quickJSHandleToHost(vm, val) { + return vm.dump(val); +} +function hostToQuickJSHandle(vm, val) { + if (typeof val === 'undefined') { + return vm.undefined; + } + else if (val === null) { + return vm.null; + } + else if (typeof val === 'string') { + return vm.newString(val); + } + else if (typeof val === 'number') { + return vm.newNumber(val); + } + else if (typeof val === 'bigint') { + return vm.newBigInt(val); + } + else if (typeof val === 'boolean') { + return val ? vm.true : vm.false; + } + else if (util_1.types.isPromise(val)) { + const promise = vm.newPromise(); + promise.settled.then(vm.runtime.executePendingJobs); + val.then((r) => { + promise.resolve(hostToQuickJSHandle(vm, r)); + }, (err) => { + promise.reject(hostToQuickJSHandle(vm, err)); + }); + return promise.handle; + } + else if (util_1.types.isNativeError(val)) { + return vm.newError(val); + } + throw new Error(`Unsupported value: ${val}`); +} +//# sourceMappingURL=compile.js.map /***/ }), -/***/ 31292: +/***/ 81484: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds; -var _index = __nccwpck_require__(53622); - +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.degenerator = void 0; +const util_1 = __nccwpck_require__(73837); +const escodegen_1 = __nccwpck_require__(7991); +const esprima_1 = __nccwpck_require__(78823); +const ast_types_1 = __nccwpck_require__(27012); /** - * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. - * They usually appear for dates that denote time before the timezones were introduced - * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 - * and GMT+01:00:00 after that date) + * Compiles sync JavaScript code into JavaScript with async Functions. * - * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above, - * which would lead to incorrect calculations. + * @param {String} code JavaScript string to convert + * @param {Array} names Array of function names to add `await` operators to + * @return {String} Converted JavaScript string with async/await injected + * @api public + */ +function degenerator(code, _names) { + if (!Array.isArray(_names)) { + throw new TypeError('an array of async function "names" is required'); + } + // Duplicate the `names` array since it's rude to augment the user args + const names = _names.slice(0); + const ast = (0, esprima_1.parseScript)(code); + // First pass is to find the `function` nodes and turn them into async or + // generator functions only if their body includes `CallExpressions` to + // function in `names`. We also add the names of the functions to the `names` + // array. We'll iterate several time, as every iteration might add new items + // to the `names` array, until no new names were added in the iteration. + let lastNamesLength = 0; + do { + lastNamesLength = names.length; + (0, ast_types_1.visit)(ast, { + visitVariableDeclaration(path) { + if (path.node.declarations) { + for (let i = 0; i < path.node.declarations.length; i++) { + const declaration = path.node.declarations[i]; + if (ast_types_1.namedTypes.VariableDeclarator.check(declaration) && + ast_types_1.namedTypes.Identifier.check(declaration.init) && + ast_types_1.namedTypes.Identifier.check(declaration.id) && + checkName(declaration.init.name, names) && + !checkName(declaration.id.name, names)) { + names.push(declaration.id.name); + } + } + } + return false; + }, + visitAssignmentExpression(path) { + if (ast_types_1.namedTypes.Identifier.check(path.node.left) && + ast_types_1.namedTypes.Identifier.check(path.node.right) && + checkName(path.node.right.name, names) && + !checkName(path.node.left.name, names)) { + names.push(path.node.left.name); + } + return false; + }, + visitFunction(path) { + if (path.node.id) { + let shouldDegenerate = false; + (0, ast_types_1.visit)(path.node, { + visitCallExpression(path) { + if (checkNames(path.node, names)) { + shouldDegenerate = true; + } + return false; + }, + }); + if (!shouldDegenerate) { + return false; + } + // Got a "function" expression/statement, + // convert it into an async function + path.node.async = true; + // Add function name to `names` array + if (!checkName(path.node.id.name, names)) { + names.push(path.node.id.name); + } + } + this.traverse(path); + }, + }); + } while (lastNamesLength !== names.length); + // Second pass is for adding `await` statements to any function + // invocations that match the given `names` array. + (0, ast_types_1.visit)(ast, { + visitCallExpression(path) { + if (checkNames(path.node, names)) { + // A "function invocation" expression, + // we need to inject an `AwaitExpression` + const delegate = false; + const { name, parent: { node: pNode }, } = path; + const expr = ast_types_1.builders.awaitExpression(path.node, delegate); + if (ast_types_1.namedTypes.CallExpression.check(pNode)) { + pNode.arguments[name] = expr; + } + else { + pNode[name] = expr; + } + } + this.traverse(path); + }, + }); + return (0, escodegen_1.generate)(ast); +} +exports.degenerator = degenerator; +/** + * Returns `true` if `node` has a matching name to one of the entries in the + * `names` array. * - * This function returns the timezone offset in milliseconds that takes seconds in account. + * @param {types.Node} node + * @param {Array} names Array of function names to return true for + * @return {Boolean} + * @api private */ -function getTimezoneOffsetInMilliseconds(date) { - const _date = (0, _index.toDate)(date); - const utcDate = new Date( - Date.UTC( - _date.getFullYear(), - _date.getMonth(), - _date.getDate(), - _date.getHours(), - _date.getMinutes(), - _date.getSeconds(), - _date.getMilliseconds(), - ), - ); - utcDate.setUTCFullYear(_date.getFullYear()); - return +date - +utcDate; +function checkNames({ callee }, names) { + let name; + if (ast_types_1.namedTypes.Identifier.check(callee)) { + name = callee.name; + } + else if (ast_types_1.namedTypes.MemberExpression.check(callee)) { + if (ast_types_1.namedTypes.Identifier.check(callee.object) && + ast_types_1.namedTypes.Identifier.check(callee.property)) { + name = `${callee.object.name}.${callee.property.name}`; + } + else { + return false; + } + } + else if (ast_types_1.namedTypes.FunctionExpression.check(callee)) { + if (callee.id) { + name = callee.id.name; + } + else { + return false; + } + } + else { + throw new Error(`Don't know how to get name for: ${callee.type}`); + } + return checkName(name, names); } - +function checkName(name, names) { + // now that we have the `name`, check if any entries match in the `names` array + for (let i = 0; i < names.length; i++) { + const n = names[i]; + if (util_1.types.isRegExp(n)) { + if (n.test(name)) { + return true; + } + } + else if (name === n) { + return true; + } + } + return false; +} +//# sourceMappingURL=degenerator.js.map /***/ }), -/***/ 82147: -/***/ ((__unused_webpack_module, exports) => { +/***/ 54545: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken; -exports.isProtectedWeekYearToken = isProtectedWeekYearToken; -exports.warnOrThrowProtectedError = warnOrThrowProtectedError; -const dayOfYearTokenRE = /^D+$/; -const weekYearTokenRE = /^Y+$/; - -const throwTokens = ["D", "DD", "YY", "YYYY"]; - -function isProtectedDayOfYearToken(token) { - return dayOfYearTokenRE.test(token); -} - -function isProtectedWeekYearToken(token) { - return weekYearTokenRE.test(token); -} - -function warnOrThrowProtectedError(token, format, input) { - const _message = message(token, format, input); - console.warn(_message); - if (throwTokens.includes(token)) throw new RangeError(_message); -} - -function message(token, format, input) { - const subject = token[0] === "Y" ? "years" : "days of the month"; - 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`; -} - +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(81484), exports); +__exportStar(__nccwpck_require__(78848), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 13110: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 58932: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -exports.add = add; -var _index = __nccwpck_require__(8361); -var _index2 = __nccwpck_require__(84119); -var _index3 = __nccwpck_require__(92736); -var _index4 = __nccwpck_require__(53622); -/** - * @name add - * @category Common Helpers - * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date. - * - * @description - * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added. - * - * | Key | Description | - * |----------------|------------------------------------| - * | years | Amount of years to be added | - * | months | Amount of months to be added | - * | weeks | Amount of weeks to be added | - * | days | Amount of days to be added | - * | hours | Amount of hours to be added | - * | minutes | Amount of minutes to be added | - * | seconds | Amount of seconds to be added | - * - * All values default to 0 - * - * @returns The new date with the seconds added - * - * @example - * // Add the following duration to 1 September 2014, 10:19:50 - * const result = add(new Date(2014, 8, 1, 10, 19, 50), { - * years: 2, - * months: 9, - * weeks: 1, - * days: 7, - * hours: 5,\\-7 - * minutes: 9, - * seconds: 30, - * }) - * //=> Thu Jun 15 2017 15:29:20 - */ -function add(date, duration) { - const { - years = 0, - months = 0, - weeks = 0, - days = 0, - hours = 0, - minutes = 0, - seconds = 0, - } = duration; +Object.defineProperty(exports, "__esModule", ({ value: true })); - // Add years and months - const _date = (0, _index4.toDate)(date); - const dateWithMonths = - months || years - ? (0, _index2.addMonths)(_date, months + years * 12) - : _date; +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) - // Add weeks and days - const dateWithDays = - days || weeks - ? (0, _index.addDays)(dateWithMonths, days + weeks * 7) - : dateWithMonths; + /* istanbul ignore next */ - // Add days, hours, minutes and seconds - const minutesToAdd = minutes + hours * 60; - const secondsToAdd = seconds + minutesToAdd * 60; - const msToAdd = secondsToAdd * 1000; - const finalDate = (0, _index3.constructFrom)( - date, - dateWithDays.getTime() + msToAdd, - ); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = 'Deprecation'; + } - return finalDate; } +exports.Deprecation = Deprecation; + /***/ }), -/***/ 11060: +/***/ 7991: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2015 Ingvar Stepanyan + Copyright (C) 2014 Ivan Nikulin + Copyright (C) 2012-2013 Michael Ficarra + Copyright (C) 2012-2013 Mathias Bynens + Copyright (C) 2013 Irakli Gozalishvili + Copyright (C) 2012 Robert Gust-Bardon + Copyright (C) 2012 John Freeman + Copyright (C) 2011-2012 Ariya Hidayat + Copyright (C) 2012 Joost-Wim Boekesteijn + Copyright (C) 2012 Kris Kowal + Copyright (C) 2012 Arpad Borsos + Copyright (C) 2020 Apple Inc. All rights reserved. -exports.addBusinessDays = addBusinessDays; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(92320); -var _index3 = __nccwpck_require__(49267); -var _index4 = __nccwpck_require__(45417); -var _index5 = __nccwpck_require__(53622); + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: -/** - * @name addBusinessDays - * @category Date Extension Helpers - * @summary Add the specified number of business days (mon - fri) to the given date. - * - * @description - * Add the specified number of business days (mon - fri) to the given date, ignoring weekends. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of business days to be added. - * - * @returns The new date with the business days added - * - * @example - * // Add 10 business days to 1 September 2014: - * const result = addBusinessDays(new Date(2014, 8, 1), 10) - * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days) - */ -function addBusinessDays(date, amount) { - const _date = (0, _index5.toDate)(date); - const startedOnWeekend = (0, _index4.isWeekend)(_date); - - if (isNaN(amount)) return (0, _index.constructFrom)(date, NaN); + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - const hours = _date.getHours(); - const sign = amount < 0 ? -1 : 1; - const fullWeeks = Math.trunc(amount / 5); + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ - _date.setDate(_date.getDate() + fullWeeks * 7); +/*global exports:true, require:true, global:true*/ +(function () { + 'use strict'; - // Get remaining days not part of a full week - let restDays = Math.abs(amount % 5); + var Syntax, + Precedence, + BinaryPrecedence, + SourceNode, + estraverse, + esutils, + base, + indent, + json, + renumber, + hexadecimal, + quotes, + escapeless, + newline, + space, + parentheses, + semicolons, + safeConcatenation, + directive, + extra, + parse, + sourceMap, + sourceCode, + preserveBlankLines, + FORMAT_MINIFY, + FORMAT_DEFAULTS; - // Loops over remaining days - while (restDays > 0) { - _date.setDate(_date.getDate() + sign); - if (!(0, _index4.isWeekend)(_date)) restDays -= 1; - } + estraverse = __nccwpck_require__(23479); + esutils = __nccwpck_require__(94038); - // If the date is a weekend day and we reduce a dividable of - // 5 from it, we land on a weekend date. - // To counter this, we add days accordingly to land on the next business day - if (startedOnWeekend && (0, _index4.isWeekend)(_date) && amount !== 0) { - // If we're reducing days, we want to add days until we land on a weekday - // If we're adding days we want to reduce days until we land on a weekday - if ((0, _index2.isSaturday)(_date)) - _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1)); - if ((0, _index3.isSunday)(_date)) - _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2)); - } + Syntax = estraverse.Syntax; - // Restore hours to avoid DST lag - _date.setHours(hours); + // Generation is done by generateExpression. + function isExpression(node) { + return CodeGenerator.Expression.hasOwnProperty(node.type); + } - return _date; -} + // Generation is done by generateStatement. + function isStatement(node) { + return CodeGenerator.Statement.hasOwnProperty(node.type); + } + Precedence = { + Sequence: 0, + Yield: 1, + Assignment: 1, + Conditional: 2, + ArrowFunction: 2, + Coalesce: 3, + LogicalOR: 4, + LogicalAND: 5, + BitwiseOR: 6, + BitwiseXOR: 7, + BitwiseAND: 8, + Equality: 9, + Relational: 10, + BitwiseSHIFT: 11, + Additive: 12, + Multiplicative: 13, + Exponentiation: 14, + Await: 15, + Unary: 15, + Postfix: 16, + OptionalChaining: 17, + Call: 18, + New: 19, + TaggedTemplate: 20, + Member: 21, + Primary: 22 + }; -/***/ }), + BinaryPrecedence = { + '??': Precedence.Coalesce, + '||': Precedence.LogicalOR, + '&&': Precedence.LogicalAND, + '|': Precedence.BitwiseOR, + '^': Precedence.BitwiseXOR, + '&': Precedence.BitwiseAND, + '==': Precedence.Equality, + '!=': Precedence.Equality, + '===': Precedence.Equality, + '!==': Precedence.Equality, + 'is': Precedence.Equality, + 'isnt': Precedence.Equality, + '<': Precedence.Relational, + '>': Precedence.Relational, + '<=': Precedence.Relational, + '>=': Precedence.Relational, + 'in': Precedence.Relational, + 'instanceof': Precedence.Relational, + '<<': Precedence.BitwiseSHIFT, + '>>': Precedence.BitwiseSHIFT, + '>>>': Precedence.BitwiseSHIFT, + '+': Precedence.Additive, + '-': Precedence.Additive, + '*': Precedence.Multiplicative, + '%': Precedence.Multiplicative, + '/': Precedence.Multiplicative, + '**': Precedence.Exponentiation + }; -/***/ 8361: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + //Flags + var F_ALLOW_IN = 1, + F_ALLOW_CALL = 1 << 1, + F_ALLOW_UNPARATH_NEW = 1 << 2, + F_FUNC_BODY = 1 << 3, + F_DIRECTIVE_CTX = 1 << 4, + F_SEMICOLON_OPT = 1 << 5, + F_FOUND_COALESCE = 1 << 6; -"use strict"; + //Expression flag sets + //NOTE: Flag order: + // F_ALLOW_IN + // F_ALLOW_CALL + // F_ALLOW_UNPARATH_NEW + var E_FTT = F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, + E_TTF = F_ALLOW_IN | F_ALLOW_CALL, + E_TTT = F_ALLOW_IN | F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, + E_TFF = F_ALLOW_IN, + E_FFT = F_ALLOW_UNPARATH_NEW, + E_TFT = F_ALLOW_IN | F_ALLOW_UNPARATH_NEW; -exports.addDays = addDays; -var _index = __nccwpck_require__(53622); -var _index2 = __nccwpck_require__(92736); + //Statement flag sets + //NOTE: Flag order: + // F_ALLOW_IN + // F_FUNC_BODY + // F_DIRECTIVE_CTX + // F_SEMICOLON_OPT + var S_TFFF = F_ALLOW_IN, + S_TFFT = F_ALLOW_IN | F_SEMICOLON_OPT, + S_FFFF = 0x00, + S_TFTF = F_ALLOW_IN | F_DIRECTIVE_CTX, + S_TTFF = F_ALLOW_IN | F_FUNC_BODY; -/** - * @name addDays - * @category Day Helpers - * @summary Add the specified number of days to the given date. - * - * @description - * Add the specified number of days to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of days to be added. - * - * @returns The new date with the days added - * - * @example - * // Add 10 days to 1 September 2014: - * const result = addDays(new Date(2014, 8, 1), 10) - * //=> Thu Sep 11 2014 00:00:00 - */ -function addDays(date, amount) { - const _date = (0, _index.toDate)(date); - if (isNaN(amount)) return (0, _index2.constructFrom)(date, NaN); - if (!amount) { - // If 0 days, no-op to avoid changing times in the hour before end of DST - return _date; - } - _date.setDate(_date.getDate() + amount); - return _date; -} + function getDefaultOptions() { + // default options + return { + indent: null, + base: null, + parse: null, + comment: false, + format: { + indent: { + style: ' ', + base: 0, + adjustMultilineComment: false + }, + newline: '\n', + space: ' ', + json: false, + renumber: false, + hexadecimal: false, + quotes: 'single', + escapeless: false, + compact: false, + parentheses: true, + semicolons: true, + safeConcatenation: false, + preserveBlankLines: false + }, + moz: { + comprehensionExpressionStartsWithAssignment: false, + starlessGenerator: false + }, + sourceMap: null, + sourceMapRoot: null, + sourceMapWithCode: false, + directive: false, + raw: true, + verbatim: null, + sourceCode: null + }; + } + function stringRepeat(str, num) { + var result = ''; -/***/ }), + for (num |= 0; num > 0; num >>>= 1, str += str) { + if (num & 1) { + result += str; + } + } -/***/ 89994: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return result; + } -"use strict"; + function hasLineTerminator(str) { + return (/[\r\n]/g).test(str); + } -exports.addHours = addHours; -var _index = __nccwpck_require__(28671); -var _index2 = __nccwpck_require__(17818); + function endsWithLineTerminator(str) { + var len = str.length; + return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1)); + } -/** - * @name addHours - * @category Hour Helpers - * @summary Add the specified number of hours to the given date. - * - * @description - * Add the specified number of hours to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of hours to be added. - * - * @returns The new date with the hours added - * - * @example - * // Add 2 hours to 10 July 2014 23:00:00: - * const result = addHours(new Date(2014, 6, 10, 23, 0), 2) - * //=> Fri Jul 11 2014 01:00:00 - */ -function addHours(date, amount) { - return (0, _index.addMilliseconds)(date, amount * _index2.millisecondsInHour); -} + function merge(target, override) { + var key; + for (key in override) { + if (override.hasOwnProperty(key)) { + target[key] = override[key]; + } + } + return target; + } + function updateDeeply(target, override) { + var key, val; -/***/ }), + function isHashObject(target) { + return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp); + } -/***/ 89209: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + for (key in override) { + if (override.hasOwnProperty(key)) { + val = override[key]; + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; + } -"use strict"; + function generateNumber(value) { + var result, point, temp, exponent, pos; -exports.addISOWeekYears = addISOWeekYears; -var _index = __nccwpck_require__(90308); -var _index2 = __nccwpck_require__(24954); + if (value !== value) { + throw new Error('Numeric literal whose value is NaN'); + } + if (value < 0 || (value === 0 && 1 / value < 0)) { + throw new Error('Numeric literal whose value is negative'); + } -/** - * @name addISOWeekYears - * @category ISO Week-Numbering Year Helpers - * @summary Add the specified number of ISO week-numbering years to the given date. - * - * @description - * Add the specified number of ISO week-numbering years to the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of ISO week-numbering years to be added. - * - * @returns The new date with the ISO week-numbering years added - * - * @example - * // Add 5 ISO week-numbering years to 2 July 2010: - * const result = addISOWeekYears(new Date(2010, 6, 2), 5) - * //=> Fri Jn 26 2015 00:00:00 - */ -function addISOWeekYears(date, amount) { - return (0, _index2.setISOWeekYear)( - date, - (0, _index.getISOWeekYear)(date) + amount, - ); -} + if (value === 1 / 0) { + return json ? 'null' : renumber ? '1e400' : '1e+400'; + } + result = '' + value; + if (!renumber || result.length < 3) { + return result; + } -/***/ }), + point = result.indexOf('.'); + if (!json && result.charCodeAt(0) === 0x30 /* 0 */ && point === 1) { + point = 0; + result = result.slice(1); + } + temp = result; + result = result.replace('e+', 'e'); + exponent = 0; + if ((pos = temp.indexOf('e')) > 0) { + exponent = +temp.slice(pos + 1); + temp = temp.slice(0, pos); + } + if (point >= 0) { + exponent -= temp.length - point - 1; + temp = +(temp.slice(0, point) + temp.slice(point + 1)) + ''; + } + pos = 0; + while (temp.charCodeAt(temp.length + pos - 1) === 0x30 /* 0 */) { + --pos; + } + if (pos !== 0) { + exponent -= pos; + temp = temp.slice(0, pos); + } + if (exponent !== 0) { + temp += 'e' + exponent; + } + if ((temp.length < result.length || + (hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = '0x' + value.toString(16)).length < result.length)) && + +temp === value) { + result = temp; + } -/***/ 28671: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return result; + } -"use strict"; + // Generate valid RegExp expression. + // This function is based on https://github.com/Constellation/iv Engine -exports.addMilliseconds = addMilliseconds; -var _index = __nccwpck_require__(53622); -var _index2 = __nccwpck_require__(92736); + function escapeRegExpCharacter(ch, previousIsBackslash) { + // not handling '\' and handling \u2028 or \u2029 to unicode escape sequence + if ((ch & ~1) === 0x2028) { + return (previousIsBackslash ? 'u' : '\\u') + ((ch === 0x2028) ? '2028' : '2029'); + } else if (ch === 10 || ch === 13) { // \n, \r + return (previousIsBackslash ? '' : '\\') + ((ch === 10) ? 'n' : 'r'); + } + return String.fromCharCode(ch); + } -/** - * @name addMilliseconds - * @category Millisecond Helpers - * @summary Add the specified number of milliseconds to the given date. - * - * @description - * Add the specified number of milliseconds to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of milliseconds to be added. - * - * @returns The new date with the milliseconds added - * - * @example - * // Add 750 milliseconds to 10 July 2014 12:45:30.000: - * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) - * //=> Thu Jul 10 2014 12:45:30.750 - */ -function addMilliseconds(date, amount) { - const timestamp = +(0, _index.toDate)(date); - return (0, _index2.constructFrom)(date, timestamp + amount); -} + function generateRegExp(reg) { + var match, result, flags, i, iz, ch, characterInBrack, previousIsBackslash; + result = reg.toString(); -/***/ }), + if (reg.source) { + // extract flag from toString result + match = result.match(/\/([^/]*)$/); + if (!match) { + return result; + } -/***/ 97231: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + flags = match[1]; + result = ''; -"use strict"; + characterInBrack = false; + previousIsBackslash = false; + for (i = 0, iz = reg.source.length; i < iz; ++i) { + ch = reg.source.charCodeAt(i); -exports.addMinutes = addMinutes; -var _index = __nccwpck_require__(28671); -var _index2 = __nccwpck_require__(17818); + if (!previousIsBackslash) { + if (characterInBrack) { + if (ch === 93) { // ] + characterInBrack = false; + } + } else { + if (ch === 47) { // / + result += '\\'; + } else if (ch === 91) { // [ + characterInBrack = true; + } + } + result += escapeRegExpCharacter(ch, previousIsBackslash); + previousIsBackslash = ch === 92; // \ + } else { + // if new RegExp("\\\n') is provided, create /\n/ + result += escapeRegExpCharacter(ch, previousIsBackslash); + // prevent like /\\[/]/ + previousIsBackslash = false; + } + } -/** - * @name addMinutes - * @category Minute Helpers - * @summary Add the specified number of minutes to the given date. - * - * @description - * Add the specified number of minutes to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of minutes to be added. - * - * @returns The new date with the minutes added - * - * @example - * // Add 30 minutes to 10 July 2014 12:00:00: - * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) - * //=> Thu Jul 10 2014 12:30:00 - */ -function addMinutes(date, amount) { - return (0, _index.addMilliseconds)( - date, - amount * _index2.millisecondsInMinute, - ); -} + return '/' + result + '/' + flags; + } + return result; + } -/***/ }), + function escapeAllowedCharacter(code, next) { + var hex; -/***/ 84119: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (code === 0x08 /* \b */) { + return '\\b'; + } -"use strict"; + if (code === 0x0C /* \f */) { + return '\\f'; + } -exports.addMonths = addMonths; -var _index = __nccwpck_require__(53622); -var _index2 = __nccwpck_require__(92736); - -/** - * @name addMonths - * @category Month Helpers - * @summary Add the specified number of months to the given date. - * - * @description - * Add the specified number of months to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of months to be added. - * - * @returns The new date with the months added - * - * @example - * // Add 5 months to 1 September 2014: - * const result = addMonths(new Date(2014, 8, 1), 5) - * //=> Sun Feb 01 2015 00:00:00 - * - * // Add one month to 30 January 2023: - * const result = addMonths(new Date(2023, 0, 30), 1) - * //=> Tue Feb 28 2023 00:00:00 - */ -function addMonths(date, amount) { - const _date = (0, _index.toDate)(date); - if (isNaN(amount)) return (0, _index2.constructFrom)(date, NaN); - if (!amount) { - // If 0 months, no-op to avoid changing times in the hour before end of DST - return _date; - } - const dayOfMonth = _date.getDate(); - - // The JS Date object supports date math by accepting out-of-bounds values for - // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and - // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we - // want except that dates will wrap around the end of a month, meaning that - // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So - // we'll default to the end of the desired month by adding 1 to the desired - // month and using a date of 0 to back up one day to the end of the desired - // month. - const endOfDesiredMonth = (0, _index2.constructFrom)(date, _date.getTime()); - endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0); - const daysInMonth = endOfDesiredMonth.getDate(); - if (dayOfMonth >= daysInMonth) { - // If we're already at the end of the month, then this is the correct date - // and we're done. - return endOfDesiredMonth; - } else { - // Otherwise, we now know that setting the original day-of-month value won't - // cause an overflow, so set the desired day-of-month. Note that we can't - // just set the date of `endOfDesiredMonth` because that object may have had - // its time changed in the unusual case where where a DST transition was on - // the last day of the month and its local time was in the hour skipped or - // repeated next to a DST transition. So we use `date` instead which is - // guaranteed to still have the original time. - _date.setFullYear( - endOfDesiredMonth.getFullYear(), - endOfDesiredMonth.getMonth(), - dayOfMonth, - ); - return _date; - } -} + if (code === 0x09 /* \t */) { + return '\\t'; + } + hex = code.toString(16).toUpperCase(); + if (json || code > 0xFF) { + return '\\u' + '0000'.slice(hex.length) + hex; + } else if (code === 0x0000 && !esutils.code.isDecimalDigit(next)) { + return '\\0'; + } else if (code === 0x000B /* \v */) { // '\v' + return '\\x0B'; + } else { + return '\\x' + '00'.slice(hex.length) + hex; + } + } -/***/ }), + function escapeDisallowedCharacter(code) { + if (code === 0x5C /* \ */) { + return '\\\\'; + } -/***/ 17153: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (code === 0x0A /* \n */) { + return '\\n'; + } -"use strict"; + if (code === 0x0D /* \r */) { + return '\\r'; + } -exports.addQuarters = addQuarters; -var _index = __nccwpck_require__(84119); + if (code === 0x2028) { + return '\\u2028'; + } -/** - * @name addQuarters - * @category Quarter Helpers - * @summary Add the specified number of year quarters to the given date. - * - * @description - * Add the specified number of year quarters to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of quarters to be added. - * - * @returns The new date with the quarters added - * - * @example - * // Add 1 quarter to 1 September 2014: - * const result = addQuarters(new Date(2014, 8, 1), 1) - * //=> Mon Dec 01 2014 00:00:00 - */ -function addQuarters(date, amount) { - const months = amount * 3; - return (0, _index.addMonths)(date, months); -} + if (code === 0x2029) { + return '\\u2029'; + } + throw new Error('Incorrectly classified character'); + } -/***/ }), + function escapeDirective(str) { + var i, iz, code, quote; -/***/ 63378: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + quote = quotes === 'double' ? '"' : '\''; + for (i = 0, iz = str.length; i < iz; ++i) { + code = str.charCodeAt(i); + if (code === 0x27 /* ' */) { + quote = '"'; + break; + } else if (code === 0x22 /* " */) { + quote = '\''; + break; + } else if (code === 0x5C /* \ */) { + ++i; + } + } -"use strict"; + return quote + str + quote; + } -exports.addSeconds = addSeconds; -var _index = __nccwpck_require__(28671); + function escapeString(str) { + var result = '', i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote; -/** - * @name addSeconds - * @category Second Helpers - * @summary Add the specified number of seconds to the given date. - * - * @description - * Add the specified number of seconds to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of seconds to be added. - * - * @returns The new date with the seconds added - * - * @example - * // Add 30 seconds to 10 July 2014 12:45:00: - * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) - * //=> Thu Jul 10 2014 12:45:30 - */ -function addSeconds(date, amount) { - return (0, _index.addMilliseconds)(date, amount * 1000); -} + for (i = 0, len = str.length; i < len; ++i) { + code = str.charCodeAt(i); + if (code === 0x27 /* ' */) { + ++singleQuotes; + } else if (code === 0x22 /* " */) { + ++doubleQuotes; + } else if (code === 0x2F /* / */ && json) { + result += '\\'; + } else if (esutils.code.isLineTerminator(code) || code === 0x5C /* \ */) { + result += escapeDisallowedCharacter(code); + continue; + } else if (!esutils.code.isIdentifierPartES5(code) && (json && code < 0x20 /* SP */ || !json && !escapeless && (code < 0x20 /* SP */ || code > 0x7E /* ~ */))) { + result += escapeAllowedCharacter(code, str.charCodeAt(i + 1)); + continue; + } + result += String.fromCharCode(code); + } + single = !(quotes === 'double' || (quotes === 'auto' && doubleQuotes < singleQuotes)); + quote = single ? '\'' : '"'; -/***/ }), + if (!(single ? singleQuotes : doubleQuotes)) { + return quote + result + quote; + } -/***/ 66985: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + str = result; + result = quote; -"use strict"; + for (i = 0, len = str.length; i < len; ++i) { + code = str.charCodeAt(i); + if ((code === 0x27 /* ' */ && single) || (code === 0x22 /* " */ && !single)) { + result += '\\'; + } + result += String.fromCharCode(code); + } -exports.addWeeks = addWeeks; -var _index = __nccwpck_require__(8361); + return result + quote; + } -/** - * @name addWeeks - * @category Week Helpers - * @summary Add the specified number of weeks to the given date. - * - * @description - * Add the specified number of week to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of weeks to be added. - * - * @returns The new date with the weeks added - * - * @example - * // Add 4 weeks to 1 September 2014: - * const result = addWeeks(new Date(2014, 8, 1), 4) - * //=> Mon Sep 29 2014 00:00:00 - */ -function addWeeks(date, amount) { - const days = amount * 7; - return (0, _index.addDays)(date, days); -} + /** + * flatten an array to a string, where the array can contain + * either strings or nested arrays + */ + function flattenToString(arr) { + var i, iz, elem, result = ''; + for (i = 0, iz = arr.length; i < iz; ++i) { + elem = arr[i]; + result += Array.isArray(elem) ? flattenToString(elem) : elem; + } + return result; + } + /** + * convert generated to a SourceNode when source maps are enabled. + */ + function toSourceNodeWhenNeeded(generated, node) { + if (!sourceMap) { + // with no source maps, generated is either an + // array or a string. if an array, flatten it. + // if a string, just return it + if (Array.isArray(generated)) { + return flattenToString(generated); + } else { + return generated; + } + } + if (node == null) { + if (generated instanceof SourceNode) { + return generated; + } else { + node = {}; + } + } + if (node.loc == null) { + return new SourceNode(null, null, sourceMap, generated, node.name || null); + } + return new SourceNode(node.loc.start.line, node.loc.start.column, (sourceMap === true ? node.loc.source || null : sourceMap), generated, node.name || null); + } -/***/ }), + function noEmptySpace() { + return (space) ? space : ' '; + } -/***/ 77204: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function join(left, right) { + var leftSource, + rightSource, + leftCharCode, + rightCharCode; -"use strict"; + leftSource = toSourceNodeWhenNeeded(left).toString(); + if (leftSource.length === 0) { + return [right]; + } -exports.addYears = addYears; -var _index = __nccwpck_require__(84119); + rightSource = toSourceNodeWhenNeeded(right).toString(); + if (rightSource.length === 0) { + return [left]; + } -/** - * @name addYears - * @category Year Helpers - * @summary Add the specified number of years to the given date. - * - * @description - * Add the specified number of years to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of years to be added. - * - * @returns The new date with the years added - * - * @example - * // Add 5 years to 1 September 2014: - * const result = addYears(new Date(2014, 8, 1), 5) - * //=> Sun Sep 01 2019 00:00:00 - */ -function addYears(date, amount) { - return (0, _index.addMonths)(date, amount * 12); -} + leftCharCode = leftSource.charCodeAt(leftSource.length - 1); + rightCharCode = rightSource.charCodeAt(0); + if ((leftCharCode === 0x2B /* + */ || leftCharCode === 0x2D /* - */) && leftCharCode === rightCharCode || + esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || + leftCharCode === 0x2F /* / */ && rightCharCode === 0x69 /* i */) { // infix word operators all start with `i` + return [left, noEmptySpace(), right]; + } else if (esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || + esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode)) { + return [left, right]; + } + return [left, space, right]; + } -/***/ }), + function addIndent(stmt) { + return [base, stmt]; + } -/***/ 88690: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function withIndent(fn) { + var previousBase; + previousBase = base; + base += indent; + fn(base); + base = previousBase; + } -"use strict"; + function calculateSpaces(str) { + var i; + for (i = str.length - 1; i >= 0; --i) { + if (esutils.code.isLineTerminator(str.charCodeAt(i))) { + break; + } + } + return (str.length - 1) - i; + } -exports.areIntervalsOverlapping = areIntervalsOverlapping; -var _index = __nccwpck_require__(53622); + function adjustMultilineComment(value, specialBase) { + var array, i, len, line, j, spaces, previousBase, sn; -/** - * The {@link areIntervalsOverlapping} function options. - */ + array = value.split(/\r\n|[\r\n]/); + spaces = Number.MAX_VALUE; -/** - * @name areIntervalsOverlapping - * @category Interval Helpers - * @summary Is the given time interval overlapping with another time interval? - * - * @description - * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`. - * - * @param intervalLeft - The first interval to compare. - * @param intervalRight - The second interval to compare. - * @param options - The object with options - * - * @returns Whether the time intervals are overlapping - * - * @example - * // For overlapping time intervals: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } - * ) - * //=> true - * - * @example - * // For non-overlapping time intervals: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } - * ) - * //=> false - * - * @example - * // For adjacent time intervals: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) } - * ) - * //=> false - * - * @example - * // Using the inclusive option: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) } - * ) - * //=> false - * - * @example - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }, - * { inclusive: true } - * ) - * //=> true - */ -function areIntervalsOverlapping(intervalLeft, intervalRight, options) { - const [leftStartTime, leftEndTime] = [ - +(0, _index.toDate)(intervalLeft.start), - +(0, _index.toDate)(intervalLeft.end), - ].sort((a, b) => a - b); - const [rightStartTime, rightEndTime] = [ - +(0, _index.toDate)(intervalRight.start), - +(0, _index.toDate)(intervalRight.end), - ].sort((a, b) => a - b); + // first line doesn't have indentation + for (i = 1, len = array.length; i < len; ++i) { + line = array[i]; + j = 0; + while (j < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j))) { + ++j; + } + if (spaces > j) { + spaces = j; + } + } - if (options?.inclusive) - return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime; + if (typeof specialBase !== 'undefined') { + // pattern like + // { + // var t = 20; /* + // * this is comment + // */ + // } + previousBase = base; + if (array[1][spaces] === '*') { + specialBase += ' '; + } + base = specialBase; + } else { + if (spaces & 1) { + // /* + // * + // */ + // If spaces are odd number, above pattern is considered. + // We waste 1 space. + --spaces; + } + previousBase = base; + } - return leftStartTime < rightEndTime && rightStartTime < leftEndTime; -} + for (i = 1, len = array.length; i < len; ++i) { + sn = toSourceNodeWhenNeeded(addIndent(array[i].slice(spaces))); + array[i] = sourceMap ? sn.join('') : sn; + } + base = previousBase; -/***/ }), + return array.join('\n'); + } -/***/ 68832: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function generateComment(comment, specialBase) { + if (comment.type === 'Line') { + if (endsWithLineTerminator(comment.value)) { + return '//' + comment.value; + } else { + // Always use LineTerminator + var result = '//' + comment.value; + if (!preserveBlankLines) { + result += '\n'; + } + return result; + } + } + if (extra.format.indent.adjustMultilineComment && /[\n\r]/.test(comment.value)) { + return adjustMultilineComment('/*' + comment.value + '*/', specialBase); + } + return '/*' + comment.value + '*/'; + } -"use strict"; + function addComments(stmt, result) { + var i, len, comment, save, tailingToStatement, specialBase, fragment, + extRange, range, prevRange, prefix, infix, suffix, count; -exports.clamp = clamp; -var _index = __nccwpck_require__(17679); -var _index2 = __nccwpck_require__(13607); + if (stmt.leadingComments && stmt.leadingComments.length > 0) { + save = result; -/** - * @name clamp - * @category Interval Helpers - * @summary Return a date bounded by the start and the end of the given interval - * - * @description - * Clamps a date to the lower bound with the start of the interval and the upper - * bound with the end of the interval. - * - * - When the date is less than the start of the interval, the start is returned. - * - When the date is greater than the end of the interval, the end is returned. - * - Otherwise the date is returned. - * - * @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). - * - * @param date - The date to be bounded - * @param interval - The interval to bound to - * - * @returns The date bounded by the start and the end of the interval - * - * @example - * // What is Mar, 21, 2021 bounded to an interval starting at Mar, 22, 2021 and ending at Apr, 01, 2021 - * const result = clamp(new Date(2021, 2, 21), { - * start: new Date(2021, 2, 22), - * end: new Date(2021, 3, 1), - * }) - * //=> Mon Mar 22 2021 00:00:00 - */ -function clamp(date, interval) { - return (0, _index2.min)([ - (0, _index.max)([date, interval.start]), - interval.end, - ]); -} + if (preserveBlankLines) { + comment = stmt.leadingComments[0]; + result = []; + extRange = comment.extendedRange; + range = comment.range; -/***/ }), + prefix = sourceCode.substring(extRange[0], range[0]); + count = (prefix.match(/\n/g) || []).length; + if (count > 0) { + result.push(stringRepeat('\n', count)); + result.push(addIndent(generateComment(comment))); + } else { + result.push(prefix); + result.push(generateComment(comment)); + } -/***/ 52563: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + prevRange = range; -"use strict"; + for (i = 1, len = stmt.leadingComments.length; i < len; i++) { + comment = stmt.leadingComments[i]; + range = comment.range; -exports.closestIndexTo = closestIndexTo; -var _index = __nccwpck_require__(53622); + infix = sourceCode.substring(prevRange[1], range[0]); + count = (infix.match(/\n/g) || []).length; + result.push(stringRepeat('\n', count)); + result.push(addIndent(generateComment(comment))); -/** - * @name closestIndexTo - * @category Common Helpers - * @summary Return an index of the closest date from the array comparing to the given date. - * - * @description - * Return an index of the closest date from the array comparing to the given date. - * - * @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). - * - * @param dateToCompare - The date to compare with - * @param dates - The array to search - * - * @returns An index of the date closest to the given date or undefined if no valid value is given - * - * @example - * // Which date is closer to 6 September 2015? - * const dateToCompare = new Date(2015, 8, 6) - * const datesArray = [ - * new Date(2015, 0, 1), - * new Date(2016, 0, 1), - * new Date(2017, 0, 1) - * ] - * const result = closestIndexTo(dateToCompare, datesArray) - * //=> 1 - */ -function closestIndexTo(dateToCompare, dates) { - const date = (0, _index.toDate)(dateToCompare); + prevRange = range; + } - if (isNaN(Number(date))) return NaN; + suffix = sourceCode.substring(range[1], extRange[1]); + count = (suffix.match(/\n/g) || []).length; + result.push(stringRepeat('\n', count)); + } else { + comment = stmt.leadingComments[0]; + result = []; + if (safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0) { + result.push('\n'); + } + result.push(generateComment(comment)); + if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result.push('\n'); + } - const timeToCompare = date.getTime(); + for (i = 1, len = stmt.leadingComments.length; i < len; ++i) { + comment = stmt.leadingComments[i]; + fragment = [generateComment(comment)]; + if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { + fragment.push('\n'); + } + result.push(addIndent(fragment)); + } + } - let result; - let minDistance; - dates.forEach(function (dirtyDate, index) { - const currentDate = (0, _index.toDate)(dirtyDate); + result.push(addIndent(save)); + } - if (isNaN(Number(currentDate))) { - result = NaN; - minDistance = NaN; - return; - } + if (stmt.trailingComments) { - const distance = Math.abs(timeToCompare - currentDate.getTime()); - if (result == null || distance < minDistance) { - result = index; - minDistance = distance; - } - }); + if (preserveBlankLines) { + comment = stmt.trailingComments[0]; + extRange = comment.extendedRange; + range = comment.range; - return result; -} + prefix = sourceCode.substring(extRange[0], range[0]); + count = (prefix.match(/\n/g) || []).length; + if (count > 0) { + result.push(stringRepeat('\n', count)); + result.push(addIndent(generateComment(comment))); + } else { + result.push(prefix); + result.push(generateComment(comment)); + } + } else { + tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); + specialBase = stringRepeat(' ', calculateSpaces(toSourceNodeWhenNeeded([base, result, indent]).toString())); + for (i = 0, len = stmt.trailingComments.length; i < len; ++i) { + comment = stmt.trailingComments[i]; + if (tailingToStatement) { + // We assume target like following script + // + // var t = 20; /** + // * This is comment of t + // */ + if (i === 0) { + // first case + result = [result, indent]; + } else { + result = [result, specialBase]; + } + result.push(generateComment(comment, specialBase)); + } else { + result = [result, addIndent(generateComment(comment))]; + } + if (i !== len - 1 && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result = [result, '\n']; + } + } + } + } -/***/ }), + return result; + } -/***/ 50043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function generateBlankLines(start, end, result) { + var j, newlineCount = 0; -"use strict"; + for (j = start; j < end; j++) { + if (sourceCode[j] === '\n') { + newlineCount++; + } + } -exports.closestTo = closestTo; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(53622); + for (j = 1; j < newlineCount; j++) { + result.push(newline); + } + } -/** - * @name closestTo - * @category Common Helpers - * @summary Return a date from the array closest to the given date. - * - * @description - * Return a date from the array closest to the given date. - * - * @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). - * - * @param dateToCompare - The date to compare with - * @param dates - The array to search - * - * @returns The date from the array closest to the given date or undefined if no valid value is given - * - * @example - * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030? - * const dateToCompare = new Date(2015, 8, 6) - * const result = closestTo(dateToCompare, [ - * new Date(2000, 0, 1), - * new Date(2030, 0, 1) - * ]) - * //=> Tue Jan 01 2030 00:00:00 - */ -function closestTo(dateToCompare, dates) { - const date = (0, _index2.toDate)(dateToCompare); + function parenthesize(text, current, should) { + if (current < should) { + return ['(', text, ')']; + } + return text; + } - if (isNaN(Number(date))) return (0, _index.constructFrom)(dateToCompare, NaN); + function generateVerbatimString(string) { + var i, iz, result; + result = string.split(/\r\n|\n/); + for (i = 1, iz = result.length; i < iz; i++) { + result[i] = newline + base + result[i]; + } + return result; + } - const timeToCompare = date.getTime(); + function generateVerbatim(expr, precedence) { + var verbatim, result, prec; + verbatim = expr[extra.verbatim]; - let result; - let minDistance; - dates.forEach((dirtyDate) => { - const currentDate = (0, _index2.toDate)(dirtyDate); + if (typeof verbatim === 'string') { + result = parenthesize(generateVerbatimString(verbatim), Precedence.Sequence, precedence); + } else { + // verbatim is object + result = generateVerbatimString(verbatim.content); + prec = (verbatim.precedence != null) ? verbatim.precedence : Precedence.Sequence; + result = parenthesize(result, prec, precedence); + } - if (isNaN(Number(currentDate))) { - result = (0, _index.constructFrom)(dateToCompare, NaN); - minDistance = NaN; - return; + return toSourceNodeWhenNeeded(result, expr); } - const distance = Math.abs(timeToCompare - currentDate.getTime()); - if (result == null || distance < minDistance) { - result = currentDate; - minDistance = distance; + function CodeGenerator() { } - }); - return result; -} + // Helpers. + CodeGenerator.prototype.maybeBlock = function(stmt, flags) { + var result, noLeadingComment, that = this; -/***/ }), + noLeadingComment = !extra.comment || !stmt.leadingComments; -/***/ 76125: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (stmt.type === Syntax.BlockStatement && noLeadingComment) { + return [space, this.generateStatement(stmt, flags)]; + } -"use strict"; + if (stmt.type === Syntax.EmptyStatement && noLeadingComment) { + return ';'; + } -exports.compareAsc = compareAsc; -var _index = __nccwpck_require__(53622); + withIndent(function () { + result = [ + newline, + addIndent(that.generateStatement(stmt, flags)) + ]; + }); -/** - * @name compareAsc - * @category Common Helpers - * @summary Compare the two dates and return -1, 0 or 1. - * - * @description - * Compare the two dates and return 1 if the first date is after the second, - * -1 if the first date is before the second or 0 if dates are equal. - * - * @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). - * - * @param dateLeft - The first date to compare - * @param dateRight - The second date to compare - * - * @returns The result of the comparison - * - * @example - * // Compare 11 February 1987 and 10 July 1989: - * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10)) - * //=> -1 - * - * @example - * // Sort the array of dates: - * const result = [ - * new Date(1995, 6, 2), - * new Date(1987, 1, 11), - * new Date(1989, 6, 10) - * ].sort(compareAsc) - * //=> [ - * // Wed Feb 11 1987 00:00:00, - * // Mon Jul 10 1989 00:00:00, - * // Sun Jul 02 1995 00:00:00 - * // ] - */ -function compareAsc(dateLeft, dateRight) { - const _dateLeft = (0, _index.toDate)(dateLeft); - const _dateRight = (0, _index.toDate)(dateRight); + return result; + }; - const diff = _dateLeft.getTime() - _dateRight.getTime(); + CodeGenerator.prototype.maybeBlockSuffix = function (stmt, result) { + var ends = endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); + if (stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends) { + return [result, space]; + } + if (ends) { + return [result, base]; + } + return [result, newline, base]; + }; - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; - // Return 0 if diff is 0; return NaN if diff is NaN - } else { - return diff; - } -} + function generateIdentifier(node) { + return toSourceNodeWhenNeeded(node.name, node); + } + function generateAsyncPrefix(node, spaceRequired) { + return node.async ? 'async' + (spaceRequired ? noEmptySpace() : space) : ''; + } -/***/ }), + function generateStarSuffix(node) { + var isGenerator = node.generator && !extra.moz.starlessGenerator; + return isGenerator ? '*' + space : ''; + } -/***/ 53259: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function generateMethodPrefix(prop) { + var func = prop.value, prefix = ''; + if (func.async) { + prefix += generateAsyncPrefix(func, !prop.computed); + } + if (func.generator) { + // avoid space before method name + prefix += generateStarSuffix(func) ? '*' : ''; + } + return prefix; + } -"use strict"; + CodeGenerator.prototype.generatePattern = function (node, precedence, flags) { + if (node.type === Syntax.Identifier) { + return generateIdentifier(node); + } + return this.generateExpression(node, precedence, flags); + }; -exports.compareDesc = compareDesc; -var _index = __nccwpck_require__(53622); + CodeGenerator.prototype.generateFunctionParams = function (node) { + var i, iz, result, hasDefault; -/** - * @name compareDesc - * @category Common Helpers - * @summary Compare the two dates reverse chronologically and return -1, 0 or 1. - * - * @description - * Compare the two dates and return -1 if the first date is after the second, - * 1 if the first date is before the second or 0 if dates are equal. - * - * @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). - * - * @param dateLeft - The first date to compare - * @param dateRight - The second date to compare - * - * @returns The result of the comparison - * - * @example - * // Compare 11 February 1987 and 10 July 1989 reverse chronologically: - * const result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10)) - * //=> 1 - * - * @example - * // Sort the array of dates in reverse chronological order: - * const result = [ - * new Date(1995, 6, 2), - * new Date(1987, 1, 11), - * new Date(1989, 6, 10) - * ].sort(compareDesc) - * //=> [ - * // Sun Jul 02 1995 00:00:00, - * // Mon Jul 10 1989 00:00:00, - * // Wed Feb 11 1987 00:00:00 - * // ] - */ -function compareDesc(dateLeft, dateRight) { - const _dateLeft = (0, _index.toDate)(dateLeft); - const _dateRight = (0, _index.toDate)(dateRight); + hasDefault = false; - const diff = _dateLeft.getTime() - _dateRight.getTime(); + if (node.type === Syntax.ArrowFunctionExpression && + !node.rest && (!node.defaults || node.defaults.length === 0) && + node.params.length === 1 && node.params[0].type === Syntax.Identifier) { + // arg => { } case + result = [generateAsyncPrefix(node, true), generateIdentifier(node.params[0])]; + } else { + result = node.type === Syntax.ArrowFunctionExpression ? [generateAsyncPrefix(node, false)] : []; + result.push('('); + if (node.defaults) { + hasDefault = true; + } + for (i = 0, iz = node.params.length; i < iz; ++i) { + if (hasDefault && node.defaults[i]) { + // Handle default values. + result.push(this.generateAssignment(node.params[i], node.defaults[i], '=', Precedence.Assignment, E_TTT)); + } else { + result.push(this.generatePattern(node.params[i], Precedence.Assignment, E_TTT)); + } + if (i + 1 < iz) { + result.push(',' + space); + } + } - if (diff > 0) { - return -1; - } else if (diff < 0) { - return 1; - // Return 0 if diff is 0; return NaN if diff is NaN - } else { - return diff; - } -} + if (node.rest) { + if (node.params.length) { + result.push(',' + space); + } + result.push('...'); + result.push(generateIdentifier(node.rest)); + } + result.push(')'); + } -/***/ }), + return result; + }; -/***/ 17818: -/***/ ((__unused_webpack_module, exports) => { + CodeGenerator.prototype.generateFunctionBody = function (node) { + var result, expr; -"use strict"; + result = this.generateFunctionParams(node); -exports.secondsInYear = - exports.secondsInWeek = - exports.secondsInQuarter = - exports.secondsInMonth = - exports.secondsInMinute = - exports.secondsInHour = - exports.secondsInDay = - exports.quartersInYear = - exports.monthsInYear = - exports.monthsInQuarter = - exports.minutesInYear = - exports.minutesInMonth = - exports.minutesInHour = - exports.minutesInDay = - exports.minTime = - exports.millisecondsInWeek = - exports.millisecondsInSecond = - exports.millisecondsInMinute = - exports.millisecondsInHour = - exports.millisecondsInDay = - exports.maxTime = - exports.daysInYear = - exports.daysInWeek = - void 0; /** - * @module constants - * @summary Useful constants - * @description - * Collection of useful date constants. - * - * The constants could be imported from `date-fns/constants`: - * - * ```ts - * import { maxTime, minTime } from "date-fns/constants"; - * - * function isAllowedTime(time) { - * return time <= maxTime && time >= minTime; - * } - * ``` - */ + if (node.type === Syntax.ArrowFunctionExpression) { + result.push(space); + result.push('=>'); + } -/** - * @constant - * @name daysInWeek - * @summary Days in 1 week. - */ -const daysInWeek = (exports.daysInWeek = 7); + if (node.expression) { + result.push(space); + expr = this.generateExpression(node.body, Precedence.Assignment, E_TTT); + if (expr.toString().charAt(0) === '{') { + expr = ['(', expr, ')']; + } + result.push(expr); + } else { + result.push(this.maybeBlock(node.body, S_TTFF)); + } -/** - * @constant - * @name daysInYear - * @summary Days in 1 year. - * - * @description - * How many days in a year. - * - * One years equals 365.2425 days according to the formula: - * - * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. - * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days - */ -const daysInYear = (exports.daysInYear = 365.2425); + return result; + }; -/** - * @constant - * @name maxTime - * @summary Maximum allowed time. - * - * @example - * import { maxTime } from "date-fns/constants"; - * - * const isValid = 8640000000000001 <= maxTime; - * //=> false - * - * new Date(8640000000000001); - * //=> Invalid Date - */ -const maxTime = (exports.maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000); + CodeGenerator.prototype.generateIterationForStatement = function (operator, stmt, flags) { + var result = ['for' + (stmt.await ? noEmptySpace() + 'await' : '') + space + '('], that = this; + withIndent(function () { + if (stmt.left.type === Syntax.VariableDeclaration) { + withIndent(function () { + result.push(stmt.left.kind + noEmptySpace()); + result.push(that.generateStatement(stmt.left.declarations[0], S_FFFF)); + }); + } else { + result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT)); + } -/** - * @constant - * @name minTime - * @summary Minimum allowed time. - * - * @example - * import { minTime } from "date-fns/constants"; - * - * const isValid = -8640000000000001 >= minTime; - * //=> false - * - * new Date(-8640000000000001) - * //=> Invalid Date - */ -const minTime = (exports.minTime = -maxTime); + result = join(result, operator); + result = [join( + result, + that.generateExpression(stmt.right, Precedence.Assignment, E_TTT) + ), ')']; + }); + result.push(this.maybeBlock(stmt.body, flags)); + return result; + }; -/** - * @constant - * @name millisecondsInWeek - * @summary Milliseconds in 1 week. - */ -const millisecondsInWeek = (exports.millisecondsInWeek = 604800000); + CodeGenerator.prototype.generatePropertyKey = function (expr, computed) { + var result = []; -/** - * @constant - * @name millisecondsInDay - * @summary Milliseconds in 1 day. - */ -const millisecondsInDay = (exports.millisecondsInDay = 86400000); - -/** - * @constant - * @name millisecondsInMinute - * @summary Milliseconds in 1 minute - */ -const millisecondsInMinute = (exports.millisecondsInMinute = 60000); + if (computed) { + result.push('['); + } -/** - * @constant - * @name millisecondsInHour - * @summary Milliseconds in 1 hour - */ -const millisecondsInHour = (exports.millisecondsInHour = 3600000); + result.push(this.generateExpression(expr, Precedence.Assignment, E_TTT)); -/** - * @constant - * @name millisecondsInSecond - * @summary Milliseconds in 1 second - */ -const millisecondsInSecond = (exports.millisecondsInSecond = 1000); + if (computed) { + result.push(']'); + } -/** - * @constant - * @name minutesInYear - * @summary Minutes in 1 year. - */ -const minutesInYear = (exports.minutesInYear = 525600); + return result; + }; -/** - * @constant - * @name minutesInMonth - * @summary Minutes in 1 month. - */ -const minutesInMonth = (exports.minutesInMonth = 43200); + CodeGenerator.prototype.generateAssignment = function (left, right, operator, precedence, flags) { + if (Precedence.Assignment < precedence) { + flags |= F_ALLOW_IN; + } -/** - * @constant - * @name minutesInDay - * @summary Minutes in 1 day. - */ -const minutesInDay = (exports.minutesInDay = 1440); + return parenthesize( + [ + this.generateExpression(left, Precedence.Call, flags), + space + operator + space, + this.generateExpression(right, Precedence.Assignment, flags) + ], + Precedence.Assignment, + precedence + ); + }; -/** - * @constant - * @name minutesInHour - * @summary Minutes in 1 hour. - */ -const minutesInHour = (exports.minutesInHour = 60); + CodeGenerator.prototype.semicolon = function (flags) { + if (!semicolons && flags & F_SEMICOLON_OPT) { + return ''; + } + return ';'; + }; -/** - * @constant - * @name monthsInQuarter - * @summary Months in 1 quarter. - */ -const monthsInQuarter = (exports.monthsInQuarter = 3); + // Statements. -/** - * @constant - * @name monthsInYear - * @summary Months in 1 year. - */ -const monthsInYear = (exports.monthsInYear = 12); + CodeGenerator.Statement = { -/** - * @constant - * @name quartersInYear - * @summary Quarters in 1 year - */ -const quartersInYear = (exports.quartersInYear = 4); + BlockStatement: function (stmt, flags) { + var range, content, result = ['{', newline], that = this; -/** - * @constant - * @name secondsInHour - * @summary Seconds in 1 hour. - */ -const secondsInHour = (exports.secondsInHour = 3600); + withIndent(function () { + // handle functions without any code + if (stmt.body.length === 0 && preserveBlankLines) { + range = stmt.range; + if (range[1] - range[0] > 2) { + content = sourceCode.substring(range[0] + 1, range[1] - 1); + if (content[0] === '\n') { + result = ['{']; + } + result.push(content); + } + } -/** - * @constant - * @name secondsInMinute - * @summary Seconds in 1 minute. - */ -const secondsInMinute = (exports.secondsInMinute = 60); + var i, iz, fragment, bodyFlags; + bodyFlags = S_TFFF; + if (flags & F_FUNC_BODY) { + bodyFlags |= F_DIRECTIVE_CTX; + } -/** - * @constant - * @name secondsInDay - * @summary Seconds in 1 day. - */ -const secondsInDay = (exports.secondsInDay = secondsInHour * 24); + for (i = 0, iz = stmt.body.length; i < iz; ++i) { + if (preserveBlankLines) { + // handle spaces before the first line + if (i === 0) { + if (stmt.body[0].leadingComments) { + range = stmt.body[0].leadingComments[0].extendedRange; + content = sourceCode.substring(range[0], range[1]); + if (content[0] === '\n') { + result = ['{']; + } + } + if (!stmt.body[0].leadingComments) { + generateBlankLines(stmt.range[0], stmt.body[0].range[0], result); + } + } -/** - * @constant - * @name secondsInWeek - * @summary Seconds in 1 week. - */ -const secondsInWeek = (exports.secondsInWeek = secondsInDay * 7); + // handle spaces between lines + if (i > 0) { + if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) { + generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result); + } + } + } -/** - * @constant - * @name secondsInYear - * @summary Seconds in 1 year. - */ -const secondsInYear = (exports.secondsInYear = secondsInDay * daysInYear); + if (i === iz - 1) { + bodyFlags |= F_SEMICOLON_OPT; + } -/** - * @constant - * @name secondsInMonth - * @summary Seconds in 1 month - */ -const secondsInMonth = (exports.secondsInMonth = secondsInYear / 12); + if (stmt.body[i].leadingComments && preserveBlankLines) { + fragment = that.generateStatement(stmt.body[i], bodyFlags); + } else { + fragment = addIndent(that.generateStatement(stmt.body[i], bodyFlags)); + } -/** - * @constant - * @name secondsInQuarter - * @summary Seconds in 1 quarter. - */ -const secondsInQuarter = (exports.secondsInQuarter = secondsInMonth * 3); + result.push(fragment); + if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { + if (preserveBlankLines && i < iz - 1) { + // don't add a new line if there are leading coments + // in the next statement + if (!stmt.body[i + 1].leadingComments) { + result.push(newline); + } + } else { + result.push(newline); + } + } + if (preserveBlankLines) { + // handle spaces after the last line + if (i === iz - 1) { + if (!stmt.body[i].trailingComments) { + generateBlankLines(stmt.body[i].range[1], stmt.range[1], result); + } + } + } + } + }); -/***/ }), + result.push(addIndent('}')); + return result; + }, -/***/ 92736: -/***/ ((__unused_webpack_module, exports) => { + BreakStatement: function (stmt, flags) { + if (stmt.label) { + return 'break ' + stmt.label.name + this.semicolon(flags); + } + return 'break' + this.semicolon(flags); + }, -"use strict"; + ContinueStatement: function (stmt, flags) { + if (stmt.label) { + return 'continue ' + stmt.label.name + this.semicolon(flags); + } + return 'continue' + this.semicolon(flags); + }, -exports.constructFrom = constructFrom; + ClassBody: function (stmt, flags) { + var result = [ '{', newline], that = this; -/** - * @name constructFrom - * @category Generic Helpers - * @summary Constructs a date using the reference date and the value - * - * @description - * The function constructs a new date using the constructor from the reference - * date and the given value. It helps to build generic functions that accept - * date extensions. - * - * It defaults to `Date` if the passed reference date is a number or a string. - * - * @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). - * - * @param date - The reference date to take constructor from - * @param value - The value to create the date - * - * @returns Date initialized using the given date and value - * - * @example - * import { constructFrom } from 'date-fns' - * - * // A function that clones a date preserving the original type - * function cloneDate { + ClassDeclaration: function (stmt, flags) { + var result, fragment; + result = ['class']; + if (stmt.id) { + result = join(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT)); + } + if (stmt.superClass) { + fragment = join('extends', this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT)); + result = join(result, fragment); + } + result.push(space); + result.push(this.generateStatement(stmt.body, S_TFFT)); + return result; + }, -"use strict"; + DirectiveStatement: function (stmt, flags) { + if (extra.raw && stmt.raw) { + return stmt.raw + this.semicolon(flags); + } + return escapeDirective(stmt.directive) + this.semicolon(flags); + }, -exports.constructNow = constructNow; -var _index = __nccwpck_require__(92736); + DoWhileStatement: function (stmt, flags) { + // Because `do 42 while (cond)` is Syntax Error. We need semicolon. + var result = join('do', this.maybeBlock(stmt.body, S_TFFF)); + result = this.maybeBlockSuffix(stmt.body, result); + return join(result, [ + 'while' + space + '(', + this.generateExpression(stmt.test, Precedence.Sequence, E_TTT), + ')' + this.semicolon(flags) + ]); + }, -/** - * @name constructNow - * @category Generic Helpers - * @summary Constructs a new current date using the passed value constructor. - * @pure false - * - * @description - * The function constructs a new current date using the constructor from - * the reference date. It helps to build generic functions that accept date - * extensions and use the current date. - * - * It defaults to `Date` if the passed reference date is a number or a string. - * - * @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). - * - * @param date - The reference date to take constructor from - * - * @returns Current date initialized using the given date constructor - * - * @example - * import { constructNow, isSameDay } from 'date-fns' - * - * function isToday( - * date: DateType | number | string, - * ): boolean { - * // If we were to use `new Date()` directly, the function would behave - * // differently in different timezones and return false for the same date. - * return isSameDay(date, constructNow(date)); - * } - */ -function constructNow(date) { - return (0, _index.constructFrom)(date, Date.now()); -} + CatchClause: function (stmt, flags) { + var result, that = this; + withIndent(function () { + var guard; + if (stmt.param) { + result = [ + 'catch' + space + '(', + that.generateExpression(stmt.param, Precedence.Sequence, E_TTT), + ')' + ]; -/***/ }), + if (stmt.guard) { + guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT); + result.splice(2, 0, ' if ', guard); + } + } else { + result = ['catch']; + } + }); + result.push(this.maybeBlock(stmt.body, S_TFFF)); + return result; + }, -/***/ 85123: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + DebuggerStatement: function (stmt, flags) { + return 'debugger' + this.semicolon(flags); + }, -"use strict"; + EmptyStatement: function (stmt, flags) { + return ';'; + }, -exports.daysToWeeks = daysToWeeks; -var _index = __nccwpck_require__(17818); + ExportDefaultDeclaration: function (stmt, flags) { + var result = [ 'export' ], bodyFlags; -/** - * @name daysToWeeks - * @category Conversion Helpers - * @summary Convert days to weeks. - * - * @description - * Convert a number of days to a full number of weeks. - * - * @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). - * - * @param days - The number of days to be converted - * - * @returns The number of days converted in weeks - * - * @example - * // Convert 14 days to weeks: - * const result = daysToWeeks(14) - * //=> 2 - * - * @example - * // It uses trunc rounding: - * const result = daysToWeeks(13) - * //=> 1 - */ -function daysToWeeks(days) { - const weeks = days / _index.daysInWeek; - const result = Math.trunc(weeks); - // Prevent negative zero - return result === 0 ? 0 : result; -} + bodyFlags = (flags & F_SEMICOLON_OPT) ? S_TFFT : S_TFFF; + // export default HoistableDeclaration[Default] + // export default AssignmentExpression[In] ; + result = join(result, 'default'); + if (isStatement(stmt.declaration)) { + result = join(result, this.generateStatement(stmt.declaration, bodyFlags)); + } else { + result = join(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags)); + } + return result; + }, -/***/ }), + ExportNamedDeclaration: function (stmt, flags) { + var result = [ 'export' ], bodyFlags, that = this; -/***/ 26753: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + bodyFlags = (flags & F_SEMICOLON_OPT) ? S_TFFT : S_TFFF; -"use strict"; + // export VariableStatement + // export Declaration[Default] + if (stmt.declaration) { + return join(result, this.generateStatement(stmt.declaration, bodyFlags)); + } -exports.differenceInBusinessDays = differenceInBusinessDays; -var _index = __nccwpck_require__(8361); -var _index2 = __nccwpck_require__(90338); -var _index3 = __nccwpck_require__(28512); -var _index4 = __nccwpck_require__(58915); -var _index5 = __nccwpck_require__(45417); -var _index6 = __nccwpck_require__(53622); + // export ExportClause[NoReference] FromClause ; + // export ExportClause ; + if (stmt.specifiers) { + if (stmt.specifiers.length === 0) { + result = join(result, '{' + space + '}'); + } else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) { + result = join(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT)); + } else { + result = join(result, '{'); + withIndent(function (indent) { + var i, iz; + result.push(newline); + for (i = 0, iz = stmt.specifiers.length; i < iz; ++i) { + result.push(indent); + result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)); + if (i + 1 < iz) { + result.push(',' + newline); + } + } + }); + if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result.push(newline); + } + result.push(base + '}'); + } -/** - * @name differenceInBusinessDays - * @category Day Helpers - * @summary Get the number of business days between the given dates. - * - * @description - * Get the number of business day periods between the given dates. - * Business days being days that arent in the weekend. - * Like `differenceInCalendarDays`, the function removes the times from - * the dates before calculating the difference. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of business days - * - * @example - * // How many business days are between - * // 10 January 2014 and 20 July 2014? - * const result = differenceInBusinessDays( - * new Date(2014, 6, 20), - * new Date(2014, 0, 10) - * ) - * //=> 136 - * - * // How many business days are between - * // 30 November 2021 and 1 November 2021? - * const result = differenceInBusinessDays( - * new Date(2021, 10, 30), - * new Date(2021, 10, 1) - * ) - * //=> 21 - * - * // How many business days are between - * // 1 November 2021 and 1 December 2021? - * const result = differenceInBusinessDays( - * new Date(2021, 10, 1), - * new Date(2021, 11, 1) - * ) - * //=> -22 - * - * // How many business days are between - * // 1 November 2021 and 1 November 2021 ? - * const result = differenceInBusinessDays( - * new Date(2021, 10, 1), - * new Date(2021, 10, 1) - * ) - * //=> 0 - */ -function differenceInBusinessDays(dateLeft, dateRight) { - const _dateLeft = (0, _index6.toDate)(dateLeft); - let _dateRight = (0, _index6.toDate)(dateRight); + if (stmt.source) { + result = join(result, [ + 'from' + space, + // ModuleSpecifier + this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), + this.semicolon(flags) + ]); + } else { + result.push(this.semicolon(flags)); + } + } + return result; + }, - if (!(0, _index4.isValid)(_dateLeft) || !(0, _index4.isValid)(_dateRight)) - return NaN; - - const calendarDifference = (0, _index2.differenceInCalendarDays)( - _dateLeft, - _dateRight, - ); - const sign = calendarDifference < 0 ? -1 : 1; + ExportAllDeclaration: function (stmt, flags) { + // export * FromClause ; + return [ + 'export' + space, + '*' + space, + 'from' + space, + // ModuleSpecifier + this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), + this.semicolon(flags) + ]; + }, - const weeks = Math.trunc(calendarDifference / 7); + ExpressionStatement: function (stmt, flags) { + var result, fragment; - let result = weeks * 5; - _dateRight = (0, _index.addDays)(_dateRight, weeks * 7); + function isClassPrefixed(fragment) { + var code; + if (fragment.slice(0, 5) !== 'class') { + return false; + } + code = fragment.charCodeAt(5); + return code === 0x7B /* '{' */ || esutils.code.isWhiteSpace(code) || esutils.code.isLineTerminator(code); + } - // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week - while (!(0, _index3.isSameDay)(_dateLeft, _dateRight)) { - // sign is used to account for both negative and positive differences - result += (0, _index5.isWeekend)(_dateRight) ? 0 : sign; - _dateRight = (0, _index.addDays)(_dateRight, sign); - } + function isFunctionPrefixed(fragment) { + var code; + if (fragment.slice(0, 8) !== 'function') { + return false; + } + code = fragment.charCodeAt(8); + return code === 0x28 /* '(' */ || esutils.code.isWhiteSpace(code) || code === 0x2A /* '*' */ || esutils.code.isLineTerminator(code); + } - // Prevent negative zero - return result === 0 ? 0 : result; -} + function isAsyncPrefixed(fragment) { + var code, i, iz; + if (fragment.slice(0, 5) !== 'async') { + return false; + } + if (!esutils.code.isWhiteSpace(fragment.charCodeAt(5))) { + return false; + } + for (i = 6, iz = fragment.length; i < iz; ++i) { + if (!esutils.code.isWhiteSpace(fragment.charCodeAt(i))) { + break; + } + } + if (i === iz) { + return false; + } + if (fragment.slice(i, i + 8) !== 'function') { + return false; + } + code = fragment.charCodeAt(i + 8); + return code === 0x28 /* '(' */ || esutils.code.isWhiteSpace(code) || code === 0x2A /* '*' */ || esutils.code.isLineTerminator(code); + } + result = [this.generateExpression(stmt.expression, Precedence.Sequence, E_TTT)]; + // 12.4 '{', 'function', 'class' is not allowed in this position. + // wrap expression with parentheses + fragment = toSourceNodeWhenNeeded(result).toString(); + if (fragment.charCodeAt(0) === 0x7B /* '{' */ || // ObjectExpression + isClassPrefixed(fragment) || + isFunctionPrefixed(fragment) || + isAsyncPrefixed(fragment) || + (directive && (flags & F_DIRECTIVE_CTX) && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === 'string')) { + result = ['(', result, ')' + this.semicolon(flags)]; + } else { + result.push(this.semicolon(flags)); + } + return result; + }, -/***/ }), + ImportDeclaration: function (stmt, flags) { + // ES6: 15.2.1 valid import declarations: + // - import ImportClause FromClause ; + // - import ModuleSpecifier ; + var result, cursor, that = this; -/***/ 90338: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // If no ImportClause is present, + // this should be `import ModuleSpecifier` so skip `from` + // ModuleSpecifier is StringLiteral. + if (stmt.specifiers.length === 0) { + // import ModuleSpecifier ; + return [ + 'import', + space, + // ModuleSpecifier + this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), + this.semicolon(flags) + ]; + } -"use strict"; + // import ImportClause FromClause ; + result = [ + 'import' + ]; + cursor = 0; -exports.differenceInCalendarDays = differenceInCalendarDays; -var _index = __nccwpck_require__(17818); -var _index2 = __nccwpck_require__(91310); -var _index3 = __nccwpck_require__(31292); + // ImportedBinding + if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) { + result = join(result, [ + this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT) + ]); + ++cursor; + } -/** - * @name differenceInCalendarDays - * @category Day Helpers - * @summary Get the number of calendar days between the given dates. - * - * @description - * Get the number of calendar days between the given dates. This means that the times are removed - * from the dates and then the difference in days is calculated. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of calendar days - * - * @example - * // How many calendar days are between - * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? - * const result = differenceInCalendarDays( - * new Date(2012, 6, 2, 0, 0), - * new Date(2011, 6, 2, 23, 0) - * ) - * //=> 366 - * // How many calendar days are between - * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? - * const result = differenceInCalendarDays( - * new Date(2011, 6, 3, 0, 1), - * new Date(2011, 6, 2, 23, 59) - * ) - * //=> 1 - */ -function differenceInCalendarDays(dateLeft, dateRight) { - const startOfDayLeft = (0, _index2.startOfDay)(dateLeft); - const startOfDayRight = (0, _index2.startOfDay)(dateRight); + if (stmt.specifiers[cursor]) { + if (cursor !== 0) { + result.push(','); + } - const timestampLeft = - +startOfDayLeft - - (0, _index3.getTimezoneOffsetInMilliseconds)(startOfDayLeft); - const timestampRight = - +startOfDayRight - - (0, _index3.getTimezoneOffsetInMilliseconds)(startOfDayRight); + if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) { + // NameSpaceImport + result = join(result, [ + space, + this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT) + ]); + } else { + // NamedImports + result.push(space + '{'); - // Round the number of days to the nearest integer because the number of - // milliseconds in a day is not constant (e.g. it's different in the week of - // the daylight saving time clock shift). - return Math.round( - (timestampLeft - timestampRight) / _index.millisecondsInDay, - ); -} + if ((stmt.specifiers.length - cursor) === 1) { + // import { ... } from "..."; + result.push(space); + result.push(this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)); + result.push(space + '}' + space); + } else { + // import { + // ..., + // ..., + // } from "..."; + withIndent(function (indent) { + var i, iz; + result.push(newline); + for (i = cursor, iz = stmt.specifiers.length; i < iz; ++i) { + result.push(indent); + result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)); + if (i + 1 < iz) { + result.push(',' + newline); + } + } + }); + if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result.push(newline); + } + result.push(base + '}' + space); + } + } + } + result = join(result, [ + 'from' + space, + // ModuleSpecifier + this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), + this.semicolon(flags) + ]); + return result; + }, -/***/ }), + VariableDeclarator: function (stmt, flags) { + var itemFlags = (flags & F_ALLOW_IN) ? E_TTT : E_FTT; + if (stmt.init) { + return [ + this.generateExpression(stmt.id, Precedence.Assignment, itemFlags), + space, + '=', + space, + this.generateExpression(stmt.init, Precedence.Assignment, itemFlags) + ]; + } + return this.generatePattern(stmt.id, Precedence.Assignment, itemFlags); + }, -/***/ 99321: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + VariableDeclaration: function (stmt, flags) { + // VariableDeclarator is typed as Statement, + // but joined with comma (not LineTerminator). + // So if comment is attached to target node, we should specialize. + var result, i, iz, node, bodyFlags, that = this; -"use strict"; + result = [ stmt.kind ]; -exports.differenceInCalendarISOWeekYears = differenceInCalendarISOWeekYears; -var _index = __nccwpck_require__(90308); + bodyFlags = (flags & F_ALLOW_IN) ? S_TFFF : S_FFFF; -/** - * @name differenceInCalendarISOWeekYears - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of calendar ISO week-numbering years between the given dates. - * - * @description - * Get the number of calendar ISO week-numbering years between the given dates. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of calendar ISO week-numbering years - * - * @example - * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012? - * const result = differenceInCalendarISOWeekYears( - * new Date(2012, 0, 1), - * new Date(2010, 0, 1) - * ) - * //=> 2 - */ -function differenceInCalendarISOWeekYears(dateLeft, dateRight) { - return ( - (0, _index.getISOWeekYear)(dateLeft) - (0, _index.getISOWeekYear)(dateRight) - ); -} + function block() { + node = stmt.declarations[0]; + if (extra.comment && node.leadingComments) { + result.push('\n'); + result.push(addIndent(that.generateStatement(node, bodyFlags))); + } else { + result.push(noEmptySpace()); + result.push(that.generateStatement(node, bodyFlags)); + } + for (i = 1, iz = stmt.declarations.length; i < iz; ++i) { + node = stmt.declarations[i]; + if (extra.comment && node.leadingComments) { + result.push(',' + newline); + result.push(addIndent(that.generateStatement(node, bodyFlags))); + } else { + result.push(',' + space); + result.push(that.generateStatement(node, bodyFlags)); + } + } + } -/***/ }), + if (stmt.declarations.length > 1) { + withIndent(block); + } else { + block(); + } -/***/ 74765: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + result.push(this.semicolon(flags)); -"use strict"; + return result; + }, -exports.differenceInCalendarISOWeeks = differenceInCalendarISOWeeks; -var _index = __nccwpck_require__(17818); -var _index2 = __nccwpck_require__(69709); -var _index3 = __nccwpck_require__(31292); + ThrowStatement: function (stmt, flags) { + return [join( + 'throw', + this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) + ), this.semicolon(flags)]; + }, -/** - * @name differenceInCalendarISOWeeks - * @category ISO Week Helpers - * @summary Get the number of calendar ISO weeks between the given dates. - * - * @description - * Get the number of calendar ISO weeks between the given dates. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of calendar ISO weeks - * - * @example - * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014? - * const result = differenceInCalendarISOWeeks( - * new Date(2014, 6, 21), - * new Date(2014, 6, 6) - * ) - * //=> 3 - */ -function differenceInCalendarISOWeeks(dateLeft, dateRight) { - const startOfISOWeekLeft = (0, _index2.startOfISOWeek)(dateLeft); - const startOfISOWeekRight = (0, _index2.startOfISOWeek)(dateRight); + TryStatement: function (stmt, flags) { + var result, i, iz, guardedHandlers; - const timestampLeft = - +startOfISOWeekLeft - - (0, _index3.getTimezoneOffsetInMilliseconds)(startOfISOWeekLeft); - const timestampRight = - +startOfISOWeekRight - - (0, _index3.getTimezoneOffsetInMilliseconds)(startOfISOWeekRight); + result = ['try', this.maybeBlock(stmt.block, S_TFFF)]; + result = this.maybeBlockSuffix(stmt.block, result); - // Round the number of weeks to the nearest integer because the number of - // milliseconds in a week is not constant (e.g. it's different in the week of - // the daylight saving time clock shift). - return Math.round( - (timestampLeft - timestampRight) / _index.millisecondsInWeek, - ); -} + if (stmt.handlers) { + // old interface + for (i = 0, iz = stmt.handlers.length; i < iz; ++i) { + result = join(result, this.generateStatement(stmt.handlers[i], S_TFFF)); + if (stmt.finalizer || i + 1 !== iz) { + result = this.maybeBlockSuffix(stmt.handlers[i].body, result); + } + } + } else { + guardedHandlers = stmt.guardedHandlers || []; + for (i = 0, iz = guardedHandlers.length; i < iz; ++i) { + result = join(result, this.generateStatement(guardedHandlers[i], S_TFFF)); + if (stmt.finalizer || i + 1 !== iz) { + result = this.maybeBlockSuffix(guardedHandlers[i].body, result); + } + } -/***/ }), + // new interface + if (stmt.handler) { + if (Array.isArray(stmt.handler)) { + for (i = 0, iz = stmt.handler.length; i < iz; ++i) { + result = join(result, this.generateStatement(stmt.handler[i], S_TFFF)); + if (stmt.finalizer || i + 1 !== iz) { + result = this.maybeBlockSuffix(stmt.handler[i].body, result); + } + } + } else { + result = join(result, this.generateStatement(stmt.handler, S_TFFF)); + if (stmt.finalizer) { + result = this.maybeBlockSuffix(stmt.handler.body, result); + } + } + } + } + if (stmt.finalizer) { + result = join(result, ['finally', this.maybeBlock(stmt.finalizer, S_TFFF)]); + } + return result; + }, -/***/ 34939: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + SwitchStatement: function (stmt, flags) { + var result, fragment, i, iz, bodyFlags, that = this; + withIndent(function () { + result = [ + 'switch' + space + '(', + that.generateExpression(stmt.discriminant, Precedence.Sequence, E_TTT), + ')' + space + '{' + newline + ]; + }); + if (stmt.cases) { + bodyFlags = S_TFFF; + for (i = 0, iz = stmt.cases.length; i < iz; ++i) { + if (i === iz - 1) { + bodyFlags |= F_SEMICOLON_OPT; + } + fragment = addIndent(this.generateStatement(stmt.cases[i], bodyFlags)); + result.push(fragment); + if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { + result.push(newline); + } + } + } + result.push(addIndent('}')); + return result; + }, -"use strict"; + SwitchCase: function (stmt, flags) { + var result, fragment, i, iz, bodyFlags, that = this; + withIndent(function () { + if (stmt.test) { + result = [ + join('case', that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)), + ':' + ]; + } else { + result = ['default:']; + } -exports.differenceInCalendarMonths = differenceInCalendarMonths; -var _index = __nccwpck_require__(53622); + i = 0; + iz = stmt.consequent.length; + if (iz && stmt.consequent[0].type === Syntax.BlockStatement) { + fragment = that.maybeBlock(stmt.consequent[0], S_TFFF); + result.push(fragment); + i = 1; + } -/** - * @name differenceInCalendarMonths - * @category Month Helpers - * @summary Get the number of calendar months between the given dates. - * - * @description - * Get the number of calendar months between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of calendar months - * - * @example - * // How many calendar months are between 31 January 2014 and 1 September 2014? - * const result = differenceInCalendarMonths( - * new Date(2014, 8, 1), - * new Date(2014, 0, 31) - * ) - * //=> 8 - */ -function differenceInCalendarMonths(dateLeft, dateRight) { - const _dateLeft = (0, _index.toDate)(dateLeft); - const _dateRight = (0, _index.toDate)(dateRight); + if (i !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result.push(newline); + } - const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear(); - const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth(); + bodyFlags = S_TFFF; + for (; i < iz; ++i) { + if (i === iz - 1 && flags & F_SEMICOLON_OPT) { + bodyFlags |= F_SEMICOLON_OPT; + } + fragment = addIndent(that.generateStatement(stmt.consequent[i], bodyFlags)); + result.push(fragment); + if (i + 1 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { + result.push(newline); + } + } + }); + return result; + }, - return yearDiff * 12 + monthDiff; -} + IfStatement: function (stmt, flags) { + var result, bodyFlags, semicolonOptional, that = this; + withIndent(function () { + result = [ + 'if' + space + '(', + that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), + ')' + ]; + }); + semicolonOptional = flags & F_SEMICOLON_OPT; + bodyFlags = S_TFFF; + if (semicolonOptional) { + bodyFlags |= F_SEMICOLON_OPT; + } + if (stmt.alternate) { + result.push(this.maybeBlock(stmt.consequent, S_TFFF)); + result = this.maybeBlockSuffix(stmt.consequent, result); + if (stmt.alternate.type === Syntax.IfStatement) { + result = join(result, ['else ', this.generateStatement(stmt.alternate, bodyFlags)]); + } else { + result = join(result, join('else', this.maybeBlock(stmt.alternate, bodyFlags))); + } + } else { + result.push(this.maybeBlock(stmt.consequent, bodyFlags)); + } + return result; + }, + ForStatement: function (stmt, flags) { + var result, that = this; + withIndent(function () { + result = ['for' + space + '(']; + if (stmt.init) { + if (stmt.init.type === Syntax.VariableDeclaration) { + result.push(that.generateStatement(stmt.init, S_FFFF)); + } else { + // F_ALLOW_IN becomes false. + result.push(that.generateExpression(stmt.init, Precedence.Sequence, E_FTT)); + result.push(';'); + } + } else { + result.push(';'); + } -/***/ }), + if (stmt.test) { + result.push(space); + result.push(that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)); + result.push(';'); + } else { + result.push(';'); + } -/***/ 73599: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (stmt.update) { + result.push(space); + result.push(that.generateExpression(stmt.update, Precedence.Sequence, E_TTT)); + result.push(')'); + } else { + result.push(')'); + } + }); -"use strict"; - -exports.differenceInCalendarQuarters = differenceInCalendarQuarters; -var _index = __nccwpck_require__(2243); -var _index2 = __nccwpck_require__(53622); + result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); + return result; + }, -/** - * @name differenceInCalendarQuarters - * @category Quarter Helpers - * @summary Get the number of calendar quarters between the given dates. - * - * @description - * Get the number of calendar quarters between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + ForInStatement: function (stmt, flags) { + return this.generateIterationForStatement('in', stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); + }, - * @returns The number of calendar quarters - * - * @example - * // How many calendar quarters are between 31 December 2013 and 2 July 2014? - * const result = differenceInCalendarQuarters( - * new Date(2014, 6, 2), - * new Date(2013, 11, 31) - * ) - * //=> 3 - */ -function differenceInCalendarQuarters(dateLeft, dateRight) { - const _dateLeft = (0, _index2.toDate)(dateLeft); - const _dateRight = (0, _index2.toDate)(dateRight); + ForOfStatement: function (stmt, flags) { + return this.generateIterationForStatement('of', stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); + }, - const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear(); - const quarterDiff = - (0, _index.getQuarter)(_dateLeft) - (0, _index.getQuarter)(_dateRight); + LabeledStatement: function (stmt, flags) { + return [stmt.label.name + ':', this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)]; + }, - return yearDiff * 4 + quarterDiff; -} + Program: function (stmt, flags) { + var result, fragment, i, iz, bodyFlags; + iz = stmt.body.length; + result = [safeConcatenation && iz > 0 ? '\n' : '']; + bodyFlags = S_TFTF; + for (i = 0; i < iz; ++i) { + if (!safeConcatenation && i === iz - 1) { + bodyFlags |= F_SEMICOLON_OPT; + } + if (preserveBlankLines) { + // handle spaces before the first line + if (i === 0) { + if (!stmt.body[0].leadingComments) { + generateBlankLines(stmt.range[0], stmt.body[i].range[0], result); + } + } -/***/ }), + // handle spaces between lines + if (i > 0) { + if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) { + generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result); + } + } + } -/***/ 21538: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + fragment = addIndent(this.generateStatement(stmt.body[i], bodyFlags)); + result.push(fragment); + if (i + 1 < iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { + if (preserveBlankLines) { + if (!stmt.body[i + 1].leadingComments) { + result.push(newline); + } + } else { + result.push(newline); + } + } -"use strict"; + if (preserveBlankLines) { + // handle spaces after the last line + if (i === iz - 1) { + if (!stmt.body[i].trailingComments) { + generateBlankLines(stmt.body[i].range[1], stmt.range[1], result); + } + } + } + } + return result; + }, -exports.differenceInCalendarWeeks = differenceInCalendarWeeks; -var _index = __nccwpck_require__(17818); -var _index2 = __nccwpck_require__(26068); + FunctionDeclaration: function (stmt, flags) { + return [ + generateAsyncPrefix(stmt, true), + 'function', + generateStarSuffix(stmt) || noEmptySpace(), + stmt.id ? generateIdentifier(stmt.id) : '', + this.generateFunctionBody(stmt) + ]; + }, -var _index3 = __nccwpck_require__(31292); + ReturnStatement: function (stmt, flags) { + if (stmt.argument) { + return [join( + 'return', + this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) + ), this.semicolon(flags)]; + } + return ['return' + this.semicolon(flags)]; + }, -/** - * The {@link differenceInCalendarWeeks} function options. - */ + WhileStatement: function (stmt, flags) { + var result, that = this; + withIndent(function () { + result = [ + 'while' + space + '(', + that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), + ')' + ]; + }); + result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); + return result; + }, -/** - * @name differenceInCalendarWeeks - * @category Week Helpers - * @summary Get the number of calendar weeks between the given dates. - * - * @description - * Get the number of calendar weeks between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * @param options - An object with options. - * - * @returns The number of calendar weeks - * - * @example - * // How many calendar weeks are between 5 July 2014 and 20 July 2014? - * const result = differenceInCalendarWeeks( - * new Date(2014, 6, 20), - * new Date(2014, 6, 5) - * ) - * //=> 3 - * - * @example - * // If the week starts on Monday, - * // how many calendar weeks are between 5 July 2014 and 20 July 2014? - * const result = differenceInCalendarWeeks( - * new Date(2014, 6, 20), - * new Date(2014, 6, 5), - * { weekStartsOn: 1 } - * ) - * //=> 2 - */ -function differenceInCalendarWeeks(dateLeft, dateRight, options) { - const startOfWeekLeft = (0, _index2.startOfWeek)(dateLeft, options); - const startOfWeekRight = (0, _index2.startOfWeek)(dateRight, options); + WithStatement: function (stmt, flags) { + var result, that = this; + withIndent(function () { + result = [ + 'with' + space + '(', + that.generateExpression(stmt.object, Precedence.Sequence, E_TTT), + ')' + ]; + }); + result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); + return result; + } - const timestampLeft = - +startOfWeekLeft - - (0, _index3.getTimezoneOffsetInMilliseconds)(startOfWeekLeft); - const timestampRight = - +startOfWeekRight - - (0, _index3.getTimezoneOffsetInMilliseconds)(startOfWeekRight); + }; - // Round the number of days to the nearest integer because the number of - // milliseconds in a days is not constant (e.g. it's different in the week of - // the daylight saving time clock shift). - return Math.round( - (timestampLeft - timestampRight) / _index.millisecondsInWeek, - ); -} + merge(CodeGenerator.prototype, CodeGenerator.Statement); + // Expressions. -/***/ }), + CodeGenerator.Expression = { -/***/ 36143: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + SequenceExpression: function (expr, precedence, flags) { + var result, i, iz; + if (Precedence.Sequence < precedence) { + flags |= F_ALLOW_IN; + } + result = []; + for (i = 0, iz = expr.expressions.length; i < iz; ++i) { + result.push(this.generateExpression(expr.expressions[i], Precedence.Assignment, flags)); + if (i + 1 < iz) { + result.push(',' + space); + } + } + return parenthesize(result, Precedence.Sequence, precedence); + }, -"use strict"; + AssignmentExpression: function (expr, precedence, flags) { + return this.generateAssignment(expr.left, expr.right, expr.operator, precedence, flags); + }, -exports.differenceInCalendarYears = differenceInCalendarYears; -var _index = __nccwpck_require__(53622); + ArrowFunctionExpression: function (expr, precedence, flags) { + return parenthesize(this.generateFunctionBody(expr), Precedence.ArrowFunction, precedence); + }, -/** - * @name differenceInCalendarYears - * @category Year Helpers - * @summary Get the number of calendar years between the given dates. - * - * @description - * Get the number of calendar years between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + ConditionalExpression: function (expr, precedence, flags) { + if (Precedence.Conditional < precedence) { + flags |= F_ALLOW_IN; + } + return parenthesize( + [ + this.generateExpression(expr.test, Precedence.Coalesce, flags), + space + '?' + space, + this.generateExpression(expr.consequent, Precedence.Assignment, flags), + space + ':' + space, + this.generateExpression(expr.alternate, Precedence.Assignment, flags) + ], + Precedence.Conditional, + precedence + ); + }, - * @returns The number of calendar years - * - * @example - * // How many calendar years are between 31 December 2013 and 11 February 2015? - * const result = differenceInCalendarYears( - * new Date(2015, 1, 11), - * new Date(2013, 11, 31) - * ) - * //=> 2 - */ -function differenceInCalendarYears(dateLeft, dateRight) { - const _dateLeft = (0, _index.toDate)(dateLeft); - const _dateRight = (0, _index.toDate)(dateRight); + LogicalExpression: function (expr, precedence, flags) { + if (expr.operator === '??') { + flags |= F_FOUND_COALESCE; + } + return this.BinaryExpression(expr, precedence, flags); + }, - return _dateLeft.getFullYear() - _dateRight.getFullYear(); -} + BinaryExpression: function (expr, precedence, flags) { + var result, leftPrecedence, rightPrecedence, currentPrecedence, fragment, leftSource; + currentPrecedence = BinaryPrecedence[expr.operator]; + leftPrecedence = expr.operator === '**' ? Precedence.Postfix : currentPrecedence; + rightPrecedence = expr.operator === '**' ? currentPrecedence : currentPrecedence + 1; + if (currentPrecedence < precedence) { + flags |= F_ALLOW_IN; + } -/***/ }), + fragment = this.generateExpression(expr.left, leftPrecedence, flags); -/***/ 96605: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + leftSource = fragment.toString(); -"use strict"; + if (leftSource.charCodeAt(leftSource.length - 1) === 0x2F /* / */ && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) { + result = [fragment, noEmptySpace(), expr.operator]; + } else { + result = join(fragment, expr.operator); + } -exports.differenceInDays = differenceInDays; -var _index = __nccwpck_require__(90338); -var _index2 = __nccwpck_require__(53622); + fragment = this.generateExpression(expr.right, rightPrecedence, flags); -/** - * @name differenceInDays - * @category Day Helpers - * @summary Get the number of full days between the given dates. - * - * @description - * Get the number of full day periods between two dates. Fractional days are - * truncated towards zero. - * - * One "full day" is the distance between a local time in one day to the same - * local time on the next or previous day. A full day can sometimes be less than - * or more than 24 hours if a daylight savings change happens between two dates. - * - * To ignore DST and only measure exact 24-hour periods, use this instead: - * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of full days according to the local timezone - * - * @example - * // How many full days are between - * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? - * const result = differenceInDays( - * new Date(2012, 6, 2, 0, 0), - * new Date(2011, 6, 2, 23, 0) - * ) - * //=> 365 - * - * @example - * // How many full days are between - * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? - * const result = differenceInDays( - * new Date(2011, 6, 3, 0, 1), - * new Date(2011, 6, 2, 23, 59) - * ) - * //=> 0 - * - * @example - * // How many full days are between - * // 1 March 2020 0:00 and 1 June 2020 0:00 ? - * // Note: because local time is used, the - * // result will always be 92 days, even in - * // time zones where DST starts and the - * // period has only 92*24-1 hours. - * const result = differenceInDays( - * new Date(2020, 5, 1), - * new Date(2020, 2, 1) - * ) - * //=> 92 - */ -function differenceInDays(dateLeft, dateRight) { - const _dateLeft = (0, _index2.toDate)(dateLeft); - const _dateRight = (0, _index2.toDate)(dateRight); + if (expr.operator === '/' && fragment.toString().charAt(0) === '/' || + expr.operator.slice(-1) === '<' && fragment.toString().slice(0, 3) === '!--') { + // If '/' concats with '/' or `<` concats with `!--`, it is interpreted as comment start + result.push(noEmptySpace()); + result.push(fragment); + } else { + result = join(result, fragment); + } - const sign = compareLocalAsc(_dateLeft, _dateRight); - const difference = Math.abs( - (0, _index.differenceInCalendarDays)(_dateLeft, _dateRight), - ); + if (expr.operator === 'in' && !(flags & F_ALLOW_IN)) { + return ['(', result, ')']; + } + if ((expr.operator === '||' || expr.operator === '&&') && (flags & F_FOUND_COALESCE)) { + return ['(', result, ')']; + } + return parenthesize(result, currentPrecedence, precedence); + }, - _dateLeft.setDate(_dateLeft.getDate() - sign * difference); + CallExpression: function (expr, precedence, flags) { + var result, i, iz; - // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full - // If so, result must be decreased by 1 in absolute value - const isLastDayNotFull = Number( - compareLocalAsc(_dateLeft, _dateRight) === -sign, - ); - const result = sign * (difference - isLastDayNotFull); - // Prevent negative zero - return result === 0 ? 0 : result; -} + // F_ALLOW_UNPARATH_NEW becomes false. + result = [this.generateExpression(expr.callee, Precedence.Call, E_TTF)]; -// Like `compareAsc` but uses local time not UTC, which is needed -// for accurate equality comparisons of UTC timestamps that end up -// having the same representation in local time, e.g. one hour before -// DST ends vs. the instant that DST ends. -function compareLocalAsc(dateLeft, dateRight) { - const diff = - dateLeft.getFullYear() - dateRight.getFullYear() || - dateLeft.getMonth() - dateRight.getMonth() || - dateLeft.getDate() - dateRight.getDate() || - dateLeft.getHours() - dateRight.getHours() || - dateLeft.getMinutes() - dateRight.getMinutes() || - dateLeft.getSeconds() - dateRight.getSeconds() || - dateLeft.getMilliseconds() - dateRight.getMilliseconds(); - - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; - // Return 0 if diff is 0; return NaN if diff is NaN - } else { - return diff; - } -} + if (expr.optional) { + result.push('?.'); + } + result.push('('); + for (i = 0, iz = expr['arguments'].length; i < iz; ++i) { + result.push(this.generateExpression(expr['arguments'][i], Precedence.Assignment, E_TTT)); + if (i + 1 < iz) { + result.push(',' + space); + } + } + result.push(')'); -/***/ }), + if (!(flags & F_ALLOW_CALL)) { + return ['(', result, ')']; + } -/***/ 37407: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return parenthesize(result, Precedence.Call, precedence); + }, -"use strict"; + ChainExpression: function (expr, precedence, flags) { + if (Precedence.OptionalChaining < precedence) { + flags |= F_ALLOW_CALL; + } -exports.differenceInHours = differenceInHours; -var _index = __nccwpck_require__(21639); -var _index2 = __nccwpck_require__(17818); -var _index3 = __nccwpck_require__(95654); + var result = this.generateExpression(expr.expression, Precedence.OptionalChaining, flags); -/** - * The {@link differenceInHours} function options. - */ + return parenthesize(result, Precedence.OptionalChaining, precedence); + }, -/** - * @name differenceInHours - * @category Hour Helpers - * @summary Get the number of hours between the given dates. - * - * @description - * Get the number of hours between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * @param options - An object with options. - * - * @returns The number of hours - * - * @example - * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00? - * const result = differenceInHours( - * new Date(2014, 6, 2, 19, 0), - * new Date(2014, 6, 2, 6, 50) - * ) - * //=> 12 - */ -function differenceInHours(dateLeft, dateRight, options) { - const diff = - (0, _index3.differenceInMilliseconds)(dateLeft, dateRight) / - _index2.millisecondsInHour; - return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); -} + NewExpression: function (expr, precedence, flags) { + var result, length, i, iz, itemFlags; + length = expr['arguments'].length; + // F_ALLOW_CALL becomes false. + // F_ALLOW_UNPARATH_NEW may become false. + itemFlags = (flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0) ? E_TFT : E_TFF; -/***/ }), + result = join( + 'new', + this.generateExpression(expr.callee, Precedence.New, itemFlags) + ); -/***/ 797: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (!(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) { + result.push('('); + for (i = 0, iz = length; i < iz; ++i) { + result.push(this.generateExpression(expr['arguments'][i], Precedence.Assignment, E_TTT)); + if (i + 1 < iz) { + result.push(',' + space); + } + } + result.push(')'); + } -"use strict"; + return parenthesize(result, Precedence.New, precedence); + }, -exports.differenceInISOWeekYears = differenceInISOWeekYears; -var _index = __nccwpck_require__(76125); -var _index2 = __nccwpck_require__(99321); -var _index3 = __nccwpck_require__(34118); -var _index4 = __nccwpck_require__(53622); + MemberExpression: function (expr, precedence, flags) { + var result, fragment; -/** - * @name differenceInISOWeekYears - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of full ISO week-numbering years between the given dates. - * - * @description - * Get the number of full ISO week-numbering years between the given dates. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of full ISO week-numbering years - * - * @example - * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012? - * const result = differenceInISOWeekYears( - * new Date(2012, 0, 1), - * new Date(2010, 0, 1) - * ) - * //=> 1 - */ -function differenceInISOWeekYears(dateLeft, dateRight) { - let _dateLeft = (0, _index4.toDate)(dateLeft); - const _dateRight = (0, _index4.toDate)(dateRight); + // F_ALLOW_UNPARATH_NEW becomes false. + result = [this.generateExpression(expr.object, Precedence.Call, (flags & F_ALLOW_CALL) ? E_TTF : E_TFF)]; - const sign = (0, _index.compareAsc)(_dateLeft, _dateRight); - const difference = Math.abs( - (0, _index2.differenceInCalendarISOWeekYears)(_dateLeft, _dateRight), - ); - _dateLeft = (0, _index3.subISOWeekYears)(_dateLeft, sign * difference); + if (expr.computed) { + if (expr.optional) { + result.push('?.'); + } - // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1 - // if last calendar ISO year is not full - // If so, result must be decreased by 1 in absolute value - const isLastISOWeekYearNotFull = Number( - (0, _index.compareAsc)(_dateLeft, _dateRight) === -sign, - ); - const result = sign * (difference - isLastISOWeekYearNotFull); - // Prevent negative zero - return result === 0 ? 0 : result; -} + result.push('['); + result.push(this.generateExpression(expr.property, Precedence.Sequence, flags & F_ALLOW_CALL ? E_TTT : E_TFT)); + result.push(']'); + } else { + if (!expr.optional && expr.object.type === Syntax.Literal && typeof expr.object.value === 'number') { + fragment = toSourceNodeWhenNeeded(result).toString(); + // When the following conditions are all true, + // 1. No floating point + // 2. Don't have exponents + // 3. The last character is a decimal digit + // 4. Not hexadecimal OR octal number literal + // we should add a floating point. + if ( + fragment.indexOf('.') < 0 && + !/[eExX]/.test(fragment) && + esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && + !(fragment.length >= 2 && fragment.charCodeAt(0) === 48) // '0' + ) { + result.push(' '); + } + } + result.push(expr.optional ? '?.' : '.'); + result.push(generateIdentifier(expr.property)); + } + return parenthesize(result, Precedence.Member, precedence); + }, -/***/ }), - -/***/ 95654: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + MetaProperty: function (expr, precedence, flags) { + var result; + result = []; + result.push(typeof expr.meta === "string" ? expr.meta : generateIdentifier(expr.meta)); + result.push('.'); + result.push(typeof expr.property === "string" ? expr.property : generateIdentifier(expr.property)); + return parenthesize(result, Precedence.Member, precedence); + }, -"use strict"; + UnaryExpression: function (expr, precedence, flags) { + var result, fragment, rightCharCode, leftSource, leftCharCode; + fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT); -exports.differenceInMilliseconds = differenceInMilliseconds; -var _index = __nccwpck_require__(53622); + if (space === '') { + result = join(expr.operator, fragment); + } else { + result = [expr.operator]; + if (expr.operator.length > 2) { + // delete, void, typeof + // get `typeof []`, not `typeof[]` + result = join(result, fragment); + } else { + // Prevent inserting spaces between operator and argument if it is unnecessary + // like, `!cond` + leftSource = toSourceNodeWhenNeeded(result).toString(); + leftCharCode = leftSource.charCodeAt(leftSource.length - 1); + rightCharCode = fragment.toString().charCodeAt(0); -/** - * @name differenceInMilliseconds - * @category Millisecond Helpers - * @summary Get the number of milliseconds between the given dates. - * - * @description - * Get the number of milliseconds between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of milliseconds - * - * @example - * // How many milliseconds are between - * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700? - * const result = differenceInMilliseconds( - * new Date(2014, 6, 2, 12, 30, 21, 700), - * new Date(2014, 6, 2, 12, 30, 20, 600) - * ) - * //=> 1100 - */ -function differenceInMilliseconds(dateLeft, dateRight) { - return +(0, _index.toDate)(dateLeft) - +(0, _index.toDate)(dateRight); -} + if (((leftCharCode === 0x2B /* + */ || leftCharCode === 0x2D /* - */) && leftCharCode === rightCharCode) || + (esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode))) { + result.push(noEmptySpace()); + result.push(fragment); + } else { + result.push(fragment); + } + } + } + return parenthesize(result, Precedence.Unary, precedence); + }, + YieldExpression: function (expr, precedence, flags) { + var result; + if (expr.delegate) { + result = 'yield*'; + } else { + result = 'yield'; + } + if (expr.argument) { + result = join( + result, + this.generateExpression(expr.argument, Precedence.Yield, E_TTT) + ); + } + return parenthesize(result, Precedence.Yield, precedence); + }, -/***/ }), + AwaitExpression: function (expr, precedence, flags) { + var result = join( + expr.all ? 'await*' : 'await', + this.generateExpression(expr.argument, Precedence.Await, E_TTT) + ); + return parenthesize(result, Precedence.Await, precedence); + }, -/***/ 26235: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + UpdateExpression: function (expr, precedence, flags) { + if (expr.prefix) { + return parenthesize( + [ + expr.operator, + this.generateExpression(expr.argument, Precedence.Unary, E_TTT) + ], + Precedence.Unary, + precedence + ); + } + return parenthesize( + [ + this.generateExpression(expr.argument, Precedence.Postfix, E_TTT), + expr.operator + ], + Precedence.Postfix, + precedence + ); + }, -"use strict"; + FunctionExpression: function (expr, precedence, flags) { + var result = [ + generateAsyncPrefix(expr, true), + 'function' + ]; + if (expr.id) { + result.push(generateStarSuffix(expr) || noEmptySpace()); + result.push(generateIdentifier(expr.id)); + } else { + result.push(generateStarSuffix(expr) || space); + } + result.push(this.generateFunctionBody(expr)); + return result; + }, -exports.differenceInMinutes = differenceInMinutes; -var _index = __nccwpck_require__(21639); -var _index2 = __nccwpck_require__(17818); -var _index3 = __nccwpck_require__(95654); + ArrayPattern: function (expr, precedence, flags) { + return this.ArrayExpression(expr, precedence, flags, true); + }, -/** - * The {@link differenceInMinutes} function options. - */ + ArrayExpression: function (expr, precedence, flags, isPattern) { + var result, multiline, that = this; + if (!expr.elements.length) { + return '[]'; + } + multiline = isPattern ? false : expr.elements.length > 1; + result = ['[', multiline ? newline : '']; + withIndent(function (indent) { + var i, iz; + for (i = 0, iz = expr.elements.length; i < iz; ++i) { + if (!expr.elements[i]) { + if (multiline) { + result.push(indent); + } + if (i + 1 === iz) { + result.push(','); + } + } else { + result.push(multiline ? indent : ''); + result.push(that.generateExpression(expr.elements[i], Precedence.Assignment, E_TTT)); + } + if (i + 1 < iz) { + result.push(',' + (multiline ? newline : space)); + } + } + }); + if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result.push(newline); + } + result.push(multiline ? base : ''); + result.push(']'); + return result; + }, -/** - * @name differenceInMinutes - * @category Minute Helpers - * @summary Get the number of minutes between the given dates. - * - * @description - * Get the signed number of full (rounded towards 0) minutes between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * @param options - An object with options. - * - * @returns The number of minutes - * - * @example - * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00? - * const result = differenceInMinutes( - * new Date(2014, 6, 2, 12, 20, 0), - * new Date(2014, 6, 2, 12, 7, 59) - * ) - * //=> 12 - * - * @example - * // How many minutes are between 10:01:59 and 10:00:00 - * const result = differenceInMinutes( - * new Date(2000, 0, 1, 10, 0, 0), - * new Date(2000, 0, 1, 10, 1, 59) - * ) - * //=> -1 - */ -function differenceInMinutes(dateLeft, dateRight, options) { - const diff = - (0, _index3.differenceInMilliseconds)(dateLeft, dateRight) / - _index2.millisecondsInMinute; - return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); -} + RestElement: function(expr, precedence, flags) { + return '...' + this.generatePattern(expr.argument); + }, + ClassExpression: function (expr, precedence, flags) { + var result, fragment; + result = ['class']; + if (expr.id) { + result = join(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT)); + } + if (expr.superClass) { + fragment = join('extends', this.generateExpression(expr.superClass, Precedence.Unary, E_TTT)); + result = join(result, fragment); + } + result.push(space); + result.push(this.generateStatement(expr.body, S_TFFT)); + return result; + }, -/***/ }), + MethodDefinition: function (expr, precedence, flags) { + var result, fragment; + if (expr['static']) { + result = ['static' + space]; + } else { + result = []; + } + if (expr.kind === 'get' || expr.kind === 'set') { + fragment = [ + join(expr.kind, this.generatePropertyKey(expr.key, expr.computed)), + this.generateFunctionBody(expr.value) + ]; + } else { + fragment = [ + generateMethodPrefix(expr), + this.generatePropertyKey(expr.key, expr.computed), + this.generateFunctionBody(expr.value) + ]; + } + return join(result, fragment); + }, -/***/ 13045: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + Property: function (expr, precedence, flags) { + if (expr.kind === 'get' || expr.kind === 'set') { + return [ + expr.kind, noEmptySpace(), + this.generatePropertyKey(expr.key, expr.computed), + this.generateFunctionBody(expr.value) + ]; + } -"use strict"; + if (expr.shorthand) { + if (expr.value.type === "AssignmentPattern") { + return this.AssignmentPattern(expr.value, Precedence.Sequence, E_TTT); + } + return this.generatePropertyKey(expr.key, expr.computed); + } -exports.differenceInMonths = differenceInMonths; -var _index = __nccwpck_require__(76125); -var _index2 = __nccwpck_require__(34939); -var _index3 = __nccwpck_require__(5894); -var _index4 = __nccwpck_require__(53622); + if (expr.method) { + return [ + generateMethodPrefix(expr), + this.generatePropertyKey(expr.key, expr.computed), + this.generateFunctionBody(expr.value) + ]; + } -/** - * @name differenceInMonths - * @category Month Helpers - * @summary Get the number of full months between the given dates. - * - * @description - * Get the number of full months between the given dates using trunc as a default rounding method. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of full months - * - * @example - * // How many full months are between 31 January 2014 and 1 September 2014? - * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) - * //=> 7 - */ -function differenceInMonths(dateLeft, dateRight) { - const _dateLeft = (0, _index4.toDate)(dateLeft); - const _dateRight = (0, _index4.toDate)(dateRight); + return [ + this.generatePropertyKey(expr.key, expr.computed), + ':' + space, + this.generateExpression(expr.value, Precedence.Assignment, E_TTT) + ]; + }, - const sign = (0, _index.compareAsc)(_dateLeft, _dateRight); - const difference = Math.abs( - (0, _index2.differenceInCalendarMonths)(_dateLeft, _dateRight), - ); - let result; + ObjectExpression: function (expr, precedence, flags) { + var multiline, result, fragment, that = this; - // Check for the difference of less than month - if (difference < 1) { - result = 0; - } else { - if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) { - // This will check if the date is end of Feb and assign a higher end of month date - // to compare it with Jan - _dateLeft.setDate(30); - } + if (!expr.properties.length) { + return '{}'; + } + multiline = expr.properties.length > 1; - _dateLeft.setMonth(_dateLeft.getMonth() - sign * difference); + withIndent(function () { + fragment = that.generateExpression(expr.properties[0], Precedence.Sequence, E_TTT); + }); - // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full - // If so, result must be decreased by 1 in absolute value - let isLastMonthNotFull = - (0, _index.compareAsc)(_dateLeft, _dateRight) === -sign; + if (!multiline) { + // issues 4 + // Do not transform from + // dejavu.Class.declare({ + // method2: function () {} + // }); + // to + // dejavu.Class.declare({method2: function () { + // }}); + if (!hasLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { + return [ '{', space, fragment, space, '}' ]; + } + } - // Check for cases of one full calendar month - if ( - (0, _index3.isLastDayOfMonth)((0, _index4.toDate)(dateLeft)) && - difference === 1 && - (0, _index.compareAsc)(dateLeft, _dateRight) === 1 - ) { - isLastMonthNotFull = false; - } + withIndent(function (indent) { + var i, iz; + result = [ '{', newline, indent, fragment ]; - result = sign * (difference - Number(isLastMonthNotFull)); - } + if (multiline) { + result.push(',' + newline); + for (i = 1, iz = expr.properties.length; i < iz; ++i) { + result.push(indent); + result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT)); + if (i + 1 < iz) { + result.push(',' + newline); + } + } + } + }); - // Prevent negative zero - return result === 0 ? 0 : result; -} + if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result.push(newline); + } + result.push(base); + result.push('}'); + return result; + }, + AssignmentPattern: function(expr, precedence, flags) { + return this.generateAssignment(expr.left, expr.right, '=', precedence, flags); + }, -/***/ }), + ObjectPattern: function (expr, precedence, flags) { + var result, i, iz, multiline, property, that = this; + if (!expr.properties.length) { + return '{}'; + } -/***/ 40924: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + multiline = false; + if (expr.properties.length === 1) { + property = expr.properties[0]; + if ( + property.type === Syntax.Property + && property.value.type !== Syntax.Identifier + ) { + multiline = true; + } + } else { + for (i = 0, iz = expr.properties.length; i < iz; ++i) { + property = expr.properties[i]; + if ( + property.type === Syntax.Property + && !property.shorthand + ) { + multiline = true; + break; + } + } + } + result = ['{', multiline ? newline : '' ]; -"use strict"; + withIndent(function (indent) { + var i, iz; + for (i = 0, iz = expr.properties.length; i < iz; ++i) { + result.push(multiline ? indent : ''); + result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT)); + if (i + 1 < iz) { + result.push(',' + (multiline ? newline : space)); + } + } + }); -exports.differenceInQuarters = differenceInQuarters; -var _index = __nccwpck_require__(21639); -var _index2 = __nccwpck_require__(13045); + if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { + result.push(newline); + } + result.push(multiline ? base : ''); + result.push('}'); + return result; + }, -/** - * The {@link differenceInQuarters} function options. - */ + ThisExpression: function (expr, precedence, flags) { + return 'this'; + }, -/** - * @name differenceInQuarters - * @category Quarter Helpers - * @summary Get the number of quarters between the given dates. - * - * @description - * Get the number of quarters between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * @param options - An object with options. - * - * @returns The number of full quarters - * - * @example - * // How many full quarters are between 31 December 2013 and 2 July 2014? - * const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31)) - * //=> 2 - */ -function differenceInQuarters(dateLeft, dateRight, options) { - const diff = (0, _index2.differenceInMonths)(dateLeft, dateRight) / 3; - return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); -} + Super: function (expr, precedence, flags) { + return 'super'; + }, + Identifier: function (expr, precedence, flags) { + return generateIdentifier(expr); + }, -/***/ }), + ImportDefaultSpecifier: function (expr, precedence, flags) { + return generateIdentifier(expr.id || expr.local); + }, -/***/ 14944: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + ImportNamespaceSpecifier: function (expr, precedence, flags) { + var result = ['*']; + var id = expr.id || expr.local; + if (id) { + result.push(space + 'as' + noEmptySpace() + generateIdentifier(id)); + } + return result; + }, -"use strict"; + ImportSpecifier: function (expr, precedence, flags) { + var imported = expr.imported; + var result = [ imported.name ]; + var local = expr.local; + if (local && local.name !== imported.name) { + result.push(noEmptySpace() + 'as' + noEmptySpace() + generateIdentifier(local)); + } + return result; + }, -exports.differenceInSeconds = differenceInSeconds; -var _index = __nccwpck_require__(21639); -var _index2 = __nccwpck_require__(95654); + ExportSpecifier: function (expr, precedence, flags) { + var local = expr.local; + var result = [ local.name ]; + var exported = expr.exported; + if (exported && exported.name !== local.name) { + result.push(noEmptySpace() + 'as' + noEmptySpace() + generateIdentifier(exported)); + } + return result; + }, -/** - * The {@link differenceInSeconds} function options. - */ + Literal: function (expr, precedence, flags) { + var raw; + if (expr.hasOwnProperty('raw') && parse && extra.raw) { + try { + raw = parse(expr.raw).body[0].expression; + if (raw.type === Syntax.Literal) { + if (raw.value === expr.value) { + return expr.raw; + } + } + } catch (e) { + // not use raw property + } + } -/** - * @name differenceInSeconds - * @category Second Helpers - * @summary Get the number of seconds between the given dates. - * - * @description - * Get the number of seconds between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * @param options - An object with options. - * - * @returns The number of seconds - * - * @example - * // How many seconds are between - * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000? - * const result = differenceInSeconds( - * new Date(2014, 6, 2, 12, 30, 20, 0), - * new Date(2014, 6, 2, 12, 30, 7, 999) - * ) - * //=> 12 - */ -function differenceInSeconds(dateLeft, dateRight, options) { - const diff = - (0, _index2.differenceInMilliseconds)(dateLeft, dateRight) / 1000; - return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); -} + if (expr.regex) { + return '/' + expr.regex.pattern + '/' + expr.regex.flags; + } + if (typeof expr.value === 'bigint') { + return expr.value.toString() + 'n'; + } -/***/ }), + // `expr.value` can be null if `expr.bigint` exists. We need to check + // `expr.bigint` first. + if (expr.bigint) { + return expr.bigint + 'n'; + } -/***/ 27488: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (expr.value === null) { + return 'null'; + } -"use strict"; + if (typeof expr.value === 'string') { + return escapeString(expr.value); + } -exports.differenceInWeeks = differenceInWeeks; -var _index = __nccwpck_require__(21639); -var _index2 = __nccwpck_require__(96605); + if (typeof expr.value === 'number') { + return generateNumber(expr.value); + } -/** - * The {@link differenceInWeeks} function options. - */ + if (typeof expr.value === 'boolean') { + return expr.value ? 'true' : 'false'; + } -/** - * @name differenceInWeeks - * @category Week Helpers - * @summary Get the number of full weeks between the given dates. - * - * @description - * Get the number of full weeks between two dates. Fractional weeks are - * truncated towards zero by default. - * - * One "full week" is the distance between a local time in one day to the same - * local time 7 days earlier or later. A full week can sometimes be less than - * or more than 7*24 hours if a daylight savings change happens between two dates. - * - * To ignore DST and only measure exact 7*24-hour periods, use this instead: - * `Math.trunc(differenceInHours(dateLeft, dateRight)/(7*24))|0`. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * @param options - An object with options - * - * @returns The number of full weeks - * - * @example - * // How many full weeks are between 5 July 2014 and 20 July 2014? - * const result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5)) - * //=> 2 - * - * @example - * // How many full weeks are between - * // 1 March 2020 0:00 and 6 June 2020 0:00 ? - * // Note: because local time is used, the - * // result will always be 8 weeks (54 days), - * // even if DST starts and the period has - * // only 54*24-1 hours. - * const result = differenceInWeeks( - * new Date(2020, 5, 1), - * new Date(2020, 2, 6) - * ) - * //=> 8 - */ -function differenceInWeeks(dateLeft, dateRight, options) { - const diff = (0, _index2.differenceInDays)(dateLeft, dateRight) / 7; - return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); -} + return generateRegExp(expr.value); + }, + GeneratorExpression: function (expr, precedence, flags) { + return this.ComprehensionExpression(expr, precedence, flags); + }, -/***/ }), + ComprehensionExpression: function (expr, precedence, flags) { + // GeneratorExpression should be parenthesized with (...), ComprehensionExpression with [...] + // Due to https://bugzilla.mozilla.org/show_bug.cgi?id=883468 position of expr.body can differ in Spidermonkey and ES6 -/***/ 40830: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var result, i, iz, fragment, that = this; + result = (expr.type === Syntax.GeneratorExpression) ? ['('] : ['[']; -"use strict"; + if (extra.moz.comprehensionExpressionStartsWithAssignment) { + fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); + result.push(fragment); + } -exports.differenceInYears = differenceInYears; -var _index = __nccwpck_require__(76125); -var _index2 = __nccwpck_require__(36143); -var _index3 = __nccwpck_require__(53622); + if (expr.blocks) { + withIndent(function () { + for (i = 0, iz = expr.blocks.length; i < iz; ++i) { + fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT); + if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) { + result = join(result, fragment); + } else { + result.push(fragment); + } + } + }); + } -/** - * @name differenceInYears - * @category Year Helpers - * @summary Get the number of full years between the given dates. - * - * @description - * Get the number of full years between the given dates. - * - * @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). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * - * @returns The number of full years - * - * @example - * // How many full years are between 31 December 2013 and 11 February 2015? - * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) - * //=> 1 - */ -function differenceInYears(dateLeft, dateRight) { - const _dateLeft = (0, _index3.toDate)(dateLeft); - const _dateRight = (0, _index3.toDate)(dateRight); + if (expr.filter) { + result = join(result, 'if' + space); + fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT); + result = join(result, [ '(', fragment, ')' ]); + } - const sign = (0, _index.compareAsc)(_dateLeft, _dateRight); - const difference = Math.abs( - (0, _index2.differenceInCalendarYears)(_dateLeft, _dateRight), - ); + if (!extra.moz.comprehensionExpressionStartsWithAssignment) { + fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); - // Set both dates to a valid leap year for accurate comparison when dealing - // with leap days - _dateLeft.setFullYear(1584); - _dateRight.setFullYear(1584); + result = join(result, fragment); + } - // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full - // If so, result must be decreased by 1 in absolute value - const isLastYearNotFull = - (0, _index.compareAsc)(_dateLeft, _dateRight) === -sign; - const result = sign * (difference - +isLastYearNotFull); + result.push((expr.type === Syntax.GeneratorExpression) ? ')' : ']'); + return result; + }, - // Prevent negative zero - return result === 0 ? 0 : result; -} + ComprehensionBlock: function (expr, precedence, flags) { + var fragment; + if (expr.left.type === Syntax.VariableDeclaration) { + fragment = [ + expr.left.kind, noEmptySpace(), + this.generateStatement(expr.left.declarations[0], S_FFFF) + ]; + } else { + fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT); + } + fragment = join(fragment, expr.of ? 'of' : 'in'); + fragment = join(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT)); -/***/ }), + return [ 'for' + space + '(', fragment, ')' ]; + }, -/***/ 82367: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + SpreadElement: function (expr, precedence, flags) { + return [ + '...', + this.generateExpression(expr.argument, Precedence.Assignment, E_TTT) + ]; + }, -"use strict"; + TaggedTemplateExpression: function (expr, precedence, flags) { + var itemFlags = E_TTF; + if (!(flags & F_ALLOW_CALL)) { + itemFlags = E_TFF; + } + var result = [ + this.generateExpression(expr.tag, Precedence.Call, itemFlags), + this.generateExpression(expr.quasi, Precedence.Primary, E_FFT) + ]; + return parenthesize(result, Precedence.TaggedTemplate, precedence); + }, -exports.eachDayOfInterval = eachDayOfInterval; -var _index = __nccwpck_require__(53622); + TemplateElement: function (expr, precedence, flags) { + // Don't use "cooked". Since tagged template can use raw template + // representation. So if we do so, it breaks the script semantics. + return expr.value.raw; + }, -/** - * The {@link eachDayOfInterval} function options. - */ + TemplateLiteral: function (expr, precedence, flags) { + var result, i, iz; + result = [ '`' ]; + for (i = 0, iz = expr.quasis.length; i < iz; ++i) { + result.push(this.generateExpression(expr.quasis[i], Precedence.Primary, E_TTT)); + if (i + 1 < iz) { + result.push('${' + space); + result.push(this.generateExpression(expr.expressions[i], Precedence.Sequence, E_TTT)); + result.push(space + '}'); + } + } + result.push('`'); + return result; + }, -/** - * @name eachDayOfInterval - * @category Interval Helpers - * @summary Return the array of dates within the specified time interval. - * - * @description - * Return the array of dates within the specified time interval. - * - * @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). - * - * @param interval - The interval. - * @param options - An object with options. - * - * @returns The array with starts of days from the day of the interval start to the day of the interval end - * - * @example - * // Each day between 6 October 2014 and 10 October 2014: - * const result = eachDayOfInterval({ - * start: new Date(2014, 9, 6), - * end: new Date(2014, 9, 10) - * }) - * //=> [ - * // Mon Oct 06 2014 00:00:00, - * // Tue Oct 07 2014 00:00:00, - * // Wed Oct 08 2014 00:00:00, - * // Thu Oct 09 2014 00:00:00, - * // Fri Oct 10 2014 00:00:00 - * // ] - */ -function eachDayOfInterval(interval, options) { - const startDate = (0, _index.toDate)(interval.start); - const endDate = (0, _index.toDate)(interval.end); + ModuleSpecifier: function (expr, precedence, flags) { + return this.Literal(expr, precedence, flags); + }, - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - const currentDate = reversed ? endDate : startDate; - currentDate.setHours(0, 0, 0, 0); + ImportExpression: function(expr, precedence, flag) { + return parenthesize([ + 'import(', + this.generateExpression(expr.source, Precedence.Assignment, E_TTT), + ')' + ], Precedence.Call, precedence); + } + }; - let step = options?.step ?? 1; - if (!step) return []; - if (step < 0) { - step = -step; - reversed = !reversed; - } + merge(CodeGenerator.prototype, CodeGenerator.Expression); - const dates = []; + CodeGenerator.prototype.generateExpression = function (expr, precedence, flags) { + var result, type; - while (+currentDate <= endTime) { - dates.push((0, _index.toDate)(currentDate)); - currentDate.setDate(currentDate.getDate() + step); - currentDate.setHours(0, 0, 0, 0); - } + type = expr.type || Syntax.Property; - return reversed ? dates.reverse() : dates; -} + if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) { + return generateVerbatim(expr, precedence); + } + + result = this[type](expr, precedence, flags); -/***/ }), + if (extra.comment) { + result = addComments(expr, result); + } + return toSourceNodeWhenNeeded(result, expr); + }; -/***/ 74086: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + CodeGenerator.prototype.generateStatement = function (stmt, flags) { + var result, + fragment; -"use strict"; + result = this[stmt.type](stmt, flags); -exports.eachHourOfInterval = eachHourOfInterval; -var _index = __nccwpck_require__(89994); -var _index2 = __nccwpck_require__(53622); + // Attach comments -/** - * The {@link eachHourOfInterval} function options. - */ + if (extra.comment) { + result = addComments(stmt, result); + } -/** - * @name eachHourOfInterval - * @category Interval Helpers - * @summary Return the array of hours within the specified time interval. - * - * @description - * Return the array of hours within the specified time interval. - * - * @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). - * - * @param interval - The interval. - * @param options - An object with options. - * - * @returns The array with starts of hours from the hour of the interval start to the hour of the interval end - * - * @example - * // Each hour between 6 October 2014, 12:00 and 6 October 2014, 15:00 - * const result = eachHourOfInterval({ - * start: new Date(2014, 9, 6, 12), - * end: new Date(2014, 9, 6, 15) - * }) - * //=> [ - * // Mon Oct 06 2014 12:00:00, - * // Mon Oct 06 2014 13:00:00, - * // Mon Oct 06 2014 14:00:00, - * // Mon Oct 06 2014 15:00:00 - * // ] - */ -function eachHourOfInterval(interval, options) { - const startDate = (0, _index2.toDate)(interval.start); - const endDate = (0, _index2.toDate)(interval.end); + fragment = toSourceNodeWhenNeeded(result).toString(); + if (stmt.type === Syntax.Program && !safeConcatenation && newline === '' && fragment.charAt(fragment.length - 1) === '\n') { + result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\s+$/, '') : fragment.replace(/\s+$/, ''); + } - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - let currentDate = reversed ? endDate : startDate; - currentDate.setMinutes(0, 0, 0); + return toSourceNodeWhenNeeded(result, stmt); + }; - let step = options?.step ?? 1; - if (!step) return []; - if (step < 0) { - step = -step; - reversed = !reversed; - } + function generateInternal(node) { + var codegen; - const dates = []; + codegen = new CodeGenerator(); + if (isStatement(node)) { + return codegen.generateStatement(node, S_TFFF); + } - while (+currentDate <= endTime) { - dates.push((0, _index2.toDate)(currentDate)); - currentDate = (0, _index.addHours)(currentDate, step); - } + if (isExpression(node)) { + return codegen.generateExpression(node, Precedence.Sequence, E_TTT); + } - return reversed ? dates.reverse() : dates; -} + throw new Error('Unknown node type: ' + node.type); + } + function generate(node, options) { + var defaultOptions = getDefaultOptions(), result, pair; -/***/ }), + if (options != null) { + // Obsolete options + // + // `options.indent` + // `options.base` + // + // Instead of them, we can use `option.format.indent`. + if (typeof options.indent === 'string') { + defaultOptions.format.indent.style = options.indent; + } + if (typeof options.base === 'number') { + defaultOptions.format.indent.base = options.base; + } + options = updateDeeply(defaultOptions, options); + indent = options.format.indent.style; + if (typeof options.base === 'string') { + base = options.base; + } else { + base = stringRepeat(indent, options.format.indent.base); + } + } else { + options = defaultOptions; + indent = options.format.indent.style; + base = stringRepeat(indent, options.format.indent.base); + } + json = options.format.json; + renumber = options.format.renumber; + hexadecimal = json ? false : options.format.hexadecimal; + quotes = json ? 'double' : options.format.quotes; + escapeless = options.format.escapeless; + newline = options.format.newline; + space = options.format.space; + if (options.format.compact) { + newline = space = indent = base = ''; + } + parentheses = options.format.parentheses; + semicolons = options.format.semicolons; + safeConcatenation = options.format.safeConcatenation; + directive = options.directive; + parse = json ? null : options.parse; + sourceMap = options.sourceMap; + sourceCode = options.sourceCode; + preserveBlankLines = options.format.preserveBlankLines && sourceCode !== null; + extra = options; -/***/ 41836: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (sourceMap) { + if (!exports.browser) { + // We assume environment is node.js + // And prevent from including source-map by browserify + SourceNode = (__nccwpck_require__(56594).SourceNode); + } else { + SourceNode = global.sourceMap.SourceNode; + } + } -"use strict"; + result = generateInternal(node); -exports.eachMinuteOfInterval = eachMinuteOfInterval; -var _index = __nccwpck_require__(97231); -var _index2 = __nccwpck_require__(41831); -var _index3 = __nccwpck_require__(53622); + if (!sourceMap) { + pair = {code: result.toString(), map: null}; + return options.sourceMapWithCode ? pair : pair.code; + } -/** - * The {@link eachMinuteOfInterval} function options. - */ -/** - * @name eachMinuteOfInterval - * @category Interval Helpers - * @summary Return the array of minutes within the specified time interval. - * - * @description - * Returns the array of minutes within the specified time interval. - * - * @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). - * - * @param interval - The interval. - * @param options - An object with options. - * - * @returns The array with starts of minutes from the minute of the interval start to the minute of the interval end - * - * @example - * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03 - * const result = eachMinuteOfInterval({ - * start: new Date(2014, 9, 14, 13), - * end: new Date(2014, 9, 14, 13, 3) - * }) - * //=> [ - * // Wed Oct 14 2014 13:00:00, - * // Wed Oct 14 2014 13:01:00, - * // Wed Oct 14 2014 13:02:00, - * // Wed Oct 14 2014 13:03:00 - * // ] - */ -function eachMinuteOfInterval(interval, options) { - const startDate = (0, _index2.startOfMinute)( - (0, _index3.toDate)(interval.start), - ); - const endDate = (0, _index3.toDate)(interval.end); + pair = result.toStringWithSourceMap({ + file: options.file, + sourceRoot: options.sourceMapRoot + }); - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - let currentDate = reversed ? endDate : startDate; + if (options.sourceContent) { + pair.map.setSourceContent(options.sourceMap, + options.sourceContent); + } - let step = options?.step ?? 1; - if (!step) return []; - if (step < 0) { - step = -step; - reversed = !reversed; - } + if (options.sourceMapWithCode) { + return pair; + } - const dates = []; + return pair.map.toString(); + } - while (+currentDate <= endTime) { - dates.push((0, _index3.toDate)(currentDate)); - currentDate = (0, _index.addMinutes)(currentDate, step); - } + FORMAT_MINIFY = { + indent: { + style: '', + base: 0 + }, + renumber: true, + hexadecimal: true, + quotes: 'auto', + escapeless: true, + compact: true, + parentheses: false, + semicolons: false + }; - return reversed ? dates.reverse() : dates; -} + FORMAT_DEFAULTS = getDefaultOptions().format; + + exports.version = __nccwpck_require__(78531).version; + exports.generate = generate; + exports.attachComments = estraverse.attachComments; + exports.Precedence = updateDeeply({}, Precedence); + exports.browser = false; + exports.FORMAT_MINIFY = FORMAT_MINIFY; + exports.FORMAT_DEFAULTS = FORMAT_DEFAULTS; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/***/ 425: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 78823: +/***/ (function(module) { -"use strict"; +(function webpackUniversalModuleDefinition(root, factory) { +/* istanbul ignore next */ + if(true) + module.exports = factory(); + else {} +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; -exports.eachMonthOfInterval = eachMonthOfInterval; -var _index = __nccwpck_require__(53622); +/******/ // The require function +/******/ function __nested_webpack_require_583__(moduleId) { -/** - * The {@link eachMonthOfInterval} function options. - */ +/******/ // Check if module is in cache +/* istanbul ignore if */ +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; -/** - * @name eachMonthOfInterval - * @category Interval Helpers - * @summary Return the array of months within the specified time interval. - * - * @description - * Return the array of months within the specified time interval. - * - * @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). - * - * @param interval - The interval - * - * @returns The array with starts of months from the month of the interval start to the month of the interval end - * - * @example - * // Each month between 6 February 2014 and 10 August 2014: - * const result = eachMonthOfInterval({ - * start: new Date(2014, 1, 6), - * end: new Date(2014, 7, 10) - * }) - * //=> [ - * // Sat Feb 01 2014 00:00:00, - * // Sat Mar 01 2014 00:00:00, - * // Tue Apr 01 2014 00:00:00, - * // Thu May 01 2014 00:00:00, - * // Sun Jun 01 2014 00:00:00, - * // Tue Jul 01 2014 00:00:00, - * // Fri Aug 01 2014 00:00:00 - * // ] - */ -function eachMonthOfInterval(interval, options) { - const startDate = (0, _index.toDate)(interval.start); - const endDate = (0, _index.toDate)(interval.end); - - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - const currentDate = reversed ? endDate : startDate; - currentDate.setHours(0, 0, 0, 0); - currentDate.setDate(1); - - let step = options?.step ?? 1; - if (!step) return []; - if (step < 0) { - step = -step; - reversed = !reversed; - } - - const dates = []; - - while (+currentDate <= endTime) { - dates.push((0, _index.toDate)(currentDate)); - currentDate.setMonth(currentDate.getMonth() + step); - } - - return reversed ? dates.reverse() : dates; -} - - -/***/ }), - -/***/ 87978: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; -exports.eachQuarterOfInterval = eachQuarterOfInterval; -var _index = __nccwpck_require__(17153); -var _index2 = __nccwpck_require__(3148); -var _index3 = __nccwpck_require__(53622); +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_583__); -/** - * The {@link eachQuarterOfInterval} function options. - */ +/******/ // Flag the module as loaded +/******/ module.loaded = true; -/** - * @name eachQuarterOfInterval - * @category Interval Helpers - * @summary Return the array of quarters within the specified time interval. - * - * @description - * Return the array of quarters within the specified time interval. - * - * @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). - * - * @param interval - The interval - * - * @returns The array with starts of quarters from the quarter of the interval start to the quarter of the interval end - * - * @example - * // Each quarter within interval 6 February 2014 - 10 August 2014: - * const result = eachQuarterOfInterval({ - * start: new Date(2014, 1, 6), - * end: new Date(2014, 7, 10) - * }) - * //=> [ - * // Wed Jan 01 2014 00:00:00, - * // Tue Apr 01 2014 00:00:00, - * // Tue Jul 01 2014 00:00:00, - * // ] - */ -function eachQuarterOfInterval(interval, options) { - const startDate = (0, _index3.toDate)(interval.start); - const endDate = (0, _index3.toDate)(interval.end); +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } - let reversed = +startDate > +endDate; - const endTime = reversed - ? +(0, _index2.startOfQuarter)(startDate) - : +(0, _index2.startOfQuarter)(endDate); - let currentDate = reversed - ? (0, _index2.startOfQuarter)(endDate) - : (0, _index2.startOfQuarter)(startDate); - let step = options?.step ?? 1; - if (!step) return []; - if (step < 0) { - step = -step; - reversed = !reversed; - } +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_583__.m = modules; - const dates = []; +/******/ // expose the module cache +/******/ __nested_webpack_require_583__.c = installedModules; - while (+currentDate <= endTime) { - dates.push((0, _index3.toDate)(currentDate)); - currentDate = (0, _index.addQuarters)(currentDate, step); - } +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_583__.p = ""; - return reversed ? dates.reverse() : dates; -} +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_583__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __nested_webpack_require_1808__) { + "use strict"; + /* + Copyright JS Foundation and other contributors, https://js.foundation/ -/***/ }), + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: -/***/ 21103: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. -"use strict"; + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + Object.defineProperty(exports, "__esModule", { value: true }); + var comment_handler_1 = __nested_webpack_require_1808__(1); + var jsx_parser_1 = __nested_webpack_require_1808__(3); + var parser_1 = __nested_webpack_require_1808__(8); + var tokenizer_1 = __nested_webpack_require_1808__(15); + function parse(code, options, delegate) { + var commentHandler = null; + var proxyDelegate = function (node, metadata) { + if (delegate) { + delegate(node, metadata); + } + if (commentHandler) { + commentHandler.visit(node, metadata); + } + }; + var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; + var collectComment = false; + if (options) { + collectComment = (typeof options.comment === 'boolean' && options.comment); + var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); + if (collectComment || attachComment) { + commentHandler = new comment_handler_1.CommentHandler(); + commentHandler.attach = attachComment; + options.comment = true; + parserDelegate = proxyDelegate; + } + } + var isModule = false; + if (options && typeof options.sourceType === 'string') { + isModule = (options.sourceType === 'module'); + } + var parser; + if (options && typeof options.jsx === 'boolean' && options.jsx) { + parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); + } + else { + parser = new parser_1.Parser(code, options, parserDelegate); + } + var program = isModule ? parser.parseModule() : parser.parseScript(); + var ast = program; + if (collectComment && commentHandler) { + ast.comments = commentHandler.comments; + } + if (parser.config.tokens) { + ast.tokens = parser.tokens; + } + if (parser.config.tolerant) { + ast.errors = parser.errorHandler.errors; + } + return ast; + } + exports.parse = parse; + function parseModule(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'module'; + return parse(code, parsingOptions, delegate); + } + exports.parseModule = parseModule; + function parseScript(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'script'; + return parse(code, parsingOptions, delegate); + } + exports.parseScript = parseScript; + function tokenize(code, options, delegate) { + var tokenizer = new tokenizer_1.Tokenizer(code, options); + var tokens; + tokens = []; + try { + while (true) { + var token = tokenizer.getNextToken(); + if (!token) { + break; + } + if (delegate) { + token = delegate(token); + } + tokens.push(token); + } + } + catch (e) { + tokenizer.errorHandler.tolerate(e); + } + if (tokenizer.errorHandler.tolerant) { + tokens.errors = tokenizer.errors(); + } + return tokens; + } + exports.tokenize = tokenize; + var syntax_1 = __nested_webpack_require_1808__(2); + exports.Syntax = syntax_1.Syntax; + // Sync with *.json manifests. + exports.version = '4.0.1'; -exports.eachWeekOfInterval = eachWeekOfInterval; -var _index = __nccwpck_require__(66985); -var _index2 = __nccwpck_require__(26068); -var _index3 = __nccwpck_require__(53622); -/** - * The {@link eachWeekOfInterval} function options. - */ +/***/ }, +/* 1 */ +/***/ function(module, exports, __nested_webpack_require_6456__) { -/** - * @name eachWeekOfInterval - * @category Interval Helpers - * @summary Return the array of weeks within the specified time interval. - * - * @description - * Return the array of weeks within the specified time interval. - * - * @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). - * - * @param interval - The interval. - * @param options - An object with options. - * - * @returns The array with starts of weeks from the week of the interval start to the week of the interval end - * - * @example - * // Each week within interval 6 October 2014 - 23 November 2014: - * const result = eachWeekOfInterval({ - * start: new Date(2014, 9, 6), - * end: new Date(2014, 10, 23) - * }) - * //=> [ - * // Sun Oct 05 2014 00:00:00, - * // Sun Oct 12 2014 00:00:00, - * // Sun Oct 19 2014 00:00:00, - * // Sun Oct 26 2014 00:00:00, - * // Sun Nov 02 2014 00:00:00, - * // Sun Nov 09 2014 00:00:00, - * // Sun Nov 16 2014 00:00:00, - * // Sun Nov 23 2014 00:00:00 - * // ] - */ -function eachWeekOfInterval(interval, options) { - const startDate = (0, _index3.toDate)(interval.start); - const endDate = (0, _index3.toDate)(interval.end); + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __nested_webpack_require_6456__(2); + var CommentHandler = (function () { + function CommentHandler() { + this.attach = false; + this.comments = []; + this.stack = []; + this.leading = []; + this.trailing = []; + } + CommentHandler.prototype.insertInnerComments = function (node, metadata) { + // innnerComments for properties empty block + // `function a() {/** comments **\/}` + if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { + var innerComments = []; + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (metadata.end.offset >= entry.start) { + innerComments.unshift(entry.comment); + this.leading.splice(i, 1); + this.trailing.splice(i, 1); + } + } + if (innerComments.length) { + node.innerComments = innerComments; + } + } + }; + CommentHandler.prototype.findTrailingComments = function (metadata) { + var trailingComments = []; + if (this.trailing.length > 0) { + for (var i = this.trailing.length - 1; i >= 0; --i) { + var entry_1 = this.trailing[i]; + if (entry_1.start >= metadata.end.offset) { + trailingComments.unshift(entry_1.comment); + } + } + this.trailing.length = 0; + return trailingComments; + } + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.node.trailingComments) { + var firstComment = entry.node.trailingComments[0]; + if (firstComment && firstComment.range[0] >= metadata.end.offset) { + trailingComments = entry.node.trailingComments; + delete entry.node.trailingComments; + } + } + return trailingComments; + }; + CommentHandler.prototype.findLeadingComments = function (metadata) { + var leadingComments = []; + var target; + while (this.stack.length > 0) { + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.start >= metadata.start.offset) { + target = entry.node; + this.stack.pop(); + } + else { + break; + } + } + if (target) { + var count = target.leadingComments ? target.leadingComments.length : 0; + for (var i = count - 1; i >= 0; --i) { + var comment = target.leadingComments[i]; + if (comment.range[1] <= metadata.start.offset) { + leadingComments.unshift(comment); + target.leadingComments.splice(i, 1); + } + } + if (target.leadingComments && target.leadingComments.length === 0) { + delete target.leadingComments; + } + return leadingComments; + } + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (entry.start <= metadata.start.offset) { + leadingComments.unshift(entry.comment); + this.leading.splice(i, 1); + } + } + return leadingComments; + }; + CommentHandler.prototype.visitNode = function (node, metadata) { + if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { + return; + } + this.insertInnerComments(node, metadata); + var trailingComments = this.findTrailingComments(metadata); + var leadingComments = this.findLeadingComments(metadata); + if (leadingComments.length > 0) { + node.leadingComments = leadingComments; + } + if (trailingComments.length > 0) { + node.trailingComments = trailingComments; + } + this.stack.push({ + node: node, + start: metadata.start.offset + }); + }; + CommentHandler.prototype.visitComment = function (node, metadata) { + var type = (node.type[0] === 'L') ? 'Line' : 'Block'; + var comment = { + type: type, + value: node.value + }; + if (node.range) { + comment.range = node.range; + } + if (node.loc) { + comment.loc = node.loc; + } + this.comments.push(comment); + if (this.attach) { + var entry = { + comment: { + type: type, + value: node.value, + range: [metadata.start.offset, metadata.end.offset] + }, + start: metadata.start.offset + }; + if (node.loc) { + entry.comment.loc = node.loc; + } + node.type = type; + this.leading.push(entry); + this.trailing.push(entry); + } + }; + CommentHandler.prototype.visit = function (node, metadata) { + if (node.type === 'LineComment') { + this.visitComment(node, metadata); + } + else if (node.type === 'BlockComment') { + this.visitComment(node, metadata); + } + else if (this.attach) { + this.visitNode(node, metadata); + } + }; + return CommentHandler; + }()); + exports.CommentHandler = CommentHandler; - let reversed = +startDate > +endDate; - const startDateWeek = reversed - ? (0, _index2.startOfWeek)(endDate, options) - : (0, _index2.startOfWeek)(startDate, options); - const endDateWeek = reversed - ? (0, _index2.startOfWeek)(startDate, options) - : (0, _index2.startOfWeek)(endDate, options); - // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet - startDateWeek.setHours(15); - endDateWeek.setHours(15); +/***/ }, +/* 2 */ +/***/ function(module, exports) { - const endTime = +endDateWeek.getTime(); - let currentDate = startDateWeek; + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForOfStatement: 'ForOfStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchCase: 'SwitchCase', + SwitchStatement: 'SwitchStatement', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; - let step = options?.step ?? 1; - if (!step) return []; - if (step < 0) { - step = -step; - reversed = !reversed; - } - const dates = []; - - while (+currentDate <= endTime) { - currentDate.setHours(0); - dates.push((0, _index3.toDate)(currentDate)); - currentDate = (0, _index.addWeeks)(currentDate, step); - currentDate.setHours(15); - } - - return reversed ? dates.reverse() : dates; -} - - -/***/ }), - -/***/ 85984: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.eachWeekendOfInterval = eachWeekendOfInterval; -var _index = __nccwpck_require__(82367); -var _index2 = __nccwpck_require__(45417); - -/** - * @name eachWeekendOfInterval - * @category Interval Helpers - * @summary List all the Saturdays and Sundays in the given date interval. - * - * @description - * Get all the Saturdays and Sundays in the given date interval. - * - * @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). - * - * @param interval - The given interval - * - * @returns An array containing all the Saturdays and Sundays - * - * @example - * // Lists all Saturdays and Sundays in the given date interval - * const result = eachWeekendOfInterval({ - * start: new Date(2018, 8, 17), - * end: new Date(2018, 8, 30) - * }) - * //=> [ - * // Sat Sep 22 2018 00:00:00, - * // Sun Sep 23 2018 00:00:00, - * // Sat Sep 29 2018 00:00:00, - * // Sun Sep 30 2018 00:00:00 - * // ] - */ -function eachWeekendOfInterval(interval) { - const dateInterval = (0, _index.eachDayOfInterval)(interval); - const weekends = []; - let index = 0; - while (index < dateInterval.length) { - const date = dateInterval[index++]; - if ((0, _index2.isWeekend)(date)) weekends.push(date); - } - return weekends; -} - - -/***/ }), - -/***/ 77633: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.eachWeekendOfMonth = eachWeekendOfMonth; -var _index = __nccwpck_require__(85984); -var _index2 = __nccwpck_require__(63434); -var _index3 = __nccwpck_require__(80050); - -/** - * @name eachWeekendOfMonth - * @category Month Helpers - * @summary List all the Saturdays and Sundays in the given month. - * - * @description - * Get all the Saturdays and Sundays in the given month. - * - * @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). - * - * @param date - The given month - * - * @returns An array containing all the Saturdays and Sundays - * - * @example - * // Lists all Saturdays and Sundays in the given month - * const result = eachWeekendOfMonth(new Date(2022, 1, 1)) - * //=> [ - * // Sat Feb 05 2022 00:00:00, - * // Sun Feb 06 2022 00:00:00, - * // Sat Feb 12 2022 00:00:00, - * // Sun Feb 13 2022 00:00:00, - * // Sat Feb 19 2022 00:00:00, - * // Sun Feb 20 2022 00:00:00, - * // Sat Feb 26 2022 00:00:00, - * // Sun Feb 27 2022 00:00:00 - * // ] - */ -function eachWeekendOfMonth(date) { - const start = (0, _index3.startOfMonth)(date); - const end = (0, _index2.endOfMonth)(date); - return (0, _index.eachWeekendOfInterval)({ start, end }); -} - - -/***/ }), - -/***/ 44666: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.eachWeekendOfYear = eachWeekendOfYear; -var _index = __nccwpck_require__(85984); -var _index2 = __nccwpck_require__(36063); -var _index3 = __nccwpck_require__(63304); - -/** - * @name eachWeekendOfYear - * @category Year Helpers - * @summary List all the Saturdays and Sundays in the year. - * - * @description - * Get all the Saturdays and Sundays in the year. - * - * @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). - * - * @param date - The given year - * - * @returns An array containing all the Saturdays and Sundays - * - * @example - * // Lists all Saturdays and Sundays in the year - * const result = eachWeekendOfYear(new Date(2020, 1, 1)) - * //=> [ - * // Sat Jan 03 2020 00:00:00, - * // Sun Jan 04 2020 00:00:00, - * // ... - * // Sun Dec 27 2020 00:00:00 - * // ] - * ] - */ -function eachWeekendOfYear(date) { - const start = (0, _index3.startOfYear)(date); - const end = (0, _index2.endOfYear)(date); - return (0, _index.eachWeekendOfInterval)({ start, end }); -} - - -/***/ }), - -/***/ 98256: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.eachYearOfInterval = eachYearOfInterval; -var _index = __nccwpck_require__(53622); - -/** - * The {@link eachYearOfInterval} function options. - */ - -/** - * @name eachYearOfInterval - * @category Interval Helpers - * @summary Return the array of yearly timestamps within the specified time interval. - * - * @description - * Return the array of yearly timestamps within the specified time interval. - * - * @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). - * - * @param interval - The interval. - * - * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end - * - * @example - * // Each year between 6 February 2014 and 10 August 2017: - * const result = eachYearOfInterval({ - * start: new Date(2014, 1, 6), - * end: new Date(2017, 7, 10) - * }) - * //=> [ - * // Wed Jan 01 2014 00:00:00, - * // Thu Jan 01 2015 00:00:00, - * // Fri Jan 01 2016 00:00:00, - * // Sun Jan 01 2017 00:00:00 - * // ] - */ -function eachYearOfInterval(interval, options) { - const startDate = (0, _index.toDate)(interval.start); - const endDate = (0, _index.toDate)(interval.end); - - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - const currentDate = reversed ? endDate : startDate; - currentDate.setHours(0, 0, 0, 0); - currentDate.setMonth(0, 1); - - let step = options?.step ?? 1; - if (!step) return []; - if (step < 0) { - step = -step; - reversed = !reversed; - } - - const dates = []; - - while (+currentDate <= endTime) { - dates.push((0, _index.toDate)(currentDate)); - currentDate.setFullYear(currentDate.getFullYear() + step); - } - - return reversed ? dates.reverse() : dates; -} - - -/***/ }), - -/***/ 86610: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfDay = endOfDay; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfDay - * @category Day Helpers - * @summary Return the end of a day for the given date. - * - * @description - * Return the end of a day for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The end of a day - * - * @example - * // The end of a day for 2 September 2014 11:55:00: - * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 02 2014 23:59:59.999 - */ -function endOfDay(date) { - const _date = (0, _index.toDate)(date); - _date.setHours(23, 59, 59, 999); - return _date; -} - - -/***/ }), - -/***/ 76877: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfDecade = endOfDecade; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfDecade - * @category Decade Helpers - * @summary Return the end of a decade for the given date. - * - * @description - * Return the end of a decade for the given date. - * - * @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). - * - * @param date - The original date - * - * @returns The end of a decade - * - * @example - * // The end of a decade for 12 May 1984 00:00:00: - * const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00)) - * //=> Dec 31 1989 23:59:59.999 - */ -function endOfDecade(date) { - // TODO: Switch to more technical definition in of decades that start with 1 - // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking - // change, so it can only be done in 4.0. - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - const decade = 9 + Math.floor(year / 10) * 10; - _date.setFullYear(decade, 11, 31); - _date.setHours(23, 59, 59, 999); - return _date; -} - - -/***/ }), - -/***/ 92987: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfHour = endOfHour; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfHour - * @category Hour Helpers - * @summary Return the end of an hour for the given date. - * - * @description - * Return the end of an hour for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The end of an hour - * - * @example - * // The end of an hour for 2 September 2014 11:55:00: - * const result = endOfHour(new Date(2014, 8, 2, 11, 55)) - * //=> Tue Sep 02 2014 11:59:59.999 - */ -function endOfHour(date) { - const _date = (0, _index.toDate)(date); - _date.setMinutes(59, 59, 999); - return _date; -} - - -/***/ }), - -/***/ 64056: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfISOWeek = endOfISOWeek; -var _index = __nccwpck_require__(78135); - -/** - * @name endOfISOWeek - * @category ISO Week Helpers - * @summary Return the end of an ISO week for the given date. - * - * @description - * Return the end of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The original date - * - * @returns The end of an ISO week - * - * @example - * // The end of an ISO week for 2 September 2014 11:55:00: - * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Sep 07 2014 23:59:59.999 - */ -function endOfISOWeek(date) { - return (0, _index.endOfWeek)(date, { weekStartsOn: 1 }); -} - - -/***/ }), - -/***/ 52961: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfISOWeekYear = endOfISOWeekYear; -var _index = __nccwpck_require__(90308); -var _index2 = __nccwpck_require__(69709); -var _index3 = __nccwpck_require__(92736); - -/** - * @name endOfISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Return the end of an ISO week-numbering year for the given date. - * - * @description - * Return the end of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The original date - * - * @returns The end of an ISO week-numbering year - * - * @example - * // The end of an ISO week-numbering year for 2 July 2005: - * const result = endOfISOWeekYear(new Date(2005, 6, 2)) - * //=> Sun Jan 01 2006 23:59:59.999 - */ -function endOfISOWeekYear(date) { - const year = (0, _index.getISOWeekYear)(date); - const fourthOfJanuaryOfNextYear = (0, _index3.constructFrom)(date, 0); - fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); - fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); - const _date = (0, _index2.startOfISOWeek)(fourthOfJanuaryOfNextYear); - _date.setMilliseconds(_date.getMilliseconds() - 1); - return _date; -} - - -/***/ }), - -/***/ 15953: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfMinute = endOfMinute; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfMinute - * @category Minute Helpers - * @summary Return the end of a minute for the given date. - * - * @description - * Return the end of a minute for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The end of a minute - * - * @example - * // The end of a minute for 1 December 2014 22:15:45.400: - * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:59.999 - */ -function endOfMinute(date) { - const _date = (0, _index.toDate)(date); - _date.setSeconds(59, 999); - return _date; -} - - -/***/ }), - -/***/ 63434: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfMonth = endOfMonth; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfMonth - * @category Month Helpers - * @summary Return the end of a month for the given date. - * - * @description - * Return the end of a month for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The end of a month - * - * @example - * // The end of a month for 2 September 2014 11:55:00: - * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 23:59:59.999 - */ -function endOfMonth(date) { - const _date = (0, _index.toDate)(date); - const month = _date.getMonth(); - _date.setFullYear(_date.getFullYear(), month + 1, 0); - _date.setHours(23, 59, 59, 999); - return _date; -} - - -/***/ }), - -/***/ 89479: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfQuarter = endOfQuarter; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfQuarter - * @category Quarter Helpers - * @summary Return the end of a year quarter for the given date. - * - * @description - * Return the end of a year quarter for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The end of a quarter - * - * @example - * // The end of a quarter for 2 September 2014 11:55:00: - * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 23:59:59.999 - */ -function endOfQuarter(date) { - const _date = (0, _index.toDate)(date); - const currentMonth = _date.getMonth(); - const month = currentMonth - (currentMonth % 3) + 3; - _date.setMonth(month, 0); - _date.setHours(23, 59, 59, 999); - return _date; -} - - -/***/ }), - -/***/ 36169: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfSecond = endOfSecond; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfSecond - * @category Second Helpers - * @summary Return the end of a second for the given date. - * - * @description - * Return the end of a second for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The end of a second - * - * @example - * // The end of a second for 1 December 2014 22:15:45.400: - * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:45.999 - */ -function endOfSecond(date) { - const _date = (0, _index.toDate)(date); - _date.setMilliseconds(999); - return _date; -} - - -/***/ }), - -/***/ 50003: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfToday = endOfToday; -var _index = __nccwpck_require__(86610); - -/** - * @name endOfToday - * @category Day Helpers - * @summary Return the end of today. - * @pure false - * - * @description - * Return the end of today. - * - * @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). - * - * @returns The end of today - * - * @example - * // If today is 6 October 2014: - * const result = endOfToday() - * //=> Mon Oct 6 2014 23:59:59.999 - */ -function endOfToday() { - return (0, _index.endOfDay)(Date.now()); -} - - -/***/ }), - -/***/ 72019: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.endOfTomorrow = endOfTomorrow; /** - * @name endOfTomorrow - * @category Day Helpers - * @summary Return the end of tomorrow. - * @pure false - * - * @description - * Return the end of tomorrow. - * - * @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). - * - * @returns The end of tomorrow - * - * @example - * // If today is 6 October 2014: - * const result = endOfTomorrow() - * //=> Tue Oct 7 2014 23:59:59.999 - */ -function endOfTomorrow() { - const now = new Date(); - const year = now.getFullYear(); - const month = now.getMonth(); - const day = now.getDate(); - - const date = new Date(0); - date.setFullYear(year, month, day + 1); - date.setHours(23, 59, 59, 999); - return date; -} - - -/***/ }), - -/***/ 78135: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfWeek = endOfWeek; -var _index = __nccwpck_require__(53622); - -var _index2 = __nccwpck_require__(42466); - -/** - * The {@link endOfWeek} function options. - */ - -/** - * @name endOfWeek - * @category Week Helpers - * @summary Return the end of a week for the given date. - * - * @description - * Return the end of a week for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * @param options - An object with options - * - * @returns The end of a week - * - * @example - * // The end of a week for 2 September 2014 11:55:00: - * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sat Sep 06 2014 23:59:59.999 - * - * @example - * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00: - * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) - * //=> Sun Sep 07 2014 23:59:59.999 - */ -function endOfWeek(date, options) { - const defaultOptions = (0, _index2.getDefaultOptions)(); - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - const _date = (0, _index.toDate)(date); - const day = _date.getDay(); - const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); - - _date.setDate(_date.getDate() + diff); - _date.setHours(23, 59, 59, 999); - return _date; -} - - -/***/ }), - -/***/ 36063: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.endOfYear = endOfYear; -var _index = __nccwpck_require__(53622); - -/** - * @name endOfYear - * @category Year Helpers - * @summary Return the end of a year for the given date. - * - * @description - * Return the end of a year for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The end of a year - * - * @example - * // The end of a year for 2 September 2014 11:55:00: - * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Dec 31 2014 23:59:59.999 - */ -function endOfYear(date) { - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - _date.setFullYear(year + 1, 0, 0); - _date.setHours(23, 59, 59, 999); - return _date; -} - - -/***/ }), - -/***/ 99317: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.endOfYesterday = endOfYesterday; /** - * @name endOfYesterday - * @category Day Helpers - * @summary Return the end of yesterday. - * @pure false - * - * @description - * Return the end of yesterday. - * - * @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). - * - * @returns The end of yesterday - * - * @example - * // If today is 6 October 2014: - * const result = endOfYesterday() - * //=> Sun Oct 5 2014 23:59:59.999 - */ -function endOfYesterday() { - const now = new Date(); - const year = now.getFullYear(); - const month = now.getMonth(); - const day = now.getDate(); - - const date = new Date(0); - date.setFullYear(year, month, day - 1); - date.setHours(23, 59, 59, 999); - return date; -} - - -/***/ }), - -/***/ 51578: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.format = exports.formatDate = format; -Object.defineProperty(exports, "formatters", ({ - enumerable: true, - get: function () { - return _index3.formatters; - }, -})); -Object.defineProperty(exports, "longFormatters", ({ - enumerable: true, - get: function () { - return _index4.longFormatters; - }, -})); -var _index = __nccwpck_require__(64092); -var _index2 = __nccwpck_require__(42466); -var _index3 = __nccwpck_require__(59892); -var _index4 = __nccwpck_require__(8707); -var _index5 = __nccwpck_require__(82147); - -var _index6 = __nccwpck_require__(58915); -var _index7 = __nccwpck_require__(53622); - -// Rexports of internal for libraries to use. -// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 - -// This RegExp consists of three parts separated by `|`: -// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token -// (one of the certain letters followed by `o`) -// - (\w)\1* matches any sequences of the same letter -// - '' matches two quote characters in a row -// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), -// except a single quote symbol, which ends the sequence. -// Two quote characters do not end the sequence. -// If there is no matching single quote -// then the sequence will continue until the end of the string. -// - . matches any single character unmatched by previous parts of the RegExps -const formattingTokensRegExp = - /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; - -// This RegExp catches symbols escaped by quotes, and also -// sequences of symbols P, p, and the combinations like `PPPPPPPppppp` -const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; - -const escapedStringRegExp = /^'([^]*?)'?$/; -const doubleQuoteRegExp = /''/g; -const unescapedLatinCharacterRegExp = /[a-zA-Z]/; - -/** - * The {@link format} function options. - */ - -/** - * @name format - * @alias formatDate - * @category Common Helpers - * @summary Format the date. - * - * @description - * Return the formatted date string in the given format. The result may vary by locale. - * - * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. - * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * The characters wrapped between two single quotes characters (') are escaped. - * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. - * (see the last example) - * - * Format of the string is based on Unicode Technical Standard #35: - * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * with a few additions (see note 7 below the table). - * - * Accepted patterns: - * | Unit | Pattern | Result examples | Notes | - * |---------------------------------|---------|-----------------------------------|-------| - * | Era | G..GGG | AD, BC | | - * | | GGGG | Anno Domini, Before Christ | 2 | - * | | GGGGG | A, B | | - * | Calendar year | y | 44, 1, 1900, 2017 | 5 | - * | | yo | 44th, 1st, 0th, 17th | 5,7 | - * | | yy | 44, 01, 00, 17 | 5 | - * | | yyy | 044, 001, 1900, 2017 | 5 | - * | | yyyy | 0044, 0001, 1900, 2017 | 5 | - * | | yyyyy | ... | 3,5 | - * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 | - * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 | - * | | YY | 44, 01, 00, 17 | 5,8 | - * | | YYY | 044, 001, 1900, 2017 | 5 | - * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 | - * | | YYYYY | ... | 3,5 | - * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 | - * | | RR | -43, 00, 01, 1900, 2017 | 5,7 | - * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 | - * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 | - * | | RRRRR | ... | 3,5,7 | - * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 | - * | | uu | -43, 01, 1900, 2017 | 5 | - * | | uuu | -043, 001, 1900, 2017 | 5 | - * | | uuuu | -0043, 0001, 1900, 2017 | 5 | - * | | uuuuu | ... | 3,5 | - * | Quarter (formatting) | Q | 1, 2, 3, 4 | | - * | | Qo | 1st, 2nd, 3rd, 4th | 7 | - * | | QQ | 01, 02, 03, 04 | | - * | | QQQ | Q1, Q2, Q3, Q4 | | - * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | - * | | QQQQQ | 1, 2, 3, 4 | 4 | - * | Quarter (stand-alone) | q | 1, 2, 3, 4 | | - * | | qo | 1st, 2nd, 3rd, 4th | 7 | - * | | qq | 01, 02, 03, 04 | | - * | | qqq | Q1, Q2, Q3, Q4 | | - * | | qqqq | 1st quarter, 2nd quarter, ... | 2 | - * | | qqqqq | 1, 2, 3, 4 | 4 | - * | Month (formatting) | M | 1, 2, ..., 12 | | - * | | Mo | 1st, 2nd, ..., 12th | 7 | - * | | MM | 01, 02, ..., 12 | | - * | | MMM | Jan, Feb, ..., Dec | | - * | | MMMM | January, February, ..., December | 2 | - * | | MMMMM | J, F, ..., D | | - * | Month (stand-alone) | L | 1, 2, ..., 12 | | - * | | Lo | 1st, 2nd, ..., 12th | 7 | - * | | LL | 01, 02, ..., 12 | | - * | | LLL | Jan, Feb, ..., Dec | | - * | | LLLL | January, February, ..., December | 2 | - * | | LLLLL | J, F, ..., D | | - * | Local week of year | w | 1, 2, ..., 53 | | - * | | wo | 1st, 2nd, ..., 53th | 7 | - * | | ww | 01, 02, ..., 53 | | - * | ISO week of year | I | 1, 2, ..., 53 | 7 | - * | | Io | 1st, 2nd, ..., 53th | 7 | - * | | II | 01, 02, ..., 53 | 7 | - * | Day of month | d | 1, 2, ..., 31 | | - * | | do | 1st, 2nd, ..., 31st | 7 | - * | | dd | 01, 02, ..., 31 | | - * | Day of year | D | 1, 2, ..., 365, 366 | 9 | - * | | Do | 1st, 2nd, ..., 365th, 366th | 7 | - * | | DD | 01, 02, ..., 365, 366 | 9 | - * | | DDD | 001, 002, ..., 365, 366 | | - * | | DDDD | ... | 3 | - * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | | - * | | EEEE | Monday, Tuesday, ..., Sunday | 2 | - * | | EEEEE | M, T, W, T, F, S, S | | - * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | - * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 | - * | | io | 1st, 2nd, ..., 7th | 7 | - * | | ii | 01, 02, ..., 07 | 7 | - * | | iii | Mon, Tue, Wed, ..., Sun | 7 | - * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 | - * | | iiiii | M, T, W, T, F, S, S | 7 | - * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 | - * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | | - * | | eo | 2nd, 3rd, ..., 1st | 7 | - * | | ee | 02, 03, ..., 01 | | - * | | eee | Mon, Tue, Wed, ..., Sun | | - * | | eeee | Monday, Tuesday, ..., Sunday | 2 | - * | | eeeee | M, T, W, T, F, S, S | | - * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | - * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | | - * | | co | 2nd, 3rd, ..., 1st | 7 | - * | | cc | 02, 03, ..., 01 | | - * | | ccc | Mon, Tue, Wed, ..., Sun | | - * | | cccc | Monday, Tuesday, ..., Sunday | 2 | - * | | ccccc | M, T, W, T, F, S, S | | - * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | - * | AM, PM | a..aa | AM, PM | | - * | | aaa | am, pm | | - * | | aaaa | a.m., p.m. | 2 | - * | | aaaaa | a, p | | - * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | | - * | | bbb | am, pm, noon, midnight | | - * | | bbbb | a.m., p.m., noon, midnight | 2 | - * | | bbbbb | a, p, n, mi | | - * | Flexible day period | B..BBB | at night, in the morning, ... | | - * | | BBBB | at night, in the morning, ... | 2 | - * | | BBBBB | at night, in the morning, ... | | - * | Hour [1-12] | h | 1, 2, ..., 11, 12 | | - * | | ho | 1st, 2nd, ..., 11th, 12th | 7 | - * | | hh | 01, 02, ..., 11, 12 | | - * | Hour [0-23] | H | 0, 1, 2, ..., 23 | | - * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 | - * | | HH | 00, 01, 02, ..., 23 | | - * | Hour [0-11] | K | 1, 2, ..., 11, 0 | | - * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 | - * | | KK | 01, 02, ..., 11, 00 | | - * | Hour [1-24] | k | 24, 1, 2, ..., 23 | | - * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 | - * | | kk | 24, 01, 02, ..., 23 | | - * | Minute | m | 0, 1, ..., 59 | | - * | | mo | 0th, 1st, ..., 59th | 7 | - * | | mm | 00, 01, ..., 59 | | - * | Second | s | 0, 1, ..., 59 | | - * | | so | 0th, 1st, ..., 59th | 7 | - * | | ss | 00, 01, ..., 59 | | - * | Fraction of second | S | 0, 1, ..., 9 | | - * | | SS | 00, 01, ..., 99 | | - * | | SSS | 000, 001, ..., 999 | | - * | | SSSS | ... | 3 | - * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | | - * | | XX | -0800, +0530, Z | | - * | | XXX | -08:00, +05:30, Z | | - * | | XXXX | -0800, +0530, Z, +123456 | 2 | - * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | - * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | | - * | | xx | -0800, +0530, +0000 | | - * | | xxx | -08:00, +05:30, +00:00 | 2 | - * | | xxxx | -0800, +0530, +0000, +123456 | | - * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | - * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | | - * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 | - * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 | - * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 | - * | Seconds timestamp | t | 512969520 | 7 | - * | | tt | ... | 3,7 | - * | Milliseconds timestamp | T | 512969520900 | 7 | - * | | TT | ... | 3,7 | - * | Long localized date | P | 04/29/1453 | 7 | - * | | PP | Apr 29, 1453 | 7 | - * | | PPP | April 29th, 1453 | 7 | - * | | PPPP | Friday, April 29th, 1453 | 2,7 | - * | Long localized time | p | 12:00 AM | 7 | - * | | pp | 12:00:00 AM | 7 | - * | | ppp | 12:00:00 AM GMT+2 | 7 | - * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 | - * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 | - * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 | - * | | PPPppp | April 29th, 1453 at ... | 7 | - * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 | - * Notes: - * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale - * are the same as "stand-alone" units, but are different in some languages. - * "Formatting" units are declined according to the rules of the language - * in the context of a date. "Stand-alone" units are always nominative singular: - * - * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` - * - * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` - * - * 2. Any sequence of the identical letters is a pattern, unless it is escaped by - * the single quote characters (see below). - * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`) - * the output will be the same as default pattern for this unit, usually - * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units - * are marked with "2" in the last column of the table. - * - * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'` - * - * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'` - * - * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'` - * - * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'` - * - * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'` - * - * 3. Some patterns could be unlimited length (such as `yyyyyyyy`). - * The output will be padded with zeros to match the length of the pattern. - * - * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'` - * - * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. - * These tokens represent the shortest form of the quarter. - * - * 5. The main difference between `y` and `u` patterns are B.C. years: - * - * | Year | `y` | `u` | - * |------|-----|-----| - * | AC 1 | 1 | 1 | - * | BC 1 | 1 | 0 | - * | BC 2 | 2 | -1 | - * - * Also `yy` always returns the last two digits of a year, - * while `uu` pads single digit years to 2 characters and returns other years unchanged: - * - * | Year | `yy` | `uu` | - * |------|------|------| - * | 1 | 01 | 01 | - * | 14 | 14 | 14 | - * | 376 | 76 | 376 | - * | 1453 | 53 | 1453 | - * - * The same difference is true for local and ISO week-numbering years (`Y` and `R`), - * except local week-numbering years are dependent on `options.weekStartsOn` - * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear) - * and [getWeekYear](https://date-fns.org/docs/getWeekYear)). - * - * 6. Specific non-location timezones are currently unavailable in `date-fns`, - * so right now these tokens fall back to GMT timezones. - * - * 7. These patterns are not in the Unicode Technical Standard #35: - * - `i`: ISO day of week - * - `I`: ISO week of year - * - `R`: ISO week-numbering year - * - `t`: seconds timestamp - * - `T`: milliseconds timestamp - * - `o`: ordinal number modifier - * - `P`: long localized date - * - `p`: long localized time - * - * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. - * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. - * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * @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). - * - * @param date - The original date - * @param format - The string of tokens - * @param options - An object with options - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * @throws `options.locale` must contain `localize` property - * @throws `options.locale` must contain `formatLong` property - * @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 - * @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 - * @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 - * @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 - * @throws format string contains an unescaped latin alphabet character - * - * @example - * // Represent 11 February 2014 in middle-endian format: - * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy') - * //=> '02/11/2014' - * - * @example - * // Represent 2 July 2014 in Esperanto: - * import { eoLocale } from 'date-fns/locale/eo' - * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", { - * locale: eoLocale - * }) - * //=> '2-a de julio 2014' - * - * @example - * // Escape string by single quote characters: - * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'") - * //=> "3 o'clock" - */ -function format(date, formatStr, options) { - const defaultOptions = (0, _index2.getDefaultOptions)(); - const locale = - options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; - - const firstWeekContainsDate = - options?.firstWeekContainsDate ?? - options?.locale?.options?.firstWeekContainsDate ?? - defaultOptions.firstWeekContainsDate ?? - defaultOptions.locale?.options?.firstWeekContainsDate ?? - 1; - - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - const originalDate = (0, _index7.toDate)(date); - - if (!(0, _index6.isValid)(originalDate)) { - throw new RangeError("Invalid time value"); - } - - let parts = formatStr - .match(longFormattingTokensRegExp) - .map((substring) => { - const firstCharacter = substring[0]; - if (firstCharacter === "p" || firstCharacter === "P") { - const longFormatter = _index4.longFormatters[firstCharacter]; - return longFormatter(substring, locale.formatLong); - } - return substring; - }) - .join("") - .match(formattingTokensRegExp) - .map((substring) => { - // Replace two single quote characters with one single quote character - if (substring === "''") { - return { isToken: false, value: "'" }; - } - - const firstCharacter = substring[0]; - if (firstCharacter === "'") { - return { isToken: false, value: cleanEscapedString(substring) }; - } - - if (_index3.formatters[firstCharacter]) { - return { isToken: true, value: substring }; - } - - if (firstCharacter.match(unescapedLatinCharacterRegExp)) { - throw new RangeError( - "Format string contains an unescaped latin alphabet character `" + - firstCharacter + - "`", - ); - } - - return { isToken: false, value: substring }; - }); - - // invoke localize preprocessor (only for french locales at the moment) - if (locale.localize.preprocessor) { - parts = locale.localize.preprocessor(originalDate, parts); - } - - const formatterOptions = { - firstWeekContainsDate, - weekStartsOn, - locale, - }; - - return parts - .map((part) => { - if (!part.isToken) return part.value; - - const token = part.value; - - if ( - (!options?.useAdditionalWeekYearTokens && - (0, _index5.isProtectedWeekYearToken)(token)) || - (!options?.useAdditionalDayOfYearTokens && - (0, _index5.isProtectedDayOfYearToken)(token)) - ) { - (0, _index5.warnOrThrowProtectedError)(token, formatStr, String(date)); - } - - const formatter = _index3.formatters[token[0]]; - return formatter(originalDate, token, locale.localize, formatterOptions); - }) - .join(""); -} - -function cleanEscapedString(input) { - const matched = input.match(escapedStringRegExp); - - if (!matched) { - return input; - } - - return matched[1].replace(doubleQuoteRegExp, "'"); -} - - -/***/ }), - -/***/ 63888: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatDistance = formatDistance; -var _index = __nccwpck_require__(76125); -var _index2 = __nccwpck_require__(17818); -var _index3 = __nccwpck_require__(13045); -var _index4 = __nccwpck_require__(14944); -var _index5 = __nccwpck_require__(53622); - -var _index6 = __nccwpck_require__(64092); -var _index7 = __nccwpck_require__(42466); -var _index8 = __nccwpck_require__(31292); - -/** - * The {@link formatDistance} function options. - */ - -/** - * @name formatDistance - * @category Common Helpers - * @summary Return the distance between the given dates in words. - * - * @description - * Return the distance between the given dates in words. - * - * | Distance between dates | Result | - * |-------------------------------------------------------------------|---------------------| - * | 0 ... 30 secs | less than a minute | - * | 30 secs ... 1 min 30 secs | 1 minute | - * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | - * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | - * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | - * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | - * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | - * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | - * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | - * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | - * | 1 yr ... 1 yr 3 months | about 1 year | - * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | - * | 1 yr 9 months ... 2 yrs | almost 2 years | - * | N yrs ... N yrs 3 months | about N years | - * | N yrs 3 months ... N yrs 9 months | over N years | - * | N yrs 9 months ... N+1 yrs | almost N+1 years | - * - * With `options.includeSeconds == true`: - * | Distance between dates | Result | - * |------------------------|----------------------| - * | 0 secs ... 5 secs | less than 5 seconds | - * | 5 secs ... 10 secs | less than 10 seconds | - * | 10 secs ... 20 secs | less than 20 seconds | - * | 20 secs ... 40 secs | half a minute | - * | 40 secs ... 60 secs | less than a minute | - * | 60 secs ... 90 secs | 1 minute | - * - * @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). - * - * @param date - The date - * @param baseDate - The date to compare with - * @param options - An object with options - * - * @returns The distance in words - * - * @throws `date` must not be Invalid Date - * @throws `baseDate` must not be Invalid Date - * @throws `options.locale` must contain `formatDistance` property - * - * @example - * // What is the distance between 2 July 2014 and 1 January 2015? - * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1)) - * //=> '6 months' - * - * @example - * // What is the distance between 1 January 2015 00:00:15 - * // and 1 January 2015 00:00:00, including seconds? - * const result = formatDistance( - * new Date(2015, 0, 1, 0, 0, 15), - * new Date(2015, 0, 1, 0, 0, 0), - * { includeSeconds: true } - * ) - * //=> 'less than 20 seconds' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, with a suffix? - * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), { - * addSuffix: true - * }) - * //=> 'about 1 year ago' - * - * @example - * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? - * import { eoLocale } from 'date-fns/locale/eo' - * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), { - * locale: eoLocale - * }) - * //=> 'pli ol 1 jaro' - */ - -function formatDistance(date, baseDate, options) { - const defaultOptions = (0, _index7.getDefaultOptions)(); - const locale = - options?.locale ?? defaultOptions.locale ?? _index6.defaultLocale; - const minutesInAlmostTwoDays = 2520; - - const comparison = (0, _index.compareAsc)(date, baseDate); - - if (isNaN(comparison)) { - throw new RangeError("Invalid time value"); - } - - const localizeOptions = Object.assign({}, options, { - addSuffix: options?.addSuffix, - comparison: comparison, - }); - - let dateLeft; - let dateRight; - if (comparison > 0) { - dateLeft = (0, _index5.toDate)(baseDate); - dateRight = (0, _index5.toDate)(date); - } else { - dateLeft = (0, _index5.toDate)(date); - dateRight = (0, _index5.toDate)(baseDate); - } - - const seconds = (0, _index4.differenceInSeconds)(dateRight, dateLeft); - const offsetInSeconds = - ((0, _index8.getTimezoneOffsetInMilliseconds)(dateRight) - - (0, _index8.getTimezoneOffsetInMilliseconds)(dateLeft)) / - 1000; - const minutes = Math.round((seconds - offsetInSeconds) / 60); - let months; - - // 0 up to 2 mins - if (minutes < 2) { - if (options?.includeSeconds) { - if (seconds < 5) { - return locale.formatDistance("lessThanXSeconds", 5, localizeOptions); - } else if (seconds < 10) { - return locale.formatDistance("lessThanXSeconds", 10, localizeOptions); - } else if (seconds < 20) { - return locale.formatDistance("lessThanXSeconds", 20, localizeOptions); - } else if (seconds < 40) { - return locale.formatDistance("halfAMinute", 0, localizeOptions); - } else if (seconds < 60) { - return locale.formatDistance("lessThanXMinutes", 1, localizeOptions); - } else { - return locale.formatDistance("xMinutes", 1, localizeOptions); - } - } else { - if (minutes === 0) { - return locale.formatDistance("lessThanXMinutes", 1, localizeOptions); - } else { - return locale.formatDistance("xMinutes", minutes, localizeOptions); - } - } - - // 2 mins up to 0.75 hrs - } else if (minutes < 45) { - return locale.formatDistance("xMinutes", minutes, localizeOptions); - - // 0.75 hrs up to 1.5 hrs - } else if (minutes < 90) { - return locale.formatDistance("aboutXHours", 1, localizeOptions); - - // 1.5 hrs up to 24 hrs - } else if (minutes < _index2.minutesInDay) { - const hours = Math.round(minutes / 60); - return locale.formatDistance("aboutXHours", hours, localizeOptions); - - // 1 day up to 1.75 days - } else if (minutes < minutesInAlmostTwoDays) { - return locale.formatDistance("xDays", 1, localizeOptions); - - // 1.75 days up to 30 days - } else if (minutes < _index2.minutesInMonth) { - const days = Math.round(minutes / _index2.minutesInDay); - return locale.formatDistance("xDays", days, localizeOptions); - - // 1 month up to 2 months - } else if (minutes < _index2.minutesInMonth * 2) { - months = Math.round(minutes / _index2.minutesInMonth); - return locale.formatDistance("aboutXMonths", months, localizeOptions); - } - - months = (0, _index3.differenceInMonths)(dateRight, dateLeft); - - // 2 months up to 12 months - if (months < 12) { - const nearestMonth = Math.round(minutes / _index2.minutesInMonth); - return locale.formatDistance("xMonths", nearestMonth, localizeOptions); - - // 1 year up to max Date - } else { - const monthsSinceStartOfYear = months % 12; - const years = Math.trunc(months / 12); - - // N years up to 1 years 3 months - if (monthsSinceStartOfYear < 3) { - return locale.formatDistance("aboutXYears", years, localizeOptions); - - // N years 3 months up to N years 9 months - } else if (monthsSinceStartOfYear < 9) { - return locale.formatDistance("overXYears", years, localizeOptions); - - // N years 9 months up to N year 12 months - } else { - return locale.formatDistance("almostXYears", years + 1, localizeOptions); - } - } -} - - -/***/ }), - -/***/ 17916: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatDistanceStrict = formatDistanceStrict; -var _index = __nccwpck_require__(64092); -var _index2 = __nccwpck_require__(42466); -var _index3 = __nccwpck_require__(21639); -var _index4 = __nccwpck_require__(31292); -var _index5 = __nccwpck_require__(76125); -var _index6 = __nccwpck_require__(17818); - -var _index7 = __nccwpck_require__(53622); - -/** - * The {@link formatDistanceStrict} function options. - */ - -/** - * The unit used to format the distance in {@link formatDistanceStrict}. - */ - -/** - * @name formatDistanceStrict - * @category Common Helpers - * @summary Return the distance between the given dates in words. - * - * @description - * Return the distance between the given dates in words, using strict units. - * This is like `formatDistance`, but does not use helpers like 'almost', 'over', - * 'less than' and the like. - * - * | Distance between dates | Result | - * |------------------------|---------------------| - * | 0 ... 59 secs | [0..59] seconds | - * | 1 ... 59 mins | [1..59] minutes | - * | 1 ... 23 hrs | [1..23] hours | - * | 1 ... 29 days | [1..29] days | - * | 1 ... 11 months | [1..11] months | - * | 1 ... N years | [1..N] years | - * - * @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). - * - * @param date - The date - * @param baseDate - The date to compare with - * @param options - An object with options - * - * @returns The distance in words - * - * @throws `date` must not be Invalid Date - * @throws `baseDate` must not be Invalid Date - * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year' - * @throws `options.locale` must contain `formatDistance` property - * - * @example - * // What is the distance between 2 July 2014 and 1 January 2015? - * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2)) - * //=> '6 months' - * - * @example - * // What is the distance between 1 January 2015 00:00:15 - * // and 1 January 2015 00:00:00? - * const result = formatDistanceStrict( - * new Date(2015, 0, 1, 0, 0, 15), - * new Date(2015, 0, 1, 0, 0, 0) - * ) - * //=> '15 seconds' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, with a suffix? - * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), { - * addSuffix: true - * }) - * //=> '1 year ago' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, in minutes? - * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), { - * unit: 'minute' - * }) - * //=> '525600 minutes' - * - * @example - * // What is the distance from 1 January 2015 - * // to 28 January 2015, in months, rounded up? - * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), { - * unit: 'month', - * roundingMethod: 'ceil' - * }) - * //=> '1 month' - * - * @example - * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? - * import { eoLocale } from 'date-fns/locale/eo' - * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), { - * locale: eoLocale - * }) - * //=> '1 jaro' - */ - -function formatDistanceStrict(date, baseDate, options) { - const defaultOptions = (0, _index2.getDefaultOptions)(); - const locale = - options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; - - const comparison = (0, _index5.compareAsc)(date, baseDate); - - if (isNaN(comparison)) { - throw new RangeError("Invalid time value"); - } - - const localizeOptions = Object.assign({}, options, { - addSuffix: options?.addSuffix, - comparison: comparison, - }); - - let dateLeft; - let dateRight; - if (comparison > 0) { - dateLeft = (0, _index7.toDate)(baseDate); - dateRight = (0, _index7.toDate)(date); - } else { - dateLeft = (0, _index7.toDate)(date); - dateRight = (0, _index7.toDate)(baseDate); - } - - const roundingMethod = (0, _index3.getRoundingMethod)( - options?.roundingMethod ?? "round", - ); - - const milliseconds = dateRight.getTime() - dateLeft.getTime(); - const minutes = milliseconds / _index6.millisecondsInMinute; - - const timezoneOffset = - (0, _index4.getTimezoneOffsetInMilliseconds)(dateRight) - - (0, _index4.getTimezoneOffsetInMilliseconds)(dateLeft); - - // Use DST-normalized difference in minutes for years, months and days; - // use regular difference in minutes for hours, minutes and seconds. - const dstNormalizedMinutes = - (milliseconds - timezoneOffset) / _index6.millisecondsInMinute; - - const defaultUnit = options?.unit; - let unit; - if (!defaultUnit) { - if (minutes < 1) { - unit = "second"; - } else if (minutes < 60) { - unit = "minute"; - } else if (minutes < _index6.minutesInDay) { - unit = "hour"; - } else if (dstNormalizedMinutes < _index6.minutesInMonth) { - unit = "day"; - } else if (dstNormalizedMinutes < _index6.minutesInYear) { - unit = "month"; - } else { - unit = "year"; - } - } else { - unit = defaultUnit; - } - - // 0 up to 60 seconds - if (unit === "second") { - const seconds = roundingMethod(milliseconds / 1000); - return locale.formatDistance("xSeconds", seconds, localizeOptions); - - // 1 up to 60 mins - } else if (unit === "minute") { - const roundedMinutes = roundingMethod(minutes); - return locale.formatDistance("xMinutes", roundedMinutes, localizeOptions); - - // 1 up to 24 hours - } else if (unit === "hour") { - const hours = roundingMethod(minutes / 60); - return locale.formatDistance("xHours", hours, localizeOptions); - - // 1 up to 30 days - } else if (unit === "day") { - const days = roundingMethod(dstNormalizedMinutes / _index6.minutesInDay); - return locale.formatDistance("xDays", days, localizeOptions); - - // 1 up to 12 months - } else if (unit === "month") { - const months = roundingMethod( - dstNormalizedMinutes / _index6.minutesInMonth, - ); - return months === 12 && defaultUnit !== "month" - ? locale.formatDistance("xYears", 1, localizeOptions) - : locale.formatDistance("xMonths", months, localizeOptions); - - // 1 year up to max Date - } else { - const years = roundingMethod(dstNormalizedMinutes / _index6.minutesInYear); - return locale.formatDistance("xYears", years, localizeOptions); - } -} - - -/***/ }), - -/***/ 65228: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatDistanceToNow = formatDistanceToNow; -var _index = __nccwpck_require__(87785); - -var _index2 = __nccwpck_require__(63888); - -/** - * The {@link formatDistanceToNow} function options. - */ - -/** - * @name formatDistanceToNow - * @category Common Helpers - * @summary Return the distance between the given date and now in words. - * @pure false - * - * @description - * Return the distance between the given date and now in words. - * - * | Distance to now | Result | - * |-------------------------------------------------------------------|---------------------| - * | 0 ... 30 secs | less than a minute | - * | 30 secs ... 1 min 30 secs | 1 minute | - * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | - * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | - * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | - * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | - * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | - * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | - * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | - * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | - * | 1 yr ... 1 yr 3 months | about 1 year | - * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | - * | 1 yr 9 months ... 2 yrs | almost 2 years | - * | N yrs ... N yrs 3 months | about N years | - * | N yrs 3 months ... N yrs 9 months | over N years | - * | N yrs 9 months ... N+1 yrs | almost N+1 years | - * - * With `options.includeSeconds == true`: - * | Distance to now | Result | - * |---------------------|----------------------| - * | 0 secs ... 5 secs | less than 5 seconds | - * | 5 secs ... 10 secs | less than 10 seconds | - * | 10 secs ... 20 secs | less than 20 seconds | - * | 20 secs ... 40 secs | half a minute | - * | 40 secs ... 60 secs | less than a minute | - * | 60 secs ... 90 secs | 1 minute | - * - * @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). - * - * @param date - The given date - * @param options - The object with options - * - * @returns The distance in words - * - * @throws `date` must not be Invalid Date - * @throws `options.locale` must contain `formatDistance` property - * - * @example - * // If today is 1 January 2015, what is the distance to 2 July 2014? - * const result = formatDistanceToNow( - * new Date(2014, 6, 2) - * ) - * //=> '6 months' - * - * @example - * // If now is 1 January 2015 00:00:00, - * // what is the distance to 1 January 2015 00:00:15, including seconds? - * const result = formatDistanceToNow( - * new Date(2015, 0, 1, 0, 0, 15), - * {includeSeconds: true} - * ) - * //=> 'less than 20 seconds' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 January 2016, with a suffix? - * const result = formatDistanceToNow( - * new Date(2016, 0, 1), - * {addSuffix: true} - * ) - * //=> 'in about 1 year' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 August 2016 in Esperanto? - * const eoLocale = require('date-fns/locale/eo') - * const result = formatDistanceToNow( - * new Date(2016, 7, 1), - * {locale: eoLocale} - * ) - * //=> 'pli ol 1 jaro' - */ -function formatDistanceToNow(date, options) { - return (0, _index2.formatDistance)( - date, - (0, _index.constructNow)(date), - options, - ); -} - - -/***/ }), - -/***/ 84025: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatDistanceToNowStrict = formatDistanceToNowStrict; -var _index = __nccwpck_require__(17916); -var _index2 = __nccwpck_require__(87785); - -/** - * The {@link formatDistanceToNowStrict} function options. - */ - -/** - * @name formatDistanceToNowStrict - * @category Common Helpers - * @summary Return the distance between the given date and now in words. - * @pure false - * - * @description - * Return the distance between the given dates in words, using strict units. - * This is like `formatDistance`, but does not use helpers like 'almost', 'over', - * 'less than' and the like. - * - * | Distance between dates | Result | - * |------------------------|---------------------| - * | 0 ... 59 secs | [0..59] seconds | - * | 1 ... 59 mins | [1..59] minutes | - * | 1 ... 23 hrs | [1..23] hours | - * | 1 ... 29 days | [1..29] days | - * | 1 ... 11 months | [1..11] months | - * | 1 ... N years | [1..N] years | - * - * @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). - * - * @param date - The given date - * @param options - An object with options. - * - * @returns The distance in words - * - * @throws `date` must not be Invalid Date - * @throws `options.locale` must contain `formatDistance` property - * - * @example - * // If today is 1 January 2015, what is the distance to 2 July 2014? - * const result = formatDistanceToNowStrict( - * new Date(2014, 6, 2) - * ) - * //=> '6 months' - * - * @example - * // If now is 1 January 2015 00:00:00, - * // what is the distance to 1 January 2015 00:00:15, including seconds? - * const result = formatDistanceToNowStrict( - * new Date(2015, 0, 1, 0, 0, 15) - * ) - * //=> '15 seconds' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 January 2016, with a suffix? - * const result = formatDistanceToNowStrict( - * new Date(2016, 0, 1), - * {addSuffix: true} - * ) - * //=> 'in 1 year' - * - * @example - * // If today is 28 January 2015, - * // what is the distance to 1 January 2015, in months, rounded up?? - * const result = formatDistanceToNowStrict(new Date(2015, 0, 1), { - * unit: 'month', - * roundingMethod: 'ceil' - * }) - * //=> '1 month' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 January 2016 in Esperanto? - * const eoLocale = require('date-fns/locale/eo') - * const result = formatDistanceToNowStrict( - * new Date(2016, 0, 1), - * {locale: eoLocale} - * ) - * //=> '1 jaro' - */ -function formatDistanceToNowStrict(date, options) { - return (0, _index.formatDistanceStrict)( - date, - (0, _index2.constructNow)(date), - options, - ); -} - - -/***/ }), - -/***/ 42630: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatDuration = formatDuration; - -var _index = __nccwpck_require__(64092); -var _index2 = __nccwpck_require__(42466); - -/** - * The {@link formatDuration} function options. - */ - -const defaultFormat = [ - "years", - "months", - "weeks", - "days", - "hours", - "minutes", - "seconds", -]; - -/** - * @name formatDuration - * @category Common Helpers - * @summary Formats a duration in human-readable format - * - * @description - * Return human-readable duration string i.e. "9 months 2 days" - * - * @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). - * - * @param duration - The duration to format - * @param options - An object with options. - * - * @returns The formatted date string - * - * @example - * // Format full duration - * formatDuration({ - * years: 2, - * months: 9, - * weeks: 1, - * days: 7, - * hours: 5, - * minutes: 9, - * seconds: 30 - * }) - * //=> '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds' - * - * @example - * // Format partial duration - * formatDuration({ months: 9, days: 2 }) - * //=> '9 months 2 days' - * - * @example - * // Customize the format - * formatDuration( - * { - * years: 2, - * months: 9, - * weeks: 1, - * days: 7, - * hours: 5, - * minutes: 9, - * seconds: 30 - * }, - * { format: ['months', 'weeks'] } - * ) === '9 months 1 week' - * - * @example - * // Customize the zeros presence - * formatDuration({ years: 0, months: 9 }) - * //=> '9 months' - * formatDuration({ years: 0, months: 9 }, { zero: true }) - * //=> '0 years 9 months' - * - * @example - * // Customize the delimiter - * formatDuration({ years: 2, months: 9, weeks: 3 }, { delimiter: ', ' }) - * //=> '2 years, 9 months, 3 weeks' - */ -function formatDuration(duration, options) { - const defaultOptions = (0, _index2.getDefaultOptions)(); - const locale = - options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; - const format = options?.format ?? defaultFormat; - const zero = options?.zero ?? false; - const delimiter = options?.delimiter ?? " "; - - if (!locale.formatDistance) { - return ""; - } - - const result = format - .reduce((acc, unit) => { - const token = `x${unit.replace(/(^.)/, (m) => m.toUpperCase())}`; - const value = duration[unit]; - if (value !== undefined && (zero || duration[unit])) { - return acc.concat(locale.formatDistance(token, value)); - } - return acc; - }, []) - .join(delimiter); - - return result; -} - - -/***/ }), - -/***/ 75270: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatISO = formatISO; -var _index = __nccwpck_require__(53622); - -var _index2 = __nccwpck_require__(534); - -/** - * The {@link formatISO} function options. - */ - -/** - * @name formatISO - * @category Common Helpers - * @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). - * - * @description - * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date. - * - * @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). - * - * @param date - The original date - * @param options - An object with options. - * - * @returns The formatted date string (in loca.l time zone) - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC): - * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52)) - * //=> '2019-09-18T19:00:52Z' - * - * @example - * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC): - * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' }) - * //=> '20190918T190052' - * - * @example - * // Represent 18 September 2019 in ISO 8601 format, date only: - * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' }) - * //=> '2019-09-18' - * - * @example - * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC): - * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) - * //=> '19:00:52Z' - */ -function formatISO(date, options) { - const _date = (0, _index.toDate)(date); - - if (isNaN(_date.getTime())) { - throw new RangeError("Invalid time value"); - } - - const format = options?.format ?? "extended"; - const representation = options?.representation ?? "complete"; - - let result = ""; - let tzOffset = ""; - - const dateDelimiter = format === "extended" ? "-" : ""; - const timeDelimiter = format === "extended" ? ":" : ""; - - // Representation is either 'date' or 'complete' - if (representation !== "time") { - const day = (0, _index2.addLeadingZeros)(_date.getDate(), 2); - const month = (0, _index2.addLeadingZeros)(_date.getMonth() + 1, 2); - const year = (0, _index2.addLeadingZeros)(_date.getFullYear(), 4); - - // yyyyMMdd or yyyy-MM-dd. - result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`; - } - - // Representation is either 'time' or 'complete' - if (representation !== "date") { - // Add the timezone. - const offset = _date.getTimezoneOffset(); - - if (offset !== 0) { - const absoluteOffset = Math.abs(offset); - const hourOffset = (0, _index2.addLeadingZeros)( - Math.trunc(absoluteOffset / 60), - 2, - ); - const minuteOffset = (0, _index2.addLeadingZeros)(absoluteOffset % 60, 2); - // If less than 0, the sign is +, because it is ahead of time. - const sign = offset < 0 ? "+" : "-"; - - tzOffset = `${sign}${hourOffset}:${minuteOffset}`; - } else { - tzOffset = "Z"; - } - - const hour = (0, _index2.addLeadingZeros)(_date.getHours(), 2); - const minute = (0, _index2.addLeadingZeros)(_date.getMinutes(), 2); - const second = (0, _index2.addLeadingZeros)(_date.getSeconds(), 2); - - // If there's also date, separate it with time with 'T' - const separator = result === "" ? "" : "T"; - - // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined. - const time = [hour, minute, second].join(timeDelimiter); - - // HHmmss or HH:mm:ss. - result = `${result}${separator}${time}${tzOffset}`; - } - - return result; -} - - -/***/ }), - -/***/ 16964: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatISO9075 = formatISO9075; -var _index = __nccwpck_require__(58915); -var _index2 = __nccwpck_require__(53622); - -var _index3 = __nccwpck_require__(534); - -/** - * The {@link formatISO9075} function options. - */ - -/** - * @name formatISO9075 - * @category Common Helpers - * @summary Format the date according to the ISO 9075 standard (https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_get-format). - * - * @description - * Return the formatted date string in ISO 9075 format. Options may be passed to control the parts and notations of the date. - * - * @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). - * - * @param date - The original date - * @param options - An object with options. - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 18 September 2019 in ISO 9075 format: - * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52)) - * //=> '2019-09-18 19:00:52' - * - * @example - * // Represent 18 September 2019 in ISO 9075, short format: - * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' }) - * //=> '20190918 190052' - * - * @example - * // Represent 18 September 2019 in ISO 9075 format, date only: - * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' }) - * //=> '2019-09-18' - * - * @example - * // Represent 18 September 2019 in ISO 9075 format, time only: - * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) - * //=> '19:00:52' - */ -function formatISO9075(date, options) { - const _date = (0, _index2.toDate)(date); - - if (!(0, _index.isValid)(_date)) { - throw new RangeError("Invalid time value"); - } - - const format = options?.format ?? "extended"; - const representation = options?.representation ?? "complete"; - - let result = ""; - - const dateDelimiter = format === "extended" ? "-" : ""; - const timeDelimiter = format === "extended" ? ":" : ""; - - // Representation is either 'date' or 'complete' - if (representation !== "time") { - const day = (0, _index3.addLeadingZeros)(_date.getDate(), 2); - const month = (0, _index3.addLeadingZeros)(_date.getMonth() + 1, 2); - const year = (0, _index3.addLeadingZeros)(_date.getFullYear(), 4); - - // yyyyMMdd or yyyy-MM-dd. - result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`; - } - - // Representation is either 'time' or 'complete' - if (representation !== "date") { - const hour = (0, _index3.addLeadingZeros)(_date.getHours(), 2); - const minute = (0, _index3.addLeadingZeros)(_date.getMinutes(), 2); - const second = (0, _index3.addLeadingZeros)(_date.getSeconds(), 2); - - // If there's also date, separate it with time with a space - const separator = result === "" ? "" : " "; - - // HHmmss or HH:mm:ss. - result = `${result}${separator}${hour}${timeDelimiter}${minute}${timeDelimiter}${second}`; - } - - return result; -} - - -/***/ }), - -/***/ 44827: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.formatISODuration = formatISODuration; - -/** - * @name formatISODuration - * @category Common Helpers - * @summary Format a duration object according as ISO 8601 duration string - * - * @description - * Format a duration object according to the ISO 8601 duration standard (https://www.digi.com/resources/documentation/digidocs//90001488-13/reference/r_iso_8601_duration_format.htm) - * - * @param duration - The duration to format - * - * @returns The ISO 8601 duration string - * - * @example - * // Format the given duration as ISO 8601 string - * const result = formatISODuration({ - * years: 39, - * months: 2, - * days: 20, - * hours: 7, - * minutes: 5, - * seconds: 0 - * }) - * //=> 'P39Y2M20DT0H0M0S' - */ -function formatISODuration(duration) { - const { - years = 0, - months = 0, - days = 0, - hours = 0, - minutes = 0, - seconds = 0, - } = duration; - - return `P${years}Y${months}M${days}DT${hours}H${minutes}M${seconds}S`; -} - - -/***/ }), - -/***/ 85568: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatRFC3339 = formatRFC3339; -var _index = __nccwpck_require__(58915); -var _index2 = __nccwpck_require__(53622); -var _index3 = __nccwpck_require__(534); - -/** - * The {@link formatRFC3339} function options. - */ - -/** - * @name formatRFC3339 - * @category Common Helpers - * @summary Format the date according to the RFC 3339 standard (https://tools.ietf.org/html/rfc3339#section-5.6). - * - * @description - * Return the formatted date string in RFC 3339 format. Options may be passed to control the parts and notations of the date. - * - * @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). - * - * @param date - The original date - * @param options - An object with options. - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 18 September 2019 in RFC 3339 format: - * formatRFC3339(new Date(2019, 8, 18, 19, 0, 52)) - * //=> '2019-09-18T19:00:52Z' - * - * @example - * // Represent 18 September 2019 in RFC 3339 format, 3 digits of second fraction - * formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { - * fractionDigits: 3 - * }) - * //=> '2019-09-18T19:00:52.234Z' - */ -function formatRFC3339(date, options) { - const _date = (0, _index2.toDate)(date); - - if (!(0, _index.isValid)(_date)) { - throw new RangeError("Invalid time value"); - } - - const fractionDigits = options?.fractionDigits ?? 0; - - const day = (0, _index3.addLeadingZeros)(_date.getDate(), 2); - const month = (0, _index3.addLeadingZeros)(_date.getMonth() + 1, 2); - const year = _date.getFullYear(); - - const hour = (0, _index3.addLeadingZeros)(_date.getHours(), 2); - const minute = (0, _index3.addLeadingZeros)(_date.getMinutes(), 2); - const second = (0, _index3.addLeadingZeros)(_date.getSeconds(), 2); - - let fractionalSecond = ""; - if (fractionDigits > 0) { - const milliseconds = _date.getMilliseconds(); - const fractionalSeconds = Math.trunc( - milliseconds * Math.pow(10, fractionDigits - 3), - ); - fractionalSecond = - "." + (0, _index3.addLeadingZeros)(fractionalSeconds, fractionDigits); - } - - let offset = ""; - const tzOffset = _date.getTimezoneOffset(); - - if (tzOffset !== 0) { - const absoluteOffset = Math.abs(tzOffset); - const hourOffset = (0, _index3.addLeadingZeros)( - Math.trunc(absoluteOffset / 60), - 2, - ); - const minuteOffset = (0, _index3.addLeadingZeros)(absoluteOffset % 60, 2); - // If less than 0, the sign is +, because it is ahead of time. - const sign = tzOffset < 0 ? "+" : "-"; - - offset = `${sign}${hourOffset}:${minuteOffset}`; - } else { - offset = "Z"; - } - - return `${year}-${month}-${day}T${hour}:${minute}:${second}${fractionalSecond}${offset}`; -} - - -/***/ }), - -/***/ 98558: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatRFC7231 = formatRFC7231; -var _index = __nccwpck_require__(58915); -var _index2 = __nccwpck_require__(53622); -var _index3 = __nccwpck_require__(534); - -const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; - -const months = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", -]; - -/** - * @name formatRFC7231 - * @category Common Helpers - * @summary Format the date according to the RFC 7231 standard (https://tools.ietf.org/html/rfc7231#section-7.1.1.1). - * - * @description - * Return the formatted date string in RFC 7231 format. - * The result will always be in UTC timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 18 September 2019 in RFC 7231 format: - * const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52)) - * //=> 'Wed, 18 Sep 2019 19:00:52 GMT' - */ -function formatRFC7231(date) { - const _date = (0, _index2.toDate)(date); - - if (!(0, _index.isValid)(_date)) { - throw new RangeError("Invalid time value"); - } - - const dayName = days[_date.getUTCDay()]; - const dayOfMonth = (0, _index3.addLeadingZeros)(_date.getUTCDate(), 2); - const monthName = months[_date.getUTCMonth()]; - const year = _date.getUTCFullYear(); - - const hour = (0, _index3.addLeadingZeros)(_date.getUTCHours(), 2); - const minute = (0, _index3.addLeadingZeros)(_date.getUTCMinutes(), 2); - const second = (0, _index3.addLeadingZeros)(_date.getUTCSeconds(), 2); - - // Result variables. - return `${dayName}, ${dayOfMonth} ${monthName} ${year} ${hour}:${minute}:${second} GMT`; -} - - -/***/ }), - -/***/ 29429: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatRelative = formatRelative; -var _index = __nccwpck_require__(90338); -var _index2 = __nccwpck_require__(51578); - -var _index3 = __nccwpck_require__(53622); - -var _index4 = __nccwpck_require__(64092); -var _index5 = __nccwpck_require__(42466); - -/** - * The {@link formatRelative} function options. - */ - -/** - * @name formatRelative - * @category Common Helpers - * @summary Represent the date in words relative to the given base date. - * - * @description - * Represent the date in words relative to the given base date. - * - * | Distance to the base date | Result | - * |---------------------------|---------------------------| - * | Previous 6 days | last Sunday at 04:30 AM | - * | Last day | yesterday at 04:30 AM | - * | Same day | today at 04:30 AM | - * | Next day | tomorrow at 04:30 AM | - * | Next 6 days | Sunday at 04:30 AM | - * | Other | 12/31/2017 | - * - * @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). - * - * @param date - The date to format - * @param baseDate - The date to compare with - * @param options - An object with options - * - * @returns The date in words - * - * @throws `date` must not be Invalid Date - * @throws `baseDate` must not be Invalid Date - * @throws `options.locale` must contain `localize` property - * @throws `options.locale` must contain `formatLong` property - * @throws `options.locale` must contain `formatRelative` property - * - * @example - * // Represent the date of 6 days ago in words relative to the given base date. In this example, today is Wednesday - * const result = formatRelative(subDays(new Date(), 6), new Date()) - * //=> "last Thursday at 12:45 AM" - */ -function formatRelative(date, baseDate, options) { - const _date = (0, _index3.toDate)(date); - const _baseDate = (0, _index3.toDate)(baseDate); - - const defaultOptions = (0, _index5.getDefaultOptions)(); - const locale = - options?.locale ?? defaultOptions.locale ?? _index4.defaultLocale; - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - const diff = (0, _index.differenceInCalendarDays)(_date, _baseDate); - - if (isNaN(diff)) { - throw new RangeError("Invalid time value"); - } - - let token; - if (diff < -6) { - token = "other"; - } else if (diff < -1) { - token = "lastWeek"; - } else if (diff < 0) { - token = "yesterday"; - } else if (diff < 1) { - token = "today"; - } else if (diff < 2) { - token = "tomorrow"; - } else if (diff < 7) { - token = "nextWeek"; - } else { - token = "other"; - } - - const formatStr = locale.formatRelative(token, _date, _baseDate, { - locale, - weekStartsOn, - }); - return (0, _index2.format)(_date, formatStr, { locale, weekStartsOn }); -} - - -/***/ }), - -/***/ 57093: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.fromUnixTime = fromUnixTime; -var _index = __nccwpck_require__(53622); - -/** - * @name fromUnixTime - * @category Timestamp Helpers - * @summary Create a date from a Unix timestamp. - * - * @description - * Create a date from a Unix timestamp (in seconds). Decimal values will be discarded. - * - * @param unixTime - The given Unix timestamp (in seconds) - * - * @returns The date - * - * @example - * // Create the date 29 February 2012 11:45:05: - * const result = fromUnixTime(1330515905) - * //=> Wed Feb 29 2012 11:45:05 - */ -function fromUnixTime(unixTime) { - return (0, _index.toDate)(unixTime * 1000); -} - - -/***/ }), - -/***/ 86326: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getDate = getDate; -var _index = __nccwpck_require__(53622); - -/** - * @name getDate - * @category Day Helpers - * @summary Get the day of the month of the given date. - * - * @description - * Get the day of the month of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The day of month - * - * @example - * // Which day of the month is 29 February 2012? - * const result = getDate(new Date(2012, 1, 29)) - * //=> 29 - */ -function getDate(date) { - const _date = (0, _index.toDate)(date); - const dayOfMonth = _date.getDate(); - return dayOfMonth; -} - - -/***/ }), - -/***/ 46172: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getDay = getDay; -var _index = __nccwpck_require__(53622); - -/** - * @name getDay - * @category Weekday Helpers - * @summary Get the day of the week of the given date. - * - * @description - * Get the day of the week of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The day of week, 0 represents Sunday - * - * @example - * // Which day of the week is 29 February 2012? - * const result = getDay(new Date(2012, 1, 29)) - * //=> 3 - */ -function getDay(date) { - const _date = (0, _index.toDate)(date); - const day = _date.getDay(); - return day; -} - - -/***/ }), - -/***/ 900: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getDayOfYear = getDayOfYear; -var _index = __nccwpck_require__(90338); -var _index2 = __nccwpck_require__(63304); -var _index3 = __nccwpck_require__(53622); - -/** - * @name getDayOfYear - * @category Day Helpers - * @summary Get the day of the year of the given date. - * - * @description - * Get the day of the year of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The day of year - * - * @example - * // Which day of the year is 2 July 2014? - * const result = getDayOfYear(new Date(2014, 6, 2)) - * //=> 183 - */ -function getDayOfYear(date) { - const _date = (0, _index3.toDate)(date); - const diff = (0, _index.differenceInCalendarDays)( - _date, - (0, _index2.startOfYear)(_date), - ); - const dayOfYear = diff + 1; - return dayOfYear; -} - - -/***/ }), - -/***/ 75586: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getDaysInMonth = getDaysInMonth; -var _index = __nccwpck_require__(53622); -var _index2 = __nccwpck_require__(92736); - -/** - * @name getDaysInMonth - * @category Month Helpers - * @summary Get the number of days in a month of the given date. - * - * @description - * Get the number of days in a month of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The number of days in a month - * - * @example - * // How many days are in February 2000? - * const result = getDaysInMonth(new Date(2000, 1)) - * //=> 29 - */ -function getDaysInMonth(date) { - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - const monthIndex = _date.getMonth(); - const lastDayOfMonth = (0, _index2.constructFrom)(date, 0); - lastDayOfMonth.setFullYear(year, monthIndex + 1, 0); - lastDayOfMonth.setHours(0, 0, 0, 0); - return lastDayOfMonth.getDate(); -} - - -/***/ }), - -/***/ 96023: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getDaysInYear = getDaysInYear; -var _index = __nccwpck_require__(18260); -var _index2 = __nccwpck_require__(53622); - -/** - * @name getDaysInYear - * @category Year Helpers - * @summary Get the number of days in a year of the given date. - * - * @description - * Get the number of days in a year of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The number of days in a year - * - * @example - * // How many days are in 2012? - * const result = getDaysInYear(new Date(2012, 0, 1)) - * //=> 366 - */ -function getDaysInYear(date) { - const _date = (0, _index2.toDate)(date); - - if (String(new Date(_date)) === "Invalid Date") { - return NaN; - } - - return (0, _index.isLeapYear)(_date) ? 366 : 365; -} - - -/***/ }), - -/***/ 67467: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getDecade = getDecade; -var _index = __nccwpck_require__(53622); - -/** - * @name getDecade - * @category Decade Helpers - * @summary Get the decade of the given date. - * - * @description - * Get the decade of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The year of decade - * - * @example - * // Which decade belongs 27 November 1942? - * const result = getDecade(new Date(1942, 10, 27)) - * //=> 1940 - */ -function getDecade(date) { - // TODO: Switch to more technical definition in of decades that start with 1 - // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking - // change, so it can only be done in 4.0. - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - const decade = Math.floor(year / 10) * 10; - return decade; -} - - -/***/ }), - -/***/ 67157: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getDefaultOptions = getDefaultOptions; - -var _index = __nccwpck_require__(42466); - -/** - * @name getDefaultOptions - * @category Common Helpers - * @summary Get default options. - * @pure false - * - * @description - * Returns an object that contains defaults for - * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate` - * arguments for all functions. - * - * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions). - * - * @returns The default options - * - * @example - * const result = getDefaultOptions() - * //=> {} - * - * @example - * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 }) - * const result = getDefaultOptions() - * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 } - */ -function getDefaultOptions() { - return Object.assign({}, (0, _index.getDefaultOptions)()); -} - - -/***/ }), - -/***/ 41078: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getHours = getHours; -var _index = __nccwpck_require__(53622); - -/** - * @name getHours - * @category Hour Helpers - * @summary Get the hours of the given date. - * - * @description - * Get the hours of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The hours - * - * @example - * // Get the hours of 29 February 2012 11:45:00: - * const result = getHours(new Date(2012, 1, 29, 11, 45)) - * //=> 11 - */ -function getHours(date) { - const _date = (0, _index.toDate)(date); - const hours = _date.getHours(); - return hours; -} - - -/***/ }), - -/***/ 12924: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getISODay = getISODay; -var _index = __nccwpck_require__(53622); - -/** - * @name getISODay - * @category Weekday Helpers - * @summary Get the day of the ISO week of the given date. - * - * @description - * Get the day of the ISO week of the given date, - * which is 7 for Sunday, 1 for Monday etc. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The given date - * - * @returns The day of ISO week - * - * @example - * // Which day of the ISO week is 26 February 2012? - * const result = getISODay(new Date(2012, 1, 26)) - * //=> 7 - */ -function getISODay(date) { - const _date = (0, _index.toDate)(date); - let day = _date.getDay(); - - if (day === 0) { - day = 7; - } - - return day; -} - - -/***/ }), - -/***/ 66475: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getISOWeek = getISOWeek; -var _index = __nccwpck_require__(17818); -var _index2 = __nccwpck_require__(69709); -var _index3 = __nccwpck_require__(37809); -var _index4 = __nccwpck_require__(53622); - -/** - * @name getISOWeek - * @category ISO Week Helpers - * @summary Get the ISO week of the given date. - * - * @description - * Get the ISO week of the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The given date - * - * @returns The ISO week - * - * @example - * // Which week of the ISO-week numbering year is 2 January 2005? - * const result = getISOWeek(new Date(2005, 0, 2)) - * //=> 53 - */ -function getISOWeek(date) { - const _date = (0, _index4.toDate)(date); - const diff = - +(0, _index2.startOfISOWeek)(_date) - - +(0, _index3.startOfISOWeekYear)(_date); - - // Round the number of weeks to the nearest integer because the number of - // milliseconds in a week is not constant (e.g. it's different in the week of - // the daylight saving time clock shift). - return Math.round(diff / _index.millisecondsInWeek) + 1; -} - - -/***/ }), - -/***/ 90308: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getISOWeekYear = getISOWeekYear; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(69709); -var _index3 = __nccwpck_require__(53622); - -/** - * @name getISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Get the ISO week-numbering year of the given date. - * - * @description - * Get the ISO week-numbering year of the given date, - * which always starts 3 days before the year's first Thursday. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The given date - * - * @returns The ISO week-numbering year - * - * @example - * // Which ISO-week numbering year is 2 January 2005? - * const result = getISOWeekYear(new Date(2005, 0, 2)) - * //=> 2004 - */ -function getISOWeekYear(date) { - const _date = (0, _index3.toDate)(date); - const year = _date.getFullYear(); - - const fourthOfJanuaryOfNextYear = (0, _index.constructFrom)(date, 0); - fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); - fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); - const startOfNextYear = (0, _index2.startOfISOWeek)( - fourthOfJanuaryOfNextYear, - ); - - const fourthOfJanuaryOfThisYear = (0, _index.constructFrom)(date, 0); - fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); - fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); - const startOfThisYear = (0, _index2.startOfISOWeek)( - fourthOfJanuaryOfThisYear, - ); - - if (_date.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (_date.getTime() >= startOfThisYear.getTime()) { - return year; - } else { - return year - 1; - } -} - - -/***/ }), - -/***/ 53283: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getISOWeeksInYear = getISOWeeksInYear; -var _index = __nccwpck_require__(66985); -var _index2 = __nccwpck_require__(17818); -var _index3 = __nccwpck_require__(37809); - -/** - * @name getISOWeeksInYear - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of weeks in an ISO week-numbering year of the given date. - * - * @description - * Get the number of weeks in an ISO week-numbering year of the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The given date - * - * @returns The number of ISO weeks in a year - * - * @example - * // How many weeks are in ISO week-numbering year 2015? - * const result = getISOWeeksInYear(new Date(2015, 1, 11)) - * //=> 53 - */ -function getISOWeeksInYear(date) { - const thisYear = (0, _index3.startOfISOWeekYear)(date); - const nextYear = (0, _index3.startOfISOWeekYear)( - (0, _index.addWeeks)(thisYear, 60), - ); - const diff = +nextYear - +thisYear; - - // Round the number of weeks to the nearest integer because the number of - // milliseconds in a week is not constant (e.g. it's different in the week of - // the daylight saving time clock shift). - return Math.round(diff / _index2.millisecondsInWeek); -} - - -/***/ }), - -/***/ 95495: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getMilliseconds = getMilliseconds; -var _index = __nccwpck_require__(53622); - -/** - * @name getMilliseconds - * @category Millisecond Helpers - * @summary Get the milliseconds of the given date. - * - * @description - * Get the milliseconds of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The milliseconds - * - * @example - * // Get the milliseconds of 29 February 2012 11:45:05.123: - * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123)) - * //=> 123 - */ -function getMilliseconds(date) { - const _date = (0, _index.toDate)(date); - const milliseconds = _date.getMilliseconds(); - return milliseconds; -} - - -/***/ }), - -/***/ 16012: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getMinutes = getMinutes; -var _index = __nccwpck_require__(53622); - -/** - * @name getMinutes - * @category Minute Helpers - * @summary Get the minutes of the given date. - * - * @description - * Get the minutes of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The minutes - * - * @example - * // Get the minutes of 29 February 2012 11:45:05: - * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5)) - * //=> 45 - */ -function getMinutes(date) { - const _date = (0, _index.toDate)(date); - const minutes = _date.getMinutes(); - return minutes; -} - - -/***/ }), - -/***/ 6829: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getMonth = getMonth; -var _index = __nccwpck_require__(53622); - -/** - * @name getMonth - * @category Month Helpers - * @summary Get the month of the given date. - * - * @description - * Get the month of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The month index (0-11) - * - * @example - * // Which month is 29 February 2012? - * const result = getMonth(new Date(2012, 1, 29)) - * //=> 1 - */ -function getMonth(date) { - const _date = (0, _index.toDate)(date); - const month = _date.getMonth(); - return month; -} - - -/***/ }), - -/***/ 41417: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getOverlappingDaysInIntervals = getOverlappingDaysInIntervals; -var _index = __nccwpck_require__(31292); -var _index2 = __nccwpck_require__(17818); -var _index3 = __nccwpck_require__(53622); - -/** - * @name getOverlappingDaysInIntervals - * @category Interval Helpers - * @summary Get the number of days that overlap in two time intervals - * - * @description - * Get the number of days that overlap in two time intervals. It uses the time - * between dates to calculate the number of days, rounding it up to include - * partial days. - * - * Two equal 0-length intervals will result in 0. Two equal 1ms intervals will - * result in 1. - * - * @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). - * - * @param intervalLeft - The first interval to compare. - * @param intervalRight - The second interval to compare. - * - * @returns The number of days that overlap in two time intervals - * - * @example - * // For overlapping time intervals adds 1 for each started overlapping day: - * getOverlappingDaysInIntervals( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } - * ) - * //=> 3 - * - * @example - * // For non-overlapping time intervals returns 0: - * getOverlappingDaysInIntervals( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } - * ) - * //=> 0 - */ - -function getOverlappingDaysInIntervals(intervalLeft, intervalRight) { - const [leftStart, leftEnd] = [ - +(0, _index3.toDate)(intervalLeft.start), - +(0, _index3.toDate)(intervalLeft.end), - ].sort((a, b) => a - b); - const [rightStart, rightEnd] = [ - +(0, _index3.toDate)(intervalRight.start), - +(0, _index3.toDate)(intervalRight.end), - ].sort((a, b) => a - b); - - // Prevent NaN result if intervals don't overlap at all. - const isOverlapping = leftStart < rightEnd && rightStart < leftEnd; - if (!isOverlapping) return 0; - - // Remove the timezone offset to negate the DST effect on calculations. - const overlapLeft = rightStart < leftStart ? leftStart : rightStart; - const left = - overlapLeft - (0, _index.getTimezoneOffsetInMilliseconds)(overlapLeft); - const overlapRight = rightEnd > leftEnd ? leftEnd : rightEnd; - const right = - overlapRight - (0, _index.getTimezoneOffsetInMilliseconds)(overlapRight); - - // Ceil the number to include partial days too. - return Math.ceil((right - left) / _index2.millisecondsInDay); -} - - -/***/ }), - -/***/ 2243: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getQuarter = getQuarter; -var _index = __nccwpck_require__(53622); - -/** - * @name getQuarter - * @category Quarter Helpers - * @summary Get the year quarter of the given date. - * - * @description - * Get the year quarter of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The quarter - * - * @example - * // Which quarter is 2 July 2014? - * const result = getQuarter(new Date(2014, 6, 2)) - * //=> 3 - */ -function getQuarter(date) { - const _date = (0, _index.toDate)(date); - const quarter = Math.trunc(_date.getMonth() / 3) + 1; - return quarter; -} - - -/***/ }), - -/***/ 14426: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getSeconds = getSeconds; -var _index = __nccwpck_require__(53622); - -/** - * @name getSeconds - * @category Second Helpers - * @summary Get the seconds of the given date. - * - * @description - * Get the seconds of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The seconds - * - * @example - * // Get the seconds of 29 February 2012 11:45:05.123: - * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123)) - * //=> 5 - */ -function getSeconds(date) { - const _date = (0, _index.toDate)(date); - const seconds = _date.getSeconds(); - return seconds; -} - - -/***/ }), - -/***/ 88370: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getTime = getTime; -var _index = __nccwpck_require__(53622); - -/** - * @name getTime - * @category Timestamp Helpers - * @summary Get the milliseconds timestamp of the given date. - * - * @description - * Get the milliseconds timestamp of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The timestamp - * - * @example - * // Get the timestamp of 29 February 2012 11:45:05.123: - * const result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123)) - * //=> 1330515905123 - */ -function getTime(date) { - const _date = (0, _index.toDate)(date); - const timestamp = _date.getTime(); - return timestamp; -} - - -/***/ }), - -/***/ 29493: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getUnixTime = getUnixTime; -var _index = __nccwpck_require__(53622); - -/** - * @name getUnixTime - * @category Timestamp Helpers - * @summary Get the seconds timestamp of the given date. - * - * @description - * Get the seconds timestamp of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The timestamp - * - * @example - * // Get the timestamp of 29 February 2012 11:45:05 CET: - * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5)) - * //=> 1330512305 - */ -function getUnixTime(date) { - return Math.trunc(+(0, _index.toDate)(date) / 1000); -} - - -/***/ }), - -/***/ 90802: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getWeek = getWeek; -var _index = __nccwpck_require__(17818); -var _index2 = __nccwpck_require__(26068); -var _index3 = __nccwpck_require__(31348); -var _index4 = __nccwpck_require__(53622); - -/** - * The {@link getWeek} function options. - */ - -/** - * @name getWeek - * @category Week Helpers - * @summary Get the local week index of the given date. - * - * @description - * Get the local week index of the given date. - * The exact calculation depends on the values of - * `options.weekStartsOn` (which is the index of the first day of the week) - * and `options.firstWeekContainsDate` (which is the day of January, which is always in - * the first week of the week-numbering year) - * - * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system - * - * @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). - * - * @param date - The given date - * @param options - An object with options - * - * @returns The week - * - * @example - * // Which week of the local week numbering year is 2 January 2005 with default options? - * const result = getWeek(new Date(2005, 0, 2)) - * //=> 2 - * - * @example - * // Which week of the local week numbering year is 2 January 2005, - * // if Monday is the first day of the week, - * // and the first week of the year always contains 4 January? - * const result = getWeek(new Date(2005, 0, 2), { - * weekStartsOn: 1, - * firstWeekContainsDate: 4 - * }) - * //=> 53 - */ - -function getWeek(date, options) { - const _date = (0, _index4.toDate)(date); - const diff = - +(0, _index2.startOfWeek)(_date, options) - - +(0, _index3.startOfWeekYear)(_date, options); - - // Round the number of weeks to the nearest integer because the number of - // milliseconds in a week is not constant (e.g. it's different in the week of - // the daylight saving time clock shift). - return Math.round(diff / _index.millisecondsInWeek) + 1; -} - - -/***/ }), - -/***/ 22088: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getWeekOfMonth = getWeekOfMonth; -var _index = __nccwpck_require__(86326); -var _index2 = __nccwpck_require__(46172); -var _index3 = __nccwpck_require__(80050); - -var _index4 = __nccwpck_require__(42466); - -/** - * The {@link getWeekOfMonth} function options. - */ - -/** - * @name getWeekOfMonth - * @category Week Helpers - * @summary Get the week of the month of the given date. - * - * @description - * Get the week of the month of the given date. - * - * @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). - * - * @param date - The given date - * @param options - An object with options. - * - * @returns The week of month - * - * @example - * // Which week of the month is 9 November 2017? - * const result = getWeekOfMonth(new Date(2017, 10, 9)) - * //=> 2 - */ -function getWeekOfMonth(date, options) { - const defaultOptions = (0, _index4.getDefaultOptions)(); - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - const currentDayOfMonth = (0, _index.getDate)(date); - if (isNaN(currentDayOfMonth)) return NaN; - - const startWeekDay = (0, _index2.getDay)((0, _index3.startOfMonth)(date)); - - let lastDayOfFirstWeek = weekStartsOn - startWeekDay; - if (lastDayOfFirstWeek <= 0) lastDayOfFirstWeek += 7; - - const remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek; - return Math.ceil(remainingDaysAfterFirstWeek / 7) + 1; -} - - -/***/ }), - -/***/ 87669: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getWeekYear = getWeekYear; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(26068); -var _index3 = __nccwpck_require__(53622); - -var _index4 = __nccwpck_require__(42466); - -/** - * The {@link getWeekYear} function options. - */ - -/** - * @name getWeekYear - * @category Week-Numbering Year Helpers - * @summary Get the local week-numbering year of the given date. - * - * @description - * Get the local week-numbering year of the given date. - * The exact calculation depends on the values of - * `options.weekStartsOn` (which is the index of the first day of the week) - * and `options.firstWeekContainsDate` (which is the day of January, which is always in - * the first week of the week-numbering year) - * - * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system - * - * @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). - * - * @param date - The given date - * @param options - An object with options. - * - * @returns The local week-numbering year - * - * @example - * // Which week numbering year is 26 December 2004 with the default settings? - * const result = getWeekYear(new Date(2004, 11, 26)) - * //=> 2005 - * - * @example - * // Which week numbering year is 26 December 2004 if week starts on Saturday? - * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 }) - * //=> 2004 - * - * @example - * // Which week numbering year is 26 December 2004 if the first week contains 4 January? - * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 }) - * //=> 2004 - */ -function getWeekYear(date, options) { - const _date = (0, _index3.toDate)(date); - const year = _date.getFullYear(); - - const defaultOptions = (0, _index4.getDefaultOptions)(); - const firstWeekContainsDate = - options?.firstWeekContainsDate ?? - options?.locale?.options?.firstWeekContainsDate ?? - defaultOptions.firstWeekContainsDate ?? - defaultOptions.locale?.options?.firstWeekContainsDate ?? - 1; - - const firstWeekOfNextYear = (0, _index.constructFrom)(date, 0); - firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); - firstWeekOfNextYear.setHours(0, 0, 0, 0); - const startOfNextYear = (0, _index2.startOfWeek)( - firstWeekOfNextYear, - options, - ); - - const firstWeekOfThisYear = (0, _index.constructFrom)(date, 0); - firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); - firstWeekOfThisYear.setHours(0, 0, 0, 0); - const startOfThisYear = (0, _index2.startOfWeek)( - firstWeekOfThisYear, - options, - ); - - if (_date.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (_date.getTime() >= startOfThisYear.getTime()) { - return year; - } else { - return year - 1; - } -} - - -/***/ }), - -/***/ 49051: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getWeeksInMonth = getWeeksInMonth; -var _index = __nccwpck_require__(21538); -var _index2 = __nccwpck_require__(97270); -var _index3 = __nccwpck_require__(80050); - -/** - * The {@link getWeeksInMonth} function options. - */ - -/** - * @name getWeeksInMonth - * @category Week Helpers - * @summary Get the number of calendar weeks a month spans. - * - * @description - * Get the number of calendar weeks the month in the given date spans. - * - * @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). - * - * @param date - The given date - * @param options - An object with options. - * - * @returns The number of calendar weeks - * - * @example - * // How many calendar weeks does February 2015 span? - * const result = getWeeksInMonth(new Date(2015, 1, 8)) - * //=> 4 - * - * @example - * // If the week starts on Monday, - * // how many calendar weeks does July 2017 span? - * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 }) - * //=> 6 - */ -function getWeeksInMonth(date, options) { - return ( - (0, _index.differenceInCalendarWeeks)( - (0, _index2.lastDayOfMonth)(date), - (0, _index3.startOfMonth)(date), - options, - ) + 1 - ); -} - - -/***/ }), - -/***/ 46714: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.getYear = getYear; -var _index = __nccwpck_require__(53622); - -/** - * @name getYear - * @category Year Helpers - * @summary Get the year of the given date. - * - * @description - * Get the year of the given date. - * - * @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). - * - * @param date - The given date - * - * @returns The year - * - * @example - * // Which year is 2 July 2014? - * const result = getYear(new Date(2014, 6, 2)) - * //=> 2014 - */ -function getYear(date) { - return (0, _index.toDate)(date).getFullYear(); -} - - -/***/ }), - -/***/ 91656: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.hoursToMilliseconds = hoursToMilliseconds; -var _index = __nccwpck_require__(17818); - -/** - * @name hoursToMilliseconds - * @category Conversion Helpers - * @summary Convert hours to milliseconds. - * - * @description - * Convert a number of hours to a full number of milliseconds. - * - * @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). - * - * @param hours - number of hours to be converted - * - * @returns The number of hours converted to milliseconds - * - * @example - * // Convert 2 hours to milliseconds: - * const result = hoursToMilliseconds(2) - * //=> 7200000 - */ -function hoursToMilliseconds(hours) { - return Math.trunc(hours * _index.millisecondsInHour); -} - - -/***/ }), - -/***/ 16470: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.hoursToMinutes = hoursToMinutes; -var _index = __nccwpck_require__(17818); - -/** - * @name hoursToMinutes - * @category Conversion Helpers - * @summary Convert hours to minutes. - * - * @description - * Convert a number of hours to a full number of minutes. - * - * @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). - * - * @param hours - number of hours to be converted - * - * @returns The number of hours converted in minutes - * - * @example - * // Convert 2 hours to minutes: - * const result = hoursToMinutes(2) - * //=> 120 - */ -function hoursToMinutes(hours) { - return Math.trunc(hours * _index.minutesInHour); -} - - -/***/ }), - -/***/ 24970: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.hoursToSeconds = hoursToSeconds; -var _index = __nccwpck_require__(17818); - -/** - * @name hoursToSeconds - * @category Conversion Helpers - * @summary Convert hours to seconds. - * - * @description - * Convert a number of hours to a full number of seconds. - * - * @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). - * - * @param hours - The number of hours to be converted - * - * @returns The number of hours converted in seconds - * - * @example - * // Convert 2 hours to seconds: - * const result = hoursToSeconds(2) - * //=> 7200 - */ -function hoursToSeconds(hours) { - return Math.trunc(hours * _index.secondsInHour); -} - - -/***/ }), - -/***/ 73314: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var _index = __nccwpck_require__(13110); -Object.keys(_index).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index[key]; - }, - }); -}); -var _index2 = __nccwpck_require__(11060); -Object.keys(_index2).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index2[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index2[key]; - }, - }); -}); -var _index3 = __nccwpck_require__(8361); -Object.keys(_index3).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index3[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index3[key]; - }, - }); -}); -var _index4 = __nccwpck_require__(89994); -Object.keys(_index4).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index4[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index4[key]; - }, - }); -}); -var _index5 = __nccwpck_require__(89209); -Object.keys(_index5).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index5[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index5[key]; - }, - }); -}); -var _index6 = __nccwpck_require__(28671); -Object.keys(_index6).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index6[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index6[key]; - }, - }); -}); -var _index7 = __nccwpck_require__(97231); -Object.keys(_index7).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index7[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index7[key]; - }, - }); -}); -var _index8 = __nccwpck_require__(84119); -Object.keys(_index8).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index8[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index8[key]; - }, - }); -}); -var _index9 = __nccwpck_require__(17153); -Object.keys(_index9).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index9[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index9[key]; - }, - }); -}); -var _index10 = __nccwpck_require__(63378); -Object.keys(_index10).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index10[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index10[key]; - }, - }); -}); -var _index11 = __nccwpck_require__(66985); -Object.keys(_index11).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index11[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index11[key]; - }, - }); -}); -var _index12 = __nccwpck_require__(77204); -Object.keys(_index12).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index12[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index12[key]; - }, - }); -}); -var _index13 = __nccwpck_require__(88690); -Object.keys(_index13).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index13[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index13[key]; - }, - }); -}); -var _index14 = __nccwpck_require__(68832); -Object.keys(_index14).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index14[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index14[key]; - }, - }); -}); -var _index15 = __nccwpck_require__(52563); -Object.keys(_index15).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index15[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index15[key]; - }, - }); -}); -var _index16 = __nccwpck_require__(50043); -Object.keys(_index16).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index16[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index16[key]; - }, - }); -}); -var _index17 = __nccwpck_require__(76125); -Object.keys(_index17).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index17[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index17[key]; - }, - }); -}); -var _index18 = __nccwpck_require__(53259); -Object.keys(_index18).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index18[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index18[key]; - }, - }); -}); -var _index19 = __nccwpck_require__(92736); -Object.keys(_index19).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index19[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index19[key]; - }, - }); -}); -var _index20 = __nccwpck_require__(87785); -Object.keys(_index20).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index20[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index20[key]; - }, - }); -}); -var _index21 = __nccwpck_require__(85123); -Object.keys(_index21).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index21[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index21[key]; - }, - }); -}); -var _index22 = __nccwpck_require__(26753); -Object.keys(_index22).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index22[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index22[key]; - }, - }); -}); -var _index23 = __nccwpck_require__(90338); -Object.keys(_index23).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index23[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index23[key]; - }, - }); -}); -var _index24 = __nccwpck_require__(99321); -Object.keys(_index24).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index24[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index24[key]; - }, - }); -}); -var _index25 = __nccwpck_require__(74765); -Object.keys(_index25).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index25[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index25[key]; - }, - }); -}); -var _index26 = __nccwpck_require__(34939); -Object.keys(_index26).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index26[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index26[key]; - }, - }); -}); -var _index27 = __nccwpck_require__(73599); -Object.keys(_index27).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index27[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index27[key]; - }, - }); -}); -var _index28 = __nccwpck_require__(21538); -Object.keys(_index28).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index28[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index28[key]; - }, - }); -}); -var _index29 = __nccwpck_require__(36143); -Object.keys(_index29).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index29[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index29[key]; - }, - }); -}); -var _index30 = __nccwpck_require__(96605); -Object.keys(_index30).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index30[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index30[key]; - }, - }); -}); -var _index31 = __nccwpck_require__(37407); -Object.keys(_index31).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index31[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index31[key]; - }, - }); -}); -var _index32 = __nccwpck_require__(797); -Object.keys(_index32).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index32[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index32[key]; - }, - }); -}); -var _index33 = __nccwpck_require__(95654); -Object.keys(_index33).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index33[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index33[key]; - }, - }); -}); -var _index34 = __nccwpck_require__(26235); -Object.keys(_index34).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index34[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index34[key]; - }, - }); -}); -var _index35 = __nccwpck_require__(13045); -Object.keys(_index35).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index35[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index35[key]; - }, - }); -}); -var _index36 = __nccwpck_require__(40924); -Object.keys(_index36).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index36[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index36[key]; - }, - }); -}); -var _index37 = __nccwpck_require__(14944); -Object.keys(_index37).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index37[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index37[key]; - }, - }); -}); -var _index38 = __nccwpck_require__(27488); -Object.keys(_index38).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index38[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index38[key]; - }, - }); -}); -var _index39 = __nccwpck_require__(40830); -Object.keys(_index39).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index39[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index39[key]; - }, - }); -}); -var _index40 = __nccwpck_require__(82367); -Object.keys(_index40).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index40[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index40[key]; - }, - }); -}); -var _index41 = __nccwpck_require__(74086); -Object.keys(_index41).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index41[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index41[key]; - }, - }); -}); -var _index42 = __nccwpck_require__(41836); -Object.keys(_index42).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index42[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index42[key]; - }, - }); -}); -var _index43 = __nccwpck_require__(425); -Object.keys(_index43).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index43[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index43[key]; - }, - }); -}); -var _index44 = __nccwpck_require__(87978); -Object.keys(_index44).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index44[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index44[key]; - }, - }); -}); -var _index45 = __nccwpck_require__(21103); -Object.keys(_index45).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index45[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index45[key]; - }, - }); -}); -var _index46 = __nccwpck_require__(85984); -Object.keys(_index46).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index46[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index46[key]; - }, - }); -}); -var _index47 = __nccwpck_require__(77633); -Object.keys(_index47).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index47[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index47[key]; - }, - }); -}); -var _index48 = __nccwpck_require__(44666); -Object.keys(_index48).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index48[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index48[key]; - }, - }); -}); -var _index49 = __nccwpck_require__(98256); -Object.keys(_index49).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index49[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index49[key]; - }, - }); -}); -var _index50 = __nccwpck_require__(86610); -Object.keys(_index50).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index50[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index50[key]; - }, - }); -}); -var _index51 = __nccwpck_require__(76877); -Object.keys(_index51).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index51[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index51[key]; - }, - }); -}); -var _index52 = __nccwpck_require__(92987); -Object.keys(_index52).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index52[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index52[key]; - }, - }); -}); -var _index53 = __nccwpck_require__(64056); -Object.keys(_index53).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index53[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index53[key]; - }, - }); -}); -var _index54 = __nccwpck_require__(52961); -Object.keys(_index54).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index54[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index54[key]; - }, - }); -}); -var _index55 = __nccwpck_require__(15953); -Object.keys(_index55).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index55[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index55[key]; - }, - }); -}); -var _index56 = __nccwpck_require__(63434); -Object.keys(_index56).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index56[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index56[key]; - }, - }); -}); -var _index57 = __nccwpck_require__(89479); -Object.keys(_index57).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index57[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index57[key]; - }, - }); -}); -var _index58 = __nccwpck_require__(36169); -Object.keys(_index58).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index58[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index58[key]; - }, - }); -}); -var _index59 = __nccwpck_require__(50003); -Object.keys(_index59).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index59[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index59[key]; - }, - }); -}); -var _index60 = __nccwpck_require__(72019); -Object.keys(_index60).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index60[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index60[key]; - }, - }); -}); -var _index61 = __nccwpck_require__(78135); -Object.keys(_index61).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index61[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index61[key]; - }, - }); -}); -var _index62 = __nccwpck_require__(36063); -Object.keys(_index62).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index62[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index62[key]; - }, - }); -}); -var _index63 = __nccwpck_require__(99317); -Object.keys(_index63).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index63[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index63[key]; - }, - }); -}); -var _index64 = __nccwpck_require__(51578); -Object.keys(_index64).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index64[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index64[key]; - }, - }); -}); -var _index65 = __nccwpck_require__(63888); -Object.keys(_index65).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index65[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index65[key]; - }, - }); -}); -var _index66 = __nccwpck_require__(17916); -Object.keys(_index66).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index66[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index66[key]; - }, - }); -}); -var _index67 = __nccwpck_require__(65228); -Object.keys(_index67).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index67[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index67[key]; - }, - }); -}); -var _index68 = __nccwpck_require__(84025); -Object.keys(_index68).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index68[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index68[key]; - }, - }); -}); -var _index69 = __nccwpck_require__(42630); -Object.keys(_index69).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index69[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index69[key]; - }, - }); -}); -var _index70 = __nccwpck_require__(75270); -Object.keys(_index70).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index70[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index70[key]; - }, - }); -}); -var _index71 = __nccwpck_require__(16964); -Object.keys(_index71).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index71[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index71[key]; - }, - }); -}); -var _index72 = __nccwpck_require__(44827); -Object.keys(_index72).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index72[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index72[key]; - }, - }); -}); -var _index73 = __nccwpck_require__(85568); -Object.keys(_index73).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index73[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index73[key]; - }, - }); -}); -var _index74 = __nccwpck_require__(98558); -Object.keys(_index74).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index74[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index74[key]; - }, - }); -}); -var _index75 = __nccwpck_require__(29429); -Object.keys(_index75).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index75[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index75[key]; - }, - }); -}); -var _index76 = __nccwpck_require__(57093); -Object.keys(_index76).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index76[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index76[key]; - }, - }); -}); -var _index77 = __nccwpck_require__(86326); -Object.keys(_index77).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index77[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index77[key]; - }, - }); -}); -var _index78 = __nccwpck_require__(46172); -Object.keys(_index78).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index78[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index78[key]; - }, - }); -}); -var _index79 = __nccwpck_require__(900); -Object.keys(_index79).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index79[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index79[key]; - }, - }); -}); -var _index80 = __nccwpck_require__(75586); -Object.keys(_index80).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index80[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index80[key]; - }, - }); -}); -var _index81 = __nccwpck_require__(96023); -Object.keys(_index81).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index81[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index81[key]; - }, - }); -}); -var _index82 = __nccwpck_require__(67467); -Object.keys(_index82).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index82[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index82[key]; - }, - }); -}); -var _index83 = __nccwpck_require__(67157); -Object.keys(_index83).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index83[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index83[key]; - }, - }); -}); -var _index84 = __nccwpck_require__(41078); -Object.keys(_index84).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index84[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index84[key]; - }, - }); -}); -var _index85 = __nccwpck_require__(12924); -Object.keys(_index85).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index85[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index85[key]; - }, - }); -}); -var _index86 = __nccwpck_require__(66475); -Object.keys(_index86).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index86[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index86[key]; - }, - }); -}); -var _index87 = __nccwpck_require__(90308); -Object.keys(_index87).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index87[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index87[key]; - }, - }); -}); -var _index88 = __nccwpck_require__(53283); -Object.keys(_index88).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index88[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index88[key]; - }, - }); -}); -var _index89 = __nccwpck_require__(95495); -Object.keys(_index89).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index89[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index89[key]; - }, - }); -}); -var _index90 = __nccwpck_require__(16012); -Object.keys(_index90).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index90[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index90[key]; - }, - }); -}); -var _index91 = __nccwpck_require__(6829); -Object.keys(_index91).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index91[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index91[key]; - }, - }); -}); -var _index92 = __nccwpck_require__(41417); -Object.keys(_index92).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index92[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index92[key]; - }, - }); -}); -var _index93 = __nccwpck_require__(2243); -Object.keys(_index93).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index93[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index93[key]; - }, - }); -}); -var _index94 = __nccwpck_require__(14426); -Object.keys(_index94).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index94[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index94[key]; - }, - }); -}); -var _index95 = __nccwpck_require__(88370); -Object.keys(_index95).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index95[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index95[key]; - }, - }); -}); -var _index96 = __nccwpck_require__(29493); -Object.keys(_index96).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index96[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index96[key]; - }, - }); -}); -var _index97 = __nccwpck_require__(90802); -Object.keys(_index97).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index97[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index97[key]; - }, - }); -}); -var _index98 = __nccwpck_require__(22088); -Object.keys(_index98).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index98[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index98[key]; - }, - }); -}); -var _index99 = __nccwpck_require__(87669); -Object.keys(_index99).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index99[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index99[key]; - }, - }); -}); -var _index100 = __nccwpck_require__(49051); -Object.keys(_index100).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index100[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index100[key]; - }, - }); -}); -var _index101 = __nccwpck_require__(46714); -Object.keys(_index101).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index101[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index101[key]; - }, - }); -}); -var _index102 = __nccwpck_require__(91656); -Object.keys(_index102).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index102[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index102[key]; - }, - }); -}); -var _index103 = __nccwpck_require__(16470); -Object.keys(_index103).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index103[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index103[key]; - }, - }); -}); -var _index104 = __nccwpck_require__(24970); -Object.keys(_index104).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index104[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index104[key]; - }, - }); -}); -var _index105 = __nccwpck_require__(8039); -Object.keys(_index105).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index105[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index105[key]; - }, - }); -}); -var _index106 = __nccwpck_require__(18019); -Object.keys(_index106).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index106[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index106[key]; - }, - }); -}); -var _index107 = __nccwpck_require__(76582); -Object.keys(_index107).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index107[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index107[key]; - }, - }); -}); -var _index108 = __nccwpck_require__(77229); -Object.keys(_index108).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index108[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index108[key]; - }, - }); -}); -var _index109 = __nccwpck_require__(33846); -Object.keys(_index109).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index109[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index109[key]; - }, - }); -}); -var _index110 = __nccwpck_require__(23964); -Object.keys(_index110).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index110[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index110[key]; - }, - }); -}); -var _index111 = __nccwpck_require__(62272); -Object.keys(_index111).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index111[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index111[key]; - }, - }); -}); -var _index112 = __nccwpck_require__(51995); -Object.keys(_index112).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index112[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index112[key]; - }, - }); -}); -var _index113 = __nccwpck_require__(44912); -Object.keys(_index113).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index113[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index113[key]; - }, - }); -}); -var _index114 = __nccwpck_require__(64387); -Object.keys(_index114).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index114[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index114[key]; - }, - }); -}); -var _index115 = __nccwpck_require__(91861); -Object.keys(_index115).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index115[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index115[key]; - }, - }); -}); -var _index116 = __nccwpck_require__(26513); -Object.keys(_index116).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index116[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index116[key]; - }, - }); -}); -var _index117 = __nccwpck_require__(5894); -Object.keys(_index117).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index117[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index117[key]; - }, - }); -}); -var _index118 = __nccwpck_require__(18260); -Object.keys(_index118).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index118[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index118[key]; - }, - }); -}); -var _index119 = __nccwpck_require__(34699); -Object.keys(_index119).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index119[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index119[key]; - }, - }); -}); -var _index120 = __nccwpck_require__(47369); -Object.keys(_index120).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index120[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index120[key]; - }, - }); -}); -var _index121 = __nccwpck_require__(14687); -Object.keys(_index121).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index121[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index121[key]; - }, - }); -}); -var _index122 = __nccwpck_require__(28512); -Object.keys(_index122).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index122[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index122[key]; - }, - }); -}); -var _index123 = __nccwpck_require__(91108); -Object.keys(_index123).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index123[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index123[key]; - }, - }); -}); -var _index124 = __nccwpck_require__(10741); -Object.keys(_index124).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index124[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index124[key]; - }, - }); -}); -var _index125 = __nccwpck_require__(45295); -Object.keys(_index125).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index125[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index125[key]; - }, - }); -}); -var _index126 = __nccwpck_require__(53494); -Object.keys(_index126).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index126[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index126[key]; - }, - }); -}); -var _index127 = __nccwpck_require__(36679); -Object.keys(_index127).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index127[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index127[key]; - }, - }); -}); -var _index128 = __nccwpck_require__(20883); -Object.keys(_index128).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index128[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index128[key]; - }, - }); -}); -var _index129 = __nccwpck_require__(50821); -Object.keys(_index129).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index129[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index129[key]; - }, - }); -}); -var _index130 = __nccwpck_require__(85644); -Object.keys(_index130).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index130[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index130[key]; - }, - }); -}); -var _index131 = __nccwpck_require__(65694); -Object.keys(_index131).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index131[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index131[key]; - }, - }); -}); -var _index132 = __nccwpck_require__(92320); -Object.keys(_index132).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index132[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index132[key]; - }, - }); -}); -var _index133 = __nccwpck_require__(49267); -Object.keys(_index133).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index133[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index133[key]; - }, - }); -}); -var _index134 = __nccwpck_require__(24872); -Object.keys(_index134).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index134[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index134[key]; - }, - }); -}); -var _index135 = __nccwpck_require__(5573); -Object.keys(_index135).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index135[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index135[key]; - }, - }); -}); -var _index136 = __nccwpck_require__(96051); -Object.keys(_index136).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index136[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index136[key]; - }, - }); -}); -var _index137 = __nccwpck_require__(53335); -Object.keys(_index137).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index137[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index137[key]; - }, - }); -}); -var _index138 = __nccwpck_require__(14474); -Object.keys(_index138).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index138[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index138[key]; - }, - }); -}); -var _index139 = __nccwpck_require__(11000); -Object.keys(_index139).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index139[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index139[key]; - }, - }); -}); -var _index140 = __nccwpck_require__(6738); -Object.keys(_index140).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index140[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index140[key]; - }, - }); -}); -var _index141 = __nccwpck_require__(60871); -Object.keys(_index141).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index141[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index141[key]; - }, - }); -}); -var _index142 = __nccwpck_require__(12573); -Object.keys(_index142).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index142[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index142[key]; - }, - }); -}); -var _index143 = __nccwpck_require__(56045); -Object.keys(_index143).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index143[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index143[key]; - }, - }); -}); -var _index144 = __nccwpck_require__(93845); -Object.keys(_index144).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index144[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index144[key]; - }, - }); -}); -var _index145 = __nccwpck_require__(30078); -Object.keys(_index145).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index145[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index145[key]; - }, - }); -}); -var _index146 = __nccwpck_require__(58915); -Object.keys(_index146).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index146[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index146[key]; - }, - }); -}); -var _index147 = __nccwpck_require__(68880); -Object.keys(_index147).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index147[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index147[key]; - }, - }); -}); -var _index148 = __nccwpck_require__(45417); -Object.keys(_index148).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index148[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index148[key]; - }, - }); -}); -var _index149 = __nccwpck_require__(66460); -Object.keys(_index149).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index149[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index149[key]; - }, - }); -}); -var _index150 = __nccwpck_require__(3673); -Object.keys(_index150).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index150[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index150[key]; - }, - }); -}); -var _index151 = __nccwpck_require__(64615); -Object.keys(_index151).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index151[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index151[key]; - }, - }); -}); -var _index152 = __nccwpck_require__(92494); -Object.keys(_index152).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index152[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index152[key]; - }, - }); -}); -var _index153 = __nccwpck_require__(8454); -Object.keys(_index153).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index153[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index153[key]; - }, - }); -}); -var _index154 = __nccwpck_require__(97270); -Object.keys(_index154).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index154[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index154[key]; - }, - }); -}); -var _index155 = __nccwpck_require__(68921); -Object.keys(_index155).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index155[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index155[key]; - }, - }); -}); -var _index156 = __nccwpck_require__(88228); -Object.keys(_index156).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index156[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index156[key]; - }, - }); -}); -var _index157 = __nccwpck_require__(63494); -Object.keys(_index157).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index157[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index157[key]; - }, - }); -}); -var _index158 = __nccwpck_require__(100); -Object.keys(_index158).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index158[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index158[key]; - }, - }); -}); -var _index159 = __nccwpck_require__(17679); -Object.keys(_index159).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index159[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index159[key]; - }, - }); -}); -var _index160 = __nccwpck_require__(43152); -Object.keys(_index160).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index160[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index160[key]; - }, - }); -}); -var _index161 = __nccwpck_require__(33067); -Object.keys(_index161).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index161[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index161[key]; - }, - }); -}); -var _index162 = __nccwpck_require__(3883); -Object.keys(_index162).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index162[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index162[key]; - }, - }); -}); -var _index163 = __nccwpck_require__(43913); -Object.keys(_index163).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index163[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index163[key]; - }, - }); -}); -var _index164 = __nccwpck_require__(13607); -Object.keys(_index164).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index164[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index164[key]; - }, - }); -}); -var _index165 = __nccwpck_require__(22278); -Object.keys(_index165).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index165[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index165[key]; - }, - }); -}); -var _index166 = __nccwpck_require__(81361); -Object.keys(_index166).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index166[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index166[key]; - }, - }); -}); -var _index167 = __nccwpck_require__(26298); -Object.keys(_index167).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index167[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index167[key]; - }, - }); -}); -var _index168 = __nccwpck_require__(4428); -Object.keys(_index168).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index168[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index168[key]; - }, - }); -}); -var _index169 = __nccwpck_require__(93832); -Object.keys(_index169).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index169[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index169[key]; - }, - }); -}); -var _index170 = __nccwpck_require__(29043); -Object.keys(_index170).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index170[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index170[key]; - }, - }); -}); -var _index171 = __nccwpck_require__(72598); -Object.keys(_index171).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index171[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index171[key]; - }, - }); -}); -var _index172 = __nccwpck_require__(51686); -Object.keys(_index172).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index172[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index172[key]; - }, - }); -}); -var _index173 = __nccwpck_require__(99643); -Object.keys(_index173).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index173[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index173[key]; - }, - }); -}); -var _index174 = __nccwpck_require__(29870); -Object.keys(_index174).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index174[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index174[key]; - }, - }); -}); -var _index175 = __nccwpck_require__(70933); -Object.keys(_index175).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index175[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index175[key]; - }, - }); -}); -var _index176 = __nccwpck_require__(70665); -Object.keys(_index176).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index176[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index176[key]; - }, - }); -}); -var _index177 = __nccwpck_require__(13585); -Object.keys(_index177).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index177[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index177[key]; - }, - }); -}); -var _index178 = __nccwpck_require__(69884); -Object.keys(_index178).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index178[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index178[key]; - }, - }); -}); -var _index179 = __nccwpck_require__(93822); -Object.keys(_index179).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index179[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index179[key]; - }, - }); -}); -var _index180 = __nccwpck_require__(50135); -Object.keys(_index180).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index180[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index180[key]; - }, - }); -}); -var _index181 = __nccwpck_require__(456); -Object.keys(_index181).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index181[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index181[key]; - }, - }); -}); -var _index182 = __nccwpck_require__(21812); -Object.keys(_index182).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index182[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index182[key]; - }, - }); -}); -var _index183 = __nccwpck_require__(39484); -Object.keys(_index183).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index183[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index183[key]; - }, - }); -}); -var _index184 = __nccwpck_require__(15648); -Object.keys(_index184).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index184[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index184[key]; - }, - }); -}); -var _index185 = __nccwpck_require__(59010); -Object.keys(_index185).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index185[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index185[key]; - }, - }); -}); -var _index186 = __nccwpck_require__(50582); -Object.keys(_index186).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index186[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index186[key]; - }, - }); -}); -var _index187 = __nccwpck_require__(57967); -Object.keys(_index187).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index187[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index187[key]; - }, - }); -}); -var _index188 = __nccwpck_require__(70615); -Object.keys(_index188).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index188[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index188[key]; - }, - }); -}); -var _index189 = __nccwpck_require__(40912); -Object.keys(_index189).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index189[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index189[key]; - }, - }); -}); -var _index190 = __nccwpck_require__(31861); -Object.keys(_index190).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index190[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index190[key]; - }, - }); -}); -var _index191 = __nccwpck_require__(43331); -Object.keys(_index191).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index191[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index191[key]; - }, - }); -}); -var _index192 = __nccwpck_require__(20295); -Object.keys(_index192).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index192[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index192[key]; - }, - }); -}); -var _index193 = __nccwpck_require__(61528); -Object.keys(_index193).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index193[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index193[key]; - }, - }); -}); -var _index194 = __nccwpck_require__(14812); -Object.keys(_index194).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index194[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index194[key]; - }, - }); -}); -var _index195 = __nccwpck_require__(38217); -Object.keys(_index195).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index195[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index195[key]; - }, - }); -}); -var _index196 = __nccwpck_require__(95027); -Object.keys(_index196).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index196[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index196[key]; - }, - }); -}); -var _index197 = __nccwpck_require__(25574); -Object.keys(_index197).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index197[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index197[key]; - }, - }); -}); -var _index198 = __nccwpck_require__(29424); -Object.keys(_index198).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index198[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index198[key]; - }, - }); -}); -var _index199 = __nccwpck_require__(58715); -Object.keys(_index199).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index199[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index199[key]; - }, - }); -}); -var _index200 = __nccwpck_require__(47911); -Object.keys(_index200).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index200[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index200[key]; - }, - }); -}); -var _index201 = __nccwpck_require__(82560); -Object.keys(_index201).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index201[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index201[key]; - }, - }); -}); -var _index202 = __nccwpck_require__(20665); -Object.keys(_index202).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index202[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index202[key]; - }, - }); -}); -var _index203 = __nccwpck_require__(81308); -Object.keys(_index203).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index203[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index203[key]; - }, - }); -}); -var _index204 = __nccwpck_require__(24954); -Object.keys(_index204).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index204[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index204[key]; - }, - }); -}); -var _index205 = __nccwpck_require__(49756); -Object.keys(_index205).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index205[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index205[key]; - }, - }); -}); -var _index206 = __nccwpck_require__(79541); -Object.keys(_index206).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index206[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index206[key]; - }, - }); -}); -var _index207 = __nccwpck_require__(11771); -Object.keys(_index207).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index207[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index207[key]; - }, - }); -}); -var _index208 = __nccwpck_require__(75595); -Object.keys(_index208).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index208[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index208[key]; - }, - }); -}); -var _index209 = __nccwpck_require__(83987); -Object.keys(_index209).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index209[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index209[key]; - }, - }); -}); -var _index210 = __nccwpck_require__(98476); -Object.keys(_index210).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index210[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index210[key]; - }, - }); -}); -var _index211 = __nccwpck_require__(81651); -Object.keys(_index211).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index211[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index211[key]; - }, - }); -}); -var _index212 = __nccwpck_require__(94085); -Object.keys(_index212).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index212[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index212[key]; - }, - }); -}); -var _index213 = __nccwpck_require__(91310); -Object.keys(_index213).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index213[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index213[key]; - }, - }); -}); -var _index214 = __nccwpck_require__(87407); -Object.keys(_index214).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index214[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index214[key]; - }, - }); -}); -var _index215 = __nccwpck_require__(68079); -Object.keys(_index215).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index215[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index215[key]; - }, - }); -}); -var _index216 = __nccwpck_require__(69709); -Object.keys(_index216).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index216[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index216[key]; - }, - }); -}); -var _index217 = __nccwpck_require__(37809); -Object.keys(_index217).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index217[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index217[key]; - }, - }); -}); -var _index218 = __nccwpck_require__(41831); -Object.keys(_index218).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index218[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index218[key]; - }, - }); -}); -var _index219 = __nccwpck_require__(80050); -Object.keys(_index219).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index219[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index219[key]; - }, - }); -}); -var _index220 = __nccwpck_require__(3148); -Object.keys(_index220).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index220[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index220[key]; - }, - }); -}); -var _index221 = __nccwpck_require__(22991); -Object.keys(_index221).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index221[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index221[key]; - }, - }); -}); -var _index222 = __nccwpck_require__(12361); -Object.keys(_index222).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index222[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index222[key]; - }, - }); -}); -var _index223 = __nccwpck_require__(78227); -Object.keys(_index223).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index223[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index223[key]; - }, - }); -}); -var _index224 = __nccwpck_require__(26068); -Object.keys(_index224).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index224[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index224[key]; - }, - }); -}); -var _index225 = __nccwpck_require__(31348); -Object.keys(_index225).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index225[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index225[key]; - }, - }); -}); -var _index226 = __nccwpck_require__(63304); -Object.keys(_index226).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index226[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index226[key]; - }, - }); -}); -var _index227 = __nccwpck_require__(32600); -Object.keys(_index227).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index227[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index227[key]; - }, - }); -}); -var _index228 = __nccwpck_require__(67264); -Object.keys(_index228).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index228[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index228[key]; - }, - }); -}); -var _index229 = __nccwpck_require__(19271); -Object.keys(_index229).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index229[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index229[key]; - }, - }); -}); -var _index230 = __nccwpck_require__(19771); -Object.keys(_index230).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index230[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index230[key]; - }, - }); -}); -var _index231 = __nccwpck_require__(52505); -Object.keys(_index231).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index231[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index231[key]; - }, - }); -}); -var _index232 = __nccwpck_require__(34118); -Object.keys(_index232).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index232[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index232[key]; - }, - }); -}); -var _index233 = __nccwpck_require__(79473); -Object.keys(_index233).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index233[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index233[key]; - }, - }); -}); -var _index234 = __nccwpck_require__(78137); -Object.keys(_index234).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index234[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index234[key]; - }, - }); -}); -var _index235 = __nccwpck_require__(58682); -Object.keys(_index235).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index235[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index235[key]; - }, - }); -}); -var _index236 = __nccwpck_require__(2535); -Object.keys(_index236).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index236[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index236[key]; - }, - }); -}); -var _index237 = __nccwpck_require__(24796); -Object.keys(_index237).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index237[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index237[key]; - }, - }); -}); -var _index238 = __nccwpck_require__(49966); -Object.keys(_index238).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index238[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index238[key]; - }, - }); -}); -var _index239 = __nccwpck_require__(79442); -Object.keys(_index239).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index239[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index239[key]; - }, - }); -}); -var _index240 = __nccwpck_require__(53622); -Object.keys(_index240).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index240[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index240[key]; - }, - }); -}); -var _index241 = __nccwpck_require__(71881); -Object.keys(_index241).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index241[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index241[key]; - }, - }); -}); -var _index242 = __nccwpck_require__(1388); -Object.keys(_index242).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index242[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index242[key]; - }, - }); -}); -var _index243 = __nccwpck_require__(84273); -Object.keys(_index243).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index243[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index243[key]; - }, - }); -}); -var _index244 = __nccwpck_require__(5556); -Object.keys(_index244).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index244[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index244[key]; - }, - }); -}); -var _index245 = __nccwpck_require__(84117); -Object.keys(_index245).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _index245[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _index245[key]; - }, - }); -}); - - -/***/ }), - -/***/ 8039: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.interval = interval; -var _index = __nccwpck_require__(53622); - -/** - * The {@link interval} function options. - */ - -/** - * @name interval - * @category Interval Helpers - * @summary Creates an interval object and validates its values. - * - * @description - * Creates a normalized interval object and validates its values. If the interval is invalid, an exception is thrown. - * - * @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). - * - * @param start - The start of the interval. - * @param end - The end of the interval. - * @param options - The options object. - * - * @throws `Start date is invalid` when `start` is invalid. - * @throws `End date is invalid` when `end` is invalid. - * @throws `End date must be after start date` when end is before `start` and `options.assertPositive` is true. - * - * @returns The normalized and validated interval object. - */ -function interval(start, end, options) { - const _start = (0, _index.toDate)(start); - if (isNaN(+_start)) throw new TypeError("Start date is invalid"); - - const _end = (0, _index.toDate)(end); - if (isNaN(+_end)) throw new TypeError("End date is invalid"); - - if (options?.assertPositive && +_start > +_end) - throw new TypeError("End date must be after start date"); - - return { start: _start, end: _end }; -} - - -/***/ }), - -/***/ 18019: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.intervalToDuration = intervalToDuration; -var _index = __nccwpck_require__(13110); -var _index2 = __nccwpck_require__(96605); -var _index3 = __nccwpck_require__(37407); -var _index4 = __nccwpck_require__(26235); -var _index5 = __nccwpck_require__(13045); -var _index6 = __nccwpck_require__(14944); -var _index7 = __nccwpck_require__(40830); -var _index8 = __nccwpck_require__(53622); - -/** - * @name intervalToDuration - * @category Common Helpers - * @summary Convert interval to duration - * - * @description - * Convert a interval object to a duration object. - * - * @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). - * - * @param interval - The interval to convert to duration - * - * @returns The duration object - * - * @example - * // Get the duration between January 15, 1929 and April 4, 1968. - * intervalToDuration({ - * start: new Date(1929, 0, 15, 12, 0, 0), - * end: new Date(1968, 3, 4, 19, 5, 0) - * }) - * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } - */ -function intervalToDuration(interval) { - const start = (0, _index8.toDate)(interval.start); - const end = (0, _index8.toDate)(interval.end); - - const duration = {}; - - const years = (0, _index7.differenceInYears)(end, start); - if (years) duration.years = years; - - const remainingMonths = (0, _index.add)(start, { years: duration.years }); - - const months = (0, _index5.differenceInMonths)(end, remainingMonths); - if (months) duration.months = months; - - const remainingDays = (0, _index.add)(remainingMonths, { - months: duration.months, - }); - - const days = (0, _index2.differenceInDays)(end, remainingDays); - if (days) duration.days = days; - - const remainingHours = (0, _index.add)(remainingDays, { - days: duration.days, - }); - - const hours = (0, _index3.differenceInHours)(end, remainingHours); - if (hours) duration.hours = hours; - - const remainingMinutes = (0, _index.add)(remainingHours, { - hours: duration.hours, - }); - - const minutes = (0, _index4.differenceInMinutes)(end, remainingMinutes); - if (minutes) duration.minutes = minutes; - - const remainingSeconds = (0, _index.add)(remainingMinutes, { - minutes: duration.minutes, - }); - - const seconds = (0, _index6.differenceInSeconds)(end, remainingSeconds); - if (seconds) duration.seconds = seconds; - - return duration; -} - - -/***/ }), - -/***/ 76582: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.intlFormat = intlFormat; -var _index = __nccwpck_require__(53622); - -/** - * The locale string (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). - */ - -/** - * The format options (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) - */ - -/** - * The locale options. - */ - -/** - * @name intlFormat - * @category Common Helpers - * @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat). - * - * @description - * Return the formatted date string in the given format. - * The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside. - * formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options) - * - * > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default. - * - * @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). - * - * @param date - The date to format - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 4 October 2019 in middle-endian format: - * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456)) - * //=> 10/4/2019 - */ - -/** - * @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). - * - * @param date - The date to format - * @param localeOptions - An object with locale - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 4 October 2019 in Korean. - * // Convert the date with locale's options. - * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { - * locale: 'ko-KR', - * }) - * //=> 2019. 10. 4. - */ - -/** - * @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). - * - * @param date - The date to format - * @param formatOptions - The format options - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 4 October 2019. - * // Convert the date with format's options. - * const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), { - * year: 'numeric', - * month: 'numeric', - * day: 'numeric', - * hour: 'numeric', - * }) - * //=> 10/4/2019, 12 PM - */ - -/** - * @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). - * - * @param date - The date to format - * @param formatOptions - The format options - * @param localeOptions - An object with locale - * - * @returns The formatted date string - * - * @throws `date` must not be Invalid Date - * - * @example - * // Represent 4 October 2019 in German. - * // Convert the date with format's options and locale's options. - * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { - * weekday: 'long', - * year: 'numeric', - * month: 'long', - * day: 'numeric', - * }, { - * locale: 'de-DE', - * }) - * //=> Freitag, 4. Oktober 2019 - */ - -function intlFormat(date, formatOrLocale, localeOptions) { - let formatOptions; - - if (isFormatOptions(formatOrLocale)) { - formatOptions = formatOrLocale; - } else { - localeOptions = formatOrLocale; - } - - return new Intl.DateTimeFormat(localeOptions?.locale, formatOptions).format( - (0, _index.toDate)(date), - ); -} - -function isFormatOptions(opts) { - return opts !== undefined && !("locale" in opts); -} - - -/***/ }), - -/***/ 77229: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.intlFormatDistance = intlFormatDistance; -var _index = __nccwpck_require__(17818); - -var _index2 = __nccwpck_require__(90338); -var _index3 = __nccwpck_require__(34939); -var _index4 = __nccwpck_require__(73599); -var _index5 = __nccwpck_require__(21538); -var _index6 = __nccwpck_require__(36143); -var _index7 = __nccwpck_require__(37407); -var _index8 = __nccwpck_require__(26235); -var _index9 = __nccwpck_require__(14944); -var _index10 = __nccwpck_require__(53622); - -/** - * The {@link intlFormatDistance} function options. - */ - -/** - * The unit used to format the distance in {@link intlFormatDistance}. - */ - -/** - * @name intlFormatDistance - * @category Common Helpers - * @summary Formats distance between two dates in a human-readable format - * @description - * The function calculates the difference between two dates and formats it as a human-readable string. - * - * The function will pick the most appropriate unit depending on the distance between dates. For example, if the distance is a few hours, it might return `x hours`. If the distance is a few months, it might return `x months`. - * - * You can also specify a unit to force using it regardless of the distance to get a result like `123456 hours`. - * - * See the table below for the unit picking logic: - * - * | Distance between dates | Result (past) | Result (future) | - * | ---------------------- | -------------- | --------------- | - * | 0 seconds | now | now | - * | 1-59 seconds | X seconds ago | in X seconds | - * | 1-59 minutes | X minutes ago | in X minutes | - * | 1-23 hours | X hours ago | in X hours | - * | 1 day | yesterday | tomorrow | - * | 2-6 days | X days ago | in X days | - * | 7 days | last week | next week | - * | 8 days-1 month | X weeks ago | in X weeks | - * | 1 month | last month | next month | - * | 2-3 months | X months ago | in X months | - * | 1 quarter | last quarter | next quarter | - * | 2-3 quarters | X quarters ago | in X quarters | - * | 1 year | last year | next year | - * | 2+ years | X years ago | in X years | - * - * @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). - * - * @param date - The date - * @param baseDate - The date to compare with. - * @param options - An object with options. - * See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) - * The narrow one could be similar to the short one for some locales. - * - * @returns The distance in words according to language-sensitive relative time formatting. - * - * @throws `date` must not be Invalid Date - * @throws `baseDate` must not be Invalid Date - * @throws `options.unit` must not be invalid Unit - * @throws `options.locale` must not be invalid locale - * @throws `options.localeMatcher` must not be invalid localeMatcher - * @throws `options.numeric` must not be invalid numeric - * @throws `options.style` must not be invalid style - * - * @example - * // What is the distance between the dates when the fist date is after the second? - * intlFormatDistance( - * new Date(1986, 3, 4, 11, 30, 0), - * new Date(1986, 3, 4, 10, 30, 0) - * ) - * //=> 'in 1 hour' - * - * // What is the distance between the dates when the fist date is before the second? - * intlFormatDistance( - * new Date(1986, 3, 4, 10, 30, 0), - * new Date(1986, 3, 4, 11, 30, 0) - * ) - * //=> '1 hour ago' - * - * @example - * // Use the unit option to force the function to output the result in quarters. Without setting it, the example would return "next year" - * intlFormatDistance( - * new Date(1987, 6, 4, 10, 30, 0), - * new Date(1986, 3, 4, 10, 30, 0), - * { unit: 'quarter' } - * ) - * //=> 'in 5 quarters' - * - * @example - * // Use the locale option to get the result in Spanish. Without setting it, the example would return "in 1 hour". - * intlFormatDistance( - * new Date(1986, 3, 4, 11, 30, 0), - * new Date(1986, 3, 4, 10, 30, 0), - * { locale: 'es' } - * ) - * //=> 'dentro de 1 hora' - * - * @example - * // Use the numeric option to force the function to use numeric values. Without setting it, the example would return "tomorrow". - * intlFormatDistance( - * new Date(1986, 3, 5, 11, 30, 0), - * new Date(1986, 3, 4, 11, 30, 0), - * { numeric: 'always' } - * ) - * //=> 'in 1 day' - * - * @example - * // Use the style option to force the function to use short values. Without setting it, the example would return "in 2 years". - * intlFormatDistance( - * new Date(1988, 3, 4, 11, 30, 0), - * new Date(1986, 3, 4, 11, 30, 0), - * { style: 'short' } - * ) - * //=> 'in 2 yr' - */ -function intlFormatDistance(date, baseDate, options) { - let value = 0; - let unit; - const dateLeft = (0, _index10.toDate)(date); - const dateRight = (0, _index10.toDate)(baseDate); - - if (!options?.unit) { - // Get the unit based on diffInSeconds calculations if no unit is specified - const diffInSeconds = (0, _index9.differenceInSeconds)(dateLeft, dateRight); // The smallest unit - - if (Math.abs(diffInSeconds) < _index.secondsInMinute) { - value = (0, _index9.differenceInSeconds)(dateLeft, dateRight); - unit = "second"; - } else if (Math.abs(diffInSeconds) < _index.secondsInHour) { - value = (0, _index8.differenceInMinutes)(dateLeft, dateRight); - unit = "minute"; - } else if ( - Math.abs(diffInSeconds) < _index.secondsInDay && - Math.abs((0, _index2.differenceInCalendarDays)(dateLeft, dateRight)) < 1 - ) { - value = (0, _index7.differenceInHours)(dateLeft, dateRight); - unit = "hour"; - } else if ( - Math.abs(diffInSeconds) < _index.secondsInWeek && - (value = (0, _index2.differenceInCalendarDays)(dateLeft, dateRight)) && - Math.abs(value) < 7 - ) { - unit = "day"; - } else if (Math.abs(diffInSeconds) < _index.secondsInMonth) { - value = (0, _index5.differenceInCalendarWeeks)(dateLeft, dateRight); - unit = "week"; - } else if (Math.abs(diffInSeconds) < _index.secondsInQuarter) { - value = (0, _index3.differenceInCalendarMonths)(dateLeft, dateRight); - unit = "month"; - } else if (Math.abs(diffInSeconds) < _index.secondsInYear) { - if ((0, _index4.differenceInCalendarQuarters)(dateLeft, dateRight) < 4) { - // To filter out cases that are less than a year but match 4 quarters - value = (0, _index4.differenceInCalendarQuarters)(dateLeft, dateRight); - unit = "quarter"; - } else { - value = (0, _index6.differenceInCalendarYears)(dateLeft, dateRight); - unit = "year"; - } - } else { - value = (0, _index6.differenceInCalendarYears)(dateLeft, dateRight); - unit = "year"; - } - } else { - // Get the value if unit is specified - unit = options?.unit; - if (unit === "second") { - value = (0, _index9.differenceInSeconds)(dateLeft, dateRight); - } else if (unit === "minute") { - value = (0, _index8.differenceInMinutes)(dateLeft, dateRight); - } else if (unit === "hour") { - value = (0, _index7.differenceInHours)(dateLeft, dateRight); - } else if (unit === "day") { - value = (0, _index2.differenceInCalendarDays)(dateLeft, dateRight); - } else if (unit === "week") { - value = (0, _index5.differenceInCalendarWeeks)(dateLeft, dateRight); - } else if (unit === "month") { - value = (0, _index3.differenceInCalendarMonths)(dateLeft, dateRight); - } else if (unit === "quarter") { - value = (0, _index4.differenceInCalendarQuarters)(dateLeft, dateRight); - } else if (unit === "year") { - value = (0, _index6.differenceInCalendarYears)(dateLeft, dateRight); - } - } - - const rtf = new Intl.RelativeTimeFormat(options?.locale, { - localeMatcher: options?.localeMatcher, - numeric: options?.numeric || "auto", - style: options?.style, - }); - - return rtf.format(value, unit); -} - - -/***/ }), - -/***/ 33846: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isAfter = isAfter; -var _index = __nccwpck_require__(53622); - -/** - * @name isAfter - * @category Common Helpers - * @summary Is the first date after the second one? - * - * @description - * Is the first date after the second one? - * - * @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). - * - * @param date - The date that should be after the other one to return true - * @param dateToCompare - The date to compare with - * - * @returns The first date is after the second date - * - * @example - * // Is 10 July 1989 after 11 February 1987? - * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) - * //=> true - */ -function isAfter(date, dateToCompare) { - const _date = (0, _index.toDate)(date); - const _dateToCompare = (0, _index.toDate)(dateToCompare); - return _date.getTime() > _dateToCompare.getTime(); -} - - -/***/ }), - -/***/ 23964: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isBefore = isBefore; -var _index = __nccwpck_require__(53622); - -/** - * @name isBefore - * @category Common Helpers - * @summary Is the first date before the second one? - * - * @description - * Is the first date before the second one? - * - * @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). - * - * @param date - The date that should be before the other one to return true - * @param dateToCompare - The date to compare with - * - * @returns The first date is before the second date - * - * @example - * // Is 10 July 1989 before 11 February 1987? - * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) - * //=> false - */ -function isBefore(date, dateToCompare) { - const _date = (0, _index.toDate)(date); - const _dateToCompare = (0, _index.toDate)(dateToCompare); - return +_date < +_dateToCompare; -} - - -/***/ }), - -/***/ 62272: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.isDate = isDate; /** - * @name isDate - * @category Common Helpers - * @summary Is the given value a date? - * - * @description - * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes. - * - * @param value - The value to check - * - * @returns True if the given value is a date - * - * @example - * // For a valid date: - * const result = isDate(new Date()) - * //=> true - * - * @example - * // For an invalid date: - * const result = isDate(new Date(NaN)) - * //=> true - * - * @example - * // For some value: - * const result = isDate('2014-02-31') - * //=> false - * - * @example - * // For an object: - * const result = isDate({}) - * //=> false - */ -function isDate(value) { - return ( - value instanceof Date || - (typeof value === "object" && - Object.prototype.toString.call(value) === "[object Date]") - ); -} - - -/***/ }), - -/***/ 51995: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isEqual = isEqual; -var _index = __nccwpck_require__(53622); - -/** - * @name isEqual - * @category Common Helpers - * @summary Are the given dates equal? - * - * @description - * Are the given dates equal? - * - * @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). - * - * @param dateLeft - The first date to compare - * @param dateRight - The second date to compare - * - * @returns The dates are equal - * - * @example - * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal? - * const result = isEqual( - * new Date(2014, 6, 2, 6, 30, 45, 0), - * new Date(2014, 6, 2, 6, 30, 45, 500) - * ) - * //=> false - */ -function isEqual(leftDate, rightDate) { - const _dateLeft = (0, _index.toDate)(leftDate); - const _dateRight = (0, _index.toDate)(rightDate); - return +_dateLeft === +_dateRight; -} - - -/***/ }), - -/***/ 44912: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.isExists = isExists; /** - * @name isExists - * @category Common Helpers - * @summary Is the given date exists? - * - * @description - * Checks if the given arguments convert to an existing date. - * - * @param year - The year of the date to check - * @param month - The month of the date to check - * @param day - The day of the date to check - * - * @returns `true` if the date exists - * - * @example - * // For the valid date: - * const result = isExists(2018, 0, 31) - * //=> true - * - * @example - * // For the invalid date: - * const result = isExists(2018, 1, 31) - * //=> false - */ -function isExists(year, month, day) { - const date = new Date(year, month, day); - return ( - date.getFullYear() === year && - date.getMonth() === month && - date.getDate() === day - ); -} - - -/***/ }), - -/***/ 64387: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isFirstDayOfMonth = isFirstDayOfMonth; -var _index = __nccwpck_require__(53622); - -/** - * @name isFirstDayOfMonth - * @category Month Helpers - * @summary Is the given date the first day of a month? - * - * @description - * Is the given date the first day of a month? - * - * @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). - * - * @param date - The date to check - - * @returns The date is the first day of a month - * - * @example - * // Is 1 September 2014 the first day of a month? - * const result = isFirstDayOfMonth(new Date(2014, 8, 1)) - * //=> true - */ -function isFirstDayOfMonth(date) { - return (0, _index.toDate)(date).getDate() === 1; -} - - -/***/ }), - -/***/ 91861: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isFriday = isFriday; -var _index = __nccwpck_require__(53622); - -/** - * @name isFriday - * @category Weekday Helpers - * @summary Is the given date Friday? - * - * @description - * Is the given date Friday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is Friday - * - * @example - * // Is 26 September 2014 Friday? - * const result = isFriday(new Date(2014, 8, 26)) - * //=> true - */ -function isFriday(date) { - return (0, _index.toDate)(date).getDay() === 5; -} - - -/***/ }), - -/***/ 26513: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isFuture = isFuture; -var _index = __nccwpck_require__(53622); - -/** - * @name isFuture - * @category Common Helpers - * @summary Is the given date in the future? - * @pure false - * - * @description - * Is the given date in the future? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in the future - * - * @example - * // If today is 6 October 2014, is 31 December 2014 in the future? - * const result = isFuture(new Date(2014, 11, 31)) - * //=> true - */ -function isFuture(date) { - return +(0, _index.toDate)(date) > Date.now(); -} - - -/***/ }), - -/***/ 5894: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isLastDayOfMonth = isLastDayOfMonth; -var _index = __nccwpck_require__(86610); -var _index2 = __nccwpck_require__(63434); -var _index3 = __nccwpck_require__(53622); - -/** - * @name isLastDayOfMonth - * @category Month Helpers - * @summary Is the given date the last day of a month? - * - * @description - * Is the given date the last day of a month? - * - * @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). - * - * @param date - The date to check - - * @returns The date is the last day of a month - * - * @example - * // Is 28 February 2014 the last day of a month? - * const result = isLastDayOfMonth(new Date(2014, 1, 28)) - * //=> true - */ -function isLastDayOfMonth(date) { - const _date = (0, _index3.toDate)(date); - return +(0, _index.endOfDay)(_date) === +(0, _index2.endOfMonth)(_date); -} - - -/***/ }), - -/***/ 18260: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isLeapYear = isLeapYear; -var _index = __nccwpck_require__(53622); - -/** - * @name isLeapYear - * @category Year Helpers - * @summary Is the given date in the leap year? - * - * @description - * Is the given date in the leap year? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in the leap year - * - * @example - * // Is 1 September 2012 in the leap year? - * const result = isLeapYear(new Date(2012, 8, 1)) - * //=> true - */ -function isLeapYear(date) { - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); -} - - -/***/ }), - -/***/ 34699: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isMatch = isMatch; -var _index = __nccwpck_require__(58915); -var _index2 = __nccwpck_require__(69884); - -/** - * The {@link isMatch} function options. - */ - -/** - * @name isMatch - * @category Common Helpers - * @summary validates the date string against given formats - * - * @description - * Return the true if given date is string correct against the given format else - * will return false. - * - * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. - * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * The characters in the format string wrapped between two single quotes characters (') are escaped. - * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. - * - * Format of the format string is based on Unicode Technical Standard #35: - * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * with a few additions (see note 5 below the table). - * - * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited - * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: - * - * ```javascript - * isMatch('23 AM', 'HH a') - * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time - * ``` - * - * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true - * - * Accepted format string patterns: - * | Unit |Prior| Pattern | Result examples | Notes | - * |---------------------------------|-----|---------|-----------------------------------|-------| - * | Era | 140 | G..GGG | AD, BC | | - * | | | GGGG | Anno Domini, Before Christ | 2 | - * | | | GGGGG | A, B | | - * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | - * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | yy | 44, 01, 00, 17 | 4 | - * | | | yyy | 044, 001, 123, 999 | 4 | - * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | - * | | | yyyyy | ... | 2,4 | - * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | - * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | YY | 44, 01, 00, 17 | 4,6 | - * | | | YYY | 044, 001, 123, 999 | 4 | - * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | - * | | | YYYYY | ... | 2,4 | - * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | - * | | | RR | -43, 01, 00, 17 | 4,5 | - * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | - * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | - * | | | RRRRR | ... | 2,4,5 | - * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | - * | | | uu | -43, 01, 99, -99 | 4 | - * | | | uuu | -043, 001, 123, 999, -999 | 4 | - * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | - * | | | uuuuu | ... | 2,4 | - * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | - * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | QQ | 01, 02, 03, 04 | | - * | | | QQQ | Q1, Q2, Q3, Q4 | | - * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | - * | | | QQQQQ | 1, 2, 3, 4 | 4 | - * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | - * | | | qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | qq | 01, 02, 03, 04 | | - * | | | qqq | Q1, Q2, Q3, Q4 | | - * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | - * | | | qqqqq | 1, 2, 3, 4 | 3 | - * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | - * | | | Mo | 1st, 2nd, ..., 12th | 5 | - * | | | MM | 01, 02, ..., 12 | | - * | | | MMM | Jan, Feb, ..., Dec | | - * | | | MMMM | January, February, ..., December | 2 | - * | | | MMMMM | J, F, ..., D | | - * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | - * | | | Lo | 1st, 2nd, ..., 12th | 5 | - * | | | LL | 01, 02, ..., 12 | | - * | | | LLL | Jan, Feb, ..., Dec | | - * | | | LLLL | January, February, ..., December | 2 | - * | | | LLLLL | J, F, ..., D | | - * | Local week of year | 100 | w | 1, 2, ..., 53 | | - * | | | wo | 1st, 2nd, ..., 53th | 5 | - * | | | ww | 01, 02, ..., 53 | | - * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | - * | | | Io | 1st, 2nd, ..., 53th | 5 | - * | | | II | 01, 02, ..., 53 | 5 | - * | Day of month | 90 | d | 1, 2, ..., 31 | | - * | | | do | 1st, 2nd, ..., 31st | 5 | - * | | | dd | 01, 02, ..., 31 | | - * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | - * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | - * | | | DD | 01, 02, ..., 365, 366 | 7 | - * | | | DDD | 001, 002, ..., 365, 366 | | - * | | | DDDD | ... | 2 | - * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | | - * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | - * | | | EEEEE | M, T, W, T, F, S, S | | - * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | - * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | - * | | | io | 1st, 2nd, ..., 7th | 5 | - * | | | ii | 01, 02, ..., 07 | 5 | - * | | | iii | Mon, Tue, Wed, ..., Su | 5 | - * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | - * | | | iiiii | M, T, W, T, F, S, S | 5 | - * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 | - * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | - * | | | eo | 2nd, 3rd, ..., 1st | 5 | - * | | | ee | 02, 03, ..., 01 | | - * | | | eee | Mon, Tue, Wed, ..., Su | | - * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | - * | | | eeeee | M, T, W, T, F, S, S | | - * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | - * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | - * | | | co | 2nd, 3rd, ..., 1st | 5 | - * | | | cc | 02, 03, ..., 01 | | - * | | | ccc | Mon, Tue, Wed, ..., Su | | - * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | - * | | | ccccc | M, T, W, T, F, S, S | | - * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | - * | AM, PM | 80 | a..aaa | AM, PM | | - * | | | aaaa | a.m., p.m. | 2 | - * | | | aaaaa | a, p | | - * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | - * | | | bbbb | a.m., p.m., noon, midnight | 2 | - * | | | bbbbb | a, p, n, mi | | - * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | - * | | | BBBB | at night, in the morning, ... | 2 | - * | | | BBBBB | at night, in the morning, ... | | - * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | - * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | - * | | | hh | 01, 02, ..., 11, 12 | | - * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | - * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | - * | | | HH | 00, 01, 02, ..., 23 | | - * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | - * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | - * | | | KK | 01, 02, ..., 11, 00 | | - * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | - * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | - * | | | kk | 24, 01, 02, ..., 23 | | - * | Minute | 60 | m | 0, 1, ..., 59 | | - * | | | mo | 0th, 1st, ..., 59th | 5 | - * | | | mm | 00, 01, ..., 59 | | - * | Second | 50 | s | 0, 1, ..., 59 | | - * | | | so | 0th, 1st, ..., 59th | 5 | - * | | | ss | 00, 01, ..., 59 | | - * | Seconds timestamp | 40 | t | 512969520 | | - * | | | tt | ... | 2 | - * | Fraction of second | 30 | S | 0, 1, ..., 9 | | - * | | | SS | 00, 01, ..., 99 | | - * | | | SSS | 000, 001, ..., 999 | | - * | | | SSSS | ... | 2 | - * | Milliseconds timestamp | 20 | T | 512969520900 | | - * | | | TT | ... | 2 | - * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | - * | | | XX | -0800, +0530, Z | | - * | | | XXX | -08:00, +05:30, Z | | - * | | | XXXX | -0800, +0530, Z, +123456 | 2 | - * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | - * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | - * | | | xx | -0800, +0530, +0000 | | - * | | | xxx | -08:00, +05:30, +00:00 | 2 | - * | | | xxxx | -0800, +0530, +0000, +123456 | | - * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | - * | Long localized date | NA | P | 05/29/1453 | 5,8 | - * | | | PP | May 29, 1453 | | - * | | | PPP | May 29th, 1453 | | - * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | - * | Long localized time | NA | p | 12:00 AM | 5,8 | - * | | | pp | 12:00:00 AM | | - * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | - * | | | PPpp | May 29, 1453, 12:00:00 AM | | - * | | | PPPpp | May 29th, 1453 at ... | | - * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | - * Notes: - * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale - * are the same as "stand-alone" units, but are different in some languages. - * "Formatting" units are declined according to the rules of the language - * in the context of a date. "Stand-alone" units are always nominative singular. - * In `format` function, they will produce different result: - * - * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` - * - * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` - * - * `isMatch` will try to match both formatting and stand-alone units interchangably. - * - * 2. Any sequence of the identical letters is a pattern, unless it is escaped by - * the single quote characters (see below). - * If the sequence is longer than listed in table: - * - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number - * as wide as the sequence - * - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit. - * These variations are marked with "2" in the last column of the table. - * - * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. - * These tokens represent the shortest form of the quarter. - * - * 4. The main difference between `y` and `u` patterns are B.C. years: - * - * | Year | `y` | `u` | - * |------|-----|-----| - * | AC 1 | 1 | 1 | - * | BC 1 | 1 | 0 | - * | BC 2 | 2 | -1 | - * - * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: - * - * `isMatch('50', 'yy') //=> true` - * - * `isMatch('75', 'yy') //=> true` - * - * while `uu` will use the year as is: - * - * `isMatch('50', 'uu') //=> true` - * - * `isMatch('75', 'uu') //=> true` - * - * The same difference is true for local and ISO week-numbering years (`Y` and `R`), - * except local week-numbering years are dependent on `options.weekStartsOn` - * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear) - * and [setWeekYear](https://date-fns.org/docs/setWeekYear)). - * - * 5. These patterns are not in the Unicode Technical Standard #35: - * - `i`: ISO day of week - * - `I`: ISO week of year - * - `R`: ISO week-numbering year - * - `o`: ordinal number modifier - * - `P`: long localized date - * - `p`: long localized time - * - * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. - * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. - * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based - * on the given locale. - * - * using `en-US` locale: `P` => `MM/dd/yyyy` - * using `en-US` locale: `p` => `hh:mm a` - * using `pt-BR` locale: `P` => `dd/MM/yyyy` - * using `pt-BR` locale: `p` => `HH:mm` - * - * Values will be checked in the descending order of its unit's priority. - * Units of an equal priority overwrite each other in the order of appearance. - * - * If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year), - * the values will be taken from today's using `new Date()` date which works as a context of parsing. - * - * The result may vary by locale. - * - * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. - * - * @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). - * - * @param dateStr - The date string to verify - * @param format - The string of tokens - * @param options - An object with options. - * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * @returns Is format string a match for date string? - * - * @throws `options.locale` must contain `match` property - * @throws use `yyyy` instead of `YYYY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * @throws use `yy` instead of `YY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * @throws use `d` instead of `D` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * @throws use `dd` instead of `DD` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * @throws format string contains an unescaped latin alphabet character - * - * @example - * // Match 11 February 2014 from middle-endian format: - * const result = isMatch('02/11/2014', 'MM/dd/yyyy') - * //=> true - * - * @example - * // Match 28th of February in Esperanto locale in the context of 2010 year: - * import eo from 'date-fns/locale/eo' - * const result = isMatch('28-a de februaro', "do 'de' MMMM", { - * locale: eo - * }) - * //=> true - */ -function isMatch(dateStr, formatStr, options) { - return (0, _index.isValid)( - (0, _index2.parse)(dateStr, formatStr, new Date(), options), - ); -} - - -/***/ }), - -/***/ 47369: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isMonday = isMonday; -var _index = __nccwpck_require__(53622); - -/** - * @name isMonday - * @category Weekday Helpers - * @summary Is the given date Monday? - * - * @description - * Is the given date Monday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is Monday - * - * @example - * // Is 22 September 2014 Monday? - * const result = isMonday(new Date(2014, 8, 22)) - * //=> true - */ -function isMonday(date) { - return (0, _index.toDate)(date).getDay() === 1; -} - - -/***/ }), - -/***/ 14687: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isPast = isPast; -var _index = __nccwpck_require__(53622); - -/** - * @name isPast - * @category Common Helpers - * @summary Is the given date in the past? - * @pure false - * - * @description - * Is the given date in the past? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in the past - * - * @example - * // If today is 6 October 2014, is 2 July 2014 in the past? - * const result = isPast(new Date(2014, 6, 2)) - * //=> true - */ -function isPast(date) { - return +(0, _index.toDate)(date) < Date.now(); -} - - -/***/ }), - -/***/ 28512: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameDay = isSameDay; -var _index = __nccwpck_require__(91310); - -/** - * @name isSameDay - * @category Day Helpers - * @summary Are the given dates in the same day (and year and month)? - * - * @description - * Are the given dates in the same day (and year and month)? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - - * @returns The dates are in the same day (and year and month) - * - * @example - * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day? - * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0)) - * //=> true - * - * @example - * // Are 4 September and 4 October in the same day? - * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4)) - * //=> false - * - * @example - * // Are 4 September, 2014 and 4 September, 2015 in the same day? - * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4)) - * //=> false - */ -function isSameDay(dateLeft, dateRight) { - const dateLeftStartOfDay = (0, _index.startOfDay)(dateLeft); - const dateRightStartOfDay = (0, _index.startOfDay)(dateRight); - - return +dateLeftStartOfDay === +dateRightStartOfDay; -} - - -/***/ }), - -/***/ 91108: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameHour = isSameHour; -var _index = __nccwpck_require__(68079); - -/** - * @name isSameHour - * @category Hour Helpers - * @summary Are the given dates in the same hour (and same day)? - * - * @description - * Are the given dates in the same hour (and same day)? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * - * @returns The dates are in the same hour (and same day) - * - * @example - * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour? - * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30)) - * //=> true - * - * @example - * // Are 4 September 2014 06:00:00 and 5 September 06:00:00 in the same hour? - * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 5, 6, 0)) - * //=> false - */ -function isSameHour(dateLeft, dateRight) { - const dateLeftStartOfHour = (0, _index.startOfHour)(dateLeft); - const dateRightStartOfHour = (0, _index.startOfHour)(dateRight); - - return +dateLeftStartOfHour === +dateRightStartOfHour; -} - - -/***/ }), - -/***/ 10741: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameISOWeek = isSameISOWeek; -var _index = __nccwpck_require__(85644); - -/** - * @name isSameISOWeek - * @category ISO Week Helpers - * @summary Are the given dates in the same ISO week (and year)? - * - * @description - * Are the given dates in the same ISO week (and year)? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * - * @returns The dates are in the same ISO week (and year) - * - * @example - * // Are 1 September 2014 and 7 September 2014 in the same ISO week? - * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7)) - * //=> true - * - * @example - * // Are 1 September 2014 and 1 September 2015 in the same ISO week? - * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2015, 8, 1)) - * //=> false - */ -function isSameISOWeek(dateLeft, dateRight) { - return (0, _index.isSameWeek)(dateLeft, dateRight, { weekStartsOn: 1 }); -} - - -/***/ }), - -/***/ 45295: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameISOWeekYear = isSameISOWeekYear; -var _index = __nccwpck_require__(37809); - -/** - * @name isSameISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Are the given dates in the same ISO week-numbering year? - * - * @description - * Are the given dates in the same ISO week-numbering year? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * - * @returns The dates are in the same ISO week-numbering year - * - * @example - * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year? - * const result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2)) - * //=> true - */ -function isSameISOWeekYear(dateLeft, dateRight) { - const dateLeftStartOfYear = (0, _index.startOfISOWeekYear)(dateLeft); - const dateRightStartOfYear = (0, _index.startOfISOWeekYear)(dateRight); - - return +dateLeftStartOfYear === +dateRightStartOfYear; -} - - -/***/ }), - -/***/ 53494: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameMinute = isSameMinute; -var _index = __nccwpck_require__(41831); - -/** - * @name isSameMinute - * @category Minute Helpers - * @summary Are the given dates in the same minute (and hour and day)? - * - * @description - * Are the given dates in the same minute (and hour and day)? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * - * @returns The dates are in the same minute (and hour and day) - * - * @example - * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15 in the same minute? - * const result = isSameMinute( - * new Date(2014, 8, 4, 6, 30), - * new Date(2014, 8, 4, 6, 30, 15) - * ) - * //=> true - * - * @example - * // Are 4 September 2014 06:30:00 and 5 September 2014 06:30:00 in the same minute? - * const result = isSameMinute( - * new Date(2014, 8, 4, 6, 30), - * new Date(2014, 8, 5, 6, 30) - * ) - * //=> false - */ -function isSameMinute(dateLeft, dateRight) { - const dateLeftStartOfMinute = (0, _index.startOfMinute)(dateLeft); - const dateRightStartOfMinute = (0, _index.startOfMinute)(dateRight); - - return +dateLeftStartOfMinute === +dateRightStartOfMinute; -} - - -/***/ }), - -/***/ 36679: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameMonth = isSameMonth; -var _index = __nccwpck_require__(53622); - -/** - * @name isSameMonth - * @category Month Helpers - * @summary Are the given dates in the same month (and year)? - * - * @description - * Are the given dates in the same month (and year)? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * - * @returns The dates are in the same month (and year) - * - * @example - * // Are 2 September 2014 and 25 September 2014 in the same month? - * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25)) - * //=> true - * - * @example - * // Are 2 September 2014 and 25 September 2015 in the same month? - * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25)) - * //=> false - */ -function isSameMonth(dateLeft, dateRight) { - const _dateLeft = (0, _index.toDate)(dateLeft); - const _dateRight = (0, _index.toDate)(dateRight); - return ( - _dateLeft.getFullYear() === _dateRight.getFullYear() && - _dateLeft.getMonth() === _dateRight.getMonth() - ); -} - - -/***/ }), - -/***/ 20883: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameQuarter = isSameQuarter; -var _index = __nccwpck_require__(3148); - -/** - * @name isSameQuarter - * @category Quarter Helpers - * @summary Are the given dates in the same quarter (and year)? - * - * @description - * Are the given dates in the same quarter (and year)? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - - * @returns The dates are in the same quarter (and year) - * - * @example - * // Are 1 January 2014 and 8 March 2014 in the same quarter? - * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8)) - * //=> true - * - * @example - * // Are 1 January 2014 and 1 January 2015 in the same quarter? - * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1)) - * //=> false - */ -function isSameQuarter(dateLeft, dateRight) { - const dateLeftStartOfQuarter = (0, _index.startOfQuarter)(dateLeft); - const dateRightStartOfQuarter = (0, _index.startOfQuarter)(dateRight); - - return +dateLeftStartOfQuarter === +dateRightStartOfQuarter; -} - - -/***/ }), - -/***/ 50821: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameSecond = isSameSecond; -var _index = __nccwpck_require__(22991); - -/** - * @name isSameSecond - * @category Second Helpers - * @summary Are the given dates in the same second (and hour and day)? - * - * @description - * Are the given dates in the same second (and hour and day)? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * - * @returns The dates are in the same second (and hour and day) - * - * @example - * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 in the same second? - * const result = isSameSecond( - * new Date(2014, 8, 4, 6, 30, 15), - * new Date(2014, 8, 4, 6, 30, 15, 500) - * ) - * //=> true - * - * @example - * // Are 4 September 2014 06:00:15.000 and 4 September 2014 06:01.15.000 in the same second? - * const result = isSameSecond( - * new Date(2014, 8, 4, 6, 0, 15), - * new Date(2014, 8, 4, 6, 1, 15) - * ) - * //=> false - * - * @example - * // Are 4 September 2014 06:00:15.000 and 5 September 2014 06:00.15.000 in the same second? - * const result = isSameSecond( - * new Date(2014, 8, 4, 6, 0, 15), - * new Date(2014, 8, 5, 6, 0, 15) - * ) - * //=> false - */ -function isSameSecond(dateLeft, dateRight) { - const dateLeftStartOfSecond = (0, _index.startOfSecond)(dateLeft); - const dateRightStartOfSecond = (0, _index.startOfSecond)(dateRight); - - return +dateLeftStartOfSecond === +dateRightStartOfSecond; -} - - -/***/ }), - -/***/ 85644: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameWeek = isSameWeek; -var _index = __nccwpck_require__(26068); - -/** - * The {@link isSameWeek} function options. - */ - -/** - * @name isSameWeek - * @category Week Helpers - * @summary Are the given dates in the same week (and month and year)? - * - * @description - * Are the given dates in the same week (and month and year)? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * @param options - An object with options - * - * @returns The dates are in the same week (and month and year) - * - * @example - * // Are 31 August 2014 and 4 September 2014 in the same week? - * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4)) - * //=> true - * - * @example - * // If week starts with Monday, - * // are 31 August 2014 and 4 September 2014 in the same week? - * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), { - * weekStartsOn: 1 - * }) - * //=> false - * - * @example - * // Are 1 January 2014 and 1 January 2015 in the same week? - * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1)) - * //=> false - */ -function isSameWeek(dateLeft, dateRight, options) { - const dateLeftStartOfWeek = (0, _index.startOfWeek)(dateLeft, options); - const dateRightStartOfWeek = (0, _index.startOfWeek)(dateRight, options); - - return +dateLeftStartOfWeek === +dateRightStartOfWeek; -} - - -/***/ }), - -/***/ 65694: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSameYear = isSameYear; -var _index = __nccwpck_require__(53622); - -/** - * @name isSameYear - * @category Year Helpers - * @summary Are the given dates in the same year? - * - * @description - * Are the given dates in the same year? - * - * @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). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * - * @returns The dates are in the same year - * - * @example - * // Are 2 September 2014 and 25 September 2014 in the same year? - * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25)) - * //=> true - */ -function isSameYear(dateLeft, dateRight) { - const _dateLeft = (0, _index.toDate)(dateLeft); - const _dateRight = (0, _index.toDate)(dateRight); - return _dateLeft.getFullYear() === _dateRight.getFullYear(); -} - - -/***/ }), - -/***/ 92320: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSaturday = isSaturday; -var _index = __nccwpck_require__(53622); - -/** - * @name isSaturday - * @category Weekday Helpers - * @summary Is the given date Saturday? - * - * @description - * Is the given date Saturday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is Saturday - * - * @example - * // Is 27 September 2014 Saturday? - * const result = isSaturday(new Date(2014, 8, 27)) - * //=> true - */ -function isSaturday(date) { - return (0, _index.toDate)(date).getDay() === 6; -} - - -/***/ }), - -/***/ 49267: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isSunday = isSunday; -var _index = __nccwpck_require__(53622); - -/** - * @name isSunday - * @category Weekday Helpers - * @summary Is the given date Sunday? - * - * @description - * Is the given date Sunday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is Sunday - * - * @example - * // Is 21 September 2014 Sunday? - * const result = isSunday(new Date(2014, 8, 21)) - * //=> true - */ -function isSunday(date) { - return (0, _index.toDate)(date).getDay() === 0; -} - - -/***/ }), - -/***/ 24872: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisHour = isThisHour; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(91108); - -/** - * @name isThisHour - * @category Hour Helpers - * @summary Is the given date in the same hour as the current date? - * @pure false - * - * @description - * Is the given date in the same hour as the current date? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in this hour - * - * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:00:00 in this hour? - * const result = isThisHour(new Date(2014, 8, 25, 18)) - * //=> true - */ -function isThisHour(date) { - return (0, _index2.isSameHour)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 5573: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisISOWeek = isThisISOWeek; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(10741); - -/** - * @name isThisISOWeek - * @category ISO Week Helpers - * @summary Is the given date in the same ISO week as the current date? - * @pure false - * - * @description - * Is the given date in the same ISO week as the current date? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in this ISO week - * - * @example - * // If today is 25 September 2014, is 22 September 2014 in this ISO week? - * const result = isThisISOWeek(new Date(2014, 8, 22)) - * //=> true - */ - -function isThisISOWeek(date) { - return (0, _index2.isSameISOWeek)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 96051: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisMinute = isThisMinute; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(53494); - -/** - * @name isThisMinute - * @category Minute Helpers - * @summary Is the given date in the same minute as the current date? - * @pure false - * - * @description - * Is the given date in the same minute as the current date? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in this minute - * - * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:30:00 in this minute? - * const result = isThisMinute(new Date(2014, 8, 25, 18, 30)) - * //=> true - */ - -function isThisMinute(date) { - return (0, _index2.isSameMinute)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 53335: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisMonth = isThisMonth; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(36679); - -/** - * @name isThisMonth - * @category Month Helpers - * @summary Is the given date in the same month as the current date? - * @pure false - * - * @description - * Is the given date in the same month as the current date? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in this month - * - * @example - * // If today is 25 September 2014, is 15 September 2014 in this month? - * const result = isThisMonth(new Date(2014, 8, 15)) - * //=> true - */ - -function isThisMonth(date) { - return (0, _index2.isSameMonth)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 14474: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisQuarter = isThisQuarter; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(20883); - -/** - * @name isThisQuarter - * @category Quarter Helpers - * @summary Is the given date in the same quarter as the current date? - * @pure false - * - * @description - * Is the given date in the same quarter as the current date? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in this quarter - * - * @example - * // If today is 25 September 2014, is 2 July 2014 in this quarter? - * const result = isThisQuarter(new Date(2014, 6, 2)) - * //=> true - */ -function isThisQuarter(date) { - return (0, _index2.isSameQuarter)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 11000: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisSecond = isThisSecond; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(50821); - -/** - * @name isThisSecond - * @category Second Helpers - * @summary Is the given date in the same second as the current date? - * @pure false - * - * @description - * Is the given date in the same second as the current date? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in this second - * - * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:30:15.000 in this second? - * const result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15)) - * //=> true - */ -function isThisSecond(date) { - return (0, _index2.isSameSecond)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 6738: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisWeek = isThisWeek; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(85644); - -/** - * The {@link isThisWeek} function options. - */ - -/** - * @name isThisWeek - * @category Week Helpers - * @summary Is the given date in the same week as the current date? - * @pure false - * - * @description - * Is the given date in the same week as the current date? - * - * @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). - * - * @param date - The date to check - * @param options - The object with options - * - * @returns The date is in this week - * - * @example - * // If today is 25 September 2014, is 21 September 2014 in this week? - * const result = isThisWeek(new Date(2014, 8, 21)) - * //=> true - * - * @example - * // If today is 25 September 2014 and week starts with Monday - * // is 21 September 2014 in this week? - * const result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 }) - * //=> false - */ -function isThisWeek(date, options) { - return (0, _index2.isSameWeek)(date, (0, _index.constructNow)(date), options); -} - - -/***/ }), - -/***/ 60871: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThisYear = isThisYear; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(65694); - -/** - * @name isThisYear - * @category Year Helpers - * @summary Is the given date in the same year as the current date? - * @pure false - * - * @description - * Is the given date in the same year as the current date? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is in this year - * - * @example - * // If today is 25 September 2014, is 2 July 2014 in this year? - * const result = isThisYear(new Date(2014, 6, 2)) - * //=> true - */ -function isThisYear(date) { - return (0, _index2.isSameYear)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 12573: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isThursday = isThursday; -var _index = __nccwpck_require__(53622); - -/** - * @name isThursday - * @category Weekday Helpers - * @summary Is the given date Thursday? - * - * @description - * Is the given date Thursday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is Thursday - * - * @example - * // Is 25 September 2014 Thursday? - * const result = isThursday(new Date(2014, 8, 25)) - * //=> true - */ -function isThursday(date) { - return (0, _index.toDate)(date).getDay() === 4; -} - - -/***/ }), - -/***/ 56045: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isToday = isToday; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(28512); - -/** - * @name isToday - * @category Day Helpers - * @summary Is the given date today? - * @pure false - * - * @description - * Is the given date today? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is today - * - * @example - * // If today is 6 October 2014, is 6 October 14:00:00 today? - * const result = isToday(new Date(2014, 9, 6, 14, 0)) - * //=> true - */ -function isToday(date) { - return (0, _index2.isSameDay)(date, (0, _index.constructNow)(date)); -} - - -/***/ }), - -/***/ 93845: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isTomorrow = isTomorrow; -var _index = __nccwpck_require__(8361); -var _index2 = __nccwpck_require__(87785); -var _index3 = __nccwpck_require__(28512); - -/** - * @name isTomorrow - * @category Day Helpers - * @summary Is the given date tomorrow? - * @pure false - * - * @description - * Is the given date tomorrow? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is tomorrow - * - * @example - * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow? - * const result = isTomorrow(new Date(2014, 9, 7, 14, 0)) - * //=> true - */ -function isTomorrow(date) { - return (0, _index3.isSameDay)( - date, - (0, _index.addDays)((0, _index2.constructNow)(date), 1), - ); -} - - -/***/ }), - -/***/ 30078: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isTuesday = isTuesday; -var _index = __nccwpck_require__(53622); - -/** - * @name isTuesday - * @category Weekday Helpers - * @summary Is the given date Tuesday? - * - * @description - * Is the given date Tuesday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is Tuesday - * - * @example - * // Is 23 September 2014 Tuesday? - * const result = isTuesday(new Date(2014, 8, 23)) - * //=> true - */ -function isTuesday(date) { - return (0, _index.toDate)(date).getDay() === 2; -} - - -/***/ }), - -/***/ 58915: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isValid = isValid; -var _index = __nccwpck_require__(62272); -var _index2 = __nccwpck_require__(53622); - -/** - * @name isValid - * @category Common Helpers - * @summary Is the given date valid? - * - * @description - * Returns false if argument is Invalid Date and true otherwise. - * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate) - * Invalid Date is a Date, whose time value is NaN. - * - * Time value of Date: http://es5.github.io/#x15.9.1.1 - * - * @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). - * - * @param date - The date to check - * - * @returns The date is valid - * - * @example - * // For the valid date: - * const result = isValid(new Date(2014, 1, 31)) - * //=> true - * - * @example - * // For the value, convertable into a date: - * const result = isValid(1393804800000) - * //=> true - * - * @example - * // For the invalid date: - * const result = isValid(new Date('')) - * //=> false - */ -function isValid(date) { - if (!(0, _index.isDate)(date) && typeof date !== "number") { - return false; - } - const _date = (0, _index2.toDate)(date); - return !isNaN(Number(_date)); -} - - -/***/ }), - -/***/ 68880: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isWednesday = isWednesday; -var _index = __nccwpck_require__(53622); - -/** - * @name isWednesday - * @category Weekday Helpers - * @summary Is the given date Wednesday? - * - * @description - * Is the given date Wednesday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is Wednesday - * - * @example - * // Is 24 September 2014 Wednesday? - * const result = isWednesday(new Date(2014, 8, 24)) - * //=> true - */ -function isWednesday(date) { - return (0, _index.toDate)(date).getDay() === 3; -} - - -/***/ }), - -/***/ 45417: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isWeekend = isWeekend; -var _index = __nccwpck_require__(53622); - -/** - * @name isWeekend - * @category Weekday Helpers - * @summary Does the given date fall on a weekend? - * - * @description - * Does the given date fall on a weekend? - * - * @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). - * - * @param date - The date to check - * - * @returns The date falls on a weekend - * - * @example - * // Does 5 October 2014 fall on a weekend? - * const result = isWeekend(new Date(2014, 9, 5)) - * //=> true - */ -function isWeekend(date) { - const day = (0, _index.toDate)(date).getDay(); - return day === 0 || day === 6; -} - - -/***/ }), - -/***/ 66460: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isWithinInterval = isWithinInterval; -var _index = __nccwpck_require__(53622); - -/** - * @name isWithinInterval - * @category Interval Helpers - * @summary Is the given date within the interval? - * - * @description - * Is the given date within the interval? (Including start and end.) - * - * @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). - * - * @param date - The date to check - * @param interval - The interval to check - * - * @returns The date is within the interval - * - * @example - * // For the date within the interval: - * isWithinInterval(new Date(2014, 0, 3), { - * start: new Date(2014, 0, 1), - * end: new Date(2014, 0, 7) - * }) - * //=> true - * - * @example - * // For the date outside of the interval: - * isWithinInterval(new Date(2014, 0, 10), { - * start: new Date(2014, 0, 1), - * end: new Date(2014, 0, 7) - * }) - * //=> false - * - * @example - * // For date equal to interval start: - * isWithinInterval(date, { start, end: date }) - * // => true - * - * @example - * // For date equal to interval end: - * isWithinInterval(date, { start: date, end }) - * // => true - */ -function isWithinInterval(date, interval) { - const time = +(0, _index.toDate)(date); - const [startTime, endTime] = [ - +(0, _index.toDate)(interval.start), - +(0, _index.toDate)(interval.end), - ].sort((a, b) => a - b); - - return time >= startTime && time <= endTime; -} - - -/***/ }), - -/***/ 3673: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.isYesterday = isYesterday; -var _index = __nccwpck_require__(87785); -var _index2 = __nccwpck_require__(28512); -var _index3 = __nccwpck_require__(19771); - -/** - * @name isYesterday - * @category Day Helpers - * @summary Is the given date yesterday? - * @pure false - * - * @description - * Is the given date yesterday? - * - * @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). - * - * @param date - The date to check - * - * @returns The date is yesterday - * - * @example - * // If today is 6 October 2014, is 5 October 14:00:00 yesterday? - * const result = isYesterday(new Date(2014, 9, 5, 14, 0)) - * //=> true - */ -function isYesterday(date) { - return (0, _index2.isSameDay)( - date, - (0, _index3.subDays)((0, _index.constructNow)(date), 1), - ); -} - - -/***/ }), - -/***/ 64615: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lastDayOfDecade = lastDayOfDecade; -var _index = __nccwpck_require__(53622); - -/** - * @name lastDayOfDecade - * @category Decade Helpers - * @summary Return the last day of a decade for the given date. - * - * @description - * Return the last day of a decade for the given date. - * - * @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). - * - * @param date - The original date - * - * @returns The last day of a decade - * - * @example - * // The last day of a decade for 21 December 2012 21:12:00: - * const result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00)) - * //=> Wed Dec 31 2019 00:00:00 - */ -function lastDayOfDecade(date) { - // TODO: Switch to more technical definition in of decades that start with 1 - // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking - // change, so it can only be done in 4.0. - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - const decade = 9 + Math.floor(year / 10) * 10; - _date.setFullYear(decade + 1, 0, 0); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 92494: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lastDayOfISOWeek = lastDayOfISOWeek; -var _index = __nccwpck_require__(88228); - -/** - * @name lastDayOfISOWeek - * @category ISO Week Helpers - * @summary Return the last day of an ISO week for the given date. - * - * @description - * Return the last day of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The original date - * - * @returns The last day of an ISO week - * - * @example - * // The last day of an ISO week for 2 September 2014 11:55:00: - * const result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Sep 07 2014 00:00:00 - */ -function lastDayOfISOWeek(date) { - return (0, _index.lastDayOfWeek)(date, { weekStartsOn: 1 }); -} - - -/***/ }), - -/***/ 8454: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lastDayOfISOWeekYear = lastDayOfISOWeekYear; -var _index = __nccwpck_require__(90308); -var _index2 = __nccwpck_require__(69709); -var _index3 = __nccwpck_require__(92736); - -/** - * @name lastDayOfISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Return the last day of an ISO week-numbering year for the given date. - * - * @description - * Return the last day of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The original date - * - * @returns The end of an ISO week-numbering year - * - * @example - * // The last day of an ISO week-numbering year for 2 July 2005: - * const result = lastDayOfISOWeekYear(new Date(2005, 6, 2)) - * //=> Sun Jan 01 2006 00:00:00 - */ -function lastDayOfISOWeekYear(date) { - const year = (0, _index.getISOWeekYear)(date); - const fourthOfJanuary = (0, _index3.constructFrom)(date, 0); - fourthOfJanuary.setFullYear(year + 1, 0, 4); - fourthOfJanuary.setHours(0, 0, 0, 0); - const _date = (0, _index2.startOfISOWeek)(fourthOfJanuary); - _date.setDate(_date.getDate() - 1); - return _date; -} - - -/***/ }), - -/***/ 97270: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lastDayOfMonth = lastDayOfMonth; -var _index = __nccwpck_require__(53622); - -/** - * @name lastDayOfMonth - * @category Month Helpers - * @summary Return the last day of a month for the given date. - * - * @description - * Return the last day of a month for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The last day of a month - * - * @example - * // The last day of a month for 2 September 2014 11:55:00: - * const result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 00:00:00 - */ -function lastDayOfMonth(date) { - const _date = (0, _index.toDate)(date); - const month = _date.getMonth(); - _date.setFullYear(_date.getFullYear(), month + 1, 0); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 68921: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lastDayOfQuarter = lastDayOfQuarter; -var _index = __nccwpck_require__(53622); - -/** - * @name lastDayOfQuarter - * @category Quarter Helpers - * @summary Return the last day of a year quarter for the given date. - * - * @description - * Return the last day of a year quarter for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The last day of a quarter - * - * @example - * // The last day of a quarter for 2 September 2014 11:55:00: - * const result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 00:00:00 - */ -function lastDayOfQuarter(date) { - const _date = (0, _index.toDate)(date); - const currentMonth = _date.getMonth(); - const month = currentMonth - (currentMonth % 3) + 3; - _date.setMonth(month, 0); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 88228: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lastDayOfWeek = lastDayOfWeek; -var _index = __nccwpck_require__(53622); - -var _index2 = __nccwpck_require__(42466); - -/** - * The {@link lastDayOfWeek} function options. - */ - -/** - * @name lastDayOfWeek - * @category Week Helpers - * @summary Return the last day of a week for the given date. - * - * @description - * Return the last day of a week for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * @param options - An object with options - * - * @returns The last day of a week - * - * @example - * // The last day of a week for 2 September 2014 11:55:00: - * const result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sat Sep 06 2014 00:00:00 - * - * @example - * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00: - * const result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) - * //=> Sun Sep 07 2014 00:00:00 - */ -function lastDayOfWeek(date, options) { - const defaultOptions = (0, _index2.getDefaultOptions)(); - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - const _date = (0, _index.toDate)(date); - const day = _date.getDay(); - const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); - - _date.setHours(0, 0, 0, 0); - _date.setDate(_date.getDate() + diff); - return _date; -} - - -/***/ }), - -/***/ 63494: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lastDayOfYear = lastDayOfYear; -var _index = __nccwpck_require__(53622); - -/** - * @name lastDayOfYear - * @category Year Helpers - * @summary Return the last day of a year for the given date. - * - * @description - * Return the last day of a year for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The last day of a year - * - * @example - * // The last day of a year for 2 September 2014 11:55:00: - * const result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Dec 31 2014 00:00:00 - */ -function lastDayOfYear(date) { - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - _date.setFullYear(year + 1, 0, 0); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 100: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.lightFormat = lightFormat; -Object.defineProperty(exports, "lightFormatters", ({ - enumerable: true, - get: function () { - return _index3.lightFormatters; - }, -})); -var _index = __nccwpck_require__(58915); -var _index2 = __nccwpck_require__(53622); -var _index3 = __nccwpck_require__(26961); - -// Rexports of internal for libraries to use. -// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 - -// This RegExp consists of three parts separated by `|`: -// - (\w)\1* matches any sequences of the same letter -// - '' matches two quote characters in a row -// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), -// except a single quote symbol, which ends the sequence. -// Two quote characters do not end the sequence. -// If there is no matching single quote -// then the sequence will continue until the end of the string. -// - . matches any single character unmatched by previous parts of the RegExps -const formattingTokensRegExp = /(\w)\1*|''|'(''|[^'])+('|$)|./g; - -const escapedStringRegExp = /^'([^]*?)'?$/; -const doubleQuoteRegExp = /''/g; -const unescapedLatinCharacterRegExp = /[a-zA-Z]/; - -/** - * @private - */ - -/** - * @name lightFormat - * @category Common Helpers - * @summary Format the date. - * - * @description - * Return the formatted date string in the given format. Unlike `format`, - * `lightFormat` doesn't use locales and outputs date using the most popular tokens. - * - * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries. - * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * The characters wrapped between two single quotes characters (') are escaped. - * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. - * - * Format of the string is based on Unicode Technical Standard #35: - * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * - * Accepted patterns: - * | Unit | Pattern | Result examples | - * |---------------------------------|---------|-----------------------------------| - * | AM, PM | a..aaa | AM, PM | - * | | aaaa | a.m., p.m. | - * | | aaaaa | a, p | - * | Calendar year | y | 44, 1, 1900, 2017 | - * | | yy | 44, 01, 00, 17 | - * | | yyy | 044, 001, 000, 017 | - * | | yyyy | 0044, 0001, 1900, 2017 | - * | Month (formatting) | M | 1, 2, ..., 12 | - * | | MM | 01, 02, ..., 12 | - * | Day of month | d | 1, 2, ..., 31 | - * | | dd | 01, 02, ..., 31 | - * | Hour [1-12] | h | 1, 2, ..., 11, 12 | - * | | hh | 01, 02, ..., 11, 12 | - * | Hour [0-23] | H | 0, 1, 2, ..., 23 | - * | | HH | 00, 01, 02, ..., 23 | - * | Minute | m | 0, 1, ..., 59 | - * | | mm | 00, 01, ..., 59 | - * | Second | s | 0, 1, ..., 59 | - * | | ss | 00, 01, ..., 59 | - * | Fraction of second | S | 0, 1, ..., 9 | - * | | SS | 00, 01, ..., 99 | - * | | SSS | 000, 001, ..., 999 | - * | | SSSS | ... | - * - * @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). - * - * @param date - The original date - * @param format - The string of tokens - * - * @returns The formatted date string - * - * @throws `Invalid time value` if the date is invalid - * @throws format string contains an unescaped latin alphabet character - * - * @example - * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd') - * //=> '2014-02-11' - */ -function lightFormat(date, formatStr) { - const _date = (0, _index2.toDate)(date); - - if (!(0, _index.isValid)(_date)) { - throw new RangeError("Invalid time value"); - } - - const tokens = formatStr.match(formattingTokensRegExp); - - // The only case when formattingTokensRegExp doesn't match the string is when it's empty - if (!tokens) return ""; - - const result = tokens - .map((substring) => { - // Replace two single quote characters with one single quote character - if (substring === "''") { - return "'"; - } - - const firstCharacter = substring[0]; - if (firstCharacter === "'") { - return cleanEscapedString(substring); - } - - const formatter = _index3.lightFormatters[firstCharacter]; - if (formatter) { - return formatter(_date, substring); - } - - if (firstCharacter.match(unescapedLatinCharacterRegExp)) { - throw new RangeError( - "Format string contains an unescaped latin alphabet character `" + - firstCharacter + - "`", - ); - } - - return substring; - }) - .join(""); - - return result; -} - -function cleanEscapedString(input) { - const matches = input.match(escapedStringRegExp); - - if (!matches) { - return input; - } - - return matches[1].replace(doubleQuoteRegExp, "'"); -} - - -/***/ }), - -/***/ 79839: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.buildFormatLongFn = buildFormatLongFn; - -function buildFormatLongFn(args) { - return (options = {}) => { - // TODO: Remove String() - const width = options.width ? String(options.width) : args.defaultWidth; - const format = args.formats[width] || args.formats[args.defaultWidth]; - return format; - }; -} - - -/***/ }), - -/***/ 2080: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.buildLocalizeFn = buildLocalizeFn; /* eslint-disable no-unused-vars */ - -/** - * The localize function argument callback which allows to convert raw value to - * the actual type. - * - * @param value - The value to convert - * - * @returns The converted value - */ - -/** - * The map of localized values for each width. - */ - -/** - * The index type of the locale unit value. It types conversion of units of - * values that don't start at 0 (i.e. quarters). - */ - -/** - * Converts the unit value to the tuple of values. - */ - -/** - * The tuple of localized era values. The first element represents BC, - * the second element represents AD. - */ - -/** - * The tuple of localized quarter values. The first element represents Q1. - */ - -/** - * The tuple of localized day values. The first element represents Sunday. - */ - -/** - * The tuple of localized month values. The first element represents January. - */ - -function buildLocalizeFn(args) { - return (value, options) => { - const context = options?.context ? String(options.context) : "standalone"; - - let valuesArray; - if (context === "formatting" && args.formattingValues) { - const defaultWidth = args.defaultFormattingWidth || args.defaultWidth; - const width = options?.width ? String(options.width) : defaultWidth; - - valuesArray = - args.formattingValues[width] || args.formattingValues[defaultWidth]; - } else { - const defaultWidth = args.defaultWidth; - const width = options?.width ? String(options.width) : args.defaultWidth; - - valuesArray = args.values[width] || args.values[defaultWidth]; - } - const index = args.argumentCallback ? args.argumentCallback(value) : value; - - // @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! - return valuesArray[index]; - }; -} - - -/***/ }), - -/***/ 8867: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.buildMatchFn = buildMatchFn; - -function buildMatchFn(args) { - return (string, options = {}) => { - const width = options.width; - - const matchPattern = - (width && args.matchPatterns[width]) || - args.matchPatterns[args.defaultMatchWidth]; - const matchResult = string.match(matchPattern); - - if (!matchResult) { - return null; - } - const matchedString = matchResult[0]; - - const parsePatterns = - (width && args.parsePatterns[width]) || - args.parsePatterns[args.defaultParseWidth]; - - const key = Array.isArray(parsePatterns) - ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - findKey(parsePatterns, (pattern) => pattern.test(matchedString)); - - let value; - - value = args.valueCallback ? args.valueCallback(key) : key; - value = options.valueCallback - ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - options.valueCallback(value) - : value; - - const rest = string.slice(matchedString.length); - - return { value, rest }; - }; -} - -function findKey(object, predicate) { - for (const key in object) { - if ( - Object.prototype.hasOwnProperty.call(object, key) && - predicate(object[key]) - ) { - return key; - } - } - return undefined; -} - -function findIndex(array, predicate) { - for (let key = 0; key < array.length; key++) { - if (predicate(array[key])) { - return key; - } - } - return undefined; -} - - -/***/ }), - -/***/ 14719: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.buildMatchPatternFn = buildMatchPatternFn; - -function buildMatchPatternFn(args) { - return (string, options = {}) => { - const matchResult = string.match(args.matchPattern); - if (!matchResult) return null; - const matchedString = matchResult[0]; - - const parseResult = string.match(args.parsePattern); - if (!parseResult) return null; - let value = args.valueCallback - ? args.valueCallback(parseResult[0]) - : parseResult[0]; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - value = options.valueCallback ? options.valueCallback(value) : value; - - const rest = string.slice(matchedString.length); - - return { value, rest }; - }; -} - - -/***/ }), - -/***/ 55: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.enUS = void 0; -var _index = __nccwpck_require__(25163); -var _index2 = __nccwpck_require__(7666); -var _index3 = __nccwpck_require__(74908); -var _index4 = __nccwpck_require__(86229); -var _index5 = __nccwpck_require__(62403); - -/** - * @category Locales - * @summary English locale (United States). - * @language English - * @iso-639-2 eng - * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp) - * @author Lesha Koss [@leshakoss](https://github.com/leshakoss) - */ -const enUS = (exports.enUS = { - code: "en-US", - formatDistance: _index.formatDistance, - formatLong: _index2.formatLong, - formatRelative: _index3.formatRelative, - localize: _index4.localize, - match: _index5.match, - options: { - weekStartsOn: 0 /* Sunday */, - firstWeekContainsDate: 1, - }, -}); - - -/***/ }), - -/***/ 25163: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.formatDistance = void 0; - -const formatDistanceLocale = { - lessThanXSeconds: { - one: "less than a second", - other: "less than {{count}} seconds", - }, - - xSeconds: { - one: "1 second", - other: "{{count}} seconds", - }, - - halfAMinute: "half a minute", - - lessThanXMinutes: { - one: "less than a minute", - other: "less than {{count}} minutes", - }, - - xMinutes: { - one: "1 minute", - other: "{{count}} minutes", - }, - - aboutXHours: { - one: "about 1 hour", - other: "about {{count}} hours", - }, - - xHours: { - one: "1 hour", - other: "{{count}} hours", - }, - - xDays: { - one: "1 day", - other: "{{count}} days", - }, - - aboutXWeeks: { - one: "about 1 week", - other: "about {{count}} weeks", - }, - - xWeeks: { - one: "1 week", - other: "{{count}} weeks", - }, - - aboutXMonths: { - one: "about 1 month", - other: "about {{count}} months", - }, - - xMonths: { - one: "1 month", - other: "{{count}} months", - }, - - aboutXYears: { - one: "about 1 year", - other: "about {{count}} years", - }, - - xYears: { - one: "1 year", - other: "{{count}} years", - }, - - overXYears: { - one: "over 1 year", - other: "over {{count}} years", - }, - - almostXYears: { - one: "almost 1 year", - other: "almost {{count}} years", - }, -}; - -const formatDistance = (token, count, options) => { - let result; - - const tokenValue = formatDistanceLocale[token]; - if (typeof tokenValue === "string") { - result = tokenValue; - } else if (count === 1) { - result = tokenValue.one; - } else { - result = tokenValue.other.replace("{{count}}", count.toString()); - } - - if (options?.addSuffix) { - if (options.comparison && options.comparison > 0) { - return "in " + result; - } else { - return result + " ago"; - } - } - - return result; -}; -exports.formatDistance = formatDistance; - - -/***/ }), - -/***/ 7666: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.formatLong = void 0; -var _index = __nccwpck_require__(79839); - -const dateFormats = { - full: "EEEE, MMMM do, y", - long: "MMMM do, y", - medium: "MMM d, y", - short: "MM/dd/yyyy", -}; - -const timeFormats = { - full: "h:mm:ss a zzzz", - long: "h:mm:ss a z", - medium: "h:mm:ss a", - short: "h:mm a", -}; - -const dateTimeFormats = { - full: "{{date}} 'at' {{time}}", - long: "{{date}} 'at' {{time}}", - medium: "{{date}}, {{time}}", - short: "{{date}}, {{time}}", -}; - -const formatLong = (exports.formatLong = { - date: (0, _index.buildFormatLongFn)({ - formats: dateFormats, - defaultWidth: "full", - }), - - time: (0, _index.buildFormatLongFn)({ - formats: timeFormats, - defaultWidth: "full", - }), - - dateTime: (0, _index.buildFormatLongFn)({ - formats: dateTimeFormats, - defaultWidth: "full", - }), -}); - - -/***/ }), - -/***/ 74908: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.formatRelative = void 0; - -const formatRelativeLocale = { - lastWeek: "'last' eeee 'at' p", - yesterday: "'yesterday at' p", - today: "'today at' p", - tomorrow: "'tomorrow at' p", - nextWeek: "eeee 'at' p", - other: "P", -}; - -const formatRelative = (token, _date, _baseDate, _options) => - formatRelativeLocale[token]; -exports.formatRelative = formatRelative; - - -/***/ }), - -/***/ 86229: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.localize = void 0; -var _index = __nccwpck_require__(2080); - -const eraValues = { - narrow: ["B", "A"], - abbreviated: ["BC", "AD"], - wide: ["Before Christ", "Anno Domini"], -}; - -const quarterValues = { - narrow: ["1", "2", "3", "4"], - abbreviated: ["Q1", "Q2", "Q3", "Q4"], - wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"], -}; - -// Note: in English, the names of days of the week and months are capitalized. -// If you are making a new locale based on this one, check if the same is true for the language you're working on. -// Generally, formatted dates should look like they are in the middle of a sentence, -// e.g. in Spanish language the weekdays and months should be in the lowercase. -const monthValues = { - narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], - abbreviated: [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", - ], - - wide: [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", - ], -}; - -const dayValues = { - narrow: ["S", "M", "T", "W", "T", "F", "S"], - short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], - abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - wide: [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - ], -}; - -const dayPeriodValues = { - narrow: { - am: "a", - pm: "p", - midnight: "mi", - noon: "n", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night", - }, - abbreviated: { - am: "AM", - pm: "PM", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night", - }, - wide: { - am: "a.m.", - pm: "p.m.", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night", - }, -}; - -const formattingDayPeriodValues = { - narrow: { - am: "a", - pm: "p", - midnight: "mi", - noon: "n", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night", - }, - abbreviated: { - am: "AM", - pm: "PM", - midnight: "midnight", - noon: "noon", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night", - }, - wide: { - am: "a.m.", - pm: "p.m.", - midnight: "midnight", - noon: "noon", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night", - }, -}; - -const ordinalNumber = (dirtyNumber, _options) => { - const number = Number(dirtyNumber); - - // If ordinal numbers depend on context, for example, - // if they are different for different grammatical genders, - // use `options.unit`. - // - // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear', - // 'day', 'hour', 'minute', 'second'. - - const rem100 = number % 100; - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + "st"; - case 2: - return number + "nd"; - case 3: - return number + "rd"; - } - } - return number + "th"; -}; - -const localize = (exports.localize = { - ordinalNumber, - - era: (0, _index.buildLocalizeFn)({ - values: eraValues, - defaultWidth: "wide", - }), - - quarter: (0, _index.buildLocalizeFn)({ - values: quarterValues, - defaultWidth: "wide", - argumentCallback: (quarter) => quarter - 1, - }), - - month: (0, _index.buildLocalizeFn)({ - values: monthValues, - defaultWidth: "wide", - }), - - day: (0, _index.buildLocalizeFn)({ - values: dayValues, - defaultWidth: "wide", - }), - - dayPeriod: (0, _index.buildLocalizeFn)({ - values: dayPeriodValues, - defaultWidth: "wide", - formattingValues: formattingDayPeriodValues, - defaultFormattingWidth: "wide", - }), -}); - - -/***/ }), - -/***/ 62403: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.match = void 0; - -var _index = __nccwpck_require__(8867); -var _index2 = __nccwpck_require__(14719); - -const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; -const parseOrdinalNumberPattern = /\d+/i; - -const matchEraPatterns = { - narrow: /^(b|a)/i, - abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, - wide: /^(before christ|before common era|anno domini|common era)/i, -}; -const parseEraPatterns = { - any: [/^b/i, /^(a|c)/i], -}; - -const matchQuarterPatterns = { - narrow: /^[1234]/i, - abbreviated: /^q[1234]/i, - wide: /^[1234](th|st|nd|rd)? quarter/i, -}; -const parseQuarterPatterns = { - any: [/1/i, /2/i, /3/i, /4/i], -}; - -const matchMonthPatterns = { - narrow: /^[jfmasond]/i, - abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, - wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i, -}; -const parseMonthPatterns = { - narrow: [ - /^j/i, - /^f/i, - /^m/i, - /^a/i, - /^m/i, - /^j/i, - /^j/i, - /^a/i, - /^s/i, - /^o/i, - /^n/i, - /^d/i, - ], - - any: [ - /^ja/i, - /^f/i, - /^mar/i, - /^ap/i, - /^may/i, - /^jun/i, - /^jul/i, - /^au/i, - /^s/i, - /^o/i, - /^n/i, - /^d/i, - ], -}; - -const matchDayPatterns = { - narrow: /^[smtwf]/i, - short: /^(su|mo|tu|we|th|fr|sa)/i, - abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, - wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i, -}; -const parseDayPatterns = { - narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], - any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i], -}; - -const matchDayPeriodPatterns = { - narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, - any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i, -}; -const parseDayPeriodPatterns = { - any: { - am: /^a/i, - pm: /^p/i, - midnight: /^mi/i, - noon: /^no/i, - morning: /morning/i, - afternoon: /afternoon/i, - evening: /evening/i, - night: /night/i, - }, -}; - -const match = (exports.match = { - ordinalNumber: (0, _index2.buildMatchPatternFn)({ - matchPattern: matchOrdinalNumberPattern, - parsePattern: parseOrdinalNumberPattern, - valueCallback: (value) => parseInt(value, 10), - }), - - era: (0, _index.buildMatchFn)({ - matchPatterns: matchEraPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseEraPatterns, - defaultParseWidth: "any", - }), - - quarter: (0, _index.buildMatchFn)({ - matchPatterns: matchQuarterPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseQuarterPatterns, - defaultParseWidth: "any", - valueCallback: (index) => index + 1, - }), - - month: (0, _index.buildMatchFn)({ - matchPatterns: matchMonthPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseMonthPatterns, - defaultParseWidth: "any", - }), - - day: (0, _index.buildMatchFn)({ - matchPatterns: matchDayPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseDayPatterns, - defaultParseWidth: "any", - }), - - dayPeriod: (0, _index.buildMatchFn)({ - matchPatterns: matchDayPeriodPatterns, - defaultMatchWidth: "any", - parsePatterns: parseDayPeriodPatterns, - defaultParseWidth: "any", - }), -}); - - -/***/ }), - -/***/ 17679: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.max = max; -var _index = __nccwpck_require__(53622); - -/** - * @name max - * @category Common Helpers - * @summary Return the latest of the given dates. - * - * @description - * Return the latest of the given dates. - * - * @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). - * - * @param dates - The dates to compare - * - * @returns The latest of the dates - * - * @example - * // Which of these dates is the latest? - * const result = max([ - * new Date(1989, 6, 10), - * new Date(1987, 1, 11), - * new Date(1995, 6, 2), - * new Date(1990, 0, 1) - * ]) - * //=> Sun Jul 02 1995 00:00:00 - */ -function max(dates) { - let result; - dates.forEach(function (dirtyDate) { - const currentDate = (0, _index.toDate)(dirtyDate); - - if ( - result === undefined || - result < currentDate || - isNaN(Number(currentDate)) - ) { - result = currentDate; - } - }); - - return result || new Date(NaN); -} - - -/***/ }), - -/***/ 43152: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.milliseconds = milliseconds; -var _index = __nccwpck_require__(17818); - -/** - * @name milliseconds - * @category Millisecond Helpers - * @summary - * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. - * - * @description - * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. - * - * One years equals 365.2425 days according to the formula: - * - * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. - * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days - * - * One month is a year divided by 12. - * - * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added. - * - * @returns The milliseconds - * - * @example - * // 1 year in milliseconds - * milliseconds({ years: 1 }) - * //=> 31556952000 - * - * // 3 months in milliseconds - * milliseconds({ months: 3 }) - * //=> 7889238000 - */ -function milliseconds({ years, months, weeks, days, hours, minutes, seconds }) { - let totalDays = 0; - - if (years) totalDays += years * _index.daysInYear; - if (months) totalDays += months * (_index.daysInYear / 12); - if (weeks) totalDays += weeks * 7; - if (days) totalDays += days; - - let totalSeconds = totalDays * 24 * 60 * 60; - - if (hours) totalSeconds += hours * 60 * 60; - if (minutes) totalSeconds += minutes * 60; - if (seconds) totalSeconds += seconds; - - return Math.trunc(totalSeconds * 1000); -} - - -/***/ }), - -/***/ 33067: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.millisecondsToHours = millisecondsToHours; -var _index = __nccwpck_require__(17818); - -/** - * @name millisecondsToHours - * @category Conversion Helpers - * @summary Convert milliseconds to hours. - * - * @description - * Convert a number of milliseconds to a full number of hours. - * - * @param milliseconds - The number of milliseconds to be converted - * - * @returns The number of milliseconds converted in hours - * - * @example - * // Convert 7200000 milliseconds to hours: - * const result = millisecondsToHours(7200000) - * //=> 2 - * - * @example - * // It uses floor rounding: - * const result = millisecondsToHours(7199999) - * //=> 1 - */ -function millisecondsToHours(milliseconds) { - const hours = milliseconds / _index.millisecondsInHour; - return Math.trunc(hours); -} - - -/***/ }), - -/***/ 3883: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.millisecondsToMinutes = millisecondsToMinutes; -var _index = __nccwpck_require__(17818); - -/** - * @name millisecondsToMinutes - * @category Conversion Helpers - * @summary Convert milliseconds to minutes. - * - * @description - * Convert a number of milliseconds to a full number of minutes. - * - * @param milliseconds - The number of milliseconds to be converted - * - * @returns The number of milliseconds converted in minutes - * - * @example - * // Convert 60000 milliseconds to minutes: - * const result = millisecondsToMinutes(60000) - * //=> 1 - * - * @example - * // It uses floor rounding: - * const result = millisecondsToMinutes(119999) - * //=> 1 - */ -function millisecondsToMinutes(milliseconds) { - const minutes = milliseconds / _index.millisecondsInMinute; - return Math.trunc(minutes); -} - - -/***/ }), - -/***/ 43913: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.millisecondsToSeconds = millisecondsToSeconds; -var _index = __nccwpck_require__(17818); - -/** - * @name millisecondsToSeconds - * @category Conversion Helpers - * @summary Convert milliseconds to seconds. - * - * @description - * Convert a number of milliseconds to a full number of seconds. - * - * @param milliseconds - The number of milliseconds to be converted - * - * @returns The number of milliseconds converted in seconds - * - * @example - * // Convert 1000 miliseconds to seconds: - * const result = millisecondsToSeconds(1000) - * //=> 1 - * - * @example - * // It uses floor rounding: - * const result = millisecondsToSeconds(1999) - * //=> 1 - */ -function millisecondsToSeconds(milliseconds) { - const seconds = milliseconds / _index.millisecondsInSecond; - return Math.trunc(seconds); -} - - -/***/ }), - -/***/ 13607: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.min = min; -var _index = __nccwpck_require__(53622); - -/** - * @name min - * @category Common Helpers - * @summary Returns the earliest of the given dates. - * - * @description - * Returns the earliest of the given dates. - * - * @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). - * - * @param dates - The dates to compare - * - * @returns The earliest of the dates - * - * @example - * // Which of these dates is the earliest? - * const result = min([ - * new Date(1989, 6, 10), - * new Date(1987, 1, 11), - * new Date(1995, 6, 2), - * new Date(1990, 0, 1) - * ]) - * //=> Wed Feb 11 1987 00:00:00 - */ -function min(dates) { - let result; - - dates.forEach((dirtyDate) => { - const date = (0, _index.toDate)(dirtyDate); - if (!result || result > date || isNaN(+date)) { - result = date; - } - }); - - return result || new Date(NaN); -} - - -/***/ }), - -/***/ 22278: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.minutesToHours = minutesToHours; -var _index = __nccwpck_require__(17818); - -/** - * @name minutesToHours - * @category Conversion Helpers - * @summary Convert minutes to hours. - * - * @description - * Convert a number of minutes to a full number of hours. - * - * @param minutes - The number of minutes to be converted - * - * @returns The number of minutes converted in hours - * - * @example - * // Convert 140 minutes to hours: - * const result = minutesToHours(120) - * //=> 2 - * - * @example - * // It uses floor rounding: - * const result = minutesToHours(179) - * //=> 2 - */ -function minutesToHours(minutes) { - const hours = minutes / _index.minutesInHour; - return Math.trunc(hours); -} - - -/***/ }), - -/***/ 81361: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.minutesToMilliseconds = minutesToMilliseconds; -var _index = __nccwpck_require__(17818); - -/** - * @name minutesToMilliseconds - * @category Conversion Helpers - * @summary Convert minutes to milliseconds. - * - * @description - * Convert a number of minutes to a full number of milliseconds. - * - * @param minutes - The number of minutes to be converted - * - * @returns The number of minutes converted in milliseconds - * - * @example - * // Convert 2 minutes to milliseconds - * const result = minutesToMilliseconds(2) - * //=> 120000 - */ -function minutesToMilliseconds(minutes) { - return Math.trunc(minutes * _index.millisecondsInMinute); -} - - -/***/ }), - -/***/ 26298: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.minutesToSeconds = minutesToSeconds; -var _index = __nccwpck_require__(17818); - -/** - * @name minutesToSeconds - * @category Conversion Helpers - * @summary Convert minutes to seconds. - * - * @description - * Convert a number of minutes to a full number of seconds. - * - * @param minutes - The number of minutes to be converted - * - * @returns The number of minutes converted in seconds - * - * @example - * // Convert 2 minutes to seconds - * const result = minutesToSeconds(2) - * //=> 120 - */ -function minutesToSeconds(minutes) { - return Math.trunc(minutes * _index.secondsInMinute); -} - - -/***/ }), - -/***/ 4428: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.monthsToQuarters = monthsToQuarters; -var _index = __nccwpck_require__(17818); - -/** - * @name monthsToQuarters - * @category Conversion Helpers - * @summary Convert number of months to quarters. - * - * @description - * Convert a number of months to a full number of quarters. - * - * @param months - The number of months to be converted. - * - * @returns The number of months converted in quarters - * - * @example - * // Convert 6 months to quarters: - * const result = monthsToQuarters(6) - * //=> 2 - * - * @example - * // It uses floor rounding: - * const result = monthsToQuarters(7) - * //=> 2 - */ -function monthsToQuarters(months) { - const quarters = months / _index.monthsInQuarter; - return Math.trunc(quarters); -} - - -/***/ }), - -/***/ 93832: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.monthsToYears = monthsToYears; -var _index = __nccwpck_require__(17818); - -/** - * @name monthsToYears - * @category Conversion Helpers - * @summary Convert number of months to years. - * - * @description - * Convert a number of months to a full number of years. - * - * @param months - The number of months to be converted - * - * @returns The number of months converted in years - * - * @example - * // Convert 36 months to years: - * const result = monthsToYears(36) - * //=> 3 - * - * // It uses floor rounding: - * const result = monthsToYears(40) - * //=> 3 - */ -function monthsToYears(months) { - const years = months / _index.monthsInYear; - return Math.trunc(years); -} - - -/***/ }), - -/***/ 29043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextDay = nextDay; -var _index = __nccwpck_require__(8361); -var _index2 = __nccwpck_require__(46172); - -/** - * @name nextDay - * @category Weekday Helpers - * @summary When is the next day of the week? - * - * @description - * When is the next day of the week? 0-6 the day of the week, 0 represents Sunday. - * - * @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). - * - * @param date - The date to check - * @param day - day of the week - * - * @returns The date is the next day of week - * - * @example - * // When is the next Monday after Mar, 20, 2020? - * const result = nextDay(new Date(2020, 2, 20), 1) - * //=> Mon Mar 23 2020 00:00:00 - * - * @example - * // When is the next Tuesday after Mar, 21, 2020? - * const result = nextDay(new Date(2020, 2, 21), 2) - * //=> Tue Mar 24 2020 00:00:00 - */ -function nextDay(date, day) { - let delta = day - (0, _index2.getDay)(date); - if (delta <= 0) delta += 7; - - return (0, _index.addDays)(date, delta); -} - - -/***/ }), - -/***/ 72598: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextFriday = nextFriday; -var _index = __nccwpck_require__(29043); - -/** - * @name nextFriday - * @category Weekday Helpers - * @summary When is the next Friday? - * - * @description - * When is the next Friday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The next Friday - * - * @example - * // When is the next Friday after Mar, 22, 2020? - * const result = nextFriday(new Date(2020, 2, 22)) - * //=> Fri Mar 27 2020 00:00:00 - */ -function nextFriday(date) { - return (0, _index.nextDay)(date, 5); -} - - -/***/ }), - -/***/ 51686: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextMonday = nextMonday; -var _index = __nccwpck_require__(29043); - -/** - * @name nextMonday - * @category Weekday Helpers - * @summary When is the next Monday? - * - * @description - * When is the next Monday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The next Monday - * - * @example - * // When is the next Monday after Mar, 22, 2020? - * const result = nextMonday(new Date(2020, 2, 22)) - * //=> Mon Mar 23 2020 00:00:00 - */ -function nextMonday(date) { - return (0, _index.nextDay)(date, 1); -} - - -/***/ }), - -/***/ 99643: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextSaturday = nextSaturday; -var _index = __nccwpck_require__(29043); - -/** - * @name nextSaturday - * @category Weekday Helpers - * @summary When is the next Saturday? - * - * @description - * When is the next Saturday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The next Saturday - * - * @example - * // When is the next Saturday after Mar, 22, 2020? - * const result = nextSaturday(new Date(2020, 2, 22)) - * //=> Sat Mar 28 2020 00:00:00 - */ -function nextSaturday(date) { - return (0, _index.nextDay)(date, 6); -} - - -/***/ }), - -/***/ 29870: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextSunday = nextSunday; -var _index = __nccwpck_require__(29043); - -/** - * @name nextSunday - * @category Weekday Helpers - * @summary When is the next Sunday? - * - * @description - * When is the next Sunday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The next Sunday - * - * @example - * // When is the next Sunday after Mar, 22, 2020? - * const result = nextSunday(new Date(2020, 2, 22)) - * //=> Sun Mar 29 2020 00:00:00 - */ -function nextSunday(date) { - return (0, _index.nextDay)(date, 0); -} - - -/***/ }), - -/***/ 70933: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextThursday = nextThursday; -var _index = __nccwpck_require__(29043); - -/** - * @name nextThursday - * @category Weekday Helpers - * @summary When is the next Thursday? - * - * @description - * When is the next Thursday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The next Thursday - * - * @example - * // When is the next Thursday after Mar, 22, 2020? - * const result = nextThursday(new Date(2020, 2, 22)) - * //=> Thur Mar 26 2020 00:00:00 - */ -function nextThursday(date) { - return (0, _index.nextDay)(date, 4); -} - - -/***/ }), - -/***/ 70665: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextTuesday = nextTuesday; -var _index = __nccwpck_require__(29043); - -/** - * @name nextTuesday - * @category Weekday Helpers - * @summary When is the next Tuesday? - * - * @description - * When is the next Tuesday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The next Tuesday - * - * @example - * // When is the next Tuesday after Mar, 22, 2020? - * const result = nextTuesday(new Date(2020, 2, 22)) - * //=> Tue Mar 24 2020 00:00:00 - */ -function nextTuesday(date) { - return (0, _index.nextDay)(date, 2); -} - - -/***/ }), - -/***/ 13585: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.nextWednesday = nextWednesday; -var _index = __nccwpck_require__(29043); - -/** - * @name nextWednesday - * @category Weekday Helpers - * @summary When is the next Wednesday? - * - * @description - * When is the next Wednesday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The next Wednesday - * - * @example - * // When is the next Wednesday after Mar, 22, 2020? - * const result = nextWednesday(new Date(2020, 2, 22)) - * //=> Wed Mar 25 2020 00:00:00 - */ -function nextWednesday(date) { - return (0, _index.nextDay)(date, 3); -} - - -/***/ }), - -/***/ 69884: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "longFormatters", ({ - enumerable: true, - get: function () { - return _index5.longFormatters; - }, -})); -exports.parse = parse; -Object.defineProperty(exports, "parsers", ({ - enumerable: true, - get: function () { - return _index7.parsers; - }, -})); -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(67157); -var _index3 = __nccwpck_require__(64092); -var _index4 = __nccwpck_require__(53622); - -var _index5 = __nccwpck_require__(8707); -var _index6 = __nccwpck_require__(82147); - -var _index7 = __nccwpck_require__(96874); - -var _Setter = __nccwpck_require__(75665); - -// Rexports of internal for libraries to use. -// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 - -/** - * The {@link parse} function options. - */ - -// This RegExp consists of three parts separated by `|`: -// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token -// (one of the certain letters followed by `o`) -// - (\w)\1* matches any sequences of the same letter -// - '' matches two quote characters in a row -// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), -// except a single quote symbol, which ends the sequence. -// Two quote characters do not end the sequence. -// If there is no matching single quote -// then the sequence will continue until the end of the string. -// - . matches any single character unmatched by previous parts of the RegExps -const formattingTokensRegExp = - /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; - -// This RegExp catches symbols escaped by quotes, and also -// sequences of symbols P, p, and the combinations like `PPPPPPPppppp` -const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; - -const escapedStringRegExp = /^'([^]*?)'?$/; -const doubleQuoteRegExp = /''/g; - -const notWhitespaceRegExp = /\S/; -const unescapedLatinCharacterRegExp = /[a-zA-Z]/; - -/** - * @name parse - * @category Common Helpers - * @summary Parse the date. - * - * @description - * Return the date parsed from string using the given format string. - * - * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. - * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * The characters in the format string wrapped between two single quotes characters (') are escaped. - * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. - * - * Format of the format string is based on Unicode Technical Standard #35: - * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * with a few additions (see note 5 below the table). - * - * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited - * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: - * - * ```javascript - * parse('23 AM', 'HH a', new Date()) - * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time - * ``` - * - * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true - * - * Accepted format string patterns: - * | Unit |Prior| Pattern | Result examples | Notes | - * |---------------------------------|-----|---------|-----------------------------------|-------| - * | Era | 140 | G..GGG | AD, BC | | - * | | | GGGG | Anno Domini, Before Christ | 2 | - * | | | GGGGG | A, B | | - * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | - * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | yy | 44, 01, 00, 17 | 4 | - * | | | yyy | 044, 001, 123, 999 | 4 | - * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | - * | | | yyyyy | ... | 2,4 | - * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | - * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | YY | 44, 01, 00, 17 | 4,6 | - * | | | YYY | 044, 001, 123, 999 | 4 | - * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | - * | | | YYYYY | ... | 2,4 | - * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | - * | | | RR | -43, 01, 00, 17 | 4,5 | - * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | - * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | - * | | | RRRRR | ... | 2,4,5 | - * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | - * | | | uu | -43, 01, 99, -99 | 4 | - * | | | uuu | -043, 001, 123, 999, -999 | 4 | - * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | - * | | | uuuuu | ... | 2,4 | - * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | - * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | QQ | 01, 02, 03, 04 | | - * | | | QQQ | Q1, Q2, Q3, Q4 | | - * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | - * | | | QQQQQ | 1, 2, 3, 4 | 4 | - * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | - * | | | qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | qq | 01, 02, 03, 04 | | - * | | | qqq | Q1, Q2, Q3, Q4 | | - * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | - * | | | qqqqq | 1, 2, 3, 4 | 3 | - * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | - * | | | Mo | 1st, 2nd, ..., 12th | 5 | - * | | | MM | 01, 02, ..., 12 | | - * | | | MMM | Jan, Feb, ..., Dec | | - * | | | MMMM | January, February, ..., December | 2 | - * | | | MMMMM | J, F, ..., D | | - * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | - * | | | Lo | 1st, 2nd, ..., 12th | 5 | - * | | | LL | 01, 02, ..., 12 | | - * | | | LLL | Jan, Feb, ..., Dec | | - * | | | LLLL | January, February, ..., December | 2 | - * | | | LLLLL | J, F, ..., D | | - * | Local week of year | 100 | w | 1, 2, ..., 53 | | - * | | | wo | 1st, 2nd, ..., 53th | 5 | - * | | | ww | 01, 02, ..., 53 | | - * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | - * | | | Io | 1st, 2nd, ..., 53th | 5 | - * | | | II | 01, 02, ..., 53 | 5 | - * | Day of month | 90 | d | 1, 2, ..., 31 | | - * | | | do | 1st, 2nd, ..., 31st | 5 | - * | | | dd | 01, 02, ..., 31 | | - * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | - * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | - * | | | DD | 01, 02, ..., 365, 366 | 7 | - * | | | DDD | 001, 002, ..., 365, 366 | | - * | | | DDDD | ... | 2 | - * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | | - * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | - * | | | EEEEE | M, T, W, T, F, S, S | | - * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | - * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | - * | | | io | 1st, 2nd, ..., 7th | 5 | - * | | | ii | 01, 02, ..., 07 | 5 | - * | | | iii | Mon, Tue, Wed, ..., Sun | 5 | - * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | - * | | | iiiii | M, T, W, T, F, S, S | 5 | - * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 | - * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | - * | | | eo | 2nd, 3rd, ..., 1st | 5 | - * | | | ee | 02, 03, ..., 01 | | - * | | | eee | Mon, Tue, Wed, ..., Sun | | - * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | - * | | | eeeee | M, T, W, T, F, S, S | | - * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | - * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | - * | | | co | 2nd, 3rd, ..., 1st | 5 | - * | | | cc | 02, 03, ..., 01 | | - * | | | ccc | Mon, Tue, Wed, ..., Sun | | - * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | - * | | | ccccc | M, T, W, T, F, S, S | | - * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | - * | AM, PM | 80 | a..aaa | AM, PM | | - * | | | aaaa | a.m., p.m. | 2 | - * | | | aaaaa | a, p | | - * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | - * | | | bbbb | a.m., p.m., noon, midnight | 2 | - * | | | bbbbb | a, p, n, mi | | - * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | - * | | | BBBB | at night, in the morning, ... | 2 | - * | | | BBBBB | at night, in the morning, ... | | - * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | - * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | - * | | | hh | 01, 02, ..., 11, 12 | | - * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | - * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | - * | | | HH | 00, 01, 02, ..., 23 | | - * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | - * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | - * | | | KK | 01, 02, ..., 11, 00 | | - * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | - * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | - * | | | kk | 24, 01, 02, ..., 23 | | - * | Minute | 60 | m | 0, 1, ..., 59 | | - * | | | mo | 0th, 1st, ..., 59th | 5 | - * | | | mm | 00, 01, ..., 59 | | - * | Second | 50 | s | 0, 1, ..., 59 | | - * | | | so | 0th, 1st, ..., 59th | 5 | - * | | | ss | 00, 01, ..., 59 | | - * | Seconds timestamp | 40 | t | 512969520 | | - * | | | tt | ... | 2 | - * | Fraction of second | 30 | S | 0, 1, ..., 9 | | - * | | | SS | 00, 01, ..., 99 | | - * | | | SSS | 000, 001, ..., 999 | | - * | | | SSSS | ... | 2 | - * | Milliseconds timestamp | 20 | T | 512969520900 | | - * | | | TT | ... | 2 | - * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | - * | | | XX | -0800, +0530, Z | | - * | | | XXX | -08:00, +05:30, Z | | - * | | | XXXX | -0800, +0530, Z, +123456 | 2 | - * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | - * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | - * | | | xx | -0800, +0530, +0000 | | - * | | | xxx | -08:00, +05:30, +00:00 | 2 | - * | | | xxxx | -0800, +0530, +0000, +123456 | | - * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | - * | Long localized date | NA | P | 05/29/1453 | 5,8 | - * | | | PP | May 29, 1453 | | - * | | | PPP | May 29th, 1453 | | - * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | - * | Long localized time | NA | p | 12:00 AM | 5,8 | - * | | | pp | 12:00:00 AM | | - * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | - * | | | PPpp | May 29, 1453, 12:00:00 AM | | - * | | | PPPpp | May 29th, 1453 at ... | | - * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | - * Notes: - * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale - * are the same as "stand-alone" units, but are different in some languages. - * "Formatting" units are declined according to the rules of the language - * in the context of a date. "Stand-alone" units are always nominative singular. - * In `format` function, they will produce different result: - * - * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` - * - * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` - * - * `parse` will try to match both formatting and stand-alone units interchangably. - * - * 2. Any sequence of the identical letters is a pattern, unless it is escaped by - * the single quote characters (see below). - * If the sequence is longer than listed in table: - * - for numerical units (`yyyyyyyy`) `parse` will try to match a number - * as wide as the sequence - * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit. - * These variations are marked with "2" in the last column of the table. - * - * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. - * These tokens represent the shortest form of the quarter. - * - * 4. The main difference between `y` and `u` patterns are B.C. years: - * - * | Year | `y` | `u` | - * |------|-----|-----| - * | AC 1 | 1 | 1 | - * | BC 1 | 1 | 0 | - * | BC 2 | 2 | -1 | - * - * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: - * - * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00` - * - * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00` - * - * while `uu` will just assign the year as is: - * - * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00` - * - * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00` - * - * The same difference is true for local and ISO week-numbering years (`Y` and `R`), - * except local week-numbering years are dependent on `options.weekStartsOn` - * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear) - * and [setWeekYear](https://date-fns.org/docs/setWeekYear)). - * - * 5. These patterns are not in the Unicode Technical Standard #35: - * - `i`: ISO day of week - * - `I`: ISO week of year - * - `R`: ISO week-numbering year - * - `o`: ordinal number modifier - * - `P`: long localized date - * - `p`: long localized time - * - * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. - * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. - * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based - * on the given locale. - * - * using `en-US` locale: `P` => `MM/dd/yyyy` - * using `en-US` locale: `p` => `hh:mm a` - * using `pt-BR` locale: `P` => `dd/MM/yyyy` - * using `pt-BR` locale: `p` => `HH:mm` - * - * Values will be assigned to the date in the descending order of its unit's priority. - * Units of an equal priority overwrite each other in the order of appearance. - * - * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), - * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing. - * - * `referenceDate` must be passed for correct work of the function. - * If you're not sure which `referenceDate` to supply, create a new instance of Date: - * `parse('02/11/2014', 'MM/dd/yyyy', new Date())` - * In this case parsing will be done in the context of the current date. - * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`, - * then `Invalid Date` will be returned. - * - * The result may vary by locale. - * - * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. - * - * If parsing failed, `Invalid Date` will be returned. - * Invalid Date is a Date, whose time value is NaN. - * Time value of Date: http://es5.github.io/#x15.9.1.1 - * - * @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). - * - * @param dateStr - The string to parse - * @param formatStr - The string of tokens - * @param referenceDate - defines values missing from the parsed dateString - * @param options - An object with options. - * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md - * - * @returns The parsed date - * - * @throws `options.locale` must contain `match` property - * @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 - * @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 - * @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 - * @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 - * @throws format string contains an unescaped latin alphabet character - * - * @example - * // Parse 11 February 2014 from middle-endian format: - * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date()) - * //=> Tue Feb 11 2014 00:00:00 - * - * @example - * // Parse 28th of February in Esperanto locale in the context of 2010 year: - * import eo from 'date-fns/locale/eo' - * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), { - * locale: eo - * }) - * //=> Sun Feb 28 2010 00:00:00 - */ -function parse(dateStr, formatStr, referenceDate, options) { - const defaultOptions = (0, _index2.getDefaultOptions)(); - const locale = - options?.locale ?? defaultOptions.locale ?? _index3.defaultLocale; - - const firstWeekContainsDate = - options?.firstWeekContainsDate ?? - options?.locale?.options?.firstWeekContainsDate ?? - defaultOptions.firstWeekContainsDate ?? - defaultOptions.locale?.options?.firstWeekContainsDate ?? - 1; - - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - if (formatStr === "") { - if (dateStr === "") { - return (0, _index4.toDate)(referenceDate); - } else { - return (0, _index.constructFrom)(referenceDate, NaN); - } - } - - const subFnOptions = { - firstWeekContainsDate, - weekStartsOn, - locale, - }; - - // If timezone isn't specified, it will be set to the system timezone - const setters = [new _Setter.DateToSystemTimezoneSetter()]; - - const tokens = formatStr - .match(longFormattingTokensRegExp) - .map((substring) => { - const firstCharacter = substring[0]; - if (firstCharacter in _index5.longFormatters) { - const longFormatter = _index5.longFormatters[firstCharacter]; - return longFormatter(substring, locale.formatLong); - } - return substring; - }) - .join("") - .match(formattingTokensRegExp); - - const usedTokens = []; - - for (let token of tokens) { - if ( - !options?.useAdditionalWeekYearTokens && - (0, _index6.isProtectedWeekYearToken)(token) - ) { - (0, _index6.warnOrThrowProtectedError)(token, formatStr, dateStr); - } - if ( - !options?.useAdditionalDayOfYearTokens && - (0, _index6.isProtectedDayOfYearToken)(token) - ) { - (0, _index6.warnOrThrowProtectedError)(token, formatStr, dateStr); - } - - const firstCharacter = token[0]; - const parser = _index7.parsers[firstCharacter]; - if (parser) { - const { incompatibleTokens } = parser; - if (Array.isArray(incompatibleTokens)) { - const incompatibleToken = usedTokens.find( - (usedToken) => - incompatibleTokens.includes(usedToken.token) || - usedToken.token === firstCharacter, - ); - if (incompatibleToken) { - throw new RangeError( - `The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`, - ); - } - } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) { - throw new RangeError( - `The format string mustn't contain \`${token}\` and any other token at the same time`, - ); - } - - usedTokens.push({ token: firstCharacter, fullToken: token }); - - const parseResult = parser.run( - dateStr, - token, - locale.match, - subFnOptions, - ); - - if (!parseResult) { - return (0, _index.constructFrom)(referenceDate, NaN); - } - - setters.push(parseResult.setter); - - dateStr = parseResult.rest; - } else { - if (firstCharacter.match(unescapedLatinCharacterRegExp)) { - throw new RangeError( - "Format string contains an unescaped latin alphabet character `" + - firstCharacter + - "`", - ); - } - - // Replace two single quote characters with one single quote character - if (token === "''") { - token = "'"; - } else if (firstCharacter === "'") { - token = cleanEscapedString(token); - } - - // Cut token from string, or, if string doesn't match the token, return Invalid Date - if (dateStr.indexOf(token) === 0) { - dateStr = dateStr.slice(token.length); - } else { - return (0, _index.constructFrom)(referenceDate, NaN); - } - } - } - - // Check if the remaining input contains something other than whitespace - if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) { - return (0, _index.constructFrom)(referenceDate, NaN); - } - - const uniquePrioritySetters = setters - .map((setter) => setter.priority) - .sort((a, b) => b - a) - .filter((priority, index, array) => array.indexOf(priority) === index) - .map((priority) => - setters - .filter((setter) => setter.priority === priority) - .sort((a, b) => b.subPriority - a.subPriority), - ) - .map((setterArray) => setterArray[0]); - - let date = (0, _index4.toDate)(referenceDate); - - if (isNaN(date.getTime())) { - return (0, _index.constructFrom)(referenceDate, NaN); - } - - const flags = {}; - for (const setter of uniquePrioritySetters) { - if (!setter.validate(date, subFnOptions)) { - return (0, _index.constructFrom)(referenceDate, NaN); - } - - const result = setter.set(date, flags, subFnOptions); - // Result is tuple (date, flags) - if (Array.isArray(result)) { - date = result[0]; - Object.assign(flags, result[1]); - // Result is date - } else { - date = result; - } - } - - return (0, _index.constructFrom)(referenceDate, date); -} - -function cleanEscapedString(input) { - return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); -} - - -/***/ }), - -/***/ 5619: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.Parser = void 0; -var _Setter = __nccwpck_require__(75665); - -class Parser { - run(dateString, token, match, options) { - const result = this.parse(dateString, token, match, options); - if (!result) { - return null; - } - - return { - setter: new _Setter.ValueSetter( - result.value, - this.validate, - this.set, - this.priority, - this.subPriority, - ), - rest: result.rest, - }; - } - - validate(_utcDate, _value, _options) { - return true; - } -} -exports.Parser = Parser; - - -/***/ }), - -/***/ 75665: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.ValueSetter = - exports.Setter = - exports.DateToSystemTimezoneSetter = - void 0; -var _index = __nccwpck_require__(71881); -var _index2 = __nccwpck_require__(92736); - -const TIMEZONE_UNIT_PRIORITY = 10; - -class Setter { - subPriority = 0; - - validate(_utcDate, _options) { - return true; - } -} -exports.Setter = Setter; - -class ValueSetter extends Setter { - constructor( - value, - - validateValue, - - setValue, - - priority, - subPriority, - ) { - super(); - this.value = value; - this.validateValue = validateValue; - this.setValue = setValue; - this.priority = priority; - if (subPriority) { - this.subPriority = subPriority; - } - } - - validate(date, options) { - return this.validateValue(date, this.value, options); - } - - set(date, flags, options) { - return this.setValue(date, flags, this.value, options); - } -} -exports.ValueSetter = ValueSetter; - -class DateToSystemTimezoneSetter extends Setter { - priority = TIMEZONE_UNIT_PRIORITY; - subPriority = -1; - set(date, flags) { - if (flags.timestampIsSet) return date; - return (0, _index2.constructFrom)(date, (0, _index.transpose)(date, Date)); - } -} -exports.DateToSystemTimezoneSetter = DateToSystemTimezoneSetter; - - -/***/ }), - -/***/ 30463: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.timezonePatterns = exports.numericPatterns = void 0; -const numericPatterns = (exports.numericPatterns = { - month: /^(1[0-2]|0?\d)/, // 0 to 12 - date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31 - dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 - week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53 - hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23 - hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24 - hour11h: /^(1[0-1]|0?\d)/, // 0 to 11 - hour12h: /^(1[0-2]|0?\d)/, // 0 to 12 - minute: /^[0-5]?\d/, // 0 to 59 - second: /^[0-5]?\d/, // 0 to 59 - - singleDigit: /^\d/, // 0 to 9 - twoDigits: /^\d{1,2}/, // 0 to 99 - threeDigits: /^\d{1,3}/, // 0 to 999 - fourDigits: /^\d{1,4}/, // 0 to 9999 - - anyDigitsSigned: /^-?\d+/, - singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9 - twoDigitsSigned: /^-?\d{1,2}/, // 0 to 99, -0 to -99 - threeDigitsSigned: /^-?\d{1,3}/, // 0 to 999, -0 to -999 - fourDigitsSigned: /^-?\d{1,4}/, // 0 to 9999, -0 to -9999 -}); - -const timezonePatterns = (exports.timezonePatterns = { - basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, - basic: /^([+-])(\d{2})(\d{2})|Z/, - basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, - extended: /^([+-])(\d{2}):(\d{2})|Z/, - extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/, -}); - - -/***/ }), - -/***/ 96874: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.parsers = void 0; -var _EraParser = __nccwpck_require__(36309); -var _YearParser = __nccwpck_require__(12493); -var _LocalWeekYearParser = __nccwpck_require__(90085); -var _ISOWeekYearParser = __nccwpck_require__(40519); -var _ExtendedYearParser = __nccwpck_require__(14754); -var _QuarterParser = __nccwpck_require__(65667); -var _StandAloneQuarterParser = __nccwpck_require__(22898); -var _MonthParser = __nccwpck_require__(9581); -var _StandAloneMonthParser = __nccwpck_require__(69915); -var _LocalWeekParser = __nccwpck_require__(26555); -var _ISOWeekParser = __nccwpck_require__(92127); -var _DateParser = __nccwpck_require__(64757); -var _DayOfYearParser = __nccwpck_require__(17001); -var _DayParser = __nccwpck_require__(72280); -var _LocalDayParser = __nccwpck_require__(31190); -var _StandAloneLocalDayParser = __nccwpck_require__(51556); -var _ISODayParser = __nccwpck_require__(96376); -var _AMPMParser = __nccwpck_require__(38678); -var _AMPMMidnightParser = __nccwpck_require__(19187); -var _DayPeriodParser = __nccwpck_require__(29273); -var _Hour1to12Parser = __nccwpck_require__(27929); -var _Hour0to23Parser = __nccwpck_require__(82610); -var _Hour0To11Parser = __nccwpck_require__(323); -var _Hour1To24Parser = __nccwpck_require__(25980); -var _MinuteParser = __nccwpck_require__(84254); -var _SecondParser = __nccwpck_require__(63478); -var _FractionOfSecondParser = __nccwpck_require__(75194); -var _ISOTimezoneWithZParser = __nccwpck_require__(9822); -var _ISOTimezoneParser = __nccwpck_require__(69874); -var _TimestampSecondsParser = __nccwpck_require__(90771); -var _TimestampMillisecondsParser = __nccwpck_require__(63726); - -/* - * | | Unit | | Unit | - * |-----|--------------------------------|-----|--------------------------------| - * | a | AM, PM | A* | Milliseconds in day | - * | b | AM, PM, noon, midnight | B | Flexible day period | - * | c | Stand-alone local day of week | C* | Localized hour w/ day period | - * | d | Day of month | D | Day of year | - * | e | Local day of week | E | Day of week | - * | f | | F* | Day of week in month | - * | g* | Modified Julian day | G | Era | - * | h | Hour [1-12] | H | Hour [0-23] | - * | i! | ISO day of week | I! | ISO week of year | - * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | - * | k | Hour [1-24] | K | Hour [0-11] | - * | l* | (deprecated) | L | Stand-alone month | - * | m | Minute | M | Month | - * | n | | N | | - * | o! | Ordinal number modifier | O* | Timezone (GMT) | - * | p | | P | | - * | q | Stand-alone quarter | Q | Quarter | - * | r* | Related Gregorian year | R! | ISO week-numbering year | - * | s | Second | S | Fraction of second | - * | t! | Seconds timestamp | T! | Milliseconds timestamp | - * | u | Extended year | U* | Cyclic year | - * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | - * | w | Local week of year | W* | Week of month | - * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | - * | y | Year (abs) | Y | Local week-numbering year | - * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) | - * - * Letters marked by * are not implemented but reserved by Unicode standard. - * - * Letters marked by ! are non-standard, but implemented by date-fns: - * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs) - * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, - * i.e. 7 for Sunday, 1 for Monday, etc. - * - `I` is ISO week of year, as opposed to `w` which is local week of year. - * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. - * `R` is supposed to be used in conjunction with `I` and `i` - * for universal ISO week-numbering date, whereas - * `Y` is supposed to be used in conjunction with `w` and `e` - * for week-numbering date specific to the locale. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here -const parsers = (exports.parsers = { - G: new _EraParser.EraParser(), - y: new _YearParser.YearParser(), - Y: new _LocalWeekYearParser.LocalWeekYearParser(), - R: new _ISOWeekYearParser.ISOWeekYearParser(), - u: new _ExtendedYearParser.ExtendedYearParser(), - Q: new _QuarterParser.QuarterParser(), - q: new _StandAloneQuarterParser.StandAloneQuarterParser(), - M: new _MonthParser.MonthParser(), - L: new _StandAloneMonthParser.StandAloneMonthParser(), - w: new _LocalWeekParser.LocalWeekParser(), - I: new _ISOWeekParser.ISOWeekParser(), - d: new _DateParser.DateParser(), - D: new _DayOfYearParser.DayOfYearParser(), - E: new _DayParser.DayParser(), - e: new _LocalDayParser.LocalDayParser(), - c: new _StandAloneLocalDayParser.StandAloneLocalDayParser(), - i: new _ISODayParser.ISODayParser(), - a: new _AMPMParser.AMPMParser(), - b: new _AMPMMidnightParser.AMPMMidnightParser(), - B: new _DayPeriodParser.DayPeriodParser(), - h: new _Hour1to12Parser.Hour1to12Parser(), - H: new _Hour0to23Parser.Hour0to23Parser(), - K: new _Hour0To11Parser.Hour0To11Parser(), - k: new _Hour1To24Parser.Hour1To24Parser(), - m: new _MinuteParser.MinuteParser(), - s: new _SecondParser.SecondParser(), - S: new _FractionOfSecondParser.FractionOfSecondParser(), - X: new _ISOTimezoneWithZParser.ISOTimezoneWithZParser(), - x: new _ISOTimezoneParser.ISOTimezoneParser(), - t: new _TimestampSecondsParser.TimestampSecondsParser(), - T: new _TimestampMillisecondsParser.TimestampMillisecondsParser(), -}); - - -/***/ }), - -/***/ 19187: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.AMPMMidnightParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class AMPMMidnightParser extends _Parser.Parser { - priority = 80; - - parse(dateString, token, match) { - switch (token) { - case "b": - case "bb": - case "bbb": - return ( - match.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }) - ); - - case "bbbbb": - return match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }); - case "bbbb": - default: - return ( - match.dayPeriod(dateString, { - width: "wide", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }) - ); - } - } - - set(date, _flags, value) { - date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); - return date; - } - - incompatibleTokens = ["a", "B", "H", "k", "t", "T"]; -} -exports.AMPMMidnightParser = AMPMMidnightParser; - - -/***/ }), - -/***/ 38678: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.AMPMParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class AMPMParser extends _Parser.Parser { - priority = 80; - - parse(dateString, token, match) { - switch (token) { - case "a": - case "aa": - case "aaa": - return ( - match.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }) - ); - - case "aaaaa": - return match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }); - case "aaaa": - default: - return ( - match.dayPeriod(dateString, { - width: "wide", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }) - ); - } - } - - set(date, _flags, value) { - date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); - return date; - } - - incompatibleTokens = ["b", "B", "H", "k", "t", "T"]; -} -exports.AMPMParser = AMPMParser; - - -/***/ }), - -/***/ 64757: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.DateParser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -const DAYS_IN_MONTH_LEAP_YEAR = [ - 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, -]; - -// Day of the month -class DateParser extends _Parser.Parser { - priority = 90; - subPriority = 1; - - parse(dateString, token, match) { - switch (token) { - case "d": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.date, - dateString, - ); - case "do": - return match.ordinalNumber(dateString, { unit: "date" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(date, value) { - const year = date.getFullYear(); - const isLeapYear = (0, _utils.isLeapYearIndex)(year); - const month = date.getMonth(); - if (isLeapYear) { - return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; - } else { - return value >= 1 && value <= DAYS_IN_MONTH[month]; - } - } - - set(date, _flags, value) { - date.setDate(value); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "Y", - "R", - "q", - "Q", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ]; -} -exports.DateParser = DateParser; - - -/***/ }), - -/***/ 17001: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.DayOfYearParser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class DayOfYearParser extends _Parser.Parser { - priority = 90; - - subpriority = 1; - - parse(dateString, token, match) { - switch (token) { - case "D": - case "DD": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.dayOfYear, - dateString, - ); - case "Do": - return match.ordinalNumber(dateString, { unit: "date" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(date, value) { - const year = date.getFullYear(); - const isLeapYear = (0, _utils.isLeapYearIndex)(year); - if (isLeapYear) { - return value >= 1 && value <= 366; - } else { - return value >= 1 && value <= 365; - } - } - - set(date, _flags, value) { - date.setMonth(0, value); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "Y", - "R", - "q", - "Q", - "M", - "L", - "w", - "I", - "d", - "E", - "i", - "e", - "c", - "t", - "T", - ]; -} -exports.DayOfYearParser = DayOfYearParser; - - -/***/ }), - -/***/ 72280: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.DayParser = void 0; -var _index = __nccwpck_require__(29424); -var _Parser = __nccwpck_require__(5619); - -// Day of week -class DayParser extends _Parser.Parser { - priority = 90; - - parse(dateString, token, match) { - switch (token) { - // Tue - case "E": - case "EE": - case "EEE": - return ( - match.day(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.day(dateString, { width: "short", context: "formatting" }) || - match.day(dateString, { width: "narrow", context: "formatting" }) - ); - - // T - case "EEEEE": - return match.day(dateString, { - width: "narrow", - context: "formatting", - }); - // Tu - case "EEEEEE": - return ( - match.day(dateString, { width: "short", context: "formatting" }) || - match.day(dateString, { width: "narrow", context: "formatting" }) - ); - - // Tuesday - case "EEEE": - default: - return ( - match.day(dateString, { width: "wide", context: "formatting" }) || - match.day(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.day(dateString, { width: "short", context: "formatting" }) || - match.day(dateString, { width: "narrow", context: "formatting" }) - ); - } - } - - validate(_date, value) { - return value >= 0 && value <= 6; - } - - set(date, _flags, value, options) { - date = (0, _index.setDay)(date, value, options); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = ["D", "i", "e", "c", "t", "T"]; -} -exports.DayParser = DayParser; - - -/***/ }), - -/***/ 29273: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.DayPeriodParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// in the morning, in the afternoon, in the evening, at night -class DayPeriodParser extends _Parser.Parser { - priority = 80; - - parse(dateString, token, match) { - switch (token) { - case "B": - case "BB": - case "BBB": - return ( - match.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }) - ); - - case "BBBBB": - return match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }); - case "BBBB": - default: - return ( - match.dayPeriod(dateString, { - width: "wide", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.dayPeriod(dateString, { - width: "narrow", - context: "formatting", - }) - ); - } - } - - set(date, _flags, value) { - date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); - return date; - } - - incompatibleTokens = ["a", "b", "t", "T"]; -} -exports.DayPeriodParser = DayPeriodParser; - - -/***/ }), - -/***/ 36309: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.EraParser = void 0; - -var _Parser = __nccwpck_require__(5619); - -class EraParser extends _Parser.Parser { - priority = 140; - - parse(dateString, token, match) { - switch (token) { - // AD, BC - case "G": - case "GG": - case "GGG": - return ( - match.era(dateString, { width: "abbreviated" }) || - match.era(dateString, { width: "narrow" }) - ); - - // A, B - case "GGGGG": - return match.era(dateString, { width: "narrow" }); - // Anno Domini, Before Christ - case "GGGG": - default: - return ( - match.era(dateString, { width: "wide" }) || - match.era(dateString, { width: "abbreviated" }) || - match.era(dateString, { width: "narrow" }) - ); - } - } - - set(date, flags, value) { - flags.era = value; - date.setFullYear(value, 0, 1); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = ["R", "u", "t", "T"]; -} -exports.EraParser = EraParser; - - -/***/ }), - -/***/ 14754: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.ExtendedYearParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class ExtendedYearParser extends _Parser.Parser { - priority = 130; - - parse(dateString, token) { - if (token === "u") { - return (0, _utils.parseNDigitsSigned)(4, dateString); - } - - return (0, _utils.parseNDigitsSigned)(token.length, dateString); - } - - set(date, _flags, value) { - date.setFullYear(value, 0, 1); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]; -} -exports.ExtendedYearParser = ExtendedYearParser; - - -/***/ }), - -/***/ 75194: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.FractionOfSecondParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class FractionOfSecondParser extends _Parser.Parser { - priority = 30; - - parse(dateString, token) { - const valueCallback = (value) => - Math.trunc(value * Math.pow(10, -token.length + 3)); - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(token.length, dateString), - valueCallback, - ); - } - - set(date, _flags, value) { - date.setMilliseconds(value); - return date; - } - - incompatibleTokens = ["t", "T"]; -} -exports.FractionOfSecondParser = FractionOfSecondParser; - - -/***/ }), - -/***/ 323: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.Hour0To11Parser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class Hour0To11Parser extends _Parser.Parser { - priority = 70; - - parse(dateString, token, match) { - switch (token) { - case "K": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.hour11h, - dateString, - ); - case "Ko": - return match.ordinalNumber(dateString, { unit: "hour" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 0 && value <= 11; - } - - set(date, _flags, value) { - const isPM = date.getHours() >= 12; - if (isPM && value < 12) { - date.setHours(value + 12, 0, 0, 0); - } else { - date.setHours(value, 0, 0, 0); - } - return date; - } - - incompatibleTokens = ["h", "H", "k", "t", "T"]; -} -exports.Hour0To11Parser = Hour0To11Parser; - - -/***/ }), - -/***/ 82610: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.Hour0to23Parser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class Hour0to23Parser extends _Parser.Parser { - priority = 70; - - parse(dateString, token, match) { - switch (token) { - case "H": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.hour23h, - dateString, - ); - case "Ho": - return match.ordinalNumber(dateString, { unit: "hour" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 0 && value <= 23; - } - - set(date, _flags, value) { - date.setHours(value, 0, 0, 0); - return date; - } - - incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"]; -} -exports.Hour0to23Parser = Hour0to23Parser; - - -/***/ }), - -/***/ 25980: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.Hour1To24Parser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class Hour1To24Parser extends _Parser.Parser { - priority = 70; - - parse(dateString, token, match) { - switch (token) { - case "k": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.hour24h, - dateString, - ); - case "ko": - return match.ordinalNumber(dateString, { unit: "hour" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 1 && value <= 24; - } - - set(date, _flags, value) { - const hours = value <= 24 ? value % 24 : value; - date.setHours(hours, 0, 0, 0); - return date; - } - - incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"]; -} -exports.Hour1To24Parser = Hour1To24Parser; - - -/***/ }), - -/***/ 27929: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.Hour1to12Parser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class Hour1to12Parser extends _Parser.Parser { - priority = 70; - - parse(dateString, token, match) { - switch (token) { - case "h": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.hour12h, - dateString, - ); - case "ho": - return match.ordinalNumber(dateString, { unit: "hour" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 1 && value <= 12; - } - - set(date, _flags, value) { - const isPM = date.getHours() >= 12; - if (isPM && value < 12) { - date.setHours(value + 12, 0, 0, 0); - } else if (!isPM && value === 12) { - date.setHours(0, 0, 0, 0); - } else { - date.setHours(value, 0, 0, 0); - } - return date; - } - - incompatibleTokens = ["H", "K", "k", "t", "T"]; -} -exports.Hour1to12Parser = Hour1to12Parser; - - -/***/ }), - -/***/ 96376: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.ISODayParser = void 0; -var _index = __nccwpck_require__(20665); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// ISO day of week -class ISODayParser extends _Parser.Parser { - priority = 90; - - parse(dateString, token, match) { - const valueCallback = (value) => { - if (value === 0) { - return 7; - } - return value; - }; - - switch (token) { - // 2 - case "i": - case "ii": // 02 - return (0, _utils.parseNDigits)(token.length, dateString); - // 2nd - case "io": - return match.ordinalNumber(dateString, { unit: "day" }); - // Tue - case "iii": - return (0, _utils.mapValue)( - match.day(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.day(dateString, { - width: "short", - context: "formatting", - }) || - match.day(dateString, { - width: "narrow", - context: "formatting", - }), - valueCallback, - ); - // T - case "iiiii": - return (0, _utils.mapValue)( - match.day(dateString, { - width: "narrow", - context: "formatting", - }), - valueCallback, - ); - // Tu - case "iiiiii": - return (0, _utils.mapValue)( - match.day(dateString, { - width: "short", - context: "formatting", - }) || - match.day(dateString, { - width: "narrow", - context: "formatting", - }), - valueCallback, - ); - // Tuesday - case "iiii": - default: - return (0, _utils.mapValue)( - match.day(dateString, { - width: "wide", - context: "formatting", - }) || - match.day(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.day(dateString, { - width: "short", - context: "formatting", - }) || - match.day(dateString, { - width: "narrow", - context: "formatting", - }), - valueCallback, - ); - } - } - - validate(_date, value) { - return value >= 1 && value <= 7; - } - - set(date, _flags, value) { - date = (0, _index.setISODay)(date, value); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "y", - "Y", - "u", - "q", - "Q", - "M", - "L", - "w", - "d", - "D", - "E", - "e", - "c", - "t", - "T", - ]; -} -exports.ISODayParser = ISODayParser; - - -/***/ }), - -/***/ 69874: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.ISOTimezoneParser = void 0; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(31292); -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// Timezone (ISO-8601) -class ISOTimezoneParser extends _Parser.Parser { - priority = 10; - - parse(dateString, token) { - switch (token) { - case "x": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.basicOptionalMinutes, - dateString, - ); - case "xx": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.basic, - dateString, - ); - case "xxxx": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.basicOptionalSeconds, - dateString, - ); - case "xxxxx": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.extendedOptionalSeconds, - dateString, - ); - case "xxx": - default: - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.extended, - dateString, - ); - } - } - - set(date, flags, value) { - if (flags.timestampIsSet) return date; - return (0, _index.constructFrom)( - date, - date.getTime() - - (0, _index2.getTimezoneOffsetInMilliseconds)(date) - - value, - ); - } - - incompatibleTokens = ["t", "T", "X"]; -} -exports.ISOTimezoneParser = ISOTimezoneParser; - - -/***/ }), - -/***/ 9822: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.ISOTimezoneWithZParser = void 0; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(31292); -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// Timezone (ISO-8601. +00:00 is `'Z'`) -class ISOTimezoneWithZParser extends _Parser.Parser { - priority = 10; - - parse(dateString, token) { - switch (token) { - case "X": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.basicOptionalMinutes, - dateString, - ); - case "XX": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.basic, - dateString, - ); - case "XXXX": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.basicOptionalSeconds, - dateString, - ); - case "XXXXX": - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.extendedOptionalSeconds, - dateString, - ); - case "XXX": - default: - return (0, _utils.parseTimezonePattern)( - _constants.timezonePatterns.extended, - dateString, - ); - } - } - - set(date, flags, value) { - if (flags.timestampIsSet) return date; - return (0, _index.constructFrom)( - date, - date.getTime() - - (0, _index2.getTimezoneOffsetInMilliseconds)(date) - - value, - ); - } - - incompatibleTokens = ["t", "T", "x"]; -} -exports.ISOTimezoneWithZParser = ISOTimezoneWithZParser; - - -/***/ }), - -/***/ 92127: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.ISOWeekParser = void 0; -var _index = __nccwpck_require__(81308); -var _index2 = __nccwpck_require__(69709); -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// ISO week of year -class ISOWeekParser extends _Parser.Parser { - priority = 100; - - parse(dateString, token, match) { - switch (token) { - case "I": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.week, - dateString, - ); - case "Io": - return match.ordinalNumber(dateString, { unit: "week" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 1 && value <= 53; - } - - set(date, _flags, value) { - return (0, _index2.startOfISOWeek)((0, _index.setISOWeek)(date, value)); - } - - incompatibleTokens = [ - "y", - "Y", - "u", - "q", - "Q", - "M", - "L", - "w", - "d", - "D", - "e", - "c", - "t", - "T", - ]; -} -exports.ISOWeekParser = ISOWeekParser; - - -/***/ }), - -/***/ 40519: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.ISOWeekYearParser = void 0; -var _index = __nccwpck_require__(69709); -var _index2 = __nccwpck_require__(92736); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// ISO week-numbering year -class ISOWeekYearParser extends _Parser.Parser { - priority = 130; - - parse(dateString, token) { - if (token === "R") { - return (0, _utils.parseNDigitsSigned)(4, dateString); - } - - return (0, _utils.parseNDigitsSigned)(token.length, dateString); - } - - set(date, _flags, value) { - const firstWeekOfYear = (0, _index2.constructFrom)(date, 0); - firstWeekOfYear.setFullYear(value, 0, 4); - firstWeekOfYear.setHours(0, 0, 0, 0); - return (0, _index.startOfISOWeek)(firstWeekOfYear); - } - - incompatibleTokens = [ - "G", - "y", - "Y", - "u", - "Q", - "q", - "M", - "L", - "w", - "d", - "D", - "e", - "c", - "t", - "T", - ]; -} -exports.ISOWeekYearParser = ISOWeekYearParser; - - -/***/ }), - -/***/ 31190: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.LocalDayParser = void 0; -var _index = __nccwpck_require__(29424); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// Local day of week -class LocalDayParser extends _Parser.Parser { - priority = 90; - parse(dateString, token, match, options) { - const valueCallback = (value) => { - // We want here floor instead of trunc, so we get -7 for value 0 instead of 0 - const wholeWeekDays = Math.floor((value - 1) / 7) * 7; - return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays; - }; - - switch (token) { - // 3 - case "e": - case "ee": // 03 - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(token.length, dateString), - valueCallback, - ); - // 3rd - case "eo": - return (0, _utils.mapValue)( - match.ordinalNumber(dateString, { - unit: "day", - }), - valueCallback, - ); - // Tue - case "eee": - return ( - match.day(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.day(dateString, { width: "short", context: "formatting" }) || - match.day(dateString, { width: "narrow", context: "formatting" }) - ); - - // T - case "eeeee": - return match.day(dateString, { - width: "narrow", - context: "formatting", - }); - // Tu - case "eeeeee": - return ( - match.day(dateString, { width: "short", context: "formatting" }) || - match.day(dateString, { width: "narrow", context: "formatting" }) - ); - - // Tuesday - case "eeee": - default: - return ( - match.day(dateString, { width: "wide", context: "formatting" }) || - match.day(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.day(dateString, { width: "short", context: "formatting" }) || - match.day(dateString, { width: "narrow", context: "formatting" }) - ); - } - } - - validate(_date, value) { - return value >= 0 && value <= 6; - } - - set(date, _flags, value, options) { - date = (0, _index.setDay)(date, value, options); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "E", - "i", - "c", - "t", - "T", - ]; -} -exports.LocalDayParser = LocalDayParser; - - -/***/ }), - -/***/ 26555: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.LocalWeekParser = void 0; -var _index = __nccwpck_require__(98476); -var _index2 = __nccwpck_require__(26068); -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// Local week of year -class LocalWeekParser extends _Parser.Parser { - priority = 100; - - parse(dateString, token, match) { - switch (token) { - case "w": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.week, - dateString, - ); - case "wo": - return match.ordinalNumber(dateString, { unit: "week" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 1 && value <= 53; - } - - set(date, _flags, value, options) { - return (0, _index2.startOfWeek)( - (0, _index.setWeek)(date, value, options), - options, - ); - } - - incompatibleTokens = [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "i", - "t", - "T", - ]; -} -exports.LocalWeekParser = LocalWeekParser; - - -/***/ }), - -/***/ 90085: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.LocalWeekYearParser = void 0; -var _index = __nccwpck_require__(87669); - -var _index2 = __nccwpck_require__(26068); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// Local week-numbering year -class LocalWeekYearParser extends _Parser.Parser { - priority = 130; - - parse(dateString, token, match) { - const valueCallback = (year) => ({ - year, - isTwoDigitYear: token === "YY", - }); - - switch (token) { - case "Y": - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(4, dateString), - valueCallback, - ); - case "Yo": - return (0, _utils.mapValue)( - match.ordinalNumber(dateString, { - unit: "year", - }), - valueCallback, - ); - default: - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(token.length, dateString), - valueCallback, - ); - } - } - - validate(_date, value) { - return value.isTwoDigitYear || value.year > 0; - } - - set(date, flags, value, options) { - const currentYear = (0, _index.getWeekYear)(date, options); - - if (value.isTwoDigitYear) { - const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)( - value.year, - currentYear, - ); - date.setFullYear( - normalizedTwoDigitYear, - 0, - options.firstWeekContainsDate, - ); - date.setHours(0, 0, 0, 0); - return (0, _index2.startOfWeek)(date, options); - } - - const year = - !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; - date.setFullYear(year, 0, options.firstWeekContainsDate); - date.setHours(0, 0, 0, 0); - return (0, _index2.startOfWeek)(date, options); - } - - incompatibleTokens = [ - "y", - "R", - "u", - "Q", - "q", - "M", - "L", - "I", - "d", - "D", - "i", - "t", - "T", - ]; -} -exports.LocalWeekYearParser = LocalWeekYearParser; - - -/***/ }), - -/***/ 84254: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.MinuteParser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class MinuteParser extends _Parser.Parser { - priority = 60; - - parse(dateString, token, match) { - switch (token) { - case "m": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.minute, - dateString, - ); - case "mo": - return match.ordinalNumber(dateString, { unit: "minute" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 0 && value <= 59; - } - - set(date, _flags, value) { - date.setMinutes(value, 0, 0); - return date; - } - - incompatibleTokens = ["t", "T"]; -} -exports.MinuteParser = MinuteParser; - - -/***/ }), - -/***/ 9581: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.MonthParser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class MonthParser extends _Parser.Parser { - incompatibleTokens = [ - "Y", - "R", - "q", - "Q", - "L", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ]; - - priority = 110; - - parse(dateString, token, match) { - const valueCallback = (value) => value - 1; - - switch (token) { - // 1, 2, ..., 12 - case "M": - return (0, _utils.mapValue)( - (0, _utils.parseNumericPattern)( - _constants.numericPatterns.month, - dateString, - ), - valueCallback, - ); - // 01, 02, ..., 12 - case "MM": - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(2, dateString), - valueCallback, - ); - // 1st, 2nd, ..., 12th - case "Mo": - return (0, _utils.mapValue)( - match.ordinalNumber(dateString, { - unit: "month", - }), - valueCallback, - ); - // Jan, Feb, ..., Dec - case "MMM": - return ( - match.month(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.month(dateString, { width: "narrow", context: "formatting" }) - ); - - // J, F, ..., D - case "MMMMM": - return match.month(dateString, { - width: "narrow", - context: "formatting", - }); - // January, February, ..., December - case "MMMM": - default: - return ( - match.month(dateString, { width: "wide", context: "formatting" }) || - match.month(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.month(dateString, { width: "narrow", context: "formatting" }) - ); - } - } - - validate(_date, value) { - return value >= 0 && value <= 11; - } - - set(date, _flags, value) { - date.setMonth(value, 1); - date.setHours(0, 0, 0, 0); - return date; - } -} -exports.MonthParser = MonthParser; - - -/***/ }), - -/***/ 65667: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.QuarterParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class QuarterParser extends _Parser.Parser { - priority = 120; - - parse(dateString, token, match) { - switch (token) { - // 1, 2, 3, 4 - case "Q": - case "QQ": // 01, 02, 03, 04 - return (0, _utils.parseNDigits)(token.length, dateString); - // 1st, 2nd, 3rd, 4th - case "Qo": - return match.ordinalNumber(dateString, { unit: "quarter" }); - // Q1, Q2, Q3, Q4 - case "QQQ": - return ( - match.quarter(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.quarter(dateString, { - width: "narrow", - context: "formatting", - }) - ); - - // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case "QQQQQ": - return match.quarter(dateString, { - width: "narrow", - context: "formatting", - }); - // 1st quarter, 2nd quarter, ... - case "QQQQ": - default: - return ( - match.quarter(dateString, { - width: "wide", - context: "formatting", - }) || - match.quarter(dateString, { - width: "abbreviated", - context: "formatting", - }) || - match.quarter(dateString, { - width: "narrow", - context: "formatting", - }) - ); - } - } - - validate(_date, value) { - return value >= 1 && value <= 4; - } - - set(date, _flags, value) { - date.setMonth((value - 1) * 3, 1); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "Y", - "R", - "q", - "M", - "L", - "w", - "I", - "d", - "D", - "i", - "e", - "c", - "t", - "T", - ]; -} -exports.QuarterParser = QuarterParser; - - -/***/ }), - -/***/ 63478: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.SecondParser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class SecondParser extends _Parser.Parser { - priority = 50; - - parse(dateString, token, match) { - switch (token) { - case "s": - return (0, _utils.parseNumericPattern)( - _constants.numericPatterns.second, - dateString, - ); - case "so": - return match.ordinalNumber(dateString, { unit: "second" }); - default: - return (0, _utils.parseNDigits)(token.length, dateString); - } - } - - validate(_date, value) { - return value >= 0 && value <= 59; - } - - set(date, _flags, value) { - date.setSeconds(value, 0); - return date; - } - - incompatibleTokens = ["t", "T"]; -} -exports.SecondParser = SecondParser; - - -/***/ }), - -/***/ 51556: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.StandAloneLocalDayParser = void 0; -var _index = __nccwpck_require__(29424); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// Stand-alone local day of week -class StandAloneLocalDayParser extends _Parser.Parser { - priority = 90; - - parse(dateString, token, match, options) { - const valueCallback = (value) => { - // We want here floor instead of trunc, so we get -7 for value 0 instead of 0 - const wholeWeekDays = Math.floor((value - 1) / 7) * 7; - return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays; - }; - - switch (token) { - // 3 - case "c": - case "cc": // 03 - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(token.length, dateString), - valueCallback, - ); - // 3rd - case "co": - return (0, _utils.mapValue)( - match.ordinalNumber(dateString, { - unit: "day", - }), - valueCallback, - ); - // Tue - case "ccc": - return ( - match.day(dateString, { - width: "abbreviated", - context: "standalone", - }) || - match.day(dateString, { width: "short", context: "standalone" }) || - match.day(dateString, { width: "narrow", context: "standalone" }) - ); - - // T - case "ccccc": - return match.day(dateString, { - width: "narrow", - context: "standalone", - }); - // Tu - case "cccccc": - return ( - match.day(dateString, { width: "short", context: "standalone" }) || - match.day(dateString, { width: "narrow", context: "standalone" }) - ); - - // Tuesday - case "cccc": - default: - return ( - match.day(dateString, { width: "wide", context: "standalone" }) || - match.day(dateString, { - width: "abbreviated", - context: "standalone", - }) || - match.day(dateString, { width: "short", context: "standalone" }) || - match.day(dateString, { width: "narrow", context: "standalone" }) - ); - } - } - - validate(_date, value) { - return value >= 0 && value <= 6; - } - - set(date, _flags, value, options) { - date = (0, _index.setDay)(date, value, options); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "E", - "i", - "e", - "t", - "T", - ]; -} -exports.StandAloneLocalDayParser = StandAloneLocalDayParser; - - -/***/ }), - -/***/ 69915: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.StandAloneMonthParser = void 0; -var _constants = __nccwpck_require__(30463); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class StandAloneMonthParser extends _Parser.Parser { - priority = 110; - - parse(dateString, token, match) { - const valueCallback = (value) => value - 1; - - switch (token) { - // 1, 2, ..., 12 - case "L": - return (0, _utils.mapValue)( - (0, _utils.parseNumericPattern)( - _constants.numericPatterns.month, - dateString, - ), - valueCallback, - ); - // 01, 02, ..., 12 - case "LL": - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(2, dateString), - valueCallback, - ); - // 1st, 2nd, ..., 12th - case "Lo": - return (0, _utils.mapValue)( - match.ordinalNumber(dateString, { - unit: "month", - }), - valueCallback, - ); - // Jan, Feb, ..., Dec - case "LLL": - return ( - match.month(dateString, { - width: "abbreviated", - context: "standalone", - }) || - match.month(dateString, { width: "narrow", context: "standalone" }) - ); - - // J, F, ..., D - case "LLLLL": - return match.month(dateString, { - width: "narrow", - context: "standalone", - }); - // January, February, ..., December - case "LLLL": - default: - return ( - match.month(dateString, { width: "wide", context: "standalone" }) || - match.month(dateString, { - width: "abbreviated", - context: "standalone", - }) || - match.month(dateString, { width: "narrow", context: "standalone" }) - ); - } - } - - validate(_date, value) { - return value >= 0 && value <= 11; - } - - set(date, _flags, value) { - date.setMonth(value, 1); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "Y", - "R", - "q", - "Q", - "M", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ]; -} -exports.StandAloneMonthParser = StandAloneMonthParser; - - -/***/ }), - -/***/ 22898: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.StandAloneQuarterParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class StandAloneQuarterParser extends _Parser.Parser { - priority = 120; - - parse(dateString, token, match) { - switch (token) { - // 1, 2, 3, 4 - case "q": - case "qq": // 01, 02, 03, 04 - return (0, _utils.parseNDigits)(token.length, dateString); - // 1st, 2nd, 3rd, 4th - case "qo": - return match.ordinalNumber(dateString, { unit: "quarter" }); - // Q1, Q2, Q3, Q4 - case "qqq": - return ( - match.quarter(dateString, { - width: "abbreviated", - context: "standalone", - }) || - match.quarter(dateString, { - width: "narrow", - context: "standalone", - }) - ); - - // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case "qqqqq": - return match.quarter(dateString, { - width: "narrow", - context: "standalone", - }); - // 1st quarter, 2nd quarter, ... - case "qqqq": - default: - return ( - match.quarter(dateString, { - width: "wide", - context: "standalone", - }) || - match.quarter(dateString, { - width: "abbreviated", - context: "standalone", - }) || - match.quarter(dateString, { - width: "narrow", - context: "standalone", - }) - ); - } - } - - validate(_date, value) { - return value >= 1 && value <= 4; - } - - set(date, _flags, value) { - date.setMonth((value - 1) * 3, 1); - date.setHours(0, 0, 0, 0); - return date; - } - - incompatibleTokens = [ - "Y", - "R", - "Q", - "M", - "L", - "w", - "I", - "d", - "D", - "i", - "e", - "c", - "t", - "T", - ]; -} -exports.StandAloneQuarterParser = StandAloneQuarterParser; - - -/***/ }), - -/***/ 63726: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.TimestampMillisecondsParser = void 0; -var _index = __nccwpck_require__(92736); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class TimestampMillisecondsParser extends _Parser.Parser { - priority = 20; - - parse(dateString) { - return (0, _utils.parseAnyDigitsSigned)(dateString); - } - - set(date, _flags, value) { - return [(0, _index.constructFrom)(date, value), { timestampIsSet: true }]; - } - - incompatibleTokens = "*"; -} -exports.TimestampMillisecondsParser = TimestampMillisecondsParser; - - -/***/ }), - -/***/ 90771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.TimestampSecondsParser = void 0; -var _index = __nccwpck_require__(92736); -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -class TimestampSecondsParser extends _Parser.Parser { - priority = 40; - - parse(dateString) { - return (0, _utils.parseAnyDigitsSigned)(dateString); - } - - set(date, _flags, value) { - return [ - (0, _index.constructFrom)(date, value * 1000), - { timestampIsSet: true }, - ]; - } - - incompatibleTokens = "*"; -} -exports.TimestampSecondsParser = TimestampSecondsParser; - - -/***/ }), - -/***/ 12493: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.YearParser = void 0; -var _Parser = __nccwpck_require__(5619); - -var _utils = __nccwpck_require__(59042); - -// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns -// | Year | y | yy | yyy | yyyy | yyyyy | -// |----------|-------|----|-------|-------|-------| -// | AD 1 | 1 | 01 | 001 | 0001 | 00001 | -// | AD 12 | 12 | 12 | 012 | 0012 | 00012 | -// | AD 123 | 123 | 23 | 123 | 0123 | 00123 | -// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | -// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | -class YearParser extends _Parser.Parser { - priority = 130; - incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]; - - parse(dateString, token, match) { - const valueCallback = (year) => ({ - year, - isTwoDigitYear: token === "yy", - }); - - switch (token) { - case "y": - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(4, dateString), - valueCallback, - ); - case "yo": - return (0, _utils.mapValue)( - match.ordinalNumber(dateString, { - unit: "year", - }), - valueCallback, - ); - default: - return (0, _utils.mapValue)( - (0, _utils.parseNDigits)(token.length, dateString), - valueCallback, - ); - } - } - - validate(_date, value) { - return value.isTwoDigitYear || value.year > 0; - } - - set(date, flags, value) { - const currentYear = date.getFullYear(); - - if (value.isTwoDigitYear) { - const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)( - value.year, - currentYear, - ); - date.setFullYear(normalizedTwoDigitYear, 0, 1); - date.setHours(0, 0, 0, 0); - return date; - } - - const year = - !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; - date.setFullYear(year, 0, 1); - date.setHours(0, 0, 0, 0); - return date; - } -} -exports.YearParser = YearParser; - - -/***/ }), - -/***/ 59042: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.dayPeriodEnumToHours = dayPeriodEnumToHours; -exports.isLeapYearIndex = isLeapYearIndex; -exports.mapValue = mapValue; -exports.normalizeTwoDigitYear = normalizeTwoDigitYear; -exports.parseAnyDigitsSigned = parseAnyDigitsSigned; -exports.parseNDigits = parseNDigits; -exports.parseNDigitsSigned = parseNDigitsSigned; -exports.parseNumericPattern = parseNumericPattern; -exports.parseTimezonePattern = parseTimezonePattern; -var _index = __nccwpck_require__(17818); - -var _constants = __nccwpck_require__(30463); - -function mapValue(parseFnResult, mapFn) { - if (!parseFnResult) { - return parseFnResult; - } - - return { - value: mapFn(parseFnResult.value), - rest: parseFnResult.rest, - }; -} - -function parseNumericPattern(pattern, dateString) { - const matchResult = dateString.match(pattern); - - if (!matchResult) { - return null; - } - - return { - value: parseInt(matchResult[0], 10), - rest: dateString.slice(matchResult[0].length), - }; -} - -function parseTimezonePattern(pattern, dateString) { - const matchResult = dateString.match(pattern); - - if (!matchResult) { - return null; - } - - // Input is 'Z' - if (matchResult[0] === "Z") { - return { - value: 0, - rest: dateString.slice(1), - }; - } - - const sign = matchResult[1] === "+" ? 1 : -1; - const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0; - const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0; - const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0; - - return { - value: - sign * - (hours * _index.millisecondsInHour + - minutes * _index.millisecondsInMinute + - seconds * _index.millisecondsInSecond), - rest: dateString.slice(matchResult[0].length), - }; -} - -function parseAnyDigitsSigned(dateString) { - return parseNumericPattern( - _constants.numericPatterns.anyDigitsSigned, - dateString, - ); -} - -function parseNDigits(n, dateString) { - switch (n) { - case 1: - return parseNumericPattern( - _constants.numericPatterns.singleDigit, - dateString, - ); - case 2: - return parseNumericPattern( - _constants.numericPatterns.twoDigits, - dateString, - ); - case 3: - return parseNumericPattern( - _constants.numericPatterns.threeDigits, - dateString, - ); - case 4: - return parseNumericPattern( - _constants.numericPatterns.fourDigits, - dateString, - ); - default: - return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString); - } -} - -function parseNDigitsSigned(n, dateString) { - switch (n) { - case 1: - return parseNumericPattern( - _constants.numericPatterns.singleDigitSigned, - dateString, - ); - case 2: - return parseNumericPattern( - _constants.numericPatterns.twoDigitsSigned, - dateString, - ); - case 3: - return parseNumericPattern( - _constants.numericPatterns.threeDigitsSigned, - dateString, - ); - case 4: - return parseNumericPattern( - _constants.numericPatterns.fourDigitsSigned, - dateString, - ); - default: - return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString); - } -} - -function dayPeriodEnumToHours(dayPeriod) { - switch (dayPeriod) { - case "morning": - return 4; - case "evening": - return 17; - case "pm": - case "noon": - case "afternoon": - return 12; - case "am": - case "midnight": - case "night": - default: - return 0; - } -} - -function normalizeTwoDigitYear(twoDigitYear, currentYear) { - const isCommonEra = currentYear > 0; - // Absolute number of the current year: - // 1 -> 1 AC - // 0 -> 1 BC - // -1 -> 2 BC - const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear; - - let result; - if (absCurrentYear <= 50) { - result = twoDigitYear || 100; - } else { - const rangeEnd = absCurrentYear + 50; - const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100; - const isPreviousCentury = twoDigitYear >= rangeEnd % 100; - result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0); - } - - return isCommonEra ? result : 1 - result; -} - -function isLeapYearIndex(year) { - return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); -} - - -/***/ }), - -/***/ 93822: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.parseISO = parseISO; -var _index = __nccwpck_require__(17818); - -/** - * The {@link parseISO} function options. - */ - -/** - * @name parseISO - * @category Common Helpers - * @summary Parse ISO string - * - * @description - * Parse the given string in ISO 8601 format and return an instance of Date. - * - * Function accepts complete ISO 8601 formats as well as partial implementations. - * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 - * - * If the argument isn't a string, the function cannot parse the string or - * the values are invalid, it returns Invalid Date. - * - * @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). - * - * @param argument - The value to convert - * @param options - An object with options - * - * @returns The parsed date in the local time zone - * - * @example - * // Convert string '2014-02-11T11:30:30' to date: - * const result = parseISO('2014-02-11T11:30:30') - * //=> Tue Feb 11 2014 11:30:30 - * - * @example - * // Convert string '+02014101' to date, - * // if the additional number of digits in the extended year format is 1: - * const result = parseISO('+02014101', { additionalDigits: 1 }) - * //=> Fri Apr 11 2014 00:00:00 - */ -function parseISO(argument, options) { - const additionalDigits = options?.additionalDigits ?? 2; - const dateStrings = splitDateString(argument); - - let date; - if (dateStrings.date) { - const parseYearResult = parseYear(dateStrings.date, additionalDigits); - date = parseDate(parseYearResult.restDateString, parseYearResult.year); - } - - if (!date || isNaN(date.getTime())) { - return new Date(NaN); - } - - const timestamp = date.getTime(); - let time = 0; - let offset; - - if (dateStrings.time) { - time = parseTime(dateStrings.time); - if (isNaN(time)) { - return new Date(NaN); - } - } - - if (dateStrings.timezone) { - offset = parseTimezone(dateStrings.timezone); - if (isNaN(offset)) { - return new Date(NaN); - } - } else { - const dirtyDate = new Date(timestamp + time); - // JS parsed string assuming it's in UTC timezone - // but we need it to be parsed in our timezone - // so we use utc values to build date in our timezone. - // Year values from 0 to 99 map to the years 1900 to 1999 - // so set year explicitly with setFullYear. - const result = new Date(0); - result.setFullYear( - dirtyDate.getUTCFullYear(), - dirtyDate.getUTCMonth(), - dirtyDate.getUTCDate(), - ); - result.setHours( - dirtyDate.getUTCHours(), - dirtyDate.getUTCMinutes(), - dirtyDate.getUTCSeconds(), - dirtyDate.getUTCMilliseconds(), - ); - return result; - } - - return new Date(timestamp + time + offset); -} - -const patterns = { - dateTimeDelimiter: /[T ]/, - timeZoneDelimiter: /[Z ]/i, - timezone: /([Z+-].*)$/, -}; - -const dateRegex = - /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/; -const timeRegex = - /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/; -const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/; - -function splitDateString(dateString) { - const dateStrings = {}; - const array = dateString.split(patterns.dateTimeDelimiter); - let timeString; - - // The regex match should only return at maximum two array elements. - // [date], [time], or [date, time]. - if (array.length > 2) { - return dateStrings; - } - - if (/:/.test(array[0])) { - timeString = array[0]; - } else { - dateStrings.date = array[0]; - timeString = array[1]; - if (patterns.timeZoneDelimiter.test(dateStrings.date)) { - dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]; - timeString = dateString.substr( - dateStrings.date.length, - dateString.length, - ); - } - } - - if (timeString) { - const token = patterns.timezone.exec(timeString); - if (token) { - dateStrings.time = timeString.replace(token[1], ""); - dateStrings.timezone = token[1]; - } else { - dateStrings.time = timeString; - } - } - - return dateStrings; -} - -function parseYear(dateString, additionalDigits) { - const regex = new RegExp( - "^(?:(\\d{4}|[+-]\\d{" + - (4 + additionalDigits) + - "})|(\\d{2}|[+-]\\d{" + - (2 + additionalDigits) + - "})$)", - ); - - const captures = dateString.match(regex); - // Invalid ISO-formatted year - if (!captures) return { year: NaN, restDateString: "" }; - - const year = captures[1] ? parseInt(captures[1]) : null; - const century = captures[2] ? parseInt(captures[2]) : null; - - // either year or century is null, not both - return { - year: century === null ? year : century * 100, - restDateString: dateString.slice((captures[1] || captures[2]).length), - }; -} - -function parseDate(dateString, year) { - // Invalid ISO-formatted year - if (year === null) return new Date(NaN); - - const captures = dateString.match(dateRegex); - // Invalid ISO-formatted string - if (!captures) return new Date(NaN); - - const isWeekDate = !!captures[4]; - const dayOfYear = parseDateUnit(captures[1]); - const month = parseDateUnit(captures[2]) - 1; - const day = parseDateUnit(captures[3]); - const week = parseDateUnit(captures[4]); - const dayOfWeek = parseDateUnit(captures[5]) - 1; - - if (isWeekDate) { - if (!validateWeekDate(year, week, dayOfWeek)) { - return new Date(NaN); - } - return dayOfISOWeekYear(year, week, dayOfWeek); - } else { - const date = new Date(0); - if ( - !validateDate(year, month, day) || - !validateDayOfYearDate(year, dayOfYear) - ) { - return new Date(NaN); - } - date.setUTCFullYear(year, month, Math.max(dayOfYear, day)); - return date; - } -} - -function parseDateUnit(value) { - return value ? parseInt(value) : 1; -} - -function parseTime(timeString) { - const captures = timeString.match(timeRegex); - if (!captures) return NaN; // Invalid ISO-formatted time - - const hours = parseTimeUnit(captures[1]); - const minutes = parseTimeUnit(captures[2]); - const seconds = parseTimeUnit(captures[3]); - - if (!validateTime(hours, minutes, seconds)) { - return NaN; - } - - return ( - hours * _index.millisecondsInHour + - minutes * _index.millisecondsInMinute + - seconds * 1000 - ); -} - -function parseTimeUnit(value) { - return (value && parseFloat(value.replace(",", "."))) || 0; -} - -function parseTimezone(timezoneString) { - if (timezoneString === "Z") return 0; - - const captures = timezoneString.match(timezoneRegex); - if (!captures) return 0; - - const sign = captures[1] === "+" ? -1 : 1; - const hours = parseInt(captures[2]); - const minutes = (captures[3] && parseInt(captures[3])) || 0; - - if (!validateTimezone(hours, minutes)) { - return NaN; - } - - return ( - sign * - (hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute) - ); -} - -function dayOfISOWeekYear(isoWeekYear, week, day) { - const date = new Date(0); - date.setUTCFullYear(isoWeekYear, 0, 4); - const fourthOfJanuaryDay = date.getUTCDay() || 7; - const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay; - date.setUTCDate(date.getUTCDate() + diff); - return date; -} - -// Validation functions - -// February is null to handle the leap year (using ||) -const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - -function isLeapYearIndex(year) { - return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); -} - -function validateDate(year, month, date) { - return ( - month >= 0 && - month <= 11 && - date >= 1 && - date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28)) - ); -} - -function validateDayOfYearDate(year, dayOfYear) { - return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365); -} - -function validateWeekDate(_year, week, day) { - return week >= 1 && week <= 53 && day >= 0 && day <= 6; -} - -function validateTime(hours, minutes, seconds) { - if (hours === 24) { - return minutes === 0 && seconds === 0; - } - - return ( - seconds >= 0 && - seconds < 60 && - minutes >= 0 && - minutes < 60 && - hours >= 0 && - hours < 25 - ); -} - -function validateTimezone(_hours, minutes) { - return minutes >= 0 && minutes <= 59; -} - - -/***/ }), - -/***/ 50135: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.parseJSON = parseJSON; /** - * @name parseJSON - * @category Common Helpers - * @summary Parse a JSON date string - * - * @description - * Converts a complete ISO date string in UTC time, the typical format for transmitting - * a date in JSON, to a JavaScript `Date` instance. - * - * This is a minimal implementation for converting dates retrieved from a JSON API to - * a `Date` instance which can be used with other functions in the `date-fns` library. - * The following formats are supported: - * - * - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())` - * - `2000-03-15T05:20:10Z`: Without milliseconds - * - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages - * - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages - * - `2000-03-15T05:20:10+0000`: With a zero offset without a colon - * - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol - * - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds - * - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting - * - * For convenience and ease of use these other input types are also supported - * via [toDate](https://date-fns.org/docs/toDate): - * - * - A `Date` instance will be cloned - * - A `number` will be treated as a timestamp - * - * Any other input type or invalid date strings will return an `Invalid Date`. - * - * @param dateStr - A fully formed ISO8601 date string to convert - * - * @returns The parsed date in the local time zone - */ -function parseJSON(dateStr) { - const parts = dateStr.match( - /(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/, - ); - if (parts) { - // Group 8 matches the sign - return new Date( - Date.UTC( - +parts[1], - +parts[2] - 1, - +parts[3], - +parts[4] - (+parts[9] || 0) * (parts[8] == "-" ? -1 : 1), - +parts[5] - (+parts[10] || 0) * (parts[8] == "-" ? -1 : 1), - +parts[6], - +((parts[7] || "0") + "00").substring(0, 3), - ), - ); - } - return new Date(NaN); -} - - -/***/ }), - -/***/ 456: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousDay = previousDay; -var _index = __nccwpck_require__(46172); -var _index2 = __nccwpck_require__(19771); - -/** - * @name previousDay - * @category Weekday Helpers - * @summary When is the previous day of the week? - * - * @description - * When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday. - * - * @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). - * - * @param date - The date to check - * @param day - The day of the week - * - * @returns The date is the previous day of week - * - * @example - * // When is the previous Monday before Mar, 20, 2020? - * const result = previousDay(new Date(2020, 2, 20), 1) - * //=> Mon Mar 16 2020 00:00:00 - * - * @example - * // When is the previous Tuesday before Mar, 21, 2020? - * const result = previousDay(new Date(2020, 2, 21), 2) - * //=> Tue Mar 17 2020 00:00:00 - */ -function previousDay(date, day) { - let delta = (0, _index.getDay)(date) - day; - if (delta <= 0) delta += 7; - - return (0, _index2.subDays)(date, delta); -} - - -/***/ }), - -/***/ 21812: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousFriday = previousFriday; -var _index = __nccwpck_require__(456); - -/** - * @name previousFriday - * @category Weekday Helpers - * @summary When is the previous Friday? - * - * @description - * When is the previous Friday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The previous Friday - * - * @example - * // When is the previous Friday before Jun, 19, 2021? - * const result = previousFriday(new Date(2021, 5, 19)) - * //=> Fri June 18 2021 00:00:00 - */ -function previousFriday(date) { - return (0, _index.previousDay)(date, 5); -} - - -/***/ }), - -/***/ 39484: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousMonday = previousMonday; -var _index = __nccwpck_require__(456); - -/** - * @name previousMonday - * @category Weekday Helpers - * @summary When is the previous Monday? - * - * @description - * When is the previous Monday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The previous Monday - * - * @example - * // When is the previous Monday before Jun, 18, 2021? - * const result = previousMonday(new Date(2021, 5, 18)) - * //=> Mon June 14 2021 00:00:00 - */ -function previousMonday(date) { - return (0, _index.previousDay)(date, 1); -} - - -/***/ }), - -/***/ 15648: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousSaturday = previousSaturday; -var _index = __nccwpck_require__(456); - -/** - * @name previousSaturday - * @category Weekday Helpers - * @summary When is the previous Saturday? - * - * @description - * When is the previous Saturday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The previous Saturday - * - * @example - * // When is the previous Saturday before Jun, 20, 2021? - * const result = previousSaturday(new Date(2021, 5, 20)) - * //=> Sat June 19 2021 00:00:00 - */ -function previousSaturday(date) { - return (0, _index.previousDay)(date, 6); -} - - -/***/ }), - -/***/ 59010: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousSunday = previousSunday; -var _index = __nccwpck_require__(456); - -/** - * @name previousSunday - * @category Weekday Helpers - * @summary When is the previous Sunday? - * - * @description - * When is the previous Sunday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The previous Sunday - * - * @example - * // When is the previous Sunday before Jun, 21, 2021? - * const result = previousSunday(new Date(2021, 5, 21)) - * //=> Sun June 20 2021 00:00:00 - */ -function previousSunday(date) { - return (0, _index.previousDay)(date, 0); -} - - -/***/ }), - -/***/ 50582: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousThursday = previousThursday; -var _index = __nccwpck_require__(456); - -/** - * @name previousThursday - * @category Weekday Helpers - * @summary When is the previous Thursday? - * - * @description - * When is the previous Thursday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The previous Thursday - * - * @example - * // When is the previous Thursday before Jun, 18, 2021? - * const result = previousThursday(new Date(2021, 5, 18)) - * //=> Thu June 17 2021 00:00:00 - */ -function previousThursday(date) { - return (0, _index.previousDay)(date, 4); -} - - -/***/ }), - -/***/ 57967: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousTuesday = previousTuesday; -var _index = __nccwpck_require__(456); - -/** - * @name previousTuesday - * @category Weekday Helpers - * @summary When is the previous Tuesday? - * - * @description - * When is the previous Tuesday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The previous Tuesday - * - * @example - * // When is the previous Tuesday before Jun, 18, 2021? - * const result = previousTuesday(new Date(2021, 5, 18)) - * //=> Tue June 15 2021 00:00:00 - */ -function previousTuesday(date) { - return (0, _index.previousDay)(date, 2); -} - - -/***/ }), - -/***/ 70615: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.previousWednesday = previousWednesday; -var _index = __nccwpck_require__(456); - -/** - * @name previousWednesday - * @category Weekday Helpers - * @summary When is the previous Wednesday? - * - * @description - * When is the previous Wednesday? - * - * @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). - * - * @param date - The date to start counting from - * - * @returns The previous Wednesday - * - * @example - * // When is the previous Wednesday before Jun, 18, 2021? - * const result = previousWednesday(new Date(2021, 5, 18)) - * //=> Wed June 16 2021 00:00:00 - */ -function previousWednesday(date) { - return (0, _index.previousDay)(date, 3); -} - - -/***/ }), - -/***/ 40912: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.quartersToMonths = quartersToMonths; -var _index = __nccwpck_require__(17818); - -/** - * @name quartersToMonths - * @category Conversion Helpers - * @summary Convert number of quarters to months. - * - * @description - * Convert a number of quarters to a full number of months. - * - * @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). - * - * @param quarters - The number of quarters to be converted - * - * @returns The number of quarters converted in months - * - * @example - * // Convert 2 quarters to months - * const result = quartersToMonths(2) - * //=> 6 - */ -function quartersToMonths(quarters) { - return Math.trunc(quarters * _index.monthsInQuarter); -} - - -/***/ }), - -/***/ 31861: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.quartersToYears = quartersToYears; -var _index = __nccwpck_require__(17818); - -/** - * @name quartersToYears - * @category Conversion Helpers - * @summary Convert number of quarters to years. - * - * @description - * Convert a number of quarters to a full number of years. - * - * @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). - * - * @param quarters - The number of quarters to be converted - * - * @returns The number of quarters converted in years - * - * @example - * // Convert 8 quarters to years - * const result = quartersToYears(8) - * //=> 2 - * - * @example - * // It uses floor rounding: - * const result = quartersToYears(11) - * //=> 2 - */ -function quartersToYears(quarters) { - const years = quarters / _index.quartersInYear; - return Math.trunc(years); -} - - -/***/ }), - -/***/ 43331: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.roundToNearestHours = roundToNearestHours; -var _index = __nccwpck_require__(21639); -var _index2 = __nccwpck_require__(92736); -var _index3 = __nccwpck_require__(53622); - -/** - * The {@link roundToNearestHours} function options. - */ - -/** - * @name roundToNearestHours - * @category Hour Helpers - * @summary Rounds the given date to the nearest hour - * - * @description - * Rounds the given date to the nearest hour (or number of hours). - * Rounds up when the given date is exactly between the nearest round hours. - * - * @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). - * - * @param date - The date to round - * @param options - An object with options. - * - * @returns The new date rounded to the closest hour - * - * @example - * // Round 10 July 2014 12:34:56 to nearest hour: - * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56)) - * //=> Thu Jul 10 2014 13:00:00 - * - * @example - * // Round 10 July 2014 12:34:56 to nearest half hour: - * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 6 }) - * //=> Thu Jul 10 2014 12:00:00 - - * @example - * // Round 10 July 2014 12:34:56 to nearest half hour: - * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 }) - * //=> Thu Jul 10 2014 16:00:00 - -* @example - * // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour: - * const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' }) - * //=> Thu Jul 10 2014 02:00:00 - * - * @example - * // Ceil (rounds up) 10 July 2014 12:34:56 to nearest quarter hour: - * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { roundingMethod: 'floor', nearestTo: 8 }) - * //=> Thu Jul 10 2014 08:00:00 - */ -function roundToNearestHours(date, options) { - const nearestTo = options?.nearestTo ?? 1; - - if (nearestTo < 1 || nearestTo > 12) - return (0, _index2.constructFrom)(date, NaN); - - const _date = (0, _index3.toDate)(date); - const fractionalMinutes = _date.getMinutes() / 60; - const fractionalSeconds = _date.getSeconds() / 60 / 60; - const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60 / 60; - const hours = - _date.getHours() + - fractionalMinutes + - fractionalSeconds + - fractionalMilliseconds; - - // Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc' - const method = options?.roundingMethod ?? "round"; - const roundingMethod = (0, _index.getRoundingMethod)(method); - - // nearestTo option does not care daylight savings time - const roundedHours = roundingMethod(hours / nearestTo) * nearestTo; - - const result = (0, _index2.constructFrom)(date, _date); - result.setHours(roundedHours, 0, 0, 0); - return result; -} - - -/***/ }), - -/***/ 20295: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.roundToNearestMinutes = roundToNearestMinutes; -var _index = __nccwpck_require__(21639); -var _index2 = __nccwpck_require__(92736); -var _index3 = __nccwpck_require__(53622); - -/** - * The {@link roundToNearestMinutes} function options. - */ - -/** - * @name roundToNearestMinutes - * @category Minute Helpers - * @summary Rounds the given date to the nearest minute - * - * @description - * Rounds the given date to the nearest minute (or number of minutes). - * Rounds up when the given date is exactly between the nearest round minutes. - * - * @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). - * - * @param date - The date to round - * @param options - An object with options. - * - * @returns The new date rounded to the closest minute - * - * @example - * // Round 10 July 2014 12:12:34 to nearest minute: - * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34)) - * //=> Thu Jul 10 2014 12:13:00 - * - * @example - * // Round 10 July 2014 12:12:34 to nearest quarter hour: - * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 }) - * //=> Thu Jul 10 2014 12:15:00 - * - * @example - * // Floor (rounds down) 10 July 2014 12:12:34 to nearest minute: - * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'floor' }) - * //=> Thu Jul 10 2014 12:12:00 - * - * @example - * // Ceil (rounds up) 10 July 2014 12:12:34 to nearest half hour: - * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'ceil', nearestTo: 30 }) - * //=> Thu Jul 10 2014 12:30:00 - */ -function roundToNearestMinutes(date, options) { - const nearestTo = options?.nearestTo ?? 1; - - if (nearestTo < 1 || nearestTo > 30) - return (0, _index2.constructFrom)(date, NaN); - - const _date = (0, _index3.toDate)(date); - const fractionalSeconds = _date.getSeconds() / 60; - const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60; - const minutes = - _date.getMinutes() + fractionalSeconds + fractionalMilliseconds; - - // Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc' - const method = options?.roundingMethod ?? "round"; - const roundingMethod = (0, _index.getRoundingMethod)(method); - - const roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo; - - const result = (0, _index2.constructFrom)(date, _date); - result.setMinutes(roundedMinutes, 0, 0); - return result; -} - - -/***/ }), - -/***/ 61528: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.secondsToHours = secondsToHours; -var _index = __nccwpck_require__(17818); - -/** - * @name secondsToHours - * @category Conversion Helpers - * @summary Convert seconds to hours. - * - * @description - * Convert a number of seconds to a full number of hours. - * - * @param seconds - The number of seconds to be converted - * - * @returns The number of seconds converted in hours - * - * @example - * // Convert 7200 seconds into hours - * const result = secondsToHours(7200) - * //=> 2 - * - * @example - * // It uses floor rounding: - * const result = secondsToHours(7199) - * //=> 1 - */ -function secondsToHours(seconds) { - const hours = seconds / _index.secondsInHour; - return Math.trunc(hours); -} - - -/***/ }), - -/***/ 14812: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.secondsToMilliseconds = secondsToMilliseconds; -var _index = __nccwpck_require__(17818); - -/** - * @name secondsToMilliseconds - * @category Conversion Helpers - * @summary Convert seconds to milliseconds. - * - * @description - * Convert a number of seconds to a full number of milliseconds. - * - * @param seconds - The number of seconds to be converted - * - * @returns The number of seconds converted in milliseconds - * - * @example - * // Convert 2 seconds into milliseconds - * const result = secondsToMilliseconds(2) - * //=> 2000 - */ -function secondsToMilliseconds(seconds) { - return seconds * _index.millisecondsInSecond; -} - - -/***/ }), - -/***/ 38217: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.secondsToMinutes = secondsToMinutes; -var _index = __nccwpck_require__(17818); - -/** - * @name secondsToMinutes - * @category Conversion Helpers - * @summary Convert seconds to minutes. - * - * @description - * Convert a number of seconds to a full number of minutes. - * - * @param seconds - The number of seconds to be converted - * - * @returns The number of seconds converted in minutes - * - * @example - * // Convert 120 seconds into minutes - * const result = secondsToMinutes(120) - * //=> 2 - * - * @example - * // It uses floor rounding: - * const result = secondsToMinutes(119) - * //=> 1 - */ -function secondsToMinutes(seconds) { - const minutes = seconds / _index.secondsInMinute; - return Math.trunc(minutes); -} - - -/***/ }), - -/***/ 95027: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.set = set; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(11771); -var _index3 = __nccwpck_require__(53622); - -/** - * @name set - * @category Common Helpers - * @summary Set date values to a given date. - * - * @description - * Set date values to a given date. - * - * Sets time values to date from object `values`. - * A value is not set if it is undefined or null or doesn't exist in `values`. - * - * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts - * to use native `Date#setX` methods. If you use this function, you may not want to include the - * other `setX` functions that date-fns provides if you are concerned about the bundle size. - * - * @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). - * - * @param date - The date to be changed - * @param values - The date values to be set - * - * @returns The new date with options set - * - * @example - * // Transform 1 September 2014 into 20 October 2015 in a single line: - * const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 }) - * //=> Tue Oct 20 2015 00:00:00 - * - * @example - * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00: - * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 }) - * //=> Mon Sep 01 2014 12:23:45 - */ - -function set(date, values) { - let _date = (0, _index3.toDate)(date); - - // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date - if (isNaN(+_date)) { - return (0, _index.constructFrom)(date, NaN); - } - - if (values.year != null) { - _date.setFullYear(values.year); - } - - if (values.month != null) { - _date = (0, _index2.setMonth)(_date, values.month); - } - - if (values.date != null) { - _date.setDate(values.date); - } - - if (values.hours != null) { - _date.setHours(values.hours); - } - - if (values.minutes != null) { - _date.setMinutes(values.minutes); - } - - if (values.seconds != null) { - _date.setSeconds(values.seconds); - } - - if (values.milliseconds != null) { - _date.setMilliseconds(values.milliseconds); - } - - return _date; -} - - -/***/ }), - -/***/ 25574: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setDate = setDate; -var _index = __nccwpck_require__(53622); - -/** - * @name setDate - * @category Day Helpers - * @summary Set the day of the month to the given date. - * - * @description - * Set the day of the month to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param dayOfMonth - The day of the month of the new date - * - * @returns The new date with the day of the month set - * - * @example - * // Set the 30th day of the month to 1 September 2014: - * const result = setDate(new Date(2014, 8, 1), 30) - * //=> Tue Sep 30 2014 00:00:00 - */ -function setDate(date, dayOfMonth) { - const _date = (0, _index.toDate)(date); - _date.setDate(dayOfMonth); - return _date; -} - - -/***/ }), - -/***/ 29424: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setDay = setDay; -var _index = __nccwpck_require__(8361); -var _index2 = __nccwpck_require__(53622); - -var _index3 = __nccwpck_require__(42466); - -/** - * The {@link setDay} function options. - */ - -/** - * @name setDay - * @category Weekday Helpers - * @summary Set the day of the week to the given date. - * - * @description - * Set the day of the week to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param day - The day of the week of the new date - * @param options - An object with options. - * - * @returns The new date with the day of the week set - * - * @example - * // Set week day to Sunday, with the default weekStartsOn of Sunday: - * const result = setDay(new Date(2014, 8, 1), 0) - * //=> Sun Aug 31 2014 00:00:00 - * - * @example - * // Set week day to Sunday, with a weekStartsOn of Monday: - * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 }) - * //=> Sun Sep 07 2014 00:00:00 - */ -function setDay(date, day, options) { - const defaultOptions = (0, _index3.getDefaultOptions)(); - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - const _date = (0, _index2.toDate)(date); - const currentDay = _date.getDay(); - - const remainder = day % 7; - const dayIndex = (remainder + 7) % 7; - - const delta = 7 - weekStartsOn; - const diff = - day < 0 || day > 6 - ? day - ((currentDay + delta) % 7) - : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7); - return (0, _index.addDays)(_date, diff); -} - - -/***/ }), - -/***/ 58715: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setDayOfYear = setDayOfYear; -var _index = __nccwpck_require__(53622); - -/** - * @name setDayOfYear - * @category Day Helpers - * @summary Set the day of the year to the given date. - * - * @description - * Set the day of the year to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param dayOfYear - The day of the year of the new date - * - * @returns The new date with the day of the year set - * - * @example - * // Set the 2nd day of the year to 2 July 2014: - * const result = setDayOfYear(new Date(2014, 6, 2), 2) - * //=> Thu Jan 02 2014 00:00:00 - */ -function setDayOfYear(date, dayOfYear) { - const _date = (0, _index.toDate)(date); - _date.setMonth(0); - _date.setDate(dayOfYear); - return _date; -} - - -/***/ }), - -/***/ 47911: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setDefaultOptions = setDefaultOptions; - -var _index = __nccwpck_require__(42466); - -/** - * @name setDefaultOptions - * @category Common Helpers - * @summary Set default options including locale. - * @pure false - * - * @description - * Sets the defaults for - * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate` - * arguments for all functions. - * - * @param options - An object with options - * - * @example - * // Set global locale: - * import { es } from 'date-fns/locale' - * setDefaultOptions({ locale: es }) - * const result = format(new Date(2014, 8, 2), 'PPPP') - * //=> 'martes, 2 de septiembre de 2014' - * - * @example - * // Start of the week for 2 September 2014: - * const result = startOfWeek(new Date(2014, 8, 2)) - * //=> Sun Aug 31 2014 00:00:00 - * - * @example - * // Start of the week for 2 September 2014, - * // when we set that week starts on Monday by default: - * setDefaultOptions({ weekStartsOn: 1 }) - * const result = startOfWeek(new Date(2014, 8, 2)) - * //=> Mon Sep 01 2014 00:00:00 - * - * @example - * // Manually set options take priority over default options: - * setDefaultOptions({ weekStartsOn: 1 }) - * const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 }) - * //=> Sun Aug 31 2014 00:00:00 - * - * @example - * // Remove the option by setting it to `undefined`: - * setDefaultOptions({ weekStartsOn: 1 }) - * setDefaultOptions({ weekStartsOn: undefined }) - * const result = startOfWeek(new Date(2014, 8, 2)) - * //=> Sun Aug 31 2014 00:00:00 - */ -function setDefaultOptions(options) { - const result = {}; - const defaultOptions = (0, _index.getDefaultOptions)(); - - for (const property in defaultOptions) { - if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - result[property] = defaultOptions[property]; - } - } - - for (const property in options) { - if (Object.prototype.hasOwnProperty.call(options, property)) { - if (options[property] === undefined) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - delete result[property]; - } else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - result[property] = options[property]; - } - } - } - - (0, _index.setDefaultOptions)(result); -} - - -/***/ }), - -/***/ 82560: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setHours = setHours; -var _index = __nccwpck_require__(53622); - -/** - * @name setHours - * @category Hour Helpers - * @summary Set the hours to the given date. - * - * @description - * Set the hours to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param hours - The hours of the new date - * - * @returns The new date with the hours set - * - * @example - * // Set 4 hours to 1 September 2014 11:30:00: - * const result = setHours(new Date(2014, 8, 1, 11, 30), 4) - * //=> Mon Sep 01 2014 04:30:00 - */ -function setHours(date, hours) { - const _date = (0, _index.toDate)(date); - _date.setHours(hours); - return _date; -} - - -/***/ }), - -/***/ 20665: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setISODay = setISODay; -var _index = __nccwpck_require__(8361); -var _index2 = __nccwpck_require__(12924); -var _index3 = __nccwpck_require__(53622); - -/** - * @name setISODay - * @category Weekday Helpers - * @summary Set the day of the ISO week to the given date. - * - * @description - * Set the day of the ISO week to the given date. - * ISO week starts with Monday. - * 7 is the index of Sunday, 1 is the index of Monday etc. - * - * @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). - * - * @param date - The date to be changed - * @param day - The day of the ISO week of the new date - * - * @returns The new date with the day of the ISO week set - * - * @example - * // Set Sunday to 1 September 2014: - * const result = setISODay(new Date(2014, 8, 1), 7) - * //=> Sun Sep 07 2014 00:00:00 - */ -function setISODay(date, day) { - const _date = (0, _index3.toDate)(date); - const currentDay = (0, _index2.getISODay)(_date); - const diff = day - currentDay; - return (0, _index.addDays)(_date, diff); -} - - -/***/ }), - -/***/ 81308: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setISOWeek = setISOWeek; -var _index = __nccwpck_require__(66475); -var _index2 = __nccwpck_require__(53622); - -/** - * @name setISOWeek - * @category ISO Week Helpers - * @summary Set the ISO week to the given date. - * - * @description - * Set the ISO week to the given date, saving the weekday number. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The date to be changed - * @param week - The ISO week of the new date - * - * @returns The new date with the ISO week set - * - * @example - * // Set the 53rd ISO week to 7 August 2004: - * const result = setISOWeek(new Date(2004, 7, 7), 53) - * //=> Sat Jan 01 2005 00:00:00 - */ -function setISOWeek(date, week) { - const _date = (0, _index2.toDate)(date); - const diff = (0, _index.getISOWeek)(_date) - week; - _date.setDate(_date.getDate() - diff * 7); - return _date; -} - - -/***/ }), - -/***/ 24954: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setISOWeekYear = setISOWeekYear; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(90338); -var _index3 = __nccwpck_require__(37809); -var _index4 = __nccwpck_require__(53622); - -/** - * @name setISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Set the ISO week-numbering year to the given date. - * - * @description - * Set the ISO week-numbering year to the given date, - * saving the week number and the weekday number. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The date to be changed - * @param weekYear - The ISO week-numbering year of the new date - * - * @returns The new date with the ISO week-numbering year set - * - * @example - * // Set ISO week-numbering year 2007 to 29 December 2008: - * const result = setISOWeekYear(new Date(2008, 11, 29), 2007) - * //=> Mon Jan 01 2007 00:00:00 - */ -function setISOWeekYear(date, weekYear) { - let _date = (0, _index4.toDate)(date); - const diff = (0, _index2.differenceInCalendarDays)( - _date, - (0, _index3.startOfISOWeekYear)(_date), - ); - const fourthOfJanuary = (0, _index.constructFrom)(date, 0); - fourthOfJanuary.setFullYear(weekYear, 0, 4); - fourthOfJanuary.setHours(0, 0, 0, 0); - _date = (0, _index3.startOfISOWeekYear)(fourthOfJanuary); - _date.setDate(_date.getDate() + diff); - return _date; -} - - -/***/ }), - -/***/ 49756: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setMilliseconds = setMilliseconds; -var _index = __nccwpck_require__(53622); - -/** - * @name setMilliseconds - * @category Millisecond Helpers - * @summary Set the milliseconds to the given date. - * - * @description - * Set the milliseconds to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param milliseconds - The milliseconds of the new date - * - * @returns The new date with the milliseconds set - * - * @example - * // Set 300 milliseconds to 1 September 2014 11:30:40.500: - * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) - * //=> Mon Sep 01 2014 11:30:40.300 - */ -function setMilliseconds(date, milliseconds) { - const _date = (0, _index.toDate)(date); - _date.setMilliseconds(milliseconds); - return _date; -} - - -/***/ }), - -/***/ 79541: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setMinutes = setMinutes; -var _index = __nccwpck_require__(53622); - -/** - * @name setMinutes - * @category Minute Helpers - * @summary Set the minutes to the given date. - * - * @description - * Set the minutes to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param minutes - The minutes of the new date - * - * @returns The new date with the minutes set - * - * @example - * // Set 45 minutes to 1 September 2014 11:30:40: - * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45) - * //=> Mon Sep 01 2014 11:45:40 - */ -function setMinutes(date, minutes) { - const _date = (0, _index.toDate)(date); - _date.setMinutes(minutes); - return _date; -} - - -/***/ }), - -/***/ 11771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setMonth = setMonth; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(75586); -var _index3 = __nccwpck_require__(53622); - -/** - * @name setMonth - * @category Month Helpers - * @summary Set the month to the given date. - * - * @description - * Set the month to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param month - The month index to set (0-11) - * - * @returns The new date with the month set - * - * @example - * // Set February to 1 September 2014: - * const result = setMonth(new Date(2014, 8, 1), 1) - * //=> Sat Feb 01 2014 00:00:00 - */ -function setMonth(date, month) { - const _date = (0, _index3.toDate)(date); - const year = _date.getFullYear(); - const day = _date.getDate(); - - const dateWithDesiredMonth = (0, _index.constructFrom)(date, 0); - dateWithDesiredMonth.setFullYear(year, month, 15); - dateWithDesiredMonth.setHours(0, 0, 0, 0); - const daysInMonth = (0, _index2.getDaysInMonth)(dateWithDesiredMonth); - // Set the last day of the new month - // if the original date was the last day of the longer month - _date.setMonth(month, Math.min(day, daysInMonth)); - return _date; -} - - -/***/ }), - -/***/ 75595: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setQuarter = setQuarter; -var _index = __nccwpck_require__(11771); -var _index2 = __nccwpck_require__(53622); - -/** - * @name setQuarter - * @category Quarter Helpers - * @summary Set the year quarter to the given date. - * - * @description - * Set the year quarter to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param quarter - The quarter of the new date - * - * @returns The new date with the quarter set - * - * @example - * // Set the 2nd quarter to 2 July 2014: - * const result = setQuarter(new Date(2014, 6, 2), 2) - * //=> Wed Apr 02 2014 00:00:00 - */ -function setQuarter(date, quarter) { - const _date = (0, _index2.toDate)(date); - const oldQuarter = Math.trunc(_date.getMonth() / 3) + 1; - const diff = quarter - oldQuarter; - return (0, _index.setMonth)(_date, _date.getMonth() + diff * 3); -} - - -/***/ }), - -/***/ 83987: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setSeconds = setSeconds; -var _index = __nccwpck_require__(53622); - -/** - * @name setSeconds - * @category Second Helpers - * @summary Set the seconds to the given date. - * - * @description - * Set the seconds to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param seconds - The seconds of the new date - * - * @returns The new date with the seconds set - * - * @example - * // Set 45 seconds to 1 September 2014 11:30:40: - * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) - * //=> Mon Sep 01 2014 11:30:45 - */ -function setSeconds(date, seconds) { - const _date = (0, _index.toDate)(date); - _date.setSeconds(seconds); - return _date; -} - - -/***/ }), - -/***/ 98476: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setWeek = setWeek; -var _index = __nccwpck_require__(90802); -var _index2 = __nccwpck_require__(53622); - -/** - * The {@link setWeek} function options. - */ - -/** - * @name setWeek - * @category Week Helpers - * @summary Set the local week to the given date. - * - * @description - * Set the local week to the given date, saving the weekday number. - * The exact calculation depends on the values of - * `options.weekStartsOn` (which is the index of the first day of the week) - * and `options.firstWeekContainsDate` (which is the day of January, which is always in - * the first week of the week-numbering year) - * - * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system - * - * @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). - * - * @param date - The date to be changed - * @param week - The week of the new date - * @param options - An object with options - * - * @returns The new date with the local week set - * - * @example - * // Set the 1st week to 2 January 2005 with default options: - * const result = setWeek(new Date(2005, 0, 2), 1) - * //=> Sun Dec 26 2004 00:00:00 - * - * @example - * // Set the 1st week to 2 January 2005, - * // if Monday is the first day of the week, - * // and the first week of the year always contains 4 January: - * const result = setWeek(new Date(2005, 0, 2), 1, { - * weekStartsOn: 1, - * firstWeekContainsDate: 4 - * }) - * //=> Sun Jan 4 2004 00:00:00 - */ -function setWeek(date, week, options) { - const _date = (0, _index2.toDate)(date); - const diff = (0, _index.getWeek)(_date, options) - week; - _date.setDate(_date.getDate() - diff * 7); - return _date; -} - - -/***/ }), - -/***/ 81651: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setWeekYear = setWeekYear; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(90338); -var _index3 = __nccwpck_require__(31348); -var _index4 = __nccwpck_require__(53622); - -var _index5 = __nccwpck_require__(42466); - -/** - * The {@link setWeekYear} function options. - */ - -/** - * @name setWeekYear - * @category Week-Numbering Year Helpers - * @summary Set the local week-numbering year to the given date. - * - * @description - * Set the local week-numbering year to the given date, - * saving the week number and the weekday number. - * The exact calculation depends on the values of - * `options.weekStartsOn` (which is the index of the first day of the week) - * and `options.firstWeekContainsDate` (which is the day of January, which is always in - * the first week of the week-numbering year) - * - * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system - * - * @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). - * - * @param date - The date to be changed - * @param weekYear - The local week-numbering year of the new date - * @param options - An object with options - * - * @returns The new date with the local week-numbering year set - * - * @example - * // Set the local week-numbering year 2004 to 2 January 2010 with default options: - * const result = setWeekYear(new Date(2010, 0, 2), 2004) - * //=> Sat Jan 03 2004 00:00:00 - * - * @example - * // Set the local week-numbering year 2004 to 2 January 2010, - * // if Monday is the first day of week - * // and 4 January is always in the first week of the year: - * const result = setWeekYear(new Date(2010, 0, 2), 2004, { - * weekStartsOn: 1, - * firstWeekContainsDate: 4 - * }) - * //=> Sat Jan 01 2005 00:00:00 - */ -function setWeekYear(date, weekYear, options) { - const defaultOptions = (0, _index5.getDefaultOptions)(); - const firstWeekContainsDate = - options?.firstWeekContainsDate ?? - options?.locale?.options?.firstWeekContainsDate ?? - defaultOptions.firstWeekContainsDate ?? - defaultOptions.locale?.options?.firstWeekContainsDate ?? - 1; - - let _date = (0, _index4.toDate)(date); - const diff = (0, _index2.differenceInCalendarDays)( - _date, - (0, _index3.startOfWeekYear)(_date, options), - ); - const firstWeek = (0, _index.constructFrom)(date, 0); - firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate); - firstWeek.setHours(0, 0, 0, 0); - _date = (0, _index3.startOfWeekYear)(firstWeek, options); - _date.setDate(_date.getDate() + diff); - return _date; -} - - -/***/ }), - -/***/ 94085: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.setYear = setYear; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(53622); - -/** - * @name setYear - * @category Year Helpers - * @summary Set the year to the given date. - * - * @description - * Set the year to the given date. - * - * @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). - * - * @param date - The date to be changed - * @param year - The year of the new date - * - * @returns The new date with the year set - * - * @example - * // Set year 2013 to 1 September 2014: - * const result = setYear(new Date(2014, 8, 1), 2013) - * //=> Sun Sep 01 2013 00:00:00 - */ -function setYear(date, year) { - const _date = (0, _index2.toDate)(date); - - // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date - if (isNaN(+_date)) { - return (0, _index.constructFrom)(date, NaN); - } - - _date.setFullYear(year); - return _date; -} - - -/***/ }), - -/***/ 91310: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfDay = startOfDay; -var _index = __nccwpck_require__(53622); - -/** - * @name startOfDay - * @category Day Helpers - * @summary Return the start of a day for the given date. - * - * @description - * Return the start of a day for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The start of a day - * - * @example - * // The start of a day for 2 September 2014 11:55:00: - * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 02 2014 00:00:00 - */ -function startOfDay(date) { - const _date = (0, _index.toDate)(date); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 87407: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfDecade = startOfDecade; -var _index = __nccwpck_require__(53622); - -/** - * @name startOfDecade - * @category Decade Helpers - * @summary Return the start of a decade for the given date. - * - * @description - * Return the start of a decade for the given date. - * - * @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). - * - * @param date - The original date - * - * @returns The start of a decade - * - * @example - * // The start of a decade for 21 October 2015 00:00:00: - * const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00)) - * //=> Jan 01 2010 00:00:00 - */ -function startOfDecade(date) { - // TODO: Switch to more technical definition in of decades that start with 1 - // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking - // change, so it can only be done in 4.0. - const _date = (0, _index.toDate)(date); - const year = _date.getFullYear(); - const decade = Math.floor(year / 10) * 10; - _date.setFullYear(decade, 0, 1); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 68079: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfHour = startOfHour; -var _index = __nccwpck_require__(53622); - -/** - * @name startOfHour - * @category Hour Helpers - * @summary Return the start of an hour for the given date. - * - * @description - * Return the start of an hour for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The start of an hour - * - * @example - * // The start of an hour for 2 September 2014 11:55:00: - * const result = startOfHour(new Date(2014, 8, 2, 11, 55)) - * //=> Tue Sep 02 2014 11:00:00 - */ -function startOfHour(date) { - const _date = (0, _index.toDate)(date); - _date.setMinutes(0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 69709: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfISOWeek = startOfISOWeek; -var _index = __nccwpck_require__(26068); - -/** - * @name startOfISOWeek - * @category ISO Week Helpers - * @summary Return the start of an ISO week for the given date. - * - * @description - * Return the start of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The original date - * - * @returns The start of an ISO week - * - * @example - * // The start of an ISO week for 2 September 2014 11:55:00: - * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Mon Sep 01 2014 00:00:00 - */ -function startOfISOWeek(date) { - return (0, _index.startOfWeek)(date, { weekStartsOn: 1 }); -} - - -/***/ }), - -/***/ 37809: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfISOWeekYear = startOfISOWeekYear; -var _index = __nccwpck_require__(90308); -var _index2 = __nccwpck_require__(69709); -var _index3 = __nccwpck_require__(92736); - -/** - * @name startOfISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Return the start of an ISO week-numbering year for the given date. - * - * @description - * Return the start of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The original date - * - * @returns The start of an ISO week-numbering year - * - * @example - * // The start of an ISO week-numbering year for 2 July 2005: - * const result = startOfISOWeekYear(new Date(2005, 6, 2)) - * //=> Mon Jan 03 2005 00:00:00 - */ -function startOfISOWeekYear(date) { - const year = (0, _index.getISOWeekYear)(date); - const fourthOfJanuary = (0, _index3.constructFrom)(date, 0); - fourthOfJanuary.setFullYear(year, 0, 4); - fourthOfJanuary.setHours(0, 0, 0, 0); - return (0, _index2.startOfISOWeek)(fourthOfJanuary); -} - - -/***/ }), - -/***/ 41831: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfMinute = startOfMinute; -var _index = __nccwpck_require__(53622); - -/** - * @name startOfMinute - * @category Minute Helpers - * @summary Return the start of a minute for the given date. - * - * @description - * Return the start of a minute for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The start of a minute - * - * @example - * // The start of a minute for 1 December 2014 22:15:45.400: - * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:00 - */ -function startOfMinute(date) { - const _date = (0, _index.toDate)(date); - _date.setSeconds(0, 0); - return _date; -} - - -/***/ }), - -/***/ 80050: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfMonth = startOfMonth; -var _index = __nccwpck_require__(53622); - -/** - * @name startOfMonth - * @category Month Helpers - * @summary Return the start of a month for the given date. - * - * @description - * Return the start of a month for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The start of a month - * - * @example - * // The start of a month for 2 September 2014 11:55:00: - * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Mon Sep 01 2014 00:00:00 - */ -function startOfMonth(date) { - const _date = (0, _index.toDate)(date); - _date.setDate(1); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 3148: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfQuarter = startOfQuarter; -var _index = __nccwpck_require__(53622); - -/** - * @name startOfQuarter - * @category Quarter Helpers - * @summary Return the start of a year quarter for the given date. - * - * @description - * Return the start of a year quarter for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The start of a quarter - * - * @example - * // The start of a quarter for 2 September 2014 11:55:00: - * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Jul 01 2014 00:00:00 - */ -function startOfQuarter(date) { - const _date = (0, _index.toDate)(date); - const currentMonth = _date.getMonth(); - const month = currentMonth - (currentMonth % 3); - _date.setMonth(month, 1); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 22991: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfSecond = startOfSecond; -var _index = __nccwpck_require__(53622); - -/** - * @name startOfSecond - * @category Second Helpers - * @summary Return the start of a second for the given date. - * - * @description - * Return the start of a second for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The start of a second - * - * @example - * // The start of a second for 1 December 2014 22:15:45.400: - * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:45.000 - */ -function startOfSecond(date) { - const _date = (0, _index.toDate)(date); - _date.setMilliseconds(0); - return _date; -} - - -/***/ }), - -/***/ 12361: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfToday = startOfToday; -var _index = __nccwpck_require__(91310); - -/** - * @name startOfToday - * @category Day Helpers - * @summary Return the start of today. - * @pure false - * - * @description - * Return the start of today. - * - * @returns The start of today - * - * @example - * // If today is 6 October 2014: - * const result = startOfToday() - * //=> Mon Oct 6 2014 00:00:00 - */ -function startOfToday() { - return (0, _index.startOfDay)(Date.now()); -} - - -/***/ }), - -/***/ 78227: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.startOfTomorrow = startOfTomorrow; /** - * @name startOfTomorrow - * @category Day Helpers - * @summary Return the start of tomorrow. - * @pure false - * - * @description - * Return the start of tomorrow. - * - * @returns The start of tomorrow - * - * @example - * // If today is 6 October 2014: - * const result = startOfTomorrow() - * //=> Tue Oct 7 2014 00:00:00 - */ -function startOfTomorrow() { - const now = new Date(); - const year = now.getFullYear(); - const month = now.getMonth(); - const day = now.getDate(); - - const date = new Date(0); - date.setFullYear(year, month, day + 1); - date.setHours(0, 0, 0, 0); - return date; -} - - -/***/ }), - -/***/ 26068: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfWeek = startOfWeek; -var _index = __nccwpck_require__(53622); - -var _index2 = __nccwpck_require__(42466); - -/** - * The {@link startOfWeek} function options. - */ - -/** - * @name startOfWeek - * @category Week Helpers - * @summary Return the start of a week for the given date. - * - * @description - * Return the start of a week for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * @param options - An object with options - * - * @returns The start of a week - * - * @example - * // The start of a week for 2 September 2014 11:55:00: - * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Aug 31 2014 00:00:00 - * - * @example - * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00: - * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) - * //=> Mon Sep 01 2014 00:00:00 - */ -function startOfWeek(date, options) { - const defaultOptions = (0, _index2.getDefaultOptions)(); - const weekStartsOn = - options?.weekStartsOn ?? - options?.locale?.options?.weekStartsOn ?? - defaultOptions.weekStartsOn ?? - defaultOptions.locale?.options?.weekStartsOn ?? - 0; - - const _date = (0, _index.toDate)(date); - const day = _date.getDay(); - const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - - _date.setDate(_date.getDate() - diff); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 31348: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfWeekYear = startOfWeekYear; -var _index = __nccwpck_require__(92736); -var _index2 = __nccwpck_require__(87669); -var _index3 = __nccwpck_require__(26068); - -var _index4 = __nccwpck_require__(42466); - -/** - * The {@link startOfWeekYear} function options. - */ - -/** - * @name startOfWeekYear - * @category Week-Numbering Year Helpers - * @summary Return the start of a local week-numbering year for the given date. - * - * @description - * Return the start of a local week-numbering year. - * The exact calculation depends on the values of - * `options.weekStartsOn` (which is the index of the first day of the week) - * and `options.firstWeekContainsDate` (which is the day of January, which is always in - * the first week of the week-numbering year) - * - * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system - * - * @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). - * - * @param date - The original date - * @param options - An object with options - * - * @returns The start of a week-numbering year - * - * @example - * // The start of an a week-numbering year for 2 July 2005 with default settings: - * const result = startOfWeekYear(new Date(2005, 6, 2)) - * //=> Sun Dec 26 2004 00:00:00 - * - * @example - * // The start of a week-numbering year for 2 July 2005 - * // if Monday is the first day of week - * // and 4 January is always in the first week of the year: - * const result = startOfWeekYear(new Date(2005, 6, 2), { - * weekStartsOn: 1, - * firstWeekContainsDate: 4 - * }) - * //=> Mon Jan 03 2005 00:00:00 - */ -function startOfWeekYear(date, options) { - const defaultOptions = (0, _index4.getDefaultOptions)(); - const firstWeekContainsDate = - options?.firstWeekContainsDate ?? - options?.locale?.options?.firstWeekContainsDate ?? - defaultOptions.firstWeekContainsDate ?? - defaultOptions.locale?.options?.firstWeekContainsDate ?? - 1; - - const year = (0, _index2.getWeekYear)(date, options); - const firstWeek = (0, _index.constructFrom)(date, 0); - firstWeek.setFullYear(year, 0, firstWeekContainsDate); - firstWeek.setHours(0, 0, 0, 0); - const _date = (0, _index3.startOfWeek)(firstWeek, options); - return _date; -} - - -/***/ }), - -/***/ 63304: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.startOfYear = startOfYear; -var _index = __nccwpck_require__(53622); -var _index2 = __nccwpck_require__(92736); - -/** - * @name startOfYear - * @category Year Helpers - * @summary Return the start of a year for the given date. - * - * @description - * Return the start of a year for the given date. - * The result will be in the local timezone. - * - * @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). - * - * @param date - The original date - * - * @returns The start of a year - * - * @example - * // The start of a year for 2 September 2014 11:55:00: - * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Jan 01 2014 00:00:00 - */ -function startOfYear(date) { - const cleanDate = (0, _index.toDate)(date); - const _date = (0, _index2.constructFrom)(date, 0); - _date.setFullYear(cleanDate.getFullYear(), 0, 1); - _date.setHours(0, 0, 0, 0); - return _date; -} - - -/***/ }), - -/***/ 32600: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.startOfYesterday = startOfYesterday; /** - * @name startOfYesterday - * @category Day Helpers - * @summary Return the start of yesterday. - * @pure false - * - * @description - * Return the start of yesterday. - * - * @returns The start of yesterday - * - * @example - * // If today is 6 October 2014: - * const result = startOfYesterday() - * //=> Sun Oct 5 2014 00:00:00 - */ -function startOfYesterday() { - const now = new Date(); - const year = now.getFullYear(); - const month = now.getMonth(); - const day = now.getDate(); - - const date = new Date(0); - date.setFullYear(year, month, day - 1); - date.setHours(0, 0, 0, 0); - return date; -} - - -/***/ }), - -/***/ 67264: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.sub = sub; -var _index = __nccwpck_require__(19771); -var _index2 = __nccwpck_require__(58682); - -var _index3 = __nccwpck_require__(92736); - -/** - * @name sub - * @category Common Helpers - * @summary Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. - * - * @description - * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be subtracted - * - * | Key | Description | - * |---------|------------------------------------| - * | years | Amount of years to be subtracted | - * | months | Amount of months to be subtracted | - * | weeks | Amount of weeks to be subtracted | - * | days | Amount of days to be subtracted | - * | hours | Amount of hours to be subtracted | - * | minutes | Amount of minutes to be subtracted | - * | seconds | Amount of seconds to be subtracted | - * - * All values default to 0 - * - * @returns The new date with the seconds subtracted - * - * @example - * // Subtract the following duration from 15 June 2017 15:29:20 - * const result = sub(new Date(2017, 5, 15, 15, 29, 20), { - * years: 2, - * months: 9, - * weeks: 1, - * days: 7, - * hours: 5, - * minutes: 9, - * seconds: 30 - * }) - * //=> Mon Sep 1 2014 10:19:50 - */ -function sub(date, duration) { - const { - years = 0, - months = 0, - weeks = 0, - days = 0, - hours = 0, - minutes = 0, - seconds = 0, - } = duration; - - // Subtract years and months - const dateWithoutMonths = (0, _index2.subMonths)(date, months + years * 12); - - // Subtract weeks and days - const dateWithoutDays = (0, _index.subDays)( - dateWithoutMonths, - days + weeks * 7, - ); - - // Subtract hours, minutes and seconds - const minutestoSub = minutes + hours * 60; - const secondstoSub = seconds + minutestoSub * 60; - const mstoSub = secondstoSub * 1000; - const finalDate = (0, _index3.constructFrom)( - date, - dateWithoutDays.getTime() - mstoSub, - ); - - return finalDate; -} - - -/***/ }), - -/***/ 19271: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subBusinessDays = subBusinessDays; -var _index = __nccwpck_require__(11060); - -/** - * @name subBusinessDays - * @category Day Helpers - * @summary Substract the specified number of business days (mon - fri) to the given date. - * - * @description - * Substract the specified number of business days (mon - fri) to the given date, ignoring weekends. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of business days to be subtracted. - * - * @returns The new date with the business days subtracted - * - * @example - * // Substract 10 business days from 1 September 2014: - * const result = subBusinessDays(new Date(2014, 8, 1), 10) - * //=> Mon Aug 18 2014 00:00:00 (skipped weekend days) - */ -function subBusinessDays(date, amount) { - return (0, _index.addBusinessDays)(date, -amount); -} - - -/***/ }), - -/***/ 19771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subDays = subDays; -var _index = __nccwpck_require__(8361); - -/** - * @name subDays - * @category Day Helpers - * @summary Subtract the specified number of days from the given date. - * - * @description - * Subtract the specified number of days from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of days to be subtracted. - * - * @returns The new date with the days subtracted - * - * @example - * // Subtract 10 days from 1 September 2014: - * const result = subDays(new Date(2014, 8, 1), 10) - * //=> Fri Aug 22 2014 00:00:00 - */ -function subDays(date, amount) { - return (0, _index.addDays)(date, -amount); -} - - -/***/ }), - -/***/ 52505: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subHours = subHours; -var _index = __nccwpck_require__(89994); - -/** - * @name subHours - * @category Hour Helpers - * @summary Subtract the specified number of hours from the given date. - * - * @description - * Subtract the specified number of hours from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of hours to be subtracted. - * - * @returns The new date with the hours subtracted - * - * @example - * // Subtract 2 hours from 11 July 2014 01:00:00: - * const result = subHours(new Date(2014, 6, 11, 1, 0), 2) - * //=> Thu Jul 10 2014 23:00:00 - */ -function subHours(date, amount) { - return (0, _index.addHours)(date, -amount); -} - - -/***/ }), - -/***/ 34118: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subISOWeekYears = subISOWeekYears; -var _index = __nccwpck_require__(89209); - -/** - * @name subISOWeekYears - * @category ISO Week-Numbering Year Helpers - * @summary Subtract the specified number of ISO week-numbering years from the given date. - * - * @description - * Subtract the specified number of ISO week-numbering years from the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of ISO week-numbering years to be subtracted. - * - * @returns The new date with the ISO week-numbering years subtracted - * - * @example - * // Subtract 5 ISO week-numbering years from 1 September 2014: - * const result = subISOWeekYears(new Date(2014, 8, 1), 5) - * //=> Mon Aug 31 2009 00:00:00 - */ -function subISOWeekYears(date, amount) { - return (0, _index.addISOWeekYears)(date, -amount); -} - - -/***/ }), - -/***/ 79473: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subMilliseconds = subMilliseconds; -var _index = __nccwpck_require__(28671); - -/** - * @name subMilliseconds - * @category Millisecond Helpers - * @summary Subtract the specified number of milliseconds from the given date. - * - * @description - * Subtract the specified number of milliseconds from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of milliseconds to be subtracted. - * - * @returns The new date with the milliseconds subtracted - * - * @example - * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000: - * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) - * //=> Thu Jul 10 2014 12:45:29.250 - */ -function subMilliseconds(date, amount) { - return (0, _index.addMilliseconds)(date, -amount); -} - - -/***/ }), - -/***/ 78137: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subMinutes = subMinutes; -var _index = __nccwpck_require__(97231); - -/** - * @name subMinutes - * @category Minute Helpers - * @summary Subtract the specified number of minutes from the given date. - * - * @description - * Subtract the specified number of minutes from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of minutes to be subtracted. - * - * @returns The new date with the minutes subtracted - * - * @example - * // Subtract 30 minutes from 10 July 2014 12:00:00: - * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) - * //=> Thu Jul 10 2014 11:30:00 - */ -function subMinutes(date, amount) { - return (0, _index.addMinutes)(date, -amount); -} - - -/***/ }), - -/***/ 58682: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subMonths = subMonths; -var _index = __nccwpck_require__(84119); - -/** - * @name subMonths - * @category Month Helpers - * @summary Subtract the specified number of months from the given date. - * - * @description - * Subtract the specified number of months from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of months to be subtracted. - * - * @returns The new date with the months subtracted - * - * @example - * // Subtract 5 months from 1 February 2015: - * const result = subMonths(new Date(2015, 1, 1), 5) - * //=> Mon Sep 01 2014 00:00:00 - */ -function subMonths(date, amount) { - return (0, _index.addMonths)(date, -amount); -} - - -/***/ }), - -/***/ 2535: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subQuarters = subQuarters; -var _index = __nccwpck_require__(17153); - -/** - * @name subQuarters - * @category Quarter Helpers - * @summary Subtract the specified number of year quarters from the given date. - * - * @description - * Subtract the specified number of year quarters from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of quarters to be subtracted. - * - * @returns The new date with the quarters subtracted - * - * @example - * // Subtract 3 quarters from 1 September 2014: - * const result = subQuarters(new Date(2014, 8, 1), 3) - * //=> Sun Dec 01 2013 00:00:00 - */ -function subQuarters(date, amount) { - return (0, _index.addQuarters)(date, -amount); -} - - -/***/ }), - -/***/ 24796: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subSeconds = subSeconds; -var _index = __nccwpck_require__(63378); - -/** - * @name subSeconds - * @category Second Helpers - * @summary Subtract the specified number of seconds from the given date. - * - * @description - * Subtract the specified number of seconds from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of seconds to be subtracted. - * - * @returns The new date with the seconds subtracted - * - * @example - * // Subtract 30 seconds from 10 July 2014 12:45:00: - * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) - * //=> Thu Jul 10 2014 12:44:30 - */ -function subSeconds(date, amount) { - return (0, _index.addSeconds)(date, -amount); -} - - -/***/ }), - -/***/ 49966: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subWeeks = subWeeks; -var _index = __nccwpck_require__(66985); - -/** - * @name subWeeks - * @category Week Helpers - * @summary Subtract the specified number of weeks from the given date. - * - * @description - * Subtract the specified number of weeks from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of weeks to be subtracted. - * - * @returns The new date with the weeks subtracted - * - * @example - * // Subtract 4 weeks from 1 September 2014: - * const result = subWeeks(new Date(2014, 8, 1), 4) - * //=> Mon Aug 04 2014 00:00:00 - */ -function subWeeks(date, amount) { - return (0, _index.addWeeks)(date, -amount); -} - - -/***/ }), - -/***/ 79442: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.subYears = subYears; -var _index = __nccwpck_require__(77204); - -/** - * @name subYears - * @category Year Helpers - * @summary Subtract the specified number of years from the given date. - * - * @description - * Subtract the specified number of years from the given date. - * - * @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). - * - * @param date - The date to be changed - * @param amount - The amount of years to be subtracted. - * - * @returns The new date with the years subtracted - * - * @example - * // Subtract 5 years from 1 September 2014: - * const result = subYears(new Date(2014, 8, 1), 5) - * //=> Tue Sep 01 2009 00:00:00 - */ -function subYears(date, amount) { - return (0, _index.addYears)(date, -amount); -} - - -/***/ }), - -/***/ 53622: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.toDate = toDate; - -/** - * @name toDate - * @category Common Helpers - * @summary Convert the given argument to an instance of Date. - * - * @description - * Convert the given argument to an instance of Date. - * - * If the argument is an instance of Date, the function returns its clone. - * - * If the argument is a number, it is treated as a timestamp. - * - * If the argument is none of the above, the function returns Invalid Date. - * - * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. - * - * @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). - * - * @param argument - The value to convert - * - * @returns The parsed date in the local time zone - * - * @example - * // Clone the date: - * const result = toDate(new Date(2014, 1, 11, 11, 30, 30)) - * //=> Tue Feb 11 2014 11:30:30 - * - * @example - * // Convert the timestamp to date: - * const result = toDate(1392098430000) - * //=> Tue Feb 11 2014 11:30:30 - */ -function toDate(argument) { - const argStr = Object.prototype.toString.call(argument); - - // Clone the date - if ( - argument instanceof Date || - (typeof argument === "object" && argStr === "[object Date]") - ) { - // Prevent the date to lose the milliseconds when passed to new Date() in IE10 - return new argument.constructor(+argument); - } else if ( - typeof argument === "number" || - argStr === "[object Number]" || - typeof argument === "string" || - argStr === "[object String]" - ) { - // TODO: Can we get rid of as? - return new Date(argument); - } else { - // TODO: Can we get rid of as? - return new Date(NaN); - } -} - - -/***/ }), - -/***/ 71881: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.transpose = transpose; -var _index = __nccwpck_require__(92736); - -/** - * @name transpose - * @category Generic Helpers - * @summary Transpose the date to the given constructor. - * - * @description - * The function transposes the date to the given constructor. It helps you - * to transpose the date in the system time zone to say `UTCDate` or any other - * date extension. - * - * @typeParam DateInputType - The input `Date` type derived from the passed argument. - * @typeParam DateOutputType - The output `Date` type derived from the passed constructor. - * - * @param fromDate - The date to use values from - * @param constructor - The date constructor to use - * - * @returns Date transposed to the given constructor - * - * @example - * // Create July 10, 2022 00:00 in locale time zone - * const date = new Date(2022, 6, 10) - * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)' - * - * @example - * // Transpose the date to July 10, 2022 00:00 in UTC - * transpose(date, UTCDate) - * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)' - */ -function transpose(fromDate, constructor) { - const date = - constructor instanceof Date - ? (0, _index.constructFrom)(constructor, 0) - : new constructor(0); - date.setFullYear( - fromDate.getFullYear(), - fromDate.getMonth(), - fromDate.getDate(), - ); - date.setHours( - fromDate.getHours(), - fromDate.getMinutes(), - fromDate.getSeconds(), - fromDate.getMilliseconds(), - ); - return date; -} - - -/***/ }), - -/***/ 1388: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.weeksToDays = weeksToDays; -var _index = __nccwpck_require__(17818); - -/** - * @name weeksToDays - * @category Conversion Helpers - * @summary Convert weeks to days. - * - * @description - * Convert a number of weeks to a full number of days. - * - * @param weeks - The number of weeks to be converted - * - * @returns The number of weeks converted in days - * - * @example - * // Convert 2 weeks into days - * const result = weeksToDays(2) - * //=> 14 - */ -function weeksToDays(weeks) { - return Math.trunc(weeks * _index.daysInWeek); -} - - -/***/ }), - -/***/ 84273: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.yearsToDays = yearsToDays; -var _index = __nccwpck_require__(17818); - -/** - * @name yearsToDays - * @category Conversion Helpers - * @summary Convert years to days. - * - * @description - * Convert a number of years to a full number of days. - * - * @param years - The number of years to be converted - * - * @returns The number of years converted in days - * - * @example - * // Convert 2 years into days - * const result = yearsToDays(2) - * //=> 730 - */ -function yearsToDays(years) { - return Math.trunc(years * _index.daysInYear); -} - - -/***/ }), - -/***/ 5556: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.yearsToMonths = yearsToMonths; -var _index = __nccwpck_require__(17818); - -/** - * @name yearsToMonths - * @category Conversion Helpers - * @summary Convert years to months. - * - * @description - * Convert a number of years to a full number of months. - * - * @param years - The number of years to be converted - * - * @returns The number of years converted in months - * - * @example - * // Convert 2 years into months - * const result = yearsToMonths(2) - * //=> 24 - */ -function yearsToMonths(years) { - return Math.trunc(years * _index.monthsInYear); -} - - -/***/ }), - -/***/ 84117: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.yearsToQuarters = yearsToQuarters; -var _index = __nccwpck_require__(17818); - -/** - * @name yearsToQuarters - * @category Conversion Helpers - * @summary Convert years to quarters. - * - * @description - * Convert a number of years to a full number of quarters. - * - * @param years - The number of years to be converted - * - * @returns The number of years converted in quarters - * - * @example - * // Convert 2 years to quarters - * const result = yearsToQuarters(2) - * //=> 8 - */ -function yearsToQuarters(years) { - return Math.trunc(years * _index.quartersInYear); -} - - -/***/ }), - -/***/ 28222: -/***/ ((module, exports, __nccwpck_require__) => { - -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = __nccwpck_require__(46243)(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; - - -/***/ }), - -/***/ 46243: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __nccwpck_require__(80900); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; - - -/***/ }), - -/***/ 38237: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ - -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __nccwpck_require__(28222); -} else { - module.exports = __nccwpck_require__(35332); -} - - -/***/ }), - -/***/ 35332: -/***/ ((module, exports, __nccwpck_require__) => { - -/** - * Module dependencies. - */ - -const tty = __nccwpck_require__(76224); -const util = __nccwpck_require__(73837); - -/** - * This is the Node.js implementation of `debug()`. - */ - -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __nccwpck_require__(59318); - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } - - obj[prop] = val; - return obj; -}, {}); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} - -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ - -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - -function init(debug) { - debug.inspectOpts = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = __nccwpck_require__(46243)(exports); - -const {formatters} = module.exports; - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; - -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; - - -/***/ }), - -/***/ 78848: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.compile = void 0; -const util_1 = __nccwpck_require__(73837); -const degenerator_1 = __nccwpck_require__(81484); -function compile(qjs, code, returnName, options = {}) { - const compiled = (0, degenerator_1.degenerator)(code, options.names ?? []); - const vm = qjs.newContext(); - // Add functions to global - if (options.sandbox) { - for (const [name, value] of Object.entries(options.sandbox)) { - if (typeof value !== 'function') { - throw new Error(`Expected a "function" for sandbox property \`${name}\`, but got "${typeof value}"`); - } - const fnHandle = vm.newFunction(name, (...args) => { - const result = value(...args.map((arg) => quickJSHandleToHost(vm, arg))); - vm.runtime.executePendingJobs(); - return hostToQuickJSHandle(vm, result); - }); - fnHandle.consume((handle) => vm.setProp(vm.global, name, handle)); - } - } - const fnResult = vm.evalCode(`${compiled};${returnName}`, options.filename); - const fn = vm.unwrapResult(fnResult); - const t = vm.typeof(fn); - if (t !== 'function') { - throw new Error(`Expected a "function" named \`${returnName}\` to be defined, but got "${t}"`); - } - const r = async function (...args) { - let promiseHandle; - let resolvedHandle; - try { - const result = vm.callFunction(fn, vm.undefined, ...args.map((arg) => hostToQuickJSHandle(vm, arg))); - promiseHandle = vm.unwrapResult(result); - const resolvedResultP = vm.resolvePromise(promiseHandle); - vm.runtime.executePendingJobs(); - const resolvedResult = await resolvedResultP; - resolvedHandle = vm.unwrapResult(resolvedResult); - return quickJSHandleToHost(vm, resolvedHandle); - } - catch (err) { - if (err && typeof err === 'object' && 'cause' in err && err.cause) { - if (typeof err.cause === 'object' && - 'stack' in err.cause && - 'name' in err.cause && - 'message' in err.cause && - typeof err.cause.stack === 'string' && - typeof err.cause.name === 'string' && - typeof err.cause.message === 'string') { - // QuickJS Error `stack` does not include the name + - // message, so patch those in to behave more like V8 - err.cause.stack = `${err.cause.name}: ${err.cause.message}\n${err.cause.stack}`; - } - throw err.cause; - } - throw err; - } - finally { - promiseHandle?.dispose(); - resolvedHandle?.dispose(); - } - }; - Object.defineProperty(r, 'toString', { - value: () => compiled, - enumerable: false, - }); - return r; -} -exports.compile = compile; -function quickJSHandleToHost(vm, val) { - return vm.dump(val); -} -function hostToQuickJSHandle(vm, val) { - if (typeof val === 'undefined') { - return vm.undefined; - } - else if (val === null) { - return vm.null; - } - else if (typeof val === 'string') { - return vm.newString(val); - } - else if (typeof val === 'number') { - return vm.newNumber(val); - } - else if (typeof val === 'bigint') { - return vm.newBigInt(val); - } - else if (typeof val === 'boolean') { - return val ? vm.true : vm.false; - } - else if (util_1.types.isPromise(val)) { - const promise = vm.newPromise(); - promise.settled.then(vm.runtime.executePendingJobs); - val.then((r) => { - promise.resolve(hostToQuickJSHandle(vm, r)); - }, (err) => { - promise.reject(hostToQuickJSHandle(vm, err)); - }); - return promise.handle; - } - else if (util_1.types.isNativeError(val)) { - return vm.newError(val); - } - throw new Error(`Unsupported value: ${val}`); -} -//# sourceMappingURL=compile.js.map - -/***/ }), - -/***/ 81484: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.degenerator = void 0; -const util_1 = __nccwpck_require__(73837); -const escodegen_1 = __nccwpck_require__(7991); -const esprima_1 = __nccwpck_require__(78823); -const ast_types_1 = __nccwpck_require__(27012); -/** - * Compiles sync JavaScript code into JavaScript with async Functions. - * - * @param {String} code JavaScript string to convert - * @param {Array} names Array of function names to add `await` operators to - * @return {String} Converted JavaScript string with async/await injected - * @api public - */ -function degenerator(code, _names) { - if (!Array.isArray(_names)) { - throw new TypeError('an array of async function "names" is required'); - } - // Duplicate the `names` array since it's rude to augment the user args - const names = _names.slice(0); - const ast = (0, esprima_1.parseScript)(code); - // First pass is to find the `function` nodes and turn them into async or - // generator functions only if their body includes `CallExpressions` to - // function in `names`. We also add the names of the functions to the `names` - // array. We'll iterate several time, as every iteration might add new items - // to the `names` array, until no new names were added in the iteration. - let lastNamesLength = 0; - do { - lastNamesLength = names.length; - (0, ast_types_1.visit)(ast, { - visitVariableDeclaration(path) { - if (path.node.declarations) { - for (let i = 0; i < path.node.declarations.length; i++) { - const declaration = path.node.declarations[i]; - if (ast_types_1.namedTypes.VariableDeclarator.check(declaration) && - ast_types_1.namedTypes.Identifier.check(declaration.init) && - ast_types_1.namedTypes.Identifier.check(declaration.id) && - checkName(declaration.init.name, names) && - !checkName(declaration.id.name, names)) { - names.push(declaration.id.name); - } - } - } - return false; - }, - visitAssignmentExpression(path) { - if (ast_types_1.namedTypes.Identifier.check(path.node.left) && - ast_types_1.namedTypes.Identifier.check(path.node.right) && - checkName(path.node.right.name, names) && - !checkName(path.node.left.name, names)) { - names.push(path.node.left.name); - } - return false; - }, - visitFunction(path) { - if (path.node.id) { - let shouldDegenerate = false; - (0, ast_types_1.visit)(path.node, { - visitCallExpression(path) { - if (checkNames(path.node, names)) { - shouldDegenerate = true; - } - return false; - }, - }); - if (!shouldDegenerate) { - return false; - } - // Got a "function" expression/statement, - // convert it into an async function - path.node.async = true; - // Add function name to `names` array - if (!checkName(path.node.id.name, names)) { - names.push(path.node.id.name); - } - } - this.traverse(path); - }, - }); - } while (lastNamesLength !== names.length); - // Second pass is for adding `await` statements to any function - // invocations that match the given `names` array. - (0, ast_types_1.visit)(ast, { - visitCallExpression(path) { - if (checkNames(path.node, names)) { - // A "function invocation" expression, - // we need to inject an `AwaitExpression` - const delegate = false; - const { name, parent: { node: pNode }, } = path; - const expr = ast_types_1.builders.awaitExpression(path.node, delegate); - if (ast_types_1.namedTypes.CallExpression.check(pNode)) { - pNode.arguments[name] = expr; - } - else { - pNode[name] = expr; - } - } - this.traverse(path); - }, - }); - return (0, escodegen_1.generate)(ast); -} -exports.degenerator = degenerator; -/** - * Returns `true` if `node` has a matching name to one of the entries in the - * `names` array. - * - * @param {types.Node} node - * @param {Array} names Array of function names to return true for - * @return {Boolean} - * @api private - */ -function checkNames({ callee }, names) { - let name; - if (ast_types_1.namedTypes.Identifier.check(callee)) { - name = callee.name; - } - else if (ast_types_1.namedTypes.MemberExpression.check(callee)) { - if (ast_types_1.namedTypes.Identifier.check(callee.object) && - ast_types_1.namedTypes.Identifier.check(callee.property)) { - name = `${callee.object.name}.${callee.property.name}`; - } - else { - return false; - } - } - else if (ast_types_1.namedTypes.FunctionExpression.check(callee)) { - if (callee.id) { - name = callee.id.name; - } - else { - return false; - } - } - else { - throw new Error(`Don't know how to get name for: ${callee.type}`); - } - return checkName(name, names); -} -function checkName(name, names) { - // now that we have the `name`, check if any entries match in the `names` array - for (let i = 0; i < names.length; i++) { - const n = names[i]; - if (util_1.types.isRegExp(n)) { - if (n.test(name)) { - return true; - } - } - else if (name === n) { - return true; - } - } - return false; -} -//# sourceMappingURL=degenerator.js.map - -/***/ }), - -/***/ 54545: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(81484), exports); -__exportStar(__nccwpck_require__(78848), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 58932: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = 'Deprecation'; - } - -} - -exports.Deprecation = Deprecation; - - -/***/ }), - -/***/ 7991: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2015 Ingvar Stepanyan - Copyright (C) 2014 Ivan Nikulin - Copyright (C) 2012-2013 Michael Ficarra - Copyright (C) 2012-2013 Mathias Bynens - Copyright (C) 2013 Irakli Gozalishvili - Copyright (C) 2012 Robert Gust-Bardon - Copyright (C) 2012 John Freeman - Copyright (C) 2011-2012 Ariya Hidayat - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Kris Kowal - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2020 Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*global exports:true, require:true, global:true*/ -(function () { - 'use strict'; - - var Syntax, - Precedence, - BinaryPrecedence, - SourceNode, - estraverse, - esutils, - base, - indent, - json, - renumber, - hexadecimal, - quotes, - escapeless, - newline, - space, - parentheses, - semicolons, - safeConcatenation, - directive, - extra, - parse, - sourceMap, - sourceCode, - preserveBlankLines, - FORMAT_MINIFY, - FORMAT_DEFAULTS; - - estraverse = __nccwpck_require__(23479); - esutils = __nccwpck_require__(94038); - - Syntax = estraverse.Syntax; - - // Generation is done by generateExpression. - function isExpression(node) { - return CodeGenerator.Expression.hasOwnProperty(node.type); - } - - // Generation is done by generateStatement. - function isStatement(node) { - return CodeGenerator.Statement.hasOwnProperty(node.type); - } - - Precedence = { - Sequence: 0, - Yield: 1, - Assignment: 1, - Conditional: 2, - ArrowFunction: 2, - Coalesce: 3, - LogicalOR: 4, - LogicalAND: 5, - BitwiseOR: 6, - BitwiseXOR: 7, - BitwiseAND: 8, - Equality: 9, - Relational: 10, - BitwiseSHIFT: 11, - Additive: 12, - Multiplicative: 13, - Exponentiation: 14, - Await: 15, - Unary: 15, - Postfix: 16, - OptionalChaining: 17, - Call: 18, - New: 19, - TaggedTemplate: 20, - Member: 21, - Primary: 22 - }; - - BinaryPrecedence = { - '??': Precedence.Coalesce, - '||': Precedence.LogicalOR, - '&&': Precedence.LogicalAND, - '|': Precedence.BitwiseOR, - '^': Precedence.BitwiseXOR, - '&': Precedence.BitwiseAND, - '==': Precedence.Equality, - '!=': Precedence.Equality, - '===': Precedence.Equality, - '!==': Precedence.Equality, - 'is': Precedence.Equality, - 'isnt': Precedence.Equality, - '<': Precedence.Relational, - '>': Precedence.Relational, - '<=': Precedence.Relational, - '>=': Precedence.Relational, - 'in': Precedence.Relational, - 'instanceof': Precedence.Relational, - '<<': Precedence.BitwiseSHIFT, - '>>': Precedence.BitwiseSHIFT, - '>>>': Precedence.BitwiseSHIFT, - '+': Precedence.Additive, - '-': Precedence.Additive, - '*': Precedence.Multiplicative, - '%': Precedence.Multiplicative, - '/': Precedence.Multiplicative, - '**': Precedence.Exponentiation - }; - - //Flags - var F_ALLOW_IN = 1, - F_ALLOW_CALL = 1 << 1, - F_ALLOW_UNPARATH_NEW = 1 << 2, - F_FUNC_BODY = 1 << 3, - F_DIRECTIVE_CTX = 1 << 4, - F_SEMICOLON_OPT = 1 << 5, - F_FOUND_COALESCE = 1 << 6; - - //Expression flag sets - //NOTE: Flag order: - // F_ALLOW_IN - // F_ALLOW_CALL - // F_ALLOW_UNPARATH_NEW - var E_FTT = F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, - E_TTF = F_ALLOW_IN | F_ALLOW_CALL, - E_TTT = F_ALLOW_IN | F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, - E_TFF = F_ALLOW_IN, - E_FFT = F_ALLOW_UNPARATH_NEW, - E_TFT = F_ALLOW_IN | F_ALLOW_UNPARATH_NEW; - - //Statement flag sets - //NOTE: Flag order: - // F_ALLOW_IN - // F_FUNC_BODY - // F_DIRECTIVE_CTX - // F_SEMICOLON_OPT - var S_TFFF = F_ALLOW_IN, - S_TFFT = F_ALLOW_IN | F_SEMICOLON_OPT, - S_FFFF = 0x00, - S_TFTF = F_ALLOW_IN | F_DIRECTIVE_CTX, - S_TTFF = F_ALLOW_IN | F_FUNC_BODY; - - function getDefaultOptions() { - // default options - return { - indent: null, - base: null, - parse: null, - comment: false, - format: { - indent: { - style: ' ', - base: 0, - adjustMultilineComment: false - }, - newline: '\n', - space: ' ', - json: false, - renumber: false, - hexadecimal: false, - quotes: 'single', - escapeless: false, - compact: false, - parentheses: true, - semicolons: true, - safeConcatenation: false, - preserveBlankLines: false - }, - moz: { - comprehensionExpressionStartsWithAssignment: false, - starlessGenerator: false - }, - sourceMap: null, - sourceMapRoot: null, - sourceMapWithCode: false, - directive: false, - raw: true, - verbatim: null, - sourceCode: null - }; - } - - function stringRepeat(str, num) { - var result = ''; - - for (num |= 0; num > 0; num >>>= 1, str += str) { - if (num & 1) { - result += str; - } - } - - return result; - } - - function hasLineTerminator(str) { - return (/[\r\n]/g).test(str); - } - - function endsWithLineTerminator(str) { - var len = str.length; - return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1)); - } - - function merge(target, override) { - var key; - for (key in override) { - if (override.hasOwnProperty(key)) { - target[key] = override[key]; - } - } - return target; - } - - function updateDeeply(target, override) { - var key, val; - - function isHashObject(target) { - return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp); - } - - for (key in override) { - if (override.hasOwnProperty(key)) { - val = override[key]; - if (isHashObject(val)) { - if (isHashObject(target[key])) { - updateDeeply(target[key], val); - } else { - target[key] = updateDeeply({}, val); - } - } else { - target[key] = val; - } - } - } - return target; - } - - function generateNumber(value) { - var result, point, temp, exponent, pos; - - if (value !== value) { - throw new Error('Numeric literal whose value is NaN'); - } - if (value < 0 || (value === 0 && 1 / value < 0)) { - throw new Error('Numeric literal whose value is negative'); - } - - if (value === 1 / 0) { - return json ? 'null' : renumber ? '1e400' : '1e+400'; - } - - result = '' + value; - if (!renumber || result.length < 3) { - return result; - } - - point = result.indexOf('.'); - if (!json && result.charCodeAt(0) === 0x30 /* 0 */ && point === 1) { - point = 0; - result = result.slice(1); - } - temp = result; - result = result.replace('e+', 'e'); - exponent = 0; - if ((pos = temp.indexOf('e')) > 0) { - exponent = +temp.slice(pos + 1); - temp = temp.slice(0, pos); - } - if (point >= 0) { - exponent -= temp.length - point - 1; - temp = +(temp.slice(0, point) + temp.slice(point + 1)) + ''; - } - pos = 0; - while (temp.charCodeAt(temp.length + pos - 1) === 0x30 /* 0 */) { - --pos; - } - if (pos !== 0) { - exponent -= pos; - temp = temp.slice(0, pos); - } - if (exponent !== 0) { - temp += 'e' + exponent; - } - if ((temp.length < result.length || - (hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = '0x' + value.toString(16)).length < result.length)) && - +temp === value) { - result = temp; - } - - return result; - } - - // Generate valid RegExp expression. - // This function is based on https://github.com/Constellation/iv Engine - - function escapeRegExpCharacter(ch, previousIsBackslash) { - // not handling '\' and handling \u2028 or \u2029 to unicode escape sequence - if ((ch & ~1) === 0x2028) { - return (previousIsBackslash ? 'u' : '\\u') + ((ch === 0x2028) ? '2028' : '2029'); - } else if (ch === 10 || ch === 13) { // \n, \r - return (previousIsBackslash ? '' : '\\') + ((ch === 10) ? 'n' : 'r'); - } - return String.fromCharCode(ch); - } - - function generateRegExp(reg) { - var match, result, flags, i, iz, ch, characterInBrack, previousIsBackslash; - - result = reg.toString(); - - if (reg.source) { - // extract flag from toString result - match = result.match(/\/([^/]*)$/); - if (!match) { - return result; - } - - flags = match[1]; - result = ''; - - characterInBrack = false; - previousIsBackslash = false; - for (i = 0, iz = reg.source.length; i < iz; ++i) { - ch = reg.source.charCodeAt(i); - - if (!previousIsBackslash) { - if (characterInBrack) { - if (ch === 93) { // ] - characterInBrack = false; - } - } else { - if (ch === 47) { // / - result += '\\'; - } else if (ch === 91) { // [ - characterInBrack = true; - } - } - result += escapeRegExpCharacter(ch, previousIsBackslash); - previousIsBackslash = ch === 92; // \ - } else { - // if new RegExp("\\\n') is provided, create /\n/ - result += escapeRegExpCharacter(ch, previousIsBackslash); - // prevent like /\\[/]/ - previousIsBackslash = false; - } - } - - return '/' + result + '/' + flags; - } - - return result; - } - - function escapeAllowedCharacter(code, next) { - var hex; - - if (code === 0x08 /* \b */) { - return '\\b'; - } - - if (code === 0x0C /* \f */) { - return '\\f'; - } - - if (code === 0x09 /* \t */) { - return '\\t'; - } - - hex = code.toString(16).toUpperCase(); - if (json || code > 0xFF) { - return '\\u' + '0000'.slice(hex.length) + hex; - } else if (code === 0x0000 && !esutils.code.isDecimalDigit(next)) { - return '\\0'; - } else if (code === 0x000B /* \v */) { // '\v' - return '\\x0B'; - } else { - return '\\x' + '00'.slice(hex.length) + hex; - } - } - - function escapeDisallowedCharacter(code) { - if (code === 0x5C /* \ */) { - return '\\\\'; - } - - if (code === 0x0A /* \n */) { - return '\\n'; - } - - if (code === 0x0D /* \r */) { - return '\\r'; - } - - if (code === 0x2028) { - return '\\u2028'; - } - - if (code === 0x2029) { - return '\\u2029'; - } - - throw new Error('Incorrectly classified character'); - } - - function escapeDirective(str) { - var i, iz, code, quote; - - quote = quotes === 'double' ? '"' : '\''; - for (i = 0, iz = str.length; i < iz; ++i) { - code = str.charCodeAt(i); - if (code === 0x27 /* ' */) { - quote = '"'; - break; - } else if (code === 0x22 /* " */) { - quote = '\''; - break; - } else if (code === 0x5C /* \ */) { - ++i; - } - } - - return quote + str + quote; - } - - function escapeString(str) { - var result = '', i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote; - - for (i = 0, len = str.length; i < len; ++i) { - code = str.charCodeAt(i); - if (code === 0x27 /* ' */) { - ++singleQuotes; - } else if (code === 0x22 /* " */) { - ++doubleQuotes; - } else if (code === 0x2F /* / */ && json) { - result += '\\'; - } else if (esutils.code.isLineTerminator(code) || code === 0x5C /* \ */) { - result += escapeDisallowedCharacter(code); - continue; - } else if (!esutils.code.isIdentifierPartES5(code) && (json && code < 0x20 /* SP */ || !json && !escapeless && (code < 0x20 /* SP */ || code > 0x7E /* ~ */))) { - result += escapeAllowedCharacter(code, str.charCodeAt(i + 1)); - continue; - } - result += String.fromCharCode(code); - } - - single = !(quotes === 'double' || (quotes === 'auto' && doubleQuotes < singleQuotes)); - quote = single ? '\'' : '"'; - - if (!(single ? singleQuotes : doubleQuotes)) { - return quote + result + quote; - } - - str = result; - result = quote; - - for (i = 0, len = str.length; i < len; ++i) { - code = str.charCodeAt(i); - if ((code === 0x27 /* ' */ && single) || (code === 0x22 /* " */ && !single)) { - result += '\\'; - } - result += String.fromCharCode(code); - } - - return result + quote; - } - - /** - * flatten an array to a string, where the array can contain - * either strings or nested arrays - */ - function flattenToString(arr) { - var i, iz, elem, result = ''; - for (i = 0, iz = arr.length; i < iz; ++i) { - elem = arr[i]; - result += Array.isArray(elem) ? flattenToString(elem) : elem; - } - return result; - } - - /** - * convert generated to a SourceNode when source maps are enabled. - */ - function toSourceNodeWhenNeeded(generated, node) { - if (!sourceMap) { - // with no source maps, generated is either an - // array or a string. if an array, flatten it. - // if a string, just return it - if (Array.isArray(generated)) { - return flattenToString(generated); - } else { - return generated; - } - } - if (node == null) { - if (generated instanceof SourceNode) { - return generated; - } else { - node = {}; - } - } - if (node.loc == null) { - return new SourceNode(null, null, sourceMap, generated, node.name || null); - } - return new SourceNode(node.loc.start.line, node.loc.start.column, (sourceMap === true ? node.loc.source || null : sourceMap), generated, node.name || null); - } - - function noEmptySpace() { - return (space) ? space : ' '; - } - - function join(left, right) { - var leftSource, - rightSource, - leftCharCode, - rightCharCode; - - leftSource = toSourceNodeWhenNeeded(left).toString(); - if (leftSource.length === 0) { - return [right]; - } - - rightSource = toSourceNodeWhenNeeded(right).toString(); - if (rightSource.length === 0) { - return [left]; - } - - leftCharCode = leftSource.charCodeAt(leftSource.length - 1); - rightCharCode = rightSource.charCodeAt(0); - - if ((leftCharCode === 0x2B /* + */ || leftCharCode === 0x2D /* - */) && leftCharCode === rightCharCode || - esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || - leftCharCode === 0x2F /* / */ && rightCharCode === 0x69 /* i */) { // infix word operators all start with `i` - return [left, noEmptySpace(), right]; - } else if (esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || - esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode)) { - return [left, right]; - } - return [left, space, right]; - } - - function addIndent(stmt) { - return [base, stmt]; - } - - function withIndent(fn) { - var previousBase; - previousBase = base; - base += indent; - fn(base); - base = previousBase; - } - - function calculateSpaces(str) { - var i; - for (i = str.length - 1; i >= 0; --i) { - if (esutils.code.isLineTerminator(str.charCodeAt(i))) { - break; - } - } - return (str.length - 1) - i; - } - - function adjustMultilineComment(value, specialBase) { - var array, i, len, line, j, spaces, previousBase, sn; - - array = value.split(/\r\n|[\r\n]/); - spaces = Number.MAX_VALUE; - - // first line doesn't have indentation - for (i = 1, len = array.length; i < len; ++i) { - line = array[i]; - j = 0; - while (j < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j))) { - ++j; - } - if (spaces > j) { - spaces = j; - } - } - - if (typeof specialBase !== 'undefined') { - // pattern like - // { - // var t = 20; /* - // * this is comment - // */ - // } - previousBase = base; - if (array[1][spaces] === '*') { - specialBase += ' '; - } - base = specialBase; - } else { - if (spaces & 1) { - // /* - // * - // */ - // If spaces are odd number, above pattern is considered. - // We waste 1 space. - --spaces; - } - previousBase = base; - } - - for (i = 1, len = array.length; i < len; ++i) { - sn = toSourceNodeWhenNeeded(addIndent(array[i].slice(spaces))); - array[i] = sourceMap ? sn.join('') : sn; - } - - base = previousBase; - - return array.join('\n'); - } - - function generateComment(comment, specialBase) { - if (comment.type === 'Line') { - if (endsWithLineTerminator(comment.value)) { - return '//' + comment.value; - } else { - // Always use LineTerminator - var result = '//' + comment.value; - if (!preserveBlankLines) { - result += '\n'; - } - return result; - } - } - if (extra.format.indent.adjustMultilineComment && /[\n\r]/.test(comment.value)) { - return adjustMultilineComment('/*' + comment.value + '*/', specialBase); - } - return '/*' + comment.value + '*/'; - } - - function addComments(stmt, result) { - var i, len, comment, save, tailingToStatement, specialBase, fragment, - extRange, range, prevRange, prefix, infix, suffix, count; - - if (stmt.leadingComments && stmt.leadingComments.length > 0) { - save = result; - - if (preserveBlankLines) { - comment = stmt.leadingComments[0]; - result = []; - - extRange = comment.extendedRange; - range = comment.range; - - prefix = sourceCode.substring(extRange[0], range[0]); - count = (prefix.match(/\n/g) || []).length; - if (count > 0) { - result.push(stringRepeat('\n', count)); - result.push(addIndent(generateComment(comment))); - } else { - result.push(prefix); - result.push(generateComment(comment)); - } - - prevRange = range; - - for (i = 1, len = stmt.leadingComments.length; i < len; i++) { - comment = stmt.leadingComments[i]; - range = comment.range; - - infix = sourceCode.substring(prevRange[1], range[0]); - count = (infix.match(/\n/g) || []).length; - result.push(stringRepeat('\n', count)); - result.push(addIndent(generateComment(comment))); - - prevRange = range; - } - - suffix = sourceCode.substring(range[1], extRange[1]); - count = (suffix.match(/\n/g) || []).length; - result.push(stringRepeat('\n', count)); - } else { - comment = stmt.leadingComments[0]; - result = []; - if (safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0) { - result.push('\n'); - } - result.push(generateComment(comment)); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push('\n'); - } - - for (i = 1, len = stmt.leadingComments.length; i < len; ++i) { - comment = stmt.leadingComments[i]; - fragment = [generateComment(comment)]; - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - fragment.push('\n'); - } - result.push(addIndent(fragment)); - } - } - - result.push(addIndent(save)); - } - - if (stmt.trailingComments) { - - if (preserveBlankLines) { - comment = stmt.trailingComments[0]; - extRange = comment.extendedRange; - range = comment.range; - - prefix = sourceCode.substring(extRange[0], range[0]); - count = (prefix.match(/\n/g) || []).length; - - if (count > 0) { - result.push(stringRepeat('\n', count)); - result.push(addIndent(generateComment(comment))); - } else { - result.push(prefix); - result.push(generateComment(comment)); - } - } else { - tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); - specialBase = stringRepeat(' ', calculateSpaces(toSourceNodeWhenNeeded([base, result, indent]).toString())); - for (i = 0, len = stmt.trailingComments.length; i < len; ++i) { - comment = stmt.trailingComments[i]; - if (tailingToStatement) { - // We assume target like following script - // - // var t = 20; /** - // * This is comment of t - // */ - if (i === 0) { - // first case - result = [result, indent]; - } else { - result = [result, specialBase]; - } - result.push(generateComment(comment, specialBase)); - } else { - result = [result, addIndent(generateComment(comment))]; - } - if (i !== len - 1 && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result = [result, '\n']; - } - } - } - } - - return result; - } - - function generateBlankLines(start, end, result) { - var j, newlineCount = 0; - - for (j = start; j < end; j++) { - if (sourceCode[j] === '\n') { - newlineCount++; - } - } - - for (j = 1; j < newlineCount; j++) { - result.push(newline); - } - } - - function parenthesize(text, current, should) { - if (current < should) { - return ['(', text, ')']; - } - return text; - } - - function generateVerbatimString(string) { - var i, iz, result; - result = string.split(/\r\n|\n/); - for (i = 1, iz = result.length; i < iz; i++) { - result[i] = newline + base + result[i]; - } - return result; - } - - function generateVerbatim(expr, precedence) { - var verbatim, result, prec; - verbatim = expr[extra.verbatim]; - - if (typeof verbatim === 'string') { - result = parenthesize(generateVerbatimString(verbatim), Precedence.Sequence, precedence); - } else { - // verbatim is object - result = generateVerbatimString(verbatim.content); - prec = (verbatim.precedence != null) ? verbatim.precedence : Precedence.Sequence; - result = parenthesize(result, prec, precedence); - } - - return toSourceNodeWhenNeeded(result, expr); - } - - function CodeGenerator() { - } - - // Helpers. - - CodeGenerator.prototype.maybeBlock = function(stmt, flags) { - var result, noLeadingComment, that = this; - - noLeadingComment = !extra.comment || !stmt.leadingComments; - - if (stmt.type === Syntax.BlockStatement && noLeadingComment) { - return [space, this.generateStatement(stmt, flags)]; - } - - if (stmt.type === Syntax.EmptyStatement && noLeadingComment) { - return ';'; - } - - withIndent(function () { - result = [ - newline, - addIndent(that.generateStatement(stmt, flags)) - ]; - }); - - return result; - }; - - CodeGenerator.prototype.maybeBlockSuffix = function (stmt, result) { - var ends = endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); - if (stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends) { - return [result, space]; - } - if (ends) { - return [result, base]; - } - return [result, newline, base]; - }; - - function generateIdentifier(node) { - return toSourceNodeWhenNeeded(node.name, node); - } - - function generateAsyncPrefix(node, spaceRequired) { - return node.async ? 'async' + (spaceRequired ? noEmptySpace() : space) : ''; - } - - function generateStarSuffix(node) { - var isGenerator = node.generator && !extra.moz.starlessGenerator; - return isGenerator ? '*' + space : ''; - } - - function generateMethodPrefix(prop) { - var func = prop.value, prefix = ''; - if (func.async) { - prefix += generateAsyncPrefix(func, !prop.computed); - } - if (func.generator) { - // avoid space before method name - prefix += generateStarSuffix(func) ? '*' : ''; - } - return prefix; - } - - CodeGenerator.prototype.generatePattern = function (node, precedence, flags) { - if (node.type === Syntax.Identifier) { - return generateIdentifier(node); - } - return this.generateExpression(node, precedence, flags); - }; - - CodeGenerator.prototype.generateFunctionParams = function (node) { - var i, iz, result, hasDefault; - - hasDefault = false; - - if (node.type === Syntax.ArrowFunctionExpression && - !node.rest && (!node.defaults || node.defaults.length === 0) && - node.params.length === 1 && node.params[0].type === Syntax.Identifier) { - // arg => { } case - result = [generateAsyncPrefix(node, true), generateIdentifier(node.params[0])]; - } else { - result = node.type === Syntax.ArrowFunctionExpression ? [generateAsyncPrefix(node, false)] : []; - result.push('('); - if (node.defaults) { - hasDefault = true; - } - for (i = 0, iz = node.params.length; i < iz; ++i) { - if (hasDefault && node.defaults[i]) { - // Handle default values. - result.push(this.generateAssignment(node.params[i], node.defaults[i], '=', Precedence.Assignment, E_TTT)); - } else { - result.push(this.generatePattern(node.params[i], Precedence.Assignment, E_TTT)); - } - if (i + 1 < iz) { - result.push(',' + space); - } - } - - if (node.rest) { - if (node.params.length) { - result.push(',' + space); - } - result.push('...'); - result.push(generateIdentifier(node.rest)); - } - - result.push(')'); - } - - return result; - }; - - CodeGenerator.prototype.generateFunctionBody = function (node) { - var result, expr; - - result = this.generateFunctionParams(node); - - if (node.type === Syntax.ArrowFunctionExpression) { - result.push(space); - result.push('=>'); - } - - if (node.expression) { - result.push(space); - expr = this.generateExpression(node.body, Precedence.Assignment, E_TTT); - if (expr.toString().charAt(0) === '{') { - expr = ['(', expr, ')']; - } - result.push(expr); - } else { - result.push(this.maybeBlock(node.body, S_TTFF)); - } - - return result; - }; - - CodeGenerator.prototype.generateIterationForStatement = function (operator, stmt, flags) { - var result = ['for' + (stmt.await ? noEmptySpace() + 'await' : '') + space + '('], that = this; - withIndent(function () { - if (stmt.left.type === Syntax.VariableDeclaration) { - withIndent(function () { - result.push(stmt.left.kind + noEmptySpace()); - result.push(that.generateStatement(stmt.left.declarations[0], S_FFFF)); - }); - } else { - result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT)); - } - - result = join(result, operator); - result = [join( - result, - that.generateExpression(stmt.right, Precedence.Assignment, E_TTT) - ), ')']; - }); - result.push(this.maybeBlock(stmt.body, flags)); - return result; - }; - - CodeGenerator.prototype.generatePropertyKey = function (expr, computed) { - var result = []; - - if (computed) { - result.push('['); - } - - result.push(this.generateExpression(expr, Precedence.Assignment, E_TTT)); - - if (computed) { - result.push(']'); - } - - return result; - }; - - CodeGenerator.prototype.generateAssignment = function (left, right, operator, precedence, flags) { - if (Precedence.Assignment < precedence) { - flags |= F_ALLOW_IN; - } - - return parenthesize( - [ - this.generateExpression(left, Precedence.Call, flags), - space + operator + space, - this.generateExpression(right, Precedence.Assignment, flags) - ], - Precedence.Assignment, - precedence - ); - }; - - CodeGenerator.prototype.semicolon = function (flags) { - if (!semicolons && flags & F_SEMICOLON_OPT) { - return ''; - } - return ';'; - }; - - // Statements. - - CodeGenerator.Statement = { - - BlockStatement: function (stmt, flags) { - var range, content, result = ['{', newline], that = this; - - withIndent(function () { - // handle functions without any code - if (stmt.body.length === 0 && preserveBlankLines) { - range = stmt.range; - if (range[1] - range[0] > 2) { - content = sourceCode.substring(range[0] + 1, range[1] - 1); - if (content[0] === '\n') { - result = ['{']; - } - result.push(content); - } - } - - var i, iz, fragment, bodyFlags; - bodyFlags = S_TFFF; - if (flags & F_FUNC_BODY) { - bodyFlags |= F_DIRECTIVE_CTX; - } - - for (i = 0, iz = stmt.body.length; i < iz; ++i) { - if (preserveBlankLines) { - // handle spaces before the first line - if (i === 0) { - if (stmt.body[0].leadingComments) { - range = stmt.body[0].leadingComments[0].extendedRange; - content = sourceCode.substring(range[0], range[1]); - if (content[0] === '\n') { - result = ['{']; - } - } - if (!stmt.body[0].leadingComments) { - generateBlankLines(stmt.range[0], stmt.body[0].range[0], result); - } - } - - // handle spaces between lines - if (i > 0) { - if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) { - generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result); - } - } - } - - if (i === iz - 1) { - bodyFlags |= F_SEMICOLON_OPT; - } - - if (stmt.body[i].leadingComments && preserveBlankLines) { - fragment = that.generateStatement(stmt.body[i], bodyFlags); - } else { - fragment = addIndent(that.generateStatement(stmt.body[i], bodyFlags)); - } - - result.push(fragment); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - if (preserveBlankLines && i < iz - 1) { - // don't add a new line if there are leading coments - // in the next statement - if (!stmt.body[i + 1].leadingComments) { - result.push(newline); - } - } else { - result.push(newline); - } - } - - if (preserveBlankLines) { - // handle spaces after the last line - if (i === iz - 1) { - if (!stmt.body[i].trailingComments) { - generateBlankLines(stmt.body[i].range[1], stmt.range[1], result); - } - } - } - } - }); - - result.push(addIndent('}')); - return result; - }, - - BreakStatement: function (stmt, flags) { - if (stmt.label) { - return 'break ' + stmt.label.name + this.semicolon(flags); - } - return 'break' + this.semicolon(flags); - }, - - ContinueStatement: function (stmt, flags) { - if (stmt.label) { - return 'continue ' + stmt.label.name + this.semicolon(flags); - } - return 'continue' + this.semicolon(flags); - }, - - ClassBody: function (stmt, flags) { - var result = [ '{', newline], that = this; - - withIndent(function (indent) { - var i, iz; - - for (i = 0, iz = stmt.body.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(stmt.body[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(newline); - } - } - }); - - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base); - result.push('}'); - return result; - }, - - ClassDeclaration: function (stmt, flags) { - var result, fragment; - result = ['class']; - if (stmt.id) { - result = join(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT)); - } - if (stmt.superClass) { - fragment = join('extends', this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT)); - result = join(result, fragment); - } - result.push(space); - result.push(this.generateStatement(stmt.body, S_TFFT)); - return result; - }, - - DirectiveStatement: function (stmt, flags) { - if (extra.raw && stmt.raw) { - return stmt.raw + this.semicolon(flags); - } - return escapeDirective(stmt.directive) + this.semicolon(flags); - }, - - DoWhileStatement: function (stmt, flags) { - // Because `do 42 while (cond)` is Syntax Error. We need semicolon. - var result = join('do', this.maybeBlock(stmt.body, S_TFFF)); - result = this.maybeBlockSuffix(stmt.body, result); - return join(result, [ - 'while' + space + '(', - this.generateExpression(stmt.test, Precedence.Sequence, E_TTT), - ')' + this.semicolon(flags) - ]); - }, - - CatchClause: function (stmt, flags) { - var result, that = this; - withIndent(function () { - var guard; - - if (stmt.param) { - result = [ - 'catch' + space + '(', - that.generateExpression(stmt.param, Precedence.Sequence, E_TTT), - ')' - ]; - - if (stmt.guard) { - guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT); - result.splice(2, 0, ' if ', guard); - } - } else { - result = ['catch']; - } - }); - result.push(this.maybeBlock(stmt.body, S_TFFF)); - return result; - }, - - DebuggerStatement: function (stmt, flags) { - return 'debugger' + this.semicolon(flags); - }, - - EmptyStatement: function (stmt, flags) { - return ';'; - }, - - ExportDefaultDeclaration: function (stmt, flags) { - var result = [ 'export' ], bodyFlags; - - bodyFlags = (flags & F_SEMICOLON_OPT) ? S_TFFT : S_TFFF; - - // export default HoistableDeclaration[Default] - // export default AssignmentExpression[In] ; - result = join(result, 'default'); - if (isStatement(stmt.declaration)) { - result = join(result, this.generateStatement(stmt.declaration, bodyFlags)); - } else { - result = join(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags)); - } - return result; - }, - - ExportNamedDeclaration: function (stmt, flags) { - var result = [ 'export' ], bodyFlags, that = this; - - bodyFlags = (flags & F_SEMICOLON_OPT) ? S_TFFT : S_TFFF; - - // export VariableStatement - // export Declaration[Default] - if (stmt.declaration) { - return join(result, this.generateStatement(stmt.declaration, bodyFlags)); - } - - // export ExportClause[NoReference] FromClause ; - // export ExportClause ; - if (stmt.specifiers) { - if (stmt.specifiers.length === 0) { - result = join(result, '{' + space + '}'); - } else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) { - result = join(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT)); - } else { - result = join(result, '{'); - withIndent(function (indent) { - var i, iz; - result.push(newline); - for (i = 0, iz = stmt.specifiers.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + newline); - } - } - }); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base + '}'); - } - - if (stmt.source) { - result = join(result, [ - 'from' + space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]); - } else { - result.push(this.semicolon(flags)); - } - } - return result; - }, - - ExportAllDeclaration: function (stmt, flags) { - // export * FromClause ; - return [ - 'export' + space, - '*' + space, - 'from' + space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]; - }, - - ExpressionStatement: function (stmt, flags) { - var result, fragment; - - function isClassPrefixed(fragment) { - var code; - if (fragment.slice(0, 5) !== 'class') { - return false; - } - code = fragment.charCodeAt(5); - return code === 0x7B /* '{' */ || esutils.code.isWhiteSpace(code) || esutils.code.isLineTerminator(code); - } - - function isFunctionPrefixed(fragment) { - var code; - if (fragment.slice(0, 8) !== 'function') { - return false; - } - code = fragment.charCodeAt(8); - return code === 0x28 /* '(' */ || esutils.code.isWhiteSpace(code) || code === 0x2A /* '*' */ || esutils.code.isLineTerminator(code); - } - - function isAsyncPrefixed(fragment) { - var code, i, iz; - if (fragment.slice(0, 5) !== 'async') { - return false; - } - if (!esutils.code.isWhiteSpace(fragment.charCodeAt(5))) { - return false; - } - for (i = 6, iz = fragment.length; i < iz; ++i) { - if (!esutils.code.isWhiteSpace(fragment.charCodeAt(i))) { - break; - } - } - if (i === iz) { - return false; - } - if (fragment.slice(i, i + 8) !== 'function') { - return false; - } - code = fragment.charCodeAt(i + 8); - return code === 0x28 /* '(' */ || esutils.code.isWhiteSpace(code) || code === 0x2A /* '*' */ || esutils.code.isLineTerminator(code); - } - - result = [this.generateExpression(stmt.expression, Precedence.Sequence, E_TTT)]; - // 12.4 '{', 'function', 'class' is not allowed in this position. - // wrap expression with parentheses - fragment = toSourceNodeWhenNeeded(result).toString(); - if (fragment.charCodeAt(0) === 0x7B /* '{' */ || // ObjectExpression - isClassPrefixed(fragment) || - isFunctionPrefixed(fragment) || - isAsyncPrefixed(fragment) || - (directive && (flags & F_DIRECTIVE_CTX) && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === 'string')) { - result = ['(', result, ')' + this.semicolon(flags)]; - } else { - result.push(this.semicolon(flags)); - } - return result; - }, - - ImportDeclaration: function (stmt, flags) { - // ES6: 15.2.1 valid import declarations: - // - import ImportClause FromClause ; - // - import ModuleSpecifier ; - var result, cursor, that = this; - - // If no ImportClause is present, - // this should be `import ModuleSpecifier` so skip `from` - // ModuleSpecifier is StringLiteral. - if (stmt.specifiers.length === 0) { - // import ModuleSpecifier ; - return [ - 'import', - space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]; - } - - // import ImportClause FromClause ; - result = [ - 'import' - ]; - cursor = 0; - - // ImportedBinding - if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) { - result = join(result, [ - this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT) - ]); - ++cursor; - } - - if (stmt.specifiers[cursor]) { - if (cursor !== 0) { - result.push(','); - } - - if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) { - // NameSpaceImport - result = join(result, [ - space, - this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT) - ]); - } else { - // NamedImports - result.push(space + '{'); - - if ((stmt.specifiers.length - cursor) === 1) { - // import { ... } from "..."; - result.push(space); - result.push(this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)); - result.push(space + '}' + space); - } else { - // import { - // ..., - // ..., - // } from "..."; - withIndent(function (indent) { - var i, iz; - result.push(newline); - for (i = cursor, iz = stmt.specifiers.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + newline); - } - } - }); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base + '}' + space); - } - } - } - - result = join(result, [ - 'from' + space, - // ModuleSpecifier - this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), - this.semicolon(flags) - ]); - return result; - }, - - VariableDeclarator: function (stmt, flags) { - var itemFlags = (flags & F_ALLOW_IN) ? E_TTT : E_FTT; - if (stmt.init) { - return [ - this.generateExpression(stmt.id, Precedence.Assignment, itemFlags), - space, - '=', - space, - this.generateExpression(stmt.init, Precedence.Assignment, itemFlags) - ]; - } - return this.generatePattern(stmt.id, Precedence.Assignment, itemFlags); - }, - - VariableDeclaration: function (stmt, flags) { - // VariableDeclarator is typed as Statement, - // but joined with comma (not LineTerminator). - // So if comment is attached to target node, we should specialize. - var result, i, iz, node, bodyFlags, that = this; - - result = [ stmt.kind ]; - - bodyFlags = (flags & F_ALLOW_IN) ? S_TFFF : S_FFFF; - - function block() { - node = stmt.declarations[0]; - if (extra.comment && node.leadingComments) { - result.push('\n'); - result.push(addIndent(that.generateStatement(node, bodyFlags))); - } else { - result.push(noEmptySpace()); - result.push(that.generateStatement(node, bodyFlags)); - } - - for (i = 1, iz = stmt.declarations.length; i < iz; ++i) { - node = stmt.declarations[i]; - if (extra.comment && node.leadingComments) { - result.push(',' + newline); - result.push(addIndent(that.generateStatement(node, bodyFlags))); - } else { - result.push(',' + space); - result.push(that.generateStatement(node, bodyFlags)); - } - } - } - - if (stmt.declarations.length > 1) { - withIndent(block); - } else { - block(); - } - - result.push(this.semicolon(flags)); - - return result; - }, - - ThrowStatement: function (stmt, flags) { - return [join( - 'throw', - this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) - ), this.semicolon(flags)]; - }, - - TryStatement: function (stmt, flags) { - var result, i, iz, guardedHandlers; - - result = ['try', this.maybeBlock(stmt.block, S_TFFF)]; - result = this.maybeBlockSuffix(stmt.block, result); - - if (stmt.handlers) { - // old interface - for (i = 0, iz = stmt.handlers.length; i < iz; ++i) { - result = join(result, this.generateStatement(stmt.handlers[i], S_TFFF)); - if (stmt.finalizer || i + 1 !== iz) { - result = this.maybeBlockSuffix(stmt.handlers[i].body, result); - } - } - } else { - guardedHandlers = stmt.guardedHandlers || []; - - for (i = 0, iz = guardedHandlers.length; i < iz; ++i) { - result = join(result, this.generateStatement(guardedHandlers[i], S_TFFF)); - if (stmt.finalizer || i + 1 !== iz) { - result = this.maybeBlockSuffix(guardedHandlers[i].body, result); - } - } - - // new interface - if (stmt.handler) { - if (Array.isArray(stmt.handler)) { - for (i = 0, iz = stmt.handler.length; i < iz; ++i) { - result = join(result, this.generateStatement(stmt.handler[i], S_TFFF)); - if (stmt.finalizer || i + 1 !== iz) { - result = this.maybeBlockSuffix(stmt.handler[i].body, result); - } - } - } else { - result = join(result, this.generateStatement(stmt.handler, S_TFFF)); - if (stmt.finalizer) { - result = this.maybeBlockSuffix(stmt.handler.body, result); - } - } - } - } - if (stmt.finalizer) { - result = join(result, ['finally', this.maybeBlock(stmt.finalizer, S_TFFF)]); - } - return result; - }, - - SwitchStatement: function (stmt, flags) { - var result, fragment, i, iz, bodyFlags, that = this; - withIndent(function () { - result = [ - 'switch' + space + '(', - that.generateExpression(stmt.discriminant, Precedence.Sequence, E_TTT), - ')' + space + '{' + newline - ]; - }); - if (stmt.cases) { - bodyFlags = S_TFFF; - for (i = 0, iz = stmt.cases.length; i < iz; ++i) { - if (i === iz - 1) { - bodyFlags |= F_SEMICOLON_OPT; - } - fragment = addIndent(this.generateStatement(stmt.cases[i], bodyFlags)); - result.push(fragment); - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - result.push(newline); - } - } - } - result.push(addIndent('}')); - return result; - }, - - SwitchCase: function (stmt, flags) { - var result, fragment, i, iz, bodyFlags, that = this; - withIndent(function () { - if (stmt.test) { - result = [ - join('case', that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)), - ':' - ]; - } else { - result = ['default:']; - } - - i = 0; - iz = stmt.consequent.length; - if (iz && stmt.consequent[0].type === Syntax.BlockStatement) { - fragment = that.maybeBlock(stmt.consequent[0], S_TFFF); - result.push(fragment); - i = 1; - } - - if (i !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - - bodyFlags = S_TFFF; - for (; i < iz; ++i) { - if (i === iz - 1 && flags & F_SEMICOLON_OPT) { - bodyFlags |= F_SEMICOLON_OPT; - } - fragment = addIndent(that.generateStatement(stmt.consequent[i], bodyFlags)); - result.push(fragment); - if (i + 1 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - result.push(newline); - } - } - }); - return result; - }, - - IfStatement: function (stmt, flags) { - var result, bodyFlags, semicolonOptional, that = this; - withIndent(function () { - result = [ - 'if' + space + '(', - that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), - ')' - ]; - }); - semicolonOptional = flags & F_SEMICOLON_OPT; - bodyFlags = S_TFFF; - if (semicolonOptional) { - bodyFlags |= F_SEMICOLON_OPT; - } - if (stmt.alternate) { - result.push(this.maybeBlock(stmt.consequent, S_TFFF)); - result = this.maybeBlockSuffix(stmt.consequent, result); - if (stmt.alternate.type === Syntax.IfStatement) { - result = join(result, ['else ', this.generateStatement(stmt.alternate, bodyFlags)]); - } else { - result = join(result, join('else', this.maybeBlock(stmt.alternate, bodyFlags))); - } - } else { - result.push(this.maybeBlock(stmt.consequent, bodyFlags)); - } - return result; - }, - - ForStatement: function (stmt, flags) { - var result, that = this; - withIndent(function () { - result = ['for' + space + '(']; - if (stmt.init) { - if (stmt.init.type === Syntax.VariableDeclaration) { - result.push(that.generateStatement(stmt.init, S_FFFF)); - } else { - // F_ALLOW_IN becomes false. - result.push(that.generateExpression(stmt.init, Precedence.Sequence, E_FTT)); - result.push(';'); - } - } else { - result.push(';'); - } - - if (stmt.test) { - result.push(space); - result.push(that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)); - result.push(';'); - } else { - result.push(';'); - } - - if (stmt.update) { - result.push(space); - result.push(that.generateExpression(stmt.update, Precedence.Sequence, E_TTT)); - result.push(')'); - } else { - result.push(')'); - } - }); - - result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); - return result; - }, - - ForInStatement: function (stmt, flags) { - return this.generateIterationForStatement('in', stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); - }, - - ForOfStatement: function (stmt, flags) { - return this.generateIterationForStatement('of', stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); - }, - - LabeledStatement: function (stmt, flags) { - return [stmt.label.name + ':', this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)]; - }, - - Program: function (stmt, flags) { - var result, fragment, i, iz, bodyFlags; - iz = stmt.body.length; - result = [safeConcatenation && iz > 0 ? '\n' : '']; - bodyFlags = S_TFTF; - for (i = 0; i < iz; ++i) { - if (!safeConcatenation && i === iz - 1) { - bodyFlags |= F_SEMICOLON_OPT; - } - - if (preserveBlankLines) { - // handle spaces before the first line - if (i === 0) { - if (!stmt.body[0].leadingComments) { - generateBlankLines(stmt.range[0], stmt.body[i].range[0], result); - } - } - - // handle spaces between lines - if (i > 0) { - if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) { - generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result); - } - } - } - - fragment = addIndent(this.generateStatement(stmt.body[i], bodyFlags)); - result.push(fragment); - if (i + 1 < iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - if (preserveBlankLines) { - if (!stmt.body[i + 1].leadingComments) { - result.push(newline); - } - } else { - result.push(newline); - } - } - - if (preserveBlankLines) { - // handle spaces after the last line - if (i === iz - 1) { - if (!stmt.body[i].trailingComments) { - generateBlankLines(stmt.body[i].range[1], stmt.range[1], result); - } - } - } - } - return result; - }, - - FunctionDeclaration: function (stmt, flags) { - return [ - generateAsyncPrefix(stmt, true), - 'function', - generateStarSuffix(stmt) || noEmptySpace(), - stmt.id ? generateIdentifier(stmt.id) : '', - this.generateFunctionBody(stmt) - ]; - }, - - ReturnStatement: function (stmt, flags) { - if (stmt.argument) { - return [join( - 'return', - this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) - ), this.semicolon(flags)]; - } - return ['return' + this.semicolon(flags)]; - }, - - WhileStatement: function (stmt, flags) { - var result, that = this; - withIndent(function () { - result = [ - 'while' + space + '(', - that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), - ')' - ]; - }); - result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); - return result; - }, - - WithStatement: function (stmt, flags) { - var result, that = this; - withIndent(function () { - result = [ - 'with' + space + '(', - that.generateExpression(stmt.object, Precedence.Sequence, E_TTT), - ')' - ]; - }); - result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); - return result; - } - - }; - - merge(CodeGenerator.prototype, CodeGenerator.Statement); - - // Expressions. - - CodeGenerator.Expression = { - - SequenceExpression: function (expr, precedence, flags) { - var result, i, iz; - if (Precedence.Sequence < precedence) { - flags |= F_ALLOW_IN; - } - result = []; - for (i = 0, iz = expr.expressions.length; i < iz; ++i) { - result.push(this.generateExpression(expr.expressions[i], Precedence.Assignment, flags)); - if (i + 1 < iz) { - result.push(',' + space); - } - } - return parenthesize(result, Precedence.Sequence, precedence); - }, - - AssignmentExpression: function (expr, precedence, flags) { - return this.generateAssignment(expr.left, expr.right, expr.operator, precedence, flags); - }, - - ArrowFunctionExpression: function (expr, precedence, flags) { - return parenthesize(this.generateFunctionBody(expr), Precedence.ArrowFunction, precedence); - }, - - ConditionalExpression: function (expr, precedence, flags) { - if (Precedence.Conditional < precedence) { - flags |= F_ALLOW_IN; - } - return parenthesize( - [ - this.generateExpression(expr.test, Precedence.Coalesce, flags), - space + '?' + space, - this.generateExpression(expr.consequent, Precedence.Assignment, flags), - space + ':' + space, - this.generateExpression(expr.alternate, Precedence.Assignment, flags) - ], - Precedence.Conditional, - precedence - ); - }, - - LogicalExpression: function (expr, precedence, flags) { - if (expr.operator === '??') { - flags |= F_FOUND_COALESCE; - } - return this.BinaryExpression(expr, precedence, flags); - }, - - BinaryExpression: function (expr, precedence, flags) { - var result, leftPrecedence, rightPrecedence, currentPrecedence, fragment, leftSource; - currentPrecedence = BinaryPrecedence[expr.operator]; - leftPrecedence = expr.operator === '**' ? Precedence.Postfix : currentPrecedence; - rightPrecedence = expr.operator === '**' ? currentPrecedence : currentPrecedence + 1; - - if (currentPrecedence < precedence) { - flags |= F_ALLOW_IN; - } - - fragment = this.generateExpression(expr.left, leftPrecedence, flags); - - leftSource = fragment.toString(); - - if (leftSource.charCodeAt(leftSource.length - 1) === 0x2F /* / */ && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) { - result = [fragment, noEmptySpace(), expr.operator]; - } else { - result = join(fragment, expr.operator); - } - - fragment = this.generateExpression(expr.right, rightPrecedence, flags); - - if (expr.operator === '/' && fragment.toString().charAt(0) === '/' || - expr.operator.slice(-1) === '<' && fragment.toString().slice(0, 3) === '!--') { - // If '/' concats with '/' or `<` concats with `!--`, it is interpreted as comment start - result.push(noEmptySpace()); - result.push(fragment); - } else { - result = join(result, fragment); - } - - if (expr.operator === 'in' && !(flags & F_ALLOW_IN)) { - return ['(', result, ')']; - } - if ((expr.operator === '||' || expr.operator === '&&') && (flags & F_FOUND_COALESCE)) { - return ['(', result, ')']; - } - return parenthesize(result, currentPrecedence, precedence); - }, - - CallExpression: function (expr, precedence, flags) { - var result, i, iz; - - // F_ALLOW_UNPARATH_NEW becomes false. - result = [this.generateExpression(expr.callee, Precedence.Call, E_TTF)]; - - if (expr.optional) { - result.push('?.'); - } - - result.push('('); - for (i = 0, iz = expr['arguments'].length; i < iz; ++i) { - result.push(this.generateExpression(expr['arguments'][i], Precedence.Assignment, E_TTT)); - if (i + 1 < iz) { - result.push(',' + space); - } - } - result.push(')'); - - if (!(flags & F_ALLOW_CALL)) { - return ['(', result, ')']; - } - - return parenthesize(result, Precedence.Call, precedence); - }, - - ChainExpression: function (expr, precedence, flags) { - if (Precedence.OptionalChaining < precedence) { - flags |= F_ALLOW_CALL; - } - - var result = this.generateExpression(expr.expression, Precedence.OptionalChaining, flags); - - return parenthesize(result, Precedence.OptionalChaining, precedence); - }, - - NewExpression: function (expr, precedence, flags) { - var result, length, i, iz, itemFlags; - length = expr['arguments'].length; - - // F_ALLOW_CALL becomes false. - // F_ALLOW_UNPARATH_NEW may become false. - itemFlags = (flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0) ? E_TFT : E_TFF; - - result = join( - 'new', - this.generateExpression(expr.callee, Precedence.New, itemFlags) - ); - - if (!(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) { - result.push('('); - for (i = 0, iz = length; i < iz; ++i) { - result.push(this.generateExpression(expr['arguments'][i], Precedence.Assignment, E_TTT)); - if (i + 1 < iz) { - result.push(',' + space); - } - } - result.push(')'); - } - - return parenthesize(result, Precedence.New, precedence); - }, - - MemberExpression: function (expr, precedence, flags) { - var result, fragment; - - // F_ALLOW_UNPARATH_NEW becomes false. - result = [this.generateExpression(expr.object, Precedence.Call, (flags & F_ALLOW_CALL) ? E_TTF : E_TFF)]; - - if (expr.computed) { - if (expr.optional) { - result.push('?.'); - } - - result.push('['); - result.push(this.generateExpression(expr.property, Precedence.Sequence, flags & F_ALLOW_CALL ? E_TTT : E_TFT)); - result.push(']'); - } else { - if (!expr.optional && expr.object.type === Syntax.Literal && typeof expr.object.value === 'number') { - fragment = toSourceNodeWhenNeeded(result).toString(); - // When the following conditions are all true, - // 1. No floating point - // 2. Don't have exponents - // 3. The last character is a decimal digit - // 4. Not hexadecimal OR octal number literal - // we should add a floating point. - if ( - fragment.indexOf('.') < 0 && - !/[eExX]/.test(fragment) && - esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && - !(fragment.length >= 2 && fragment.charCodeAt(0) === 48) // '0' - ) { - result.push(' '); - } - } - result.push(expr.optional ? '?.' : '.'); - result.push(generateIdentifier(expr.property)); - } - - return parenthesize(result, Precedence.Member, precedence); - }, - - MetaProperty: function (expr, precedence, flags) { - var result; - result = []; - result.push(typeof expr.meta === "string" ? expr.meta : generateIdentifier(expr.meta)); - result.push('.'); - result.push(typeof expr.property === "string" ? expr.property : generateIdentifier(expr.property)); - return parenthesize(result, Precedence.Member, precedence); - }, - - UnaryExpression: function (expr, precedence, flags) { - var result, fragment, rightCharCode, leftSource, leftCharCode; - fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT); - - if (space === '') { - result = join(expr.operator, fragment); - } else { - result = [expr.operator]; - if (expr.operator.length > 2) { - // delete, void, typeof - // get `typeof []`, not `typeof[]` - result = join(result, fragment); - } else { - // Prevent inserting spaces between operator and argument if it is unnecessary - // like, `!cond` - leftSource = toSourceNodeWhenNeeded(result).toString(); - leftCharCode = leftSource.charCodeAt(leftSource.length - 1); - rightCharCode = fragment.toString().charCodeAt(0); - - if (((leftCharCode === 0x2B /* + */ || leftCharCode === 0x2D /* - */) && leftCharCode === rightCharCode) || - (esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode))) { - result.push(noEmptySpace()); - result.push(fragment); - } else { - result.push(fragment); - } - } - } - return parenthesize(result, Precedence.Unary, precedence); - }, - - YieldExpression: function (expr, precedence, flags) { - var result; - if (expr.delegate) { - result = 'yield*'; - } else { - result = 'yield'; - } - if (expr.argument) { - result = join( - result, - this.generateExpression(expr.argument, Precedence.Yield, E_TTT) - ); - } - return parenthesize(result, Precedence.Yield, precedence); - }, - - AwaitExpression: function (expr, precedence, flags) { - var result = join( - expr.all ? 'await*' : 'await', - this.generateExpression(expr.argument, Precedence.Await, E_TTT) - ); - return parenthesize(result, Precedence.Await, precedence); - }, - - UpdateExpression: function (expr, precedence, flags) { - if (expr.prefix) { - return parenthesize( - [ - expr.operator, - this.generateExpression(expr.argument, Precedence.Unary, E_TTT) - ], - Precedence.Unary, - precedence - ); - } - return parenthesize( - [ - this.generateExpression(expr.argument, Precedence.Postfix, E_TTT), - expr.operator - ], - Precedence.Postfix, - precedence - ); - }, - - FunctionExpression: function (expr, precedence, flags) { - var result = [ - generateAsyncPrefix(expr, true), - 'function' - ]; - if (expr.id) { - result.push(generateStarSuffix(expr) || noEmptySpace()); - result.push(generateIdentifier(expr.id)); - } else { - result.push(generateStarSuffix(expr) || space); - } - result.push(this.generateFunctionBody(expr)); - return result; - }, - - ArrayPattern: function (expr, precedence, flags) { - return this.ArrayExpression(expr, precedence, flags, true); - }, - - ArrayExpression: function (expr, precedence, flags, isPattern) { - var result, multiline, that = this; - if (!expr.elements.length) { - return '[]'; - } - multiline = isPattern ? false : expr.elements.length > 1; - result = ['[', multiline ? newline : '']; - withIndent(function (indent) { - var i, iz; - for (i = 0, iz = expr.elements.length; i < iz; ++i) { - if (!expr.elements[i]) { - if (multiline) { - result.push(indent); - } - if (i + 1 === iz) { - result.push(','); - } - } else { - result.push(multiline ? indent : ''); - result.push(that.generateExpression(expr.elements[i], Precedence.Assignment, E_TTT)); - } - if (i + 1 < iz) { - result.push(',' + (multiline ? newline : space)); - } - } - }); - if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(multiline ? base : ''); - result.push(']'); - return result; - }, - - RestElement: function(expr, precedence, flags) { - return '...' + this.generatePattern(expr.argument); - }, - - ClassExpression: function (expr, precedence, flags) { - var result, fragment; - result = ['class']; - if (expr.id) { - result = join(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT)); - } - if (expr.superClass) { - fragment = join('extends', this.generateExpression(expr.superClass, Precedence.Unary, E_TTT)); - result = join(result, fragment); - } - result.push(space); - result.push(this.generateStatement(expr.body, S_TFFT)); - return result; - }, - - MethodDefinition: function (expr, precedence, flags) { - var result, fragment; - if (expr['static']) { - result = ['static' + space]; - } else { - result = []; - } - if (expr.kind === 'get' || expr.kind === 'set') { - fragment = [ - join(expr.kind, this.generatePropertyKey(expr.key, expr.computed)), - this.generateFunctionBody(expr.value) - ]; - } else { - fragment = [ - generateMethodPrefix(expr), - this.generatePropertyKey(expr.key, expr.computed), - this.generateFunctionBody(expr.value) - ]; - } - return join(result, fragment); - }, - - Property: function (expr, precedence, flags) { - if (expr.kind === 'get' || expr.kind === 'set') { - return [ - expr.kind, noEmptySpace(), - this.generatePropertyKey(expr.key, expr.computed), - this.generateFunctionBody(expr.value) - ]; - } - - if (expr.shorthand) { - if (expr.value.type === "AssignmentPattern") { - return this.AssignmentPattern(expr.value, Precedence.Sequence, E_TTT); - } - return this.generatePropertyKey(expr.key, expr.computed); - } - - if (expr.method) { - return [ - generateMethodPrefix(expr), - this.generatePropertyKey(expr.key, expr.computed), - this.generateFunctionBody(expr.value) - ]; - } - - return [ - this.generatePropertyKey(expr.key, expr.computed), - ':' + space, - this.generateExpression(expr.value, Precedence.Assignment, E_TTT) - ]; - }, - - ObjectExpression: function (expr, precedence, flags) { - var multiline, result, fragment, that = this; - - if (!expr.properties.length) { - return '{}'; - } - multiline = expr.properties.length > 1; - - withIndent(function () { - fragment = that.generateExpression(expr.properties[0], Precedence.Sequence, E_TTT); - }); - - if (!multiline) { - // issues 4 - // Do not transform from - // dejavu.Class.declare({ - // method2: function () {} - // }); - // to - // dejavu.Class.declare({method2: function () { - // }}); - if (!hasLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { - return [ '{', space, fragment, space, '}' ]; - } - } - - withIndent(function (indent) { - var i, iz; - result = [ '{', newline, indent, fragment ]; - - if (multiline) { - result.push(',' + newline); - for (i = 1, iz = expr.properties.length; i < iz; ++i) { - result.push(indent); - result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + newline); - } - } - } - }); - - if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(base); - result.push('}'); - return result; - }, - - AssignmentPattern: function(expr, precedence, flags) { - return this.generateAssignment(expr.left, expr.right, '=', precedence, flags); - }, - - ObjectPattern: function (expr, precedence, flags) { - var result, i, iz, multiline, property, that = this; - if (!expr.properties.length) { - return '{}'; - } - - multiline = false; - if (expr.properties.length === 1) { - property = expr.properties[0]; - if ( - property.type === Syntax.Property - && property.value.type !== Syntax.Identifier - ) { - multiline = true; - } - } else { - for (i = 0, iz = expr.properties.length; i < iz; ++i) { - property = expr.properties[i]; - if ( - property.type === Syntax.Property - && !property.shorthand - ) { - multiline = true; - break; - } - } - } - result = ['{', multiline ? newline : '' ]; - - withIndent(function (indent) { - var i, iz; - for (i = 0, iz = expr.properties.length; i < iz; ++i) { - result.push(multiline ? indent : ''); - result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT)); - if (i + 1 < iz) { - result.push(',' + (multiline ? newline : space)); - } - } - }); - - if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { - result.push(newline); - } - result.push(multiline ? base : ''); - result.push('}'); - return result; - }, - - ThisExpression: function (expr, precedence, flags) { - return 'this'; - }, - - Super: function (expr, precedence, flags) { - return 'super'; - }, - - Identifier: function (expr, precedence, flags) { - return generateIdentifier(expr); - }, - - ImportDefaultSpecifier: function (expr, precedence, flags) { - return generateIdentifier(expr.id || expr.local); - }, - - ImportNamespaceSpecifier: function (expr, precedence, flags) { - var result = ['*']; - var id = expr.id || expr.local; - if (id) { - result.push(space + 'as' + noEmptySpace() + generateIdentifier(id)); - } - return result; - }, - - ImportSpecifier: function (expr, precedence, flags) { - var imported = expr.imported; - var result = [ imported.name ]; - var local = expr.local; - if (local && local.name !== imported.name) { - result.push(noEmptySpace() + 'as' + noEmptySpace() + generateIdentifier(local)); - } - return result; - }, - - ExportSpecifier: function (expr, precedence, flags) { - var local = expr.local; - var result = [ local.name ]; - var exported = expr.exported; - if (exported && exported.name !== local.name) { - result.push(noEmptySpace() + 'as' + noEmptySpace() + generateIdentifier(exported)); - } - return result; - }, - - Literal: function (expr, precedence, flags) { - var raw; - if (expr.hasOwnProperty('raw') && parse && extra.raw) { - try { - raw = parse(expr.raw).body[0].expression; - if (raw.type === Syntax.Literal) { - if (raw.value === expr.value) { - return expr.raw; - } - } - } catch (e) { - // not use raw property - } - } - - if (expr.regex) { - return '/' + expr.regex.pattern + '/' + expr.regex.flags; - } - - if (typeof expr.value === 'bigint') { - return expr.value.toString() + 'n'; - } - - // `expr.value` can be null if `expr.bigint` exists. We need to check - // `expr.bigint` first. - if (expr.bigint) { - return expr.bigint + 'n'; - } - - if (expr.value === null) { - return 'null'; - } - - if (typeof expr.value === 'string') { - return escapeString(expr.value); - } - - if (typeof expr.value === 'number') { - return generateNumber(expr.value); - } - - if (typeof expr.value === 'boolean') { - return expr.value ? 'true' : 'false'; - } - - return generateRegExp(expr.value); - }, - - GeneratorExpression: function (expr, precedence, flags) { - return this.ComprehensionExpression(expr, precedence, flags); - }, - - ComprehensionExpression: function (expr, precedence, flags) { - // GeneratorExpression should be parenthesized with (...), ComprehensionExpression with [...] - // Due to https://bugzilla.mozilla.org/show_bug.cgi?id=883468 position of expr.body can differ in Spidermonkey and ES6 - - var result, i, iz, fragment, that = this; - result = (expr.type === Syntax.GeneratorExpression) ? ['('] : ['[']; - - if (extra.moz.comprehensionExpressionStartsWithAssignment) { - fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); - result.push(fragment); - } - - if (expr.blocks) { - withIndent(function () { - for (i = 0, iz = expr.blocks.length; i < iz; ++i) { - fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT); - if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) { - result = join(result, fragment); - } else { - result.push(fragment); - } - } - }); - } - - if (expr.filter) { - result = join(result, 'if' + space); - fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT); - result = join(result, [ '(', fragment, ')' ]); - } - - if (!extra.moz.comprehensionExpressionStartsWithAssignment) { - fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); - - result = join(result, fragment); - } - - result.push((expr.type === Syntax.GeneratorExpression) ? ')' : ']'); - return result; - }, - - ComprehensionBlock: function (expr, precedence, flags) { - var fragment; - if (expr.left.type === Syntax.VariableDeclaration) { - fragment = [ - expr.left.kind, noEmptySpace(), - this.generateStatement(expr.left.declarations[0], S_FFFF) - ]; - } else { - fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT); - } - - fragment = join(fragment, expr.of ? 'of' : 'in'); - fragment = join(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT)); - - return [ 'for' + space + '(', fragment, ')' ]; - }, - - SpreadElement: function (expr, precedence, flags) { - return [ - '...', - this.generateExpression(expr.argument, Precedence.Assignment, E_TTT) - ]; - }, - - TaggedTemplateExpression: function (expr, precedence, flags) { - var itemFlags = E_TTF; - if (!(flags & F_ALLOW_CALL)) { - itemFlags = E_TFF; - } - var result = [ - this.generateExpression(expr.tag, Precedence.Call, itemFlags), - this.generateExpression(expr.quasi, Precedence.Primary, E_FFT) - ]; - return parenthesize(result, Precedence.TaggedTemplate, precedence); - }, - - TemplateElement: function (expr, precedence, flags) { - // Don't use "cooked". Since tagged template can use raw template - // representation. So if we do so, it breaks the script semantics. - return expr.value.raw; - }, - - TemplateLiteral: function (expr, precedence, flags) { - var result, i, iz; - result = [ '`' ]; - for (i = 0, iz = expr.quasis.length; i < iz; ++i) { - result.push(this.generateExpression(expr.quasis[i], Precedence.Primary, E_TTT)); - if (i + 1 < iz) { - result.push('${' + space); - result.push(this.generateExpression(expr.expressions[i], Precedence.Sequence, E_TTT)); - result.push(space + '}'); - } - } - result.push('`'); - return result; - }, - - ModuleSpecifier: function (expr, precedence, flags) { - return this.Literal(expr, precedence, flags); - }, - - ImportExpression: function(expr, precedence, flag) { - return parenthesize([ - 'import(', - this.generateExpression(expr.source, Precedence.Assignment, E_TTT), - ')' - ], Precedence.Call, precedence); - } - }; - - merge(CodeGenerator.prototype, CodeGenerator.Expression); - - CodeGenerator.prototype.generateExpression = function (expr, precedence, flags) { - var result, type; - - type = expr.type || Syntax.Property; - - if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) { - return generateVerbatim(expr, precedence); - } - - result = this[type](expr, precedence, flags); - - - if (extra.comment) { - result = addComments(expr, result); - } - return toSourceNodeWhenNeeded(result, expr); - }; - - CodeGenerator.prototype.generateStatement = function (stmt, flags) { - var result, - fragment; - - result = this[stmt.type](stmt, flags); - - // Attach comments - - if (extra.comment) { - result = addComments(stmt, result); - } - - fragment = toSourceNodeWhenNeeded(result).toString(); - if (stmt.type === Syntax.Program && !safeConcatenation && newline === '' && fragment.charAt(fragment.length - 1) === '\n') { - result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\s+$/, '') : fragment.replace(/\s+$/, ''); - } - - return toSourceNodeWhenNeeded(result, stmt); - }; - - function generateInternal(node) { - var codegen; - - codegen = new CodeGenerator(); - if (isStatement(node)) { - return codegen.generateStatement(node, S_TFFF); - } - - if (isExpression(node)) { - return codegen.generateExpression(node, Precedence.Sequence, E_TTT); - } - - throw new Error('Unknown node type: ' + node.type); - } - - function generate(node, options) { - var defaultOptions = getDefaultOptions(), result, pair; - - if (options != null) { - // Obsolete options - // - // `options.indent` - // `options.base` - // - // Instead of them, we can use `option.format.indent`. - if (typeof options.indent === 'string') { - defaultOptions.format.indent.style = options.indent; - } - if (typeof options.base === 'number') { - defaultOptions.format.indent.base = options.base; - } - options = updateDeeply(defaultOptions, options); - indent = options.format.indent.style; - if (typeof options.base === 'string') { - base = options.base; - } else { - base = stringRepeat(indent, options.format.indent.base); - } - } else { - options = defaultOptions; - indent = options.format.indent.style; - base = stringRepeat(indent, options.format.indent.base); - } - json = options.format.json; - renumber = options.format.renumber; - hexadecimal = json ? false : options.format.hexadecimal; - quotes = json ? 'double' : options.format.quotes; - escapeless = options.format.escapeless; - newline = options.format.newline; - space = options.format.space; - if (options.format.compact) { - newline = space = indent = base = ''; - } - parentheses = options.format.parentheses; - semicolons = options.format.semicolons; - safeConcatenation = options.format.safeConcatenation; - directive = options.directive; - parse = json ? null : options.parse; - sourceMap = options.sourceMap; - sourceCode = options.sourceCode; - preserveBlankLines = options.format.preserveBlankLines && sourceCode !== null; - extra = options; - - if (sourceMap) { - if (!exports.browser) { - // We assume environment is node.js - // And prevent from including source-map by browserify - SourceNode = (__nccwpck_require__(56594).SourceNode); - } else { - SourceNode = global.sourceMap.SourceNode; - } - } - - result = generateInternal(node); - - if (!sourceMap) { - pair = {code: result.toString(), map: null}; - return options.sourceMapWithCode ? pair : pair.code; - } - - - pair = result.toStringWithSourceMap({ - file: options.file, - sourceRoot: options.sourceMapRoot - }); - - if (options.sourceContent) { - pair.map.setSourceContent(options.sourceMap, - options.sourceContent); - } - - if (options.sourceMapWithCode) { - return pair; - } - - return pair.map.toString(); - } - - FORMAT_MINIFY = { - indent: { - style: '', - base: 0 - }, - renumber: true, - hexadecimal: true, - quotes: 'auto', - escapeless: true, - compact: true, - parentheses: false, - semicolons: false - }; - - FORMAT_DEFAULTS = getDefaultOptions().format; - - exports.version = __nccwpck_require__(78531).version; - exports.generate = generate; - exports.attachComments = estraverse.attachComments; - exports.Precedence = updateDeeply({}, Precedence); - exports.browser = false; - exports.FORMAT_MINIFY = FORMAT_MINIFY; - exports.FORMAT_DEFAULTS = FORMAT_DEFAULTS; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 78823: -/***/ (function(module) { - -(function webpackUniversalModuleDefinition(root, factory) { -/* istanbul ignore next */ - if(true) - module.exports = factory(); - else {} -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __nested_webpack_require_583__(moduleId) { - -/******/ // Check if module is in cache -/* istanbul ignore if */ -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_583__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __nested_webpack_require_583__.m = modules; - -/******/ // expose the module cache -/******/ __nested_webpack_require_583__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __nested_webpack_require_583__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __nested_webpack_require_583__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __nested_webpack_require_1808__) { - - "use strict"; - /* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - Object.defineProperty(exports, "__esModule", { value: true }); - var comment_handler_1 = __nested_webpack_require_1808__(1); - var jsx_parser_1 = __nested_webpack_require_1808__(3); - var parser_1 = __nested_webpack_require_1808__(8); - var tokenizer_1 = __nested_webpack_require_1808__(15); - function parse(code, options, delegate) { - var commentHandler = null; - var proxyDelegate = function (node, metadata) { - if (delegate) { - delegate(node, metadata); - } - if (commentHandler) { - commentHandler.visit(node, metadata); - } - }; - var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; - var collectComment = false; - if (options) { - collectComment = (typeof options.comment === 'boolean' && options.comment); - var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); - if (collectComment || attachComment) { - commentHandler = new comment_handler_1.CommentHandler(); - commentHandler.attach = attachComment; - options.comment = true; - parserDelegate = proxyDelegate; - } - } - var isModule = false; - if (options && typeof options.sourceType === 'string') { - isModule = (options.sourceType === 'module'); - } - var parser; - if (options && typeof options.jsx === 'boolean' && options.jsx) { - parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); - } - else { - parser = new parser_1.Parser(code, options, parserDelegate); - } - var program = isModule ? parser.parseModule() : parser.parseScript(); - var ast = program; - if (collectComment && commentHandler) { - ast.comments = commentHandler.comments; - } - if (parser.config.tokens) { - ast.tokens = parser.tokens; - } - if (parser.config.tolerant) { - ast.errors = parser.errorHandler.errors; - } - return ast; - } - exports.parse = parse; - function parseModule(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'module'; - return parse(code, parsingOptions, delegate); - } - exports.parseModule = parseModule; - function parseScript(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'script'; - return parse(code, parsingOptions, delegate); - } - exports.parseScript = parseScript; - function tokenize(code, options, delegate) { - var tokenizer = new tokenizer_1.Tokenizer(code, options); - var tokens; - tokens = []; - try { - while (true) { - var token = tokenizer.getNextToken(); - if (!token) { - break; - } - if (delegate) { - token = delegate(token); - } - tokens.push(token); - } - } - catch (e) { - tokenizer.errorHandler.tolerate(e); - } - if (tokenizer.errorHandler.tolerant) { - tokens.errors = tokenizer.errors(); - } - return tokens; - } - exports.tokenize = tokenize; - var syntax_1 = __nested_webpack_require_1808__(2); - exports.Syntax = syntax_1.Syntax; - // Sync with *.json manifests. - exports.version = '4.0.1'; - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __nested_webpack_require_6456__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __nested_webpack_require_6456__(2); - var CommentHandler = (function () { - function CommentHandler() { - this.attach = false; - this.comments = []; - this.stack = []; - this.leading = []; - this.trailing = []; - } - CommentHandler.prototype.insertInnerComments = function (node, metadata) { - // innnerComments for properties empty block - // `function a() {/** comments **\/}` - if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { - var innerComments = []; - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (metadata.end.offset >= entry.start) { - innerComments.unshift(entry.comment); - this.leading.splice(i, 1); - this.trailing.splice(i, 1); - } - } - if (innerComments.length) { - node.innerComments = innerComments; - } - } - }; - CommentHandler.prototype.findTrailingComments = function (metadata) { - var trailingComments = []; - if (this.trailing.length > 0) { - for (var i = this.trailing.length - 1; i >= 0; --i) { - var entry_1 = this.trailing[i]; - if (entry_1.start >= metadata.end.offset) { - trailingComments.unshift(entry_1.comment); - } - } - this.trailing.length = 0; - return trailingComments; - } - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.node.trailingComments) { - var firstComment = entry.node.trailingComments[0]; - if (firstComment && firstComment.range[0] >= metadata.end.offset) { - trailingComments = entry.node.trailingComments; - delete entry.node.trailingComments; - } - } - return trailingComments; - }; - CommentHandler.prototype.findLeadingComments = function (metadata) { - var leadingComments = []; - var target; - while (this.stack.length > 0) { - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.start >= metadata.start.offset) { - target = entry.node; - this.stack.pop(); - } - else { - break; - } - } - if (target) { - var count = target.leadingComments ? target.leadingComments.length : 0; - for (var i = count - 1; i >= 0; --i) { - var comment = target.leadingComments[i]; - if (comment.range[1] <= metadata.start.offset) { - leadingComments.unshift(comment); - target.leadingComments.splice(i, 1); - } - } - if (target.leadingComments && target.leadingComments.length === 0) { - delete target.leadingComments; - } - return leadingComments; - } - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (entry.start <= metadata.start.offset) { - leadingComments.unshift(entry.comment); - this.leading.splice(i, 1); - } - } - return leadingComments; - }; - CommentHandler.prototype.visitNode = function (node, metadata) { - if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { - return; - } - this.insertInnerComments(node, metadata); - var trailingComments = this.findTrailingComments(metadata); - var leadingComments = this.findLeadingComments(metadata); - if (leadingComments.length > 0) { - node.leadingComments = leadingComments; - } - if (trailingComments.length > 0) { - node.trailingComments = trailingComments; - } - this.stack.push({ - node: node, - start: metadata.start.offset - }); - }; - CommentHandler.prototype.visitComment = function (node, metadata) { - var type = (node.type[0] === 'L') ? 'Line' : 'Block'; - var comment = { - type: type, - value: node.value - }; - if (node.range) { - comment.range = node.range; - } - if (node.loc) { - comment.loc = node.loc; - } - this.comments.push(comment); - if (this.attach) { - var entry = { - comment: { - type: type, - value: node.value, - range: [metadata.start.offset, metadata.end.offset] - }, - start: metadata.start.offset - }; - if (node.loc) { - entry.comment.loc = node.loc; - } - node.type = type; - this.leading.push(entry); - this.trailing.push(entry); - } - }; - CommentHandler.prototype.visit = function (node, metadata) { - if (node.type === 'LineComment') { - this.visitComment(node, metadata); - } - else if (node.type === 'BlockComment') { - this.visitComment(node, metadata); - } - else if (this.attach) { - this.visitNode(node, metadata); - } - }; - return CommentHandler; - }()); - exports.CommentHandler = CommentHandler; - - -/***/ }, -/* 2 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForOfStatement: 'ForOfStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchCase: 'SwitchCase', - SwitchStatement: 'SwitchStatement', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - -/***/ }, -/* 3 */ -/***/ function(module, exports, __nested_webpack_require_15019__) { +/***/ }, +/* 3 */ +/***/ function(module, exports, __nested_webpack_require_15019__) { "use strict"; /* istanbul ignore next */ @@ -108132,1584 +87063,23411 @@ module.exports.parseURL = function (input, options) { /***/ }), -/***/ 83185: -/***/ ((module) => { +/***/ 83185: +/***/ ((module) => { + +"use strict"; + + +module.exports.mixin = function mixin(target, source) { + const keys = Object.getOwnPropertyNames(source); + for (let i = 0; i < keys.length; ++i) { + Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); + } +}; + +module.exports.wrapperSymbol = Symbol("wrapper"); +module.exports.implSymbol = Symbol("impl"); + +module.exports.wrapperForImpl = function (impl) { + return impl[module.exports.wrapperSymbol]; +}; + +module.exports.implForWrapper = function (wrapper) { + return wrapper[module.exports.implSymbol]; +}; + + + +/***/ }), + +/***/ 62940: +/***/ ((module) => { + +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} + + +/***/ }), + +/***/ 22877: +/***/ ((module) => { + +module.exports = eval("require")("encoding"); + + +/***/ }), + +/***/ 39491: +/***/ ((module) => { + +"use strict"; +module.exports = require("assert"); + +/***/ }), + +/***/ 50852: +/***/ ((module) => { + +"use strict"; +module.exports = require("async_hooks"); + +/***/ }), + +/***/ 14300: +/***/ ((module) => { + +"use strict"; +module.exports = require("buffer"); + +/***/ }), + +/***/ 32081: +/***/ ((module) => { + +"use strict"; +module.exports = require("child_process"); + +/***/ }), + +/***/ 96206: +/***/ ((module) => { + +"use strict"; +module.exports = require("console"); + +/***/ }), + +/***/ 22057: +/***/ ((module) => { + +"use strict"; +module.exports = require("constants"); + +/***/ }), + +/***/ 6113: +/***/ ((module) => { + +"use strict"; +module.exports = require("crypto"); + +/***/ }), + +/***/ 67643: +/***/ ((module) => { + +"use strict"; +module.exports = require("diagnostics_channel"); + +/***/ }), + +/***/ 17578: +/***/ ((module) => { + +"use strict"; +module.exports = require("dns"); + +/***/ }), + +/***/ 82361: +/***/ ((module) => { + +"use strict"; +module.exports = require("events"); + +/***/ }), + +/***/ 57147: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs"); + +/***/ }), + +/***/ 13685: +/***/ ((module) => { + +"use strict"; +module.exports = require("http"); + +/***/ }), + +/***/ 85158: +/***/ ((module) => { + +"use strict"; +module.exports = require("http2"); + +/***/ }), + +/***/ 95687: +/***/ ((module) => { + +"use strict"; +module.exports = require("https"); + +/***/ }), + +/***/ 41808: +/***/ ((module) => { + +"use strict"; +module.exports = require("net"); + +/***/ }), + +/***/ 15673: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:events"); + +/***/ }), + +/***/ 84492: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:stream"); + +/***/ }), + +/***/ 47261: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:util"); + +/***/ }), + +/***/ 22037: +/***/ ((module) => { + +"use strict"; +module.exports = require("os"); + +/***/ }), + +/***/ 71017: +/***/ ((module) => { + +"use strict"; +module.exports = require("path"); + +/***/ }), + +/***/ 4074: +/***/ ((module) => { + +"use strict"; +module.exports = require("perf_hooks"); + +/***/ }), + +/***/ 85477: +/***/ ((module) => { + +"use strict"; +module.exports = require("punycode"); + +/***/ }), + +/***/ 63477: +/***/ ((module) => { + +"use strict"; +module.exports = require("querystring"); + +/***/ }), + +/***/ 12781: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream"); + +/***/ }), + +/***/ 35356: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream/web"); + +/***/ }), + +/***/ 71576: +/***/ ((module) => { + +"use strict"; +module.exports = require("string_decoder"); + +/***/ }), + +/***/ 39512: +/***/ ((module) => { + +"use strict"; +module.exports = require("timers"); + +/***/ }), + +/***/ 24404: +/***/ ((module) => { + +"use strict"; +module.exports = require("tls"); + +/***/ }), + +/***/ 76224: +/***/ ((module) => { + +"use strict"; +module.exports = require("tty"); + +/***/ }), + +/***/ 57310: +/***/ ((module) => { + +"use strict"; +module.exports = require("url"); + +/***/ }), + +/***/ 73837: +/***/ ((module) => { + +"use strict"; +module.exports = require("util"); + +/***/ }), + +/***/ 29830: +/***/ ((module) => { + +"use strict"; +module.exports = require("util/types"); + +/***/ }), + +/***/ 71267: +/***/ ((module) => { + +"use strict"; +module.exports = require("worker_threads"); + +/***/ }), + +/***/ 59796: +/***/ ((module) => { + +"use strict"; +module.exports = require("zlib"); + +/***/ }), + +/***/ 32702: +/***/ ((module) => { + +const perf = + typeof performance === 'object' && + performance && + typeof performance.now === 'function' + ? performance + : Date + +const hasAbortController = typeof AbortController === 'function' + +// minimal backwards-compatibility polyfill +// this doesn't have nearly all the checks and whatnot that +// actual AbortController/Signal has, but it's enough for +// our purposes, and if used properly, behaves the same. +const AC = hasAbortController + ? AbortController + : class AbortController { + constructor() { + this.signal = new AS() + } + abort(reason = new Error('This operation was aborted')) { + this.signal.reason = this.signal.reason || reason + this.signal.aborted = true + this.signal.dispatchEvent({ + type: 'abort', + target: this.signal, + }) + } + } + +const hasAbortSignal = typeof AbortSignal === 'function' +// Some polyfills put this on the AC class, not global +const hasACAbortSignal = typeof AC.AbortSignal === 'function' +const AS = hasAbortSignal + ? AbortSignal + : hasACAbortSignal + ? AC.AbortController + : class AbortSignal { + constructor() { + this.reason = undefined + this.aborted = false + this._listeners = [] + } + dispatchEvent(e) { + if (e.type === 'abort') { + this.aborted = true + this.onabort(e) + this._listeners.forEach(f => f(e), this) + } + } + onabort() {} + addEventListener(ev, fn) { + if (ev === 'abort') { + this._listeners.push(fn) + } + } + removeEventListener(ev, fn) { + if (ev === 'abort') { + this._listeners = this._listeners.filter(f => f !== fn) + } + } + } + +const warned = new Set() +const deprecatedOption = (opt, instead) => { + const code = `LRU_CACHE_OPTION_${opt}` + if (shouldWarn(code)) { + warn(code, `${opt} option`, `options.${instead}`, LRUCache) + } +} +const deprecatedMethod = (method, instead) => { + const code = `LRU_CACHE_METHOD_${method}` + if (shouldWarn(code)) { + const { prototype } = LRUCache + const { get } = Object.getOwnPropertyDescriptor(prototype, method) + warn(code, `${method} method`, `cache.${instead}()`, get) + } +} +const deprecatedProperty = (field, instead) => { + const code = `LRU_CACHE_PROPERTY_${field}` + if (shouldWarn(code)) { + const { prototype } = LRUCache + const { get } = Object.getOwnPropertyDescriptor(prototype, field) + warn(code, `${field} property`, `cache.${instead}`, get) + } +} + +const emitWarning = (...a) => { + typeof process === 'object' && + process && + typeof process.emitWarning === 'function' + ? process.emitWarning(...a) + : console.error(...a) +} + +const shouldWarn = code => !warned.has(code) + +const warn = (code, what, instead, fn) => { + warned.add(code) + const msg = `The ${what} is deprecated. Please use ${instead} instead.` + emitWarning(msg, 'DeprecationWarning', code, fn) +} + +const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) + +/* istanbul ignore next - This is a little bit ridiculous, tbh. + * The maximum array length is 2^32-1 or thereabouts on most JS impls. + * And well before that point, you're caching the entire world, I mean, + * that's ~32GB of just integers for the next/prev links, plus whatever + * else to hold that many keys and values. Just filling the memory with + * zeroes at init time is brutal when you get that big. + * But why not be complete? + * Maybe in the future, these limits will have expanded. */ +const getUintArray = max => + !isPosInt(max) + ? null + : max <= Math.pow(2, 8) + ? Uint8Array + : max <= Math.pow(2, 16) + ? Uint16Array + : max <= Math.pow(2, 32) + ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER + ? ZeroArray + : null + +class ZeroArray extends Array { + constructor(size) { + super(size) + this.fill(0) + } +} + +class Stack { + constructor(max) { + if (max === 0) { + return [] + } + const UintArray = getUintArray(max) + this.heap = new UintArray(max) + this.length = 0 + } + push(n) { + this.heap[this.length++] = n + } + pop() { + return this.heap[--this.length] + } +} + +class LRUCache { + constructor(options = {}) { + const { + max = 0, + ttl, + ttlResolution = 1, + ttlAutopurge, + updateAgeOnGet, + updateAgeOnHas, + allowStale, + dispose, + disposeAfter, + noDisposeOnSet, + noUpdateTTL, + maxSize = 0, + maxEntrySize = 0, + sizeCalculation, + fetchMethod, + fetchContext, + noDeleteOnFetchRejection, + noDeleteOnStaleGet, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + } = options + + // deprecated options, don't trigger a warning for getting them if + // the thing being passed in is another LRUCache we're copying. + const { length, maxAge, stale } = + options instanceof LRUCache ? {} : options + + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer') + } + + const UintArray = max ? getUintArray(max) : Array + if (!UintArray) { + throw new Error('invalid max value: ' + max) + } + + this.max = max + this.maxSize = maxSize + this.maxEntrySize = maxEntrySize || this.maxSize + this.sizeCalculation = sizeCalculation || length + if (this.sizeCalculation) { + if (!this.maxSize && !this.maxEntrySize) { + throw new TypeError( + 'cannot set sizeCalculation without setting maxSize or maxEntrySize' + ) + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function') + } + } + + this.fetchMethod = fetchMethod || null + if (this.fetchMethod && typeof this.fetchMethod !== 'function') { + throw new TypeError( + 'fetchMethod must be a function if specified' + ) + } + + this.fetchContext = fetchContext + if (!this.fetchMethod && fetchContext !== undefined) { + throw new TypeError( + 'cannot set fetchContext without fetchMethod' + ) + } + + this.keyMap = new Map() + this.keyList = new Array(max).fill(null) + this.valList = new Array(max).fill(null) + this.next = new UintArray(max) + this.prev = new UintArray(max) + this.head = 0 + this.tail = 0 + this.free = new Stack(max) + this.initialFill = 1 + this.size = 0 + + if (typeof dispose === 'function') { + this.dispose = dispose + } + if (typeof disposeAfter === 'function') { + this.disposeAfter = disposeAfter + this.disposed = [] + } else { + this.disposeAfter = null + this.disposed = null + } + this.noDisposeOnSet = !!noDisposeOnSet + this.noUpdateTTL = !!noUpdateTTL + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort + this.ignoreFetchAbort = !!ignoreFetchAbort + + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.maxSize !== 0) { + if (!isPosInt(this.maxSize)) { + throw new TypeError( + 'maxSize must be a positive integer if specified' + ) + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError( + 'maxEntrySize must be a positive integer if specified' + ) + } + this.initializeSizeTracking() + } + + this.allowStale = !!allowStale || !!stale + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet + this.updateAgeOnGet = !!updateAgeOnGet + this.updateAgeOnHas = !!updateAgeOnHas + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 + ? ttlResolution + : 1 + this.ttlAutopurge = !!ttlAutopurge + this.ttl = ttl || maxAge || 0 + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError( + 'ttl must be a positive integer if specified' + ) + } + this.initializeTTLTracking() + } + + // do not allow completely unbounded caches + if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { + throw new TypeError( + 'At least one of max, maxSize, or ttl is required' + ) + } + if (!this.ttlAutopurge && !this.max && !this.maxSize) { + const code = 'LRU_CACHE_UNBOUNDED' + if (shouldWarn(code)) { + warned.add(code) + const msg = + 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.' + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) + } + } + + if (stale) { + deprecatedOption('stale', 'allowStale') + } + if (maxAge) { + deprecatedOption('maxAge', 'ttl') + } + if (length) { + deprecatedOption('length', 'sizeCalculation') + } + } + + getRemainingTTL(key) { + return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 + } + + initializeTTLTracking() { + this.ttls = new ZeroArray(this.max) + this.starts = new ZeroArray(this.max) + + this.setItemTTL = (index, ttl, start = perf.now()) => { + this.starts[index] = ttl !== 0 ? start : 0 + this.ttls[index] = ttl + if (ttl !== 0 && this.ttlAutopurge) { + const t = setTimeout(() => { + if (this.isStale(index)) { + this.delete(this.keyList[index]) + } + }, ttl + 1) + /* istanbul ignore else - unref() not supported on all platforms */ + if (t.unref) { + t.unref() + } + } + } + + this.updateItemAge = index => { + this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 + } + + this.statusTTL = (status, index) => { + if (status) { + status.ttl = this.ttls[index] + status.start = this.starts[index] + status.now = cachedNow || getNow() + status.remainingTTL = status.now + status.ttl - status.start + } + } + + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0 + const getNow = () => { + const n = perf.now() + if (this.ttlResolution > 0) { + cachedNow = n + const t = setTimeout( + () => (cachedNow = 0), + this.ttlResolution + ) + /* istanbul ignore else - not available on all platforms */ + if (t.unref) { + t.unref() + } + } + return n + } + + this.getRemainingTTL = key => { + const index = this.keyMap.get(key) + if (index === undefined) { + return 0 + } + return this.ttls[index] === 0 || this.starts[index] === 0 + ? Infinity + : this.starts[index] + + this.ttls[index] - + (cachedNow || getNow()) + } + + this.isStale = index => { + return ( + this.ttls[index] !== 0 && + this.starts[index] !== 0 && + (cachedNow || getNow()) - this.starts[index] > + this.ttls[index] + ) + } + } + updateItemAge(_index) {} + statusTTL(_status, _index) {} + setItemTTL(_index, _ttl, _start) {} + isStale(_index) { + return false + } + + initializeSizeTracking() { + this.calculatedSize = 0 + this.sizes = new ZeroArray(this.max) + this.removeItemSize = index => { + this.calculatedSize -= this.sizes[index] + this.sizes[index] = 0 + } + this.requireSize = (k, v, size, sizeCalculation) => { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.isBackgroundFetch(v)) { + return 0 + } + if (!isPosInt(size)) { + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function') + } + size = sizeCalculation(v, k) + if (!isPosInt(size)) { + throw new TypeError( + 'sizeCalculation return invalid (expect positive integer)' + ) + } + } else { + throw new TypeError( + 'invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + + 'must be set.' + ) + } + } + return size + } + this.addItemSize = (index, size, status) => { + this.sizes[index] = size + if (this.maxSize) { + const maxSize = this.maxSize - this.sizes[index] + while (this.calculatedSize > maxSize) { + this.evict(true) + } + } + this.calculatedSize += this.sizes[index] + if (status) { + status.entrySize = size + status.totalCalculatedSize = this.calculatedSize + } + } + } + removeItemSize(_index) {} + addItemSize(_index, _size) {} + requireSize(_k, _v, size, sizeCalculation) { + if (size || sizeCalculation) { + throw new TypeError( + 'cannot set size without setting maxSize or maxEntrySize on cache' + ) + } + } + + *indexes({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.tail; true; ) { + if (!this.isValidIndex(i)) { + break + } + if (allowStale || !this.isStale(i)) { + yield i + } + if (i === this.head) { + break + } else { + i = this.prev[i] + } + } + } + } + + *rindexes({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.head; true; ) { + if (!this.isValidIndex(i)) { + break + } + if (allowStale || !this.isStale(i)) { + yield i + } + if (i === this.tail) { + break + } else { + i = this.next[i] + } + } + } + } + + isValidIndex(index) { + return ( + index !== undefined && + this.keyMap.get(this.keyList[index]) === index + ) + } + + *entries() { + for (const i of this.indexes()) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield [this.keyList[i], this.valList[i]] + } + } + } + *rentries() { + for (const i of this.rindexes()) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield [this.keyList[i], this.valList[i]] + } + } + } + + *keys() { + for (const i of this.indexes()) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.keyList[i] + } + } + } + *rkeys() { + for (const i of this.rindexes()) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.keyList[i] + } + } + } + + *values() { + for (const i of this.indexes()) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.valList[i] + } + } + } + *rvalues() { + for (const i of this.rindexes()) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.valList[i] + } + } + } + + [Symbol.iterator]() { + return this.entries() + } + + find(fn, getOptions) { + for (const i of this.indexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + if (fn(value, this.keyList[i], this)) { + return this.get(this.keyList[i], getOptions) + } + } + } + + forEach(fn, thisp = this) { + for (const i of this.indexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) + } + } + + rforEach(fn, thisp = this) { + for (const i of this.rindexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) + } + } + + get prune() { + deprecatedMethod('prune', 'purgeStale') + return this.purgeStale + } + + purgeStale() { + let deleted = false + for (const i of this.rindexes({ allowStale: true })) { + if (this.isStale(i)) { + this.delete(this.keyList[i]) + deleted = true + } + } + return deleted + } + + dump() { + const arr = [] + for (const i of this.indexes({ allowStale: true })) { + const key = this.keyList[i] + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + const entry = { value } + if (this.ttls) { + entry.ttl = this.ttls[i] + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = perf.now() - this.starts[i] + entry.start = Math.floor(Date.now() - age) + } + if (this.sizes) { + entry.size = this.sizes[i] + } + arr.unshift([key, entry]) + } + return arr + } + + load(arr) { + this.clear() + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset. + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start + entry.start = perf.now() - age + } + this.set(key, entry.value, entry) + } + } + + dispose(_v, _k, _reason) {} + + set( + k, + v, + { + ttl = this.ttl, + start, + noDisposeOnSet = this.noDisposeOnSet, + size = 0, + sizeCalculation = this.sizeCalculation, + noUpdateTTL = this.noUpdateTTL, + status, + } = {} + ) { + size = this.requireSize(k, v, size, sizeCalculation) + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss' + status.maxEntrySizeExceeded = true + } + // have to delete, in case a background fetch is there already. + // in non-async cases, this is a no-op + this.delete(k) + return this + } + let index = this.size === 0 ? undefined : this.keyMap.get(k) + if (index === undefined) { + // addition + index = this.newIndex() + this.keyList[index] = k + this.valList[index] = v + this.keyMap.set(k, index) + this.next[this.tail] = index + this.prev[index] = this.tail + this.tail = index + this.size++ + this.addItemSize(index, size, status) + if (status) { + status.set = 'add' + } + noUpdateTTL = false + } else { + // update + this.moveToTail(index) + const oldVal = this.valList[index] + if (v !== oldVal) { + if (this.isBackgroundFetch(oldVal)) { + oldVal.__abortController.abort(new Error('replaced')) + } else { + if (!noDisposeOnSet) { + this.dispose(oldVal, k, 'set') + if (this.disposeAfter) { + this.disposed.push([oldVal, k, 'set']) + } + } + } + this.removeItemSize(index) + this.valList[index] = v + this.addItemSize(index, size, status) + if (status) { + status.set = 'replace' + const oldValue = + oldVal && this.isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal + if (oldValue !== undefined) status.oldValue = oldValue + } + } else if (status) { + status.set = 'update' + } + } + if (ttl !== 0 && this.ttl === 0 && !this.ttls) { + this.initializeTTLTracking() + } + if (!noUpdateTTL) { + this.setItemTTL(index, ttl, start) + } + this.statusTTL(status, index) + if (this.disposeAfter) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + return this + } + + newIndex() { + if (this.size === 0) { + return this.tail + } + if (this.size === this.max && this.max !== 0) { + return this.evict(false) + } + if (this.free.length !== 0) { + return this.free.pop() + } + // initial fill, just keep writing down the list + return this.initialFill++ + } + + pop() { + if (this.size) { + const val = this.valList[this.head] + this.evict(true) + return val + } + } + + evict(free) { + const head = this.head + const k = this.keyList[head] + const v = this.valList[head] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('evicted')) + } else { + this.dispose(v, k, 'evict') + if (this.disposeAfter) { + this.disposed.push([v, k, 'evict']) + } + } + this.removeItemSize(head) + // if we aren't about to use the index, then null these out + if (free) { + this.keyList[head] = null + this.valList[head] = null + this.free.push(head) + } + this.head = this.next[head] + this.keyMap.delete(k) + this.size-- + return head + } + + has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { + const index = this.keyMap.get(k) + if (index !== undefined) { + if (!this.isStale(index)) { + if (updateAgeOnHas) { + this.updateItemAge(index) + } + if (status) status.has = 'hit' + this.statusTTL(status, index) + return true + } else if (status) { + status.has = 'stale' + this.statusTTL(status, index) + } + } else if (status) { + status.has = 'miss' + } + return false + } + + // like get(), but without any LRU updating or TTL expiration + peek(k, { allowStale = this.allowStale } = {}) { + const index = this.keyMap.get(k) + if (index !== undefined && (allowStale || !this.isStale(index))) { + const v = this.valList[index] + // either stale and allowed, or forcing a refresh of non-stale value + return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v + } + } + + backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.valList[index] + if (this.isBackgroundFetch(v)) { + return v + } + const ac = new AC() + if (options.signal) { + options.signal.addEventListener('abort', () => + ac.abort(options.signal.reason) + ) + } + const fetchOpts = { + signal: ac.signal, + options, + context, + } + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal + const ignoreAbort = options.ignoreFetchAbort && v !== undefined + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true + options.status.fetchError = ac.signal.reason + if (ignoreAbort) options.status.fetchAbortIgnored = true + } else { + options.status.fetchResolved = true + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason) + } + // either we didn't abort, and are still here, or we did, and ignored + if (this.valList[index] === p) { + if (v === undefined) { + if (p.__staleWhileFetching) { + this.valList[index] = p.__staleWhileFetching + } else { + this.delete(k) + } + } else { + if (options.status) options.status.fetchUpdated = true + this.set(k, v, fetchOpts.options) + } + } + return v + } + const eb = er => { + if (options.status) { + options.status.fetchRejected = true + options.status.fetchError = er + } + return fetchFail(er) + } + const fetchFail = er => { + const { aborted } = ac.signal + const allowStaleAborted = + aborted && options.allowStaleOnFetchAbort + const allowStale = + allowStaleAborted || options.allowStaleOnFetchRejection + const noDelete = allowStale || options.noDeleteOnFetchRejection + if (this.valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || p.__staleWhileFetching === undefined + if (del) { + this.delete(k) + } else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.valList[index] = p.__staleWhileFetching + } + } + if (allowStale) { + if (options.status && p.__staleWhileFetching !== undefined) { + options.status.returnedStale = true + } + return p.__staleWhileFetching + } else if (p.__returned === p) { + throw er + } + } + const pcall = (res, rej) => { + this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if ( + !options.ignoreFetchAbort || + options.allowStaleOnFetchAbort + ) { + res() + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true) + } + } + }) + } + if (options.status) options.status.fetchDispatched = true + const p = new Promise(pcall).then(cb, eb) + p.__abortController = ac + p.__staleWhileFetching = v + p.__returned = null + if (index === undefined) { + // internal, don't expose status. + this.set(k, p, { ...fetchOpts.options, status: undefined }) + index = this.keyMap.get(k) + } else { + this.valList[index] = p + } + return p + } + + isBackgroundFetch(p) { + return ( + p && + typeof p === 'object' && + typeof p.then === 'function' && + Object.prototype.hasOwnProperty.call( + p, + '__staleWhileFetching' + ) && + Object.prototype.hasOwnProperty.call(p, '__returned') && + (p.__returned === p || p.__returned === null) + ) + } + + // this takes the union of get() and set() opts, because it does both + async fetch( + k, + { + // get options + allowStale = this.allowStale, + updateAgeOnGet = this.updateAgeOnGet, + noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, + noDisposeOnSet = this.noDisposeOnSet, + size = 0, + sizeCalculation = this.sizeCalculation, + noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, + allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, + ignoreFetchAbort = this.ignoreFetchAbort, + allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, + fetchContext = this.fetchContext, + forceRefresh = false, + status, + signal, + } = {} + ) { + if (!this.fetchMethod) { + if (status) status.fetch = 'get' + return this.get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }) + } + + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + } + + let index = this.keyMap.get(k) + if (index === undefined) { + if (status) status.fetch = 'miss' + const p = this.backgroundFetch(k, index, options, fetchContext) + return (p.__returned = p) + } else { + // in cache, maybe already fetching + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + const stale = + allowStale && v.__staleWhileFetching !== undefined + if (status) { + status.fetch = 'inflight' + if (stale) status.returnedStale = true + } + return stale ? v.__staleWhileFetching : (v.__returned = v) + } + + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.isStale(index) + if (!forceRefresh && !isStale) { + if (status) status.fetch = 'hit' + this.moveToTail(index) + if (updateAgeOnGet) { + this.updateItemAge(index) + } + this.statusTTL(status, index) + return v + } + + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.backgroundFetch(k, index, options, fetchContext) + const hasStale = p.__staleWhileFetching !== undefined + const staleVal = hasStale && allowStale + if (status) { + status.fetch = hasStale && isStale ? 'stale' : 'refresh' + if (staleVal && isStale) status.returnedStale = true + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p) + } + } + + get( + k, + { + allowStale = this.allowStale, + updateAgeOnGet = this.updateAgeOnGet, + noDeleteOnStaleGet = this.noDeleteOnStaleGet, + status, + } = {} + ) { + const index = this.keyMap.get(k) + if (index !== undefined) { + const value = this.valList[index] + const fetching = this.isBackgroundFetch(value) + this.statusTTL(status, index) + if (this.isStale(index)) { + if (status) status.get = 'stale' + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.delete(k) + } + if (status) status.returnedStale = allowStale + return allowStale ? value : undefined + } else { + if (status) { + status.returnedStale = + allowStale && value.__staleWhileFetching !== undefined + } + return allowStale ? value.__staleWhileFetching : undefined + } + } else { + if (status) status.get = 'hit' + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + if (fetching) { + return value.__staleWhileFetching + } + this.moveToTail(index) + if (updateAgeOnGet) { + this.updateItemAge(index) + } + return value + } + } else if (status) { + status.get = 'miss' + } + } + + connect(p, n) { + this.prev[n] = p + this.next[p] = n + } + + moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.tail) { + if (index === this.head) { + this.head = this.next[index] + } else { + this.connect(this.prev[index], this.next[index]) + } + this.connect(this.tail, index) + this.tail = index + } + } + + get del() { + deprecatedMethod('del', 'delete') + return this.delete + } + + delete(k) { + let deleted = false + if (this.size !== 0) { + const index = this.keyMap.get(k) + if (index !== undefined) { + deleted = true + if (this.size === 1) { + this.clear() + } else { + this.removeItemSize(index) + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')) + } else { + this.dispose(v, k, 'delete') + if (this.disposeAfter) { + this.disposed.push([v, k, 'delete']) + } + } + this.keyMap.delete(k) + this.keyList[index] = null + this.valList[index] = null + if (index === this.tail) { + this.tail = this.prev[index] + } else if (index === this.head) { + this.head = this.next[index] + } else { + this.next[this.prev[index]] = this.next[index] + this.prev[this.next[index]] = this.prev[index] + } + this.size-- + this.free.push(index) + } + } + } + if (this.disposed) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + return deleted + } + + clear() { + for (const index of this.rindexes({ allowStale: true })) { + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')) + } else { + const k = this.keyList[index] + this.dispose(v, k, 'delete') + if (this.disposeAfter) { + this.disposed.push([v, k, 'delete']) + } + } + } + + this.keyMap.clear() + this.valList.fill(null) + this.keyList.fill(null) + if (this.ttls) { + this.ttls.fill(0) + this.starts.fill(0) + } + if (this.sizes) { + this.sizes.fill(0) + } + this.head = 0 + this.tail = 0 + this.initialFill = 1 + this.free.length = 0 + this.calculatedSize = 0 + this.size = 0 + if (this.disposed) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + } + + get reset() { + deprecatedMethod('reset', 'clear') + return this.clear + } + + get length() { + deprecatedProperty('length', 'size') + return this.size + } + + static get AbortController() { + return AC + } + static get AbortSignal() { + return AS + } +} + +module.exports = LRUCache + + +/***/ }), + +/***/ 36411: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.addLeadingZeros = addLeadingZeros; +function addLeadingZeros(number, targetLength) { + const sign = number < 0 ? "-" : ""; + const output = Math.abs(number).toString().padStart(targetLength, "0"); + return sign + output; +} + + +/***/ }), + +/***/ 7479: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "defaultLocale", ({ + enumerable: true, + get: function () { + return _index.enUS; + }, +})); +var _index = __nccwpck_require__(39425); + + +/***/ }), + +/***/ 35586: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.getDefaultOptions = getDefaultOptions; +exports.setDefaultOptions = setDefaultOptions; + +let defaultOptions = {}; + +function getDefaultOptions() { + return defaultOptions; +} + +function setDefaultOptions(newOptions) { + defaultOptions = newOptions; +} + + +/***/ }), + +/***/ 56615: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatters = void 0; +var _index = __nccwpck_require__(91412); +var _index2 = __nccwpck_require__(16703); +var _index3 = __nccwpck_require__(47131); +var _index4 = __nccwpck_require__(43080); +var _index5 = __nccwpck_require__(19116); + +var _index6 = __nccwpck_require__(36411); +var _index7 = __nccwpck_require__(58914); + +const dayPeriodEnum = { + am: "am", + pm: "pm", + midnight: "midnight", + noon: "noon", + morning: "morning", + afternoon: "afternoon", + evening: "evening", + night: "night", +}; + +/* + * | | Unit | | Unit | + * |-----|--------------------------------|-----|--------------------------------| + * | a | AM, PM | A* | Milliseconds in day | + * | b | AM, PM, noon, midnight | B | Flexible day period | + * | c | Stand-alone local day of week | C* | Localized hour w/ day period | + * | d | Day of month | D | Day of year | + * | e | Local day of week | E | Day of week | + * | f | | F* | Day of week in month | + * | g* | Modified Julian day | G | Era | + * | h | Hour [1-12] | H | Hour [0-23] | + * | i! | ISO day of week | I! | ISO week of year | + * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | + * | k | Hour [1-24] | K | Hour [0-11] | + * | l* | (deprecated) | L | Stand-alone month | + * | m | Minute | M | Month | + * | n | | N | | + * | o! | Ordinal number modifier | O | Timezone (GMT) | + * | p! | Long localized time | P! | Long localized date | + * | q | Stand-alone quarter | Q | Quarter | + * | r* | Related Gregorian year | R! | ISO week-numbering year | + * | s | Second | S | Fraction of second | + * | t! | Seconds timestamp | T! | Milliseconds timestamp | + * | u | Extended year | U* | Cyclic year | + * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | + * | w | Local week of year | W* | Week of month | + * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | + * | y | Year (abs) | Y | Local week-numbering year | + * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) | + * + * Letters marked by * are not implemented but reserved by Unicode standard. + * + * Letters marked by ! are non-standard, but implemented by date-fns: + * - `o` modifies the previous token to turn it into an ordinal (see `format` docs) + * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, + * i.e. 7 for Sunday, 1 for Monday, etc. + * - `I` is ISO week of year, as opposed to `w` which is local week of year. + * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. + * `R` is supposed to be used in conjunction with `I` and `i` + * for universal ISO week-numbering date, whereas + * `Y` is supposed to be used in conjunction with `w` and `e` + * for week-numbering date specific to the locale. + * - `P` is long localized date format + * - `p` is long localized time format + */ + +const formatters = (exports.formatters = { + // Era + G: function (date, token, localize) { + const era = date.getFullYear() > 0 ? 1 : 0; + switch (token) { + // AD, BC + case "G": + case "GG": + case "GGG": + return localize.era(era, { width: "abbreviated" }); + // A, B + case "GGGGG": + return localize.era(era, { width: "narrow" }); + // Anno Domini, Before Christ + case "GGGG": + default: + return localize.era(era, { width: "wide" }); + } + }, + + // Year + y: function (date, token, localize) { + // Ordinal number + if (token === "yo") { + const signedYear = date.getFullYear(); + // Returns 1 for 1 BC (which is year 0 in JavaScript) + const year = signedYear > 0 ? signedYear : 1 - signedYear; + return localize.ordinalNumber(year, { unit: "year" }); + } + + return _index7.lightFormatters.y(date, token); + }, + + // Local week-numbering year + Y: function (date, token, localize, options) { + const signedWeekYear = (0, _index5.getWeekYear)(date, options); + // Returns 1 for 1 BC (which is year 0 in JavaScript) + const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; + + // Two digit year + if (token === "YY") { + const twoDigitYear = weekYear % 100; + return (0, _index6.addLeadingZeros)(twoDigitYear, 2); + } + + // Ordinal number + if (token === "Yo") { + return localize.ordinalNumber(weekYear, { unit: "year" }); + } + + // Padding + return (0, _index6.addLeadingZeros)(weekYear, token.length); + }, + + // ISO week-numbering year + R: function (date, token) { + const isoWeekYear = (0, _index3.getISOWeekYear)(date); + + // Padding + return (0, _index6.addLeadingZeros)(isoWeekYear, token.length); + }, + + // Extended year. This is a single number designating the year of this calendar system. + // The main difference between `y` and `u` localizers are B.C. years: + // | Year | `y` | `u` | + // |------|-----|-----| + // | AC 1 | 1 | 1 | + // | BC 1 | 1 | 0 | + // | BC 2 | 2 | -1 | + // Also `yy` always returns the last two digits of a year, + // while `uu` pads single digit years to 2 characters and returns other years unchanged. + u: function (date, token) { + const year = date.getFullYear(); + return (0, _index6.addLeadingZeros)(year, token.length); + }, + + // Quarter + Q: function (date, token, localize) { + const quarter = Math.ceil((date.getMonth() + 1) / 3); + switch (token) { + // 1, 2, 3, 4 + case "Q": + return String(quarter); + // 01, 02, 03, 04 + case "QQ": + return (0, _index6.addLeadingZeros)(quarter, 2); + // 1st, 2nd, 3rd, 4th + case "Qo": + return localize.ordinalNumber(quarter, { unit: "quarter" }); + // Q1, Q2, Q3, Q4 + case "QQQ": + return localize.quarter(quarter, { + width: "abbreviated", + context: "formatting", + }); + // 1, 2, 3, 4 (narrow quarter; could be not numerical) + case "QQQQQ": + return localize.quarter(quarter, { + width: "narrow", + context: "formatting", + }); + // 1st quarter, 2nd quarter, ... + case "QQQQ": + default: + return localize.quarter(quarter, { + width: "wide", + context: "formatting", + }); + } + }, + + // Stand-alone quarter + q: function (date, token, localize) { + const quarter = Math.ceil((date.getMonth() + 1) / 3); + switch (token) { + // 1, 2, 3, 4 + case "q": + return String(quarter); + // 01, 02, 03, 04 + case "qq": + return (0, _index6.addLeadingZeros)(quarter, 2); + // 1st, 2nd, 3rd, 4th + case "qo": + return localize.ordinalNumber(quarter, { unit: "quarter" }); + // Q1, Q2, Q3, Q4 + case "qqq": + return localize.quarter(quarter, { + width: "abbreviated", + context: "standalone", + }); + // 1, 2, 3, 4 (narrow quarter; could be not numerical) + case "qqqqq": + return localize.quarter(quarter, { + width: "narrow", + context: "standalone", + }); + // 1st quarter, 2nd quarter, ... + case "qqqq": + default: + return localize.quarter(quarter, { + width: "wide", + context: "standalone", + }); + } + }, + + // Month + M: function (date, token, localize) { + const month = date.getMonth(); + switch (token) { + case "M": + case "MM": + return _index7.lightFormatters.M(date, token); + // 1st, 2nd, ..., 12th + case "Mo": + return localize.ordinalNumber(month + 1, { unit: "month" }); + // Jan, Feb, ..., Dec + case "MMM": + return localize.month(month, { + width: "abbreviated", + context: "formatting", + }); + // J, F, ..., D + case "MMMMM": + return localize.month(month, { + width: "narrow", + context: "formatting", + }); + // January, February, ..., December + case "MMMM": + default: + return localize.month(month, { width: "wide", context: "formatting" }); + } + }, + + // Stand-alone month + L: function (date, token, localize) { + const month = date.getMonth(); + switch (token) { + // 1, 2, ..., 12 + case "L": + return String(month + 1); + // 01, 02, ..., 12 + case "LL": + return (0, _index6.addLeadingZeros)(month + 1, 2); + // 1st, 2nd, ..., 12th + case "Lo": + return localize.ordinalNumber(month + 1, { unit: "month" }); + // Jan, Feb, ..., Dec + case "LLL": + return localize.month(month, { + width: "abbreviated", + context: "standalone", + }); + // J, F, ..., D + case "LLLLL": + return localize.month(month, { + width: "narrow", + context: "standalone", + }); + // January, February, ..., December + case "LLLL": + default: + return localize.month(month, { width: "wide", context: "standalone" }); + } + }, + + // Local week of year + w: function (date, token, localize, options) { + const week = (0, _index4.getWeek)(date, options); + + if (token === "wo") { + return localize.ordinalNumber(week, { unit: "week" }); + } + + return (0, _index6.addLeadingZeros)(week, token.length); + }, + + // ISO week of year + I: function (date, token, localize) { + const isoWeek = (0, _index2.getISOWeek)(date); + + if (token === "Io") { + return localize.ordinalNumber(isoWeek, { unit: "week" }); + } + + return (0, _index6.addLeadingZeros)(isoWeek, token.length); + }, + + // Day of the month + d: function (date, token, localize) { + if (token === "do") { + return localize.ordinalNumber(date.getDate(), { unit: "date" }); + } + + return _index7.lightFormatters.d(date, token); + }, + + // Day of year + D: function (date, token, localize) { + const dayOfYear = (0, _index.getDayOfYear)(date); + + if (token === "Do") { + return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" }); + } + + return (0, _index6.addLeadingZeros)(dayOfYear, token.length); + }, + + // Day of week + E: function (date, token, localize) { + const dayOfWeek = date.getDay(); + switch (token) { + // Tue + case "E": + case "EE": + case "EEE": + return localize.day(dayOfWeek, { + width: "abbreviated", + context: "formatting", + }); + // T + case "EEEEE": + return localize.day(dayOfWeek, { + width: "narrow", + context: "formatting", + }); + // Tu + case "EEEEEE": + return localize.day(dayOfWeek, { + width: "short", + context: "formatting", + }); + // Tuesday + case "EEEE": + default: + return localize.day(dayOfWeek, { + width: "wide", + context: "formatting", + }); + } + }, + + // Local day of week + e: function (date, token, localize, options) { + const dayOfWeek = date.getDay(); + const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; + switch (token) { + // Numerical value (Nth day of week with current locale or weekStartsOn) + case "e": + return String(localDayOfWeek); + // Padded numerical value + case "ee": + return (0, _index6.addLeadingZeros)(localDayOfWeek, 2); + // 1st, 2nd, ..., 7th + case "eo": + return localize.ordinalNumber(localDayOfWeek, { unit: "day" }); + case "eee": + return localize.day(dayOfWeek, { + width: "abbreviated", + context: "formatting", + }); + // T + case "eeeee": + return localize.day(dayOfWeek, { + width: "narrow", + context: "formatting", + }); + // Tu + case "eeeeee": + return localize.day(dayOfWeek, { + width: "short", + context: "formatting", + }); + // Tuesday + case "eeee": + default: + return localize.day(dayOfWeek, { + width: "wide", + context: "formatting", + }); + } + }, + + // Stand-alone local day of week + c: function (date, token, localize, options) { + const dayOfWeek = date.getDay(); + const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; + switch (token) { + // Numerical value (same as in `e`) + case "c": + return String(localDayOfWeek); + // Padded numerical value + case "cc": + return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length); + // 1st, 2nd, ..., 7th + case "co": + return localize.ordinalNumber(localDayOfWeek, { unit: "day" }); + case "ccc": + return localize.day(dayOfWeek, { + width: "abbreviated", + context: "standalone", + }); + // T + case "ccccc": + return localize.day(dayOfWeek, { + width: "narrow", + context: "standalone", + }); + // Tu + case "cccccc": + return localize.day(dayOfWeek, { + width: "short", + context: "standalone", + }); + // Tuesday + case "cccc": + default: + return localize.day(dayOfWeek, { + width: "wide", + context: "standalone", + }); + } + }, + + // ISO day of week + i: function (date, token, localize) { + const dayOfWeek = date.getDay(); + const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; + switch (token) { + // 2 + case "i": + return String(isoDayOfWeek); + // 02 + case "ii": + return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length); + // 2nd + case "io": + return localize.ordinalNumber(isoDayOfWeek, { unit: "day" }); + // Tue + case "iii": + return localize.day(dayOfWeek, { + width: "abbreviated", + context: "formatting", + }); + // T + case "iiiii": + return localize.day(dayOfWeek, { + width: "narrow", + context: "formatting", + }); + // Tu + case "iiiiii": + return localize.day(dayOfWeek, { + width: "short", + context: "formatting", + }); + // Tuesday + case "iiii": + default: + return localize.day(dayOfWeek, { + width: "wide", + context: "formatting", + }); + } + }, + + // AM or PM + a: function (date, token, localize) { + const hours = date.getHours(); + const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; + + switch (token) { + case "a": + case "aa": + return localize.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting", + }); + case "aaa": + return localize + .dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting", + }) + .toLowerCase(); + case "aaaaa": + return localize.dayPeriod(dayPeriodEnumValue, { + width: "narrow", + context: "formatting", + }); + case "aaaa": + default: + return localize.dayPeriod(dayPeriodEnumValue, { + width: "wide", + context: "formatting", + }); + } + }, + + // AM, PM, midnight, noon + b: function (date, token, localize) { + const hours = date.getHours(); + let dayPeriodEnumValue; + if (hours === 12) { + dayPeriodEnumValue = dayPeriodEnum.noon; + } else if (hours === 0) { + dayPeriodEnumValue = dayPeriodEnum.midnight; + } else { + dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; + } + + switch (token) { + case "b": + case "bb": + return localize.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting", + }); + case "bbb": + return localize + .dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting", + }) + .toLowerCase(); + case "bbbbb": + return localize.dayPeriod(dayPeriodEnumValue, { + width: "narrow", + context: "formatting", + }); + case "bbbb": + default: + return localize.dayPeriod(dayPeriodEnumValue, { + width: "wide", + context: "formatting", + }); + } + }, + + // in the morning, in the afternoon, in the evening, at night + B: function (date, token, localize) { + const hours = date.getHours(); + let dayPeriodEnumValue; + if (hours >= 17) { + dayPeriodEnumValue = dayPeriodEnum.evening; + } else if (hours >= 12) { + dayPeriodEnumValue = dayPeriodEnum.afternoon; + } else if (hours >= 4) { + dayPeriodEnumValue = dayPeriodEnum.morning; + } else { + dayPeriodEnumValue = dayPeriodEnum.night; + } + + switch (token) { + case "B": + case "BB": + case "BBB": + return localize.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting", + }); + case "BBBBB": + return localize.dayPeriod(dayPeriodEnumValue, { + width: "narrow", + context: "formatting", + }); + case "BBBB": + default: + return localize.dayPeriod(dayPeriodEnumValue, { + width: "wide", + context: "formatting", + }); + } + }, + + // Hour [1-12] + h: function (date, token, localize) { + if (token === "ho") { + let hours = date.getHours() % 12; + if (hours === 0) hours = 12; + return localize.ordinalNumber(hours, { unit: "hour" }); + } + + return _index7.lightFormatters.h(date, token); + }, + + // Hour [0-23] + H: function (date, token, localize) { + if (token === "Ho") { + return localize.ordinalNumber(date.getHours(), { unit: "hour" }); + } + + return _index7.lightFormatters.H(date, token); + }, + + // Hour [0-11] + K: function (date, token, localize) { + const hours = date.getHours() % 12; + + if (token === "Ko") { + return localize.ordinalNumber(hours, { unit: "hour" }); + } + + return (0, _index6.addLeadingZeros)(hours, token.length); + }, + + // Hour [1-24] + k: function (date, token, localize) { + let hours = date.getHours(); + if (hours === 0) hours = 24; + + if (token === "ko") { + return localize.ordinalNumber(hours, { unit: "hour" }); + } + + return (0, _index6.addLeadingZeros)(hours, token.length); + }, + + // Minute + m: function (date, token, localize) { + if (token === "mo") { + return localize.ordinalNumber(date.getMinutes(), { unit: "minute" }); + } + + return _index7.lightFormatters.m(date, token); + }, + + // Second + s: function (date, token, localize) { + if (token === "so") { + return localize.ordinalNumber(date.getSeconds(), { unit: "second" }); + } + + return _index7.lightFormatters.s(date, token); + }, + + // Fraction of second + S: function (date, token) { + return _index7.lightFormatters.S(date, token); + }, + + // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) + X: function (date, token, _localize) { + const timezoneOffset = date.getTimezoneOffset(); + + if (timezoneOffset === 0) { + return "Z"; + } + + switch (token) { + // Hours and optional minutes + case "X": + return formatTimezoneWithOptionalMinutes(timezoneOffset); + + // Hours, minutes and optional seconds without `:` delimiter + // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets + // so this token always has the same output as `XX` + case "XXXX": + case "XX": // Hours and minutes without `:` delimiter + return formatTimezone(timezoneOffset); + + // Hours, minutes and optional seconds with `:` delimiter + // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets + // so this token always has the same output as `XXX` + case "XXXXX": + case "XXX": // Hours and minutes with `:` delimiter + default: + return formatTimezone(timezoneOffset, ":"); + } + }, + + // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) + x: function (date, token, _localize) { + const timezoneOffset = date.getTimezoneOffset(); + + switch (token) { + // Hours and optional minutes + case "x": + return formatTimezoneWithOptionalMinutes(timezoneOffset); + + // Hours, minutes and optional seconds without `:` delimiter + // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets + // so this token always has the same output as `xx` + case "xxxx": + case "xx": // Hours and minutes without `:` delimiter + return formatTimezone(timezoneOffset); + + // Hours, minutes and optional seconds with `:` delimiter + // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets + // so this token always has the same output as `xxx` + case "xxxxx": + case "xxx": // Hours and minutes with `:` delimiter + default: + return formatTimezone(timezoneOffset, ":"); + } + }, + + // Timezone (GMT) + O: function (date, token, _localize) { + const timezoneOffset = date.getTimezoneOffset(); + + switch (token) { + // Short + case "O": + case "OO": + case "OOO": + return "GMT" + formatTimezoneShort(timezoneOffset, ":"); + // Long + case "OOOO": + default: + return "GMT" + formatTimezone(timezoneOffset, ":"); + } + }, + + // Timezone (specific non-location) + z: function (date, token, _localize) { + const timezoneOffset = date.getTimezoneOffset(); + + switch (token) { + // Short + case "z": + case "zz": + case "zzz": + return "GMT" + formatTimezoneShort(timezoneOffset, ":"); + // Long + case "zzzz": + default: + return "GMT" + formatTimezone(timezoneOffset, ":"); + } + }, + + // Seconds timestamp + t: function (date, token, _localize) { + const timestamp = Math.trunc(+date / 1000); + return (0, _index6.addLeadingZeros)(timestamp, token.length); + }, + + // Milliseconds timestamp + T: function (date, token, _localize) { + return (0, _index6.addLeadingZeros)(+date, token.length); + }, +}); + +function formatTimezoneShort(offset, delimiter = "") { + const sign = offset > 0 ? "-" : "+"; + const absOffset = Math.abs(offset); + const hours = Math.trunc(absOffset / 60); + const minutes = absOffset % 60; + if (minutes === 0) { + return sign + String(hours); + } + return ( + sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2) + ); +} + +function formatTimezoneWithOptionalMinutes(offset, delimiter) { + if (offset % 60 === 0) { + const sign = offset > 0 ? "-" : "+"; + return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2); + } + return formatTimezone(offset, delimiter); +} + +function formatTimezone(offset, delimiter = "") { + const sign = offset > 0 ? "-" : "+"; + const absOffset = Math.abs(offset); + const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2); + const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2); + return sign + hours + delimiter + minutes; +} + + +/***/ }), + +/***/ 58914: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lightFormatters = void 0; +var _index = __nccwpck_require__(36411); + +/* + * | | Unit | | Unit | + * |-----|--------------------------------|-----|--------------------------------| + * | a | AM, PM | A* | | + * | d | Day of month | D | | + * | h | Hour [1-12] | H | Hour [0-23] | + * | m | Minute | M | Month | + * | s | Second | S | Fraction of second | + * | y | Year (abs) | Y | | + * + * Letters marked by * are not implemented but reserved by Unicode standard. + */ + +const lightFormatters = (exports.lightFormatters = { + // Year + y(date, token) { + // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens + // | Year | y | yy | yyy | yyyy | yyyyy | + // |----------|-------|----|-------|-------|-------| + // | AD 1 | 1 | 01 | 001 | 0001 | 00001 | + // | AD 12 | 12 | 12 | 012 | 0012 | 00012 | + // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | + // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | + // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | + + const signedYear = date.getFullYear(); + // Returns 1 for 1 BC (which is year 0 in JavaScript) + const year = signedYear > 0 ? signedYear : 1 - signedYear; + return (0, _index.addLeadingZeros)( + token === "yy" ? year % 100 : year, + token.length, + ); + }, + + // Month + M(date, token) { + const month = date.getMonth(); + return token === "M" + ? String(month + 1) + : (0, _index.addLeadingZeros)(month + 1, 2); + }, + + // Day of the month + d(date, token) { + return (0, _index.addLeadingZeros)(date.getDate(), token.length); + }, + + // AM or PM + a(date, token) { + const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am"; + + switch (token) { + case "a": + case "aa": + return dayPeriodEnumValue.toUpperCase(); + case "aaa": + return dayPeriodEnumValue; + case "aaaaa": + return dayPeriodEnumValue[0]; + case "aaaa": + default: + return dayPeriodEnumValue === "am" ? "a.m." : "p.m."; + } + }, + + // Hour [1-12] + h(date, token) { + return (0, _index.addLeadingZeros)( + date.getHours() % 12 || 12, + token.length, + ); + }, + + // Hour [0-23] + H(date, token) { + return (0, _index.addLeadingZeros)(date.getHours(), token.length); + }, + + // Minute + m(date, token) { + return (0, _index.addLeadingZeros)(date.getMinutes(), token.length); + }, + + // Second + s(date, token) { + return (0, _index.addLeadingZeros)(date.getSeconds(), token.length); + }, + + // Fraction of second + S(date, token) { + const numberOfDigits = token.length; + const milliseconds = date.getMilliseconds(); + const fractionalSeconds = Math.trunc( + milliseconds * Math.pow(10, numberOfDigits - 3), + ); + return (0, _index.addLeadingZeros)(fractionalSeconds, token.length); + }, +}); + + +/***/ }), + +/***/ 46376: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.longFormatters = void 0; + +const dateLongFormatter = (pattern, formatLong) => { + switch (pattern) { + case "P": + return formatLong.date({ width: "short" }); + case "PP": + return formatLong.date({ width: "medium" }); + case "PPP": + return formatLong.date({ width: "long" }); + case "PPPP": + default: + return formatLong.date({ width: "full" }); + } +}; + +const timeLongFormatter = (pattern, formatLong) => { + switch (pattern) { + case "p": + return formatLong.time({ width: "short" }); + case "pp": + return formatLong.time({ width: "medium" }); + case "ppp": + return formatLong.time({ width: "long" }); + case "pppp": + default: + return formatLong.time({ width: "full" }); + } +}; + +const dateTimeLongFormatter = (pattern, formatLong) => { + const matchResult = pattern.match(/(P+)(p+)?/) || []; + const datePattern = matchResult[1]; + const timePattern = matchResult[2]; + + if (!timePattern) { + return dateLongFormatter(pattern, formatLong); + } + + let dateTimeFormat; + + switch (datePattern) { + case "P": + dateTimeFormat = formatLong.dateTime({ width: "short" }); + break; + case "PP": + dateTimeFormat = formatLong.dateTime({ width: "medium" }); + break; + case "PPP": + dateTimeFormat = formatLong.dateTime({ width: "long" }); + break; + case "PPPP": + default: + dateTimeFormat = formatLong.dateTime({ width: "full" }); + break; + } + + return dateTimeFormat + .replace("{{date}}", dateLongFormatter(datePattern, formatLong)) + .replace("{{time}}", timeLongFormatter(timePattern, formatLong)); +}; + +const longFormatters = (exports.longFormatters = { + p: timeLongFormatter, + P: dateTimeLongFormatter, +}); + + +/***/ }), + +/***/ 35920: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.getRoundingMethod = getRoundingMethod; + +function getRoundingMethod(method) { + return (number) => { + const round = method ? Math[method] : Math.trunc; + const result = round(number); + // Prevent negative zero + return result === 0 ? 0 : result; + }; +} + + +/***/ }), + +/***/ 91546: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds; +var _index = __nccwpck_require__(46439); + +/** + * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. + * They usually appear for dates that denote time before the timezones were introduced + * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 + * and GMT+01:00:00 after that date) + * + * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above, + * which would lead to incorrect calculations. + * + * This function returns the timezone offset in milliseconds that takes seconds in account. + */ +function getTimezoneOffsetInMilliseconds(date) { + const _date = (0, _index.toDate)(date); + const utcDate = new Date( + Date.UTC( + _date.getFullYear(), + _date.getMonth(), + _date.getDate(), + _date.getHours(), + _date.getMinutes(), + _date.getSeconds(), + _date.getMilliseconds(), + ), + ); + utcDate.setUTCFullYear(_date.getFullYear()); + return +date - +utcDate; +} + + +/***/ }), + +/***/ 58897: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.normalizeDates = normalizeDates; +var _index = __nccwpck_require__(30926); + +function normalizeDates(context, ...dates) { + const normalize = _index.constructFrom.bind( + null, + context || dates.find((date) => typeof date === "object"), + ); + return dates.map(normalize); +} + + +/***/ }), + +/***/ 97776: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.normalizeInterval = normalizeInterval; +var _index = __nccwpck_require__(58897); + +function normalizeInterval(context, interval) { + const [start, end] = (0, _index.normalizeDates)( + context, + interval.start, + interval.end, + ); + return { start, end }; +} + + +/***/ }), + +/***/ 53554: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken; +exports.isProtectedWeekYearToken = isProtectedWeekYearToken; +exports.warnOrThrowProtectedError = warnOrThrowProtectedError; +const dayOfYearTokenRE = /^D+$/; +const weekYearTokenRE = /^Y+$/; + +const throwTokens = ["D", "DD", "YY", "YYYY"]; + +function isProtectedDayOfYearToken(token) { + return dayOfYearTokenRE.test(token); +} + +function isProtectedWeekYearToken(token) { + return weekYearTokenRE.test(token); +} + +function warnOrThrowProtectedError(token, format, input) { + const _message = message(token, format, input); + console.warn(_message); + if (throwTokens.includes(token)) throw new RangeError(_message); +} + +function message(token, format, input) { + const subject = token[0] === "Y" ? "years" : "days of the month"; + 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`; +} + + +/***/ }), + +/***/ 42033: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.add = add; +var _index = __nccwpck_require__(7412); +var _index2 = __nccwpck_require__(69793); +var _index3 = __nccwpck_require__(30926); +var _index4 = __nccwpck_require__(46439); + +/** + * The {@link add} function options. + */ + +/** + * @name add + * @category Common Helpers + * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date. + * + * @description + * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added. + * @param options - An object with options + * + * @returns The new date with the seconds added + * + * @example + * // Add the following duration to 1 September 2014, 10:19:50 + * const result = add(new Date(2014, 8, 1, 10, 19, 50), { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30, + * }) + * //=> Thu Jun 15 2017 15:29:20 + */ +function add(date, duration, options) { + const { + years = 0, + months = 0, + weeks = 0, + days = 0, + hours = 0, + minutes = 0, + seconds = 0, + } = duration; + + // Add years and months + const _date = (0, _index4.toDate)(date, options?.in); + const dateWithMonths = + months || years + ? (0, _index2.addMonths)(_date, months + years * 12) + : _date; + + // Add weeks and days + const dateWithDays = + days || weeks + ? (0, _index.addDays)(dateWithMonths, days + weeks * 7) + : dateWithMonths; + + // Add days, hours, minutes, and seconds + const minutesToAdd = minutes + hours * 60; + const secondsToAdd = seconds + minutesToAdd * 60; + const msToAdd = secondsToAdd * 1000; + + return (0, _index3.constructFrom)( + options?.in || date, + +dateWithDays + msToAdd, + ); +} + + +/***/ }), + +/***/ 22759: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addBusinessDays = addBusinessDays; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(1623); +var _index3 = __nccwpck_require__(4862); +var _index4 = __nccwpck_require__(51038); +var _index5 = __nccwpck_require__(46439); + +/** + * The {@link addBusinessDays} function options. + */ + +/** + * @name addBusinessDays + * @category Day Helpers + * @summary Add the specified number of business days (mon - fri) to the given date. + * + * @description + * Add the specified number of business days (mon - fri) to the given date, ignoring weekends. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of business days to be added. + * @param options - An object with options + * + * @returns The new date with the business days added + * + * @example + * // Add 10 business days to 1 September 2014: + * const result = addBusinessDays(new Date(2014, 8, 1), 10) + * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days) + */ +function addBusinessDays(date, amount, options) { + const _date = (0, _index5.toDate)(date, options?.in); + const startedOnWeekend = (0, _index4.isWeekend)(_date, options); + + if (isNaN(amount)) return (0, _index.constructFrom)(options?.in, NaN); + + const hours = _date.getHours(); + const sign = amount < 0 ? -1 : 1; + const fullWeeks = Math.trunc(amount / 5); + + _date.setDate(_date.getDate() + fullWeeks * 7); + + // Get remaining days not part of a full week + let restDays = Math.abs(amount % 5); + + // Loops over remaining days + while (restDays > 0) { + _date.setDate(_date.getDate() + sign); + if (!(0, _index4.isWeekend)(_date, options)) restDays -= 1; + } + + // If the date is a weekend day and we reduce a dividable of + // 5 from it, we land on a weekend date. + // To counter this, we add days accordingly to land on the next business day + if ( + startedOnWeekend && + (0, _index4.isWeekend)(_date, options) && + amount !== 0 + ) { + // If we're reducing days, we want to add days until we land on a weekday + // If we're adding days we want to reduce days until we land on a weekday + if ((0, _index2.isSaturday)(_date, options)) + _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1)); + if ((0, _index3.isSunday)(_date, options)) + _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2)); + } + + // Restore hours to avoid DST lag + _date.setHours(hours); + + return _date; +} + + +/***/ }), + +/***/ 7412: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addDays = addDays; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link addDays} function options. + */ + +/** + * @name addDays + * @category Day Helpers + * @summary Add the specified number of days to the given date. + * + * @description + * Add the specified number of days to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of days to be added. + * @param options - An object with options + * + * @returns The new date with the days added + * + * @example + * // Add 10 days to 1 September 2014: + * const result = addDays(new Date(2014, 8, 1), 10) + * //=> Thu Sep 11 2014 00:00:00 + */ +function addDays(date, amount, options) { + const _date = (0, _index2.toDate)(date, options?.in); + if (isNaN(amount)) return (0, _index.constructFrom)(options?.in || date, NaN); + + // If 0 days, no-op to avoid changing times in the hour before end of DST + if (!amount) return _date; + + _date.setDate(_date.getDate() + amount); + return _date; +} + + +/***/ }), + +/***/ 67102: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addHours = addHours; +var _index = __nccwpck_require__(80006); +var _index2 = __nccwpck_require__(64278); + +/** + * The {@link addHours} function options. + */ + +/** + * @name addHours + * @category Hour Helpers + * @summary Add the specified number of hours to the given date. + * + * @description + * Add the specified number of hours to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of hours to be added + * @param options - An object with options + * + * @returns The new date with the hours added + * + * @example + * // Add 2 hours to 10 July 2014 23:00:00: + * const result = addHours(new Date(2014, 6, 10, 23, 0), 2) + * //=> Fri Jul 11 2014 01:00:00 + */ +function addHours(date, amount, options) { + return (0, _index.addMilliseconds)( + date, + amount * _index2.millisecondsInHour, + options, + ); +} + + +/***/ }), + +/***/ 72768: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addISOWeekYears = addISOWeekYears; +var _index = __nccwpck_require__(47131); +var _index2 = __nccwpck_require__(64482); + +/** + * The {@link addISOWeekYears} function options. + */ + +/** + * @name addISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Add the specified number of ISO week-numbering years to the given date. + * + * @description + * Add the specified number of ISO week-numbering years to the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * + * @param date - The date to be changed + * @param amount - The amount of ISO week-numbering years to be added. + * @param options - An object with options + * + * @returns The new date with the ISO week-numbering years added + * + * @example + * // Add 5 ISO week-numbering years to 2 July 2010: + * const result = addISOWeekYears(new Date(2010, 6, 2), 5) + * //=> Fri Jun 26 2015 00:00:00 + */ +function addISOWeekYears(date, amount, options) { + return (0, _index2.setISOWeekYear)( + date, + (0, _index.getISOWeekYear)(date, options) + amount, + options, + ); +} + + +/***/ }), + +/***/ 80006: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addMilliseconds = addMilliseconds; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link addMilliseconds} function options. + */ + +/** + * @name addMilliseconds + * @category Millisecond Helpers + * @summary Add the specified number of milliseconds to the given date. + * + * @description + * Add the specified number of milliseconds to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of milliseconds to be added. + * @param options - The options object + * + * @returns The new date with the milliseconds added + * + * @example + * // Add 750 milliseconds to 10 July 2014 12:45:30.000: + * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) + * //=> Thu Jul 10 2014 12:45:30.750 + */ +function addMilliseconds(date, amount, options) { + return (0, _index.constructFrom)( + options?.in || date, + +(0, _index2.toDate)(date) + amount, + ); +} + + +/***/ }), + +/***/ 85223: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addMinutes = addMinutes; +var _index = __nccwpck_require__(64278); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link addMinutes} function options. + */ + +/** + * @name addMinutes + * @category Minute Helpers + * @summary Add the specified number of minutes to the given date. + * + * @description + * Add the specified number of minutes to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of minutes to be added. + * @param options - An object with options + * + * @returns The new date with the minutes added + * + * @example + * // Add 30 minutes to 10 July 2014 12:00:00: + * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 12:30:00 + */ +function addMinutes(date, amount, options) { + const _date = (0, _index2.toDate)(date, options?.in); + _date.setTime(_date.getTime() + amount * _index.millisecondsInMinute); + return _date; +} + + +/***/ }), + +/***/ 69793: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addMonths = addMonths; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link addMonths} function options. + */ + +/** + * @name addMonths + * @category Month Helpers + * @summary Add the specified number of months to the given date. + * + * @description + * Add the specified number of months to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of months to be added. + * @param options - The options object + * + * @returns The new date with the months added + * + * @example + * // Add 5 months to 1 September 2014: + * const result = addMonths(new Date(2014, 8, 1), 5) + * //=> Sun Feb 01 2015 00:00:00 + * + * // Add one month to 30 January 2023: + * const result = addMonths(new Date(2023, 0, 30), 1) + * //=> Tue Feb 28 2023 00:00:00 + */ +function addMonths(date, amount, options) { + const _date = (0, _index2.toDate)(date, options?.in); + if (isNaN(amount)) return (0, _index.constructFrom)(options?.in || date, NaN); + if (!amount) { + // If 0 months, no-op to avoid changing times in the hour before end of DST + return _date; + } + const dayOfMonth = _date.getDate(); + + // The JS Date object supports date math by accepting out-of-bounds values for + // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and + // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we + // want except that dates will wrap around the end of a month, meaning that + // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So + // we'll default to the end of the desired month by adding 1 to the desired + // month and using a date of 0 to back up one day to the end of the desired + // month. + const endOfDesiredMonth = (0, _index.constructFrom)( + options?.in || date, + _date.getTime(), + ); + endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0); + const daysInMonth = endOfDesiredMonth.getDate(); + if (dayOfMonth >= daysInMonth) { + // If we're already at the end of the month, then this is the correct date + // and we're done. + return endOfDesiredMonth; + } else { + // Otherwise, we now know that setting the original day-of-month value won't + // cause an overflow, so set the desired day-of-month. Note that we can't + // just set the date of `endOfDesiredMonth` because that object may have had + // its time changed in the unusual case where where a DST transition was on + // the last day of the month and its local time was in the hour skipped or + // repeated next to a DST transition. So we use `date` instead which is + // guaranteed to still have the original time. + _date.setFullYear( + endOfDesiredMonth.getFullYear(), + endOfDesiredMonth.getMonth(), + dayOfMonth, + ); + return _date; + } +} + + +/***/ }), + +/***/ 54916: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addQuarters = addQuarters; +var _index = __nccwpck_require__(69793); + +/** + * The {@link addQuarters} function options. + */ + +/** + * @name addQuarters + * @category Quarter Helpers + * @summary Add the specified number of year quarters to the given date. + * + * @description + * Add the specified number of year quarters to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of quarters to be added. + * @param options - An object with options + * + * @returns The new date with the quarters added + * + * @example + * // Add 1 quarter to 1 September 2014: + * const result = addQuarters(new Date(2014, 8, 1), 1) + * //=; Mon Dec 01 2014 00:00:00 + */ +function addQuarters(date, amount, options) { + return (0, _index.addMonths)(date, amount * 3, options); +} + + +/***/ }), + +/***/ 97900: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addSeconds = addSeconds; +var _index = __nccwpck_require__(80006); + +/** + * The {@link addSeconds} function options. + */ + +/** + * @name addSeconds + * @category Second Helpers + * @summary Add the specified number of seconds to the given date. + * + * @description + * Add the specified number of seconds to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of seconds to be added. + * @param options - An object with options + * + * @returns The new date with the seconds added + * + * @example + * // Add 30 seconds to 10 July 2014 12:45:00: + * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) + * //=> Thu Jul 10 2014 12:45:30 + */ +function addSeconds(date, amount, options) { + return (0, _index.addMilliseconds)(date, amount * 1000, options); +} + + +/***/ }), + +/***/ 67385: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addWeeks = addWeeks; +var _index = __nccwpck_require__(7412); + +/** + * The {@link addWeeks} function options. + */ + +/** + * @name addWeeks + * @category Week Helpers + * @summary Add the specified number of weeks to the given date. + * + * @description + * Add the specified number of weeks to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of weeks to be added. + * @param options - An object with options + * + * @returns The new date with the weeks added + * + * @example + * // Add 4 weeks to 1 September 2014: + * const result = addWeeks(new Date(2014, 8, 1), 4) + * //=> Mon Sep 29 2014 00:00:00 + */ +function addWeeks(date, amount, options) { + return (0, _index.addDays)(date, amount * 7, options); +} + + +/***/ }), + +/***/ 30904: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.addYears = addYears; +var _index = __nccwpck_require__(69793); + +/** + * The {@link addYears} function options. + */ + +/** + * @name addYears + * @category Year Helpers + * @summary Add the specified number of years to the given date. + * + * @description + * Add the specified number of years to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type. + * + * @param date - The date to be changed + * @param amount - The amount of years to be added. + * @param options - The options + * + * @returns The new date with the years added + * + * @example + * // Add 5 years to 1 September 2014: + * const result = addYears(new Date(2014, 8, 1), 5) + * //=> Sun Sep 01 2019 00:00:00 + */ +function addYears(date, amount, options) { + return (0, _index.addMonths)(date, amount * 12, options); +} + + +/***/ }), + +/***/ 31262: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.areIntervalsOverlapping = areIntervalsOverlapping; +var _index = __nccwpck_require__(46439); + +/** + * The {@link areIntervalsOverlapping} function options. + */ + +/** + * @name areIntervalsOverlapping + * @category Interval Helpers + * @summary Is the given time interval overlapping with another time interval? + * + * @description + * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`. + * + * @param intervalLeft - The first interval to compare. + * @param intervalRight - The second interval to compare. + * @param options - The object with options + * + * @returns Whether the time intervals are overlapping + * + * @example + * // For overlapping time intervals: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } + * ) + * //=> true + * + * @example + * // For non-overlapping time intervals: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } + * ) + * //=> false + * + * @example + * // For adjacent time intervals: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) } + * ) + * //=> false + * + * @example + * // Using the inclusive option: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }, + * { inclusive: true } + * ) + * //=> true + */ +function areIntervalsOverlapping(intervalLeft, intervalRight, options) { + const [leftStartTime, leftEndTime] = [ + +(0, _index.toDate)(intervalLeft.start, options?.in), + +(0, _index.toDate)(intervalLeft.end, options?.in), + ].sort((a, b) => a - b); + const [rightStartTime, rightEndTime] = [ + +(0, _index.toDate)(intervalRight.start, options?.in), + +(0, _index.toDate)(intervalRight.end, options?.in), + ].sort((a, b) => a - b); + + if (options?.inclusive) + return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime; + + return leftStartTime < rightEndTime && rightStartTime < leftEndTime; +} + + +/***/ }), + +/***/ 32193: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.clamp = clamp; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(57238); +var _index3 = __nccwpck_require__(2651); + +/** + * The {@link clamp} function options. + */ + +/** + * The {@link clamp} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ + +/** + * @name clamp + * @category Interval Helpers + * @summary Return a date bounded by the start and the end of the given interval. + * + * @description + * Clamps a date to the lower bound with the start of the interval and the upper + * bound with the end of the interval. + * + * - When the date is less than the start of the interval, the start is returned. + * - When the date is greater than the end of the interval, the end is returned. + * - Otherwise the date is returned. + * + * @typeParam DateType - Date argument type. + * @typeParam IntervalType - Interval argument type. + * @typeParam Options - Options type. + * + * @param date - The date to be bounded + * @param interval - The interval to bound to + * @param options - An object with options + * + * @returns The date bounded by the start and the end of the interval + * + * @example + * // What is Mar 21, 2021 bounded to an interval starting at Mar 22, 2021 and ending at Apr 01, 2021 + * const result = clamp(new Date(2021, 2, 21), { + * start: new Date(2021, 2, 22), + * end: new Date(2021, 3, 1), + * }) + * //=> Mon Mar 22 2021 00:00:00 + */ +function clamp(date, interval, options) { + const [date_, start, end] = (0, _index.normalizeDates)( + options?.in, + date, + interval.start, + interval.end, + ); + + return (0, _index3.min)( + [(0, _index2.max)([date_, start], options), end], + options, + ); +} + + +/***/ }), + +/***/ 71753: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.closestIndexTo = closestIndexTo; +var _index = __nccwpck_require__(46439); + +/** + * @name closestIndexTo + * @category Common Helpers + * @summary Return an index of the closest date from the array comparing to the given date. + * + * @description + * Return an index of the closest date from the array comparing to the given date. + * + * @param dateToCompare - The date to compare with + * @param dates - The array to search + * + * @returns An index of the date closest to the given date or undefined if no valid value is given + * + * @example + * // Which date is closer to 6 September 2015? + * const dateToCompare = new Date(2015, 8, 6) + * const datesArray = [ + * new Date(2015, 0, 1), + * new Date(2016, 0, 1), + * new Date(2017, 0, 1) + * ] + * const result = closestIndexTo(dateToCompare, datesArray) + * //=> 1 + */ +function closestIndexTo(dateToCompare, dates) { + // [TODO] It would be better to return -1 here rather than undefined, as this + // is how JS behaves, but it would be a breaking change, so we need + // to consider it for v4. + const timeToCompare = +(0, _index.toDate)(dateToCompare); + + if (isNaN(timeToCompare)) return NaN; + + let result; + let minDistance; + dates.forEach((date, index) => { + const date_ = (0, _index.toDate)(date); + + if (isNaN(+date_)) { + result = NaN; + minDistance = NaN; + return; + } + + const distance = Math.abs(timeToCompare - +date_); + if (result == null || distance < minDistance) { + result = index; + minDistance = distance; + } + }); + + return result; +} + + +/***/ }), + +/***/ 22781: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.closestTo = closestTo; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(71753); +var _index3 = __nccwpck_require__(30926); + +/** + * The {@link closestTo} function options. + */ + +/** + * The {@link closestTo} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ + +/** + * @name closestTo + * @category Common Helpers + * @summary Return a date from the array closest to the given date. + * + * @description + * Return a date from the array closest to the given date. + * + * @typeParam DateToCompare - Date to compare argument type. + * @typeParam DatesType - Dates array argument type. + * @typeParam Options - Options type. + * + * @param dateToCompare - The date to compare with + * @param dates - The array to search + * + * @returns The date from the array closest to the given date or undefined if no valid value is given + * + * @example + * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030? + * const dateToCompare = new Date(2015, 8, 6) + * const result = closestTo(dateToCompare, [ + * new Date(2000, 0, 1), + * new Date(2030, 0, 1) + * ]) + * //=> Tue Jan 01 2030 00:00:00 + */ +function closestTo(dateToCompare, dates, options) { + const [dateToCompare_, ...dates_] = (0, _index.normalizeDates)( + options?.in, + dateToCompare, + ...dates, + ); + + const index = (0, _index2.closestIndexTo)(dateToCompare_, dates_); + + if (typeof index === "number" && isNaN(index)) + return (0, _index3.constructFrom)(dateToCompare_, NaN); + + if (index !== undefined) return dates_[index]; +} + + +/***/ }), + +/***/ 30595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.compareAsc = compareAsc; +var _index = __nccwpck_require__(46439); + +/** + * @name compareAsc + * @category Common Helpers + * @summary Compare the two dates and return -1, 0 or 1. + * + * @description + * Compare the two dates and return 1 if the first date is after the second, + * -1 if the first date is before the second or 0 if dates are equal. + * + * @param dateLeft - The first date to compare + * @param dateRight - The second date to compare + * + * @returns The result of the comparison + * + * @example + * // Compare 11 February 1987 and 10 July 1989: + * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10)) + * //=> -1 + * + * @example + * // Sort the array of dates: + * const result = [ + * new Date(1995, 6, 2), + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ].sort(compareAsc) + * //=> [ + * // Wed Feb 11 1987 00:00:00, + * // Mon Jul 10 1989 00:00:00, + * // Sun Jul 02 1995 00:00:00 + * // ] + */ +function compareAsc(dateLeft, dateRight) { + const diff = +(0, _index.toDate)(dateLeft) - +(0, _index.toDate)(dateRight); + + if (diff < 0) return -1; + else if (diff > 0) return 1; + + // Return 0 if diff is 0; return NaN if diff is NaN + return diff; +} + + +/***/ }), + +/***/ 95068: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.compareDesc = compareDesc; +var _index = __nccwpck_require__(46439); + +/** + * @name compareDesc + * @category Common Helpers + * @summary Compare the two dates reverse chronologically and return -1, 0 or 1. + * + * @description + * Compare the two dates and return -1 if the first date is after the second, + * 1 if the first date is before the second or 0 if dates are equal. + * + * @param dateLeft - The first date to compare + * @param dateRight - The second date to compare + * + * @returns The result of the comparison + * + * @example + * // Compare 11 February 1987 and 10 July 1989 reverse chronologically: + * const result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10)) + * //=> 1 + * + * @example + * // Sort the array of dates in reverse chronological order: + * const result = [ + * new Date(1995, 6, 2), + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ].sort(compareDesc) + * //=> [ + * // Sun Jul 02 1995 00:00:00, + * // Mon Jul 10 1989 00:00:00, + * // Wed Feb 11 1987 00:00:00 + * // ] + */ +function compareDesc(dateLeft, dateRight) { + const diff = +(0, _index.toDate)(dateLeft) - +(0, _index.toDate)(dateRight); + + if (diff > 0) return -1; + else if (diff < 0) return 1; + + // Return 0 if diff is 0; return NaN if diff is NaN + return diff; +} + + +/***/ }), + +/***/ 64278: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.secondsInYear = + exports.secondsInWeek = + exports.secondsInQuarter = + exports.secondsInMonth = + exports.secondsInMinute = + exports.secondsInHour = + exports.secondsInDay = + exports.quartersInYear = + exports.monthsInYear = + exports.monthsInQuarter = + exports.minutesInYear = + exports.minutesInMonth = + exports.minutesInHour = + exports.minutesInDay = + exports.minTime = + exports.millisecondsInWeek = + exports.millisecondsInSecond = + exports.millisecondsInMinute = + exports.millisecondsInHour = + exports.millisecondsInDay = + exports.maxTime = + exports.daysInYear = + exports.daysInWeek = + exports.constructFromSymbol = + void 0; /** + * @module constants + * @summary Useful constants + * @description + * Collection of useful date constants. + * + * The constants could be imported from `date-fns/constants`: + * + * ```ts + * import { maxTime, minTime } from "date-fns/constants"; + * + * function isAllowedTime(time) { + * return time <= maxTime && time >= minTime; + * } + * ``` + */ + +/** + * @constant + * @name daysInWeek + * @summary Days in 1 week. + */ +const daysInWeek = (exports.daysInWeek = 7); + +/** + * @constant + * @name daysInYear + * @summary Days in 1 year. + * + * @description + * How many days in a year. + * + * One years equals 365.2425 days according to the formula: + * + * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400. + * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days + */ +const daysInYear = (exports.daysInYear = 365.2425); + +/** + * @constant + * @name maxTime + * @summary Maximum allowed time. + * + * @example + * import { maxTime } from "date-fns/constants"; + * + * const isValid = 8640000000000001 <= maxTime; + * //=> false + * + * new Date(8640000000000001); + * //=> Invalid Date + */ +const maxTime = (exports.maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000); + +/** + * @constant + * @name minTime + * @summary Minimum allowed time. + * + * @example + * import { minTime } from "date-fns/constants"; + * + * const isValid = -8640000000000001 >= minTime; + * //=> false + * + * new Date(-8640000000000001) + * //=> Invalid Date + */ +const minTime = (exports.minTime = -maxTime); + +/** + * @constant + * @name millisecondsInWeek + * @summary Milliseconds in 1 week. + */ +const millisecondsInWeek = (exports.millisecondsInWeek = 604800000); + +/** + * @constant + * @name millisecondsInDay + * @summary Milliseconds in 1 day. + */ +const millisecondsInDay = (exports.millisecondsInDay = 86400000); + +/** + * @constant + * @name millisecondsInMinute + * @summary Milliseconds in 1 minute + */ +const millisecondsInMinute = (exports.millisecondsInMinute = 60000); + +/** + * @constant + * @name millisecondsInHour + * @summary Milliseconds in 1 hour + */ +const millisecondsInHour = (exports.millisecondsInHour = 3600000); + +/** + * @constant + * @name millisecondsInSecond + * @summary Milliseconds in 1 second + */ +const millisecondsInSecond = (exports.millisecondsInSecond = 1000); + +/** + * @constant + * @name minutesInYear + * @summary Minutes in 1 year. + */ +const minutesInYear = (exports.minutesInYear = 525600); + +/** + * @constant + * @name minutesInMonth + * @summary Minutes in 1 month. + */ +const minutesInMonth = (exports.minutesInMonth = 43200); + +/** + * @constant + * @name minutesInDay + * @summary Minutes in 1 day. + */ +const minutesInDay = (exports.minutesInDay = 1440); + +/** + * @constant + * @name minutesInHour + * @summary Minutes in 1 hour. + */ +const minutesInHour = (exports.minutesInHour = 60); + +/** + * @constant + * @name monthsInQuarter + * @summary Months in 1 quarter. + */ +const monthsInQuarter = (exports.monthsInQuarter = 3); + +/** + * @constant + * @name monthsInYear + * @summary Months in 1 year. + */ +const monthsInYear = (exports.monthsInYear = 12); + +/** + * @constant + * @name quartersInYear + * @summary Quarters in 1 year + */ +const quartersInYear = (exports.quartersInYear = 4); + +/** + * @constant + * @name secondsInHour + * @summary Seconds in 1 hour. + */ +const secondsInHour = (exports.secondsInHour = 3600); + +/** + * @constant + * @name secondsInMinute + * @summary Seconds in 1 minute. + */ +const secondsInMinute = (exports.secondsInMinute = 60); + +/** + * @constant + * @name secondsInDay + * @summary Seconds in 1 day. + */ +const secondsInDay = (exports.secondsInDay = secondsInHour * 24); + +/** + * @constant + * @name secondsInWeek + * @summary Seconds in 1 week. + */ +const secondsInWeek = (exports.secondsInWeek = secondsInDay * 7); + +/** + * @constant + * @name secondsInYear + * @summary Seconds in 1 year. + */ +const secondsInYear = (exports.secondsInYear = secondsInDay * daysInYear); + +/** + * @constant + * @name secondsInMonth + * @summary Seconds in 1 month + */ +const secondsInMonth = (exports.secondsInMonth = secondsInYear / 12); + +/** + * @constant + * @name secondsInQuarter + * @summary Seconds in 1 quarter. + */ +const secondsInQuarter = (exports.secondsInQuarter = secondsInMonth * 3); + +/** + * @constant + * @name constructFromSymbol + * @summary Symbol enabling Date extensions to inherit properties from the reference date. + * + * The symbol is used to enable the `constructFrom` function to construct a date + * using a reference date and a value. It allows to transfer extra properties + * from the reference date to the new date. It's useful for extensions like + * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as + * a constructor argument. + */ +const constructFromSymbol = (exports.constructFromSymbol = + Symbol.for("constructDateFrom")); + + +/***/ }), + +/***/ 30926: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.constructFrom = constructFrom; +var _index = __nccwpck_require__(64278); + +/** + * @name constructFrom + * @category Generic Helpers + * @summary Constructs a date using the reference date and the value + * + * @description + * The function constructs a new date using the constructor from the reference + * date and the given value. It helps to build generic functions that accept + * date extensions. + * + * It defaults to `Date` if the passed reference date is a number or a string. + * + * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]` + * enabling to transfer extra properties from the reference date to the new date. + * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz) + * that accept a time zone as a constructor argument. + * + * @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). + * + * @param date - The reference date to take constructor from + * @param value - The value to create the date + * + * @returns Date initialized using the given date and value + * + * @example + * import { constructFrom } from "date-fns"; + * + * // A function that clones a date preserving the original type + * function cloneDate(date: DateType): DateType { + * return constructFrom( + * date, // Use constructor from the given date + * date.getTime() // Use the date value to create a new date + * ); + * } + */ +function constructFrom(date, value) { + if (typeof date === "function") return date(value); + + if (date && typeof date === "object" && _index.constructFromSymbol in date) + return date[_index.constructFromSymbol](value); + + if (date instanceof Date) return new date.constructor(value); + + return new Date(value); +} + + +/***/ }), + +/***/ 18087: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.constructNow = constructNow; +var _index = __nccwpck_require__(30926); + +/** + * @name constructNow + * @category Generic Helpers + * @summary Constructs a new current date using the passed value constructor. + * @pure false + * + * @description + * The function constructs a new current date using the constructor from + * the reference date. It helps to build generic functions that accept date + * extensions and use the current date. + * + * It defaults to `Date` if the passed reference date is a number or a string. + * + * @param date - The reference date to take constructor from + * + * @returns Current date initialized using the given date constructor + * + * @example + * import { constructNow, isSameDay } from 'date-fns' + * + * function isToday( + * date: DateArg, + * ): boolean { + * // If we were to use `new Date()` directly, the function would behave + * // differently in different timezones and return false for the same date. + * return isSameDay(date, constructNow(date)); + * } + */ +function constructNow(date) { + return (0, _index.constructFrom)(date, Date.now()); +} + + +/***/ }), + +/***/ 38113: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.daysToWeeks = daysToWeeks; +var _index = __nccwpck_require__(64278); + +/** + * @name daysToWeeks + * @category Conversion Helpers + * @summary Convert days to weeks. + * + * @description + * Convert a number of days to a full number of weeks. + * + * @param days - The number of days to be converted + * + * @returns The number of days converted in weeks + * + * @example + * // Convert 14 days to weeks: + * const result = daysToWeeks(14) + * //=> 2 + * + * @example + * // It uses trunc rounding: + * const result = daysToWeeks(13) + * //=> 1 + */ +function daysToWeeks(days) { + const result = Math.trunc(days / _index.daysInWeek); + // Prevent negative zero + return result === 0 ? 0 : result; +} + + +/***/ }), + +/***/ 98199: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInBusinessDays = differenceInBusinessDays; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(7412); +var _index3 = __nccwpck_require__(25671); +var _index4 = __nccwpck_require__(4139); +var _index5 = __nccwpck_require__(16142); +var _index6 = __nccwpck_require__(51038); + +/** + * The {@link differenceInBusinessDays} function options. + */ + +/** + * @name differenceInBusinessDays + * @category Day Helpers + * @summary Get the number of business days between the given dates. + * + * @description + * Get the number of business day periods between the given dates. + * Business days being days that aren't in the weekend. + * Like `differenceInCalendarDays`, the function removes the times from + * the dates before calculating the difference. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of business days + * + * @example + * // How many business days are between + * // 10 January 2014 and 20 July 2014? + * const result = differenceInBusinessDays( + * new Date(2014, 6, 20), + * new Date(2014, 0, 10) + * ) + * //=> 136 + * + * // How many business days are between + * // 30 November 2021 and 1 November 2021? + * const result = differenceInBusinessDays( + * new Date(2021, 10, 30), + * new Date(2021, 10, 1) + * ) + * //=> 21 + * + * // How many business days are between + * // 1 November 2021 and 1 December 2021? + * const result = differenceInBusinessDays( + * new Date(2021, 10, 1), + * new Date(2021, 11, 1) + * ) + * //=> -22 + * + * // How many business days are between + * // 1 November 2021 and 1 November 2021 ? + * const result = differenceInBusinessDays( + * new Date(2021, 10, 1), + * new Date(2021, 10, 1) + * ) + * //=> 0 + */ +function differenceInBusinessDays(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + if (!(0, _index5.isValid)(laterDate_) || !(0, _index5.isValid)(earlierDate_)) + return NaN; + + const diff = (0, _index3.differenceInCalendarDays)(laterDate_, earlierDate_); + const sign = diff < 0 ? -1 : 1; + const weeks = Math.trunc(diff / 7); + + let result = weeks * 5; + let movingDate = (0, _index2.addDays)(earlierDate_, weeks * 7); + + // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week + while (!(0, _index4.isSameDay)(laterDate_, movingDate)) { + // sign is used to account for both negative and positive differences + result += (0, _index6.isWeekend)(movingDate, options) ? 0 : sign; + movingDate = (0, _index2.addDays)(movingDate, sign); + } + + // Prevent negative zero + return result === 0 ? 0 : result; +} + + +/***/ }), + +/***/ 25671: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInCalendarDays = differenceInCalendarDays; +var _index = __nccwpck_require__(91546); +var _index2 = __nccwpck_require__(58897); +var _index3 = __nccwpck_require__(64278); +var _index4 = __nccwpck_require__(15951); + +/** + * The {@link differenceInCalendarDays} function options. + */ + +/** + * @name differenceInCalendarDays + * @category Day Helpers + * @summary Get the number of calendar days between the given dates. + * + * @description + * Get the number of calendar days between the given dates. This means that the times are removed + * from the dates and then the difference in days is calculated. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - The options object + * + * @returns The number of calendar days + * + * @example + * // How many calendar days are between + * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? + * const result = differenceInCalendarDays( + * new Date(2012, 6, 2, 0, 0), + * new Date(2011, 6, 2, 23, 0) + * ) + * //=> 366 + * // How many calendar days are between + * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? + * const result = differenceInCalendarDays( + * new Date(2011, 6, 3, 0, 1), + * new Date(2011, 6, 2, 23, 59) + * ) + * //=> 1 + */ +function differenceInCalendarDays(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index2.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + const laterStartOfDay = (0, _index4.startOfDay)(laterDate_); + const earlierStartOfDay = (0, _index4.startOfDay)(earlierDate_); + + const laterTimestamp = + +laterStartOfDay - + (0, _index.getTimezoneOffsetInMilliseconds)(laterStartOfDay); + const earlierTimestamp = + +earlierStartOfDay - + (0, _index.getTimezoneOffsetInMilliseconds)(earlierStartOfDay); + + // Round the number of days to the nearest integer because the number of + // milliseconds in a day is not constant (e.g. it's different in the week of + // the daylight saving time clock shift). + return Math.round( + (laterTimestamp - earlierTimestamp) / _index3.millisecondsInDay, + ); +} + + +/***/ }), + +/***/ 7310: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInCalendarISOWeekYears = differenceInCalendarISOWeekYears; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(47131); + +/** + * The {@link differenceInCalendarISOWeekYears} function options. + */ + +/** + * @name differenceInCalendarISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Get the number of calendar ISO week-numbering years between the given dates. + * + * @description + * Get the number of calendar ISO week-numbering years between the given dates. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of calendar ISO week-numbering years + * + * @example + * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012? + * const result = differenceInCalendarISOWeekYears( + * new Date(2012, 0, 1), + * new Date(2010, 0, 1) + * ) + * //=> 2 + */ +function differenceInCalendarISOWeekYears(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return ( + (0, _index2.getISOWeekYear)(laterDate_, options) - + (0, _index2.getISOWeekYear)(earlierDate_, options) + ); +} + + +/***/ }), + +/***/ 26742: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInCalendarISOWeeks = differenceInCalendarISOWeeks; +var _index = __nccwpck_require__(91546); +var _index2 = __nccwpck_require__(58897); +var _index3 = __nccwpck_require__(64278); +var _index4 = __nccwpck_require__(38516); + +/** + * The {@link differenceInCalendarISOWeeks} function options. + */ + +/** + * @name differenceInCalendarISOWeeks + * @category ISO Week Helpers + * @summary Get the number of calendar ISO weeks between the given dates. + * + * @description + * Get the number of calendar ISO weeks between the given dates. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of calendar ISO weeks + * + * @example + * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014? + * const result = differenceInCalendarISOWeeks( + * new Date(2014, 6, 21), + * new Date(2014, 6, 6), + * ); + * //=> 3 + */ +function differenceInCalendarISOWeeks(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index2.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + const startOfISOWeekLeft = (0, _index4.startOfISOWeek)(laterDate_); + const startOfISOWeekRight = (0, _index4.startOfISOWeek)(earlierDate_); + + const timestampLeft = + +startOfISOWeekLeft - + (0, _index.getTimezoneOffsetInMilliseconds)(startOfISOWeekLeft); + const timestampRight = + +startOfISOWeekRight - + (0, _index.getTimezoneOffsetInMilliseconds)(startOfISOWeekRight); + + // Round the number of weeks to the nearest integer because the number of + // milliseconds in a week is not constant (e.g. it's different in the week of + // the daylight saving time clock shift). + return Math.round( + (timestampLeft - timestampRight) / _index3.millisecondsInWeek, + ); +} + + +/***/ }), + +/***/ 69633: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInCalendarMonths = differenceInCalendarMonths; +var _index = __nccwpck_require__(58897); + +/** + * The {@link differenceInCalendarMonths} function options. + */ + +/** + * @name differenceInCalendarMonths + * @category Month Helpers + * @summary Get the number of calendar months between the given dates. + * + * @description + * Get the number of calendar months between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of calendar months + * + * @example + * // How many calendar months are between 31 January 2014 and 1 September 2014? + * const result = differenceInCalendarMonths( + * new Date(2014, 8, 1), + * new Date(2014, 0, 31) + * ) + * //=> 8 + */ +function differenceInCalendarMonths(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear(); + const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth(); + + return yearsDiff * 12 + monthsDiff; +} + + +/***/ }), + +/***/ 79421: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInCalendarQuarters = differenceInCalendarQuarters; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(46467); + +/** + * The {@link differenceInCalendarQuarters} function options. + */ + +/** + * @name differenceInCalendarQuarters + * @category Quarter Helpers + * @summary Get the number of calendar quarters between the given dates. + * + * @description + * Get the number of calendar quarters between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of calendar quarters + * + * @example + * // How many calendar quarters are between 31 December 2013 and 2 July 2014? + * const result = differenceInCalendarQuarters( + * new Date(2014, 6, 2), + * new Date(2013, 11, 31) + * ) + * //=> 3 + */ +function differenceInCalendarQuarters(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear(); + const quartersDiff = + (0, _index2.getQuarter)(laterDate_) - (0, _index2.getQuarter)(earlierDate_); + + return yearsDiff * 4 + quartersDiff; +} + + +/***/ }), + +/***/ 11464: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInCalendarWeeks = differenceInCalendarWeeks; +var _index = __nccwpck_require__(91546); +var _index2 = __nccwpck_require__(58897); +var _index3 = __nccwpck_require__(64278); +var _index4 = __nccwpck_require__(31284); + +/** + * The {@link differenceInCalendarWeeks} function options. + */ + +/** + * @name differenceInCalendarWeeks + * @category Week Helpers + * @summary Get the number of calendar weeks between the given dates. + * + * @description + * Get the number of calendar weeks between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options. + * + * @returns The number of calendar weeks + * + * @example + * // How many calendar weeks are between 5 July 2014 and 20 July 2014? + * const result = differenceInCalendarWeeks( + * new Date(2014, 6, 20), + * new Date(2014, 6, 5) + * ) + * //=> 3 + * + * @example + * // If the week starts on Monday, + * // how many calendar weeks are between 5 July 2014 and 20 July 2014? + * const result = differenceInCalendarWeeks( + * new Date(2014, 6, 20), + * new Date(2014, 6, 5), + * { weekStartsOn: 1 } + * ) + * //=> 2 + */ +function differenceInCalendarWeeks(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index2.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + const laterStartOfWeek = (0, _index4.startOfWeek)(laterDate_, options); + const earlierStartOfWeek = (0, _index4.startOfWeek)(earlierDate_, options); + + const laterTimestamp = + +laterStartOfWeek - + (0, _index.getTimezoneOffsetInMilliseconds)(laterStartOfWeek); + const earlierTimestamp = + +earlierStartOfWeek - + (0, _index.getTimezoneOffsetInMilliseconds)(earlierStartOfWeek); + + return Math.round( + (laterTimestamp - earlierTimestamp) / _index3.millisecondsInWeek, + ); +} + + +/***/ }), + +/***/ 64472: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInCalendarYears = differenceInCalendarYears; +var _index = __nccwpck_require__(58897); + +/** + * The {@link differenceInCalendarYears} function options. + */ + +/** + * @name differenceInCalendarYears + * @category Year Helpers + * @summary Get the number of calendar years between the given dates. + * + * @description + * Get the number of calendar years between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + + * @returns The number of calendar years + * + * @example + * // How many calendar years are between 31 December 2013 and 11 February 2015? + * const result = differenceInCalendarYears( + * new Date(2015, 1, 11), + * new Date(2013, 11, 31) + * ); + * //=> 2 + */ +function differenceInCalendarYears(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return laterDate_.getFullYear() - earlierDate_.getFullYear(); +} + + +/***/ }), + +/***/ 85554: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInDays = differenceInDays; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(25671); + +/** + * The {@link differenceInDays} function options. + */ + +/** + * @name differenceInDays + * @category Day Helpers + * @summary Get the number of full days between the given dates. + * + * @description + * Get the number of full day periods between two dates. Fractional days are + * truncated towards zero. + * + * One "full day" is the distance between a local time in one day to the same + * local time on the next or previous day. A full day can sometimes be less than + * or more than 24 hours if a daylight savings change happens between two dates. + * + * To ignore DST and only measure exact 24-hour periods, use this instead: + * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of full days according to the local timezone + * + * @example + * // How many full days are between + * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? + * const result = differenceInDays( + * new Date(2012, 6, 2, 0, 0), + * new Date(2011, 6, 2, 23, 0) + * ) + * //=> 365 + * + * @example + * // How many full days are between + * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? + * const result = differenceInDays( + * new Date(2011, 6, 3, 0, 1), + * new Date(2011, 6, 2, 23, 59) + * ) + * //=> 0 + * + * @example + * // How many full days are between + * // 1 March 2020 0:00 and 1 June 2020 0:00 ? + * // Note: because local time is used, the + * // result will always be 92 days, even in + * // time zones where DST starts and the + * // period has only 92*24-1 hours. + * const result = differenceInDays( + * new Date(2020, 5, 1), + * new Date(2020, 2, 1) + * ) + * //=> 92 + */ +function differenceInDays(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + const sign = compareLocalAsc(laterDate_, earlierDate_); + const difference = Math.abs( + (0, _index2.differenceInCalendarDays)(laterDate_, earlierDate_), + ); + + laterDate_.setDate(laterDate_.getDate() - sign * difference); + + // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full + // If so, result must be decreased by 1 in absolute value + const isLastDayNotFull = Number( + compareLocalAsc(laterDate_, earlierDate_) === -sign, + ); + + const result = sign * (difference - isLastDayNotFull); + // Prevent negative zero + return result === 0 ? 0 : result; +} + +// Like `compareAsc` but uses local time not UTC, which is needed +// for accurate equality comparisons of UTC timestamps that end up +// having the same representation in local time, e.g. one hour before +// DST ends vs. the instant that DST ends. +function compareLocalAsc(laterDate, earlierDate) { + const diff = + laterDate.getFullYear() - earlierDate.getFullYear() || + laterDate.getMonth() - earlierDate.getMonth() || + laterDate.getDate() - earlierDate.getDate() || + laterDate.getHours() - earlierDate.getHours() || + laterDate.getMinutes() - earlierDate.getMinutes() || + laterDate.getSeconds() - earlierDate.getSeconds() || + laterDate.getMilliseconds() - earlierDate.getMilliseconds(); + + if (diff < 0) return -1; + if (diff > 0) return 1; + + // Return 0 if diff is 0; return NaN if diff is NaN + return diff; +} + + +/***/ }), + +/***/ 59806: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInHours = differenceInHours; +var _index = __nccwpck_require__(35920); +var _index2 = __nccwpck_require__(58897); +var _index3 = __nccwpck_require__(64278); + +/** + * The {@link differenceInHours} function options. + */ + +/** + * @name differenceInHours + * @category Hour Helpers + * @summary Get the number of hours between the given dates. + * + * @description + * Get the number of hours between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options. + * + * @returns The number of hours + * + * @example + * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00? + * const result = differenceInHours( + * new Date(2014, 6, 2, 19, 0), + * new Date(2014, 6, 2, 6, 50) + * ) + * //=> 12 + */ +function differenceInHours(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index2.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + const diff = (+laterDate_ - +earlierDate_) / _index3.millisecondsInHour; + return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); +} + + +/***/ }), + +/***/ 18475: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInISOWeekYears = differenceInISOWeekYears; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(30595); +var _index3 = __nccwpck_require__(7310); +var _index4 = __nccwpck_require__(42625); + +/** + * The {@link differenceInISOWeekYears} function options. + */ + +/** + * @name differenceInISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Get the number of full ISO week-numbering years between the given dates. + * + * @description + * Get the number of full ISO week-numbering years between the given dates. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - The options + * + * @returns The number of full ISO week-numbering years + * + * @example + * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012? + * const result = differenceInISOWeekYears( + * new Date(2012, 0, 1), + * new Date(2010, 0, 1) + * ) + * // => 1 + */ +function differenceInISOWeekYears(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + const sign = (0, _index2.compareAsc)(laterDate_, earlierDate_); + const diff = Math.abs( + (0, _index3.differenceInCalendarISOWeekYears)( + laterDate_, + earlierDate_, + options, + ), + ); + + const adjustedDate = (0, _index4.subISOWeekYears)( + laterDate_, + sign * diff, + options, + ); + + const isLastISOWeekYearNotFull = Number( + (0, _index2.compareAsc)(adjustedDate, earlierDate_) === -sign, + ); + const result = sign * (diff - isLastISOWeekYearNotFull); + + // Prevent negative zero + return result === 0 ? 0 : result; +} + + +/***/ }), + +/***/ 59013: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInMilliseconds = differenceInMilliseconds; +var _index = __nccwpck_require__(46439); + +/** + * @name differenceInMilliseconds + * @category Millisecond Helpers + * @summary Get the number of milliseconds between the given dates. + * + * @description + * Get the number of milliseconds between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * + * @returns The number of milliseconds + * + * @example + * // How many milliseconds are between + * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700? + * const result = differenceInMilliseconds( + * new Date(2014, 6, 2, 12, 30, 21, 700), + * new Date(2014, 6, 2, 12, 30, 20, 600) + * ) + * //=> 1100 + */ +function differenceInMilliseconds(laterDate, earlierDate) { + return +(0, _index.toDate)(laterDate) - +(0, _index.toDate)(earlierDate); +} + + +/***/ }), + +/***/ 44963: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInMinutes = differenceInMinutes; +var _index = __nccwpck_require__(35920); +var _index2 = __nccwpck_require__(64278); +var _index3 = __nccwpck_require__(59013); + +/** + * The {@link differenceInMinutes} function options. + */ + +/** + * @name differenceInMinutes + * @category Minute Helpers + * @summary Get the number of minutes between the given dates. + * + * @description + * Get the signed number of full (rounded towards 0) minutes between the given dates. + * + * @param dateLeft - The later date + * @param dateRight - The earlier date + * @param options - An object with options. + * + * @returns The number of minutes + * + * @example + * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00? + * const result = differenceInMinutes( + * new Date(2014, 6, 2, 12, 20, 0), + * new Date(2014, 6, 2, 12, 7, 59) + * ) + * //=> 12 + * + * @example + * // How many minutes are between 10:01:59 and 10:00:00 + * const result = differenceInMinutes( + * new Date(2000, 0, 1, 10, 0, 0), + * new Date(2000, 0, 1, 10, 1, 59) + * ) + * //=> -1 + */ +function differenceInMinutes(dateLeft, dateRight, options) { + const diff = + (0, _index3.differenceInMilliseconds)(dateLeft, dateRight) / + _index2.millisecondsInMinute; + return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); +} + + +/***/ }), + +/***/ 41434: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInMonths = differenceInMonths; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(30595); +var _index3 = __nccwpck_require__(69633); +var _index4 = __nccwpck_require__(48454); + +/** + * The {@link differenceInMonths} function options. + */ + +/** + * @name differenceInMonths + * @category Month Helpers + * @summary Get the number of full months between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of full months + * + * @example + * // How many full months are between 31 January 2014 and 1 September 2014? + * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) + * //=> 7 + */ +function differenceInMonths(laterDate, earlierDate, options) { + const [laterDate_, workingLaterDate, earlierDate_] = (0, + _index.normalizeDates)(options?.in, laterDate, laterDate, earlierDate); + + const sign = (0, _index2.compareAsc)(workingLaterDate, earlierDate_); + const difference = Math.abs( + (0, _index3.differenceInCalendarMonths)(workingLaterDate, earlierDate_), + ); + + if (difference < 1) return 0; + + if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27) + workingLaterDate.setDate(30); + + workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference); + + let isLastMonthNotFull = + (0, _index2.compareAsc)(workingLaterDate, earlierDate_) === -sign; + + if ( + (0, _index4.isLastDayOfMonth)(laterDate_) && + difference === 1 && + (0, _index2.compareAsc)(laterDate_, earlierDate_) === 1 + ) { + isLastMonthNotFull = false; + } + + const result = sign * (difference - +isLastMonthNotFull); + return result === 0 ? 0 : result; +} + + +/***/ }), + +/***/ 54121: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInQuarters = differenceInQuarters; +var _index = __nccwpck_require__(35920); +var _index2 = __nccwpck_require__(41434); + +/** + * The {@link differenceInQuarters} function options. + */ + +/** + * @name differenceInQuarters + * @category Quarter Helpers + * @summary Get the number of quarters between the given dates. + * + * @description + * Get the number of quarters between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options. + * + * @returns The number of full quarters + * + * @example + * // How many full quarters are between 31 December 2013 and 2 July 2014? + * const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31)) + * //=> 2 + */ +function differenceInQuarters(laterDate, earlierDate, options) { + const diff = + (0, _index2.differenceInMonths)(laterDate, earlierDate, options) / 3; + return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); +} + + +/***/ }), + +/***/ 95205: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInSeconds = differenceInSeconds; +var _index = __nccwpck_require__(35920); +var _index2 = __nccwpck_require__(59013); + +/** + * The {@link differenceInSeconds} function options. + */ + +/** + * @name differenceInSeconds + * @category Second Helpers + * @summary Get the number of seconds between the given dates. + * + * @description + * Get the number of seconds between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options. + * + * @returns The number of seconds + * + * @example + * // How many seconds are between + * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000? + * const result = differenceInSeconds( + * new Date(2014, 6, 2, 12, 30, 20, 0), + * new Date(2014, 6, 2, 12, 30, 7, 999) + * ) + * //=> 12 + */ +function differenceInSeconds(laterDate, earlierDate, options) { + const diff = + (0, _index2.differenceInMilliseconds)(laterDate, earlierDate) / 1000; + return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); +} + + +/***/ }), + +/***/ 68198: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInWeeks = differenceInWeeks; +var _index = __nccwpck_require__(35920); +var _index2 = __nccwpck_require__(85554); + +/** + * The {@link differenceInWeeks} function options. + */ + +/** + * @name differenceInWeeks + * @category Week Helpers + * @summary Get the number of full weeks between the given dates. + * + * @description + * Get the number of full weeks between two dates. Fractional weeks are + * truncated towards zero by default. + * + * One "full week" is the distance between a local time in one day to the same + * local time 7 days earlier or later. A full week can sometimes be less than + * or more than 7*24 hours if a daylight savings change happens between two dates. + * + * To ignore DST and only measure exact 7*24-hour periods, use this instead: + * `Math.trunc(differenceInHours(dateLeft, dateRight)/(7*24))|0`. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of full weeks + * + * @example + * // How many full weeks are between 5 July 2014 and 20 July 2014? + * const result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5)) + * //=> 2 + * + * @example + * // How many full weeks are between + * // 1 March 2020 0:00 and 6 June 2020 0:00 ? + * // Note: because local time is used, the + * // result will always be 8 weeks (54 days), + * // even if DST starts and the period has + * // only 54*24-1 hours. + * const result = differenceInWeeks( + * new Date(2020, 5, 1), + * new Date(2020, 2, 6) + * ) + * //=> 8 + */ +function differenceInWeeks(laterDate, earlierDate, options) { + const diff = + (0, _index2.differenceInDays)(laterDate, earlierDate, options) / 7; + return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff); +} + + +/***/ }), + +/***/ 52282: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.differenceInYears = differenceInYears; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(30595); +var _index3 = __nccwpck_require__(64472); + +/** + * The {@link differenceInYears} function options. + */ + +/** + * @name differenceInYears + * @category Year Helpers + * @summary Get the number of full years between the given dates. + * + * @description + * Get the number of full years between the given dates. + * + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options + * + * @returns The number of full years + * + * @example + * // How many full years are between 31 December 2013 and 11 February 2015? + * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) + * //=> 1 + */ +function differenceInYears(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + // -1 if the left date is earlier than the right date + // 2023-12-31 - 2024-01-01 = -1 + const sign = (0, _index2.compareAsc)(laterDate_, earlierDate_); + + // First calculate the difference in calendar years + // 2024-01-01 - 2023-12-31 = 1 year + const diff = Math.abs( + (0, _index3.differenceInCalendarYears)(laterDate_, earlierDate_), + ); + + // Now we need to calculate if the difference is full. To do that we set + // both dates to the same year and check if the both date's month and day + // form a full year. + laterDate_.setFullYear(1584); + earlierDate_.setFullYear(1584); + + // For it to be true, when the later date is indeed later than the earlier date + // (2026-02-01 - 2023-12-10 = 3 years), the difference is full if + // the normalized later date is also later than the normalized earlier date. + // In our example, 1584-02-01 is earlier than 1584-12-10, so the difference + // is partial, hence we need to subtract 1 from the difference 3 - 1 = 2. + const partial = (0, _index2.compareAsc)(laterDate_, earlierDate_) === -sign; + + const result = sign * (diff - +partial); + + // Prevent negative zero + return result === 0 ? 0 : result; +} + + +/***/ }), + +/***/ 62837: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachDayOfInterval = eachDayOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(30926); + +/** + * The {@link eachDayOfInterval} function options. + */ + +/** + * The {@link eachDayOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ + +/** + * @name eachDayOfInterval + * @category Interval Helpers + * @summary Return the array of dates within the specified time interval. + * + * @description + * Return the array of dates within the specified time interval. + * + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. + * + * @param interval - The interval. + * @param options - An object with options. + * + * @returns The array with starts of days from the day of the interval start to the day of the interval end + * + * @example + * // Each day between 6 October 2014 and 10 October 2014: + * const result = eachDayOfInterval({ + * start: new Date(2014, 9, 6), + * end: new Date(2014, 9, 10) + * }) + * //=> [ + * // Mon Oct 06 2014 00:00:00, + * // Tue Oct 07 2014 00:00:00, + * // Wed Oct 08 2014 00:00:00, + * // Thu Oct 09 2014 00:00:00, + * // Fri Oct 10 2014 00:00:00 + * // ] + */ +function eachDayOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setHours(0, 0, 0, 0); + + let step = options?.step ?? 1; + if (!step) return []; + if (step < 0) { + step = -step; + reversed = !reversed; + } + + const dates = []; + + while (+date <= endTime) { + dates.push((0, _index2.constructFrom)(start, date)); + date.setDate(date.getDate() + step); + date.setHours(0, 0, 0, 0); + } + + return reversed ? dates.reverse() : dates; +} + + +/***/ }), + +/***/ 83012: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachHourOfInterval = eachHourOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(30926); + +/** + * The {@link eachHourOfInterval} function options. + */ + +/** + * The {@link eachHourOfInterval} function result type. + * Resolves to the appropriate date type based on inputs. + */ + +/** + * @name eachHourOfInterval + * @category Interval Helpers + * @summary Return the array of hours within the specified time interval. + * + * @description + * Return the array of hours within the specified time interval. + * + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. + * + * @param interval - The interval. + * @param options - An object with options. + * + * @returns The array with starts of hours from the hour of the interval start to the hour of the interval end + * + * @example + * // Each hour between 6 October 2014, 12:00 and 6 October 2014, 15:00 + * const result = eachHourOfInterval({ + * start: new Date(2014, 9, 6, 12), + * end: new Date(2014, 9, 6, 15) + * }); + * //=> [ + * // Mon Oct 06 2014 12:00:00, + * // Mon Oct 06 2014 13:00:00, + * // Mon Oct 06 2014 14:00:00, + * // Mon Oct 06 2014 15:00:00 + * // ] + */ +function eachHourOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setMinutes(0, 0, 0); + + let step = options?.step ?? 1; + if (!step) return []; + if (step < 0) { + step = -step; + reversed = !reversed; + } + + const dates = []; + + while (+date <= endTime) { + dates.push((0, _index2.constructFrom)(start, date)); + date.setHours(date.getHours() + step); + } + + return reversed ? dates.reverse() : dates; +} + + +/***/ }), + +/***/ 49911: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachMinuteOfInterval = eachMinuteOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(85223); +var _index3 = __nccwpck_require__(30926); + +/** + * The {@link eachMinuteOfInterval} function options. + */ + +/** + * The {@link eachMinuteOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ + +/** + * @name eachMinuteOfInterval + * @category Interval Helpers + * @summary Return the array of minutes within the specified time interval. + * + * @description + * Returns the array of minutes within the specified time interval. + * + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. + * + * @param interval - The interval. + * @param options - An object with options. + * + * @returns The array with starts of minutes from the minute of the interval start to the minute of the interval end + * + * @example + * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03 + * const result = eachMinuteOfInterval({ + * start: new Date(2014, 9, 14, 13), + * end: new Date(2014, 9, 14, 13, 3) + * }) + * //=> [ + * // Wed Oct 14 2014 13:00:00, + * // Wed Oct 14 2014 13:01:00, + * // Wed Oct 14 2014 13:02:00, + * // Wed Oct 14 2014 13:03:00 + * // ] + */ +function eachMinuteOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + // Set to the start of the minute + start.setSeconds(0, 0); + + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + let date = reversed ? end : start; + + let step = options?.step ?? 1; + if (!step) return []; + if (step < 0) { + step = -step; + reversed = !reversed; + } + + const dates = []; + + while (+date <= endTime) { + dates.push((0, _index3.constructFrom)(start, date)); + date = (0, _index2.addMinutes)(date, step); + } + + return reversed ? dates.reverse() : dates; +} + + +/***/ }), + +/***/ 20355: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachMonthOfInterval = eachMonthOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(30926); + +/** + * The {@link eachMonthOfInterval} function options. + */ + +/** + * The {@link eachMonthOfInterval} function result type. It resolves the proper data type. + */ + +/** + * @name eachMonthOfInterval + * @category Interval Helpers + * @summary Return the array of months within the specified time interval. + * + * @description + * Return the array of months within the specified time interval. + * + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. + * + * @param interval - The interval. + * @param options - An object with options. + * + * @returns The array with starts of months from the month of the interval start to the month of the interval end + * + * @example + * // Each month between 6 February 2014 and 10 August 2014: + * const result = eachMonthOfInterval({ + * start: new Date(2014, 1, 6), + * end: new Date(2014, 7, 10) + * }) + * //=> [ + * // Sat Feb 01 2014 00:00:00, + * // Sat Mar 01 2014 00:00:00, + * // Tue Apr 01 2014 00:00:00, + * // Thu May 01 2014 00:00:00, + * // Sun Jun 01 2014 00:00:00, + * // Tue Jul 01 2014 00:00:00, + * // Fri Aug 01 2014 00:00:00 + * // ] + */ +function eachMonthOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setHours(0, 0, 0, 0); + date.setDate(1); + + let step = options?.step ?? 1; + if (!step) return []; + if (step < 0) { + step = -step; + reversed = !reversed; + } + + const dates = []; + + while (+date <= endTime) { + dates.push((0, _index2.constructFrom)(start, date)); + date.setMonth(date.getMonth() + step); + } + + return reversed ? dates.reverse() : dates; +} + + +/***/ }), + +/***/ 82712: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachQuarterOfInterval = eachQuarterOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(54916); +var _index3 = __nccwpck_require__(30926); +var _index4 = __nccwpck_require__(77136); + +/** + * The {@link eachQuarterOfInterval} function options. + */ + +/** + * The {@link eachQuarterOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ + +/** + * @name eachQuarterOfInterval + * @category Interval Helpers + * @summary Return the array of quarters within the specified time interval. + * + * @description + * Return the array of quarters within the specified time interval. + * + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. + * + * @param interval - The interval + * @param options - An object with options + * + * @returns The array with starts of quarters from the quarter of the interval start to the quarter of the interval end + * + * @example + * // Each quarter within interval 6 February 2014 - 10 August 2014: + * const result = eachQuarterOfInterval({ + * start: new Date(2014, 1, 6), + * end: new Date(2014, 7, 10), + * }) + * //=> [ + * // Wed Jan 01 2014 00:00:00, + * // Tue Apr 01 2014 00:00:00, + * // Tue Jul 01 2014 00:00:00, + * // ] + */ +function eachQuarterOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + + let reversed = +start > +end; + const endTime = reversed + ? +(0, _index4.startOfQuarter)(start) + : +(0, _index4.startOfQuarter)(end); + let date = reversed + ? (0, _index4.startOfQuarter)(end) + : (0, _index4.startOfQuarter)(start); + + let step = options?.step ?? 1; + if (!step) return []; + if (step < 0) { + step = -step; + reversed = !reversed; + } + + const dates = []; + + while (+date <= endTime) { + dates.push((0, _index3.constructFrom)(start, date)); + date = (0, _index2.addQuarters)(date, step); + } + + return reversed ? dates.reverse() : dates; +} + + +/***/ }), + +/***/ 66940: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachWeekOfInterval = eachWeekOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(67385); +var _index3 = __nccwpck_require__(30926); +var _index4 = __nccwpck_require__(31284); + +/** + * The {@link eachWeekOfInterval} function options. + */ + +/** + * The {@link eachWeekOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the interval start date, + * then the end interval date. If a context function is passed, it uses the context function return type. + */ + +/** + * @name eachWeekOfInterval + * @category Interval Helpers + * @summary Return the array of weeks within the specified time interval. + * + * @description + * Return the array of weeks within the specified time interval. + * + * @param interval - The interval. + * @param options - An object with options. + * + * @returns The array with starts of weeks from the week of the interval start to the week of the interval end + * + * @example + * // Each week within interval 6 October 2014 - 23 November 2014: + * const result = eachWeekOfInterval({ + * start: new Date(2014, 9, 6), + * end: new Date(2014, 10, 23) + * }) + * //=> [ + * // Sun Oct 05 2014 00:00:00, + * // Sun Oct 12 2014 00:00:00, + * // Sun Oct 19 2014 00:00:00, + * // Sun Oct 26 2014 00:00:00, + * // Sun Nov 02 2014 00:00:00, + * // Sun Nov 09 2014 00:00:00, + * // Sun Nov 16 2014 00:00:00, + * // Sun Nov 23 2014 00:00:00 + * // ] + */ +function eachWeekOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + + let reversed = +start > +end; + const startDateWeek = reversed + ? (0, _index4.startOfWeek)(end, options) + : (0, _index4.startOfWeek)(start, options); + const endDateWeek = reversed + ? (0, _index4.startOfWeek)(start, options) + : (0, _index4.startOfWeek)(end, options); + + startDateWeek.setHours(15); + endDateWeek.setHours(15); + + const endTime = +endDateWeek.getTime(); + let currentDate = startDateWeek; + + let step = options?.step ?? 1; + if (!step) return []; + if (step < 0) { + step = -step; + reversed = !reversed; + } + + const dates = []; + + while (+currentDate <= endTime) { + currentDate.setHours(0); + dates.push((0, _index3.constructFrom)(start, currentDate)); + currentDate = (0, _index2.addWeeks)(currentDate, step); + currentDate.setHours(15); + } + + return reversed ? dates.reverse() : dates; +} + + +/***/ }), + +/***/ 5790: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachWeekendOfInterval = eachWeekendOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(30926); +var _index3 = __nccwpck_require__(62837); +var _index4 = __nccwpck_require__(51038); + +/** + * The {@link eachWeekendOfInterval} function options. + */ + +/** + * The {@link eachWeekendOfInterval} function result type. + */ + +/** + * @name eachWeekendOfInterval + * @category Interval Helpers + * @summary List all the Saturdays and Sundays in the given date interval. + * + * @description + * Get all the Saturdays and Sundays in the given date interval. + * + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. + * + * @param interval - The given interval + * @param options - An object with options + * + * @returns An array containing all the Saturdays and Sundays + * + * @example + * // Lists all Saturdays and Sundays in the given date interval + * const result = eachWeekendOfInterval({ + * start: new Date(2018, 8, 17), + * end: new Date(2018, 8, 30) + * }) + * //=> [ + * // Sat Sep 22 2018 00:00:00, + * // Sun Sep 23 2018 00:00:00, + * // Sat Sep 29 2018 00:00:00, + * // Sun Sep 30 2018 00:00:00 + * // ] + */ +function eachWeekendOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + const dateInterval = (0, _index3.eachDayOfInterval)({ start, end }, options); + const weekends = []; + let index = 0; + while (index < dateInterval.length) { + const date = dateInterval[index++]; + if ((0, _index4.isWeekend)(date)) + weekends.push((0, _index2.constructFrom)(start, date)); + } + return weekends; +} + + +/***/ }), + +/***/ 70025: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachWeekendOfMonth = eachWeekendOfMonth; +var _index = __nccwpck_require__(5790); +var _index2 = __nccwpck_require__(2127); +var _index3 = __nccwpck_require__(22709); + +/** + * The {@link eachWeekendOfMonth} function options. + */ + +/** + * @name eachWeekendOfMonth + * @category Month Helpers + * @summary List all the Saturdays and Sundays in the given month. + * + * @description + * Get all the Saturdays and Sundays in the given month. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The given month + * @param options - An object with options + * + * @returns An array containing all the Saturdays and Sundays + * + * @example + * // Lists all Saturdays and Sundays in the given month + * const result = eachWeekendOfMonth(new Date(2022, 1, 1)) + * //=> [ + * // Sat Feb 05 2022 00:00:00, + * // Sun Feb 06 2022 00:00:00, + * // Sat Feb 12 2022 00:00:00, + * // Sun Feb 13 2022 00:00:00, + * // Sat Feb 19 2022 00:00:00, + * // Sun Feb 20 2022 00:00:00, + * // Sat Feb 26 2022 00:00:00, + * // Sun Feb 27 2022 00:00:00 + * // ] + */ +function eachWeekendOfMonth(date, options) { + const start = (0, _index3.startOfMonth)(date, options); + const end = (0, _index2.endOfMonth)(date, options); + return (0, _index.eachWeekendOfInterval)({ start, end }, options); +} + + +/***/ }), + +/***/ 19682: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachWeekendOfYear = eachWeekendOfYear; +var _index = __nccwpck_require__(5790); +var _index2 = __nccwpck_require__(82501); +var _index3 = __nccwpck_require__(68537); + +/** + * The {@link eachWeekendOfYear} function options. + */ + +/** + * @name eachWeekendOfYear + * @category Year Helpers + * @summary List all the Saturdays and Sundays in the year. + * + * @description + * Get all the Saturdays and Sundays in the year. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The given year + * @param options - An object with options + * + * @returns An array containing all the Saturdays and Sundays + * + * @example + * // Lists all Saturdays and Sundays in the year + * const result = eachWeekendOfYear(new Date(2020, 1, 1)) + * //=> [ + * // Sat Jan 03 2020 00:00:00, + * // Sun Jan 04 2020 00:00:00, + * // ... + * // Sun Dec 27 2020 00:00:00 + * // ] + * ] + */ +function eachWeekendOfYear(date, options) { + const start = (0, _index3.startOfYear)(date, options); + const end = (0, _index2.endOfYear)(date, options); + return (0, _index.eachWeekendOfInterval)({ start, end }, options); +} + + +/***/ }), + +/***/ 52422: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.eachYearOfInterval = eachYearOfInterval; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(30926); + +/** + * The {@link eachYearOfInterval} function options. + */ + +/** + * The {@link eachYearOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ + +/** + * @name eachYearOfInterval + * @category Interval Helpers + * @summary Return the array of yearly timestamps within the specified time interval. + * + * @description + * Return the array of yearly timestamps within the specified time interval. + * + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. + * + * @param interval - The interval. + * @param options - An object with options. + * + * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end + * + * @example + * // Each year between 6 February 2014 and 10 August 2017: + * const result = eachYearOfInterval({ + * start: new Date(2014, 1, 6), + * end: new Date(2017, 7, 10) + * }) + * //=> [ + * // Wed Jan 01 2014 00:00:00, + * // Thu Jan 01 2015 00:00:00, + * // Fri Jan 01 2016 00:00:00, + * // Sun Jan 01 2017 00:00:00 + * // ] + */ +function eachYearOfInterval(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setHours(0, 0, 0, 0); + date.setMonth(0, 1); + + let step = options?.step ?? 1; + if (!step) return []; + if (step < 0) { + step = -step; + reversed = !reversed; + } + + const dates = []; + + while (+date <= endTime) { + dates.push((0, _index2.constructFrom)(start, date)); + date.setFullYear(date.getFullYear() + step); + } + + return reversed ? dates.reverse() : dates; +} + + +/***/ }), + +/***/ 79982: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfDay = endOfDay; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfDay} function options. + */ + +/** + * @name endOfDay + * @category Day Helpers + * @summary Return the end of a day for the given date. + * + * @description + * Return the end of a day for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of a day + * + * @example + * // The end of a day for 2 September 2014 11:55:00: + * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 02 2014 23:59:59.999 + */ +function endOfDay(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setHours(23, 59, 59, 999); + return _date; +} + + +/***/ }), + +/***/ 78899: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfDecade = endOfDecade; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfDecade} function options. + */ + +/** + * @name endOfDecade + * @category Decade Helpers + * @summary Return the end of a decade for the given date. + * + * @description + * Return the end of a decade for the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of a decade + * + * @example + * // The end of a decade for 12 May 1984 00:00:00: + * const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00)) + * //=> Dec 31 1989 23:59:59.999 + */ +function endOfDecade(date, options) { + // TODO: Switch to more technical definition in of decades that start with 1 + // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking + // change, so it can only be done in 4.0. + const _date = (0, _index.toDate)(date, options?.in); + const year = _date.getFullYear(); + const decade = 9 + Math.floor(year / 10) * 10; + _date.setFullYear(decade, 11, 31); + _date.setHours(23, 59, 59, 999); + return _date; +} + + +/***/ }), + +/***/ 59773: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfHour = endOfHour; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfHour} function options. + */ + +/** + * @name endOfHour + * @category Hour Helpers + * @summary Return the end of an hour for the given date. + * + * @description + * Return the end of an hour for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of an hour + * + * @example + * // The end of an hour for 2 September 2014 11:55:00: + * const result = endOfHour(new Date(2014, 8, 2, 11, 55)) + * //=> Tue Sep 02 2014 11:59:59.999 + */ +function endOfHour(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setMinutes(59, 59, 999); + return _date; +} + + +/***/ }), + +/***/ 77055: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfISOWeek = endOfISOWeek; +var _index = __nccwpck_require__(69945); + +/** + * The {@link endOfISOWeek} function options. + */ + +/** + * @name endOfISOWeek + * @category ISO Week Helpers + * @summary Return the end of an ISO week for the given date. + * + * @description + * Return the end of an ISO week for the given date. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of an ISO week + * + * @example + * // The end of an ISO week for 2 September 2014 11:55:00: + * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sun Sep 07 2014 23:59:59.999 + */ +function endOfISOWeek(date, options) { + return (0, _index.endOfWeek)(date, { ...options, weekStartsOn: 1 }); +} + + +/***/ }), + +/***/ 62423: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfISOWeekYear = endOfISOWeekYear; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(47131); +var _index3 = __nccwpck_require__(38516); + +/** + * The {@link endOfISOWeekYear} function options. + */ + +/** + * @name endOfISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Return the end of an ISO week-numbering year for the given date. + * + * @description + * Return the end of an ISO week-numbering year, + * which always starts 3 days before the year's first Thursday. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ContextDate - The `Date` type of the context function. + * + * @param date - The original date + * @param options - The options + * + * @returns The end of an ISO week-numbering year + * + * @example + * // The end of an ISO week-numbering year for 2 July 2005: + * const result = endOfISOWeekYear(new Date(2005, 6, 2)) + * //=> Sun Jan 01 2006 23:59:59.999 + */ +function endOfISOWeekYear(date, options) { + const year = (0, _index2.getISOWeekYear)(date, options); + const fourthOfJanuaryOfNextYear = (0, _index.constructFrom)( + options?.in || date, + 0, + ); + fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); + const _date = (0, _index3.startOfISOWeek)(fourthOfJanuaryOfNextYear, options); + _date.setMilliseconds(_date.getMilliseconds() - 1); + return _date; +} + + +/***/ }), + +/***/ 24387: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfMinute = endOfMinute; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfMinute} function options. + */ + +/** + * @name endOfMinute + * @category Minute Helpers + * @summary Return the end of a minute for the given date. + * + * @description + * Return the end of a minute for the given date. + * The result will be in the local timezone or the provided context. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of a minute + * + * @example + * // The end of a minute for 1 December 2014 22:15:45.400: + * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:59.999 + */ +function endOfMinute(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setSeconds(59, 999); + return _date; +} + + +/***/ }), + +/***/ 2127: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfMonth = endOfMonth; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfMonth} function options. + */ + +/** + * @name endOfMonth + * @category Month Helpers + * @summary Return the end of a month for the given date. + * + * @description + * Return the end of a month for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of a month + * + * @example + * // The end of a month for 2 September 2014 11:55:00: + * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 23:59:59.999 + */ +function endOfMonth(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const month = _date.getMonth(); + _date.setFullYear(_date.getFullYear(), month + 1, 0); + _date.setHours(23, 59, 59, 999); + return _date; +} + + +/***/ }), + +/***/ 86868: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfQuarter = endOfQuarter; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfQuarter} function options. + */ + +/** + * @name endOfQuarter + * @category Quarter Helpers + * @summary Return the end of a year quarter for the given date. + * + * @description + * Return the end of a year quarter for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of a quarter + * + * @example + * // The end of a quarter for 2 September 2014 11:55:00: + * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 23:59:59.999 + */ +function endOfQuarter(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const currentMonth = _date.getMonth(); + const month = currentMonth - (currentMonth % 3) + 3; + _date.setMonth(month, 0); + _date.setHours(23, 59, 59, 999); + return _date; +} + + +/***/ }), + +/***/ 51541: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfSecond = endOfSecond; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfSecond} function options. + */ + +/** + * @name endOfSecond + * @category Second Helpers + * @summary Return the end of a second for the given date. + * + * @description + * Return the end of a second for the given date. + * The result will be in the local timezone if no `in` option is specified. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of a second + * + * @example + * // The end of a second for 1 December 2014 22:15:45.400: + * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:45.999 + */ +function endOfSecond(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setMilliseconds(999); + return _date; +} + + +/***/ }), + +/***/ 72177: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfToday = endOfToday; +var _index = __nccwpck_require__(79982); + +/** + * The {@link endOfToday} function options. + */ + +/** + * @name endOfToday + * @category Day Helpers + * @summary Return the end of today. + * @pure false + * + * @description + * Return the end of today. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param options - The options + * + * @returns The end of today + * + * @example + * // If today is 6 October 2014: + * const result = endOfToday() + * //=> Mon Oct 6 2014 23:59:59.999 + */ +function endOfToday(options) { + return (0, _index.endOfDay)(Date.now(), options); +} + + +/***/ }), + +/***/ 97267: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfTomorrow = endOfTomorrow; +var _index = __nccwpck_require__(18087); + +/** + * The {@link endOfTomorrow} function options. + */ + +/** + * @name endOfTomorrow + * @category Day Helpers + * @summary Return the end of tomorrow. + * @pure false + * + * @description + * Return the end of tomorrow. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param options - The options + * @returns The end of tomorrow + * + * @example + * // If today is 6 October 2014: + * const result = endOfTomorrow() + * //=> Tue Oct 7 2014 23:59:59.999 + */ +function endOfTomorrow(options) { + const now = (0, _index.constructNow)(options?.in); + const year = now.getFullYear(); + const month = now.getMonth(); + const day = now.getDate(); + + const date = (0, _index.constructNow)(options?.in); + date.setFullYear(year, month, day + 1); + date.setHours(23, 59, 59, 999); + return options?.in ? options.in(date) : date; +} + + +/***/ }), + +/***/ 69945: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfWeek = endOfWeek; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link endOfWeek} function options. + */ + +/** + * @name endOfWeek + * @category Week Helpers + * @summary Return the end of a week for the given date. + * + * @description + * Return the end of a week for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of a week + * + * @example + * // The end of a week for 2 September 2014 11:55:00: + * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sat Sep 06 2014 23:59:59.999 + * + * @example + * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00: + * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) + * //=> Sun Sep 07 2014 23:59:59.999 + */ +function endOfWeek(date, options) { + const defaultOptions = (0, _index.getDefaultOptions)(); + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; + + const _date = (0, _index2.toDate)(date, options?.in); + const day = _date.getDay(); + const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); + + _date.setDate(_date.getDate() + diff); + _date.setHours(23, 59, 59, 999); + return _date; +} + + +/***/ }), + +/***/ 82501: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfYear = endOfYear; +var _index = __nccwpck_require__(46439); + +/** + * The {@link endOfYear} function options. + */ + +/** + * @name endOfYear + * @category Year Helpers + * @summary Return the end of a year for the given date. + * + * @description + * Return the end of a year for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - The options + * + * @returns The end of a year + * + * @example + * // The end of a year for 2 September 2014 11:55:00: + * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Wed Dec 31 2014 23:59:59.999 + */ +function endOfYear(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const year = _date.getFullYear(); + _date.setFullYear(year + 1, 0, 0); + _date.setHours(23, 59, 59, 999); + return _date; +} + + +/***/ }), + +/***/ 53445: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.endOfYesterday = endOfYesterday; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); + +/** + * The {@link endOfYesterday} function options. + */ + +/** + * @name endOfYesterday + * @category Day Helpers + * @summary Return the end of yesterday. + * @pure false + * + * @description + * Return the end of yesterday. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @returns The end of yesterday + * + * @example + * // If today is 6 October 2014: + * const result = endOfYesterday() + * //=> Sun Oct 5 2014 23:59:59.999 + */ +function endOfYesterday(options) { + const now = (0, _index2.constructNow)(options?.in); + const date = (0, _index.constructFrom)(options?.in, 0); + date.setFullYear(now.getFullYear(), now.getMonth(), now.getDate() - 1); + date.setHours(23, 59, 59, 999); + return date; +} + + +/***/ }), + +/***/ 42464: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.format = exports.formatDate = format; +Object.defineProperty(exports, "formatters", ({ + enumerable: true, + get: function () { + return _index3.formatters; + }, +})); +Object.defineProperty(exports, "longFormatters", ({ + enumerable: true, + get: function () { + return _index4.longFormatters; + }, +})); +var _index = __nccwpck_require__(7479); +var _index2 = __nccwpck_require__(35586); +var _index3 = __nccwpck_require__(56615); +var _index4 = __nccwpck_require__(46376); +var _index5 = __nccwpck_require__(53554); + +var _index6 = __nccwpck_require__(16142); +var _index7 = __nccwpck_require__(46439); + +// Rexports of internal for libraries to use. +// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 + +// This RegExp consists of three parts separated by `|`: +// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token +// (one of the certain letters followed by `o`) +// - (\w)\1* matches any sequences of the same letter +// - '' matches two quote characters in a row +// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), +// except a single quote symbol, which ends the sequence. +// Two quote characters do not end the sequence. +// If there is no matching single quote +// then the sequence will continue until the end of the string. +// - . matches any single character unmatched by previous parts of the RegExps +const formattingTokensRegExp = + /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; + +// This RegExp catches symbols escaped by quotes, and also +// sequences of symbols P, p, and the combinations like `PPPPPPPppppp` +const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; + +const escapedStringRegExp = /^'([^]*?)'?$/; +const doubleQuoteRegExp = /''/g; +const unescapedLatinCharacterRegExp = /[a-zA-Z]/; + +/** + * The {@link format} function options. + */ + +/** + * @name format + * @alias formatDate + * @category Common Helpers + * @summary Format the date. + * + * @description + * Return the formatted date string in the given format. The result may vary by locale. + * + * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. + * (see the last example) + * + * Format of the string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * with a few additions (see note 7 below the table). + * + * Accepted patterns: + * | Unit | Pattern | Result examples | Notes | + * |---------------------------------|---------|-----------------------------------|-------| + * | Era | G..GGG | AD, BC | | + * | | GGGG | Anno Domini, Before Christ | 2 | + * | | GGGGG | A, B | | + * | Calendar year | y | 44, 1, 1900, 2017 | 5 | + * | | yo | 44th, 1st, 0th, 17th | 5,7 | + * | | yy | 44, 01, 00, 17 | 5 | + * | | yyy | 044, 001, 1900, 2017 | 5 | + * | | yyyy | 0044, 0001, 1900, 2017 | 5 | + * | | yyyyy | ... | 3,5 | + * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 | + * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 | + * | | YY | 44, 01, 00, 17 | 5,8 | + * | | YYY | 044, 001, 1900, 2017 | 5 | + * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 | + * | | YYYYY | ... | 3,5 | + * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 | + * | | RR | -43, 00, 01, 1900, 2017 | 5,7 | + * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 | + * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 | + * | | RRRRR | ... | 3,5,7 | + * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 | + * | | uu | -43, 01, 1900, 2017 | 5 | + * | | uuu | -043, 001, 1900, 2017 | 5 | + * | | uuuu | -0043, 0001, 1900, 2017 | 5 | + * | | uuuuu | ... | 3,5 | + * | Quarter (formatting) | Q | 1, 2, 3, 4 | | + * | | Qo | 1st, 2nd, 3rd, 4th | 7 | + * | | QQ | 01, 02, 03, 04 | | + * | | QQQ | Q1, Q2, Q3, Q4 | | + * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | + * | | QQQQQ | 1, 2, 3, 4 | 4 | + * | Quarter (stand-alone) | q | 1, 2, 3, 4 | | + * | | qo | 1st, 2nd, 3rd, 4th | 7 | + * | | qq | 01, 02, 03, 04 | | + * | | qqq | Q1, Q2, Q3, Q4 | | + * | | qqqq | 1st quarter, 2nd quarter, ... | 2 | + * | | qqqqq | 1, 2, 3, 4 | 4 | + * | Month (formatting) | M | 1, 2, ..., 12 | | + * | | Mo | 1st, 2nd, ..., 12th | 7 | + * | | MM | 01, 02, ..., 12 | | + * | | MMM | Jan, Feb, ..., Dec | | + * | | MMMM | January, February, ..., December | 2 | + * | | MMMMM | J, F, ..., D | | + * | Month (stand-alone) | L | 1, 2, ..., 12 | | + * | | Lo | 1st, 2nd, ..., 12th | 7 | + * | | LL | 01, 02, ..., 12 | | + * | | LLL | Jan, Feb, ..., Dec | | + * | | LLLL | January, February, ..., December | 2 | + * | | LLLLL | J, F, ..., D | | + * | Local week of year | w | 1, 2, ..., 53 | | + * | | wo | 1st, 2nd, ..., 53th | 7 | + * | | ww | 01, 02, ..., 53 | | + * | ISO week of year | I | 1, 2, ..., 53 | 7 | + * | | Io | 1st, 2nd, ..., 53th | 7 | + * | | II | 01, 02, ..., 53 | 7 | + * | Day of month | d | 1, 2, ..., 31 | | + * | | do | 1st, 2nd, ..., 31st | 7 | + * | | dd | 01, 02, ..., 31 | | + * | Day of year | D | 1, 2, ..., 365, 366 | 9 | + * | | Do | 1st, 2nd, ..., 365th, 366th | 7 | + * | | DD | 01, 02, ..., 365, 366 | 9 | + * | | DDD | 001, 002, ..., 365, 366 | | + * | | DDDD | ... | 3 | + * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | | + * | | EEEE | Monday, Tuesday, ..., Sunday | 2 | + * | | EEEEE | M, T, W, T, F, S, S | | + * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | + * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 | + * | | io | 1st, 2nd, ..., 7th | 7 | + * | | ii | 01, 02, ..., 07 | 7 | + * | | iii | Mon, Tue, Wed, ..., Sun | 7 | + * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 | + * | | iiiii | M, T, W, T, F, S, S | 7 | + * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 | + * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | | + * | | eo | 2nd, 3rd, ..., 1st | 7 | + * | | ee | 02, 03, ..., 01 | | + * | | eee | Mon, Tue, Wed, ..., Sun | | + * | | eeee | Monday, Tuesday, ..., Sunday | 2 | + * | | eeeee | M, T, W, T, F, S, S | | + * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | + * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | | + * | | co | 2nd, 3rd, ..., 1st | 7 | + * | | cc | 02, 03, ..., 01 | | + * | | ccc | Mon, Tue, Wed, ..., Sun | | + * | | cccc | Monday, Tuesday, ..., Sunday | 2 | + * | | ccccc | M, T, W, T, F, S, S | | + * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | + * | AM, PM | a..aa | AM, PM | | + * | | aaa | am, pm | | + * | | aaaa | a.m., p.m. | 2 | + * | | aaaaa | a, p | | + * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | | + * | | bbb | am, pm, noon, midnight | | + * | | bbbb | a.m., p.m., noon, midnight | 2 | + * | | bbbbb | a, p, n, mi | | + * | Flexible day period | B..BBB | at night, in the morning, ... | | + * | | BBBB | at night, in the morning, ... | 2 | + * | | BBBBB | at night, in the morning, ... | | + * | Hour [1-12] | h | 1, 2, ..., 11, 12 | | + * | | ho | 1st, 2nd, ..., 11th, 12th | 7 | + * | | hh | 01, 02, ..., 11, 12 | | + * | Hour [0-23] | H | 0, 1, 2, ..., 23 | | + * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 | + * | | HH | 00, 01, 02, ..., 23 | | + * | Hour [0-11] | K | 1, 2, ..., 11, 0 | | + * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 | + * | | KK | 01, 02, ..., 11, 00 | | + * | Hour [1-24] | k | 24, 1, 2, ..., 23 | | + * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 | + * | | kk | 24, 01, 02, ..., 23 | | + * | Minute | m | 0, 1, ..., 59 | | + * | | mo | 0th, 1st, ..., 59th | 7 | + * | | mm | 00, 01, ..., 59 | | + * | Second | s | 0, 1, ..., 59 | | + * | | so | 0th, 1st, ..., 59th | 7 | + * | | ss | 00, 01, ..., 59 | | + * | Fraction of second | S | 0, 1, ..., 9 | | + * | | SS | 00, 01, ..., 99 | | + * | | SSS | 000, 001, ..., 999 | | + * | | SSSS | ... | 3 | + * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | | + * | | XX | -0800, +0530, Z | | + * | | XXX | -08:00, +05:30, Z | | + * | | XXXX | -0800, +0530, Z, +123456 | 2 | + * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | + * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | | + * | | xx | -0800, +0530, +0000 | | + * | | xxx | -08:00, +05:30, +00:00 | 2 | + * | | xxxx | -0800, +0530, +0000, +123456 | | + * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | + * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | | + * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 | + * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 | + * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 | + * | Seconds timestamp | t | 512969520 | 7 | + * | | tt | ... | 3,7 | + * | Milliseconds timestamp | T | 512969520900 | 7 | + * | | TT | ... | 3,7 | + * | Long localized date | P | 04/29/1453 | 7 | + * | | PP | Apr 29, 1453 | 7 | + * | | PPP | April 29th, 1453 | 7 | + * | | PPPP | Friday, April 29th, 1453 | 2,7 | + * | Long localized time | p | 12:00 AM | 7 | + * | | pp | 12:00:00 AM | 7 | + * | | ppp | 12:00:00 AM GMT+2 | 7 | + * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 | + * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 | + * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 | + * | | PPPppp | April 29th, 1453 at ... | 7 | + * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 | + * Notes: + * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale + * are the same as "stand-alone" units, but are different in some languages. + * "Formatting" units are declined according to the rules of the language + * in the context of a date. "Stand-alone" units are always nominative singular: + * + * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` + * + * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` + * + * 2. Any sequence of the identical letters is a pattern, unless it is escaped by + * the single quote characters (see below). + * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`) + * the output will be the same as default pattern for this unit, usually + * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units + * are marked with "2" in the last column of the table. + * + * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'` + * + * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'` + * + * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'` + * + * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'` + * + * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'` + * + * 3. Some patterns could be unlimited length (such as `yyyyyyyy`). + * The output will be padded with zeros to match the length of the pattern. + * + * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'` + * + * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. + * These tokens represent the shortest form of the quarter. + * + * 5. The main difference between `y` and `u` patterns are B.C. years: + * + * | Year | `y` | `u` | + * |------|-----|-----| + * | AC 1 | 1 | 1 | + * | BC 1 | 1 | 0 | + * | BC 2 | 2 | -1 | + * + * Also `yy` always returns the last two digits of a year, + * while `uu` pads single digit years to 2 characters and returns other years unchanged: + * + * | Year | `yy` | `uu` | + * |------|------|------| + * | 1 | 01 | 01 | + * | 14 | 14 | 14 | + * | 376 | 76 | 376 | + * | 1453 | 53 | 1453 | + * + * The same difference is true for local and ISO week-numbering years (`Y` and `R`), + * except local week-numbering years are dependent on `options.weekStartsOn` + * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear) + * and [getWeekYear](https://date-fns.org/docs/getWeekYear)). + * + * 6. Specific non-location timezones are currently unavailable in `date-fns`, + * so right now these tokens fall back to GMT timezones. + * + * 7. These patterns are not in the Unicode Technical Standard #35: + * - `i`: ISO day of week + * - `I`: ISO week of year + * - `R`: ISO week-numbering year + * - `t`: seconds timestamp + * - `T`: milliseconds timestamp + * - `o`: ordinal number modifier + * - `P`: long localized date + * - `p`: long localized time + * + * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. + * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. + * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * @param date - The original date + * @param format - The string of tokens + * @param options - An object with options + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * @throws `options.locale` must contain `localize` property + * @throws `options.locale` must contain `formatLong` property + * @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 + * @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 + * @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 + * @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 + * @throws format string contains an unescaped latin alphabet character + * + * @example + * // Represent 11 February 2014 in middle-endian format: + * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy') + * //=> '02/11/2014' + * + * @example + * // Represent 2 July 2014 in Esperanto: + * import { eoLocale } from 'date-fns/locale/eo' + * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", { + * locale: eoLocale + * }) + * //=> '2-a de julio 2014' + * + * @example + * // Escape string by single quote characters: + * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'") + * //=> "3 o'clock" + */ +function format(date, formatStr, options) { + const defaultOptions = (0, _index2.getDefaultOptions)(); + const locale = + options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; + + const firstWeekContainsDate = + options?.firstWeekContainsDate ?? + options?.locale?.options?.firstWeekContainsDate ?? + defaultOptions.firstWeekContainsDate ?? + defaultOptions.locale?.options?.firstWeekContainsDate ?? + 1; + + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; + + const originalDate = (0, _index7.toDate)(date, options?.in); + + if (!(0, _index6.isValid)(originalDate)) { + throw new RangeError("Invalid time value"); + } + + let parts = formatStr + .match(longFormattingTokensRegExp) + .map((substring) => { + const firstCharacter = substring[0]; + if (firstCharacter === "p" || firstCharacter === "P") { + const longFormatter = _index4.longFormatters[firstCharacter]; + return longFormatter(substring, locale.formatLong); + } + return substring; + }) + .join("") + .match(formattingTokensRegExp) + .map((substring) => { + // Replace two single quote characters with one single quote character + if (substring === "''") { + return { isToken: false, value: "'" }; + } + + const firstCharacter = substring[0]; + if (firstCharacter === "'") { + return { isToken: false, value: cleanEscapedString(substring) }; + } + + if (_index3.formatters[firstCharacter]) { + return { isToken: true, value: substring }; + } + + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { + throw new RangeError( + "Format string contains an unescaped latin alphabet character `" + + firstCharacter + + "`", + ); + } + + return { isToken: false, value: substring }; + }); + + // invoke localize preprocessor (only for french locales at the moment) + if (locale.localize.preprocessor) { + parts = locale.localize.preprocessor(originalDate, parts); + } + + const formatterOptions = { + firstWeekContainsDate, + weekStartsOn, + locale, + }; + + return parts + .map((part) => { + if (!part.isToken) return part.value; + + const token = part.value; + + if ( + (!options?.useAdditionalWeekYearTokens && + (0, _index5.isProtectedWeekYearToken)(token)) || + (!options?.useAdditionalDayOfYearTokens && + (0, _index5.isProtectedDayOfYearToken)(token)) + ) { + (0, _index5.warnOrThrowProtectedError)(token, formatStr, String(date)); + } + + const formatter = _index3.formatters[token[0]]; + return formatter(originalDate, token, locale.localize, formatterOptions); + }) + .join(""); +} + +function cleanEscapedString(input) { + const matched = input.match(escapedStringRegExp); + + if (!matched) { + return input; + } + + return matched[1].replace(doubleQuoteRegExp, "'"); +} + + +/***/ }), + +/***/ 20109: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatDistance = formatDistance; +var _index = __nccwpck_require__(7479); +var _index2 = __nccwpck_require__(35586); +var _index3 = __nccwpck_require__(91546); +var _index4 = __nccwpck_require__(58897); +var _index5 = __nccwpck_require__(30595); +var _index6 = __nccwpck_require__(64278); +var _index7 = __nccwpck_require__(41434); +var _index8 = __nccwpck_require__(95205); + +/** + * The {@link formatDistance} function options. + */ + +/** + * @name formatDistance + * @category Common Helpers + * @summary Return the distance between the given dates in words. + * + * @description + * Return the distance between the given dates in words. + * + * | Distance between dates | Result | + * |-------------------------------------------------------------------|---------------------| + * | 0 ... 30 secs | less than a minute | + * | 30 secs ... 1 min 30 secs | 1 minute | + * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | + * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | + * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | + * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | + * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | + * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | + * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | + * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | + * | 1 yr ... 1 yr 3 months | about 1 year | + * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | + * | 1 yr 9 months ... 2 yrs | almost 2 years | + * | N yrs ... N yrs 3 months | about N years | + * | N yrs 3 months ... N yrs 9 months | over N years | + * | N yrs 9 months ... N+1 yrs | almost N+1 years | + * + * With `options.includeSeconds == true`: + * | Distance between dates | Result | + * |------------------------|----------------------| + * | 0 secs ... 5 secs | less than 5 seconds | + * | 5 secs ... 10 secs | less than 10 seconds | + * | 10 secs ... 20 secs | less than 20 seconds | + * | 20 secs ... 40 secs | half a minute | + * | 40 secs ... 60 secs | less than a minute | + * | 60 secs ... 90 secs | 1 minute | + * + * @param laterDate - The date + * @param earlierDate - The date to compare with + * @param options - An object with options + * + * @returns The distance in words + * + * @throws `date` must not be Invalid Date + * @throws `baseDate` must not be Invalid Date + * @throws `options.locale` must contain `formatDistance` property + * + * @example + * // What is the distance between 2 July 2014 and 1 January 2015? + * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1)) + * //=> '6 months' + * + * @example + * // What is the distance between 1 January 2015 00:00:15 + * // and 1 January 2015 00:00:00, including seconds? + * const result = formatDistance( + * new Date(2015, 0, 1, 0, 0, 15), + * new Date(2015, 0, 1, 0, 0, 0), + * { includeSeconds: true } + * ) + * //=> 'less than 20 seconds' + * + * @example + * // What is the distance from 1 January 2016 + * // to 1 January 2015, with a suffix? + * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), { + * addSuffix: true + * }) + * //=> 'about 1 year ago' + * + * @example + * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? + * import { eoLocale } from 'date-fns/locale/eo' + * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), { + * locale: eoLocale + * }) + * //=> 'pli ol 1 jaro' + */ +function formatDistance(laterDate, earlierDate, options) { + const defaultOptions = (0, _index2.getDefaultOptions)(); + const locale = + options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; + const minutesInAlmostTwoDays = 2520; + + const comparison = (0, _index5.compareAsc)(laterDate, earlierDate); + + if (isNaN(comparison)) throw new RangeError("Invalid time value"); + + const localizeOptions = Object.assign({}, options, { + addSuffix: options?.addSuffix, + comparison: comparison, + }); + + const [laterDate_, earlierDate_] = (0, _index4.normalizeDates)( + options?.in, + ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]), + ); + + const seconds = (0, _index8.differenceInSeconds)(earlierDate_, laterDate_); + const offsetInSeconds = + ((0, _index3.getTimezoneOffsetInMilliseconds)(earlierDate_) - + (0, _index3.getTimezoneOffsetInMilliseconds)(laterDate_)) / + 1000; + const minutes = Math.round((seconds - offsetInSeconds) / 60); + let months; + + // 0 up to 2 mins + if (minutes < 2) { + if (options?.includeSeconds) { + if (seconds < 5) { + return locale.formatDistance("lessThanXSeconds", 5, localizeOptions); + } else if (seconds < 10) { + return locale.formatDistance("lessThanXSeconds", 10, localizeOptions); + } else if (seconds < 20) { + return locale.formatDistance("lessThanXSeconds", 20, localizeOptions); + } else if (seconds < 40) { + return locale.formatDistance("halfAMinute", 0, localizeOptions); + } else if (seconds < 60) { + return locale.formatDistance("lessThanXMinutes", 1, localizeOptions); + } else { + return locale.formatDistance("xMinutes", 1, localizeOptions); + } + } else { + if (minutes === 0) { + return locale.formatDistance("lessThanXMinutes", 1, localizeOptions); + } else { + return locale.formatDistance("xMinutes", minutes, localizeOptions); + } + } + + // 2 mins up to 0.75 hrs + } else if (minutes < 45) { + return locale.formatDistance("xMinutes", minutes, localizeOptions); + + // 0.75 hrs up to 1.5 hrs + } else if (minutes < 90) { + return locale.formatDistance("aboutXHours", 1, localizeOptions); + + // 1.5 hrs up to 24 hrs + } else if (minutes < _index6.minutesInDay) { + const hours = Math.round(minutes / 60); + return locale.formatDistance("aboutXHours", hours, localizeOptions); + + // 1 day up to 1.75 days + } else if (minutes < minutesInAlmostTwoDays) { + return locale.formatDistance("xDays", 1, localizeOptions); + + // 1.75 days up to 30 days + } else if (minutes < _index6.minutesInMonth) { + const days = Math.round(minutes / _index6.minutesInDay); + return locale.formatDistance("xDays", days, localizeOptions); + + // 1 month up to 2 months + } else if (minutes < _index6.minutesInMonth * 2) { + months = Math.round(minutes / _index6.minutesInMonth); + return locale.formatDistance("aboutXMonths", months, localizeOptions); + } + + months = (0, _index7.differenceInMonths)(earlierDate_, laterDate_); + + // 2 months up to 12 months + if (months < 12) { + const nearestMonth = Math.round(minutes / _index6.minutesInMonth); + return locale.formatDistance("xMonths", nearestMonth, localizeOptions); + + // 1 year up to max Date + } else { + const monthsSinceStartOfYear = months % 12; + const years = Math.trunc(months / 12); + + // N years up to 1 years 3 months + if (monthsSinceStartOfYear < 3) { + return locale.formatDistance("aboutXYears", years, localizeOptions); + + // N years 3 months up to N years 9 months + } else if (monthsSinceStartOfYear < 9) { + return locale.formatDistance("overXYears", years, localizeOptions); + + // N years 9 months up to N year 12 months + } else { + return locale.formatDistance("almostXYears", years + 1, localizeOptions); + } + } +} + + +/***/ }), + +/***/ 11746: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatDistanceStrict = formatDistanceStrict; +var _index = __nccwpck_require__(7479); +var _index2 = __nccwpck_require__(35586); +var _index3 = __nccwpck_require__(35920); +var _index4 = __nccwpck_require__(91546); +var _index5 = __nccwpck_require__(58897); +var _index6 = __nccwpck_require__(30595); +var _index7 = __nccwpck_require__(64278); + +/** + * The {@link formatDistanceStrict} function options. + */ + +/** + * The unit used to format the distance in {@link formatDistanceStrict}. + */ + +/** + * @name formatDistanceStrict + * @category Common Helpers + * @summary Return the distance between the given dates in words. + * + * @description + * Return the distance between the given dates in words, using strict units. + * This is like `formatDistance`, but does not use helpers like 'almost', 'over', + * 'less than' and the like. + * + * | Distance between dates | Result | + * |------------------------|---------------------| + * | 0 ... 59 secs | [0..59] seconds | + * | 1 ... 59 mins | [1..59] minutes | + * | 1 ... 23 hrs | [1..23] hours | + * | 1 ... 29 days | [1..29] days | + * | 1 ... 11 months | [1..11] months | + * | 1 ... N years | [1..N] years | + * + * @param laterDate - The date + * @param earlierDate - The date to compare with + * @param options - An object with options + * + * @returns The distance in words + * + * @throws `date` must not be Invalid Date + * @throws `baseDate` must not be Invalid Date + * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year' + * @throws `options.locale` must contain `formatDistance` property + * + * @example + * // What is the distance between 2 July 2014 and 1 January 2015? + * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2)) + * //=> '6 months' + * + * @example + * // What is the distance between 1 January 2015 00:00:15 + * // and 1 January 2015 00:00:00? + * const result = formatDistanceStrict( + * new Date(2015, 0, 1, 0, 0, 15), + * new Date(2015, 0, 1, 0, 0, 0) + * ) + * //=> '15 seconds' + * + * @example + * // What is the distance from 1 January 2016 + * // to 1 January 2015, with a suffix? + * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), { + * addSuffix: true + * }) + * //=> '1 year ago' + * + * @example + * // What is the distance from 1 January 2016 + * // to 1 January 2015, in minutes? + * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), { + * unit: 'minute' + * }) + * //=> '525600 minutes' + * + * @example + * // What is the distance from 1 January 2015 + * // to 28 January 2015, in months, rounded up? + * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), { + * unit: 'month', + * roundingMethod: 'ceil' + * }) + * //=> '1 month' + * + * @example + * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? + * import { eoLocale } from 'date-fns/locale/eo' + * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), { + * locale: eoLocale + * }) + * //=> '1 jaro' + */ + +function formatDistanceStrict(laterDate, earlierDate, options) { + const defaultOptions = (0, _index2.getDefaultOptions)(); + const locale = + options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; + + const comparison = (0, _index6.compareAsc)(laterDate, earlierDate); + + if (isNaN(comparison)) { + throw new RangeError("Invalid time value"); + } + + const localizeOptions = Object.assign({}, options, { + addSuffix: options?.addSuffix, + comparison: comparison, + }); + + const [laterDate_, earlierDate_] = (0, _index5.normalizeDates)( + options?.in, + ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]), + ); + + const roundingMethod = (0, _index3.getRoundingMethod)( + options?.roundingMethod ?? "round", + ); + + const milliseconds = earlierDate_.getTime() - laterDate_.getTime(); + const minutes = milliseconds / _index7.millisecondsInMinute; + + const timezoneOffset = + (0, _index4.getTimezoneOffsetInMilliseconds)(earlierDate_) - + (0, _index4.getTimezoneOffsetInMilliseconds)(laterDate_); + + // Use DST-normalized difference in minutes for years, months and days; + // use regular difference in minutes for hours, minutes and seconds. + const dstNormalizedMinutes = + (milliseconds - timezoneOffset) / _index7.millisecondsInMinute; + + const defaultUnit = options?.unit; + let unit; + if (!defaultUnit) { + if (minutes < 1) { + unit = "second"; + } else if (minutes < 60) { + unit = "minute"; + } else if (minutes < _index7.minutesInDay) { + unit = "hour"; + } else if (dstNormalizedMinutes < _index7.minutesInMonth) { + unit = "day"; + } else if (dstNormalizedMinutes < _index7.minutesInYear) { + unit = "month"; + } else { + unit = "year"; + } + } else { + unit = defaultUnit; + } + + // 0 up to 60 seconds + if (unit === "second") { + const seconds = roundingMethod(milliseconds / 1000); + return locale.formatDistance("xSeconds", seconds, localizeOptions); + + // 1 up to 60 mins + } else if (unit === "minute") { + const roundedMinutes = roundingMethod(minutes); + return locale.formatDistance("xMinutes", roundedMinutes, localizeOptions); + + // 1 up to 24 hours + } else if (unit === "hour") { + const hours = roundingMethod(minutes / 60); + return locale.formatDistance("xHours", hours, localizeOptions); + + // 1 up to 30 days + } else if (unit === "day") { + const days = roundingMethod(dstNormalizedMinutes / _index7.minutesInDay); + return locale.formatDistance("xDays", days, localizeOptions); + + // 1 up to 12 months + } else if (unit === "month") { + const months = roundingMethod( + dstNormalizedMinutes / _index7.minutesInMonth, + ); + return months === 12 && defaultUnit !== "month" + ? locale.formatDistance("xYears", 1, localizeOptions) + : locale.formatDistance("xMonths", months, localizeOptions); + + // 1 year up to max Date + } else { + const years = roundingMethod(dstNormalizedMinutes / _index7.minutesInYear); + return locale.formatDistance("xYears", years, localizeOptions); + } +} + + +/***/ }), + +/***/ 99608: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatDistanceToNow = formatDistanceToNow; +var _index = __nccwpck_require__(18087); + +var _index2 = __nccwpck_require__(20109); + +/** + * The {@link formatDistanceToNow} function options. + */ + +/** + * @name formatDistanceToNow + * @category Common Helpers + * @summary Return the distance between the given date and now in words. + * @pure false + * + * @description + * Return the distance between the given date and now in words. + * + * | Distance to now | Result | + * |-------------------------------------------------------------------|---------------------| + * | 0 ... 30 secs | less than a minute | + * | 30 secs ... 1 min 30 secs | 1 minute | + * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | + * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | + * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | + * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | + * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | + * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | + * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | + * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | + * | 1 yr ... 1 yr 3 months | about 1 year | + * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | + * | 1 yr 9 months ... 2 yrs | almost 2 years | + * | N yrs ... N yrs 3 months | about N years | + * | N yrs 3 months ... N yrs 9 months | over N years | + * | N yrs 9 months ... N+1 yrs | almost N+1 years | + * + * With `options.includeSeconds == true`: + * | Distance to now | Result | + * |---------------------|----------------------| + * | 0 secs ... 5 secs | less than 5 seconds | + * | 5 secs ... 10 secs | less than 10 seconds | + * | 10 secs ... 20 secs | less than 20 seconds | + * | 20 secs ... 40 secs | half a minute | + * | 40 secs ... 60 secs | less than a minute | + * | 60 secs ... 90 secs | 1 minute | + * + * @param date - The given date + * @param options - The object with options + * + * @returns The distance in words + * + * @throws `date` must not be Invalid Date + * @throws `options.locale` must contain `formatDistance` property + * + * @example + * // If today is 1 January 2015, what is the distance to 2 July 2014? + * const result = formatDistanceToNow( + * new Date(2014, 6, 2) + * ) + * //=> '6 months' + * + * @example + * // If now is 1 January 2015 00:00:00, + * // what is the distance to 1 January 2015 00:00:15, including seconds? + * const result = formatDistanceToNow( + * new Date(2015, 0, 1, 0, 0, 15), + * {includeSeconds: true} + * ) + * //=> 'less than 20 seconds' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 January 2016, with a suffix? + * const result = formatDistanceToNow( + * new Date(2016, 0, 1), + * {addSuffix: true} + * ) + * //=> 'in about 1 year' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 August 2016 in Esperanto? + * const eoLocale = require('date-fns/locale/eo') + * const result = formatDistanceToNow( + * new Date(2016, 7, 1), + * {locale: eoLocale} + * ) + * //=> 'pli ol 1 jaro' + */ +function formatDistanceToNow(date, options) { + return (0, _index2.formatDistance)( + date, + (0, _index.constructNow)(date), + options, + ); +} + + +/***/ }), + +/***/ 45718: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatDistanceToNowStrict = formatDistanceToNowStrict; +var _index = __nccwpck_require__(18087); + +var _index2 = __nccwpck_require__(11746); + +/** + * The {@link formatDistanceToNowStrict} function options. + */ + +/** + * @name formatDistanceToNowStrict + * @category Common Helpers + * @summary Return the distance between the given date and now in words. + * @pure false + * + * @description + * Return the distance between the given dates in words, using strict units. + * This is like `formatDistance`, but does not use helpers like 'almost', 'over', + * 'less than' and the like. + * + * | Distance between dates | Result | + * |------------------------|---------------------| + * | 0 ... 59 secs | [0..59] seconds | + * | 1 ... 59 mins | [1..59] minutes | + * | 1 ... 23 hrs | [1..23] hours | + * | 1 ... 29 days | [1..29] days | + * | 1 ... 11 months | [1..11] months | + * | 1 ... N years | [1..N] years | + * + * @param date - The given date + * @param options - An object with options. + * + * @returns The distance in words + * + * @throws `date` must not be Invalid Date + * @throws `options.locale` must contain `formatDistance` property + * + * @example + * // If today is 1 January 2015, what is the distance to 2 July 2014? + * const result = formatDistanceToNowStrict( + * new Date(2014, 6, 2) + * ) + * //=> '6 months' + * + * @example + * // If now is 1 January 2015 00:00:00, + * // what is the distance to 1 January 2015 00:00:15, including seconds? + * const result = formatDistanceToNowStrict( + * new Date(2015, 0, 1, 0, 0, 15) + * ) + * //=> '15 seconds' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 January 2016, with a suffix? + * const result = formatDistanceToNowStrict( + * new Date(2016, 0, 1), + * {addSuffix: true} + * ) + * //=> 'in 1 year' + * + * @example + * // If today is 28 January 2015, + * // what is the distance to 1 January 2015, in months, rounded up?? + * const result = formatDistanceToNowStrict(new Date(2015, 0, 1), { + * unit: 'month', + * roundingMethod: 'ceil' + * }) + * //=> '1 month' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 January 2016 in Esperanto? + * const eoLocale = require('date-fns/locale/eo') + * const result = formatDistanceToNowStrict( + * new Date(2016, 0, 1), + * {locale: eoLocale} + * ) + * //=> '1 jaro' + */ +function formatDistanceToNowStrict(date, options) { + return (0, _index2.formatDistanceStrict)( + date, + (0, _index.constructNow)(date), + options, + ); +} + + +/***/ }), + +/***/ 25405: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatDuration = formatDuration; + +var _index = __nccwpck_require__(7479); +var _index2 = __nccwpck_require__(35586); + +/** + * The {@link formatDuration} function options. + */ + +const defaultFormat = [ + "years", + "months", + "weeks", + "days", + "hours", + "minutes", + "seconds", +]; + +/** + * @name formatDuration + * @category Common Helpers + * @summary Formats a duration in human-readable format + * + * @description + * Return human-readable duration string i.e. "9 months 2 days" + * + * @param duration - The duration to format + * @param options - An object with options. + * + * @returns The formatted date string + * + * @example + * // Format full duration + * formatDuration({ + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }) + * //=> '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds' + * + * @example + * // Format partial duration + * formatDuration({ months: 9, days: 2 }) + * //=> '9 months 2 days' + * + * @example + * // Customize the format + * formatDuration( + * { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }, + * { format: ['months', 'weeks'] } + * ) === '9 months 1 week' + * + * @example + * // Customize the zeros presence + * formatDuration({ years: 0, months: 9 }) + * //=> '9 months' + * formatDuration({ years: 0, months: 9 }, { zero: true }) + * //=> '0 years 9 months' + * + * @example + * // Customize the delimiter + * formatDuration({ years: 2, months: 9, weeks: 3 }, { delimiter: ', ' }) + * //=> '2 years, 9 months, 3 weeks' + */ +function formatDuration(duration, options) { + const defaultOptions = (0, _index2.getDefaultOptions)(); + const locale = + options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; + const format = options?.format ?? defaultFormat; + const zero = options?.zero ?? false; + const delimiter = options?.delimiter ?? " "; + + if (!locale.formatDistance) { + return ""; + } + + const result = format + .reduce((acc, unit) => { + const token = `x${unit.replace(/(^.)/, (m) => m.toUpperCase())}`; + const value = duration[unit]; + if (value !== undefined && (zero || duration[unit])) { + return acc.concat(locale.formatDistance(token, value)); + } + return acc; + }, []) + .join(delimiter); + + return result; +} + + +/***/ }), + +/***/ 37235: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatISO = formatISO; +var _index = __nccwpck_require__(36411); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link formatISO} function options. + */ + +/** + * @name formatISO + * @category Common Helpers + * @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). + * + * @description + * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date. + * + * @param date - The original date + * @param options - An object with options. + * + * @returns The formatted date string (in local time zone) + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC): + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52)) + * //=> '2019-09-18T19:00:52Z' + * + * @example + * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC): + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' }) + * //=> '20190918T190052' + * + * @example + * // Represent 18 September 2019 in ISO 8601 format, date only: + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' }) + * //=> '2019-09-18' + * + * @example + * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC): + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) + * //=> '19:00:52Z' + */ +function formatISO(date, options) { + const date_ = (0, _index2.toDate)(date, options?.in); + + if (isNaN(+date_)) { + throw new RangeError("Invalid time value"); + } + + const format = options?.format ?? "extended"; + const representation = options?.representation ?? "complete"; + + let result = ""; + let tzOffset = ""; + + const dateDelimiter = format === "extended" ? "-" : ""; + const timeDelimiter = format === "extended" ? ":" : ""; + + // Representation is either 'date' or 'complete' + if (representation !== "time") { + const day = (0, _index.addLeadingZeros)(date_.getDate(), 2); + const month = (0, _index.addLeadingZeros)(date_.getMonth() + 1, 2); + const year = (0, _index.addLeadingZeros)(date_.getFullYear(), 4); + + // yyyyMMdd or yyyy-MM-dd. + result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`; + } + + // Representation is either 'time' or 'complete' + if (representation !== "date") { + // Add the timezone. + const offset = date_.getTimezoneOffset(); + + if (offset !== 0) { + const absoluteOffset = Math.abs(offset); + const hourOffset = (0, _index.addLeadingZeros)( + Math.trunc(absoluteOffset / 60), + 2, + ); + const minuteOffset = (0, _index.addLeadingZeros)(absoluteOffset % 60, 2); + // If less than 0, the sign is +, because it is ahead of time. + const sign = offset < 0 ? "+" : "-"; + + tzOffset = `${sign}${hourOffset}:${minuteOffset}`; + } else { + tzOffset = "Z"; + } + + const hour = (0, _index.addLeadingZeros)(date_.getHours(), 2); + const minute = (0, _index.addLeadingZeros)(date_.getMinutes(), 2); + const second = (0, _index.addLeadingZeros)(date_.getSeconds(), 2); + + // If there's also date, separate it with time with 'T' + const separator = result === "" ? "" : "T"; + + // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined. + const time = [hour, minute, second].join(timeDelimiter); + + // HHmmss or HH:mm:ss. + result = `${result}${separator}${time}${tzOffset}`; + } + + return result; +} + + +/***/ }), + +/***/ 5230: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatISO9075 = formatISO9075; +var _index = __nccwpck_require__(36411); +var _index2 = __nccwpck_require__(16142); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link formatISO9075} function options. + */ + +/** + * @name formatISO9075 + * @category Common Helpers + * @summary Format the date according to the ISO 9075 standard (https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_get-format). + * + * @description + * Return the formatted date string in ISO 9075 format. Options may be passed to control the parts and notations of the date. + * + * @param date - The original date + * @param options - An object with options. + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 18 September 2019 in ISO 9075 format: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52)) + * //=> '2019-09-18 19:00:52' + * + * @example + * // Represent 18 September 2019 in ISO 9075, short format: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' }) + * //=> '20190918 190052' + * + * @example + * // Represent 18 September 2019 in ISO 9075 format, date only: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' }) + * //=> '2019-09-18' + * + * @example + * // Represent 18 September 2019 in ISO 9075 format, time only: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) + * //=> '19:00:52' + */ +function formatISO9075(date, options) { + const date_ = (0, _index3.toDate)(date, options?.in); + + if (!(0, _index2.isValid)(date_)) { + throw new RangeError("Invalid time value"); + } + + const format = options?.format ?? "extended"; + const representation = options?.representation ?? "complete"; + + let result = ""; + + const dateDelimiter = format === "extended" ? "-" : ""; + const timeDelimiter = format === "extended" ? ":" : ""; + + // Representation is either 'date' or 'complete' + if (representation !== "time") { + const day = (0, _index.addLeadingZeros)(date_.getDate(), 2); + const month = (0, _index.addLeadingZeros)(date_.getMonth() + 1, 2); + const year = (0, _index.addLeadingZeros)(date_.getFullYear(), 4); + + // yyyyMMdd or yyyy-MM-dd. + result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`; + } + + // Representation is either 'time' or 'complete' + if (representation !== "date") { + const hour = (0, _index.addLeadingZeros)(date_.getHours(), 2); + const minute = (0, _index.addLeadingZeros)(date_.getMinutes(), 2); + const second = (0, _index.addLeadingZeros)(date_.getSeconds(), 2); + + // If there's also date, separate it with time with a space + const separator = result === "" ? "" : " "; + + // HHmmss or HH:mm:ss. + result = `${result}${separator}${hour}${timeDelimiter}${minute}${timeDelimiter}${second}`; + } + + return result; +} + + +/***/ }), + +/***/ 47818: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.formatISODuration = formatISODuration; + +/** + * @name formatISODuration + * @category Common Helpers + * @summary Format a duration object according as ISO 8601 duration string + * + * @description + * Format a duration object according to the ISO 8601 duration standard (https://www.digi.com/resources/documentation/digidocs//90001488-13/reference/r_iso_8601_duration_format.htm) + * + * @param duration - The duration to format + * + * @returns The ISO 8601 duration string + * + * @example + * // Format the given duration as ISO 8601 string + * const result = formatISODuration({ + * years: 39, + * months: 2, + * days: 20, + * hours: 7, + * minutes: 5, + * seconds: 0 + * }) + * //=> 'P39Y2M20DT0H0M0S' + */ +function formatISODuration(duration) { + const { + years = 0, + months = 0, + days = 0, + hours = 0, + minutes = 0, + seconds = 0, + } = duration; + + return `P${years}Y${months}M${days}DT${hours}H${minutes}M${seconds}S`; +} + + +/***/ }), + +/***/ 11483: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatRFC3339 = formatRFC3339; +var _index = __nccwpck_require__(36411); +var _index2 = __nccwpck_require__(16142); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link formatRFC3339} function options. + */ + +/** + * @name formatRFC3339 + * @category Common Helpers + * @summary Format the date according to the RFC 3339 standard (https://tools.ietf.org/html/rfc3339#section-5.6). + * + * @description + * Return the formatted date string in RFC 3339 format. Options may be passed to control the parts and notations of the date. + * + * @param date - The original date + * @param options - An object with options. + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 18 September 2019 in RFC 3339 format: + * formatRFC3339(new Date(2019, 8, 18, 19, 0, 52)) + * //=> '2019-09-18T19:00:52Z' + * + * @example + * // Represent 18 September 2019 in RFC 3339 format, 3 digits of second fraction + * formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { + * fractionDigits: 3 + * }) + * //=> '2019-09-18T19:00:52.234Z' + */ +function formatRFC3339(date, options) { + const date_ = (0, _index3.toDate)(date, options?.in); + + if (!(0, _index2.isValid)(date_)) { + throw new RangeError("Invalid time value"); + } + + const fractionDigits = options?.fractionDigits ?? 0; + + const day = (0, _index.addLeadingZeros)(date_.getDate(), 2); + const month = (0, _index.addLeadingZeros)(date_.getMonth() + 1, 2); + const year = date_.getFullYear(); + + const hour = (0, _index.addLeadingZeros)(date_.getHours(), 2); + const minute = (0, _index.addLeadingZeros)(date_.getMinutes(), 2); + const second = (0, _index.addLeadingZeros)(date_.getSeconds(), 2); + + let fractionalSecond = ""; + if (fractionDigits > 0) { + const milliseconds = date_.getMilliseconds(); + const fractionalSeconds = Math.trunc( + milliseconds * Math.pow(10, fractionDigits - 3), + ); + fractionalSecond = + "." + (0, _index.addLeadingZeros)(fractionalSeconds, fractionDigits); + } + + let offset = ""; + const tzOffset = date_.getTimezoneOffset(); + + if (tzOffset !== 0) { + const absoluteOffset = Math.abs(tzOffset); + const hourOffset = (0, _index.addLeadingZeros)( + Math.trunc(absoluteOffset / 60), + 2, + ); + const minuteOffset = (0, _index.addLeadingZeros)(absoluteOffset % 60, 2); + // If less than 0, the sign is +, because it is ahead of time. + const sign = tzOffset < 0 ? "+" : "-"; + + offset = `${sign}${hourOffset}:${minuteOffset}`; + } else { + offset = "Z"; + } + + return `${year}-${month}-${day}T${hour}:${minute}:${second}${fractionalSecond}${offset}`; +} + + +/***/ }), + +/***/ 84402: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatRFC7231 = formatRFC7231; +var _index = __nccwpck_require__(36411); +var _index2 = __nccwpck_require__(16142); +var _index3 = __nccwpck_require__(46439); + +const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; + +const months = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", +]; + +/** + * @name formatRFC7231 + * @category Common Helpers + * @summary Format the date according to the RFC 7231 standard (https://tools.ietf.org/html/rfc7231#section-7.1.1.1). + * + * @description + * Return the formatted date string in RFC 7231 format. + * The result will always be in UTC timezone. + * + * @param date - The original date + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 18 September 2019 in RFC 7231 format: + * const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52)) + * //=> 'Wed, 18 Sep 2019 19:00:52 GMT' + */ +function formatRFC7231(date) { + const _date = (0, _index3.toDate)(date); + + if (!(0, _index2.isValid)(_date)) { + throw new RangeError("Invalid time value"); + } + + const dayName = days[_date.getUTCDay()]; + const dayOfMonth = (0, _index.addLeadingZeros)(_date.getUTCDate(), 2); + const monthName = months[_date.getUTCMonth()]; + const year = _date.getUTCFullYear(); + + const hour = (0, _index.addLeadingZeros)(_date.getUTCHours(), 2); + const minute = (0, _index.addLeadingZeros)(_date.getUTCMinutes(), 2); + const second = (0, _index.addLeadingZeros)(_date.getUTCSeconds(), 2); + + // Result variables. + return `${dayName}, ${dayOfMonth} ${monthName} ${year} ${hour}:${minute}:${second} GMT`; +} + + +/***/ }), + +/***/ 82664: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatRelative = formatRelative; +var _index = __nccwpck_require__(7479); +var _index2 = __nccwpck_require__(35586); +var _index3 = __nccwpck_require__(58897); +var _index4 = __nccwpck_require__(25671); +var _index5 = __nccwpck_require__(42464); + +/** + * The {@link formatRelative} function options. + */ + +/** + * @name formatRelative + * @category Common Helpers + * @summary Represent the date in words relative to the given base date. + * + * @description + * Represent the date in words relative to the given base date. + * + * | Distance to the base date | Result | + * |---------------------------|---------------------------| + * | Previous 6 days | last Sunday at 04:30 AM | + * | Last day | yesterday at 04:30 AM | + * | Same day | today at 04:30 AM | + * | Next day | tomorrow at 04:30 AM | + * | Next 6 days | Sunday at 04:30 AM | + * | Other | 12/31/2017 | + * + * @param date - The date to format + * @param baseDate - The date to compare with + * @param options - An object with options + * + * @returns The date in words + * + * @throws `date` must not be Invalid Date + * @throws `baseDate` must not be Invalid Date + * @throws `options.locale` must contain `localize` property + * @throws `options.locale` must contain `formatLong` property + * @throws `options.locale` must contain `formatRelative` property + * + * @example + * // Represent the date of 6 days ago in words relative to the given base date. In this example, today is Wednesday + * const result = formatRelative(subDays(new Date(), 6), new Date()) + * //=> "last Thursday at 12:45 AM" + */ +function formatRelative(date, baseDate, options) { + const [date_, baseDate_] = (0, _index3.normalizeDates)( + options?.in, + date, + baseDate, + ); + + const defaultOptions = (0, _index2.getDefaultOptions)(); + const locale = + options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; + + const diff = (0, _index4.differenceInCalendarDays)(date_, baseDate_); + + if (isNaN(diff)) { + throw new RangeError("Invalid time value"); + } + + let token; + if (diff < -6) { + token = "other"; + } else if (diff < -1) { + token = "lastWeek"; + } else if (diff < 0) { + token = "yesterday"; + } else if (diff < 1) { + token = "today"; + } else if (diff < 2) { + token = "tomorrow"; + } else if (diff < 7) { + token = "nextWeek"; + } else { + token = "other"; + } + + const formatStr = locale.formatRelative(token, date_, baseDate_, { + locale, + weekStartsOn, + }); + return (0, _index5.format)(date_, formatStr, { locale, weekStartsOn }); +} + + +/***/ }), + +/***/ 16826: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.fromUnixTime = fromUnixTime; +var _index = __nccwpck_require__(46439); + +/** + * The {@link fromUnixTime} function options. + */ + +/** + * @name fromUnixTime + * @category Timestamp Helpers + * @summary Create a date from a Unix timestamp. + * + * @description + * Create a date from a Unix timestamp (in seconds). Decimal values will be discarded. + * + * @param unixTime - The given Unix timestamp (in seconds) + * @param options - An object with options. Allows to pass a context. + * + * @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). + * + * @returns The date + * + * @example + * // Create the date 29 February 2012 11:45:05: + * const result = fromUnixTime(1330515905) + * //=> Wed Feb 29 2012 11:45:05 + */ +function fromUnixTime(unixTime, options) { + return (0, _index.toDate)(unixTime * 1000, options?.in); +} + + +/***/ }), + +/***/ 58843: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getDate = getDate; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getDate} function options. + */ + +/** + * @name getDate + * @category Day Helpers + * @summary Get the day of the month of the given date. + * + * @description + * Get the day of the month of the given date. + * + * @param date - The given date + * @param options - An object with options. + * + * @returns The day of month + * + * @example + * // Which day of the month is 29 February 2012? + * const result = getDate(new Date(2012, 1, 29)) + * //=> 29 + */ +function getDate(date, options) { + return (0, _index.toDate)(date, options?.in).getDate(); +} + + +/***/ }), + +/***/ 99455: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getDay = getDay; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getDay} function options. + */ + +/** + * @name getDay + * @category Weekday Helpers + * @summary Get the day of the week of the given date. + * + * @description + * Get the day of the week of the given date. + * + * @param date - The given date + * @param options - The options + * + * @returns The day of week, 0 represents Sunday + * + * @example + * // Which day of the week is 29 February 2012? + * const result = getDay(new Date(2012, 1, 29)) + * //=> 3 + */ +function getDay(date, options) { + return (0, _index.toDate)(date, options?.in).getDay(); +} + + +/***/ }), + +/***/ 91412: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getDayOfYear = getDayOfYear; +var _index = __nccwpck_require__(25671); +var _index2 = __nccwpck_require__(68537); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link getDayOfYear} function options. + */ + +/** + * @name getDayOfYear + * @category Day Helpers + * @summary Get the day of the year of the given date. + * + * @description + * Get the day of the year of the given date. + * + * @param date - The given date + * @param options - The options + * + * @returns The day of year + * + * @example + * // Which day of the year is 2 July 2014? + * const result = getDayOfYear(new Date(2014, 6, 2)) + * //=> 183 + */ +function getDayOfYear(date, options) { + const _date = (0, _index3.toDate)(date, options?.in); + const diff = (0, _index.differenceInCalendarDays)( + _date, + (0, _index2.startOfYear)(_date), + ); + const dayOfYear = diff + 1; + return dayOfYear; +} + + +/***/ }), + +/***/ 88222: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getDaysInMonth = getDaysInMonth; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link getDaysInMonth} function options. + */ + +/** + * @name getDaysInMonth + * @category Month Helpers + * @summary Get the number of days in a month of the given date. + * + * @description + * Get the number of days in a month of the given date, considering the context if provided. + * + * @param date - The given date + * @param options - An object with options + * + * @returns The number of days in a month + * + * @example + * // How many days are in February 2000? + * const result = getDaysInMonth(new Date(2000, 1)) + * //=> 29 + */ +function getDaysInMonth(date, options) { + const _date = (0, _index2.toDate)(date, options?.in); + const year = _date.getFullYear(); + const monthIndex = _date.getMonth(); + const lastDayOfMonth = (0, _index.constructFrom)(_date, 0); + lastDayOfMonth.setFullYear(year, monthIndex + 1, 0); + lastDayOfMonth.setHours(0, 0, 0, 0); + return lastDayOfMonth.getDate(); +} + + +/***/ }), + +/***/ 40282: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getDaysInYear = getDaysInYear; +var _index = __nccwpck_require__(76605); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link getDaysInYear} function options. + */ + +/** + * @name getDaysInYear + * @category Year Helpers + * @summary Get the number of days in a year of the given date. + * + * @description + * Get the number of days in a year of the given date. + * + * @param date - The given date + * @param options - An object with options + * + * @returns The number of days in a year + * + * @example + * // How many days are in 2012? + * const result = getDaysInYear(new Date(2012, 0, 1)) + * //=> 366 + */ +function getDaysInYear(date, options) { + const _date = (0, _index2.toDate)(date, options?.in); + if (Number.isNaN(+_date)) return NaN; + return (0, _index.isLeapYear)(_date) ? 366 : 365; +} + + +/***/ }), + +/***/ 43490: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getDecade = getDecade; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getDecade} function options. + */ + +/** + * @name getDecade + * @category Decade Helpers + * @summary Get the decade of the given date. + * + * @description + * Get the decade of the given date. + * + * @param date - The given date + * @param options - An object with options + * + * @returns The year of decade + * + * @example + * // Which decade belongs 27 November 1942? + * const result = getDecade(new Date(1942, 10, 27)) + * //=> 1940 + */ +function getDecade(date, options) { + // TODO: Switch to more technical definition in of decades that start with 1 + // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking + // change, so it can only be done in 4.0. + const _date = (0, _index.toDate)(date, options?.in); + const year = _date.getFullYear(); + const decade = Math.floor(year / 10) * 10; + return decade; +} + + +/***/ }), + +/***/ 20514: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getDefaultOptions = getDefaultOptions; + +var _index = __nccwpck_require__(35586); + +/** + * @name getDefaultOptions + * @category Common Helpers + * @summary Get default options. + * @pure false + * + * @description + * Returns an object that contains defaults for + * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate` + * arguments for all functions. + * + * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions). + * + * @returns The default options + * + * @example + * const result = getDefaultOptions() + * //=> {} + * + * @example + * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 }) + * const result = getDefaultOptions() + * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 } + */ +function getDefaultOptions() { + return Object.assign({}, (0, _index.getDefaultOptions)()); +} + + +/***/ }), + +/***/ 22107: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getHours = getHours; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getHours} function options. + */ + +/** + * @name getHours + * @category Hour Helpers + * @summary Get the hours of the given date. + * + * @description + * Get the hours of the given date. + * + * @param date - The given date + * @param options - An object with options + * + * @returns The hours + * + * @example + * // Get the hours of 29 February 2012 11:45:00: + * const result = getHours(new Date(2012, 1, 29, 11, 45)) + * //=> 11 + */ +function getHours(date, options) { + return (0, _index.toDate)(date, options?.in).getHours(); +} + + +/***/ }), + +/***/ 86060: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getISODay = getISODay; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getISODay} function options. + */ + +/** + * @name getISODay + * @category Weekday Helpers + * @summary Get the day of the ISO week of the given date. + * + * @description + * Get the day of the ISO week of the given date, + * which is 7 for Sunday, 1 for Monday etc. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param date - The given date + * @param options - An object with options + * + * @returns The day of ISO week + * + * @example + * // Which day of the ISO week is 26 February 2012? + * const result = getISODay(new Date(2012, 1, 26)) + * //=> 7 + */ +function getISODay(date, options) { + const day = (0, _index.toDate)(date, options?.in).getDay(); + return day === 0 ? 7 : day; +} + + +/***/ }), + +/***/ 16703: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getISOWeek = getISOWeek; +var _index = __nccwpck_require__(64278); +var _index2 = __nccwpck_require__(38516); +var _index3 = __nccwpck_require__(65437); +var _index4 = __nccwpck_require__(46439); + +/** + * The {@link getISOWeek} function options. + */ + +/** + * @name getISOWeek + * @category ISO Week Helpers + * @summary Get the ISO week of the given date. + * + * @description + * Get the ISO week of the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param date - The given date + * @param options - The options + * + * @returns The ISO week + * + * @example + * // Which week of the ISO-week numbering year is 2 January 2005? + * const result = getISOWeek(new Date(2005, 0, 2)) + * //=> 53 + */ +function getISOWeek(date, options) { + const _date = (0, _index4.toDate)(date, options?.in); + const diff = + +(0, _index2.startOfISOWeek)(_date) - + +(0, _index3.startOfISOWeekYear)(_date); + + // Round the number of weeks to the nearest integer because the number of + // milliseconds in a week is not constant (e.g. it's different in the week of + // the daylight saving time clock shift). + return Math.round(diff / _index.millisecondsInWeek) + 1; +} + + +/***/ }), + +/***/ 47131: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getISOWeekYear = getISOWeekYear; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(38516); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link getISOWeekYear} function options. + */ + +/** + * @name getISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Get the ISO week-numbering year of the given date. + * + * @description + * Get the ISO week-numbering year of the given date, + * which always starts 3 days before the year's first Thursday. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param date - The given date + * + * @returns The ISO week-numbering year + * + * @example + * // Which ISO-week numbering year is 2 January 2005? + * const result = getISOWeekYear(new Date(2005, 0, 2)) + * //=> 2004 + */ +function getISOWeekYear(date, options) { + const _date = (0, _index3.toDate)(date, options?.in); + const year = _date.getFullYear(); + + const fourthOfJanuaryOfNextYear = (0, _index.constructFrom)(_date, 0); + fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); + const startOfNextYear = (0, _index2.startOfISOWeek)( + fourthOfJanuaryOfNextYear, + ); + + const fourthOfJanuaryOfThisYear = (0, _index.constructFrom)(_date, 0); + fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); + const startOfThisYear = (0, _index2.startOfISOWeek)( + fourthOfJanuaryOfThisYear, + ); + + if (_date.getTime() >= startOfNextYear.getTime()) { + return year + 1; + } else if (_date.getTime() >= startOfThisYear.getTime()) { + return year; + } else { + return year - 1; + } +} + + +/***/ }), + +/***/ 93473: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getISOWeeksInYear = getISOWeeksInYear; +var _index = __nccwpck_require__(67385); +var _index2 = __nccwpck_require__(64278); +var _index3 = __nccwpck_require__(65437); + +/** + * The {@link getISOWeeksInYear} function options. + */ + +/** + * @name getISOWeeksInYear + * @category ISO Week-Numbering Year Helpers + * @summary Get the number of weeks in an ISO week-numbering year of the given date. + * + * @description + * Get the number of weeks in an ISO week-numbering year of the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param date - The given date + * @param options - An object with options + * + * @returns The number of ISO weeks in a year + * + * @example + * // How many weeks are in ISO week-numbering year 2015? + * const result = getISOWeeksInYear(new Date(2015, 1, 11)) + * //=> 53 + */ +function getISOWeeksInYear(date, options) { + const thisYear = (0, _index3.startOfISOWeekYear)(date, options); + const nextYear = (0, _index3.startOfISOWeekYear)( + (0, _index.addWeeks)(thisYear, 60), + ); + const diff = +nextYear - +thisYear; + + // Round the number of weeks to the nearest integer because the number of + // milliseconds in a week is not constant (e.g. it's different in the week of + // the daylight saving time clock shift). + return Math.round(diff / _index2.millisecondsInWeek); +} + + +/***/ }), + +/***/ 60807: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getMilliseconds = getMilliseconds; +var _index = __nccwpck_require__(46439); + +/** + * @name getMilliseconds + * @category Millisecond Helpers + * @summary Get the milliseconds of the given date. + * + * @description + * Get the milliseconds of the given date. + * + * @param date - The given date + * + * @returns The milliseconds + * + * @example + * // Get the milliseconds of 29 February 2012 11:45:05.123: + * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123)) + * //=> 123 + */ +function getMilliseconds(date) { + return (0, _index.toDate)(date).getMilliseconds(); +} + + +/***/ }), + +/***/ 54719: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getMinutes = getMinutes; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getMinutes} function options. + */ + +/** + * @name getMinutes + * @category Minute Helpers + * @summary Get the minutes of the given date. + * + * @description + * Get the minutes of the given date. + * + * @param date - The given date + * @param options - The options + * + * @returns The minutes + * + * @example + * // Get the minutes of 29 February 2012 11:45:05: + * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5)) + * //=> 45 + */ +function getMinutes(date, options) { + return (0, _index.toDate)(date, options?.in).getMinutes(); +} + + +/***/ }), + +/***/ 49092: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getMonth = getMonth; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getMonth} function options. + */ + +/** + * @name getMonth + * @category Month Helpers + * @summary Get the month of the given date. + * + * @description + * Get the month of the given date. + * + * @param date - The given date + * @param options - An object with options + * + * @returns The month index (0-11) + * + * @example + * // Which month is 29 February 2012? + * const result = getMonth(new Date(2012, 1, 29)) + * //=> 1 + */ +function getMonth(date, options) { + return (0, _index.toDate)(date, options?.in).getMonth(); +} + + +/***/ }), + +/***/ 36864: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getOverlappingDaysInIntervals = getOverlappingDaysInIntervals; +var _index = __nccwpck_require__(91546); +var _index2 = __nccwpck_require__(64278); +var _index3 = __nccwpck_require__(46439); + +/** + * @name getOverlappingDaysInIntervals + * @category Interval Helpers + * @summary Get the number of days that overlap in two time intervals + * + * @description + * Get the number of days that overlap in two time intervals. It uses the time + * between dates to calculate the number of days, rounding it up to include + * partial days. + * + * Two equal 0-length intervals will result in 0. Two equal 1ms intervals will + * result in 1. + * + * @param intervalLeft - The first interval to compare. + * @param intervalRight - The second interval to compare. + * @param options - An object with options + * + * @returns The number of days that overlap in two time intervals + * + * @example + * // For overlapping time intervals adds 1 for each started overlapping day: + * getOverlappingDaysInIntervals( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } + * ) + * //=> 3 + * + * @example + * // For non-overlapping time intervals returns 0: + * getOverlappingDaysInIntervals( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } + * ) + * //=> 0 + */ + +function getOverlappingDaysInIntervals(intervalLeft, intervalRight) { + const [leftStart, leftEnd] = [ + +(0, _index3.toDate)(intervalLeft.start), + +(0, _index3.toDate)(intervalLeft.end), + ].sort((a, b) => a - b); + const [rightStart, rightEnd] = [ + +(0, _index3.toDate)(intervalRight.start), + +(0, _index3.toDate)(intervalRight.end), + ].sort((a, b) => a - b); + + // Prevent NaN result if intervals don't overlap at all. + const isOverlapping = leftStart < rightEnd && rightStart < leftEnd; + if (!isOverlapping) return 0; + + // Remove the timezone offset to negate the DST effect on calculations. + const overlapLeft = rightStart < leftStart ? leftStart : rightStart; + const left = + overlapLeft - (0, _index.getTimezoneOffsetInMilliseconds)(overlapLeft); + const overlapRight = rightEnd > leftEnd ? leftEnd : rightEnd; + const right = + overlapRight - (0, _index.getTimezoneOffsetInMilliseconds)(overlapRight); + + // Ceil the number to include partial days too. + return Math.ceil((right - left) / _index2.millisecondsInDay); +} + + +/***/ }), + +/***/ 46467: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getQuarter = getQuarter; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getQuarter} function options. + */ + +/** + * @name getQuarter + * @category Quarter Helpers + * @summary Get the year quarter of the given date. + * + * @description + * Get the year quarter of the given date. + * + * @param date - The given date + * @param options - An object with options + * + * @returns The quarter + * + * @example + * // Which quarter is 2 July 2014? + * const result = getQuarter(new Date(2014, 6, 2)); + * //=> 3 + */ +function getQuarter(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const quarter = Math.trunc(_date.getMonth() / 3) + 1; + return quarter; +} + + +/***/ }), + +/***/ 46306: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getSeconds = getSeconds; +var _index = __nccwpck_require__(46439); + +/** + * @name getSeconds + * @category Second Helpers + * @summary Get the seconds of the given date. + * + * @description + * Get the seconds of the given date. + * + * @param date - The given date + * + * @returns The seconds + * + * @example + * // Get the seconds of 29 February 2012 11:45:05.123: + * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123)) + * //=> 5 + */ +function getSeconds(date) { + return (0, _index.toDate)(date).getSeconds(); +} + + +/***/ }), + +/***/ 48094: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getTime = getTime; +var _index = __nccwpck_require__(46439); + +/** + * @name getTime + * @category Timestamp Helpers + * @summary Get the milliseconds timestamp of the given date. + * + * @description + * Get the milliseconds timestamp of the given date. + * + * @param date - The given date + * + * @returns The timestamp + * + * @example + * // Get the timestamp of 29 February 2012 11:45:05.123: + * const result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123)) + * //=> 1330515905123 + */ +function getTime(date) { + return +(0, _index.toDate)(date); +} + + +/***/ }), + +/***/ 46097: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getUnixTime = getUnixTime; +var _index = __nccwpck_require__(46439); + +/** + * @name getUnixTime + * @category Timestamp Helpers + * @summary Get the seconds timestamp of the given date. + * + * @description + * Get the seconds timestamp of the given date. + * + * @param date - The given date + * + * @returns The timestamp + * + * @example + * // Get the timestamp of 29 February 2012 11:45:05 CET: + * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5)) + * //=> 1330512305 + */ +function getUnixTime(date) { + return Math.trunc(+(0, _index.toDate)(date) / 1000); +} + + +/***/ }), + +/***/ 43080: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getWeek = getWeek; +var _index = __nccwpck_require__(64278); +var _index2 = __nccwpck_require__(31284); +var _index3 = __nccwpck_require__(15129); +var _index4 = __nccwpck_require__(46439); + +/** + * The {@link getWeek} function options. + */ + +/** + * @name getWeek + * @category Week Helpers + * @summary Get the local week index of the given date. + * + * @description + * Get the local week index of the given date. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system + * + * @param date - The given date + * @param options - An object with options + * + * @returns The week + * + * @example + * // Which week of the local week numbering year is 2 January 2005 with default options? + * const result = getWeek(new Date(2005, 0, 2)) + * //=> 2 + * + * @example + * // Which week of the local week numbering year is 2 January 2005, + * // if Monday is the first day of the week, + * // and the first week of the year always contains 4 January? + * const result = getWeek(new Date(2005, 0, 2), { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> 53 + */ +function getWeek(date, options) { + const _date = (0, _index4.toDate)(date, options?.in); + const diff = + +(0, _index2.startOfWeek)(_date, options) - + +(0, _index3.startOfWeekYear)(_date, options); + + // Round the number of weeks to the nearest integer because the number of + // milliseconds in a week is not constant (e.g. it's different in the week of + // the daylight saving time clock shift). + return Math.round(diff / _index.millisecondsInWeek) + 1; +} + + +/***/ }), + +/***/ 69432: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getWeekOfMonth = getWeekOfMonth; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(58843); +var _index3 = __nccwpck_require__(99455); +var _index4 = __nccwpck_require__(22709); +var _index5 = __nccwpck_require__(46439); + +/** + * The {@link getWeekOfMonth} function options. + */ + +/** + * @name getWeekOfMonth + * @category Week Helpers + * @summary Get the week of the month of the given date. + * + * @description + * Get the week of the month of the given date. + * + * @param date - The given date + * @param options - An object with options. + * + * @returns The week of month + * + * @example + * // Which week of the month is 9 November 2017? + * const result = getWeekOfMonth(new Date(2017, 10, 9)) + * //=> 2 + */ +function getWeekOfMonth(date, options) { + const defaultOptions = (0, _index.getDefaultOptions)(); + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; + + const currentDayOfMonth = (0, _index2.getDate)( + (0, _index5.toDate)(date, options?.in), + ); + if (isNaN(currentDayOfMonth)) return NaN; + + const startWeekDay = (0, _index3.getDay)( + (0, _index4.startOfMonth)(date, options), + ); + + let lastDayOfFirstWeek = weekStartsOn - startWeekDay; + if (lastDayOfFirstWeek <= 0) lastDayOfFirstWeek += 7; + + const remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek; + return Math.ceil(remainingDaysAfterFirstWeek / 7) + 1; +} + + +/***/ }), + +/***/ 19116: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getWeekYear = getWeekYear; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(30926); +var _index3 = __nccwpck_require__(31284); +var _index4 = __nccwpck_require__(46439); + +/** + * The {@link getWeekYear} function options. + */ + +/** + * @name getWeekYear + * @category Week-Numbering Year Helpers + * @summary Get the local week-numbering year of the given date. + * + * @description + * Get the local week-numbering year of the given date. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system + * + * @param date - The given date + * @param options - An object with options. + * + * @returns The local week-numbering year + * + * @example + * // Which week numbering year is 26 December 2004 with the default settings? + * const result = getWeekYear(new Date(2004, 11, 26)) + * //=> 2005 + * + * @example + * // Which week numbering year is 26 December 2004 if week starts on Saturday? + * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 }) + * //=> 2004 + * + * @example + * // Which week numbering year is 26 December 2004 if the first week contains 4 January? + * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 }) + * //=> 2004 + */ +function getWeekYear(date, options) { + const _date = (0, _index4.toDate)(date, options?.in); + const year = _date.getFullYear(); + + const defaultOptions = (0, _index.getDefaultOptions)(); + const firstWeekContainsDate = + options?.firstWeekContainsDate ?? + options?.locale?.options?.firstWeekContainsDate ?? + defaultOptions.firstWeekContainsDate ?? + defaultOptions.locale?.options?.firstWeekContainsDate ?? + 1; + + const firstWeekOfNextYear = (0, _index2.constructFrom)( + options?.in || date, + 0, + ); + firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); + firstWeekOfNextYear.setHours(0, 0, 0, 0); + const startOfNextYear = (0, _index3.startOfWeek)( + firstWeekOfNextYear, + options, + ); + + const firstWeekOfThisYear = (0, _index2.constructFrom)( + options?.in || date, + 0, + ); + firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); + firstWeekOfThisYear.setHours(0, 0, 0, 0); + const startOfThisYear = (0, _index3.startOfWeek)( + firstWeekOfThisYear, + options, + ); + + if (+_date >= +startOfNextYear) { + return year + 1; + } else if (+_date >= +startOfThisYear) { + return year; + } else { + return year - 1; + } +} + + +/***/ }), + +/***/ 30092: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getWeeksInMonth = getWeeksInMonth; +var _index = __nccwpck_require__(11464); +var _index2 = __nccwpck_require__(2302); +var _index3 = __nccwpck_require__(22709); +var _index4 = __nccwpck_require__(46439); + +/** + * The {@link getWeeksInMonth} function options. + */ + +/** + * @name getWeeksInMonth + * @category Week Helpers + * @summary Get the number of calendar weeks a month spans. + * + * @description + * Get the number of calendar weeks the month in the given date spans. + * + * @param date - The given date + * @param options - An object with options. + * + * @returns The number of calendar weeks + * + * @example + * // How many calendar weeks does February 2015 span? + * const result = getWeeksInMonth(new Date(2015, 1, 8)) + * //=> 4 + * + * @example + * // If the week starts on Monday, + * // how many calendar weeks does July 2017 span? + * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 }) + * //=> 6 + */ +function getWeeksInMonth(date, options) { + const contextDate = (0, _index4.toDate)(date, options?.in); + return ( + (0, _index.differenceInCalendarWeeks)( + (0, _index2.lastDayOfMonth)(contextDate, options), + (0, _index3.startOfMonth)(contextDate, options), + options, + ) + 1 + ); +} + + +/***/ }), + +/***/ 89578: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.getYear = getYear; +var _index = __nccwpck_require__(46439); + +/** + * The {@link getYear} function options. + */ + +/** + * @name getYear + * @category Year Helpers + * @summary Get the year of the given date. + * + * @description + * Get the year of the given date. + * + * @param date - The given date + * @param options - An object with options + * + * @returns The year + * + * @example + * // Which year is 2 July 2014? + * const result = getYear(new Date(2014, 6, 2)) + * //=> 2014 + */ +function getYear(date, options) { + return (0, _index.toDate)(date, options?.in).getFullYear(); +} + + +/***/ }), + +/***/ 68158: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.hoursToMilliseconds = hoursToMilliseconds; +var _index = __nccwpck_require__(64278); + +/** + * @name hoursToMilliseconds + * @category Conversion Helpers + * @summary Convert hours to milliseconds. + * + * @description + * Convert a number of hours to a full number of milliseconds. + * + * @param hours - number of hours to be converted + * + * @returns The number of hours converted to milliseconds + * + * @example + * // Convert 2 hours to milliseconds: + * const result = hoursToMilliseconds(2) + * //=> 7200000 + */ +function hoursToMilliseconds(hours) { + return Math.trunc(hours * _index.millisecondsInHour); +} + + +/***/ }), + +/***/ 42561: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.hoursToMinutes = hoursToMinutes; +var _index = __nccwpck_require__(64278); + +/** + * @name hoursToMinutes + * @category Conversion Helpers + * @summary Convert hours to minutes. + * + * @description + * Convert a number of hours to a full number of minutes. + * + * @param hours - number of hours to be converted + * + * @returns The number of hours converted in minutes + * + * @example + * // Convert 2 hours to minutes: + * const result = hoursToMinutes(2) + * //=> 120 + */ +function hoursToMinutes(hours) { + return Math.trunc(hours * _index.minutesInHour); +} + + +/***/ }), + +/***/ 19779: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.hoursToSeconds = hoursToSeconds; +var _index = __nccwpck_require__(64278); + +/** + * @name hoursToSeconds + * @category Conversion Helpers + * @summary Convert hours to seconds. + * + * @description + * Convert a number of hours to a full number of seconds. + * + * @param hours - The number of hours to be converted + * + * @returns The number of hours converted in seconds + * + * @example + * // Convert 2 hours to seconds: + * const result = hoursToSeconds(2) + * //=> 7200 + */ +function hoursToSeconds(hours) { + return Math.trunc(hours * _index.secondsInHour); +} + + +/***/ }), + +/***/ 25468: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _index = __nccwpck_require__(42033); +Object.keys(_index).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index[key]; + }, + }); +}); +var _index2 = __nccwpck_require__(22759); +Object.keys(_index2).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index2[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index2[key]; + }, + }); +}); +var _index3 = __nccwpck_require__(7412); +Object.keys(_index3).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index3[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index3[key]; + }, + }); +}); +var _index4 = __nccwpck_require__(67102); +Object.keys(_index4).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index4[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index4[key]; + }, + }); +}); +var _index5 = __nccwpck_require__(72768); +Object.keys(_index5).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index5[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index5[key]; + }, + }); +}); +var _index6 = __nccwpck_require__(80006); +Object.keys(_index6).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index6[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index6[key]; + }, + }); +}); +var _index7 = __nccwpck_require__(85223); +Object.keys(_index7).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index7[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index7[key]; + }, + }); +}); +var _index8 = __nccwpck_require__(69793); +Object.keys(_index8).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index8[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index8[key]; + }, + }); +}); +var _index9 = __nccwpck_require__(54916); +Object.keys(_index9).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index9[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index9[key]; + }, + }); +}); +var _index10 = __nccwpck_require__(97900); +Object.keys(_index10).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index10[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index10[key]; + }, + }); +}); +var _index11 = __nccwpck_require__(67385); +Object.keys(_index11).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index11[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index11[key]; + }, + }); +}); +var _index12 = __nccwpck_require__(30904); +Object.keys(_index12).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index12[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index12[key]; + }, + }); +}); +var _index13 = __nccwpck_require__(31262); +Object.keys(_index13).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index13[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index13[key]; + }, + }); +}); +var _index14 = __nccwpck_require__(32193); +Object.keys(_index14).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index14[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index14[key]; + }, + }); +}); +var _index15 = __nccwpck_require__(71753); +Object.keys(_index15).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index15[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index15[key]; + }, + }); +}); +var _index16 = __nccwpck_require__(22781); +Object.keys(_index16).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index16[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index16[key]; + }, + }); +}); +var _index17 = __nccwpck_require__(30595); +Object.keys(_index17).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index17[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index17[key]; + }, + }); +}); +var _index18 = __nccwpck_require__(95068); +Object.keys(_index18).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index18[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index18[key]; + }, + }); +}); +var _index19 = __nccwpck_require__(30926); +Object.keys(_index19).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index19[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index19[key]; + }, + }); +}); +var _index20 = __nccwpck_require__(18087); +Object.keys(_index20).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index20[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index20[key]; + }, + }); +}); +var _index21 = __nccwpck_require__(38113); +Object.keys(_index21).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index21[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index21[key]; + }, + }); +}); +var _index22 = __nccwpck_require__(98199); +Object.keys(_index22).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index22[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index22[key]; + }, + }); +}); +var _index23 = __nccwpck_require__(25671); +Object.keys(_index23).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index23[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index23[key]; + }, + }); +}); +var _index24 = __nccwpck_require__(7310); +Object.keys(_index24).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index24[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index24[key]; + }, + }); +}); +var _index25 = __nccwpck_require__(26742); +Object.keys(_index25).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index25[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index25[key]; + }, + }); +}); +var _index26 = __nccwpck_require__(69633); +Object.keys(_index26).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index26[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index26[key]; + }, + }); +}); +var _index27 = __nccwpck_require__(79421); +Object.keys(_index27).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index27[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index27[key]; + }, + }); +}); +var _index28 = __nccwpck_require__(11464); +Object.keys(_index28).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index28[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index28[key]; + }, + }); +}); +var _index29 = __nccwpck_require__(64472); +Object.keys(_index29).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index29[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index29[key]; + }, + }); +}); +var _index30 = __nccwpck_require__(85554); +Object.keys(_index30).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index30[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index30[key]; + }, + }); +}); +var _index31 = __nccwpck_require__(59806); +Object.keys(_index31).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index31[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index31[key]; + }, + }); +}); +var _index32 = __nccwpck_require__(18475); +Object.keys(_index32).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index32[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index32[key]; + }, + }); +}); +var _index33 = __nccwpck_require__(59013); +Object.keys(_index33).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index33[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index33[key]; + }, + }); +}); +var _index34 = __nccwpck_require__(44963); +Object.keys(_index34).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index34[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index34[key]; + }, + }); +}); +var _index35 = __nccwpck_require__(41434); +Object.keys(_index35).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index35[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index35[key]; + }, + }); +}); +var _index36 = __nccwpck_require__(54121); +Object.keys(_index36).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index36[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index36[key]; + }, + }); +}); +var _index37 = __nccwpck_require__(95205); +Object.keys(_index37).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index37[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index37[key]; + }, + }); +}); +var _index38 = __nccwpck_require__(68198); +Object.keys(_index38).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index38[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index38[key]; + }, + }); +}); +var _index39 = __nccwpck_require__(52282); +Object.keys(_index39).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index39[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index39[key]; + }, + }); +}); +var _index40 = __nccwpck_require__(62837); +Object.keys(_index40).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index40[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index40[key]; + }, + }); +}); +var _index41 = __nccwpck_require__(83012); +Object.keys(_index41).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index41[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index41[key]; + }, + }); +}); +var _index42 = __nccwpck_require__(49911); +Object.keys(_index42).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index42[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index42[key]; + }, + }); +}); +var _index43 = __nccwpck_require__(20355); +Object.keys(_index43).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index43[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index43[key]; + }, + }); +}); +var _index44 = __nccwpck_require__(82712); +Object.keys(_index44).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index44[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index44[key]; + }, + }); +}); +var _index45 = __nccwpck_require__(66940); +Object.keys(_index45).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index45[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index45[key]; + }, + }); +}); +var _index46 = __nccwpck_require__(5790); +Object.keys(_index46).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index46[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index46[key]; + }, + }); +}); +var _index47 = __nccwpck_require__(70025); +Object.keys(_index47).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index47[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index47[key]; + }, + }); +}); +var _index48 = __nccwpck_require__(19682); +Object.keys(_index48).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index48[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index48[key]; + }, + }); +}); +var _index49 = __nccwpck_require__(52422); +Object.keys(_index49).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index49[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index49[key]; + }, + }); +}); +var _index50 = __nccwpck_require__(79982); +Object.keys(_index50).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index50[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index50[key]; + }, + }); +}); +var _index51 = __nccwpck_require__(78899); +Object.keys(_index51).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index51[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index51[key]; + }, + }); +}); +var _index52 = __nccwpck_require__(59773); +Object.keys(_index52).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index52[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index52[key]; + }, + }); +}); +var _index53 = __nccwpck_require__(77055); +Object.keys(_index53).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index53[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index53[key]; + }, + }); +}); +var _index54 = __nccwpck_require__(62423); +Object.keys(_index54).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index54[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index54[key]; + }, + }); +}); +var _index55 = __nccwpck_require__(24387); +Object.keys(_index55).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index55[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index55[key]; + }, + }); +}); +var _index56 = __nccwpck_require__(2127); +Object.keys(_index56).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index56[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index56[key]; + }, + }); +}); +var _index57 = __nccwpck_require__(86868); +Object.keys(_index57).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index57[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index57[key]; + }, + }); +}); +var _index58 = __nccwpck_require__(51541); +Object.keys(_index58).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index58[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index58[key]; + }, + }); +}); +var _index59 = __nccwpck_require__(72177); +Object.keys(_index59).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index59[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index59[key]; + }, + }); +}); +var _index60 = __nccwpck_require__(97267); +Object.keys(_index60).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index60[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index60[key]; + }, + }); +}); +var _index61 = __nccwpck_require__(69945); +Object.keys(_index61).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index61[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index61[key]; + }, + }); +}); +var _index62 = __nccwpck_require__(82501); +Object.keys(_index62).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index62[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index62[key]; + }, + }); +}); +var _index63 = __nccwpck_require__(53445); +Object.keys(_index63).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index63[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index63[key]; + }, + }); +}); +var _index64 = __nccwpck_require__(42464); +Object.keys(_index64).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index64[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index64[key]; + }, + }); +}); +var _index65 = __nccwpck_require__(20109); +Object.keys(_index65).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index65[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index65[key]; + }, + }); +}); +var _index66 = __nccwpck_require__(11746); +Object.keys(_index66).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index66[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index66[key]; + }, + }); +}); +var _index67 = __nccwpck_require__(99608); +Object.keys(_index67).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index67[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index67[key]; + }, + }); +}); +var _index68 = __nccwpck_require__(45718); +Object.keys(_index68).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index68[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index68[key]; + }, + }); +}); +var _index69 = __nccwpck_require__(25405); +Object.keys(_index69).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index69[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index69[key]; + }, + }); +}); +var _index70 = __nccwpck_require__(37235); +Object.keys(_index70).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index70[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index70[key]; + }, + }); +}); +var _index71 = __nccwpck_require__(5230); +Object.keys(_index71).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index71[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index71[key]; + }, + }); +}); +var _index72 = __nccwpck_require__(47818); +Object.keys(_index72).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index72[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index72[key]; + }, + }); +}); +var _index73 = __nccwpck_require__(11483); +Object.keys(_index73).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index73[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index73[key]; + }, + }); +}); +var _index74 = __nccwpck_require__(84402); +Object.keys(_index74).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index74[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index74[key]; + }, + }); +}); +var _index75 = __nccwpck_require__(82664); +Object.keys(_index75).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index75[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index75[key]; + }, + }); +}); +var _index76 = __nccwpck_require__(16826); +Object.keys(_index76).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index76[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index76[key]; + }, + }); +}); +var _index77 = __nccwpck_require__(58843); +Object.keys(_index77).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index77[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index77[key]; + }, + }); +}); +var _index78 = __nccwpck_require__(99455); +Object.keys(_index78).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index78[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index78[key]; + }, + }); +}); +var _index79 = __nccwpck_require__(91412); +Object.keys(_index79).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index79[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index79[key]; + }, + }); +}); +var _index80 = __nccwpck_require__(88222); +Object.keys(_index80).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index80[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index80[key]; + }, + }); +}); +var _index81 = __nccwpck_require__(40282); +Object.keys(_index81).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index81[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index81[key]; + }, + }); +}); +var _index82 = __nccwpck_require__(43490); +Object.keys(_index82).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index82[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index82[key]; + }, + }); +}); +var _index83 = __nccwpck_require__(20514); +Object.keys(_index83).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index83[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index83[key]; + }, + }); +}); +var _index84 = __nccwpck_require__(22107); +Object.keys(_index84).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index84[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index84[key]; + }, + }); +}); +var _index85 = __nccwpck_require__(86060); +Object.keys(_index85).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index85[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index85[key]; + }, + }); +}); +var _index86 = __nccwpck_require__(16703); +Object.keys(_index86).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index86[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index86[key]; + }, + }); +}); +var _index87 = __nccwpck_require__(47131); +Object.keys(_index87).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index87[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index87[key]; + }, + }); +}); +var _index88 = __nccwpck_require__(93473); +Object.keys(_index88).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index88[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index88[key]; + }, + }); +}); +var _index89 = __nccwpck_require__(60807); +Object.keys(_index89).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index89[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index89[key]; + }, + }); +}); +var _index90 = __nccwpck_require__(54719); +Object.keys(_index90).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index90[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index90[key]; + }, + }); +}); +var _index91 = __nccwpck_require__(49092); +Object.keys(_index91).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index91[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index91[key]; + }, + }); +}); +var _index92 = __nccwpck_require__(36864); +Object.keys(_index92).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index92[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index92[key]; + }, + }); +}); +var _index93 = __nccwpck_require__(46467); +Object.keys(_index93).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index93[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index93[key]; + }, + }); +}); +var _index94 = __nccwpck_require__(46306); +Object.keys(_index94).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index94[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index94[key]; + }, + }); +}); +var _index95 = __nccwpck_require__(48094); +Object.keys(_index95).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index95[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index95[key]; + }, + }); +}); +var _index96 = __nccwpck_require__(46097); +Object.keys(_index96).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index96[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index96[key]; + }, + }); +}); +var _index97 = __nccwpck_require__(43080); +Object.keys(_index97).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index97[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index97[key]; + }, + }); +}); +var _index98 = __nccwpck_require__(69432); +Object.keys(_index98).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index98[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index98[key]; + }, + }); +}); +var _index99 = __nccwpck_require__(19116); +Object.keys(_index99).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index99[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index99[key]; + }, + }); +}); +var _index100 = __nccwpck_require__(30092); +Object.keys(_index100).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index100[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index100[key]; + }, + }); +}); +var _index101 = __nccwpck_require__(89578); +Object.keys(_index101).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index101[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index101[key]; + }, + }); +}); +var _index102 = __nccwpck_require__(68158); +Object.keys(_index102).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index102[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index102[key]; + }, + }); +}); +var _index103 = __nccwpck_require__(42561); +Object.keys(_index103).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index103[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index103[key]; + }, + }); +}); +var _index104 = __nccwpck_require__(19779); +Object.keys(_index104).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index104[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index104[key]; + }, + }); +}); +var _index105 = __nccwpck_require__(48634); +Object.keys(_index105).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index105[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index105[key]; + }, + }); +}); +var _index106 = __nccwpck_require__(65076); +Object.keys(_index106).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index106[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index106[key]; + }, + }); +}); +var _index107 = __nccwpck_require__(85954); +Object.keys(_index107).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index107[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index107[key]; + }, + }); +}); +var _index108 = __nccwpck_require__(47240); +Object.keys(_index108).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index108[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index108[key]; + }, + }); +}); +var _index109 = __nccwpck_require__(49292); +Object.keys(_index109).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index109[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index109[key]; + }, + }); +}); +var _index110 = __nccwpck_require__(97176); +Object.keys(_index110).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index110[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index110[key]; + }, + }); +}); +var _index111 = __nccwpck_require__(21652); +Object.keys(_index111).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index111[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index111[key]; + }, + }); +}); +var _index112 = __nccwpck_require__(42656); +Object.keys(_index112).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index112[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index112[key]; + }, + }); +}); +var _index113 = __nccwpck_require__(76511); +Object.keys(_index113).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index113[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index113[key]; + }, + }); +}); +var _index114 = __nccwpck_require__(14603); +Object.keys(_index114).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index114[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index114[key]; + }, + }); +}); +var _index115 = __nccwpck_require__(83998); +Object.keys(_index115).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index115[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index115[key]; + }, + }); +}); +var _index116 = __nccwpck_require__(41444); +Object.keys(_index116).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index116[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index116[key]; + }, + }); +}); +var _index117 = __nccwpck_require__(48454); +Object.keys(_index117).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index117[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index117[key]; + }, + }); +}); +var _index118 = __nccwpck_require__(76605); +Object.keys(_index118).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index118[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index118[key]; + }, + }); +}); +var _index119 = __nccwpck_require__(80248); +Object.keys(_index119).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index119[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index119[key]; + }, + }); +}); +var _index120 = __nccwpck_require__(87363); +Object.keys(_index120).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index120[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index120[key]; + }, + }); +}); +var _index121 = __nccwpck_require__(5427); +Object.keys(_index121).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index121[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index121[key]; + }, + }); +}); +var _index122 = __nccwpck_require__(4139); +Object.keys(_index122).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index122[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index122[key]; + }, + }); +}); +var _index123 = __nccwpck_require__(35584); +Object.keys(_index123).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index123[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index123[key]; + }, + }); +}); +var _index124 = __nccwpck_require__(20940); +Object.keys(_index124).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index124[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index124[key]; + }, + }); +}); +var _index125 = __nccwpck_require__(91881); +Object.keys(_index125).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index125[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index125[key]; + }, + }); +}); +var _index126 = __nccwpck_require__(13759); +Object.keys(_index126).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index126[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index126[key]; + }, + }); +}); +var _index127 = __nccwpck_require__(22487); +Object.keys(_index127).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index127[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index127[key]; + }, + }); +}); +var _index128 = __nccwpck_require__(74704); +Object.keys(_index128).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index128[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index128[key]; + }, + }); +}); +var _index129 = __nccwpck_require__(58050); +Object.keys(_index129).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index129[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index129[key]; + }, + }); +}); +var _index130 = __nccwpck_require__(5843); +Object.keys(_index130).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index130[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index130[key]; + }, + }); +}); +var _index131 = __nccwpck_require__(51729); +Object.keys(_index131).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index131[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index131[key]; + }, + }); +}); +var _index132 = __nccwpck_require__(1623); +Object.keys(_index132).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index132[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index132[key]; + }, + }); +}); +var _index133 = __nccwpck_require__(4862); +Object.keys(_index133).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index133[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index133[key]; + }, + }); +}); +var _index134 = __nccwpck_require__(54760); +Object.keys(_index134).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index134[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index134[key]; + }, + }); +}); +var _index135 = __nccwpck_require__(61389); +Object.keys(_index135).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index135[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index135[key]; + }, + }); +}); +var _index136 = __nccwpck_require__(61953); +Object.keys(_index136).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index136[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index136[key]; + }, + }); +}); +var _index137 = __nccwpck_require__(94620); +Object.keys(_index137).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index137[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index137[key]; + }, + }); +}); +var _index138 = __nccwpck_require__(36940); +Object.keys(_index138).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index138[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index138[key]; + }, + }); +}); +var _index139 = __nccwpck_require__(93393); +Object.keys(_index139).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index139[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index139[key]; + }, + }); +}); +var _index140 = __nccwpck_require__(98890); +Object.keys(_index140).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index140[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index140[key]; + }, + }); +}); +var _index141 = __nccwpck_require__(44286); +Object.keys(_index141).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index141[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index141[key]; + }, + }); +}); +var _index142 = __nccwpck_require__(76816); +Object.keys(_index142).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index142[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index142[key]; + }, + }); +}); +var _index143 = __nccwpck_require__(55318); +Object.keys(_index143).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index143[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index143[key]; + }, + }); +}); +var _index144 = __nccwpck_require__(20728); +Object.keys(_index144).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index144[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index144[key]; + }, + }); +}); +var _index145 = __nccwpck_require__(49011); +Object.keys(_index145).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index145[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index145[key]; + }, + }); +}); +var _index146 = __nccwpck_require__(16142); +Object.keys(_index146).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index146[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index146[key]; + }, + }); +}); +var _index147 = __nccwpck_require__(10506); +Object.keys(_index147).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index147[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index147[key]; + }, + }); +}); +var _index148 = __nccwpck_require__(51038); +Object.keys(_index148).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index148[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index148[key]; + }, + }); +}); +var _index149 = __nccwpck_require__(33217); +Object.keys(_index149).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index149[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index149[key]; + }, + }); +}); +var _index150 = __nccwpck_require__(43245); +Object.keys(_index150).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index150[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index150[key]; + }, + }); +}); +var _index151 = __nccwpck_require__(99446); +Object.keys(_index151).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index151[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index151[key]; + }, + }); +}); +var _index152 = __nccwpck_require__(20069); +Object.keys(_index152).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index152[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index152[key]; + }, + }); +}); +var _index153 = __nccwpck_require__(30972); +Object.keys(_index153).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index153[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index153[key]; + }, + }); +}); +var _index154 = __nccwpck_require__(2302); +Object.keys(_index154).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index154[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index154[key]; + }, + }); +}); +var _index155 = __nccwpck_require__(88525); +Object.keys(_index155).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index155[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index155[key]; + }, + }); +}); +var _index156 = __nccwpck_require__(92854); +Object.keys(_index156).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index156[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index156[key]; + }, + }); +}); +var _index157 = __nccwpck_require__(26302); +Object.keys(_index157).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index157[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index157[key]; + }, + }); +}); +var _index158 = __nccwpck_require__(37774); +Object.keys(_index158).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index158[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index158[key]; + }, + }); +}); +var _index159 = __nccwpck_require__(57238); +Object.keys(_index159).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index159[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index159[key]; + }, + }); +}); +var _index160 = __nccwpck_require__(19717); +Object.keys(_index160).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index160[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index160[key]; + }, + }); +}); +var _index161 = __nccwpck_require__(67139); +Object.keys(_index161).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index161[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index161[key]; + }, + }); +}); +var _index162 = __nccwpck_require__(61121); +Object.keys(_index162).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index162[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index162[key]; + }, + }); +}); +var _index163 = __nccwpck_require__(60630); +Object.keys(_index163).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index163[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index163[key]; + }, + }); +}); +var _index164 = __nccwpck_require__(2651); +Object.keys(_index164).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index164[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index164[key]; + }, + }); +}); +var _index165 = __nccwpck_require__(40218); +Object.keys(_index165).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index165[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index165[key]; + }, + }); +}); +var _index166 = __nccwpck_require__(77000); +Object.keys(_index166).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index166[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index166[key]; + }, + }); +}); +var _index167 = __nccwpck_require__(6878); +Object.keys(_index167).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index167[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index167[key]; + }, + }); +}); +var _index168 = __nccwpck_require__(55782); +Object.keys(_index168).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index168[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index168[key]; + }, + }); +}); +var _index169 = __nccwpck_require__(11496); +Object.keys(_index169).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index169[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index169[key]; + }, + }); +}); +var _index170 = __nccwpck_require__(45598); +Object.keys(_index170).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index170[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index170[key]; + }, + }); +}); +var _index171 = __nccwpck_require__(39807); +Object.keys(_index171).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index171[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index171[key]; + }, + }); +}); +var _index172 = __nccwpck_require__(38136); +Object.keys(_index172).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index172[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index172[key]; + }, + }); +}); +var _index173 = __nccwpck_require__(82247); +Object.keys(_index173).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index173[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index173[key]; + }, + }); +}); +var _index174 = __nccwpck_require__(44292); +Object.keys(_index174).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index174[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index174[key]; + }, + }); +}); +var _index175 = __nccwpck_require__(71141); +Object.keys(_index175).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index175[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index175[key]; + }, + }); +}); +var _index176 = __nccwpck_require__(62772); +Object.keys(_index176).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index176[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index176[key]; + }, + }); +}); +var _index177 = __nccwpck_require__(64428); +Object.keys(_index177).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index177[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index177[key]; + }, + }); +}); +var _index178 = __nccwpck_require__(35679); +Object.keys(_index178).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index178[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index178[key]; + }, + }); +}); +var _index179 = __nccwpck_require__(5975); +Object.keys(_index179).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index179[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index179[key]; + }, + }); +}); +var _index180 = __nccwpck_require__(25531); +Object.keys(_index180).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index180[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index180[key]; + }, + }); +}); +var _index181 = __nccwpck_require__(61930); +Object.keys(_index181).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index181[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index181[key]; + }, + }); +}); +var _index182 = __nccwpck_require__(47961); +Object.keys(_index182).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index182[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index182[key]; + }, + }); +}); +var _index183 = __nccwpck_require__(69377); +Object.keys(_index183).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index183[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index183[key]; + }, + }); +}); +var _index184 = __nccwpck_require__(55334); +Object.keys(_index184).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index184[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index184[key]; + }, + }); +}); +var _index185 = __nccwpck_require__(53728); +Object.keys(_index185).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index185[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index185[key]; + }, + }); +}); +var _index186 = __nccwpck_require__(41091); +Object.keys(_index186).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index186[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index186[key]; + }, + }); +}); +var _index187 = __nccwpck_require__(37373); +Object.keys(_index187).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index187[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index187[key]; + }, + }); +}); +var _index188 = __nccwpck_require__(63474); +Object.keys(_index188).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index188[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index188[key]; + }, + }); +}); +var _index189 = __nccwpck_require__(13791); +Object.keys(_index189).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index189[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index189[key]; + }, + }); +}); +var _index190 = __nccwpck_require__(29928); +Object.keys(_index190).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index190[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index190[key]; + }, + }); +}); +var _index191 = __nccwpck_require__(43780); +Object.keys(_index191).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index191[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index191[key]; + }, + }); +}); +var _index192 = __nccwpck_require__(18909); +Object.keys(_index192).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index192[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index192[key]; + }, + }); +}); +var _index193 = __nccwpck_require__(74725); +Object.keys(_index193).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index193[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index193[key]; + }, + }); +}); +var _index194 = __nccwpck_require__(67928); +Object.keys(_index194).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index194[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index194[key]; + }, + }); +}); +var _index195 = __nccwpck_require__(79730); +Object.keys(_index195).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index195[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index195[key]; + }, + }); +}); +var _index196 = __nccwpck_require__(3713); +Object.keys(_index196).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index196[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index196[key]; + }, + }); +}); +var _index197 = __nccwpck_require__(83640); +Object.keys(_index197).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index197[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index197[key]; + }, + }); +}); +var _index198 = __nccwpck_require__(51277); +Object.keys(_index198).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index198[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index198[key]; + }, + }); +}); +var _index199 = __nccwpck_require__(89849); +Object.keys(_index199).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index199[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index199[key]; + }, + }); +}); +var _index200 = __nccwpck_require__(63876); +Object.keys(_index200).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index200[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index200[key]; + }, + }); +}); +var _index201 = __nccwpck_require__(87749); +Object.keys(_index201).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index201[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index201[key]; + }, + }); +}); +var _index202 = __nccwpck_require__(8082); +Object.keys(_index202).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index202[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index202[key]; + }, + }); +}); +var _index203 = __nccwpck_require__(59325); +Object.keys(_index203).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index203[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index203[key]; + }, + }); +}); +var _index204 = __nccwpck_require__(64482); +Object.keys(_index204).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index204[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index204[key]; + }, + }); +}); +var _index205 = __nccwpck_require__(25885); +Object.keys(_index205).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index205[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index205[key]; + }, + }); +}); +var _index206 = __nccwpck_require__(48610); +Object.keys(_index206).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index206[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index206[key]; + }, + }); +}); +var _index207 = __nccwpck_require__(11618); +Object.keys(_index207).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index207[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index207[key]; + }, + }); +}); +var _index208 = __nccwpck_require__(57471); +Object.keys(_index208).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index208[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index208[key]; + }, + }); +}); +var _index209 = __nccwpck_require__(30274); +Object.keys(_index209).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index209[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index209[key]; + }, + }); +}); +var _index210 = __nccwpck_require__(9462); +Object.keys(_index210).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index210[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index210[key]; + }, + }); +}); +var _index211 = __nccwpck_require__(67577); +Object.keys(_index211).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index211[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index211[key]; + }, + }); +}); +var _index212 = __nccwpck_require__(55756); +Object.keys(_index212).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index212[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index212[key]; + }, + }); +}); +var _index213 = __nccwpck_require__(15951); +Object.keys(_index213).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index213[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index213[key]; + }, + }); +}); +var _index214 = __nccwpck_require__(95023); +Object.keys(_index214).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index214[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index214[key]; + }, + }); +}); +var _index215 = __nccwpck_require__(77057); +Object.keys(_index215).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index215[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index215[key]; + }, + }); +}); +var _index216 = __nccwpck_require__(38516); +Object.keys(_index216).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index216[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index216[key]; + }, + }); +}); +var _index217 = __nccwpck_require__(65437); +Object.keys(_index217).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index217[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index217[key]; + }, + }); +}); +var _index218 = __nccwpck_require__(17614); +Object.keys(_index218).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index218[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index218[key]; + }, + }); +}); +var _index219 = __nccwpck_require__(22709); +Object.keys(_index219).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index219[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index219[key]; + }, + }); +}); +var _index220 = __nccwpck_require__(77136); +Object.keys(_index220).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index220[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index220[key]; + }, + }); +}); +var _index221 = __nccwpck_require__(14147); +Object.keys(_index221).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index221[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index221[key]; + }, + }); +}); +var _index222 = __nccwpck_require__(62398); +Object.keys(_index222).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index222[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index222[key]; + }, + }); +}); +var _index223 = __nccwpck_require__(15324); +Object.keys(_index223).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index223[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index223[key]; + }, + }); +}); +var _index224 = __nccwpck_require__(31284); +Object.keys(_index224).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index224[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index224[key]; + }, + }); +}); +var _index225 = __nccwpck_require__(15129); +Object.keys(_index225).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index225[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index225[key]; + }, + }); +}); +var _index226 = __nccwpck_require__(68537); +Object.keys(_index226).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index226[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index226[key]; + }, + }); +}); +var _index227 = __nccwpck_require__(74682); +Object.keys(_index227).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index227[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index227[key]; + }, + }); +}); +var _index228 = __nccwpck_require__(60268); +Object.keys(_index228).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index228[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index228[key]; + }, + }); +}); +var _index229 = __nccwpck_require__(21342); +Object.keys(_index229).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index229[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index229[key]; + }, + }); +}); +var _index230 = __nccwpck_require__(24345); +Object.keys(_index230).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index230[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index230[key]; + }, + }); +}); +var _index231 = __nccwpck_require__(28422); +Object.keys(_index231).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index231[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index231[key]; + }, + }); +}); +var _index232 = __nccwpck_require__(42625); +Object.keys(_index232).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index232[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index232[key]; + }, + }); +}); +var _index233 = __nccwpck_require__(36045); +Object.keys(_index233).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index233[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index233[key]; + }, + }); +}); +var _index234 = __nccwpck_require__(61073); +Object.keys(_index234).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index234[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index234[key]; + }, + }); +}); +var _index235 = __nccwpck_require__(47784); +Object.keys(_index235).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index235[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index235[key]; + }, + }); +}); +var _index236 = __nccwpck_require__(98720); +Object.keys(_index236).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index236[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index236[key]; + }, + }); +}); +var _index237 = __nccwpck_require__(88246); +Object.keys(_index237).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index237[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index237[key]; + }, + }); +}); +var _index238 = __nccwpck_require__(9138); +Object.keys(_index238).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index238[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index238[key]; + }, + }); +}); +var _index239 = __nccwpck_require__(98787); +Object.keys(_index239).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index239[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index239[key]; + }, + }); +}); +var _index240 = __nccwpck_require__(46439); +Object.keys(_index240).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index240[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index240[key]; + }, + }); +}); +var _index241 = __nccwpck_require__(37288); +Object.keys(_index241).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index241[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index241[key]; + }, + }); +}); +var _index242 = __nccwpck_require__(90423); +Object.keys(_index242).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index242[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index242[key]; + }, + }); +}); +var _index243 = __nccwpck_require__(79813); +Object.keys(_index243).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index243[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index243[key]; + }, + }); +}); +var _index244 = __nccwpck_require__(94171); +Object.keys(_index244).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index244[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index244[key]; + }, + }); +}); +var _index245 = __nccwpck_require__(90211); +Object.keys(_index245).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _index245[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _index245[key]; + }, + }); +}); + + +/***/ }), + +/***/ 48634: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.interval = interval; +var _index = __nccwpck_require__(58897); + +/** + * The {@link interval} function options. + */ + +/** + * The {@link interval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the start argument, + * then the end interval date. If a context function is passed, it uses the context + * function return type. + */ + +/** + * @name interval + * @category Interval Helpers + * @summary Creates an interval object and validates its values. + * + * @description + * Creates a normalized interval object and validates its values. If the interval is invalid, an exception is thrown. + * + * @typeParam StartDate - Start date type. + * @typeParam EndDate - End date type. + * @typeParam Options - Options type. + * + * @param start - The start of the interval. + * @param end - The end of the interval. + * @param options - The options object. + * + * @throws `Start date is invalid` when `start` is invalid. + * @throws `End date is invalid` when `end` is invalid. + * @throws `End date must be after start date` when end is before `start` and `options.assertPositive` is true. + * + * @returns The normalized and validated interval object. + */ +function interval(start, end, options) { + const [_start, _end] = (0, _index.normalizeDates)(options?.in, start, end); + + if (isNaN(+_start)) throw new TypeError("Start date is invalid"); + if (isNaN(+_end)) throw new TypeError("End date is invalid"); + + if (options?.assertPositive && +_start > +_end) + throw new TypeError("End date must be after start date"); + + return { start: _start, end: _end }; +} + + +/***/ }), + +/***/ 65076: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.intervalToDuration = intervalToDuration; +var _index = __nccwpck_require__(97776); +var _index2 = __nccwpck_require__(42033); +var _index3 = __nccwpck_require__(85554); +var _index4 = __nccwpck_require__(59806); +var _index5 = __nccwpck_require__(44963); +var _index6 = __nccwpck_require__(41434); +var _index7 = __nccwpck_require__(95205); +var _index8 = __nccwpck_require__(52282); + +/** + * The {@link intervalToDuration} function options. + */ + +/** + * @name intervalToDuration + * @category Common Helpers + * @summary Convert interval to duration + * + * @description + * Convert an interval object to a duration object. + * + * @param interval - The interval to convert to duration + * @param options - The context options + * + * @returns The duration object + * + * @example + * // Get the duration between January 15, 1929 and April 4, 1968. + * intervalToDuration({ + * start: new Date(1929, 0, 15, 12, 0, 0), + * end: new Date(1968, 3, 4, 19, 5, 0) + * }); + * //=> { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } + */ +function intervalToDuration(interval, options) { + const { start, end } = (0, _index.normalizeInterval)(options?.in, interval); + const duration = {}; + + const years = (0, _index8.differenceInYears)(end, start); + if (years) duration.years = years; + + const remainingMonths = (0, _index2.add)(start, { years: duration.years }); + const months = (0, _index6.differenceInMonths)(end, remainingMonths); + if (months) duration.months = months; + + const remainingDays = (0, _index2.add)(remainingMonths, { + months: duration.months, + }); + const days = (0, _index3.differenceInDays)(end, remainingDays); + if (days) duration.days = days; + + const remainingHours = (0, _index2.add)(remainingDays, { + days: duration.days, + }); + const hours = (0, _index4.differenceInHours)(end, remainingHours); + if (hours) duration.hours = hours; + + const remainingMinutes = (0, _index2.add)(remainingHours, { + hours: duration.hours, + }); + const minutes = (0, _index5.differenceInMinutes)(end, remainingMinutes); + if (minutes) duration.minutes = minutes; + + const remainingSeconds = (0, _index2.add)(remainingMinutes, { + minutes: duration.minutes, + }); + const seconds = (0, _index7.differenceInSeconds)(end, remainingSeconds); + if (seconds) duration.seconds = seconds; + + return duration; +} + + +/***/ }), + +/***/ 85954: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.intlFormat = intlFormat; +var _index = __nccwpck_require__(46439); + +/** + * The locale string (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). + * @deprecated + * + * [TODO] Remove in v4 + */ + +/** + * The format options (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) + */ + +/** + * The locale options. + */ + +/** + * @name intlFormat + * @category Common Helpers + * @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat). + * + * @description + * Return the formatted date string in the given format. + * The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside. + * formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options) + * + * > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default. + * + * @param date - The date to format + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 4 October 2019 in middle-endian format: + * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456)) + * //=> 10/4/2019 + */ + +/** + * @param date - The date to format + * @param localeOptions - An object with locale + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 4 October 2019 in Korean. + * // Convert the date with locale's options. + * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { + * locale: 'ko-KR', + * }) + * //=> 2019. 10. 4. + */ + +/** + * @param date - The date to format + * @param formatOptions - The format options + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 4 October 2019. + * // Convert the date with format's options. + * const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), { + * year: 'numeric', + * month: 'numeric', + * day: 'numeric', + * hour: 'numeric', + * }) + * //=> 10/4/2019, 12 PM + */ + +/** + * @param date - The date to format + * @param formatOptions - The format options + * @param localeOptions - An object with locale + * + * @returns The formatted date string + * + * @throws `date` must not be Invalid Date + * + * @example + * // Represent 4 October 2019 in German. + * // Convert the date with format's options and locale's options. + * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { + * weekday: 'long', + * year: 'numeric', + * month: 'long', + * day: 'numeric', + * }, { + * locale: 'de-DE', + * }) + * //=> Freitag, 4. Oktober 2019 + */ + +function intlFormat(date, formatOrLocale, localeOptions) { + let formatOptions; + + if (isFormatOptions(formatOrLocale)) { + formatOptions = formatOrLocale; + } else { + localeOptions = formatOrLocale; + } + + return new Intl.DateTimeFormat(localeOptions?.locale, formatOptions).format( + (0, _index.toDate)(date), + ); +} + +function isFormatOptions(opts) { + return opts !== undefined && !("locale" in opts); +} + + +/***/ }), + +/***/ 47240: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.intlFormatDistance = intlFormatDistance; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(64278); + +var _index3 = __nccwpck_require__(25671); +var _index4 = __nccwpck_require__(69633); +var _index5 = __nccwpck_require__(79421); +var _index6 = __nccwpck_require__(11464); +var _index7 = __nccwpck_require__(64472); +var _index8 = __nccwpck_require__(59806); +var _index9 = __nccwpck_require__(44963); +var _index10 = __nccwpck_require__(95205); + +/** + * The {@link intlFormatDistance} function options. + */ + +/** + * The unit used to format the distance in {@link intlFormatDistance}. + */ + +/** + * @name intlFormatDistance + * @category Common Helpers + * @summary Formats distance between two dates in a human-readable format + * @description + * The function calculates the difference between two dates and formats it as a human-readable string. + * + * The function will pick the most appropriate unit depending on the distance between dates. For example, if the distance is a few hours, it might return `x hours`. If the distance is a few months, it might return `x months`. + * + * You can also specify a unit to force using it regardless of the distance to get a result like `123456 hours`. + * + * See the table below for the unit picking logic: + * + * | Distance between dates | Result (past) | Result (future) | + * | ---------------------- | -------------- | --------------- | + * | 0 seconds | now | now | + * | 1-59 seconds | X seconds ago | in X seconds | + * | 1-59 minutes | X minutes ago | in X minutes | + * | 1-23 hours | X hours ago | in X hours | + * | 1 day | yesterday | tomorrow | + * | 2-6 days | X days ago | in X days | + * | 7 days | last week | next week | + * | 8 days-1 month | X weeks ago | in X weeks | + * | 1 month | last month | next month | + * | 2-3 months | X months ago | in X months | + * | 1 quarter | last quarter | next quarter | + * | 2-3 quarters | X quarters ago | in X quarters | + * | 1 year | last year | next year | + * | 2+ years | X years ago | in X years | + * + * @param laterDate - The date + * @param earlierDate - The date to compare with. + * @param options - An object with options. + * See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) + * The narrow one could be similar to the short one for some locales. + * + * @returns The distance in words according to language-sensitive relative time formatting. + * + * @throws `date` must not be Invalid Date + * @throws `baseDate` must not be Invalid Date + * @throws `options.unit` must not be invalid Unit + * @throws `options.locale` must not be invalid locale + * @throws `options.localeMatcher` must not be invalid localeMatcher + * @throws `options.numeric` must not be invalid numeric + * @throws `options.style` must not be invalid style + * + * @example + * // What is the distance between the dates when the fist date is after the second? + * intlFormatDistance( + * new Date(1986, 3, 4, 11, 30, 0), + * new Date(1986, 3, 4, 10, 30, 0) + * ) + * //=> 'in 1 hour' + * + * // What is the distance between the dates when the fist date is before the second? + * intlFormatDistance( + * new Date(1986, 3, 4, 10, 30, 0), + * new Date(1986, 3, 4, 11, 30, 0) + * ) + * //=> '1 hour ago' + * + * @example + * // Use the unit option to force the function to output the result in quarters. Without setting it, the example would return "next year" + * intlFormatDistance( + * new Date(1987, 6, 4, 10, 30, 0), + * new Date(1986, 3, 4, 10, 30, 0), + * { unit: 'quarter' } + * ) + * //=> 'in 5 quarters' + * + * @example + * // Use the locale option to get the result in Spanish. Without setting it, the example would return "in 1 hour". + * intlFormatDistance( + * new Date(1986, 3, 4, 11, 30, 0), + * new Date(1986, 3, 4, 10, 30, 0), + * { locale: 'es' } + * ) + * //=> 'dentro de 1 hora' + * + * @example + * // Use the numeric option to force the function to use numeric values. Without setting it, the example would return "tomorrow". + * intlFormatDistance( + * new Date(1986, 3, 5, 11, 30, 0), + * new Date(1986, 3, 4, 11, 30, 0), + * { numeric: 'always' } + * ) + * //=> 'in 1 day' + * + * @example + * // Use the style option to force the function to use short values. Without setting it, the example would return "in 2 years". + * intlFormatDistance( + * new Date(1988, 3, 4, 11, 30, 0), + * new Date(1986, 3, 4, 11, 30, 0), + * { style: 'short' } + * ) + * //=> 'in 2 yr' + */ +function intlFormatDistance(laterDate, earlierDate, options) { + let value = 0; + let unit; + + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + + if (!options?.unit) { + // Get the unit based on diffInSeconds calculations if no unit is specified + const diffInSeconds = (0, _index10.differenceInSeconds)( + laterDate_, + earlierDate_, + ); // The smallest unit + + if (Math.abs(diffInSeconds) < _index2.secondsInMinute) { + value = (0, _index10.differenceInSeconds)(laterDate_, earlierDate_); + unit = "second"; + } else if (Math.abs(diffInSeconds) < _index2.secondsInHour) { + value = (0, _index9.differenceInMinutes)(laterDate_, earlierDate_); + unit = "minute"; + } else if ( + Math.abs(diffInSeconds) < _index2.secondsInDay && + Math.abs( + (0, _index3.differenceInCalendarDays)(laterDate_, earlierDate_), + ) < 1 + ) { + value = (0, _index8.differenceInHours)(laterDate_, earlierDate_); + unit = "hour"; + } else if ( + Math.abs(diffInSeconds) < _index2.secondsInWeek && + (value = (0, _index3.differenceInCalendarDays)( + laterDate_, + earlierDate_, + )) && + Math.abs(value) < 7 + ) { + unit = "day"; + } else if (Math.abs(diffInSeconds) < _index2.secondsInMonth) { + value = (0, _index6.differenceInCalendarWeeks)(laterDate_, earlierDate_); + unit = "week"; + } else if (Math.abs(diffInSeconds) < _index2.secondsInQuarter) { + value = (0, _index4.differenceInCalendarMonths)(laterDate_, earlierDate_); + unit = "month"; + } else if (Math.abs(diffInSeconds) < _index2.secondsInYear) { + if ( + (0, _index5.differenceInCalendarQuarters)(laterDate_, earlierDate_) < 4 + ) { + // To filter out cases that are less than a year but match 4 quarters + value = (0, _index5.differenceInCalendarQuarters)( + laterDate_, + earlierDate_, + ); + unit = "quarter"; + } else { + value = (0, _index7.differenceInCalendarYears)( + laterDate_, + earlierDate_, + ); + unit = "year"; + } + } else { + value = (0, _index7.differenceInCalendarYears)(laterDate_, earlierDate_); + unit = "year"; + } + } else { + // Get the value if unit is specified + unit = options?.unit; + if (unit === "second") { + value = (0, _index10.differenceInSeconds)(laterDate_, earlierDate_); + } else if (unit === "minute") { + value = (0, _index9.differenceInMinutes)(laterDate_, earlierDate_); + } else if (unit === "hour") { + value = (0, _index8.differenceInHours)(laterDate_, earlierDate_); + } else if (unit === "day") { + value = (0, _index3.differenceInCalendarDays)(laterDate_, earlierDate_); + } else if (unit === "week") { + value = (0, _index6.differenceInCalendarWeeks)(laterDate_, earlierDate_); + } else if (unit === "month") { + value = (0, _index4.differenceInCalendarMonths)(laterDate_, earlierDate_); + } else if (unit === "quarter") { + value = (0, _index5.differenceInCalendarQuarters)( + laterDate_, + earlierDate_, + ); + } else if (unit === "year") { + value = (0, _index7.differenceInCalendarYears)(laterDate_, earlierDate_); + } + } + + const rtf = new Intl.RelativeTimeFormat(options?.locale, { + numeric: "auto", + ...options, + }); + + return rtf.format(value, unit); +} + + +/***/ }), + +/***/ 49292: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isAfter = isAfter; +var _index = __nccwpck_require__(46439); + +/** + * @name isAfter + * @category Common Helpers + * @summary Is the first date after the second one? + * + * @description + * Is the first date after the second one? + * + * @param date - The date that should be after the other one to return true + * @param dateToCompare - The date to compare with + * + * @returns The first date is after the second date + * + * @example + * // Is 10 July 1989 after 11 February 1987? + * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) + * //=> true + */ +function isAfter(date, dateToCompare) { + return +(0, _index.toDate)(date) > +(0, _index.toDate)(dateToCompare); +} + + +/***/ }), + +/***/ 97176: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isBefore = isBefore; +var _index = __nccwpck_require__(46439); + +/** + * @name isBefore + * @category Common Helpers + * @summary Is the first date before the second one? + * + * @description + * Is the first date before the second one? + * + * @param date - The date that should be before the other one to return true + * @param dateToCompare - The date to compare with + * + * @returns The first date is before the second date + * + * @example + * // Is 10 July 1989 before 11 February 1987? + * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) + * //=> false + */ +function isBefore(date, dateToCompare) { + return +(0, _index.toDate)(date) < +(0, _index.toDate)(dateToCompare); +} + + +/***/ }), + +/***/ 21652: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.isDate = isDate; /** + * @name isDate + * @category Common Helpers + * @summary Is the given value a date? + * + * @description + * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes. + * + * @param value - The value to check + * + * @returns True if the given value is a date + * + * @example + * // For a valid date: + * const result = isDate(new Date()) + * //=> true + * + * @example + * // For an invalid date: + * const result = isDate(new Date(NaN)) + * //=> true + * + * @example + * // For some value: + * const result = isDate('2014-02-31') + * //=> false + * + * @example + * // For an object: + * const result = isDate({}) + * //=> false + */ +function isDate(value) { + return ( + value instanceof Date || + (typeof value === "object" && + Object.prototype.toString.call(value) === "[object Date]") + ); +} + + +/***/ }), + +/***/ 42656: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isEqual = isEqual; +var _index = __nccwpck_require__(46439); + +/** + * @name isEqual + * @category Common Helpers + * @summary Are the given dates equal? + * + * @description + * Are the given dates equal? + * + * @param dateLeft - The first date to compare + * @param dateRight - The second date to compare + * + * @returns The dates are equal + * + * @example + * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal? + * const result = isEqual( + * new Date(2014, 6, 2, 6, 30, 45, 0), + * new Date(2014, 6, 2, 6, 30, 45, 500) + * ) + * //=> false + */ +function isEqual(leftDate, rightDate) { + return +(0, _index.toDate)(leftDate) === +(0, _index.toDate)(rightDate); +} + + +/***/ }), + +/***/ 76511: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.isExists = isExists; /** + * @name isExists + * @category Common Helpers + * @summary Is the given date exists? + * + * @description + * Checks if the given arguments convert to an existing date. + * + * @param year - The year of the date to check + * @param month - The month of the date to check + * @param day - The day of the date to check + * + * @returns `true` if the date exists + * + * @example + * // For the valid date: + * const result = isExists(2018, 0, 31) + * //=> true + * + * @example + * // For the invalid date: + * const result = isExists(2018, 1, 31) + * //=> false + */ +function isExists(year, month, day) { + const date = new Date(year, month, day); + return ( + date.getFullYear() === year && + date.getMonth() === month && + date.getDate() === day + ); +} + + +/***/ }), + +/***/ 14603: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isFirstDayOfMonth = isFirstDayOfMonth; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isFirstDayOfMonth} function options. + */ + +/** + * @name isFirstDayOfMonth + * @category Month Helpers + * @summary Is the given date the first day of a month? + * + * @description + * Is the given date the first day of a month? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is the first day of a month + * + * @example + * // Is 1 September 2014 the first day of a month? + * const result = isFirstDayOfMonth(new Date(2014, 8, 1)) + * //=> true + */ +function isFirstDayOfMonth(date, options) { + return (0, _index.toDate)(date, options?.in).getDate() === 1; +} + + +/***/ }), + +/***/ 83998: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isFriday = isFriday; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isFriday} function options. + */ + +/** + * @name isFriday + * @category Weekday Helpers + * @summary Is the given date Friday? + * + * @description + * Is the given date Friday? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is Friday + * + * @example + * // Is 26 September 2014 Friday? + * const result = isFriday(new Date(2014, 8, 26)) + * //=> true + */ +function isFriday(date, options) { + return (0, _index.toDate)(date, options?.in).getDay() === 5; +} + + +/***/ }), + +/***/ 41444: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isFuture = isFuture; +var _index = __nccwpck_require__(46439); + +/** + * @name isFuture + * @category Common Helpers + * @summary Is the given date in the future? + * @pure false + * + * @description + * Is the given date in the future? + * + * @param date - The date to check + * + * @returns The date is in the future + * + * @example + * // If today is 6 October 2014, is 31 December 2014 in the future? + * const result = isFuture(new Date(2014, 11, 31)) + * //=> true + */ +function isFuture(date) { + return +(0, _index.toDate)(date) > Date.now(); +} + + +/***/ }), + +/***/ 48454: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isLastDayOfMonth = isLastDayOfMonth; +var _index = __nccwpck_require__(79982); +var _index2 = __nccwpck_require__(2127); +var _index3 = __nccwpck_require__(46439); + +/** + * @name isLastDayOfMonth + * @category Month Helpers + * @summary Is the given date the last day of a month? + * + * @description + * Is the given date the last day of a month? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is the last day of a month + * + * @example + * // Is 28 February 2014 the last day of a month? + * const result = isLastDayOfMonth(new Date(2014, 1, 28)) + * //=> true + */ +function isLastDayOfMonth(date, options) { + const _date = (0, _index3.toDate)(date, options?.in); + return ( + +(0, _index.endOfDay)(_date, options) === + +(0, _index2.endOfMonth)(_date, options) + ); +} + + +/***/ }), + +/***/ 76605: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isLeapYear = isLeapYear; +var _index = __nccwpck_require__(46439); + +/** + * @name isLeapYear + * @category Year Helpers + * @summary Is the given date in the leap year? + * + * @description + * Is the given date in the leap year? + * + * @param date - The date to check + * @param options - The options object + * + * @returns The date is in the leap year + * + * @example + * // Is 1 September 2012 in the leap year? + * const result = isLeapYear(new Date(2012, 8, 1)) + * //=> true + */ +function isLeapYear(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const year = _date.getFullYear(); + return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); +} + + +/***/ }), + +/***/ 80248: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isMatch = isMatch; +var _index = __nccwpck_require__(16142); +var _index2 = __nccwpck_require__(35679); + +/** + * The {@link isMatch} function options. + */ + +/** + * @name isMatch + * @category Common Helpers + * @summary validates the date string against given formats + * + * @description + * Return the true if given date is string correct against the given format else + * will return false. + * + * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters in the format string wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. + * + * Format of the format string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * with a few additions (see note 5 below the table). + * + * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited + * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: + * + * ```javascript + * isMatch('23 AM', 'HH a') + * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time + * ``` + * + * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true + * + * Accepted format string patterns: + * | Unit |Prior| Pattern | Result examples | Notes | + * |---------------------------------|-----|---------|-----------------------------------|-------| + * | Era | 140 | G..GGG | AD, BC | | + * | | | GGGG | Anno Domini, Before Christ | 2 | + * | | | GGGGG | A, B | | + * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | + * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | yy | 44, 01, 00, 17 | 4 | + * | | | yyy | 044, 001, 123, 999 | 4 | + * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | + * | | | yyyyy | ... | 2,4 | + * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | + * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | YY | 44, 01, 00, 17 | 4,6 | + * | | | YYY | 044, 001, 123, 999 | 4 | + * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | + * | | | YYYYY | ... | 2,4 | + * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | + * | | | RR | -43, 01, 00, 17 | 4,5 | + * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | + * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | + * | | | RRRRR | ... | 2,4,5 | + * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | + * | | | uu | -43, 01, 99, -99 | 4 | + * | | | uuu | -043, 001, 123, 999, -999 | 4 | + * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | + * | | | uuuuu | ... | 2,4 | + * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | + * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | QQ | 01, 02, 03, 04 | | + * | | | QQQ | Q1, Q2, Q3, Q4 | | + * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | + * | | | QQQQQ | 1, 2, 3, 4 | 4 | + * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | + * | | | qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | qq | 01, 02, 03, 04 | | + * | | | qqq | Q1, Q2, Q3, Q4 | | + * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | + * | | | qqqqq | 1, 2, 3, 4 | 3 | + * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | + * | | | Mo | 1st, 2nd, ..., 12th | 5 | + * | | | MM | 01, 02, ..., 12 | | + * | | | MMM | Jan, Feb, ..., Dec | | + * | | | MMMM | January, February, ..., December | 2 | + * | | | MMMMM | J, F, ..., D | | + * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | + * | | | Lo | 1st, 2nd, ..., 12th | 5 | + * | | | LL | 01, 02, ..., 12 | | + * | | | LLL | Jan, Feb, ..., Dec | | + * | | | LLLL | January, February, ..., December | 2 | + * | | | LLLLL | J, F, ..., D | | + * | Local week of year | 100 | w | 1, 2, ..., 53 | | + * | | | wo | 1st, 2nd, ..., 53th | 5 | + * | | | ww | 01, 02, ..., 53 | | + * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | + * | | | Io | 1st, 2nd, ..., 53th | 5 | + * | | | II | 01, 02, ..., 53 | 5 | + * | Day of month | 90 | d | 1, 2, ..., 31 | | + * | | | do | 1st, 2nd, ..., 31st | 5 | + * | | | dd | 01, 02, ..., 31 | | + * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | + * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | + * | | | DD | 01, 02, ..., 365, 366 | 7 | + * | | | DDD | 001, 002, ..., 365, 366 | | + * | | | DDDD | ... | 2 | + * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | | + * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | + * | | | EEEEE | M, T, W, T, F, S, S | | + * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | + * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | + * | | | io | 1st, 2nd, ..., 7th | 5 | + * | | | ii | 01, 02, ..., 07 | 5 | + * | | | iii | Mon, Tue, Wed, ..., Su | 5 | + * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | + * | | | iiiii | M, T, W, T, F, S, S | 5 | + * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 | + * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | + * | | | eo | 2nd, 3rd, ..., 1st | 5 | + * | | | ee | 02, 03, ..., 01 | | + * | | | eee | Mon, Tue, Wed, ..., Su | | + * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | + * | | | eeeee | M, T, W, T, F, S, S | | + * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | + * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | + * | | | co | 2nd, 3rd, ..., 1st | 5 | + * | | | cc | 02, 03, ..., 01 | | + * | | | ccc | Mon, Tue, Wed, ..., Su | | + * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | + * | | | ccccc | M, T, W, T, F, S, S | | + * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | + * | AM, PM | 80 | a..aaa | AM, PM | | + * | | | aaaa | a.m., p.m. | 2 | + * | | | aaaaa | a, p | | + * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | + * | | | bbbb | a.m., p.m., noon, midnight | 2 | + * | | | bbbbb | a, p, n, mi | | + * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | + * | | | BBBB | at night, in the morning, ... | 2 | + * | | | BBBBB | at night, in the morning, ... | | + * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | + * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | + * | | | hh | 01, 02, ..., 11, 12 | | + * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | + * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | + * | | | HH | 00, 01, 02, ..., 23 | | + * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | + * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | + * | | | KK | 01, 02, ..., 11, 00 | | + * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | + * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | + * | | | kk | 24, 01, 02, ..., 23 | | + * | Minute | 60 | m | 0, 1, ..., 59 | | + * | | | mo | 0th, 1st, ..., 59th | 5 | + * | | | mm | 00, 01, ..., 59 | | + * | Second | 50 | s | 0, 1, ..., 59 | | + * | | | so | 0th, 1st, ..., 59th | 5 | + * | | | ss | 00, 01, ..., 59 | | + * | Seconds timestamp | 40 | t | 512969520 | | + * | | | tt | ... | 2 | + * | Fraction of second | 30 | S | 0, 1, ..., 9 | | + * | | | SS | 00, 01, ..., 99 | | + * | | | SSS | 000, 001, ..., 999 | | + * | | | SSSS | ... | 2 | + * | Milliseconds timestamp | 20 | T | 512969520900 | | + * | | | TT | ... | 2 | + * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | + * | | | XX | -0800, +0530, Z | | + * | | | XXX | -08:00, +05:30, Z | | + * | | | XXXX | -0800, +0530, Z, +123456 | 2 | + * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | + * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | + * | | | xx | -0800, +0530, +0000 | | + * | | | xxx | -08:00, +05:30, +00:00 | 2 | + * | | | xxxx | -0800, +0530, +0000, +123456 | | + * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | + * | Long localized date | NA | P | 05/29/1453 | 5,8 | + * | | | PP | May 29, 1453 | | + * | | | PPP | May 29th, 1453 | | + * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | + * | Long localized time | NA | p | 12:00 AM | 5,8 | + * | | | pp | 12:00:00 AM | | + * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | + * | | | PPpp | May 29, 1453, 12:00:00 AM | | + * | | | PPPpp | May 29th, 1453 at ... | | + * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | + * Notes: + * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale + * are the same as "stand-alone" units, but are different in some languages. + * "Formatting" units are declined according to the rules of the language + * in the context of a date. "Stand-alone" units are always nominative singular. + * In `format` function, they will produce different result: + * + * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` + * + * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` + * + * `isMatch` will try to match both formatting and stand-alone units interchangeably. + * + * 2. Any sequence of the identical letters is a pattern, unless it is escaped by + * the single quote characters (see below). + * If the sequence is longer than listed in table: + * - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number + * as wide as the sequence + * - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit. + * These variations are marked with "2" in the last column of the table. + * + * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. + * These tokens represent the shortest form of the quarter. + * + * 4. The main difference between `y` and `u` patterns are B.C. years: + * + * | Year | `y` | `u` | + * |------|-----|-----| + * | AC 1 | 1 | 1 | + * | BC 1 | 1 | 0 | + * | BC 2 | 2 | -1 | + * + * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: + * + * `isMatch('50', 'yy') //=> true` + * + * `isMatch('75', 'yy') //=> true` + * + * while `uu` will use the year as is: + * + * `isMatch('50', 'uu') //=> true` + * + * `isMatch('75', 'uu') //=> true` + * + * The same difference is true for local and ISO week-numbering years (`Y` and `R`), + * except local week-numbering years are dependent on `options.weekStartsOn` + * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear) + * and [setWeekYear](https://date-fns.org/docs/setWeekYear)). + * + * 5. These patterns are not in the Unicode Technical Standard #35: + * - `i`: ISO day of week + * - `I`: ISO week of year + * - `R`: ISO week-numbering year + * - `o`: ordinal number modifier + * - `P`: long localized date + * - `p`: long localized time + * + * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. + * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. + * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based + * on the given locale. + * + * using `en-US` locale: `P` => `MM/dd/yyyy` + * using `en-US` locale: `p` => `hh:mm a` + * using `pt-BR` locale: `P` => `dd/MM/yyyy` + * using `pt-BR` locale: `p` => `HH:mm` + * + * Values will be checked in the descending order of its unit's priority. + * Units of an equal priority overwrite each other in the order of appearance. + * + * If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year), + * the values will be taken from today's using `new Date()` date which works as a context of parsing. + * + * The result may vary by locale. + * + * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. + * + * @param dateStr - The date string to verify + * @param format - The string of tokens + * @param options - An object with options. + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * @returns Is format string a match for date string? + * + * @throws `options.locale` must contain `match` property + * @throws use `yyyy` instead of `YYYY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws use `yy` instead of `YY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws use `d` instead of `D` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws use `dd` instead of `DD` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws format string contains an unescaped latin alphabet character + * + * @example + * // Match 11 February 2014 from middle-endian format: + * const result = isMatch('02/11/2014', 'MM/dd/yyyy') + * //=> true + * + * @example + * // Match 28th of February in Esperanto locale in the context of 2010 year: + * import eo from 'date-fns/locale/eo' + * const result = isMatch('28-a de februaro', "do 'de' MMMM", { + * locale: eo + * }) + * //=> true + */ +function isMatch(dateStr, formatStr, options) { + return (0, _index.isValid)( + (0, _index2.parse)(dateStr, formatStr, new Date(), options), + ); +} + + +/***/ }), + +/***/ 87363: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isMonday = isMonday; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isMonday} function options. + */ + +/** + * @name isMonday + * @category Weekday Helpers + * @summary Is the given date Monday? + * + * @description + * Is the given date Monday? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is Monday + * + * @example + * // Is 22 September 2014 Monday? + * const result = isMonday(new Date(2014, 8, 22)) + * //=> true + */ +function isMonday(date, options) { + return (0, _index.toDate)(date, options?.in).getDay() === 1; +} + + +/***/ }), + +/***/ 5427: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isPast = isPast; +var _index = __nccwpck_require__(46439); + +/** + * @name isPast + * @category Common Helpers + * @summary Is the given date in the past? + * @pure false + * + * @description + * Is the given date in the past? + * + * @param date - The date to check + * + * @returns The date is in the past + * + * @example + * // If today is 6 October 2014, is 2 July 2014 in the past? + * const result = isPast(new Date(2014, 6, 2)) + * //=> true + */ +function isPast(date) { + return +(0, _index.toDate)(date) < Date.now(); +} + + +/***/ }), + +/***/ 4139: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameDay = isSameDay; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(15951); + +/** + * The {@link isSameDay} function options. + */ + +/** + * @name isSameDay + * @category Day Helpers + * @summary Are the given dates in the same day (and year and month)? + * + * @description + * Are the given dates in the same day (and year and month)? + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same day (and year and month) + * + * @example + * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day? + * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0)) + * //=> true + * + * @example + * // Are 4 September and 4 October in the same day? + * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4)) + * //=> false + * + * @example + * // Are 4 September, 2014 and 4 September, 2015 in the same day? + * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4)) + * //=> false + */ +function isSameDay(laterDate, earlierDate, options) { + const [dateLeft_, dateRight_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return ( + +(0, _index2.startOfDay)(dateLeft_) === +(0, _index2.startOfDay)(dateRight_) + ); +} + + +/***/ }), + +/***/ 35584: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameHour = isSameHour; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(77057); + +/** + * The {@link isSameHour} function options. + */ + +/** + * @name isSameHour + * @category Hour Helpers + * @summary Are the given dates in the same hour (and same day)? + * + * @description + * Are the given dates in the same hour (and same day)? + * + * @param dateLeft - The first date to check + * @param dateRight - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same hour (and same day) + * + * @example + * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour? + * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30)) + * //=> true + * + * @example + * // Are 4 September 2014 06:00:00 and 5 September 06:00:00 in the same hour? + * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 5, 6, 0)) + * //=> false + */ +function isSameHour(dateLeft, dateRight, options) { + const [dateLeft_, dateRight_] = (0, _index.normalizeDates)( + options?.in, + dateLeft, + dateRight, + ); + return ( + +(0, _index2.startOfHour)(dateLeft_) === + +(0, _index2.startOfHour)(dateRight_) + ); +} + + +/***/ }), + +/***/ 20940: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameISOWeek = isSameISOWeek; +var _index = __nccwpck_require__(5843); + +/** + * The {@link isSameISOWeek} function options. + */ + +/** + * @name isSameISOWeek + * @category ISO Week Helpers + * @summary Are the given dates in the same ISO week (and year)? + * + * @description + * Are the given dates in the same ISO week (and year)? + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same ISO week (and year) + * + * @example + * // Are 1 September 2014 and 7 September 2014 in the same ISO week? + * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7)) + * //=> true + * + * @example + * // Are 1 September 2014 and 1 September 2015 in the same ISO week? + * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2015, 8, 1)) + * //=> false + */ +function isSameISOWeek(laterDate, earlierDate, options) { + return (0, _index.isSameWeek)(laterDate, earlierDate, { + ...options, + weekStartsOn: 1, + }); +} + + +/***/ }), + +/***/ 91881: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameISOWeekYear = isSameISOWeekYear; +var _index = __nccwpck_require__(65437); + +var _index2 = __nccwpck_require__(58897); + +/** + * The {@link isSameISOWeekYear} function options. + */ + +/** + * @name isSameISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Are the given dates in the same ISO week-numbering year? + * + * @description + * Are the given dates in the same ISO week-numbering year? + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same ISO week-numbering year + * + * @example + * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year? + * const result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2)) + * //=> true + */ +function isSameISOWeekYear(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index2.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return ( + +(0, _index.startOfISOWeekYear)(laterDate_) === + +(0, _index.startOfISOWeekYear)(earlierDate_) + ); +} + + +/***/ }), + +/***/ 13759: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameMinute = isSameMinute; +var _index = __nccwpck_require__(17614); + +/** + * @name isSameMinute + * @category Minute Helpers + * @summary Are the given dates in the same minute (and hour and day)? + * + * @description + * Are the given dates in the same minute (and hour and day)? + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * + * @returns The dates are in the same minute (and hour and day) + * + * @example + * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15 in the same minute? + * const result = isSameMinute( + * new Date(2014, 8, 4, 6, 30), + * new Date(2014, 8, 4, 6, 30, 15) + * ) + * //=> true + * + * @example + * // Are 4 September 2014 06:30:00 and 5 September 2014 06:30:00 in the same minute? + * const result = isSameMinute( + * new Date(2014, 8, 4, 6, 30), + * new Date(2014, 8, 5, 6, 30) + * ) + * //=> false + */ +function isSameMinute(laterDate, earlierDate) { + return ( + +(0, _index.startOfMinute)(laterDate) === + +(0, _index.startOfMinute)(earlierDate) + ); +} + + +/***/ }), + +/***/ 22487: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameMonth = isSameMonth; +var _index = __nccwpck_require__(58897); + +/** + * The {@link isSameMonth} function options. + */ + +/** + * @name isSameMonth + * @category Month Helpers + * @summary Are the given dates in the same month (and year)? + * + * @description + * Are the given dates in the same month (and year)? + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same month (and year) + * + * @example + * // Are 2 September 2014 and 25 September 2014 in the same month? + * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25)) + * //=> true + * + * @example + * // Are 2 September 2014 and 25 September 2015 in the same month? + * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25)) + * //=> false + */ +function isSameMonth(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return ( + laterDate_.getFullYear() === earlierDate_.getFullYear() && + laterDate_.getMonth() === earlierDate_.getMonth() + ); +} + + +/***/ }), + +/***/ 74704: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameQuarter = isSameQuarter; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(77136); + +/** + * The {@link isSameQuarter} function options. + */ + +/** + * @name isSameQuarter + * @category Quarter Helpers + * @summary Are the given dates in the same quarter (and year)? + * + * @description + * Are the given dates in the same quarter (and year)? + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same quarter (and year) + * + * @example + * // Are 1 January 2014 and 8 March 2014 in the same quarter? + * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8)) + * //=> true + * + * @example + * // Are 1 January 2014 and 1 January 2015 in the same quarter? + * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1)) + * //=> false + */ +function isSameQuarter(laterDate, earlierDate, options) { + const [dateLeft_, dateRight_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return ( + +(0, _index2.startOfQuarter)(dateLeft_) === + +(0, _index2.startOfQuarter)(dateRight_) + ); +} + + +/***/ }), + +/***/ 58050: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameSecond = isSameSecond; +var _index = __nccwpck_require__(14147); + +/** + * @name isSameSecond + * @category Second Helpers + * @summary Are the given dates in the same second (and hour and day)? + * + * @description + * Are the given dates in the same second (and hour and day)? + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * + * @returns The dates are in the same second (and hour and day) + * + * @example + * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 in the same second? + * const result = isSameSecond( + * new Date(2014, 8, 4, 6, 30, 15), + * new Date(2014, 8, 4, 6, 30, 15, 500) + * ) + * //=> true + * + * @example + * // Are 4 September 2014 06:00:15.000 and 4 September 2014 06:01.15.000 in the same second? + * const result = isSameSecond( + * new Date(2014, 8, 4, 6, 0, 15), + * new Date(2014, 8, 4, 6, 1, 15) + * ) + * //=> false + * + * @example + * // Are 4 September 2014 06:00:15.000 and 5 September 2014 06:00.15.000 in the same second? + * const result = isSameSecond( + * new Date(2014, 8, 4, 6, 0, 15), + * new Date(2014, 8, 5, 6, 0, 15) + * ) + * //=> false + */ +function isSameSecond(laterDate, earlierDate) { + return ( + +(0, _index.startOfSecond)(laterDate) === + +(0, _index.startOfSecond)(earlierDate) + ); +} + + +/***/ }), + +/***/ 5843: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameWeek = isSameWeek; +var _index = __nccwpck_require__(58897); +var _index2 = __nccwpck_require__(31284); + +/** + * The {@link isSameWeek} function options. + */ + +/** + * @name isSameWeek + * @category Week Helpers + * @summary Are the given dates in the same week (and month and year)? + * + * @description + * Are the given dates in the same week (and month and year)? + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same week (and month and year) + * + * @example + * // Are 31 August 2014 and 4 September 2014 in the same week? + * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4)) + * //=> true + * + * @example + * // If week starts with Monday, + * // are 31 August 2014 and 4 September 2014 in the same week? + * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), { + * weekStartsOn: 1 + * }) + * //=> false + * + * @example + * // Are 1 January 2014 and 1 January 2015 in the same week? + * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1)) + * //=> false + */ +function isSameWeek(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return ( + +(0, _index2.startOfWeek)(laterDate_, options) === + +(0, _index2.startOfWeek)(earlierDate_, options) + ); +} + + +/***/ }), + +/***/ 51729: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSameYear = isSameYear; +var _index = __nccwpck_require__(58897); + +/** + * The {@link isSameYear} function options. + */ + +/** + * @name isSameYear + * @category Year Helpers + * @summary Are the given dates in the same year? + * + * @description + * Are the given dates in the same year? + * + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options + * + * @returns The dates are in the same year + * + * @example + * // Are 2 September 2014 and 25 September 2014 in the same year? + * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25)) + * //=> true + */ +function isSameYear(laterDate, earlierDate, options) { + const [laterDate_, earlierDate_] = (0, _index.normalizeDates)( + options?.in, + laterDate, + earlierDate, + ); + return laterDate_.getFullYear() === earlierDate_.getFullYear(); +} + + +/***/ }), + +/***/ 1623: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSaturday = isSaturday; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isSaturday} function options. + */ + +/** + * @name isSaturday + * @category Weekday Helpers + * @summary Is the given date Saturday? + * + * @description + * Is the given date Saturday? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is Saturday + * + * @example + * // Is 27 September 2014 Saturday? + * const result = isSaturday(new Date(2014, 8, 27)) + * //=> true + */ +function isSaturday(date, options) { + return (0, _index.toDate)(date, options?.in).getDay() === 6; +} + + +/***/ }), + +/***/ 4862: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isSunday = isSunday; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isSunday} function options. + */ + +/** + * @name isSunday + * @category Weekday Helpers + * @summary Is the given date Sunday? + * + * @description + * Is the given date Sunday? + * + * @param date - The date to check + * @param options - The options object + * + * @returns The date is Sunday + * + * @example + * // Is 21 September 2014 Sunday? + * const result = isSunday(new Date(2014, 8, 21)) + * //=> true + */ +function isSunday(date, options) { + return (0, _index.toDate)(date, options?.in).getDay() === 0; +} + + +/***/ }), + +/***/ 54760: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisHour = isThisHour; +var _index = __nccwpck_require__(18087); +var _index2 = __nccwpck_require__(35584); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link isThisHour} function options. + */ + +/** + * @name isThisHour + * @category Hour Helpers + * @summary Is the given date in the same hour as the current date? + * @pure false + * + * @description + * Is the given date in the same hour as the current date? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is in this hour + * + * @example + * // If now is 25 September 2014 18:30:15.500, + * // is 25 September 2014 18:00:00 in this hour? + * const result = isThisHour(new Date(2014, 8, 25, 18)) + * //=> true + */ +function isThisHour(date, options) { + return (0, _index2.isSameHour)( + (0, _index3.toDate)(date, options?.in), + (0, _index.constructNow)(options?.in || date), + ); +} + + +/***/ }), + +/***/ 61389: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisISOWeek = isThisISOWeek; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(20940); + +/** + * The {@link isThisISOWeek} function options. + */ + +/** + * @name isThisISOWeek + * @category ISO Week Helpers + * @summary Is the given date in the same ISO week as the current date? + * @pure false + * + * @description + * Is the given date in the same ISO week as the current date? + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is in this ISO week + * + * @example + * // If today is 25 September 2014, is 22 September 2014 in this ISO week? + * const result = isThisISOWeek(new Date(2014, 8, 22)) + * //=> true + */ +function isThisISOWeek(date, options) { + return (0, _index3.isSameISOWeek)( + (0, _index.constructFrom)(options?.in || date, date), + (0, _index2.constructNow)(options?.in || date), + ); +} + + +/***/ }), + +/***/ 61953: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisMinute = isThisMinute; +var _index = __nccwpck_require__(18087); +var _index2 = __nccwpck_require__(13759); + +/** + * @name isThisMinute + * @category Minute Helpers + * @summary Is the given date in the same minute as the current date? + * @pure false + * + * @description + * Is the given date in the same minute as the current date? + * + * @param date - The date to check + * + * @returns The date is in this minute + * + * @example + * // If now is 25 September 2014 18:30:15.500, + * // is 25 September 2014 18:30:00 in this minute? + * const result = isThisMinute(new Date(2014, 8, 25, 18, 30)) + * //=> true + */ + +function isThisMinute(date) { + return (0, _index2.isSameMinute)(date, (0, _index.constructNow)(date)); +} + + +/***/ }), + +/***/ 94620: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisMonth = isThisMonth; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(22487); + +/** + * The {@link isThisMonth} function options. + */ + +/** + * @name isThisMonth + * @category Month Helpers + * @summary Is the given date in the same month as the current date? + * @pure false + * + * @description + * Is the given date in the same month as the current date? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is in this month + * + * @example + * // If today is 25 September 2014, is 15 September 2014 in this month? + * const result = isThisMonth(new Date(2014, 8, 15)) + * //=> true + */ +function isThisMonth(date, options) { + return (0, _index3.isSameMonth)( + (0, _index.constructFrom)(options?.in || date, date), + (0, _index2.constructNow)(options?.in || date), + ); +} + + +/***/ }), + +/***/ 36940: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisQuarter = isThisQuarter; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(74704); + +/** + * The {@link isThisQuarter} function options. + */ + +/** + * @name isThisQuarter + * @category Quarter Helpers + * @summary Is the given date in the same quarter as the current date? + * @pure false + * + * @description + * Is the given date in the same quarter as the current date? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is in this quarter + * + * @example + * // If today is 25 September 2014, is 2 July 2014 in this quarter? + * const result = isThisQuarter(new Date(2014, 6, 2)) + * //=> true + */ +function isThisQuarter(date, options) { + return (0, _index3.isSameQuarter)( + (0, _index.constructFrom)(options?.in || date, date), + (0, _index2.constructNow)(options?.in || date), + ); +} + + +/***/ }), + +/***/ 93393: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisSecond = isThisSecond; +var _index = __nccwpck_require__(18087); +var _index2 = __nccwpck_require__(58050); + +/** + * @name isThisSecond + * @category Second Helpers + * @summary Is the given date in the same second as the current date? + * @pure false + * + * @description + * Is the given date in the same second as the current date? + * + * @param date - The date to check + * + * @returns The date is in this second + * + * @example + * // If now is 25 September 2014 18:30:15.500, + * // is 25 September 2014 18:30:15.000 in this second? + * const result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15)) + * //=> true + */ +function isThisSecond(date) { + return (0, _index2.isSameSecond)(date, (0, _index.constructNow)(date)); +} + + +/***/ }), + +/***/ 98890: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisWeek = isThisWeek; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(5843); + +/** + * The {@link isThisWeek} function options. + */ + +/** + * @name isThisWeek + * @category Week Helpers + * @summary Is the given date in the same week as the current date? + * @pure false + * + * @description + * Is the given date in the same week as the current date? + * + * @param date - The date to check + * @param options - The object with options + * + * @returns The date is in this week + * + * @example + * // If today is 25 September 2014, is 21 September 2014 in this week? + * const result = isThisWeek(new Date(2014, 8, 21)) + * //=> true + * + * @example + * // If today is 25 September 2014 and week starts with Monday + * // is 21 September 2014 in this week? + * const result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 }) + * //=> false + */ +function isThisWeek(date, options) { + return (0, _index3.isSameWeek)( + (0, _index.constructFrom)(options?.in || date, date), + (0, _index2.constructNow)(options?.in || date), + options, + ); +} + + +/***/ }), + +/***/ 44286: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThisYear = isThisYear; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(51729); + +/** + * The {@link isThisYear} function options. + */ + +/** + * @name isThisYear + * @category Year Helpers + * @summary Is the given date in the same year as the current date? + * @pure false + * + * @description + * Is the given date in the same year as the current date? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is in this year + * + * @example + * // If today is 25 September 2014, is 2 July 2014 in this year? + * const result = isThisYear(new Date(2014, 6, 2)) + * //=> true + */ +function isThisYear(date, options) { + return (0, _index3.isSameYear)( + (0, _index.constructFrom)(options?.in || date, date), + (0, _index2.constructNow)(options?.in || date), + ); +} + + +/***/ }), + +/***/ 76816: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isThursday = isThursday; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isThursday} function options. + */ + +/** + * @name isThursday + * @category Weekday Helpers + * @summary Is the given date Thursday? + * + * @description + * Is the given date Thursday? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is Thursday + * + * @example + * // Is 25 September 2014 Thursday? + * const result = isThursday(new Date(2014, 8, 25)) + * //=> true + */ +function isThursday(date, options) { + return (0, _index.toDate)(date, options?.in).getDay() === 4; +} + + +/***/ }), + +/***/ 55318: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isToday = isToday; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(4139); + +/** + * The {@link isToday} function options. + */ + +/** + * @name isToday + * @category Day Helpers + * @summary Is the given date today? + * @pure false + * + * @description + * Is the given date today? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is today + * + * @example + * // If today is 6 October 2014, is 6 October 14:00:00 today? + * const result = isToday(new Date(2014, 9, 6, 14, 0)) + * //=> true + */ +function isToday(date, options) { + return (0, _index3.isSameDay)( + (0, _index.constructFrom)(options?.in || date, date), + (0, _index2.constructNow)(options?.in || date), + ); +} + + +/***/ }), + +/***/ 20728: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isTomorrow = isTomorrow; +var _index = __nccwpck_require__(7412); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(4139); + +/** + * The {@link isTomorrow} function options. + */ + +/** + * @name isTomorrow + * @category Day Helpers + * @summary Is the given date tomorrow? + * @pure false + * + * @description + * Is the given date tomorrow? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is tomorrow + * + * @example + * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow? + * const result = isTomorrow(new Date(2014, 9, 7, 14, 0)) + * //=> true + */ +function isTomorrow(date, options) { + return (0, _index3.isSameDay)( + date, + (0, _index.addDays)((0, _index2.constructNow)(options?.in || date), 1), + options, + ); +} + + +/***/ }), + +/***/ 49011: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isTuesday = isTuesday; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isTuesday} function options. + */ + +/** + * @name isTuesday + * @category Weekday Helpers + * @summary Is the given date Tuesday? + * + * @description + * Is the given date Tuesday? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is Tuesday + * + * @example + * // Is 23 September 2014 Tuesday? + * const result = isTuesday(new Date(2014, 8, 23)) + * //=> true + */ +function isTuesday(date, options) { + return (0, _index.toDate)(date, options?.in).getDay() === 2; +} + + +/***/ }), + +/***/ 16142: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isValid = isValid; +var _index = __nccwpck_require__(21652); +var _index2 = __nccwpck_require__(46439); + +/** + * @name isValid + * @category Common Helpers + * @summary Is the given date valid? + * + * @description + * Returns false if argument is Invalid Date and true otherwise. + * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate) + * Invalid Date is a Date, whose time value is NaN. + * + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param date - The date to check + * + * @returns The date is valid + * + * @example + * // For the valid date: + * const result = isValid(new Date(2014, 1, 31)) + * //=> true + * + * @example + * // For the value, convertible into a date: + * const result = isValid(1393804800000) + * //=> true + * + * @example + * // For the invalid date: + * const result = isValid(new Date('')) + * //=> false + */ +function isValid(date) { + return !( + (!(0, _index.isDate)(date) && typeof date !== "number") || + isNaN(+(0, _index2.toDate)(date)) + ); +} + + +/***/ }), + +/***/ 10506: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isWednesday = isWednesday; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isWednesday} function options. + */ + +/** + * @name isWednesday + * @category Weekday Helpers + * @summary Is the given date Wednesday? + * + * @description + * Is the given date Wednesday? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is Wednesday + * + * @example + * // Is 24 September 2014 Wednesday? + * const result = isWednesday(new Date(2014, 8, 24)) + * //=> true + */ +function isWednesday(date, options) { + return (0, _index.toDate)(date, options?.in).getDay() === 3; +} + + +/***/ }), + +/***/ 51038: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isWeekend = isWeekend; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isWeekend} function options. + */ + +/** + * @name isWeekend + * @category Weekday Helpers + * @summary Does the given date fall on a weekend? + * + * @description + * Does the given date fall on a weekend? A weekend is either Saturday (`6`) or Sunday (`0`). + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date falls on a weekend + * + * @example + * // Does 5 October 2014 fall on a weekend? + * const result = isWeekend(new Date(2014, 9, 5)) + * //=> true + */ +function isWeekend(date, options) { + const day = (0, _index.toDate)(date, options?.in).getDay(); + return day === 0 || day === 6; +} + + +/***/ }), + +/***/ 33217: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isWithinInterval = isWithinInterval; +var _index = __nccwpck_require__(46439); + +/** + * The {@link isWithinInterval} function options. + */ + +/** + * @name isWithinInterval + * @category Interval Helpers + * @summary Is the given date within the interval? + * + * @description + * Is the given date within the interval? (Including start and end.) + * + * @param date - The date to check + * @param interval - The interval to check + * @param options - An object with options + * + * @returns The date is within the interval + * + * @example + * // For the date within the interval: + * isWithinInterval(new Date(2014, 0, 3), { + * start: new Date(2014, 0, 1), + * end: new Date(2014, 0, 7) + * }) + * // => true + * + * @example + * // For the date outside of the interval: + * isWithinInterval(new Date(2014, 0, 10), { + * start: new Date(2014, 0, 1), + * end: new Date(2014, 0, 7) + * }) + * // => false + * + * @example + * // For date equal to the interval start: + * isWithinInterval(date, { start, end: date }) + * // => true + * + * @example + * // For date equal to the interval end: + * isWithinInterval(date, { start: date, end }) + * // => true + */ +function isWithinInterval(date, interval, options) { + const time = +(0, _index.toDate)(date, options?.in); + const [startTime, endTime] = [ + +(0, _index.toDate)(interval.start, options?.in), + +(0, _index.toDate)(interval.end, options?.in), + ].sort((a, b) => a - b); + + return time >= startTime && time <= endTime; +} + + +/***/ }), + +/***/ 43245: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.isYesterday = isYesterday; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); +var _index3 = __nccwpck_require__(4139); +var _index4 = __nccwpck_require__(24345); + +/** + * The {@link isYesterday} function options. + */ + +/** + * @name isYesterday + * @category Day Helpers + * @summary Is the given date yesterday? + * @pure false + * + * @description + * Is the given date yesterday? + * + * @param date - The date to check + * @param options - An object with options + * + * @returns The date is yesterday + * + * @example + * // If today is 6 October 2014, is 5 October 14:00:00 yesterday? + * const result = isYesterday(new Date(2014, 9, 5, 14, 0)) + * //=> true + */ +function isYesterday(date, options) { + return (0, _index3.isSameDay)( + (0, _index.constructFrom)(options?.in || date, date), + (0, _index4.subDays)((0, _index2.constructNow)(options?.in || date), 1), + ); +} + + +/***/ }), + +/***/ 99446: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lastDayOfDecade = lastDayOfDecade; +var _index = __nccwpck_require__(46439); + +/** + * The {@link lastDayOfDecade} function options. + */ + +/** + * @name lastDayOfDecade + * @category Decade Helpers + * @summary Return the last day of a decade for the given date. + * + * @description + * Return the last day of a decade for the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type; inferred from arguments or specified by context. + * + * @param date - The original date + * @param options - The options + * + * @returns The last day of a decade + * + * @example + * // The last day of a decade for 21 December 2012 21:12:00: + * const result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00)) + * //=> Wed Dec 31 2019 00:00:00 + */ +function lastDayOfDecade(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const year = _date.getFullYear(); + const decade = 9 + Math.floor(year / 10) * 10; + _date.setFullYear(decade + 1, 0, 0); + _date.setHours(0, 0, 0, 0); + return (0, _index.toDate)(_date, options?.in); +} + + +/***/ }), + +/***/ 20069: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lastDayOfISOWeek = lastDayOfISOWeek; +var _index = __nccwpck_require__(92854); + +/** + * The {@link lastDayOfISOWeek} function options. + */ + +/** + * @name lastDayOfISOWeek + * @category ISO Week Helpers + * @summary Return the last day of an ISO week for the given date. + * + * @description + * Return the last day of an ISO week for the given date. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The last day of an ISO week + * + * @example + * // The last day of an ISO week for 2 September 2014 11:55:00: + * const result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sun Sep 07 2014 00:00:00 + */ +function lastDayOfISOWeek(date, options) { + return (0, _index.lastDayOfWeek)(date, { ...options, weekStartsOn: 1 }); +} + + +/***/ }), + +/***/ 30972: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lastDayOfISOWeekYear = lastDayOfISOWeekYear; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(47131); +var _index3 = __nccwpck_require__(38516); + +/** + * The {@link lastDayOfISOWeekYear} function options. + */ + +/** + * @name lastDayOfISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Return the last day of an ISO week-numbering year for the given date. + * + * @description + * Return the last day of an ISO week-numbering year, + * which always starts 3 days before the year's first Thursday. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The end of an ISO week-numbering year + * + * @example + * // The last day of an ISO week-numbering year for 2 July 2005: + * const result = lastDayOfISOWeekYear(new Date(2005, 6, 2)) + * //=> Sun Jan 01 2006 00:00:00 + */ +function lastDayOfISOWeekYear(date, options) { + const year = (0, _index2.getISOWeekYear)(date, options); + const fourthOfJanuary = (0, _index.constructFrom)(options?.in || date, 0); + fourthOfJanuary.setFullYear(year + 1, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + + const date_ = (0, _index3.startOfISOWeek)(fourthOfJanuary, options); + date_.setDate(date_.getDate() - 1); + return date_; +} + + +/***/ }), + +/***/ 2302: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lastDayOfMonth = lastDayOfMonth; +var _index = __nccwpck_require__(46439); + +/** + * The {@link lastDayOfMonth} function options. + */ + +/** + * @name lastDayOfMonth + * @category Month Helpers + * @summary Return the last day of a month for the given date. + * + * @description + * Return the last day of a month for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The last day of a month + * + * @example + * // The last day of a month for 2 September 2014 11:55:00: + * const result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 00:00:00 + */ +function lastDayOfMonth(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const month = _date.getMonth(); + _date.setFullYear(_date.getFullYear(), month + 1, 0); + _date.setHours(0, 0, 0, 0); + return (0, _index.toDate)(_date, options?.in); +} + + +/***/ }), + +/***/ 88525: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lastDayOfQuarter = lastDayOfQuarter; +var _index = __nccwpck_require__(46439); + +/** + * The {@link lastDayOfQuarter} function options. + */ + +/** + * @name lastDayOfQuarter + * @category Quarter Helpers + * @summary Return the last day of a year quarter for the given date. + * + * @description + * Return the last day of a year quarter for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - The options + * + * @returns The last day of a quarter + * + * @example + * // The last day of a quarter for 2 September 2014 11:55:00: + * const result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 00:00:00 + */ +function lastDayOfQuarter(date, options) { + const date_ = (0, _index.toDate)(date, options?.in); + const currentMonth = date_.getMonth(); + const month = currentMonth - (currentMonth % 3) + 3; + date_.setMonth(month, 0); + date_.setHours(0, 0, 0, 0); + return date_; +} + + +/***/ }), + +/***/ 92854: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lastDayOfWeek = lastDayOfWeek; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link lastDayOfWeek} function options. + */ + +/** + * @name lastDayOfWeek + * @category Week Helpers + * @summary Return the last day of a week for the given date. + * + * @description + * Return the last day of a week for the given date. + * The result will be in the local timezone unless a context is specified. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The last day of a week + */ +function lastDayOfWeek(date, options) { + const defaultOptions = (0, _index.getDefaultOptions)(); + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; + + const _date = (0, _index2.toDate)(date, options?.in); + const day = _date.getDay(); + const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); + + _date.setHours(0, 0, 0, 0); + _date.setDate(_date.getDate() + diff); + + return _date; +} + + +/***/ }), + +/***/ 26302: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lastDayOfYear = lastDayOfYear; +var _index = __nccwpck_require__(46439); + +/** + * The {@link lastDayOfYear} function options. + */ + +/** + * @name lastDayOfYear + * @category Year Helpers + * @summary Return the last day of a year for the given date. + * + * @description + * Return the last day of a year for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The last day of a year + * + * @example + * // The last day of a year for 2 September 2014 11:55:00: + * const result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) + * //=> Wed Dec 31 2014 00:00:00 + */ +function lastDayOfYear(date, options) { + const date_ = (0, _index.toDate)(date, options?.in); + const year = date_.getFullYear(); + date_.setFullYear(year + 1, 0, 0); + date_.setHours(0, 0, 0, 0); + return date_; +} + + +/***/ }), + +/***/ 37774: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.lightFormat = lightFormat; +Object.defineProperty(exports, "lightFormatters", ({ + enumerable: true, + get: function () { + return _index.lightFormatters; + }, +})); +var _index = __nccwpck_require__(58914); +var _index2 = __nccwpck_require__(16142); +var _index3 = __nccwpck_require__(46439); + +// Rexports of internal for libraries to use. +// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 + +// This RegExp consists of three parts separated by `|`: +// - (\w)\1* matches any sequences of the same letter +// - '' matches two quote characters in a row +// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), +// except a single quote symbol, which ends the sequence. +// Two quote characters do not end the sequence. +// If there is no matching single quote +// then the sequence will continue until the end of the string. +// - . matches any single character unmatched by previous parts of the RegExps +const formattingTokensRegExp = /(\w)\1*|''|'(''|[^'])+('|$)|./g; + +const escapedStringRegExp = /^'([^]*?)'?$/; +const doubleQuoteRegExp = /''/g; +const unescapedLatinCharacterRegExp = /[a-zA-Z]/; + +/** + * @private + */ + +/** + * @name lightFormat + * @category Common Helpers + * @summary Format the date. + * + * @description + * Return the formatted date string in the given format. Unlike `format`, + * `lightFormat` doesn't use locales and outputs date using the most popular tokens. + * + * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. + * + * Format of the string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * + * Accepted patterns: + * | Unit | Pattern | Result examples | + * |---------------------------------|---------|-----------------------------------| + * | AM, PM | a..aaa | AM, PM | + * | | aaaa | a.m., p.m. | + * | | aaaaa | a, p | + * | Calendar year | y | 44, 1, 1900, 2017 | + * | | yy | 44, 01, 00, 17 | + * | | yyy | 044, 001, 000, 017 | + * | | yyyy | 0044, 0001, 1900, 2017 | + * | Month (formatting) | M | 1, 2, ..., 12 | + * | | MM | 01, 02, ..., 12 | + * | Day of month | d | 1, 2, ..., 31 | + * | | dd | 01, 02, ..., 31 | + * | Hour [1-12] | h | 1, 2, ..., 11, 12 | + * | | hh | 01, 02, ..., 11, 12 | + * | Hour [0-23] | H | 0, 1, 2, ..., 23 | + * | | HH | 00, 01, 02, ..., 23 | + * | Minute | m | 0, 1, ..., 59 | + * | | mm | 00, 01, ..., 59 | + * | Second | s | 0, 1, ..., 59 | + * | | ss | 00, 01, ..., 59 | + * | Fraction of second | S | 0, 1, ..., 9 | + * | | SS | 00, 01, ..., 99 | + * | | SSS | 000, 001, ..., 999 | + * | | SSSS | ... | + * + * @param date - The original date + * @param format - The string of tokens + * + * @returns The formatted date string + * + * @throws `Invalid time value` if the date is invalid + * @throws format string contains an unescaped latin alphabet character + * + * @example + * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd') + * //=> '2014-02-11' + */ +function lightFormat(date, formatStr) { + const date_ = (0, _index3.toDate)(date); + + if (!(0, _index2.isValid)(date_)) { + throw new RangeError("Invalid time value"); + } + + const tokens = formatStr.match(formattingTokensRegExp); + + // The only case when formattingTokensRegExp doesn't match the string is when it's empty + if (!tokens) return ""; + + const result = tokens + .map((substring) => { + // Replace two single quote characters with one single quote character + if (substring === "''") { + return "'"; + } + + const firstCharacter = substring[0]; + if (firstCharacter === "'") { + return cleanEscapedString(substring); + } + + const formatter = _index.lightFormatters[firstCharacter]; + if (formatter) { + return formatter(date_, substring); + } + + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { + throw new RangeError( + "Format string contains an unescaped latin alphabet character `" + + firstCharacter + + "`", + ); + } + + return substring; + }) + .join(""); + + return result; +} + +function cleanEscapedString(input) { + const matches = input.match(escapedStringRegExp); + if (!matches) return input; + return matches[1].replace(doubleQuoteRegExp, "'"); +} + + +/***/ }), + +/***/ 49566: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.buildFormatLongFn = buildFormatLongFn; + +function buildFormatLongFn(args) { + return (options = {}) => { + // TODO: Remove String() + const width = options.width ? String(options.width) : args.defaultWidth; + const format = args.formats[width] || args.formats[args.defaultWidth]; + return format; + }; +} + + +/***/ }), + +/***/ 74177: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.buildLocalizeFn = buildLocalizeFn; + +/** + * The localize function argument callback which allows to convert raw value to + * the actual type. + * + * @param value - The value to convert + * + * @returns The converted value + */ + +/** + * The map of localized values for each width. + */ + +/** + * The index type of the locale unit value. It types conversion of units of + * values that don't start at 0 (i.e. quarters). + */ + +/** + * Converts the unit value to the tuple of values. + */ + +/** + * The tuple of localized era values. The first element represents BC, + * the second element represents AD. + */ + +/** + * The tuple of localized quarter values. The first element represents Q1. + */ + +/** + * The tuple of localized day values. The first element represents Sunday. + */ + +/** + * The tuple of localized month values. The first element represents January. + */ + +function buildLocalizeFn(args) { + return (value, options) => { + const context = options?.context ? String(options.context) : "standalone"; + + let valuesArray; + if (context === "formatting" && args.formattingValues) { + const defaultWidth = args.defaultFormattingWidth || args.defaultWidth; + const width = options?.width ? String(options.width) : defaultWidth; + + valuesArray = + args.formattingValues[width] || args.formattingValues[defaultWidth]; + } else { + const defaultWidth = args.defaultWidth; + const width = options?.width ? String(options.width) : args.defaultWidth; + + valuesArray = args.values[width] || args.values[defaultWidth]; + } + const index = args.argumentCallback ? args.argumentCallback(value) : value; + + // @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! + return valuesArray[index]; + }; +} + + +/***/ }), + +/***/ 33277: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.buildMatchFn = buildMatchFn; + +function buildMatchFn(args) { + return (string, options = {}) => { + const width = options.width; + + const matchPattern = + (width && args.matchPatterns[width]) || + args.matchPatterns[args.defaultMatchWidth]; + const matchResult = string.match(matchPattern); + + if (!matchResult) { + return null; + } + const matchedString = matchResult[0]; + + const parsePatterns = + (width && args.parsePatterns[width]) || + args.parsePatterns[args.defaultParseWidth]; + + const key = Array.isArray(parsePatterns) + ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) + : // [TODO] -- I challenge you to fix the type + findKey(parsePatterns, (pattern) => pattern.test(matchedString)); + + let value; + + value = args.valueCallback ? args.valueCallback(key) : key; + value = options.valueCallback + ? // [TODO] -- I challenge you to fix the type + options.valueCallback(value) + : value; + + const rest = string.slice(matchedString.length); + + return { value, rest }; + }; +} + +function findKey(object, predicate) { + for (const key in object) { + if ( + Object.prototype.hasOwnProperty.call(object, key) && + predicate(object[key]) + ) { + return key; + } + } + return undefined; +} + +function findIndex(array, predicate) { + for (let key = 0; key < array.length; key++) { + if (predicate(array[key])) { + return key; + } + } + return undefined; +} + + +/***/ }), + +/***/ 78009: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.buildMatchPatternFn = buildMatchPatternFn; + +function buildMatchPatternFn(args) { + return (string, options = {}) => { + const matchResult = string.match(args.matchPattern); + if (!matchResult) return null; + const matchedString = matchResult[0]; + + const parseResult = string.match(args.parsePattern); + if (!parseResult) return null; + let value = args.valueCallback + ? args.valueCallback(parseResult[0]) + : parseResult[0]; + + // [TODO] I challenge you to fix the type + value = options.valueCallback ? options.valueCallback(value) : value; + + const rest = string.slice(matchedString.length); + + return { value, rest }; + }; +} + + +/***/ }), + +/***/ 39425: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.enUS = void 0; +var _index = __nccwpck_require__(45436); +var _index2 = __nccwpck_require__(35217); +var _index3 = __nccwpck_require__(91566); +var _index4 = __nccwpck_require__(82720); +var _index5 = __nccwpck_require__(66686); + +/** + * @category Locales + * @summary English locale (United States). + * @language English + * @iso-639-2 eng + * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp) + * @author Lesha Koss [@leshakoss](https://github.com/leshakoss) + */ +const enUS = (exports.enUS = { + code: "en-US", + formatDistance: _index.formatDistance, + formatLong: _index2.formatLong, + formatRelative: _index3.formatRelative, + localize: _index4.localize, + match: _index5.match, + options: { + weekStartsOn: 0 /* Sunday */, + firstWeekContainsDate: 1, + }, +}); + + +/***/ }), + +/***/ 45436: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.formatDistance = void 0; + +const formatDistanceLocale = { + lessThanXSeconds: { + one: "less than a second", + other: "less than {{count}} seconds", + }, + + xSeconds: { + one: "1 second", + other: "{{count}} seconds", + }, + + halfAMinute: "half a minute", + + lessThanXMinutes: { + one: "less than a minute", + other: "less than {{count}} minutes", + }, + + xMinutes: { + one: "1 minute", + other: "{{count}} minutes", + }, + + aboutXHours: { + one: "about 1 hour", + other: "about {{count}} hours", + }, + + xHours: { + one: "1 hour", + other: "{{count}} hours", + }, + + xDays: { + one: "1 day", + other: "{{count}} days", + }, + + aboutXWeeks: { + one: "about 1 week", + other: "about {{count}} weeks", + }, + + xWeeks: { + one: "1 week", + other: "{{count}} weeks", + }, + + aboutXMonths: { + one: "about 1 month", + other: "about {{count}} months", + }, + + xMonths: { + one: "1 month", + other: "{{count}} months", + }, + + aboutXYears: { + one: "about 1 year", + other: "about {{count}} years", + }, + + xYears: { + one: "1 year", + other: "{{count}} years", + }, + + overXYears: { + one: "over 1 year", + other: "over {{count}} years", + }, + + almostXYears: { + one: "almost 1 year", + other: "almost {{count}} years", + }, +}; + +const formatDistance = (token, count, options) => { + let result; + + const tokenValue = formatDistanceLocale[token]; + if (typeof tokenValue === "string") { + result = tokenValue; + } else if (count === 1) { + result = tokenValue.one; + } else { + result = tokenValue.other.replace("{{count}}", count.toString()); + } + + if (options?.addSuffix) { + if (options.comparison && options.comparison > 0) { + return "in " + result; + } else { + return result + " ago"; + } + } + + return result; +}; +exports.formatDistance = formatDistance; + + +/***/ }), + +/***/ 35217: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.formatLong = void 0; +var _index = __nccwpck_require__(49566); + +const dateFormats = { + full: "EEEE, MMMM do, y", + long: "MMMM do, y", + medium: "MMM d, y", + short: "MM/dd/yyyy", +}; + +const timeFormats = { + full: "h:mm:ss a zzzz", + long: "h:mm:ss a z", + medium: "h:mm:ss a", + short: "h:mm a", +}; + +const dateTimeFormats = { + full: "{{date}} 'at' {{time}}", + long: "{{date}} 'at' {{time}}", + medium: "{{date}}, {{time}}", + short: "{{date}}, {{time}}", +}; + +const formatLong = (exports.formatLong = { + date: (0, _index.buildFormatLongFn)({ + formats: dateFormats, + defaultWidth: "full", + }), + + time: (0, _index.buildFormatLongFn)({ + formats: timeFormats, + defaultWidth: "full", + }), + + dateTime: (0, _index.buildFormatLongFn)({ + formats: dateTimeFormats, + defaultWidth: "full", + }), +}); + + +/***/ }), + +/***/ 91566: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.formatRelative = void 0; + +const formatRelativeLocale = { + lastWeek: "'last' eeee 'at' p", + yesterday: "'yesterday at' p", + today: "'today at' p", + tomorrow: "'tomorrow at' p", + nextWeek: "eeee 'at' p", + other: "P", +}; + +const formatRelative = (token, _date, _baseDate, _options) => + formatRelativeLocale[token]; +exports.formatRelative = formatRelative; + + +/***/ }), + +/***/ 82720: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.localize = void 0; +var _index = __nccwpck_require__(74177); + +const eraValues = { + narrow: ["B", "A"], + abbreviated: ["BC", "AD"], + wide: ["Before Christ", "Anno Domini"], +}; + +const quarterValues = { + narrow: ["1", "2", "3", "4"], + abbreviated: ["Q1", "Q2", "Q3", "Q4"], + wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"], +}; + +// Note: in English, the names of days of the week and months are capitalized. +// If you are making a new locale based on this one, check if the same is true for the language you're working on. +// Generally, formatted dates should look like they are in the middle of a sentence, +// e.g. in Spanish language the weekdays and months should be in the lowercase. +const monthValues = { + narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], + abbreviated: [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", + ], + + wide: [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", + ], +}; + +const dayValues = { + narrow: ["S", "M", "T", "W", "T", "F", "S"], + short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + wide: [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + ], +}; + +const dayPeriodValues = { + narrow: { + am: "a", + pm: "p", + midnight: "mi", + noon: "n", + morning: "morning", + afternoon: "afternoon", + evening: "evening", + night: "night", + }, + abbreviated: { + am: "AM", + pm: "PM", + midnight: "midnight", + noon: "noon", + morning: "morning", + afternoon: "afternoon", + evening: "evening", + night: "night", + }, + wide: { + am: "a.m.", + pm: "p.m.", + midnight: "midnight", + noon: "noon", + morning: "morning", + afternoon: "afternoon", + evening: "evening", + night: "night", + }, +}; + +const formattingDayPeriodValues = { + narrow: { + am: "a", + pm: "p", + midnight: "mi", + noon: "n", + morning: "in the morning", + afternoon: "in the afternoon", + evening: "in the evening", + night: "at night", + }, + abbreviated: { + am: "AM", + pm: "PM", + midnight: "midnight", + noon: "noon", + morning: "in the morning", + afternoon: "in the afternoon", + evening: "in the evening", + night: "at night", + }, + wide: { + am: "a.m.", + pm: "p.m.", + midnight: "midnight", + noon: "noon", + morning: "in the morning", + afternoon: "in the afternoon", + evening: "in the evening", + night: "at night", + }, +}; + +const ordinalNumber = (dirtyNumber, _options) => { + const number = Number(dirtyNumber); + + // If ordinal numbers depend on context, for example, + // if they are different for different grammatical genders, + // use `options.unit`. + // + // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear', + // 'day', 'hour', 'minute', 'second'. + + const rem100 = number % 100; + if (rem100 > 20 || rem100 < 10) { + switch (rem100 % 10) { + case 1: + return number + "st"; + case 2: + return number + "nd"; + case 3: + return number + "rd"; + } + } + return number + "th"; +}; + +const localize = (exports.localize = { + ordinalNumber, + + era: (0, _index.buildLocalizeFn)({ + values: eraValues, + defaultWidth: "wide", + }), + + quarter: (0, _index.buildLocalizeFn)({ + values: quarterValues, + defaultWidth: "wide", + argumentCallback: (quarter) => quarter - 1, + }), + + month: (0, _index.buildLocalizeFn)({ + values: monthValues, + defaultWidth: "wide", + }), + + day: (0, _index.buildLocalizeFn)({ + values: dayValues, + defaultWidth: "wide", + }), + + dayPeriod: (0, _index.buildLocalizeFn)({ + values: dayPeriodValues, + defaultWidth: "wide", + formattingValues: formattingDayPeriodValues, + defaultFormattingWidth: "wide", + }), +}); + + +/***/ }), + +/***/ 66686: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.match = void 0; + +var _index = __nccwpck_require__(33277); +var _index2 = __nccwpck_require__(78009); + +const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; +const parseOrdinalNumberPattern = /\d+/i; + +const matchEraPatterns = { + narrow: /^(b|a)/i, + abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, + wide: /^(before christ|before common era|anno domini|common era)/i, +}; +const parseEraPatterns = { + any: [/^b/i, /^(a|c)/i], +}; + +const matchQuarterPatterns = { + narrow: /^[1234]/i, + abbreviated: /^q[1234]/i, + wide: /^[1234](th|st|nd|rd)? quarter/i, +}; +const parseQuarterPatterns = { + any: [/1/i, /2/i, /3/i, /4/i], +}; + +const matchMonthPatterns = { + narrow: /^[jfmasond]/i, + abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, + wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i, +}; +const parseMonthPatterns = { + narrow: [ + /^j/i, + /^f/i, + /^m/i, + /^a/i, + /^m/i, + /^j/i, + /^j/i, + /^a/i, + /^s/i, + /^o/i, + /^n/i, + /^d/i, + ], + + any: [ + /^ja/i, + /^f/i, + /^mar/i, + /^ap/i, + /^may/i, + /^jun/i, + /^jul/i, + /^au/i, + /^s/i, + /^o/i, + /^n/i, + /^d/i, + ], +}; + +const matchDayPatterns = { + narrow: /^[smtwf]/i, + short: /^(su|mo|tu|we|th|fr|sa)/i, + abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, + wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i, +}; +const parseDayPatterns = { + narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], + any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i], +}; + +const matchDayPeriodPatterns = { + narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, + any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i, +}; +const parseDayPeriodPatterns = { + any: { + am: /^a/i, + pm: /^p/i, + midnight: /^mi/i, + noon: /^no/i, + morning: /morning/i, + afternoon: /afternoon/i, + evening: /evening/i, + night: /night/i, + }, +}; + +const match = (exports.match = { + ordinalNumber: (0, _index2.buildMatchPatternFn)({ + matchPattern: matchOrdinalNumberPattern, + parsePattern: parseOrdinalNumberPattern, + valueCallback: (value) => parseInt(value, 10), + }), + + era: (0, _index.buildMatchFn)({ + matchPatterns: matchEraPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseEraPatterns, + defaultParseWidth: "any", + }), + + quarter: (0, _index.buildMatchFn)({ + matchPatterns: matchQuarterPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseQuarterPatterns, + defaultParseWidth: "any", + valueCallback: (index) => index + 1, + }), + + month: (0, _index.buildMatchFn)({ + matchPatterns: matchMonthPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseMonthPatterns, + defaultParseWidth: "any", + }), + + day: (0, _index.buildMatchFn)({ + matchPatterns: matchDayPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseDayPatterns, + defaultParseWidth: "any", + }), + + dayPeriod: (0, _index.buildMatchFn)({ + matchPatterns: matchDayPeriodPatterns, + defaultMatchWidth: "any", + parsePatterns: parseDayPeriodPatterns, + defaultParseWidth: "any", + }), +}); + + +/***/ }), + +/***/ 57238: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.max = max; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link max} function options. + */ + +/** + * @name max + * @category Common Helpers + * @summary Return the latest of the given dates. + * + * @description + * Return the latest of the given dates. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param dates - The dates to compare + * + * @returns The latest of the dates + * + * @example + * // Which of these dates is the latest? + * const result = max([ + * new Date(1989, 6, 10), + * new Date(1987, 1, 11), + * new Date(1995, 6, 2), + * new Date(1990, 0, 1) + * ]) + * //=> Sun Jul 02 1995 00:00:00 + */ +function max(dates, options) { + let result; + let context = options?.in; + + dates.forEach((date) => { + // Use the first date object as the context function + if (!context && typeof date === "object") + context = _index.constructFrom.bind(null, date); + + const date_ = (0, _index2.toDate)(date, context); + if (!result || result < date_ || isNaN(+date_)) result = date_; + }); + + return (0, _index.constructFrom)(context, result || NaN); +} + + +/***/ }), + +/***/ 19717: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.milliseconds = milliseconds; +var _index = __nccwpck_require__(64278); + +/** + * @name milliseconds + * @category Millisecond Helpers + * @summary + * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. + * + * @description + * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. + * + * One years equals 365.2425 days according to the formula: + * + * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400. + * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days + * + * One month is a year divided by 12. + * + * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added. + * + * @returns The milliseconds + * + * @example + * // 1 year in milliseconds + * milliseconds({ years: 1 }) + * //=> 31556952000 + * + * // 3 months in milliseconds + * milliseconds({ months: 3 }) + * //=> 7889238000 + */ +function milliseconds({ years, months, weeks, days, hours, minutes, seconds }) { + let totalDays = 0; + + if (years) totalDays += years * _index.daysInYear; + if (months) totalDays += months * (_index.daysInYear / 12); + if (weeks) totalDays += weeks * 7; + if (days) totalDays += days; + + let totalSeconds = totalDays * 24 * 60 * 60; + + if (hours) totalSeconds += hours * 60 * 60; + if (minutes) totalSeconds += minutes * 60; + if (seconds) totalSeconds += seconds; + + return Math.trunc(totalSeconds * 1000); +} + + +/***/ }), + +/***/ 67139: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.millisecondsToHours = millisecondsToHours; +var _index = __nccwpck_require__(64278); + +/** + * @name millisecondsToHours + * @category Conversion Helpers + * @summary Convert milliseconds to hours. + * + * @description + * Convert a number of milliseconds to a full number of hours. + * + * @param milliseconds - The number of milliseconds to be converted + * + * @returns The number of milliseconds converted in hours + * + * @example + * // Convert 7200000 milliseconds to hours: + * const result = millisecondsToHours(7200000) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = millisecondsToHours(7199999) + * //=> 1 + */ +function millisecondsToHours(milliseconds) { + const hours = milliseconds / _index.millisecondsInHour; + return Math.trunc(hours); +} + + +/***/ }), + +/***/ 61121: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.millisecondsToMinutes = millisecondsToMinutes; +var _index = __nccwpck_require__(64278); + +/** + * @name millisecondsToMinutes + * @category Conversion Helpers + * @summary Convert milliseconds to minutes. + * + * @description + * Convert a number of milliseconds to a full number of minutes. + * + * @param milliseconds - The number of milliseconds to be converted + * + * @returns The number of milliseconds converted in minutes + * + * @example + * // Convert 60000 milliseconds to minutes: + * const result = millisecondsToMinutes(60000) + * //=> 1 + * + * @example + * // It uses floor rounding: + * const result = millisecondsToMinutes(119999) + * //=> 1 + */ +function millisecondsToMinutes(milliseconds) { + const minutes = milliseconds / _index.millisecondsInMinute; + return Math.trunc(minutes); +} + + +/***/ }), + +/***/ 60630: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.millisecondsToSeconds = millisecondsToSeconds; +var _index = __nccwpck_require__(64278); + +/** + * @name millisecondsToSeconds + * @category Conversion Helpers + * @summary Convert milliseconds to seconds. + * + * @description + * Convert a number of milliseconds to a full number of seconds. + * + * @param milliseconds - The number of milliseconds to be converted + * + * @returns The number of milliseconds converted in seconds + * + * @example + * // Convert 1000 milliseconds to seconds: + * const result = millisecondsToSeconds(1000) + * //=> 1 + * + * @example + * // It uses floor rounding: + * const result = millisecondsToSeconds(1999) + * //=> 1 + */ +function millisecondsToSeconds(milliseconds) { + const seconds = milliseconds / _index.millisecondsInSecond; + return Math.trunc(seconds); +} + + +/***/ }), + +/***/ 2651: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.min = min; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link min} function options. + */ + +/** + * @name min + * @category Common Helpers + * @summary Returns the earliest of the given dates. + * + * @description + * Returns the earliest of the given dates. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param dates - The dates to compare + * + * @returns The earliest of the dates + * + * @example + * // Which of these dates is the earliest? + * const result = min([ + * new Date(1989, 6, 10), + * new Date(1987, 1, 11), + * new Date(1995, 6, 2), + * new Date(1990, 0, 1) + * ]) + * //=> Wed Feb 11 1987 00:00:00 + */ +function min(dates, options) { + let result; + let context = options?.in; + + dates.forEach((date) => { + // Use the first date object as the context function + if (!context && typeof date === "object") + context = _index.constructFrom.bind(null, date); + + const date_ = (0, _index2.toDate)(date, context); + if (!result || result > date_ || isNaN(+date_)) result = date_; + }); + + return (0, _index.constructFrom)(context, result || NaN); +} + + +/***/ }), + +/***/ 40218: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.minutesToHours = minutesToHours; +var _index = __nccwpck_require__(64278); + +/** + * @name minutesToHours + * @category Conversion Helpers + * @summary Convert minutes to hours. + * + * @description + * Convert a number of minutes to a full number of hours. + * + * @param minutes - The number of minutes to be converted + * + * @returns The number of minutes converted in hours + * + * @example + * // Convert 140 minutes to hours: + * const result = minutesToHours(120) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = minutesToHours(179) + * //=> 2 + */ +function minutesToHours(minutes) { + const hours = minutes / _index.minutesInHour; + return Math.trunc(hours); +} + + +/***/ }), + +/***/ 77000: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.minutesToMilliseconds = minutesToMilliseconds; +var _index = __nccwpck_require__(64278); + +/** + * @name minutesToMilliseconds + * @category Conversion Helpers + * @summary Convert minutes to milliseconds. + * + * @description + * Convert a number of minutes to a full number of milliseconds. + * + * @param minutes - The number of minutes to be converted + * + * @returns The number of minutes converted in milliseconds + * + * @example + * // Convert 2 minutes to milliseconds + * const result = minutesToMilliseconds(2) + * //=> 120000 + */ +function minutesToMilliseconds(minutes) { + return Math.trunc(minutes * _index.millisecondsInMinute); +} + + +/***/ }), + +/***/ 6878: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.minutesToSeconds = minutesToSeconds; +var _index = __nccwpck_require__(64278); + +/** + * @name minutesToSeconds + * @category Conversion Helpers + * @summary Convert minutes to seconds. + * + * @description + * Convert a number of minutes to a full number of seconds. + * + * @param minutes - The number of minutes to be converted + * + * @returns The number of minutes converted in seconds + * + * @example + * // Convert 2 minutes to seconds + * const result = minutesToSeconds(2) + * //=> 120 + */ +function minutesToSeconds(minutes) { + return Math.trunc(minutes * _index.secondsInMinute); +} + + +/***/ }), + +/***/ 55782: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.monthsToQuarters = monthsToQuarters; +var _index = __nccwpck_require__(64278); + +/** + * @name monthsToQuarters + * @category Conversion Helpers + * @summary Convert number of months to quarters. + * + * @description + * Convert a number of months to a full number of quarters. + * + * @param months - The number of months to be converted. + * + * @returns The number of months converted in quarters + * + * @example + * // Convert 6 months to quarters: + * const result = monthsToQuarters(6) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = monthsToQuarters(7) + * //=> 2 + */ +function monthsToQuarters(months) { + const quarters = months / _index.monthsInQuarter; + return Math.trunc(quarters); +} + + +/***/ }), + +/***/ 11496: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.monthsToYears = monthsToYears; +var _index = __nccwpck_require__(64278); + +/** + * @name monthsToYears + * @category Conversion Helpers + * @summary Convert number of months to years. + * + * @description + * Convert a number of months to a full number of years. + * + * @param months - The number of months to be converted + * + * @returns The number of months converted in years + * + * @example + * // Convert 36 months to years: + * const result = monthsToYears(36) + * //=> 3 + * + * // It uses floor rounding: + * const result = monthsToYears(40) + * //=> 3 + */ +function monthsToYears(months) { + const years = months / _index.monthsInYear; + return Math.trunc(years); +} + + +/***/ }), + +/***/ 45598: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextDay = nextDay; +var _index = __nccwpck_require__(7412); +var _index2 = __nccwpck_require__(99455); + +/** + * The {@link nextDay} function options. + */ + +/** + * @name nextDay + * @category Weekday Helpers + * @summary When is the next day of the week? 0-6 the day of the week, 0 represents Sunday. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to check + * @param day - Day of the week + * @param options - An object with options + * + * @returns The date is the next day of the week + * + * @example + * // When is the next Monday after Mar, 20, 2020? + * const result = nextDay(new Date(2020, 2, 20), 1) + * //=> Mon Mar 23 2020 00:00:00 + * + * @example + * // When is the next Tuesday after Mar, 21, 2020? + * const result = nextDay(new Date(2020, 2, 21), 2) + * //=> Tue Mar 24 2020 00:00:00 + */ +function nextDay(date, day, options) { + let delta = day - (0, _index2.getDay)(date, options); + if (delta <= 0) delta += 7; + + return (0, _index.addDays)(date, delta, options); +} + + +/***/ }), + +/***/ 39807: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextFriday = nextFriday; +var _index = __nccwpck_require__(45598); + +/** + * The {@link nextFriday} function options. + */ + +/** + * @name nextFriday + * @category Weekday Helpers + * @summary When is the next Friday? + * + * @description + * When is the next Friday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The next Friday + * + * @example + * // When is the next Friday after Mar, 22, 2020? + * const result = nextFriday(new Date(2020, 2, 22)) + * //=> Fri Mar 27 2020 00:00:00 + */ +function nextFriday(date, options) { + return (0, _index.nextDay)(date, 5, options); +} + + +/***/ }), + +/***/ 38136: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextMonday = nextMonday; +var _index = __nccwpck_require__(45598); + +/** + * The {@link nextMonday} function options. + */ + +/** + * @name nextMonday + * @category Weekday Helpers + * @summary When is the next Monday? + * + * @description + * When is the next Monday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, returned from the context function if passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The next Monday + * + * @example + * // When is the next Monday after Mar, 22, 2020? + * const result = nextMonday(new Date(2020, 2, 22)) + * //=> Mon Mar 23 2020 00:00:00 + */ +function nextMonday(date, options) { + return (0, _index.nextDay)(date, 1, options); +} + + +/***/ }), + +/***/ 82247: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextSaturday = nextSaturday; +var _index = __nccwpck_require__(45598); + +/** + * The {@link nextSaturday} function options. + */ + +/** + * @name nextSaturday + * @category Weekday Helpers + * @summary When is the next Saturday? + * + * @description + * When is the next Saturday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The next Saturday + * + * @example + * // When is the next Saturday after Mar, 22, 2020? + * const result = nextSaturday(new Date(2020, 2, 22)) + * //=> Sat Mar 28 2020 00:00:00 + */ +function nextSaturday(date, options) { + return (0, _index.nextDay)(date, 6, options); +} + + +/***/ }), + +/***/ 44292: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextSunday = nextSunday; +var _index = __nccwpck_require__(45598); + +/** + * The {@link nextSunday} function options. + */ + +/** + * @name nextSunday + * @category Weekday Helpers + * @summary When is the next Sunday? + * + * @description + * When is the next Sunday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned if a context is provided. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The next Sunday + * + * @example + * // When is the next Sunday after March 22, 2020? + * const result = nextSunday(new Date(2020, 2, 22)) + * //=> Sun Mar 29 2020 00:00:00 + */ +function nextSunday(date, options) { + return (0, _index.nextDay)(date, 0, options); +} + + +/***/ }), + +/***/ 71141: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextThursday = nextThursday; +var _index = __nccwpck_require__(45598); + +/** + * The {@link nextThursday} function options. + */ + +/** + * @name nextThursday + * @category Weekday Helpers + * @summary When is the next Thursday? + * + * @description + * When is the next Thursday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The next Thursday + * + * @example + * // When is the next Thursday after Mar, 22, 2020? + * const result = nextThursday(new Date(2020, 2, 22)) + * //=> Thur Mar 26 2020 00:00:00 + */ +function nextThursday(date, options) { + return (0, _index.nextDay)(date, 4, options); +} + + +/***/ }), + +/***/ 62772: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextTuesday = nextTuesday; +var _index = __nccwpck_require__(45598); + +/** + * The {@link nextTuesday} function options. + */ + +/** + * @name nextTuesday + * @category Weekday Helpers + * @summary When is the next Tuesday? + * + * @description + * When is the next Tuesday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The next Tuesday + * + * @example + * // When is the next Tuesday after Mar, 22, 2020? + * const result = nextTuesday(new Date(2020, 2, 22)) + * //=> Tue Mar 24 2020 00:00:00 + */ +function nextTuesday(date, options) { + return (0, _index.nextDay)(date, 2, options); +} + + +/***/ }), + +/***/ 64428: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.nextWednesday = nextWednesday; +var _index = __nccwpck_require__(45598); + +/** + * The {@link nextWednesday} function options. + */ + +/** + * @name nextWednesday + * @category Weekday Helpers + * @summary When is the next Wednesday? + * + * @description + * When is the next Wednesday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The next Wednesday + * + * @example + * // When is the next Wednesday after Mar, 22, 2020? + * const result = nextWednesday(new Date(2020, 2, 22)) + * //=> Wed Mar 25 2020 00:00:00 + */ +function nextWednesday(date, options) { + return (0, _index.nextDay)(date, 3, options); +} + + +/***/ }), + +/***/ 35679: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "longFormatters", ({ + enumerable: true, + get: function () { + return _index2.longFormatters; + }, +})); +exports.parse = parse; +Object.defineProperty(exports, "parsers", ({ + enumerable: true, + get: function () { + return _index7.parsers; + }, +})); +var _index = __nccwpck_require__(7479); +var _index2 = __nccwpck_require__(46376); +var _index3 = __nccwpck_require__(53554); + +var _index4 = __nccwpck_require__(30926); +var _index5 = __nccwpck_require__(20514); +var _index6 = __nccwpck_require__(46439); + +var _Setter = __nccwpck_require__(18074); +var _index7 = __nccwpck_require__(56478); + +// Rexports of internal for libraries to use. +// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 + +/** + * The {@link parse} function options. + */ + +// This RegExp consists of three parts separated by `|`: +// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token +// (one of the certain letters followed by `o`) +// - (\w)\1* matches any sequences of the same letter +// - '' matches two quote characters in a row +// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), +// except a single quote symbol, which ends the sequence. +// Two quote characters do not end the sequence. +// If there is no matching single quote +// then the sequence will continue until the end of the string. +// - . matches any single character unmatched by previous parts of the RegExps +const formattingTokensRegExp = + /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; + +// This RegExp catches symbols escaped by quotes, and also +// sequences of symbols P, p, and the combinations like `PPPPPPPppppp` +const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; + +const escapedStringRegExp = /^'([^]*?)'?$/; +const doubleQuoteRegExp = /''/g; + +const notWhitespaceRegExp = /\S/; +const unescapedLatinCharacterRegExp = /[a-zA-Z]/; + +/** + * @name parse + * @category Common Helpers + * @summary Parse the date. + * + * @description + * Return the date parsed from string using the given format string. + * + * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters in the format string wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. + * + * Format of the format string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * with a few additions (see note 5 below the table). + * + * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited + * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: + * + * ```javascript + * parse('23 AM', 'HH a', new Date()) + * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time + * ``` + * + * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true + * + * Accepted format string patterns: + * | Unit |Prior| Pattern | Result examples | Notes | + * |---------------------------------|-----|---------|-----------------------------------|-------| + * | Era | 140 | G..GGG | AD, BC | | + * | | | GGGG | Anno Domini, Before Christ | 2 | + * | | | GGGGG | A, B | | + * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | + * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | yy | 44, 01, 00, 17 | 4 | + * | | | yyy | 044, 001, 123, 999 | 4 | + * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | + * | | | yyyyy | ... | 2,4 | + * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | + * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | YY | 44, 01, 00, 17 | 4,6 | + * | | | YYY | 044, 001, 123, 999 | 4 | + * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | + * | | | YYYYY | ... | 2,4 | + * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | + * | | | RR | -43, 01, 00, 17 | 4,5 | + * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | + * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | + * | | | RRRRR | ... | 2,4,5 | + * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | + * | | | uu | -43, 01, 99, -99 | 4 | + * | | | uuu | -043, 001, 123, 999, -999 | 4 | + * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | + * | | | uuuuu | ... | 2,4 | + * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | + * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | QQ | 01, 02, 03, 04 | | + * | | | QQQ | Q1, Q2, Q3, Q4 | | + * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | + * | | | QQQQQ | 1, 2, 3, 4 | 4 | + * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | + * | | | qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | qq | 01, 02, 03, 04 | | + * | | | qqq | Q1, Q2, Q3, Q4 | | + * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | + * | | | qqqqq | 1, 2, 3, 4 | 3 | + * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | + * | | | Mo | 1st, 2nd, ..., 12th | 5 | + * | | | MM | 01, 02, ..., 12 | | + * | | | MMM | Jan, Feb, ..., Dec | | + * | | | MMMM | January, February, ..., December | 2 | + * | | | MMMMM | J, F, ..., D | | + * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | + * | | | Lo | 1st, 2nd, ..., 12th | 5 | + * | | | LL | 01, 02, ..., 12 | | + * | | | LLL | Jan, Feb, ..., Dec | | + * | | | LLLL | January, February, ..., December | 2 | + * | | | LLLLL | J, F, ..., D | | + * | Local week of year | 100 | w | 1, 2, ..., 53 | | + * | | | wo | 1st, 2nd, ..., 53th | 5 | + * | | | ww | 01, 02, ..., 53 | | + * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | + * | | | Io | 1st, 2nd, ..., 53th | 5 | + * | | | II | 01, 02, ..., 53 | 5 | + * | Day of month | 90 | d | 1, 2, ..., 31 | | + * | | | do | 1st, 2nd, ..., 31st | 5 | + * | | | dd | 01, 02, ..., 31 | | + * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | + * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | + * | | | DD | 01, 02, ..., 365, 366 | 7 | + * | | | DDD | 001, 002, ..., 365, 366 | | + * | | | DDDD | ... | 2 | + * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | | + * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | + * | | | EEEEE | M, T, W, T, F, S, S | | + * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | + * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | + * | | | io | 1st, 2nd, ..., 7th | 5 | + * | | | ii | 01, 02, ..., 07 | 5 | + * | | | iii | Mon, Tue, Wed, ..., Sun | 5 | + * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | + * | | | iiiii | M, T, W, T, F, S, S | 5 | + * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 | + * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | + * | | | eo | 2nd, 3rd, ..., 1st | 5 | + * | | | ee | 02, 03, ..., 01 | | + * | | | eee | Mon, Tue, Wed, ..., Sun | | + * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | + * | | | eeeee | M, T, W, T, F, S, S | | + * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | + * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | + * | | | co | 2nd, 3rd, ..., 1st | 5 | + * | | | cc | 02, 03, ..., 01 | | + * | | | ccc | Mon, Tue, Wed, ..., Sun | | + * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | + * | | | ccccc | M, T, W, T, F, S, S | | + * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | + * | AM, PM | 80 | a..aaa | AM, PM | | + * | | | aaaa | a.m., p.m. | 2 | + * | | | aaaaa | a, p | | + * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | + * | | | bbbb | a.m., p.m., noon, midnight | 2 | + * | | | bbbbb | a, p, n, mi | | + * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | + * | | | BBBB | at night, in the morning, ... | 2 | + * | | | BBBBB | at night, in the morning, ... | | + * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | + * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | + * | | | hh | 01, 02, ..., 11, 12 | | + * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | + * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | + * | | | HH | 00, 01, 02, ..., 23 | | + * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | + * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | + * | | | KK | 01, 02, ..., 11, 00 | | + * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | + * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | + * | | | kk | 24, 01, 02, ..., 23 | | + * | Minute | 60 | m | 0, 1, ..., 59 | | + * | | | mo | 0th, 1st, ..., 59th | 5 | + * | | | mm | 00, 01, ..., 59 | | + * | Second | 50 | s | 0, 1, ..., 59 | | + * | | | so | 0th, 1st, ..., 59th | 5 | + * | | | ss | 00, 01, ..., 59 | | + * | Seconds timestamp | 40 | t | 512969520 | | + * | | | tt | ... | 2 | + * | Fraction of second | 30 | S | 0, 1, ..., 9 | | + * | | | SS | 00, 01, ..., 99 | | + * | | | SSS | 000, 001, ..., 999 | | + * | | | SSSS | ... | 2 | + * | Milliseconds timestamp | 20 | T | 512969520900 | | + * | | | TT | ... | 2 | + * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | + * | | | XX | -0800, +0530, Z | | + * | | | XXX | -08:00, +05:30, Z | | + * | | | XXXX | -0800, +0530, Z, +123456 | 2 | + * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | + * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | + * | | | xx | -0800, +0530, +0000 | | + * | | | xxx | -08:00, +05:30, +00:00 | 2 | + * | | | xxxx | -0800, +0530, +0000, +123456 | | + * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | + * | Long localized date | NA | P | 05/29/1453 | 5,8 | + * | | | PP | May 29, 1453 | | + * | | | PPP | May 29th, 1453 | | + * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | + * | Long localized time | NA | p | 12:00 AM | 5,8 | + * | | | pp | 12:00:00 AM | | + * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | + * | | | PPpp | May 29, 1453, 12:00:00 AM | | + * | | | PPPpp | May 29th, 1453 at ... | | + * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | + * Notes: + * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale + * are the same as "stand-alone" units, but are different in some languages. + * "Formatting" units are declined according to the rules of the language + * in the context of a date. "Stand-alone" units are always nominative singular. + * In `format` function, they will produce different result: + * + * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` + * + * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` + * + * `parse` will try to match both formatting and stand-alone units interchangeably. + * + * 2. Any sequence of the identical letters is a pattern, unless it is escaped by + * the single quote characters (see below). + * If the sequence is longer than listed in table: + * - for numerical units (`yyyyyyyy`) `parse` will try to match a number + * as wide as the sequence + * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit. + * These variations are marked with "2" in the last column of the table. + * + * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. + * These tokens represent the shortest form of the quarter. + * + * 4. The main difference between `y` and `u` patterns are B.C. years: + * + * | Year | `y` | `u` | + * |------|-----|-----| + * | AC 1 | 1 | 1 | + * | BC 1 | 1 | 0 | + * | BC 2 | 2 | -1 | + * + * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: + * + * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00` + * + * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00` + * + * while `uu` will just assign the year as is: + * + * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00` + * + * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00` + * + * The same difference is true for local and ISO week-numbering years (`Y` and `R`), + * except local week-numbering years are dependent on `options.weekStartsOn` + * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear) + * and [setWeekYear](https://date-fns.org/docs/setWeekYear)). + * + * 5. These patterns are not in the Unicode Technical Standard #35: + * - `i`: ISO day of week + * - `I`: ISO week of year + * - `R`: ISO week-numbering year + * - `o`: ordinal number modifier + * - `P`: long localized date + * - `p`: long localized time + * + * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. + * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. + * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based + * on the given locale. + * + * using `en-US` locale: `P` => `MM/dd/yyyy` + * using `en-US` locale: `p` => `hh:mm a` + * using `pt-BR` locale: `P` => `dd/MM/yyyy` + * using `pt-BR` locale: `p` => `HH:mm` + * + * Values will be assigned to the date in the descending order of its unit's priority. + * Units of an equal priority overwrite each other in the order of appearance. + * + * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), + * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing. + * + * `referenceDate` must be passed for correct work of the function. + * If you're not sure which `referenceDate` to supply, create a new instance of Date: + * `parse('02/11/2014', 'MM/dd/yyyy', new Date())` + * In this case parsing will be done in the context of the current date. + * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`, + * then `Invalid Date` will be returned. + * + * The result may vary by locale. + * + * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. + * + * If parsing failed, `Invalid Date` will be returned. + * Invalid Date is a Date, whose time value is NaN. + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param dateStr - The string to parse + * @param formatStr - The string of tokens + * @param referenceDate - defines values missing from the parsed dateString + * @param options - An object with options. + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * @returns The parsed date + * + * @throws `options.locale` must contain `match` property + * @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 + * @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 + * @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 + * @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 + * @throws format string contains an unescaped latin alphabet character + * + * @example + * // Parse 11 February 2014 from middle-endian format: + * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date()) + * //=> Tue Feb 11 2014 00:00:00 + * + * @example + * // Parse 28th of February in Esperanto locale in the context of 2010 year: + * import eo from 'date-fns/locale/eo' + * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), { + * locale: eo + * }) + * //=> Sun Feb 28 2010 00:00:00 + */ +function parse(dateStr, formatStr, referenceDate, options) { + const invalidDate = () => + (0, _index4.constructFrom)(options?.in || referenceDate, NaN); + const defaultOptions = (0, _index5.getDefaultOptions)(); + const locale = + options?.locale ?? defaultOptions.locale ?? _index.defaultLocale; + + const firstWeekContainsDate = + options?.firstWeekContainsDate ?? + options?.locale?.options?.firstWeekContainsDate ?? + defaultOptions.firstWeekContainsDate ?? + defaultOptions.locale?.options?.firstWeekContainsDate ?? + 1; + + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; + + if (!formatStr) + return dateStr + ? invalidDate() + : (0, _index6.toDate)(referenceDate, options?.in); + + const subFnOptions = { + firstWeekContainsDate, + weekStartsOn, + locale, + }; + + // If timezone isn't specified, it will try to use the context or + // the reference date and fallback to the system time zone. + const setters = [new _Setter.DateTimezoneSetter(options?.in, referenceDate)]; + + const tokens = formatStr + .match(longFormattingTokensRegExp) + .map((substring) => { + const firstCharacter = substring[0]; + if (firstCharacter in _index2.longFormatters) { + const longFormatter = _index2.longFormatters[firstCharacter]; + return longFormatter(substring, locale.formatLong); + } + return substring; + }) + .join("") + .match(formattingTokensRegExp); + + const usedTokens = []; + + for (let token of tokens) { + if ( + !options?.useAdditionalWeekYearTokens && + (0, _index3.isProtectedWeekYearToken)(token) + ) { + (0, _index3.warnOrThrowProtectedError)(token, formatStr, dateStr); + } + if ( + !options?.useAdditionalDayOfYearTokens && + (0, _index3.isProtectedDayOfYearToken)(token) + ) { + (0, _index3.warnOrThrowProtectedError)(token, formatStr, dateStr); + } + + const firstCharacter = token[0]; + const parser = _index7.parsers[firstCharacter]; + if (parser) { + const { incompatibleTokens } = parser; + if (Array.isArray(incompatibleTokens)) { + const incompatibleToken = usedTokens.find( + (usedToken) => + incompatibleTokens.includes(usedToken.token) || + usedToken.token === firstCharacter, + ); + if (incompatibleToken) { + throw new RangeError( + `The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`, + ); + } + } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) { + throw new RangeError( + `The format string mustn't contain \`${token}\` and any other token at the same time`, + ); + } + + usedTokens.push({ token: firstCharacter, fullToken: token }); + + const parseResult = parser.run( + dateStr, + token, + locale.match, + subFnOptions, + ); + + if (!parseResult) { + return invalidDate(); + } + + setters.push(parseResult.setter); + + dateStr = parseResult.rest; + } else { + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { + throw new RangeError( + "Format string contains an unescaped latin alphabet character `" + + firstCharacter + + "`", + ); + } + + // Replace two single quote characters with one single quote character + if (token === "''") { + token = "'"; + } else if (firstCharacter === "'") { + token = cleanEscapedString(token); + } + + // Cut token from string, or, if string doesn't match the token, return Invalid Date + if (dateStr.indexOf(token) === 0) { + dateStr = dateStr.slice(token.length); + } else { + return invalidDate(); + } + } + } + + // Check if the remaining input contains something other than whitespace + if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) { + return invalidDate(); + } + + const uniquePrioritySetters = setters + .map((setter) => setter.priority) + .sort((a, b) => b - a) + .filter((priority, index, array) => array.indexOf(priority) === index) + .map((priority) => + setters + .filter((setter) => setter.priority === priority) + .sort((a, b) => b.subPriority - a.subPriority), + ) + .map((setterArray) => setterArray[0]); + + let date = (0, _index6.toDate)(referenceDate, options?.in); + + if (isNaN(+date)) return invalidDate(); + + const flags = {}; + for (const setter of uniquePrioritySetters) { + if (!setter.validate(date, subFnOptions)) { + return invalidDate(); + } + + const result = setter.set(date, flags, subFnOptions); + // Result is tuple (date, flags) + if (Array.isArray(result)) { + date = result[0]; + Object.assign(flags, result[1]); + // Result is date + } else { + date = result; + } + } + + return date; +} + +function cleanEscapedString(input) { + return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); +} + + +/***/ }), + +/***/ 24759: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.Parser = void 0; +var _Setter = __nccwpck_require__(18074); + +class Parser { + run(dateString, token, match, options) { + const result = this.parse(dateString, token, match, options); + if (!result) { + return null; + } + + return { + setter: new _Setter.ValueSetter( + result.value, + this.validate, + this.set, + this.priority, + this.subPriority, + ), + rest: result.rest, + }; + } + + validate(_utcDate, _value, _options) { + return true; + } +} +exports.Parser = Parser; + + +/***/ }), + +/***/ 18074: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.ValueSetter = exports.Setter = exports.DateTimezoneSetter = void 0; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(37288); + +const TIMEZONE_UNIT_PRIORITY = 10; + +class Setter { + subPriority = 0; + + validate(_utcDate, _options) { + return true; + } +} +exports.Setter = Setter; + +class ValueSetter extends Setter { + constructor( + value, + + validateValue, + + setValue, + + priority, + subPriority, + ) { + super(); + this.value = value; + this.validateValue = validateValue; + this.setValue = setValue; + this.priority = priority; + if (subPriority) { + this.subPriority = subPriority; + } + } + + validate(date, options) { + return this.validateValue(date, this.value, options); + } + + set(date, flags, options) { + return this.setValue(date, flags, this.value, options); + } +} +exports.ValueSetter = ValueSetter; + +class DateTimezoneSetter extends Setter { + priority = TIMEZONE_UNIT_PRIORITY; + subPriority = -1; + + constructor(context, reference) { + super(); + this.context = + context || ((date) => (0, _index.constructFrom)(reference, date)); + } + + set(date, flags) { + if (flags.timestampIsSet) return date; + return (0, _index.constructFrom)( + date, + (0, _index2.transpose)(date, this.context), + ); + } +} +exports.DateTimezoneSetter = DateTimezoneSetter; + + +/***/ }), + +/***/ 48766: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.timezonePatterns = exports.numericPatterns = void 0; +const numericPatterns = (exports.numericPatterns = { + month: /^(1[0-2]|0?\d)/, // 0 to 12 + date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31 + dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 + week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53 + hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23 + hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24 + hour11h: /^(1[0-1]|0?\d)/, // 0 to 11 + hour12h: /^(1[0-2]|0?\d)/, // 0 to 12 + minute: /^[0-5]?\d/, // 0 to 59 + second: /^[0-5]?\d/, // 0 to 59 + + singleDigit: /^\d/, // 0 to 9 + twoDigits: /^\d{1,2}/, // 0 to 99 + threeDigits: /^\d{1,3}/, // 0 to 999 + fourDigits: /^\d{1,4}/, // 0 to 9999 + + anyDigitsSigned: /^-?\d+/, + singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9 + twoDigitsSigned: /^-?\d{1,2}/, // 0 to 99, -0 to -99 + threeDigitsSigned: /^-?\d{1,3}/, // 0 to 999, -0 to -999 + fourDigitsSigned: /^-?\d{1,4}/, // 0 to 9999, -0 to -9999 +}); + +const timezonePatterns = (exports.timezonePatterns = { + basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, + basic: /^([+-])(\d{2})(\d{2})|Z/, + basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, + extended: /^([+-])(\d{2}):(\d{2})|Z/, + extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/, +}); + + +/***/ }), + +/***/ 56478: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.parsers = void 0; +var _EraParser = __nccwpck_require__(88391); +var _YearParser = __nccwpck_require__(57628); +var _LocalWeekYearParser = __nccwpck_require__(60134); +var _ISOWeekYearParser = __nccwpck_require__(36877); +var _ExtendedYearParser = __nccwpck_require__(95116); +var _QuarterParser = __nccwpck_require__(28301); +var _StandAloneQuarterParser = __nccwpck_require__(97943); +var _MonthParser = __nccwpck_require__(73978); +var _StandAloneMonthParser = __nccwpck_require__(94413); +var _LocalWeekParser = __nccwpck_require__(16499); +var _ISOWeekParser = __nccwpck_require__(81336); +var _DateParser = __nccwpck_require__(69116); +var _DayOfYearParser = __nccwpck_require__(9137); +var _DayParser = __nccwpck_require__(37500); +var _LocalDayParser = __nccwpck_require__(82259); +var _StandAloneLocalDayParser = __nccwpck_require__(77529); +var _ISODayParser = __nccwpck_require__(29730); +var _AMPMParser = __nccwpck_require__(82529); +var _AMPMMidnightParser = __nccwpck_require__(87387); +var _DayPeriodParser = __nccwpck_require__(22806); +var _Hour1to12Parser = __nccwpck_require__(18993); +var _Hour0to23Parser = __nccwpck_require__(56228); +var _Hour0To11Parser = __nccwpck_require__(70803); +var _Hour1To24Parser = __nccwpck_require__(27727); +var _MinuteParser = __nccwpck_require__(74650); +var _SecondParser = __nccwpck_require__(99083); +var _FractionOfSecondParser = __nccwpck_require__(5508); +var _ISOTimezoneWithZParser = __nccwpck_require__(26617); +var _ISOTimezoneParser = __nccwpck_require__(83242); +var _TimestampSecondsParser = __nccwpck_require__(86085); +var _TimestampMillisecondsParser = __nccwpck_require__(7319); + +/* + * | | Unit | | Unit | + * |-----|--------------------------------|-----|--------------------------------| + * | a | AM, PM | A* | Milliseconds in day | + * | b | AM, PM, noon, midnight | B | Flexible day period | + * | c | Stand-alone local day of week | C* | Localized hour w/ day period | + * | d | Day of month | D | Day of year | + * | e | Local day of week | E | Day of week | + * | f | | F* | Day of week in month | + * | g* | Modified Julian day | G | Era | + * | h | Hour [1-12] | H | Hour [0-23] | + * | i! | ISO day of week | I! | ISO week of year | + * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | + * | k | Hour [1-24] | K | Hour [0-11] | + * | l* | (deprecated) | L | Stand-alone month | + * | m | Minute | M | Month | + * | n | | N | | + * | o! | Ordinal number modifier | O* | Timezone (GMT) | + * | p | | P | | + * | q | Stand-alone quarter | Q | Quarter | + * | r* | Related Gregorian year | R! | ISO week-numbering year | + * | s | Second | S | Fraction of second | + * | t! | Seconds timestamp | T! | Milliseconds timestamp | + * | u | Extended year | U* | Cyclic year | + * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | + * | w | Local week of year | W* | Week of month | + * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | + * | y | Year (abs) | Y | Local week-numbering year | + * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) | + * + * Letters marked by * are not implemented but reserved by Unicode standard. + * + * Letters marked by ! are non-standard, but implemented by date-fns: + * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs) + * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, + * i.e. 7 for Sunday, 1 for Monday, etc. + * - `I` is ISO week of year, as opposed to `w` which is local week of year. + * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. + * `R` is supposed to be used in conjunction with `I` and `i` + * for universal ISO week-numbering date, whereas + * `Y` is supposed to be used in conjunction with `w` and `e` + * for week-numbering date specific to the locale. + */ +const parsers = (exports.parsers = { + G: new _EraParser.EraParser(), + y: new _YearParser.YearParser(), + Y: new _LocalWeekYearParser.LocalWeekYearParser(), + R: new _ISOWeekYearParser.ISOWeekYearParser(), + u: new _ExtendedYearParser.ExtendedYearParser(), + Q: new _QuarterParser.QuarterParser(), + q: new _StandAloneQuarterParser.StandAloneQuarterParser(), + M: new _MonthParser.MonthParser(), + L: new _StandAloneMonthParser.StandAloneMonthParser(), + w: new _LocalWeekParser.LocalWeekParser(), + I: new _ISOWeekParser.ISOWeekParser(), + d: new _DateParser.DateParser(), + D: new _DayOfYearParser.DayOfYearParser(), + E: new _DayParser.DayParser(), + e: new _LocalDayParser.LocalDayParser(), + c: new _StandAloneLocalDayParser.StandAloneLocalDayParser(), + i: new _ISODayParser.ISODayParser(), + a: new _AMPMParser.AMPMParser(), + b: new _AMPMMidnightParser.AMPMMidnightParser(), + B: new _DayPeriodParser.DayPeriodParser(), + h: new _Hour1to12Parser.Hour1to12Parser(), + H: new _Hour0to23Parser.Hour0to23Parser(), + K: new _Hour0To11Parser.Hour0To11Parser(), + k: new _Hour1To24Parser.Hour1To24Parser(), + m: new _MinuteParser.MinuteParser(), + s: new _SecondParser.SecondParser(), + S: new _FractionOfSecondParser.FractionOfSecondParser(), + X: new _ISOTimezoneWithZParser.ISOTimezoneWithZParser(), + x: new _ISOTimezoneParser.ISOTimezoneParser(), + t: new _TimestampSecondsParser.TimestampSecondsParser(), + T: new _TimestampMillisecondsParser.TimestampMillisecondsParser(), +}); + + +/***/ }), + +/***/ 87387: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.AMPMMidnightParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class AMPMMidnightParser extends _Parser.Parser { + priority = 80; + + parse(dateString, token, match) { + switch (token) { + case "b": + case "bb": + case "bbb": + return ( + match.dayPeriod(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }) + ); + + case "bbbbb": + return match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }); + case "bbbb": + default: + return ( + match.dayPeriod(dateString, { + width: "wide", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }) + ); + } + } + + set(date, _flags, value) { + date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); + return date; + } + + incompatibleTokens = ["a", "B", "H", "k", "t", "T"]; +} +exports.AMPMMidnightParser = AMPMMidnightParser; + + +/***/ }), + +/***/ 82529: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.AMPMParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class AMPMParser extends _Parser.Parser { + priority = 80; + + parse(dateString, token, match) { + switch (token) { + case "a": + case "aa": + case "aaa": + return ( + match.dayPeriod(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }) + ); + + case "aaaaa": + return match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }); + case "aaaa": + default: + return ( + match.dayPeriod(dateString, { + width: "wide", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }) + ); + } + } + + set(date, _flags, value) { + date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); + return date; + } + + incompatibleTokens = ["b", "B", "H", "k", "t", "T"]; +} +exports.AMPMParser = AMPMParser; + + +/***/ }), + +/***/ 69116: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.DateParser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +const DAYS_IN_MONTH_LEAP_YEAR = [ + 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, +]; + +// Day of the month +class DateParser extends _Parser.Parser { + priority = 90; + subPriority = 1; + + parse(dateString, token, match) { + switch (token) { + case "d": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.date, + dateString, + ); + case "do": + return match.ordinalNumber(dateString, { unit: "date" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(date, value) { + const year = date.getFullYear(); + const isLeapYear = (0, _utils.isLeapYearIndex)(year); + const month = date.getMonth(); + if (isLeapYear) { + return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; + } else { + return value >= 1 && value <= DAYS_IN_MONTH[month]; + } + } + + set(date, _flags, value) { + date.setDate(value); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "Y", + "R", + "q", + "Q", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ]; +} +exports.DateParser = DateParser; + + +/***/ }), + +/***/ 9137: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.DayOfYearParser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class DayOfYearParser extends _Parser.Parser { + priority = 90; + + subpriority = 1; + + parse(dateString, token, match) { + switch (token) { + case "D": + case "DD": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.dayOfYear, + dateString, + ); + case "Do": + return match.ordinalNumber(dateString, { unit: "date" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(date, value) { + const year = date.getFullYear(); + const isLeapYear = (0, _utils.isLeapYearIndex)(year); + if (isLeapYear) { + return value >= 1 && value <= 366; + } else { + return value >= 1 && value <= 365; + } + } + + set(date, _flags, value) { + date.setMonth(0, value); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "Y", + "R", + "q", + "Q", + "M", + "L", + "w", + "I", + "d", + "E", + "i", + "e", + "c", + "t", + "T", + ]; +} +exports.DayOfYearParser = DayOfYearParser; + + +/***/ }), + +/***/ 37500: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.DayParser = void 0; +var _index = __nccwpck_require__(51277); +var _Parser = __nccwpck_require__(24759); + +// Day of week +class DayParser extends _Parser.Parser { + priority = 90; + + parse(dateString, token, match) { + switch (token) { + // Tue + case "E": + case "EE": + case "EEE": + return ( + match.day(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.day(dateString, { width: "short", context: "formatting" }) || + match.day(dateString, { width: "narrow", context: "formatting" }) + ); + + // T + case "EEEEE": + return match.day(dateString, { + width: "narrow", + context: "formatting", + }); + // Tu + case "EEEEEE": + return ( + match.day(dateString, { width: "short", context: "formatting" }) || + match.day(dateString, { width: "narrow", context: "formatting" }) + ); + + // Tuesday + case "EEEE": + default: + return ( + match.day(dateString, { width: "wide", context: "formatting" }) || + match.day(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.day(dateString, { width: "short", context: "formatting" }) || + match.day(dateString, { width: "narrow", context: "formatting" }) + ); + } + } + + validate(_date, value) { + return value >= 0 && value <= 6; + } + + set(date, _flags, value, options) { + date = (0, _index.setDay)(date, value, options); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = ["D", "i", "e", "c", "t", "T"]; +} +exports.DayParser = DayParser; + + +/***/ }), + +/***/ 22806: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.DayPeriodParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// in the morning, in the afternoon, in the evening, at night +class DayPeriodParser extends _Parser.Parser { + priority = 80; + + parse(dateString, token, match) { + switch (token) { + case "B": + case "BB": + case "BBB": + return ( + match.dayPeriod(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }) + ); + + case "BBBBB": + return match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }); + case "BBBB": + default: + return ( + match.dayPeriod(dateString, { + width: "wide", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.dayPeriod(dateString, { + width: "narrow", + context: "formatting", + }) + ); + } + } + + set(date, _flags, value) { + date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); + return date; + } + + incompatibleTokens = ["a", "b", "t", "T"]; +} +exports.DayPeriodParser = DayPeriodParser; + + +/***/ }), + +/***/ 88391: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.EraParser = void 0; + +var _Parser = __nccwpck_require__(24759); + +class EraParser extends _Parser.Parser { + priority = 140; + + parse(dateString, token, match) { + switch (token) { + // AD, BC + case "G": + case "GG": + case "GGG": + return ( + match.era(dateString, { width: "abbreviated" }) || + match.era(dateString, { width: "narrow" }) + ); + + // A, B + case "GGGGG": + return match.era(dateString, { width: "narrow" }); + // Anno Domini, Before Christ + case "GGGG": + default: + return ( + match.era(dateString, { width: "wide" }) || + match.era(dateString, { width: "abbreviated" }) || + match.era(dateString, { width: "narrow" }) + ); + } + } + + set(date, flags, value) { + flags.era = value; + date.setFullYear(value, 0, 1); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = ["R", "u", "t", "T"]; +} +exports.EraParser = EraParser; + + +/***/ }), + +/***/ 95116: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.ExtendedYearParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class ExtendedYearParser extends _Parser.Parser { + priority = 130; + + parse(dateString, token) { + if (token === "u") { + return (0, _utils.parseNDigitsSigned)(4, dateString); + } + + return (0, _utils.parseNDigitsSigned)(token.length, dateString); + } + + set(date, _flags, value) { + date.setFullYear(value, 0, 1); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]; +} +exports.ExtendedYearParser = ExtendedYearParser; + + +/***/ }), + +/***/ 5508: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.FractionOfSecondParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class FractionOfSecondParser extends _Parser.Parser { + priority = 30; + + parse(dateString, token) { + const valueCallback = (value) => + Math.trunc(value * Math.pow(10, -token.length + 3)); + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(token.length, dateString), + valueCallback, + ); + } + + set(date, _flags, value) { + date.setMilliseconds(value); + return date; + } + + incompatibleTokens = ["t", "T"]; +} +exports.FractionOfSecondParser = FractionOfSecondParser; + + +/***/ }), + +/***/ 70803: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.Hour0To11Parser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class Hour0To11Parser extends _Parser.Parser { + priority = 70; + + parse(dateString, token, match) { + switch (token) { + case "K": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.hour11h, + dateString, + ); + case "Ko": + return match.ordinalNumber(dateString, { unit: "hour" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 0 && value <= 11; + } + + set(date, _flags, value) { + const isPM = date.getHours() >= 12; + if (isPM && value < 12) { + date.setHours(value + 12, 0, 0, 0); + } else { + date.setHours(value, 0, 0, 0); + } + return date; + } + + incompatibleTokens = ["h", "H", "k", "t", "T"]; +} +exports.Hour0To11Parser = Hour0To11Parser; + + +/***/ }), + +/***/ 56228: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.Hour0to23Parser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class Hour0to23Parser extends _Parser.Parser { + priority = 70; + + parse(dateString, token, match) { + switch (token) { + case "H": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.hour23h, + dateString, + ); + case "Ho": + return match.ordinalNumber(dateString, { unit: "hour" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 0 && value <= 23; + } + + set(date, _flags, value) { + date.setHours(value, 0, 0, 0); + return date; + } + + incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"]; +} +exports.Hour0to23Parser = Hour0to23Parser; + + +/***/ }), + +/***/ 27727: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.Hour1To24Parser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class Hour1To24Parser extends _Parser.Parser { + priority = 70; + + parse(dateString, token, match) { + switch (token) { + case "k": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.hour24h, + dateString, + ); + case "ko": + return match.ordinalNumber(dateString, { unit: "hour" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 1 && value <= 24; + } + + set(date, _flags, value) { + const hours = value <= 24 ? value % 24 : value; + date.setHours(hours, 0, 0, 0); + return date; + } + + incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"]; +} +exports.Hour1To24Parser = Hour1To24Parser; + + +/***/ }), + +/***/ 18993: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.Hour1to12Parser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class Hour1to12Parser extends _Parser.Parser { + priority = 70; + + parse(dateString, token, match) { + switch (token) { + case "h": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.hour12h, + dateString, + ); + case "ho": + return match.ordinalNumber(dateString, { unit: "hour" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 1 && value <= 12; + } + + set(date, _flags, value) { + const isPM = date.getHours() >= 12; + if (isPM && value < 12) { + date.setHours(value + 12, 0, 0, 0); + } else if (!isPM && value === 12) { + date.setHours(0, 0, 0, 0); + } else { + date.setHours(value, 0, 0, 0); + } + return date; + } + + incompatibleTokens = ["H", "K", "k", "t", "T"]; +} +exports.Hour1to12Parser = Hour1to12Parser; + + +/***/ }), + +/***/ 29730: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.ISODayParser = void 0; +var _index = __nccwpck_require__(8082); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// ISO day of week +class ISODayParser extends _Parser.Parser { + priority = 90; + + parse(dateString, token, match) { + const valueCallback = (value) => { + if (value === 0) { + return 7; + } + return value; + }; + + switch (token) { + // 2 + case "i": + case "ii": // 02 + return (0, _utils.parseNDigits)(token.length, dateString); + // 2nd + case "io": + return match.ordinalNumber(dateString, { unit: "day" }); + // Tue + case "iii": + return (0, _utils.mapValue)( + match.day(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.day(dateString, { + width: "short", + context: "formatting", + }) || + match.day(dateString, { + width: "narrow", + context: "formatting", + }), + valueCallback, + ); + // T + case "iiiii": + return (0, _utils.mapValue)( + match.day(dateString, { + width: "narrow", + context: "formatting", + }), + valueCallback, + ); + // Tu + case "iiiiii": + return (0, _utils.mapValue)( + match.day(dateString, { + width: "short", + context: "formatting", + }) || + match.day(dateString, { + width: "narrow", + context: "formatting", + }), + valueCallback, + ); + // Tuesday + case "iiii": + default: + return (0, _utils.mapValue)( + match.day(dateString, { + width: "wide", + context: "formatting", + }) || + match.day(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.day(dateString, { + width: "short", + context: "formatting", + }) || + match.day(dateString, { + width: "narrow", + context: "formatting", + }), + valueCallback, + ); + } + } + + validate(_date, value) { + return value >= 1 && value <= 7; + } + + set(date, _flags, value) { + date = (0, _index.setISODay)(date, value); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "y", + "Y", + "u", + "q", + "Q", + "M", + "L", + "w", + "d", + "D", + "E", + "e", + "c", + "t", + "T", + ]; +} +exports.ISODayParser = ISODayParser; + + +/***/ }), + +/***/ 83242: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.ISOTimezoneParser = void 0; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(91546); +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// Timezone (ISO-8601) +class ISOTimezoneParser extends _Parser.Parser { + priority = 10; + + parse(dateString, token) { + switch (token) { + case "x": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.basicOptionalMinutes, + dateString, + ); + case "xx": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.basic, + dateString, + ); + case "xxxx": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.basicOptionalSeconds, + dateString, + ); + case "xxxxx": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.extendedOptionalSeconds, + dateString, + ); + case "xxx": + default: + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.extended, + dateString, + ); + } + } + + set(date, flags, value) { + if (flags.timestampIsSet) return date; + return (0, _index.constructFrom)( + date, + date.getTime() - + (0, _index2.getTimezoneOffsetInMilliseconds)(date) - + value, + ); + } + + incompatibleTokens = ["t", "T", "X"]; +} +exports.ISOTimezoneParser = ISOTimezoneParser; + + +/***/ }), + +/***/ 26617: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.ISOTimezoneWithZParser = void 0; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(91546); +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// Timezone (ISO-8601. +00:00 is `'Z'`) +class ISOTimezoneWithZParser extends _Parser.Parser { + priority = 10; + + parse(dateString, token) { + switch (token) { + case "X": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.basicOptionalMinutes, + dateString, + ); + case "XX": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.basic, + dateString, + ); + case "XXXX": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.basicOptionalSeconds, + dateString, + ); + case "XXXXX": + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.extendedOptionalSeconds, + dateString, + ); + case "XXX": + default: + return (0, _utils.parseTimezonePattern)( + _constants.timezonePatterns.extended, + dateString, + ); + } + } + + set(date, flags, value) { + if (flags.timestampIsSet) return date; + return (0, _index.constructFrom)( + date, + date.getTime() - + (0, _index2.getTimezoneOffsetInMilliseconds)(date) - + value, + ); + } + + incompatibleTokens = ["t", "T", "x"]; +} +exports.ISOTimezoneWithZParser = ISOTimezoneWithZParser; + + +/***/ }), + +/***/ 81336: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.ISOWeekParser = void 0; +var _index = __nccwpck_require__(59325); +var _index2 = __nccwpck_require__(38516); +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// ISO week of year +class ISOWeekParser extends _Parser.Parser { + priority = 100; + + parse(dateString, token, match) { + switch (token) { + case "I": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.week, + dateString, + ); + case "Io": + return match.ordinalNumber(dateString, { unit: "week" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 1 && value <= 53; + } + + set(date, _flags, value) { + return (0, _index2.startOfISOWeek)((0, _index.setISOWeek)(date, value)); + } + + incompatibleTokens = [ + "y", + "Y", + "u", + "q", + "Q", + "M", + "L", + "w", + "d", + "D", + "e", + "c", + "t", + "T", + ]; +} +exports.ISOWeekParser = ISOWeekParser; + + +/***/ }), + +/***/ 36877: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.ISOWeekYearParser = void 0; +var _index = __nccwpck_require__(38516); +var _index2 = __nccwpck_require__(30926); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// ISO week-numbering year +class ISOWeekYearParser extends _Parser.Parser { + priority = 130; + + parse(dateString, token) { + if (token === "R") { + return (0, _utils.parseNDigitsSigned)(4, dateString); + } + + return (0, _utils.parseNDigitsSigned)(token.length, dateString); + } + + set(date, _flags, value) { + const firstWeekOfYear = (0, _index2.constructFrom)(date, 0); + firstWeekOfYear.setFullYear(value, 0, 4); + firstWeekOfYear.setHours(0, 0, 0, 0); + return (0, _index.startOfISOWeek)(firstWeekOfYear); + } + + incompatibleTokens = [ + "G", + "y", + "Y", + "u", + "Q", + "q", + "M", + "L", + "w", + "d", + "D", + "e", + "c", + "t", + "T", + ]; +} +exports.ISOWeekYearParser = ISOWeekYearParser; + + +/***/ }), + +/***/ 82259: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.LocalDayParser = void 0; +var _index = __nccwpck_require__(51277); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// Local day of week +class LocalDayParser extends _Parser.Parser { + priority = 90; + parse(dateString, token, match, options) { + const valueCallback = (value) => { + // We want here floor instead of trunc, so we get -7 for value 0 instead of 0 + const wholeWeekDays = Math.floor((value - 1) / 7) * 7; + return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays; + }; + + switch (token) { + // 3 + case "e": + case "ee": // 03 + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(token.length, dateString), + valueCallback, + ); + // 3rd + case "eo": + return (0, _utils.mapValue)( + match.ordinalNumber(dateString, { + unit: "day", + }), + valueCallback, + ); + // Tue + case "eee": + return ( + match.day(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.day(dateString, { width: "short", context: "formatting" }) || + match.day(dateString, { width: "narrow", context: "formatting" }) + ); + + // T + case "eeeee": + return match.day(dateString, { + width: "narrow", + context: "formatting", + }); + // Tu + case "eeeeee": + return ( + match.day(dateString, { width: "short", context: "formatting" }) || + match.day(dateString, { width: "narrow", context: "formatting" }) + ); + + // Tuesday + case "eeee": + default: + return ( + match.day(dateString, { width: "wide", context: "formatting" }) || + match.day(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.day(dateString, { width: "short", context: "formatting" }) || + match.day(dateString, { width: "narrow", context: "formatting" }) + ); + } + } + + validate(_date, value) { + return value >= 0 && value <= 6; + } + + set(date, _flags, value, options) { + date = (0, _index.setDay)(date, value, options); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "E", + "i", + "c", + "t", + "T", + ]; +} +exports.LocalDayParser = LocalDayParser; + + +/***/ }), + +/***/ 16499: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.LocalWeekParser = void 0; +var _index = __nccwpck_require__(9462); +var _index2 = __nccwpck_require__(31284); +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// Local week of year +class LocalWeekParser extends _Parser.Parser { + priority = 100; + + parse(dateString, token, match) { + switch (token) { + case "w": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.week, + dateString, + ); + case "wo": + return match.ordinalNumber(dateString, { unit: "week" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 1 && value <= 53; + } + + set(date, _flags, value, options) { + return (0, _index2.startOfWeek)( + (0, _index.setWeek)(date, value, options), + options, + ); + } + + incompatibleTokens = [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "i", + "t", + "T", + ]; +} +exports.LocalWeekParser = LocalWeekParser; + + +/***/ }), + +/***/ 60134: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.LocalWeekYearParser = void 0; +var _index = __nccwpck_require__(19116); + +var _index2 = __nccwpck_require__(31284); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// Local week-numbering year +class LocalWeekYearParser extends _Parser.Parser { + priority = 130; + + parse(dateString, token, match) { + const valueCallback = (year) => ({ + year, + isTwoDigitYear: token === "YY", + }); + + switch (token) { + case "Y": + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(4, dateString), + valueCallback, + ); + case "Yo": + return (0, _utils.mapValue)( + match.ordinalNumber(dateString, { + unit: "year", + }), + valueCallback, + ); + default: + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(token.length, dateString), + valueCallback, + ); + } + } + + validate(_date, value) { + return value.isTwoDigitYear || value.year > 0; + } + + set(date, flags, value, options) { + const currentYear = (0, _index.getWeekYear)(date, options); + + if (value.isTwoDigitYear) { + const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)( + value.year, + currentYear, + ); + date.setFullYear( + normalizedTwoDigitYear, + 0, + options.firstWeekContainsDate, + ); + date.setHours(0, 0, 0, 0); + return (0, _index2.startOfWeek)(date, options); + } + + const year = + !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; + date.setFullYear(year, 0, options.firstWeekContainsDate); + date.setHours(0, 0, 0, 0); + return (0, _index2.startOfWeek)(date, options); + } + + incompatibleTokens = [ + "y", + "R", + "u", + "Q", + "q", + "M", + "L", + "I", + "d", + "D", + "i", + "t", + "T", + ]; +} +exports.LocalWeekYearParser = LocalWeekYearParser; + + +/***/ }), + +/***/ 74650: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.MinuteParser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class MinuteParser extends _Parser.Parser { + priority = 60; + + parse(dateString, token, match) { + switch (token) { + case "m": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.minute, + dateString, + ); + case "mo": + return match.ordinalNumber(dateString, { unit: "minute" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 0 && value <= 59; + } + + set(date, _flags, value) { + date.setMinutes(value, 0, 0); + return date; + } + + incompatibleTokens = ["t", "T"]; +} +exports.MinuteParser = MinuteParser; + + +/***/ }), + +/***/ 73978: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.MonthParser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class MonthParser extends _Parser.Parser { + incompatibleTokens = [ + "Y", + "R", + "q", + "Q", + "L", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ]; + + priority = 110; + + parse(dateString, token, match) { + const valueCallback = (value) => value - 1; + + switch (token) { + // 1, 2, ..., 12 + case "M": + return (0, _utils.mapValue)( + (0, _utils.parseNumericPattern)( + _constants.numericPatterns.month, + dateString, + ), + valueCallback, + ); + // 01, 02, ..., 12 + case "MM": + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(2, dateString), + valueCallback, + ); + // 1st, 2nd, ..., 12th + case "Mo": + return (0, _utils.mapValue)( + match.ordinalNumber(dateString, { + unit: "month", + }), + valueCallback, + ); + // Jan, Feb, ..., Dec + case "MMM": + return ( + match.month(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.month(dateString, { width: "narrow", context: "formatting" }) + ); + + // J, F, ..., D + case "MMMMM": + return match.month(dateString, { + width: "narrow", + context: "formatting", + }); + // January, February, ..., December + case "MMMM": + default: + return ( + match.month(dateString, { width: "wide", context: "formatting" }) || + match.month(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.month(dateString, { width: "narrow", context: "formatting" }) + ); + } + } + + validate(_date, value) { + return value >= 0 && value <= 11; + } + + set(date, _flags, value) { + date.setMonth(value, 1); + date.setHours(0, 0, 0, 0); + return date; + } +} +exports.MonthParser = MonthParser; + + +/***/ }), + +/***/ 28301: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.QuarterParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class QuarterParser extends _Parser.Parser { + priority = 120; + + parse(dateString, token, match) { + switch (token) { + // 1, 2, 3, 4 + case "Q": + case "QQ": // 01, 02, 03, 04 + return (0, _utils.parseNDigits)(token.length, dateString); + // 1st, 2nd, 3rd, 4th + case "Qo": + return match.ordinalNumber(dateString, { unit: "quarter" }); + // Q1, Q2, Q3, Q4 + case "QQQ": + return ( + match.quarter(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.quarter(dateString, { + width: "narrow", + context: "formatting", + }) + ); + + // 1, 2, 3, 4 (narrow quarter; could be not numerical) + case "QQQQQ": + return match.quarter(dateString, { + width: "narrow", + context: "formatting", + }); + // 1st quarter, 2nd quarter, ... + case "QQQQ": + default: + return ( + match.quarter(dateString, { + width: "wide", + context: "formatting", + }) || + match.quarter(dateString, { + width: "abbreviated", + context: "formatting", + }) || + match.quarter(dateString, { + width: "narrow", + context: "formatting", + }) + ); + } + } + + validate(_date, value) { + return value >= 1 && value <= 4; + } + + set(date, _flags, value) { + date.setMonth((value - 1) * 3, 1); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "Y", + "R", + "q", + "M", + "L", + "w", + "I", + "d", + "D", + "i", + "e", + "c", + "t", + "T", + ]; +} +exports.QuarterParser = QuarterParser; + + +/***/ }), + +/***/ 99083: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.SecondParser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class SecondParser extends _Parser.Parser { + priority = 50; + + parse(dateString, token, match) { + switch (token) { + case "s": + return (0, _utils.parseNumericPattern)( + _constants.numericPatterns.second, + dateString, + ); + case "so": + return match.ordinalNumber(dateString, { unit: "second" }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + + validate(_date, value) { + return value >= 0 && value <= 59; + } + + set(date, _flags, value) { + date.setSeconds(value, 0); + return date; + } + + incompatibleTokens = ["t", "T"]; +} +exports.SecondParser = SecondParser; + + +/***/ }), + +/***/ 77529: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.StandAloneLocalDayParser = void 0; +var _index = __nccwpck_require__(51277); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// Stand-alone local day of week +class StandAloneLocalDayParser extends _Parser.Parser { + priority = 90; + + parse(dateString, token, match, options) { + const valueCallback = (value) => { + // We want here floor instead of trunc, so we get -7 for value 0 instead of 0 + const wholeWeekDays = Math.floor((value - 1) / 7) * 7; + return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays; + }; + + switch (token) { + // 3 + case "c": + case "cc": // 03 + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(token.length, dateString), + valueCallback, + ); + // 3rd + case "co": + return (0, _utils.mapValue)( + match.ordinalNumber(dateString, { + unit: "day", + }), + valueCallback, + ); + // Tue + case "ccc": + return ( + match.day(dateString, { + width: "abbreviated", + context: "standalone", + }) || + match.day(dateString, { width: "short", context: "standalone" }) || + match.day(dateString, { width: "narrow", context: "standalone" }) + ); + + // T + case "ccccc": + return match.day(dateString, { + width: "narrow", + context: "standalone", + }); + // Tu + case "cccccc": + return ( + match.day(dateString, { width: "short", context: "standalone" }) || + match.day(dateString, { width: "narrow", context: "standalone" }) + ); + + // Tuesday + case "cccc": + default: + return ( + match.day(dateString, { width: "wide", context: "standalone" }) || + match.day(dateString, { + width: "abbreviated", + context: "standalone", + }) || + match.day(dateString, { width: "short", context: "standalone" }) || + match.day(dateString, { width: "narrow", context: "standalone" }) + ); + } + } + + validate(_date, value) { + return value >= 0 && value <= 6; + } + + set(date, _flags, value, options) { + date = (0, _index.setDay)(date, value, options); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "E", + "i", + "e", + "t", + "T", + ]; +} +exports.StandAloneLocalDayParser = StandAloneLocalDayParser; + + +/***/ }), + +/***/ 94413: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.StandAloneMonthParser = void 0; +var _constants = __nccwpck_require__(48766); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class StandAloneMonthParser extends _Parser.Parser { + priority = 110; + + parse(dateString, token, match) { + const valueCallback = (value) => value - 1; + + switch (token) { + // 1, 2, ..., 12 + case "L": + return (0, _utils.mapValue)( + (0, _utils.parseNumericPattern)( + _constants.numericPatterns.month, + dateString, + ), + valueCallback, + ); + // 01, 02, ..., 12 + case "LL": + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(2, dateString), + valueCallback, + ); + // 1st, 2nd, ..., 12th + case "Lo": + return (0, _utils.mapValue)( + match.ordinalNumber(dateString, { + unit: "month", + }), + valueCallback, + ); + // Jan, Feb, ..., Dec + case "LLL": + return ( + match.month(dateString, { + width: "abbreviated", + context: "standalone", + }) || + match.month(dateString, { width: "narrow", context: "standalone" }) + ); + + // J, F, ..., D + case "LLLLL": + return match.month(dateString, { + width: "narrow", + context: "standalone", + }); + // January, February, ..., December + case "LLLL": + default: + return ( + match.month(dateString, { width: "wide", context: "standalone" }) || + match.month(dateString, { + width: "abbreviated", + context: "standalone", + }) || + match.month(dateString, { width: "narrow", context: "standalone" }) + ); + } + } + + validate(_date, value) { + return value >= 0 && value <= 11; + } + + set(date, _flags, value) { + date.setMonth(value, 1); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "Y", + "R", + "q", + "Q", + "M", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ]; +} +exports.StandAloneMonthParser = StandAloneMonthParser; + + +/***/ }), + +/***/ 97943: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.StandAloneQuarterParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class StandAloneQuarterParser extends _Parser.Parser { + priority = 120; + + parse(dateString, token, match) { + switch (token) { + // 1, 2, 3, 4 + case "q": + case "qq": // 01, 02, 03, 04 + return (0, _utils.parseNDigits)(token.length, dateString); + // 1st, 2nd, 3rd, 4th + case "qo": + return match.ordinalNumber(dateString, { unit: "quarter" }); + // Q1, Q2, Q3, Q4 + case "qqq": + return ( + match.quarter(dateString, { + width: "abbreviated", + context: "standalone", + }) || + match.quarter(dateString, { + width: "narrow", + context: "standalone", + }) + ); + + // 1, 2, 3, 4 (narrow quarter; could be not numerical) + case "qqqqq": + return match.quarter(dateString, { + width: "narrow", + context: "standalone", + }); + // 1st quarter, 2nd quarter, ... + case "qqqq": + default: + return ( + match.quarter(dateString, { + width: "wide", + context: "standalone", + }) || + match.quarter(dateString, { + width: "abbreviated", + context: "standalone", + }) || + match.quarter(dateString, { + width: "narrow", + context: "standalone", + }) + ); + } + } + + validate(_date, value) { + return value >= 1 && value <= 4; + } + + set(date, _flags, value) { + date.setMonth((value - 1) * 3, 1); + date.setHours(0, 0, 0, 0); + return date; + } + + incompatibleTokens = [ + "Y", + "R", + "Q", + "M", + "L", + "w", + "I", + "d", + "D", + "i", + "e", + "c", + "t", + "T", + ]; +} +exports.StandAloneQuarterParser = StandAloneQuarterParser; + + +/***/ }), + +/***/ 7319: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.TimestampMillisecondsParser = void 0; +var _index = __nccwpck_require__(30926); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class TimestampMillisecondsParser extends _Parser.Parser { + priority = 20; + + parse(dateString) { + return (0, _utils.parseAnyDigitsSigned)(dateString); + } + + set(date, _flags, value) { + return [(0, _index.constructFrom)(date, value), { timestampIsSet: true }]; + } + + incompatibleTokens = "*"; +} +exports.TimestampMillisecondsParser = TimestampMillisecondsParser; + + +/***/ }), + +/***/ 86085: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.TimestampSecondsParser = void 0; +var _index = __nccwpck_require__(30926); +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +class TimestampSecondsParser extends _Parser.Parser { + priority = 40; + + parse(dateString) { + return (0, _utils.parseAnyDigitsSigned)(dateString); + } + + set(date, _flags, value) { + return [ + (0, _index.constructFrom)(date, value * 1000), + { timestampIsSet: true }, + ]; + } + + incompatibleTokens = "*"; +} +exports.TimestampSecondsParser = TimestampSecondsParser; + + +/***/ }), + +/***/ 57628: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.YearParser = void 0; +var _Parser = __nccwpck_require__(24759); + +var _utils = __nccwpck_require__(66945); + +// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns +// | Year | y | yy | yyy | yyyy | yyyyy | +// |----------|-------|----|-------|-------|-------| +// | AD 1 | 1 | 01 | 001 | 0001 | 00001 | +// | AD 12 | 12 | 12 | 012 | 0012 | 00012 | +// | AD 123 | 123 | 23 | 123 | 0123 | 00123 | +// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | +// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | +class YearParser extends _Parser.Parser { + priority = 130; + incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]; + + parse(dateString, token, match) { + const valueCallback = (year) => ({ + year, + isTwoDigitYear: token === "yy", + }); + + switch (token) { + case "y": + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(4, dateString), + valueCallback, + ); + case "yo": + return (0, _utils.mapValue)( + match.ordinalNumber(dateString, { + unit: "year", + }), + valueCallback, + ); + default: + return (0, _utils.mapValue)( + (0, _utils.parseNDigits)(token.length, dateString), + valueCallback, + ); + } + } + + validate(_date, value) { + return value.isTwoDigitYear || value.year > 0; + } + + set(date, flags, value) { + const currentYear = date.getFullYear(); + + if (value.isTwoDigitYear) { + const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)( + value.year, + currentYear, + ); + date.setFullYear(normalizedTwoDigitYear, 0, 1); + date.setHours(0, 0, 0, 0); + return date; + } + + const year = + !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; + date.setFullYear(year, 0, 1); + date.setHours(0, 0, 0, 0); + return date; + } +} +exports.YearParser = YearParser; + + +/***/ }), + +/***/ 66945: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.dayPeriodEnumToHours = dayPeriodEnumToHours; +exports.isLeapYearIndex = isLeapYearIndex; +exports.mapValue = mapValue; +exports.normalizeTwoDigitYear = normalizeTwoDigitYear; +exports.parseAnyDigitsSigned = parseAnyDigitsSigned; +exports.parseNDigits = parseNDigits; +exports.parseNDigitsSigned = parseNDigitsSigned; +exports.parseNumericPattern = parseNumericPattern; +exports.parseTimezonePattern = parseTimezonePattern; +var _index = __nccwpck_require__(64278); + +var _constants = __nccwpck_require__(48766); + +function mapValue(parseFnResult, mapFn) { + if (!parseFnResult) { + return parseFnResult; + } + + return { + value: mapFn(parseFnResult.value), + rest: parseFnResult.rest, + }; +} + +function parseNumericPattern(pattern, dateString) { + const matchResult = dateString.match(pattern); + + if (!matchResult) { + return null; + } + + return { + value: parseInt(matchResult[0], 10), + rest: dateString.slice(matchResult[0].length), + }; +} + +function parseTimezonePattern(pattern, dateString) { + const matchResult = dateString.match(pattern); + + if (!matchResult) { + return null; + } + + // Input is 'Z' + if (matchResult[0] === "Z") { + return { + value: 0, + rest: dateString.slice(1), + }; + } + + const sign = matchResult[1] === "+" ? 1 : -1; + const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0; + const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0; + const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0; + + return { + value: + sign * + (hours * _index.millisecondsInHour + + minutes * _index.millisecondsInMinute + + seconds * _index.millisecondsInSecond), + rest: dateString.slice(matchResult[0].length), + }; +} + +function parseAnyDigitsSigned(dateString) { + return parseNumericPattern( + _constants.numericPatterns.anyDigitsSigned, + dateString, + ); +} + +function parseNDigits(n, dateString) { + switch (n) { + case 1: + return parseNumericPattern( + _constants.numericPatterns.singleDigit, + dateString, + ); + case 2: + return parseNumericPattern( + _constants.numericPatterns.twoDigits, + dateString, + ); + case 3: + return parseNumericPattern( + _constants.numericPatterns.threeDigits, + dateString, + ); + case 4: + return parseNumericPattern( + _constants.numericPatterns.fourDigits, + dateString, + ); + default: + return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString); + } +} + +function parseNDigitsSigned(n, dateString) { + switch (n) { + case 1: + return parseNumericPattern( + _constants.numericPatterns.singleDigitSigned, + dateString, + ); + case 2: + return parseNumericPattern( + _constants.numericPatterns.twoDigitsSigned, + dateString, + ); + case 3: + return parseNumericPattern( + _constants.numericPatterns.threeDigitsSigned, + dateString, + ); + case 4: + return parseNumericPattern( + _constants.numericPatterns.fourDigitsSigned, + dateString, + ); + default: + return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString); + } +} + +function dayPeriodEnumToHours(dayPeriod) { + switch (dayPeriod) { + case "morning": + return 4; + case "evening": + return 17; + case "pm": + case "noon": + case "afternoon": + return 12; + case "am": + case "midnight": + case "night": + default: + return 0; + } +} + +function normalizeTwoDigitYear(twoDigitYear, currentYear) { + const isCommonEra = currentYear > 0; + // Absolute number of the current year: + // 1 -> 1 AC + // 0 -> 1 BC + // -1 -> 2 BC + const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear; + + let result; + if (absCurrentYear <= 50) { + result = twoDigitYear || 100; + } else { + const rangeEnd = absCurrentYear + 50; + const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100; + const isPreviousCentury = twoDigitYear >= rangeEnd % 100; + result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0); + } + + return isCommonEra ? result : 1 - result; +} + +function isLeapYearIndex(year) { + return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); +} + + +/***/ }), + +/***/ 5975: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.parseISO = parseISO; +var _index = __nccwpck_require__(64278); + +var _index2 = __nccwpck_require__(30926); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link parseISO} function options. + */ + +/** + * @name parseISO + * @category Common Helpers + * @summary Parse ISO string + * + * @description + * Parse the given string in ISO 8601 format and return an instance of Date. + * + * Function accepts complete ISO 8601 formats as well as partial implementations. + * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 + * + * If the argument isn't a string, the function cannot parse the string or + * the values are invalid, it returns Invalid Date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param argument - The value to convert + * @param options - An object with options + * + * @returns The parsed date in the local time zone + * + * @example + * // Convert string '2014-02-11T11:30:30' to date: + * const result = parseISO('2014-02-11T11:30:30') + * //=> Tue Feb 11 2014 11:30:30 + * + * @example + * // Convert string '+02014101' to date, + * // if the additional number of digits in the extended year format is 1: + * const result = parseISO('+02014101', { additionalDigits: 1 }) + * //=> Fri Apr 11 2014 00:00:00 + */ +function parseISO(argument, options) { + const invalidDate = () => (0, _index2.constructFrom)(options?.in, NaN); + + const additionalDigits = options?.additionalDigits ?? 2; + const dateStrings = splitDateString(argument); + + let date; + if (dateStrings.date) { + const parseYearResult = parseYear(dateStrings.date, additionalDigits); + date = parseDate(parseYearResult.restDateString, parseYearResult.year); + } + + if (!date || isNaN(+date)) return invalidDate(); + + const timestamp = +date; + let time = 0; + let offset; + + if (dateStrings.time) { + time = parseTime(dateStrings.time); + if (isNaN(time)) return invalidDate(); + } + + if (dateStrings.timezone) { + offset = parseTimezone(dateStrings.timezone); + if (isNaN(offset)) return invalidDate(); + } else { + const tmpDate = new Date(timestamp + time); + const result = (0, _index3.toDate)(0, options?.in); + result.setFullYear( + tmpDate.getUTCFullYear(), + tmpDate.getUTCMonth(), + tmpDate.getUTCDate(), + ); + result.setHours( + tmpDate.getUTCHours(), + tmpDate.getUTCMinutes(), + tmpDate.getUTCSeconds(), + tmpDate.getUTCMilliseconds(), + ); + return result; + } + + return (0, _index3.toDate)(timestamp + time + offset, options?.in); +} + +const patterns = { + dateTimeDelimiter: /[T ]/, + timeZoneDelimiter: /[Z ]/i, + timezone: /([Z+-].*)$/, +}; + +const dateRegex = + /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/; +const timeRegex = + /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/; +const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/; + +function splitDateString(dateString) { + const dateStrings = {}; + const array = dateString.split(patterns.dateTimeDelimiter); + let timeString; + + // The regex match should only return at maximum two array elements. + // [date], [time], or [date, time]. + if (array.length > 2) { + return dateStrings; + } + + if (/:/.test(array[0])) { + timeString = array[0]; + } else { + dateStrings.date = array[0]; + timeString = array[1]; + if (patterns.timeZoneDelimiter.test(dateStrings.date)) { + dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]; + timeString = dateString.substr( + dateStrings.date.length, + dateString.length, + ); + } + } + + if (timeString) { + const token = patterns.timezone.exec(timeString); + if (token) { + dateStrings.time = timeString.replace(token[1], ""); + dateStrings.timezone = token[1]; + } else { + dateStrings.time = timeString; + } + } + + return dateStrings; +} + +function parseYear(dateString, additionalDigits) { + const regex = new RegExp( + "^(?:(\\d{4}|[+-]\\d{" + + (4 + additionalDigits) + + "})|(\\d{2}|[+-]\\d{" + + (2 + additionalDigits) + + "})$)", + ); + + const captures = dateString.match(regex); + // Invalid ISO-formatted year + if (!captures) return { year: NaN, restDateString: "" }; + + const year = captures[1] ? parseInt(captures[1]) : null; + const century = captures[2] ? parseInt(captures[2]) : null; + + // either year or century is null, not both + return { + year: century === null ? year : century * 100, + restDateString: dateString.slice((captures[1] || captures[2]).length), + }; +} + +function parseDate(dateString, year) { + // Invalid ISO-formatted year + if (year === null) return new Date(NaN); + + const captures = dateString.match(dateRegex); + // Invalid ISO-formatted string + if (!captures) return new Date(NaN); + + const isWeekDate = !!captures[4]; + const dayOfYear = parseDateUnit(captures[1]); + const month = parseDateUnit(captures[2]) - 1; + const day = parseDateUnit(captures[3]); + const week = parseDateUnit(captures[4]); + const dayOfWeek = parseDateUnit(captures[5]) - 1; + + if (isWeekDate) { + if (!validateWeekDate(year, week, dayOfWeek)) { + return new Date(NaN); + } + return dayOfISOWeekYear(year, week, dayOfWeek); + } else { + const date = new Date(0); + if ( + !validateDate(year, month, day) || + !validateDayOfYearDate(year, dayOfYear) + ) { + return new Date(NaN); + } + date.setUTCFullYear(year, month, Math.max(dayOfYear, day)); + return date; + } +} + +function parseDateUnit(value) { + return value ? parseInt(value) : 1; +} + +function parseTime(timeString) { + const captures = timeString.match(timeRegex); + if (!captures) return NaN; // Invalid ISO-formatted time + + const hours = parseTimeUnit(captures[1]); + const minutes = parseTimeUnit(captures[2]); + const seconds = parseTimeUnit(captures[3]); + + if (!validateTime(hours, minutes, seconds)) { + return NaN; + } + + return ( + hours * _index.millisecondsInHour + + minutes * _index.millisecondsInMinute + + seconds * 1000 + ); +} + +function parseTimeUnit(value) { + return (value && parseFloat(value.replace(",", "."))) || 0; +} + +function parseTimezone(timezoneString) { + if (timezoneString === "Z") return 0; + + const captures = timezoneString.match(timezoneRegex); + if (!captures) return 0; + + const sign = captures[1] === "+" ? -1 : 1; + const hours = parseInt(captures[2]); + const minutes = (captures[3] && parseInt(captures[3])) || 0; + + if (!validateTimezone(hours, minutes)) { + return NaN; + } + + return ( + sign * + (hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute) + ); +} + +function dayOfISOWeekYear(isoWeekYear, week, day) { + const date = new Date(0); + date.setUTCFullYear(isoWeekYear, 0, 4); + const fourthOfJanuaryDay = date.getUTCDay() || 7; + const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay; + date.setUTCDate(date.getUTCDate() + diff); + return date; +} + +// Validation functions + +// February is null to handle the leap year (using ||) +const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + +function isLeapYearIndex(year) { + return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); +} + +function validateDate(year, month, date) { + return ( + month >= 0 && + month <= 11 && + date >= 1 && + date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28)) + ); +} + +function validateDayOfYearDate(year, dayOfYear) { + return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365); +} + +function validateWeekDate(_year, week, day) { + return week >= 1 && week <= 53 && day >= 0 && day <= 6; +} + +function validateTime(hours, minutes, seconds) { + if (hours === 24) { + return minutes === 0 && seconds === 0; + } + + return ( + seconds >= 0 && + seconds < 60 && + minutes >= 0 && + minutes < 60 && + hours >= 0 && + hours < 25 + ); +} + +function validateTimezone(_hours, minutes) { + return minutes >= 0 && minutes <= 59; +} + + +/***/ }), + +/***/ 25531: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.parseJSON = parseJSON; +var _index = __nccwpck_require__(46439); + +/** + * The {@link parseJSON} function options. + */ + +/** + * Converts a complete ISO date string in UTC time, the typical format for transmitting + * a date in JSON, to a JavaScript `Date` instance. + * + * This is a minimal implementation for converting dates retrieved from a JSON API to + * a `Date` instance which can be used with other functions in the `date-fns` library. + * The following formats are supported: + * + * - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())` + * - `2000-03-15T05:20:10Z`: Without milliseconds + * - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages + * - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages + * - `2000-03-15T05:20:10+0000`: With a zero offset without a colon + * - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol + * - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds + * - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting + * + * For convenience and ease of use these other input types are also supported + * via [toDate](https://date-fns.org/docs/toDate): + * + * - A `Date` instance will be cloned + * - A `number` will be treated as a timestamp + * + * Any other input type or invalid date strings will return an `Invalid Date`. + * + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param dateStr - A fully formed ISO8601 date string to convert + * @param options - An object with options + * + * @returns The parsed date in the local time zone + */ +function parseJSON(dateStr, options) { + const parts = dateStr.match( + /(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/, + ); + + if (!parts) return (0, _index.toDate)(NaN, options?.in); + + return (0, _index.toDate)( + Date.UTC( + +parts[1], + +parts[2] - 1, + +parts[3], + +parts[4] - (+parts[9] || 0) * (parts[8] == "-" ? -1 : 1), + +parts[5] - (+parts[10] || 0) * (parts[8] == "-" ? -1 : 1), + +parts[6], + +((parts[7] || "0") + "00").substring(0, 3), + ), + options?.in, + ); +} + + +/***/ }), + +/***/ 61930: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousDay = previousDay; +var _index = __nccwpck_require__(99455); +var _index2 = __nccwpck_require__(24345); + +/** + * The {@link previousDay} function options. + */ + +/** + * @name previousDay + * @category Weekday Helpers + * @summary When is the previous day of the week? + * + * @description + * When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to check + * @param day - The day of the week + * @param options - An object with options + * + * @returns The date is the previous day of week + * + * @example + * // When is the previous Monday before Mar, 20, 2020? + * const result = previousDay(new Date(2020, 2, 20), 1) + * //=> Mon Mar 16 2020 00:00:00 + * + * @example + * // When is the previous Tuesday before Mar, 21, 2020? + * const result = previousDay(new Date(2020, 2, 21), 2) + * //=> Tue Mar 17 2020 00:00:00 + */ +function previousDay(date, day, options) { + let delta = (0, _index.getDay)(date, options) - day; + if (delta <= 0) delta += 7; + + return (0, _index2.subDays)(date, delta, options); +} + + +/***/ }), + +/***/ 47961: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousFriday = previousFriday; +var _index = __nccwpck_require__(61930); + +/** + * The {@link previousFriday} function options. + */ + +/** + * @name previousFriday + * @category Weekday Helpers + * @summary When is the previous Friday? + * + * @description + * When is the previous Friday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - The options + * + * @returns The previous Friday + * + * @example + * // When is the previous Friday before Jun, 19, 2021? + * const result = previousFriday(new Date(2021, 5, 19)) + * //=> Fri June 18 2021 00:00:00 + */ +function previousFriday(date, options) { + return (0, _index.previousDay)(date, 5, options); +} + + +/***/ }), + +/***/ 69377: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousMonday = previousMonday; +var _index = __nccwpck_require__(61930); + +/** + * The {@link previousMonday} function options. + */ + +/** + * @name previousMonday + * @category Weekday Helpers + * @summary When is the previous Monday? + * + * @description + * When is the previous Monday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The previous Monday + * + * @example + * // When is the previous Monday before Jun, 18, 2021? + * const result = previousMonday(new Date(2021, 5, 18)) + * //=> Mon June 14 2021 00:00:00 + */ +function previousMonday(date, options) { + return (0, _index.previousDay)(date, 1, options); +} + + +/***/ }), + +/***/ 55334: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousSaturday = previousSaturday; +var _index = __nccwpck_require__(61930); + +/** + * The {@link previousSaturday} function options. + */ + +/** + * @name previousSaturday + * @category Weekday Helpers + * @summary When is the previous Saturday? + * + * @description + * When is the previous Saturday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - The options + * + * @returns The previous Saturday + * + * @example + * // When is the previous Saturday before Jun, 20, 2021? + * const result = previousSaturday(new Date(2021, 5, 20)) + * //=> Sat June 19 2021 00:00:00 + */ +function previousSaturday(date, options) { + return (0, _index.previousDay)(date, 6, options); +} + + +/***/ }), + +/***/ 53728: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousSunday = previousSunday; +var _index = __nccwpck_require__(61930); + +/** + * The {@link previousSunday} function options. + */ + +/** + * @name previousSunday + * @category Weekday Helpers + * @summary When is the previous Sunday? + * + * @description + * When is the previous Sunday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - The options + * + * @returns The previous Sunday + * + * @example + * // When is the previous Sunday before Jun, 21, 2021? + * const result = previousSunday(new Date(2021, 5, 21)) + * //=> Sun June 20 2021 00:00:00 + */ +function previousSunday(date, options) { + return (0, _index.previousDay)(date, 0, options); +} + + +/***/ }), + +/***/ 41091: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousThursday = previousThursday; +var _index = __nccwpck_require__(61930); + +/** + * The {@link previousThursday} function options. + */ + +/** + * @name previousThursday + * @category Weekday Helpers + * @summary When is the previous Thursday? + * + * @description + * When is the previous Thursday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The previous Thursday + * + * @example + * // When is the previous Thursday before Jun, 18, 2021? + * const result = previousThursday(new Date(2021, 5, 18)) + * //=> Thu June 17 2021 00:00:00 + */ +function previousThursday(date, options) { + return (0, _index.previousDay)(date, 4, options); +} + + +/***/ }), + +/***/ 37373: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousTuesday = previousTuesday; +var _index = __nccwpck_require__(61930); + +/** + * The {@link previousTuesday} function options. + */ + +/** + * @name previousTuesday + * @category Weekday Helpers + * @summary When is the previous Tuesday? + * + * @description + * When is the previous Tuesday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The previous Tuesday + * + * @example + * // When is the previous Tuesday before Jun, 18, 2021? + * const result = previousTuesday(new Date(2021, 5, 18)) + * //=> Tue June 15 2021 00:00:00 + */ +function previousTuesday(date, options) { + return (0, _index.previousDay)(date, 2, options); +} + + +/***/ }), + +/***/ 63474: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.previousWednesday = previousWednesday; +var _index = __nccwpck_require__(61930); + +/** + * The {@link previousWednesday} function options. + */ + +/** + * @name previousWednesday + * @category Weekday Helpers + * @summary When is the previous Wednesday? + * + * @description + * When is the previous Wednesday? + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to start counting from + * @param options - An object with options + * + * @returns The previous Wednesday + * + * @example + * // When is the previous Wednesday before Jun, 18, 2021? + * const result = previousWednesday(new Date(2021, 5, 18)) + * //=> Wed June 16 2021 00:00:00 + */ +function previousWednesday(date, options) { + return (0, _index.previousDay)(date, 3, options); +} + + +/***/ }), + +/***/ 13791: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.quartersToMonths = quartersToMonths; +var _index = __nccwpck_require__(64278); + +/** + * @name quartersToMonths + * @category Conversion Helpers + * @summary Convert number of quarters to months. + * + * @description + * Convert a number of quarters to a full number of months. + * + * @param quarters - The number of quarters to be converted + * + * @returns The number of quarters converted in months + * + * @example + * // Convert 2 quarters to months + * const result = quartersToMonths(2) + * //=> 6 + */ +function quartersToMonths(quarters) { + return Math.trunc(quarters * _index.monthsInQuarter); +} + + +/***/ }), + +/***/ 29928: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.quartersToYears = quartersToYears; +var _index = __nccwpck_require__(64278); + +/** + * @name quartersToYears + * @category Conversion Helpers + * @summary Convert number of quarters to years. + * + * @description + * Convert a number of quarters to a full number of years. + * + * @param quarters - The number of quarters to be converted + * + * @returns The number of quarters converted in years + * + * @example + * // Convert 8 quarters to years + * const result = quartersToYears(8) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = quartersToYears(11) + * //=> 2 + */ +function quartersToYears(quarters) { + const years = quarters / _index.quartersInYear; + return Math.trunc(years); +} + + +/***/ }), + +/***/ 43780: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.roundToNearestHours = roundToNearestHours; +var _index = __nccwpck_require__(35920); +var _index2 = __nccwpck_require__(30926); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link roundToNearestHours} function options. + */ + +/** + * @name roundToNearestHours + * @category Hour Helpers + * @summary Rounds the given date to the nearest hour + * + * @description + * Rounds the given date to the nearest hour (or number of hours). + * Rounds up when the given date is exactly between the nearest round hours. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to round + * @param options - An object with options. + * + * @returns The new date rounded to the closest hour + * + * @example + * // Round 10 July 2014 12:34:56 to nearest hour: + * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56)) + * //=> Thu Jul 10 2014 13:00:00 + * + * @example + * // Round 10 July 2014 12:34:56 to nearest half hour: + * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 6 }) + * //=> Thu Jul 10 2014 12:00:00 + * + * @example + * // Round 10 July 2014 12:34:56 to nearest half hour: + * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 }) + * //=> Thu Jul 10 2014 16:00:00 + * + * @example + * // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour: + * const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' }) + * //=> Thu Jul 10 2014 02:00:00 + * + * @example + * // Ceil (rounds up) 10 July 2014 12:34:56 to nearest quarter hour: + * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { roundingMethod: 'floor', nearestTo: 8 }) + * //=> Thu Jul 10 2014 08:00:00 + */ +function roundToNearestHours(date, options) { + const nearestTo = options?.nearestTo ?? 1; + + if (nearestTo < 1 || nearestTo > 12) + return (0, _index2.constructFrom)(options?.in || date, NaN); + + const date_ = (0, _index3.toDate)(date, options?.in); + const fractionalMinutes = date_.getMinutes() / 60; + const fractionalSeconds = date_.getSeconds() / 60 / 60; + const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60 / 60; + const hours = + date_.getHours() + + fractionalMinutes + + fractionalSeconds + + fractionalMilliseconds; + + const method = options?.roundingMethod ?? "round"; + const roundingMethod = (0, _index.getRoundingMethod)(method); + + const roundedHours = roundingMethod(hours / nearestTo) * nearestTo; + + date_.setHours(roundedHours, 0, 0, 0); + return date_; +} + + +/***/ }), + +/***/ 18909: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.roundToNearestMinutes = roundToNearestMinutes; +var _index = __nccwpck_require__(35920); +var _index2 = __nccwpck_require__(30926); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link roundToNearestMinutes} function options. + */ + +/** + * @name roundToNearestMinutes + * @category Minute Helpers + * @summary Rounds the given date to the nearest minute + * + * @description + * Rounds the given date to the nearest minute (or number of minutes). + * Rounds up when the given date is exactly between the nearest round minutes. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to round + * @param options - An object with options. + * + * @returns The new date rounded to the closest minute + * + * @example + * // Round 10 July 2014 12:12:34 to nearest minute: + * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34)) + * //=> Thu Jul 10 2014 12:13:00 + * + * @example + * // Round 10 July 2014 12:12:34 to nearest quarter hour: + * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 }) + * //=> Thu Jul 10 2014 12:15:00 + * + * @example + * // Floor (rounds down) 10 July 2014 12:12:34 to nearest minute: + * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'floor' }) + * //=> Thu Jul 10 2014 12:12:00 + * + * @example + * // Ceil (rounds up) 10 July 2014 12:12:34 to nearest half hour: + * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'ceil', nearestTo: 30 }) + * //=> Thu Jul 10 2014 12:30:00 + */ +function roundToNearestMinutes(date, options) { + const nearestTo = options?.nearestTo ?? 1; + + if (nearestTo < 1 || nearestTo > 30) + return (0, _index2.constructFrom)(date, NaN); + + const date_ = (0, _index3.toDate)(date, options?.in); + const fractionalSeconds = date_.getSeconds() / 60; + const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60; + const minutes = + date_.getMinutes() + fractionalSeconds + fractionalMilliseconds; + + const method = options?.roundingMethod ?? "round"; + const roundingMethod = (0, _index.getRoundingMethod)(method); + + const roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo; + + date_.setMinutes(roundedMinutes, 0, 0); + return date_; +} + + +/***/ }), + +/***/ 74725: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.secondsToHours = secondsToHours; +var _index = __nccwpck_require__(64278); + +/** + * @name secondsToHours + * @category Conversion Helpers + * @summary Convert seconds to hours. + * + * @description + * Convert a number of seconds to a full number of hours. + * + * @param seconds - The number of seconds to be converted + * + * @returns The number of seconds converted in hours + * + * @example + * // Convert 7200 seconds into hours + * const result = secondsToHours(7200) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = secondsToHours(7199) + * //=> 1 + */ +function secondsToHours(seconds) { + const hours = seconds / _index.secondsInHour; + return Math.trunc(hours); +} + + +/***/ }), + +/***/ 67928: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.secondsToMilliseconds = secondsToMilliseconds; +var _index = __nccwpck_require__(64278); + +/** + * @name secondsToMilliseconds + * @category Conversion Helpers + * @summary Convert seconds to milliseconds. + * + * @description + * Convert a number of seconds to a full number of milliseconds. + * + * @param seconds - The number of seconds to be converted + * + * @returns The number of seconds converted in milliseconds + * + * @example + * // Convert 2 seconds into milliseconds + * const result = secondsToMilliseconds(2) + * //=> 2000 + */ +function secondsToMilliseconds(seconds) { + return seconds * _index.millisecondsInSecond; +} + + +/***/ }), + +/***/ 79730: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.secondsToMinutes = secondsToMinutes; +var _index = __nccwpck_require__(64278); + +/** + * @name secondsToMinutes + * @category Conversion Helpers + * @summary Convert seconds to minutes. + * + * @description + * Convert a number of seconds to a full number of minutes. + * + * @param seconds - The number of seconds to be converted + * + * @returns The number of seconds converted in minutes + * + * @example + * // Convert 120 seconds into minutes + * const result = secondsToMinutes(120) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = secondsToMinutes(119) + * //=> 1 + */ +function secondsToMinutes(seconds) { + const minutes = seconds / _index.secondsInMinute; + return Math.trunc(minutes); +} + + +/***/ }), + +/***/ 3713: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.set = set; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(11618); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link set} function options. + */ + +/** + * @name set + * @category Common Helpers + * @summary Set date values to a given date. + * + * @description + * Set date values to a given date. + * + * Sets time values to date from object `values`. + * A value is not set if it is undefined or null or doesn't exist in `values`. + * + * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts + * to use native `Date#setX` methods. If you use this function, you may not want to include the + * other `setX` functions that date-fns provides if you are concerned about the bundle size. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param values - The date values to be set + * @param options - The options + * + * @returns The new date with options set + * + * @example + * // Transform 1 September 2014 into 20 October 2015 in a single line: + * const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 }) + * //=> Tue Oct 20 2015 00:00:00 + * + * @example + * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00: + * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 }) + * //=> Mon Sep 01 2014 12:23:45 + */ +function set(date, values, options) { + let _date = (0, _index3.toDate)(date, options?.in); + + // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date + if (isNaN(+_date)) return (0, _index.constructFrom)(options?.in || date, NaN); + + if (values.year != null) _date.setFullYear(values.year); + if (values.month != null) _date = (0, _index2.setMonth)(_date, values.month); + if (values.date != null) _date.setDate(values.date); + if (values.hours != null) _date.setHours(values.hours); + if (values.minutes != null) _date.setMinutes(values.minutes); + if (values.seconds != null) _date.setSeconds(values.seconds); + if (values.milliseconds != null) _date.setMilliseconds(values.milliseconds); + + return _date; +} + + +/***/ }), + +/***/ 83640: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setDate = setDate; +var _index = __nccwpck_require__(46439); + +/** + * The {@link setDate} function options. + */ + +/** + * @name setDate + * @category Day Helpers + * @summary Set the day of the month to the given date. + * + * @description + * Set the day of the month to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param dayOfMonth - The day of the month of the new date + * @param options - The options + * + * @returns The new date with the day of the month set + * + * @example + * // Set the 30th day of the month to 1 September 2014: + * const result = setDate(new Date(2014, 8, 1), 30) + * //=> Tue Sep 30 2014 00:00:00 + */ +function setDate(date, dayOfMonth, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setDate(dayOfMonth); + return _date; +} + + +/***/ }), + +/***/ 51277: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setDay = setDay; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(7412); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link setDay} function options. + */ + +/** + * @name setDay + * @category Weekday Helpers + * @summary Set the day of the week to the given date. + * + * @description + * Set the day of the week to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param day - The day of the week of the new date + * @param options - An object with options. + * + * @returns The new date with the day of the week set + * + * @example + * // Set week day to Sunday, with the default weekStartsOn of Sunday: + * const result = setDay(new Date(2014, 8, 1), 0) + * //=> Sun Aug 31 2014 00:00:00 + * + * @example + * // Set week day to Sunday, with a weekStartsOn of Monday: + * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 }) + * //=> Sun Sep 07 2014 00:00:00 + */ +function setDay(date, day, options) { + const defaultOptions = (0, _index.getDefaultOptions)(); + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; + + const date_ = (0, _index3.toDate)(date, options?.in); + const currentDay = date_.getDay(); + + const remainder = day % 7; + const dayIndex = (remainder + 7) % 7; + + const delta = 7 - weekStartsOn; + const diff = + day < 0 || day > 6 + ? day - ((currentDay + delta) % 7) + : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7); + return (0, _index2.addDays)(date_, diff, options); +} + + +/***/ }), + +/***/ 89849: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setDayOfYear = setDayOfYear; +var _index = __nccwpck_require__(46439); + +/** + * The {@link setDayOfYear} function options. + */ + +/** + * @name setDayOfYear + * @category Day Helpers + * @summary Set the day of the year to the given date. + * + * @description + * Set the day of the year to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param dayOfYear - The day of the year of the new date + * @param options - An object with options + * + * @returns The new date with the day of the year set + * + * @example + * // Set the 2nd day of the year to 2 July 2014: + * const result = setDayOfYear(new Date(2014, 6, 2), 2) + * //=> Thu Jan 02 2014 00:00:00 + */ +function setDayOfYear(date, dayOfYear, options) { + const date_ = (0, _index.toDate)(date, options?.in); + date_.setMonth(0); + date_.setDate(dayOfYear); + return date_; +} + + +/***/ }), + +/***/ 63876: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setDefaultOptions = setDefaultOptions; +var _index = __nccwpck_require__(35586); + +/** + * @name setDefaultOptions + * @category Common Helpers + * @summary Set default options including locale. + * @pure false + * + * @description + * Sets the defaults for + * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate` + * arguments for all functions. + * + * @param options - An object with options + * + * @example + * // Set global locale: + * import { es } from 'date-fns/locale' + * setDefaultOptions({ locale: es }) + * const result = format(new Date(2014, 8, 2), 'PPPP') + * //=> 'martes, 2 de septiembre de 2014' + * + * @example + * // Start of the week for 2 September 2014: + * const result = startOfWeek(new Date(2014, 8, 2)) + * //=> Sun Aug 31 2014 00:00:00 + * + * @example + * // Start of the week for 2 September 2014, + * // when we set that week starts on Monday by default: + * setDefaultOptions({ weekStartsOn: 1 }) + * const result = startOfWeek(new Date(2014, 8, 2)) + * //=> Mon Sep 01 2014 00:00:00 + * + * @example + * // Manually set options take priority over default options: + * setDefaultOptions({ weekStartsOn: 1 }) + * const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 }) + * //=> Sun Aug 31 2014 00:00:00 + * + * @example + * // Remove the option by setting it to `undefined`: + * setDefaultOptions({ weekStartsOn: 1 }) + * setDefaultOptions({ weekStartsOn: undefined }) + * const result = startOfWeek(new Date(2014, 8, 2)) + * //=> Sun Aug 31 2014 00:00:00 + */ +function setDefaultOptions(options) { + const result = {}; + const defaultOptions = (0, _index.getDefaultOptions)(); + + for (const property in defaultOptions) { + if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) { + // [TODO] I challenge you to fix the type + result[property] = defaultOptions[property]; + } + } + + for (const property in options) { + if (Object.prototype.hasOwnProperty.call(options, property)) { + if (options[property] === undefined) { + // [TODO] I challenge you to fix the type + delete result[property]; + } else { + // [TODO] I challenge you to fix the type + result[property] = options[property]; + } + } + } + + (0, _index.setDefaultOptions)(result); +} + + +/***/ }), + +/***/ 87749: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setHours = setHours; +var _index = __nccwpck_require__(46439); + +/** + * The {@link setHours} function options. + */ + +/** + * @name setHours + * @category Hour Helpers + * @summary Set the hours to the given date. + * + * @description + * Set the hours to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param hours - The hours of the new date + * @param options - An object with options + * + * @returns The new date with the hours set + * + * @example + * // Set 4 hours to 1 September 2014 11:30:00: + * const result = setHours(new Date(2014, 8, 1, 11, 30), 4) + * //=> Mon Sep 01 2014 04:30:00 + */ +function setHours(date, hours, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setHours(hours); + return _date; +} + + +/***/ }), + +/***/ 8082: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setISODay = setISODay; +var _index = __nccwpck_require__(7412); +var _index2 = __nccwpck_require__(86060); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link setISODay} function options. + */ + +/** + * @name setISODay + * @category Weekday Helpers + * @summary Set the day of the ISO week to the given date. + * + * @description + * Set the day of the ISO week to the given date. + * ISO week starts with Monday. + * 7 is the index of Sunday, 1 is the index of Monday, etc. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param day - The day of the ISO week of the new date + * @param options - An object with options + * + * @returns The new date with the day of the ISO week set + * + * @example + * // Set Sunday to 1 September 2014: + * const result = setISODay(new Date(2014, 8, 1), 7) + * //=> Sun Sep 07 2014 00:00:00 + */ +function setISODay(date, day, options) { + const date_ = (0, _index3.toDate)(date, options?.in); + const currentDay = (0, _index2.getISODay)(date_, options); + const diff = day - currentDay; + return (0, _index.addDays)(date_, diff, options); +} + + +/***/ }), + +/***/ 59325: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setISOWeek = setISOWeek; +var _index = __nccwpck_require__(16703); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link setISOWeek} function options. + */ + +/** + * @name setISOWeek + * @category ISO Week Helpers + * @summary Set the ISO week to the given date. + * + * @description + * Set the ISO week to the given date, saving the weekday number. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The `Date` type of the context function. + * + * @param date - The date to be changed + * @param week - The ISO week of the new date + * @param options - An object with options + * + * @returns The new date with the ISO week set + * + * @example + * // Set the 53rd ISO week to 7 August 2004: + * const result = setISOWeek(new Date(2004, 7, 7), 53) + * //=> Sat Jan 01 2005 00:00:00 + */ +function setISOWeek(date, week, options) { + const _date = (0, _index2.toDate)(date, options?.in); + const diff = (0, _index.getISOWeek)(_date, options) - week; + _date.setDate(_date.getDate() - diff * 7); + return _date; +} + + +/***/ }), + +/***/ 64482: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setISOWeekYear = setISOWeekYear; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(25671); +var _index3 = __nccwpck_require__(65437); +var _index4 = __nccwpck_require__(46439); + +/** + * The {@link setISOWeekYear} function options. + */ + +/** + * @name setISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Set the ISO week-numbering year to the given date. + * + * @description + * Set the ISO week-numbering year to the given date, + * saving the week number and the weekday number. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param weekYear - The ISO week-numbering year of the new date + * @param options - An object with options + * + * @returns The new date with the ISO week-numbering year set + * + * @example + * // Set ISO week-numbering year 2007 to 29 December 2008: + * const result = setISOWeekYear(new Date(2008, 11, 29), 2007) + * //=> Mon Jan 01 2007 00:00:00 + */ +function setISOWeekYear(date, weekYear, options) { + let _date = (0, _index4.toDate)(date, options?.in); + const diff = (0, _index2.differenceInCalendarDays)( + _date, + (0, _index3.startOfISOWeekYear)(_date, options), + ); + const fourthOfJanuary = (0, _index.constructFrom)(options?.in || date, 0); + fourthOfJanuary.setFullYear(weekYear, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + _date = (0, _index3.startOfISOWeekYear)(fourthOfJanuary); + _date.setDate(_date.getDate() + diff); + return _date; +} + + +/***/ }), + +/***/ 25885: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setMilliseconds = setMilliseconds; +var _index = __nccwpck_require__(46439); + +/** + * The {@link setMilliseconds} function options. + */ + +/** + * @name setMilliseconds + * @category Millisecond Helpers + * @summary Set the milliseconds to the given date. + * + * @description + * Set the milliseconds to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param milliseconds - The milliseconds of the new date + * @param options - The options + * + * @returns The new date with the milliseconds set + * + * @example + * // Set 300 milliseconds to 1 September 2014 11:30:40.500: + * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) + * //=> Mon Sep 01 2014 11:30:40.300 + */ +function setMilliseconds(date, milliseconds, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setMilliseconds(milliseconds); + return _date; +} + + +/***/ }), + +/***/ 48610: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setMinutes = setMinutes; +var _index = __nccwpck_require__(46439); + +/** + * The {@link setMinutes} function options. + */ + +/** + * @name setMinutes + * @category Minute Helpers + * @summary Set the minutes to the given date. + * + * @description + * Set the minutes to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments. + * + * @param date - The date to be changed + * @param minutes - The minutes of the new date + * @param options - An object with options + * + * @returns The new date with the minutes set + * + * @example + * // Set 45 minutes to 1 September 2014 11:30:40: + * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45) + * //=> Mon Sep 01 2014 11:45:40 + */ +function setMinutes(date, minutes, options) { + const date_ = (0, _index.toDate)(date, options?.in); + date_.setMinutes(minutes); + return date_; +} + + +/***/ }), + +/***/ 11618: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setMonth = setMonth; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(88222); +var _index3 = __nccwpck_require__(46439); + +/** + * The {@link setMonth} function options. + */ + +/** + * @name setMonth + * @category Month Helpers + * @summary Set the month to the given date. + * + * @description + * Set the month to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param month - The month index to set (0-11) + * @param options - The options + * + * @returns The new date with the month set + * + * @example + * // Set February to 1 September 2014: + * const result = setMonth(new Date(2014, 8, 1), 1) + * //=> Sat Feb 01 2014 00:00:00 + */ +function setMonth(date, month, options) { + const _date = (0, _index3.toDate)(date, options?.in); + const year = _date.getFullYear(); + const day = _date.getDate(); + + const midMonth = (0, _index.constructFrom)(options?.in || date, 0); + midMonth.setFullYear(year, month, 15); + midMonth.setHours(0, 0, 0, 0); + const daysInMonth = (0, _index2.getDaysInMonth)(midMonth); + + // Set the earlier date, allows to wrap Jan 31 to Feb 28 + _date.setMonth(month, Math.min(day, daysInMonth)); + return _date; +} + + +/***/ }), + +/***/ 57471: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setQuarter = setQuarter; +var _index = __nccwpck_require__(11618); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link setQuarter} function options. + */ + +/** + * @name setQuarter + * @category Quarter Helpers + * @summary Set the year quarter to the given date. + * + * @description + * Set the year quarter to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param quarter - The quarter of the new date + * @param options - The options + * + * @returns The new date with the quarter set + * + * @example + * // Set the 2nd quarter to 2 July 2014: + * const result = setQuarter(new Date(2014, 6, 2), 2) + * //=> Wed Apr 02 2014 00:00:00 + */ +function setQuarter(date, quarter, options) { + const date_ = (0, _index2.toDate)(date, options?.in); + const oldQuarter = Math.trunc(date_.getMonth() / 3) + 1; + const diff = quarter - oldQuarter; + return (0, _index.setMonth)(date_, date_.getMonth() + diff * 3); +} + + +/***/ }), + +/***/ 30274: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setSeconds = setSeconds; +var _index = __nccwpck_require__(46439); + +/** + * The {@link setSeconds} function options. + */ + +/** + * @name setSeconds + * @category Second Helpers + * @summary Set the seconds to the given date, with context support. + * + * @description + * Set the seconds to the given date, with an optional context for time zone specification. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param seconds - The seconds of the new date + * @param options - An object with options + * + * @returns The new date with the seconds set + * + * @example + * // Set 45 seconds to 1 September 2014 11:30:40: + * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) + * //=> Mon Sep 01 2014 11:30:45 + */ +function setSeconds(date, seconds, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setSeconds(seconds); + return _date; +} + + +/***/ }), + +/***/ 9462: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.setWeek = setWeek; +var _index = __nccwpck_require__(43080); +var _index2 = __nccwpck_require__(46439); + +/** + * The {@link setWeek} function options. + */ + +/** + * @name setWeek + * @category Week Helpers + * @summary Set the local week to the given date. + * + * @description + * Set the local week to the given date, saving the weekday number. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param week - The week of the new date + * @param options - An object with options + * + * @returns The new date with the local week set + * + * @example + * // Set the 1st week to 2 January 2005 with default options: + * const result = setWeek(new Date(2005, 0, 2), 1) + * //=> Sun Dec 26 2004 00:00:00 + * + * @example + * // Set the 1st week to 2 January 2005, + * // if Monday is the first day of the week, + * // and the first week of the year always contains 4 January: + * const result = setWeek(new Date(2005, 0, 2), 1, { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> Sun Jan 4 2004 00:00:00 + */ +function setWeek(date, week, options) { + const date_ = (0, _index2.toDate)(date, options?.in); + const diff = (0, _index.getWeek)(date_, options) - week; + date_.setDate(date_.getDate() - diff * 7); + return (0, _index2.toDate)(date_, options?.in); +} + + +/***/ }), + +/***/ 67577: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +exports.setWeekYear = setWeekYear; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(30926); +var _index3 = __nccwpck_require__(25671); +var _index4 = __nccwpck_require__(15129); +var _index5 = __nccwpck_require__(46439); -module.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); - } -}; +/** + * The {@link setWeekYear} function options. + */ -module.exports.wrapperSymbol = Symbol("wrapper"); -module.exports.implSymbol = Symbol("impl"); +/** + * @name setWeekYear + * @category Week-Numbering Year Helpers + * @summary Set the local week-numbering year to the given date. + * + * @description + * Set the local week-numbering year to the given date, + * saving the week number and the weekday number. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param weekYear - The local week-numbering year of the new date + * @param options - An object with options + * + * @returns The new date with the local week-numbering year set + * + * @example + * // Set the local week-numbering year 2004 to 2 January 2010 with default options: + * const result = setWeekYear(new Date(2010, 0, 2), 2004) + * //=> Sat Jan 03 2004 00:00:00 + * + * @example + * // Set the local week-numbering year 2004 to 2 January 2010, + * // if Monday is the first day of week + * // and 4 January is always in the first week of the year: + * const result = setWeekYear(new Date(2010, 0, 2), 2004, { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> Sat Jan 01 2005 00:00:00 + */ +function setWeekYear(date, weekYear, options) { + const defaultOptions = (0, _index.getDefaultOptions)(); + const firstWeekContainsDate = + options?.firstWeekContainsDate ?? + options?.locale?.options?.firstWeekContainsDate ?? + defaultOptions.firstWeekContainsDate ?? + defaultOptions.locale?.options?.firstWeekContainsDate ?? + 1; -module.exports.wrapperForImpl = function (impl) { - return impl[module.exports.wrapperSymbol]; -}; + const diff = (0, _index3.differenceInCalendarDays)( + (0, _index5.toDate)(date, options?.in), + (0, _index4.startOfWeekYear)(date, options), + options, + ); -module.exports.implForWrapper = function (wrapper) { - return wrapper[module.exports.implSymbol]; -}; + const firstWeek = (0, _index2.constructFrom)(options?.in || date, 0); + firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate); + firstWeek.setHours(0, 0, 0, 0); + const date_ = (0, _index4.startOfWeekYear)(firstWeek, options); + date_.setDate(date_.getDate() + diff); + return date_; +} /***/ }), -/***/ 62940: -/***/ ((module) => { +/***/ 55756: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) +"use strict"; - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') +exports.setYear = setYear; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(46439); - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) +/** + * The {@link setYear} function options. + */ - return wrapper +/** + * @name setYear + * @category Year Helpers + * @summary Set the year to the given date. + * + * @description + * Set the year to the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param year - The year of the new date + * @param options - An object with options. + * + * @returns The new date with the year set + * + * @example + * // Set year 2013 to 1 September 2014: + * const result = setYear(new Date(2014, 8, 1), 2013) + * //=> Sun Sep 01 2013 00:00:00 + */ +function setYear(date, year, options) { + const date_ = (0, _index2.toDate)(date, options?.in); - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } + // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date + if (isNaN(+date_)) return (0, _index.constructFrom)(options?.in || date, NaN); + + date_.setFullYear(year); + return date_; +} + + +/***/ }), + +/***/ 15951: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfDay = startOfDay; +var _index = __nccwpck_require__(46439); + +/** + * The {@link startOfDay} function options. + */ + +/** + * @name startOfDay + * @category Day Helpers + * @summary Return the start of a day for the given date. + * + * @description + * Return the start of a day for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - The options + * + * @returns The start of a day + * + * @example + * // The start of a day for 2 September 2014 11:55:00: + * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 02 2014 00:00:00 + */ +function startOfDay(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setHours(0, 0, 0, 0); + return _date; +} + + +/***/ }), + +/***/ 95023: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfDecade = startOfDecade; +var _index = __nccwpck_require__(46439); + +/** + * The {@link startOfDecade} options. + */ + +/** + * @name startOfDecade + * @category Decade Helpers + * @summary Return the start of a decade for the given date. + * + * @description + * Return the start of a decade for the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of a decade + * + * @example + * // The start of a decade for 21 October 2015 00:00:00: + * const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00)) + * //=> Jan 01 2010 00:00:00 + */ +function startOfDecade(date, options) { + // TODO: Switch to more technical definition in of decades that start with 1 + // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking + // change, so it can only be done in 4.0. + const _date = (0, _index.toDate)(date, options?.in); + const year = _date.getFullYear(); + const decade = Math.floor(year / 10) * 10; + _date.setFullYear(decade, 0, 1); + _date.setHours(0, 0, 0, 0); + return _date; +} + + +/***/ }), + +/***/ 77057: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfHour = startOfHour; +var _index = __nccwpck_require__(46439); + +/** + * The {@link startOfHour} function options. + */ + +/** + * @name startOfHour + * @category Hour Helpers + * @summary Return the start of an hour for the given date. + * + * @description + * Return the start of an hour for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of an hour + * + * @example + * // The start of an hour for 2 September 2014 11:55:00: + * const result = startOfHour(new Date(2014, 8, 2, 11, 55)) + * //=> Tue Sep 02 2014 11:00:00 + */ +function startOfHour(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setMinutes(0, 0, 0); + return _date; +} + + +/***/ }), + +/***/ 38516: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfISOWeek = startOfISOWeek; +var _index = __nccwpck_require__(31284); + +/** + * The {@link startOfISOWeek} function options. + */ + +/** + * @name startOfISOWeek + * @category ISO Week Helpers + * @summary Return the start of an ISO week for the given date. + * + * @description + * Return the start of an ISO week for the given date. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of an ISO week + * + * @example + * // The start of an ISO week for 2 September 2014 11:55:00: + * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Mon Sep 01 2014 00:00:00 + */ +function startOfISOWeek(date, options) { + return (0, _index.startOfWeek)(date, { ...options, weekStartsOn: 1 }); +} + + +/***/ }), + +/***/ 65437: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfISOWeekYear = startOfISOWeekYear; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(47131); +var _index3 = __nccwpck_require__(38516); + +/** + * The {@link startOfISOWeekYear} function options. + */ + +/** + * @name startOfISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Return the start of an ISO week-numbering year for the given date. + * + * @description + * Return the start of an ISO week-numbering year, + * which always starts 3 days before the year's first Thursday. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of an ISO week-numbering year + * + * @example + * // The start of an ISO week-numbering year for 2 July 2005: + * const result = startOfISOWeekYear(new Date(2005, 6, 2)) + * //=> Mon Jan 03 2005 00:00:00 + */ +function startOfISOWeekYear(date, options) { + const year = (0, _index2.getISOWeekYear)(date, options); + const fourthOfJanuary = (0, _index.constructFrom)(options?.in || date, 0); + fourthOfJanuary.setFullYear(year, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + return (0, _index3.startOfISOWeek)(fourthOfJanuary); +} + + +/***/ }), + +/***/ 17614: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfMinute = startOfMinute; +var _index = __nccwpck_require__(46439); + +/** + * The {@link startOfMinute} function options. + */ + +/** + * @name startOfMinute + * @category Minute Helpers + * @summary Return the start of a minute for the given date. + * + * @description + * Return the start of a minute for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of a minute + * + * @example + * // The start of a minute for 1 December 2014 22:15:45.400: + * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:00 + */ +function startOfMinute(date, options) { + const date_ = (0, _index.toDate)(date, options?.in); + date_.setSeconds(0, 0); + return date_; +} + + +/***/ }), + +/***/ 22709: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfMonth = startOfMonth; +var _index = __nccwpck_require__(46439); + +/** + * The {@link startOfMonth} function options. + */ + +/** + * @name startOfMonth + * @category Month Helpers + * @summary Return the start of a month for the given date. + * + * @description + * Return the start of a month for the given date. The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, + * or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of a month + * + * @example + * // The start of a month for 2 September 2014 11:55:00: + * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Mon Sep 01 2014 00:00:00 + */ +function startOfMonth(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + _date.setDate(1); + _date.setHours(0, 0, 0, 0); + return _date; +} + + +/***/ }), + +/***/ 77136: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfQuarter = startOfQuarter; +var _index = __nccwpck_require__(46439); + +/** + * The {@link startOfQuarter} function options. + */ + +/** + * @name startOfQuarter + * @category Quarter Helpers + * @summary Return the start of a year quarter for the given date. + * + * @description + * Return the start of a year quarter for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - The options + * + * @returns The start of a quarter + * + * @example + * // The start of a quarter for 2 September 2014 11:55:00: + * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Jul 01 2014 00:00:00 + */ +function startOfQuarter(date, options) { + const _date = (0, _index.toDate)(date, options?.in); + const currentMonth = _date.getMonth(); + const month = currentMonth - (currentMonth % 3); + _date.setMonth(month, 1); + _date.setHours(0, 0, 0, 0); + return _date; +} + + +/***/ }), + +/***/ 14147: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.startOfSecond = startOfSecond; +var _index = __nccwpck_require__(46439); + +/** + * The {@link startOfSecond} function options. + */ + +/** + * @name startOfSecond + * @category Second Helpers + * @summary Return the start of a second for the given date. + * + * @description + * Return the start of a second for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - The options + * + * @returns The start of a second + * + * @example + * // The start of a second for 1 December 2014 22:15:45.400: + * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:45.000 + */ +function startOfSecond(date, options) { + const date_ = (0, _index.toDate)(date, options?.in); + date_.setMilliseconds(0); + return date_; } /***/ }), -/***/ 22877: -/***/ ((module) => { +/***/ 62398: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -module.exports = eval("require")("encoding"); +"use strict"; +exports.startOfToday = startOfToday; +var _index = __nccwpck_require__(15951); -/***/ }), +/** + * The {@link startOfToday} function options. + */ -/***/ 39491: -/***/ ((module) => { +/** + * @name startOfToday + * @category Day Helpers + * @summary Return the start of today. + * @pure false + * + * @description + * Return the start of today. + * + * @typeParam ContextDate - The `Date` type of the context function. + * + * @param options - An object with options + * + * @returns The start of today + * + * @example + * // If today is 6 October 2014: + * const result = startOfToday() + * //=> Mon Oct 6 2014 00:00:00 + */ +function startOfToday(options) { + return (0, _index.startOfDay)(Date.now(), options); +} -"use strict"; -module.exports = require("assert"); /***/ }), -/***/ 50852: -/***/ ((module) => { +/***/ 15324: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("async_hooks"); - -/***/ }), -/***/ 14300: -/***/ ((module) => { +exports.startOfTomorrow = startOfTomorrow; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(18087); -"use strict"; -module.exports = require("buffer"); +/** + * The {@link startOfTomorrow} function options. + */ -/***/ }), +/** + * @name startOfTomorrow + * @category Day Helpers + * @summary Return the start of tomorrow. + * @pure false + * + * @typeParam ContextDate - The `Date` type of the context function. + * + * @param options - An object with options + * + * @returns The start of tomorrow + * + * @description + * Return the start of tomorrow. + * + * @example + * // If today is 6 October 2014: + * const result = startOfTomorrow() + * //=> Tue Oct 7 2014 00:00:00 + */ +function startOfTomorrow(options) { + const now = (0, _index2.constructNow)(options?.in); + const year = now.getFullYear(); + const month = now.getMonth(); + const day = now.getDate(); -/***/ 32081: -/***/ ((module) => { + const date = (0, _index.constructFrom)(options?.in, 0); + date.setFullYear(year, month, day + 1); + date.setHours(0, 0, 0, 0); + return date; +} -"use strict"; -module.exports = require("child_process"); /***/ }), -/***/ 96206: -/***/ ((module) => { +/***/ 31284: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("console"); -/***/ }), +exports.startOfWeek = startOfWeek; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(46439); -/***/ 22057: -/***/ ((module) => { +/** + * The {@link startOfWeek} function options. + */ -"use strict"; -module.exports = require("constants"); +/** + * @name startOfWeek + * @category Week Helpers + * @summary Return the start of a week for the given date. + * + * @description + * Return the start of a week for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of a week + * + * @example + * // The start of a week for 2 September 2014 11:55:00: + * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sun Aug 31 2014 00:00:00 + * + * @example + * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00: + * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) + * //=> Mon Sep 01 2014 00:00:00 + */ +function startOfWeek(date, options) { + const defaultOptions = (0, _index.getDefaultOptions)(); + const weekStartsOn = + options?.weekStartsOn ?? + options?.locale?.options?.weekStartsOn ?? + defaultOptions.weekStartsOn ?? + defaultOptions.locale?.options?.weekStartsOn ?? + 0; -/***/ }), + const _date = (0, _index2.toDate)(date, options?.in); + const day = _date.getDay(); + const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; -/***/ 6113: -/***/ ((module) => { + _date.setDate(_date.getDate() - diff); + _date.setHours(0, 0, 0, 0); + return _date; +} -"use strict"; -module.exports = require("crypto"); /***/ }), -/***/ 67643: -/***/ ((module) => { +/***/ 15129: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("diagnostics_channel"); - -/***/ }), -/***/ 17578: -/***/ ((module) => { +exports.startOfWeekYear = startOfWeekYear; +var _index = __nccwpck_require__(35586); +var _index2 = __nccwpck_require__(30926); +var _index3 = __nccwpck_require__(19116); +var _index4 = __nccwpck_require__(31284); -"use strict"; -module.exports = require("dns"); +/** + * The {@link startOfWeekYear} function options. + */ -/***/ }), +/** + * @name startOfWeekYear + * @category Week-Numbering Year Helpers + * @summary Return the start of a local week-numbering year for the given date. + * + * @description + * Return the start of a local week-numbering year. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system + * + * @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). + * @typeParam ResultDate - The result `Date` type. + * + * @param date - The original date + * @param options - An object with options + * + * @returns The start of a week-numbering year + * + * @example + * // The start of an a week-numbering year for 2 July 2005 with default settings: + * const result = startOfWeekYear(new Date(2005, 6, 2)) + * //=> Sun Dec 26 2004 00:00:00 + * + * @example + * // The start of a week-numbering year for 2 July 2005 + * // if Monday is the first day of week + * // and 4 January is always in the first week of the year: + * const result = startOfWeekYear(new Date(2005, 6, 2), { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> Mon Jan 03 2005 00:00:00 + */ +function startOfWeekYear(date, options) { + const defaultOptions = (0, _index.getDefaultOptions)(); + const firstWeekContainsDate = + options?.firstWeekContainsDate ?? + options?.locale?.options?.firstWeekContainsDate ?? + defaultOptions.firstWeekContainsDate ?? + defaultOptions.locale?.options?.firstWeekContainsDate ?? + 1; -/***/ 82361: -/***/ ((module) => { + const year = (0, _index3.getWeekYear)(date, options); + const firstWeek = (0, _index2.constructFrom)(options?.in || date, 0); + firstWeek.setFullYear(year, 0, firstWeekContainsDate); + firstWeek.setHours(0, 0, 0, 0); + const _date = (0, _index4.startOfWeek)(firstWeek, options); + return _date; +} -"use strict"; -module.exports = require("events"); /***/ }), -/***/ 57147: -/***/ ((module) => { +/***/ 68537: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("fs"); - -/***/ }), -/***/ 13685: -/***/ ((module) => { - -"use strict"; -module.exports = require("http"); +exports.startOfYear = startOfYear; +var _index = __nccwpck_require__(46439); -/***/ }), +/** + * The {@link startOfYear} function options. + */ -/***/ 85158: -/***/ ((module) => { +/** + * @name startOfYear + * @category Year Helpers + * @summary Return the start of a year for the given date. + * + * @description + * Return the start of a year for the given date. + * The result will be in the local timezone. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The original date + * @param options - The options + * + * @returns The start of a year + * + * @example + * // The start of a year for 2 September 2014 11:55:00: + * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) + * //=> Wed Jan 01 2014 00:00:00 + */ +function startOfYear(date, options) { + const date_ = (0, _index.toDate)(date, options?.in); + date_.setFullYear(date_.getFullYear(), 0, 1); + date_.setHours(0, 0, 0, 0); + return date_; +} -"use strict"; -module.exports = require("http2"); /***/ }), -/***/ 95687: -/***/ ((module) => { +/***/ 74682: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("https"); - -/***/ }), -/***/ 41808: -/***/ ((module) => { +exports.startOfYesterday = startOfYesterday; +var _index = __nccwpck_require__(18087); -"use strict"; -module.exports = require("net"); +/** + * The {@link startOfYesterday} function options. + */ -/***/ }), +/** + * @name startOfYesterday + * @category Day Helpers + * @summary Return the start of yesterday. + * @pure false + * + * @typeParam ContextDate - The `Date` type of the context function. + * + * @param options - An object with options + * + * @description + * Return the start of yesterday. + * + * @returns The start of yesterday + * + * @example + * // If today is 6 October 2014: + * const result = startOfYesterday() + * //=> Sun Oct 5 2014 00:00:00 + */ +function startOfYesterday(options) { + const now = (0, _index.constructNow)(options?.in); + const year = now.getFullYear(); + const month = now.getMonth(); + const day = now.getDate(); -/***/ 15673: -/***/ ((module) => { + const date = (0, _index.constructNow)(options?.in); + date.setFullYear(year, month, day - 1); + date.setHours(0, 0, 0, 0); + return date; +} -"use strict"; -module.exports = require("node:events"); /***/ }), -/***/ 84492: -/***/ ((module) => { +/***/ 60268: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("node:stream"); - -/***/ }), - -/***/ 47261: -/***/ ((module) => { -"use strict"; -module.exports = require("node:util"); +exports.sub = sub; +var _index = __nccwpck_require__(30926); +var _index2 = __nccwpck_require__(24345); +var _index3 = __nccwpck_require__(47784); -/***/ }), +/** + * The {@link sub} function options. + */ -/***/ 22037: -/***/ ((module) => { +/** + * @name sub + * @category Common Helpers + * @summary Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. + * + * @description + * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be subtracted + * @param options - An object with options + * + * | Key | Description | + * |---------|------------------------------------| + * | years | Amount of years to be subtracted | + * | months | Amount of months to be subtracted | + * | weeks | Amount of weeks to be subtracted | + * | days | Amount of days to be subtracted | + * | hours | Amount of hours to be subtracted | + * | minutes | Amount of minutes to be subtracted | + * | seconds | Amount of seconds to be subtracted | + * + * All values default to 0 + * + * @returns The new date with the seconds subtracted + * + * @example + * // Subtract the following duration from 15 June 2017 15:29:20 + * const result = sub(new Date(2017, 5, 15, 15, 29, 20), { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }) + * //=> Mon Sep 1 2014 10:19:50 + */ +function sub(date, duration, options) { + const { + years = 0, + months = 0, + weeks = 0, + days = 0, + hours = 0, + minutes = 0, + seconds = 0, + } = duration; -"use strict"; -module.exports = require("os"); + const withoutMonths = (0, _index3.subMonths)( + date, + months + years * 12, + options, + ); + const withoutDays = (0, _index2.subDays)( + withoutMonths, + days + weeks * 7, + options, + ); -/***/ }), + const minutesToSub = minutes + hours * 60; + const secondsToSub = seconds + minutesToSub * 60; + const msToSub = secondsToSub * 1000; -/***/ 71017: -/***/ ((module) => { + return (0, _index.constructFrom)(options?.in || date, +withoutDays - msToSub); +} -"use strict"; -module.exports = require("path"); /***/ }), -/***/ 4074: -/***/ ((module) => { +/***/ 21342: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("perf_hooks"); - -/***/ }), -/***/ 85477: -/***/ ((module) => { - -"use strict"; -module.exports = require("punycode"); +exports.subBusinessDays = subBusinessDays; +var _index = __nccwpck_require__(22759); -/***/ }), +/** + * The {@link subBusinessDays} function options. + */ -/***/ 63477: -/***/ ((module) => { +/** + * @name subBusinessDays + * @category Day Helpers + * @summary Subtract the specified number of business days (mon - fri) from the given date. + * + * @description + * Subtract the specified number of business days (mon - fri) from the given date, ignoring weekends. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of business days to be subtracted. + * @param options - An object with options + * + * @returns The new date with the business days subtracted + * + * @example + * // Subtract 10 business days from 1 September 2014: + * const result = subBusinessDays(new Date(2014, 8, 1), 10) + * //=> Mon Aug 18 2014 00:00:00 (skipped weekend days) + */ +function subBusinessDays(date, amount, options) { + return (0, _index.addBusinessDays)(date, -amount, options); +} -"use strict"; -module.exports = require("querystring"); /***/ }), -/***/ 12781: -/***/ ((module) => { +/***/ 24345: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("stream"); - -/***/ }), - -/***/ 35356: -/***/ ((module) => { -"use strict"; -module.exports = require("stream/web"); +exports.subDays = subDays; +var _index = __nccwpck_require__(7412); -/***/ }), +/** + * The {@link subDays} function options. + */ -/***/ 71576: -/***/ ((module) => { +/** + * @name subDays + * @category Day Helpers + * @summary Subtract the specified number of days from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of days to be subtracted. + * @param options - An object with options + * + * @returns The new date with the days subtracted + * + * @example + * // Subtract 10 days from 1 September 2014: + * const result = subDays(new Date(2014, 8, 1), 10) + * //=> Fri Aug 22 2014 00:00:00 + */ +function subDays(date, amount, options) { + return (0, _index.addDays)(date, -amount, options); +} -"use strict"; -module.exports = require("string_decoder"); /***/ }), -/***/ 39512: -/***/ ((module) => { +/***/ 28422: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("timers"); -/***/ }), +exports.subHours = subHours; +var _index = __nccwpck_require__(67102); -/***/ 24404: -/***/ ((module) => { +/** + * The {@link subHours} function options. + */ + +/** + * @name subHours + * @category Hour Helpers + * @summary Subtract the specified number of hours from the given date. + * + * @description + * Subtract the specified number of hours from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of hours to be subtracted. + * @param options - The options + * + * @returns The new date with the hours subtracted + * + * @example + * // Subtract 2 hours from 11 July 2014 01:00:00: + * const result = subHours(new Date(2014, 6, 11, 1, 0), 2) + * //=> Thu Jul 10 2014 23:00:00 + */ +function subHours(date, amount, options) { + return (0, _index.addHours)(date, -amount, options); +} -"use strict"; -module.exports = require("tls"); /***/ }), -/***/ 76224: -/***/ ((module) => { +/***/ 42625: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("tty"); -/***/ }), +exports.subISOWeekYears = subISOWeekYears; +var _index = __nccwpck_require__(72768); -/***/ 57310: -/***/ ((module) => { +/** + * The {@link subISOWeekYears} function options. + */ + +/** + * @name subISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Subtract the specified number of ISO week-numbering years from the given date. + * + * @description + * Subtract the specified number of ISO week-numbering years from the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of ISO week-numbering years to be subtracted. + * @param options - The options + * + * @returns The new date with the ISO week-numbering years subtracted + * + * @example + * // Subtract 5 ISO week-numbering years from 1 September 2014: + * const result = subISOWeekYears(new Date(2014, 8, 1), 5) + * //=> Mon Aug 31 2009 00:00:00 + */ +function subISOWeekYears(date, amount, options) { + return (0, _index.addISOWeekYears)(date, -amount, options); +} -"use strict"; -module.exports = require("url"); /***/ }), -/***/ 73837: -/***/ ((module) => { +/***/ 36045: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("util"); -/***/ }), - -/***/ 29830: -/***/ ((module) => { - -"use strict"; -module.exports = require("util/types"); +exports.subMilliseconds = subMilliseconds; +var _index = __nccwpck_require__(80006); -/***/ }), +/** + * The {@link subMilliseconds} function options. + */ -/***/ 71267: -/***/ ((module) => { +/** + * Subtract the specified number of milliseconds from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of milliseconds to be subtracted. + * @param options - An object with options + * + * @returns The new date with the milliseconds subtracted + */ +function subMilliseconds(date, amount, options) { + return (0, _index.addMilliseconds)(date, -amount, options); +} -"use strict"; -module.exports = require("worker_threads"); /***/ }), -/***/ 59796: -/***/ ((module) => { +/***/ 61073: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -module.exports = require("zlib"); - -/***/ }), - -/***/ 32702: -/***/ ((module) => { - -const perf = - typeof performance === 'object' && - performance && - typeof performance.now === 'function' - ? performance - : Date - -const hasAbortController = typeof AbortController === 'function' -// minimal backwards-compatibility polyfill -// this doesn't have nearly all the checks and whatnot that -// actual AbortController/Signal has, but it's enough for -// our purposes, and if used properly, behaves the same. -const AC = hasAbortController - ? AbortController - : class AbortController { - constructor() { - this.signal = new AS() - } - abort(reason = new Error('This operation was aborted')) { - this.signal.reason = this.signal.reason || reason - this.signal.aborted = true - this.signal.dispatchEvent({ - type: 'abort', - target: this.signal, - }) - } - } +exports.subMinutes = subMinutes; +var _index = __nccwpck_require__(85223); -const hasAbortSignal = typeof AbortSignal === 'function' -// Some polyfills put this on the AC class, not global -const hasACAbortSignal = typeof AC.AbortSignal === 'function' -const AS = hasAbortSignal - ? AbortSignal - : hasACAbortSignal - ? AC.AbortController - : class AbortSignal { - constructor() { - this.reason = undefined - this.aborted = false - this._listeners = [] - } - dispatchEvent(e) { - if (e.type === 'abort') { - this.aborted = true - this.onabort(e) - this._listeners.forEach(f => f(e), this) - } - } - onabort() {} - addEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners.push(fn) - } - } - removeEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners = this._listeners.filter(f => f !== fn) - } - } - } +/** + * The {@link subMinutes} function options. + */ -const warned = new Set() -const deprecatedOption = (opt, instead) => { - const code = `LRU_CACHE_OPTION_${opt}` - if (shouldWarn(code)) { - warn(code, `${opt} option`, `options.${instead}`, LRUCache) - } -} -const deprecatedMethod = (method, instead) => { - const code = `LRU_CACHE_METHOD_${method}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, method) - warn(code, `${method} method`, `cache.${instead}()`, get) - } -} -const deprecatedProperty = (field, instead) => { - const code = `LRU_CACHE_PROPERTY_${field}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, field) - warn(code, `${field} property`, `cache.${instead}`, get) - } +/** + * @name subMinutes + * @category Minute Helpers + * @summary Subtract the specified number of minutes from the given date. + * + * @description + * Subtract the specified number of minutes from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of minutes to be subtracted. + * @param options - An object with options + * + * @returns The new date with the minutes subtracted + * + * @example + * // Subtract 30 minutes from 10 July 2014 12:00:00: + * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 11:30:00 + */ +function subMinutes(date, amount, options) { + return (0, _index.addMinutes)(date, -amount, options); } -const emitWarning = (...a) => { - typeof process === 'object' && - process && - typeof process.emitWarning === 'function' - ? process.emitWarning(...a) - : console.error(...a) -} -const shouldWarn = code => !warned.has(code) +/***/ }), -const warn = (code, what, instead, fn) => { - warned.add(code) - const msg = `The ${what} is deprecated. Please use ${instead} instead.` - emitWarning(msg, 'DeprecationWarning', code, fn) -} +/***/ 47784: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) +"use strict"; -/* istanbul ignore next - This is a little bit ridiculous, tbh. - * The maximum array length is 2^32-1 or thereabouts on most JS impls. - * And well before that point, you're caching the entire world, I mean, - * that's ~32GB of just integers for the next/prev links, plus whatever - * else to hold that many keys and values. Just filling the memory with - * zeroes at init time is brutal when you get that big. - * But why not be complete? - * Maybe in the future, these limits will have expanded. */ -const getUintArray = max => - !isPosInt(max) - ? null - : max <= Math.pow(2, 8) - ? Uint8Array - : max <= Math.pow(2, 16) - ? Uint16Array - : max <= Math.pow(2, 32) - ? Uint32Array - : max <= Number.MAX_SAFE_INTEGER - ? ZeroArray - : null +exports.subMonths = subMonths; +var _index = __nccwpck_require__(69793); -class ZeroArray extends Array { - constructor(size) { - super(size) - this.fill(0) - } -} +/** + * The subMonths function options. + */ -class Stack { - constructor(max) { - if (max === 0) { - return [] - } - const UintArray = getUintArray(max) - this.heap = new UintArray(max) - this.length = 0 - } - push(n) { - this.heap[this.length++] = n - } - pop() { - return this.heap[--this.length] - } +/** + * @name subMonths + * @category Month Helpers + * @summary Subtract the specified number of months from the given date. + * + * @description + * Subtract the specified number of months from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of months to be subtracted. + * @param options - An object with options + * + * @returns The new date with the months subtracted + * + * @example + * // Subtract 5 months from 1 February 2015: + * const result = subMonths(new Date(2015, 1, 1), 5) + * //=> Mon Sep 01 2014 00:00:00 + */ +function subMonths(date, amount, options) { + return (0, _index.addMonths)(date, -amount, options); } -class LRUCache { - constructor(options = {}) { - const { - max = 0, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - updateAgeOnHas, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize = 0, - maxEntrySize = 0, - sizeCalculation, - fetchMethod, - fetchContext, - noDeleteOnFetchRejection, - noDeleteOnStaleGet, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - } = options - - // deprecated options, don't trigger a warning for getting them if - // the thing being passed in is another LRUCache we're copying. - const { length, maxAge, stale } = - options instanceof LRUCache ? {} : options - - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer') - } - - const UintArray = max ? getUintArray(max) : Array - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize - this.maxEntrySize = maxEntrySize || this.maxSize - this.sizeCalculation = sizeCalculation || length - if (this.sizeCalculation) { - if (!this.maxSize && !this.maxEntrySize) { - throw new TypeError( - 'cannot set sizeCalculation without setting maxSize or maxEntrySize' - ) - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function') - } - } - - this.fetchMethod = fetchMethod || null - if (this.fetchMethod && typeof this.fetchMethod !== 'function') { - throw new TypeError( - 'fetchMethod must be a function if specified' - ) - } - this.fetchContext = fetchContext - if (!this.fetchMethod && fetchContext !== undefined) { - throw new TypeError( - 'cannot set fetchContext without fetchMethod' - ) - } +/***/ }), - this.keyMap = new Map() - this.keyList = new Array(max).fill(null) - this.valList = new Array(max).fill(null) - this.next = new UintArray(max) - this.prev = new UintArray(max) - this.head = 0 - this.tail = 0 - this.free = new Stack(max) - this.initialFill = 1 - this.size = 0 +/***/ 98720: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (typeof dispose === 'function') { - this.dispose = dispose - } - if (typeof disposeAfter === 'function') { - this.disposeAfter = disposeAfter - this.disposed = [] - } else { - this.disposeAfter = null - this.disposed = null - } - this.noDisposeOnSet = !!noDisposeOnSet - this.noUpdateTTL = !!noUpdateTTL - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort - this.ignoreFetchAbort = !!ignoreFetchAbort +"use strict"; - // NB: maxEntrySize is set to maxSize if it's set - if (this.maxEntrySize !== 0) { - if (this.maxSize !== 0) { - if (!isPosInt(this.maxSize)) { - throw new TypeError( - 'maxSize must be a positive integer if specified' - ) - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError( - 'maxEntrySize must be a positive integer if specified' - ) - } - this.initializeSizeTracking() - } +exports.subQuarters = subQuarters; +var _index = __nccwpck_require__(54916); - this.allowStale = !!allowStale || !!stale - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet - this.updateAgeOnGet = !!updateAgeOnGet - this.updateAgeOnHas = !!updateAgeOnHas - this.ttlResolution = - isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution - : 1 - this.ttlAutopurge = !!ttlAutopurge - this.ttl = ttl || maxAge || 0 - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError( - 'ttl must be a positive integer if specified' - ) - } - this.initializeTTLTracking() - } +/** + * The {@link subQuarters} function options. + */ - // do not allow completely unbounded caches - if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { - throw new TypeError( - 'At least one of max, maxSize, or ttl is required' - ) - } - if (!this.ttlAutopurge && !this.max && !this.maxSize) { - const code = 'LRU_CACHE_UNBOUNDED' - if (shouldWarn(code)) { - warned.add(code) - const msg = - 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.' - emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) - } - } +/** + * @name subQuarters + * @category Quarter Helpers + * @summary Subtract the specified number of year quarters from the given date. + * + * @description + * Subtract the specified number of year quarters from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of quarters to be subtracted. + * @param options - An object with options + * + * @returns The new date with the quarters subtracted + * + * @example + * // Subtract 3 quarters from 1 September 2014: + * const result = subQuarters(new Date(2014, 8, 1), 3) + * //=> Sun Dec 01 2013 00:00:00 + */ +function subQuarters(date, amount, options) { + return (0, _index.addQuarters)(date, -amount, options); +} - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - getRemainingTTL(key) { - return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 - } +/***/ }), - initializeTTLTracking() { - this.ttls = new ZeroArray(this.max) - this.starts = new ZeroArray(this.max) +/***/ 88246: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - this.setItemTTL = (index, ttl, start = perf.now()) => { - this.starts[index] = ttl !== 0 ? start : 0 - this.ttls[index] = ttl - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.isStale(index)) { - this.delete(this.keyList[index]) - } - }, ttl + 1) - /* istanbul ignore else - unref() not supported on all platforms */ - if (t.unref) { - t.unref() - } - } - } +"use strict"; - this.updateItemAge = index => { - this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 - } +exports.subSeconds = subSeconds; +var _index = __nccwpck_require__(97900); - this.statusTTL = (status, index) => { - if (status) { - status.ttl = this.ttls[index] - status.start = this.starts[index] - status.now = cachedNow || getNow() - status.remainingTTL = status.now + status.ttl - status.start - } - } +/** + * The {@link subSeconds} function options. + */ - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0 - const getNow = () => { - const n = perf.now() - if (this.ttlResolution > 0) { - cachedNow = n - const t = setTimeout( - () => (cachedNow = 0), - this.ttlResolution - ) - /* istanbul ignore else - not available on all platforms */ - if (t.unref) { - t.unref() - } - } - return n - } +/** + * Subtract the specified number of seconds from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of seconds to be subtracted. + * @param options - The options + * + * @returns The new date with the seconds subtracted + * + * @example + * // Subtract 30 seconds from 10 July 2014 12:45:00: + * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) + * //=> Thu Jul 10 2014 12:44:30 + */ +function subSeconds(date, amount, options) { + return (0, _index.addSeconds)(date, -amount, options); +} - this.getRemainingTTL = key => { - const index = this.keyMap.get(key) - if (index === undefined) { - return 0 - } - return this.ttls[index] === 0 || this.starts[index] === 0 - ? Infinity - : this.starts[index] + - this.ttls[index] - - (cachedNow || getNow()) - } - this.isStale = index => { - return ( - this.ttls[index] !== 0 && - this.starts[index] !== 0 && - (cachedNow || getNow()) - this.starts[index] > - this.ttls[index] - ) - } - } - updateItemAge(_index) {} - statusTTL(_status, _index) {} - setItemTTL(_index, _ttl, _start) {} - isStale(_index) { - return false - } +/***/ }), - initializeSizeTracking() { - this.calculatedSize = 0 - this.sizes = new ZeroArray(this.max) - this.removeItemSize = index => { - this.calculatedSize -= this.sizes[index] - this.sizes[index] = 0 - } - this.requireSize = (k, v, size, sizeCalculation) => { - // provisionally accept background fetches. - // actual value size will be checked when they return. - if (this.isBackgroundFetch(v)) { - return 0 - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function') - } - size = sizeCalculation(v, k) - if (!isPosInt(size)) { - throw new TypeError( - 'sizeCalculation return invalid (expect positive integer)' - ) - } - } else { - throw new TypeError( - 'invalid size value (must be positive integer). ' + - 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + - 'must be set.' - ) - } - } - return size - } - this.addItemSize = (index, size, status) => { - this.sizes[index] = size - if (this.maxSize) { - const maxSize = this.maxSize - this.sizes[index] - while (this.calculatedSize > maxSize) { - this.evict(true) - } - } - this.calculatedSize += this.sizes[index] - if (status) { - status.entrySize = size - status.totalCalculatedSize = this.calculatedSize - } - } - } - removeItemSize(_index) {} - addItemSize(_index, _size) {} - requireSize(_k, _v, size, sizeCalculation) { - if (size || sizeCalculation) { - throw new TypeError( - 'cannot set size without setting maxSize or maxEntrySize on cache' - ) - } - } +/***/ 9138: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - *indexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } else { - i = this.prev[i] - } - } - } - } +"use strict"; - *rindexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } else { - i = this.next[i] - } - } - } - } +exports.subWeeks = subWeeks; +var _index = __nccwpck_require__(67385); - isValidIndex(index) { - return ( - index !== undefined && - this.keyMap.get(this.keyList[index]) === index - ) - } +/** + * The {@link subWeeks} function options. + */ - *entries() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - *rentries() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } +/** + * @name subWeeks + * @category Week Helpers + * @summary Subtract the specified number of weeks from the given date. + * + * @description + * Subtract the specified number of weeks from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of weeks to be subtracted. + * @param options - An object with options + * + * @returns The new date with the weeks subtracted + * + * @example + * // Subtract 4 weeks from 1 September 2014: + * const result = subWeeks(new Date(2014, 8, 1), 4) + * //=> Mon Aug 04 2014 00:00:00 + */ +function subWeeks(date, amount, options) { + return (0, _index.addWeeks)(date, -amount, options); +} - *keys() { - for (const i of this.indexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - *rkeys() { - for (const i of this.rindexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - *values() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - *rvalues() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } +/***/ }), - [Symbol.iterator]() { - return this.entries() - } +/***/ 98787: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - find(fn, getOptions) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - if (fn(value, this.keyList[i], this)) { - return this.get(this.keyList[i], getOptions) - } - } - } +"use strict"; - forEach(fn, thisp = this) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } +exports.subYears = subYears; +var _index = __nccwpck_require__(30904); - rforEach(fn, thisp = this) { - for (const i of this.rindexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } +/** + * The {@link subYears} function options. + */ - get prune() { - deprecatedMethod('prune', 'purgeStale') - return this.purgeStale - } +/** + * @name subYears + * @category Year Helpers + * @summary Subtract the specified number of years from the given date. + * + * @description + * Subtract the specified number of years from the given date. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param date - The date to be changed + * @param amount - The amount of years to be subtracted. + * @param options - An object with options + * + * @returns The new date with the years subtracted + * + * @example + * // Subtract 5 years from 1 September 2014: + * const result = subYears(new Date(2014, 8, 1), 5) + * //=> Tue Sep 01 2009 00:00:00 + */ +function subYears(date, amount, options) { + return (0, _index.addYears)(date, -amount, options); +} - purgeStale() { - let deleted = false - for (const i of this.rindexes({ allowStale: true })) { - if (this.isStale(i)) { - this.delete(this.keyList[i]) - deleted = true - } - } - return deleted - } - dump() { - const arr = [] - for (const i of this.indexes({ allowStale: true })) { - const key = this.keyList[i] - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - const entry = { value } - if (this.ttls) { - entry.ttl = this.ttls[i] - // always dump the start relative to a portable timestamp - // it's ok for this to be a bit slow, it's a rare operation. - const age = perf.now() - this.starts[i] - entry.start = Math.floor(Date.now() - age) - } - if (this.sizes) { - entry.size = this.sizes[i] - } - arr.unshift([key, entry]) - } - return arr - } +/***/ }), - load(arr) { - this.clear() - for (const [key, entry] of arr) { - if (entry.start) { - // entry.start is a portable timestamp, but we may be using - // node's performance.now(), so calculate the offset. - // it's ok for this to be a bit slow, it's a rare operation. - const age = Date.now() - entry.start - entry.start = perf.now() - age - } - this.set(key, entry.value, entry) - } - } +/***/ 46439: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - dispose(_v, _k, _reason) {} +"use strict"; - set( - k, - v, - { - ttl = this.ttl, - start, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - status, - } = {} - ) { - size = this.requireSize(k, v, size, sizeCalculation) - // if the item doesn't fit, don't do anything - // NB: maxEntrySize set to maxSize by default - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = 'miss' - status.maxEntrySizeExceeded = true - } - // have to delete, in case a background fetch is there already. - // in non-async cases, this is a no-op - this.delete(k) - return this - } - let index = this.size === 0 ? undefined : this.keyMap.get(k) - if (index === undefined) { - // addition - index = this.newIndex() - this.keyList[index] = k - this.valList[index] = v - this.keyMap.set(k, index) - this.next[this.tail] = index - this.prev[index] = this.tail - this.tail = index - this.size++ - this.addItemSize(index, size, status) - if (status) { - status.set = 'add' - } - noUpdateTTL = false - } else { - // update - this.moveToTail(index) - const oldVal = this.valList[index] - if (v !== oldVal) { - if (this.isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(new Error('replaced')) - } else { - if (!noDisposeOnSet) { - this.dispose(oldVal, k, 'set') - if (this.disposeAfter) { - this.disposed.push([oldVal, k, 'set']) - } - } - } - this.removeItemSize(index) - this.valList[index] = v - this.addItemSize(index, size, status) - if (status) { - status.set = 'replace' - const oldValue = - oldVal && this.isBackgroundFetch(oldVal) - ? oldVal.__staleWhileFetching - : oldVal - if (oldValue !== undefined) status.oldValue = oldValue - } - } else if (status) { - status.set = 'update' - } - } - if (ttl !== 0 && this.ttl === 0 && !this.ttls) { - this.initializeTTLTracking() - } - if (!noUpdateTTL) { - this.setItemTTL(index, ttl, start) - } - this.statusTTL(status, index) - if (this.disposeAfter) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return this - } +exports.toDate = toDate; +var _index = __nccwpck_require__(30926); - newIndex() { - if (this.size === 0) { - return this.tail - } - if (this.size === this.max && this.max !== 0) { - return this.evict(false) - } - if (this.free.length !== 0) { - return this.free.pop() - } - // initial fill, just keep writing down the list - return this.initialFill++ - } +/** + * @name toDate + * @category Common Helpers + * @summary Convert the given argument to an instance of Date. + * + * @description + * Convert the given argument to an instance of Date. + * + * If the argument is an instance of Date, the function returns its clone. + * + * If the argument is a number, it is treated as a timestamp. + * + * If the argument is none of the above, the function returns Invalid Date. + * + * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]` + * enabling to transfer extra properties from the reference date to the new date. + * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz) + * that accept a time zone as a constructor argument. + * + * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. + * + * @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). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param argument - The value to convert + * + * @returns The parsed date in the local time zone + * + * @example + * // Clone the date: + * const result = toDate(new Date(2014, 1, 11, 11, 30, 30)) + * //=> Tue Feb 11 2014 11:30:30 + * + * @example + * // Convert the timestamp to date: + * const result = toDate(1392098430000) + * //=> Tue Feb 11 2014 11:30:30 + */ +function toDate(argument, context) { + // [TODO] Get rid of `toDate` or `constructFrom`? + return (0, _index.constructFrom)(context || argument, argument); +} - pop() { - if (this.size) { - const val = this.valList[this.head] - this.evict(true) - return val - } - } - evict(free) { - const head = this.head - const k = this.keyList[head] - const v = this.valList[head] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('evicted')) - } else { - this.dispose(v, k, 'evict') - if (this.disposeAfter) { - this.disposed.push([v, k, 'evict']) - } - } - this.removeItemSize(head) - // if we aren't about to use the index, then null these out - if (free) { - this.keyList[head] = null - this.valList[head] = null - this.free.push(head) - } - this.head = this.next[head] - this.keyMap.delete(k) - this.size-- - return head - } +/***/ }), - has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - if (!this.isStale(index)) { - if (updateAgeOnHas) { - this.updateItemAge(index) - } - if (status) status.has = 'hit' - this.statusTTL(status, index) - return true - } else if (status) { - status.has = 'stale' - this.statusTTL(status, index) - } - } else if (status) { - status.has = 'miss' - } - return false - } +/***/ 37288: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.transpose = transpose; +var _index = __nccwpck_require__(30926); + +/** + * @name transpose + * @category Generic Helpers + * @summary Transpose the date to the given constructor. + * + * @description + * The function transposes the date to the given constructor. It helps you + * to transpose the date in the system time zone to say `UTCDate` or any other + * date extension. + * + * @typeParam InputDate - The input `Date` type derived from the passed argument. + * @typeParam ResultDate - The result `Date` type derived from the passed constructor. + * + * @param date - The date to use values from + * @param constructor - The date constructor to use + * + * @returns Date transposed to the given constructor + * + * @example + * // Create July 10, 2022 00:00 in locale time zone + * const date = new Date(2022, 6, 10) + * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)' + * + * @example + * // Transpose the date to July 10, 2022 00:00 in UTC + * transpose(date, UTCDate) + * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)' + */ +function transpose(date, constructor) { + const date_ = isConstructor(constructor) + ? new constructor(0) + : (0, _index.constructFrom)(constructor, 0); + date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); + date_.setHours( + date.getHours(), + date.getMinutes(), + date.getSeconds(), + date.getMilliseconds(), + ); + return date_; +} - // like get(), but without any LRU updating or TTL expiration - peek(k, { allowStale = this.allowStale } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined && (allowStale || !this.isStale(index))) { - const v = this.valList[index] - // either stale and allowed, or forcing a refresh of non-stale value - return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v - } - } +function isConstructor(constructor) { + return ( + typeof constructor === "function" && + constructor.prototype?.constructor === constructor + ); +} - backgroundFetch(k, index, options, context) { - const v = index === undefined ? undefined : this.valList[index] - if (this.isBackgroundFetch(v)) { - return v - } - const ac = new AC() - if (options.signal) { - options.signal.addEventListener('abort', () => - ac.abort(options.signal.reason) - ) - } - const fetchOpts = { - signal: ac.signal, - options, - context, - } - const cb = (v, updateCache = false) => { - const { aborted } = ac.signal - const ignoreAbort = options.ignoreFetchAbort && v !== undefined - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true - options.status.fetchError = ac.signal.reason - if (ignoreAbort) options.status.fetchAbortIgnored = true - } else { - options.status.fetchResolved = true - } - } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason) - } - // either we didn't abort, and are still here, or we did, and ignored - if (this.valList[index] === p) { - if (v === undefined) { - if (p.__staleWhileFetching) { - this.valList[index] = p.__staleWhileFetching - } else { - this.delete(k) - } - } else { - if (options.status) options.status.fetchUpdated = true - this.set(k, v, fetchOpts.options) - } - } - return v - } - const eb = er => { - if (options.status) { - options.status.fetchRejected = true - options.status.fetchError = er - } - return fetchFail(er) - } - const fetchFail = er => { - const { aborted } = ac.signal - const allowStaleAborted = - aborted && options.allowStaleOnFetchAbort - const allowStale = - allowStaleAborted || options.allowStaleOnFetchRejection - const noDelete = allowStale || options.noDeleteOnFetchRejection - if (this.valList[index] === p) { - // if we allow stale on fetch rejections, then we need to ensure that - // the stale value is not removed from the cache when the fetch fails. - const del = !noDelete || p.__staleWhileFetching === undefined - if (del) { - this.delete(k) - } else if (!allowStaleAborted) { - // still replace the *promise* with the stale value, - // since we are done with the promise at this point. - // leave it untouched if we're still waiting for an - // aborted background fetch that hasn't yet returned. - this.valList[index] = p.__staleWhileFetching - } - } - if (allowStale) { - if (options.status && p.__staleWhileFetching !== undefined) { - options.status.returnedStale = true - } - return p.__staleWhileFetching - } else if (p.__returned === p) { - throw er - } - } - const pcall = (res, rej) => { - this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) - // ignored, we go until we finish, regardless. - // defer check until we are actually aborting, - // so fetchMethod can override. - ac.signal.addEventListener('abort', () => { - if ( - !options.ignoreFetchAbort || - options.allowStaleOnFetchAbort - ) { - res() - // when it eventually resolves, update the cache. - if (options.allowStaleOnFetchAbort) { - res = v => cb(v, true) - } - } - }) - } - if (options.status) options.status.fetchDispatched = true - const p = new Promise(pcall).then(cb, eb) - p.__abortController = ac - p.__staleWhileFetching = v - p.__returned = null - if (index === undefined) { - // internal, don't expose status. - this.set(k, p, { ...fetchOpts.options, status: undefined }) - index = this.keyMap.get(k) - } else { - this.valList[index] = p - } - return p - } - isBackgroundFetch(p) { - return ( - p && - typeof p === 'object' && - typeof p.then === 'function' && - Object.prototype.hasOwnProperty.call( - p, - '__staleWhileFetching' - ) && - Object.prototype.hasOwnProperty.call(p, '__returned') && - (p.__returned === p || p.__returned === null) - ) - } +/***/ }), - // this takes the union of get() and set() opts, because it does both - async fetch( - k, - { - // get options - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, - allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, - ignoreFetchAbort = this.ignoreFetchAbort, - allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, - fetchContext = this.fetchContext, - forceRefresh = false, - status, - signal, - } = {} - ) { - if (!this.fetchMethod) { - if (status) status.fetch = 'get' - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status, - }) - } +/***/ 90423: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal, - } +"use strict"; - let index = this.keyMap.get(k) - if (index === undefined) { - if (status) status.fetch = 'miss' - const p = this.backgroundFetch(k, index, options, fetchContext) - return (p.__returned = p) - } else { - // in cache, maybe already fetching - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - const stale = - allowStale && v.__staleWhileFetching !== undefined - if (status) { - status.fetch = 'inflight' - if (stale) status.returnedStale = true - } - return stale ? v.__staleWhileFetching : (v.__returned = v) - } +exports.weeksToDays = weeksToDays; +var _index = __nccwpck_require__(64278); - // if we force a refresh, that means do NOT serve the cached value, - // unless we are already in the process of refreshing the cache. - const isStale = this.isStale(index) - if (!forceRefresh && !isStale) { - if (status) status.fetch = 'hit' - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - this.statusTTL(status, index) - return v - } +/** + * @name weeksToDays + * @category Conversion Helpers + * @summary Convert weeks to days. + * + * @description + * Convert a number of weeks to a full number of days. + * + * @param weeks - The number of weeks to be converted + * + * @returns The number of weeks converted in days + * + * @example + * // Convert 2 weeks into days + * const result = weeksToDays(2) + * //=> 14 + */ +function weeksToDays(weeks) { + return Math.trunc(weeks * _index.daysInWeek); +} - // ok, it is stale or a forced refresh, and not already fetching. - // refresh the cache. - const p = this.backgroundFetch(k, index, options, fetchContext) - const hasStale = p.__staleWhileFetching !== undefined - const staleVal = hasStale && allowStale - if (status) { - status.fetch = hasStale && isStale ? 'stale' : 'refresh' - if (staleVal && isStale) status.returnedStale = true - } - return staleVal ? p.__staleWhileFetching : (p.__returned = p) - } - } - get( - k, - { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - status, - } = {} - ) { - const index = this.keyMap.get(k) - if (index !== undefined) { - const value = this.valList[index] - const fetching = this.isBackgroundFetch(value) - this.statusTTL(status, index) - if (this.isStale(index)) { - if (status) status.get = 'stale' - // delete only if not an in-flight background fetch - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k) - } - if (status) status.returnedStale = allowStale - return allowStale ? value : undefined - } else { - if (status) { - status.returnedStale = - allowStale && value.__staleWhileFetching !== undefined - } - return allowStale ? value.__staleWhileFetching : undefined - } - } else { - if (status) status.get = 'hit' - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching. - // If it's not stale, and fetching, AND has a __staleWhileFetching - // value, then that means the user fetched with {forceRefresh:true}, - // so it's safe to return that value. - if (fetching) { - return value.__staleWhileFetching - } - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return value - } - } else if (status) { - status.get = 'miss' - } - } +/***/ }), - connect(p, n) { - this.prev[n] = p - this.next[p] = n - } +/***/ 79813: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - moveToTail(index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.tail) { - if (index === this.head) { - this.head = this.next[index] - } else { - this.connect(this.prev[index], this.next[index]) - } - this.connect(this.tail, index) - this.tail = index - } - } +"use strict"; - get del() { - deprecatedMethod('del', 'delete') - return this.delete - } +exports.yearsToDays = yearsToDays; +var _index = __nccwpck_require__(64278); - delete(k) { - let deleted = false - if (this.size !== 0) { - const index = this.keyMap.get(k) - if (index !== undefined) { - deleted = true - if (this.size === 1) { - this.clear() - } else { - this.removeItemSize(index) - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - this.keyMap.delete(k) - this.keyList[index] = null - this.valList[index] = null - if (index === this.tail) { - this.tail = this.prev[index] - } else if (index === this.head) { - this.head = this.next[index] - } else { - this.next[this.prev[index]] = this.next[index] - this.prev[this.next[index]] = this.prev[index] - } - this.size-- - this.free.push(index) - } - } - } - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return deleted - } +/** + * @name yearsToDays + * @category Conversion Helpers + * @summary Convert years to days. + * + * @description + * Convert a number of years to a full number of days. + * + * @param years - The number of years to be converted + * + * @returns The number of years converted in days + * + * @example + * // Convert 2 years into days + * const result = yearsToDays(2) + * //=> 730 + */ +function yearsToDays(years) { + return Math.trunc(years * _index.daysInYear); +} - clear() { - for (const index of this.rindexes({ allowStale: true })) { - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - const k = this.keyList[index] - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - } - this.keyMap.clear() - this.valList.fill(null) - this.keyList.fill(null) - if (this.ttls) { - this.ttls.fill(0) - this.starts.fill(0) - } - if (this.sizes) { - this.sizes.fill(0) - } - this.head = 0 - this.tail = 0 - this.initialFill = 1 - this.free.length = 0 - this.calculatedSize = 0 - this.size = 0 - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - } +/***/ }), - get reset() { - deprecatedMethod('reset', 'clear') - return this.clear - } +/***/ 94171: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - get length() { - deprecatedProperty('length', 'size') - return this.size - } +"use strict"; - static get AbortController() { - return AC - } - static get AbortSignal() { - return AS - } +exports.yearsToMonths = yearsToMonths; +var _index = __nccwpck_require__(64278); + +/** + * @name yearsToMonths + * @category Conversion Helpers + * @summary Convert years to months. + * + * @description + * Convert a number of years to a full number of months. + * + * @param years - The number of years to be converted + * + * @returns The number of years converted in months + * + * @example + * // Convert 2 years into months + * const result = yearsToMonths(2) + * //=> 24 + */ +function yearsToMonths(years) { + return Math.trunc(years * _index.monthsInYear); } -module.exports = LRUCache + +/***/ }), + +/***/ 90211: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.yearsToQuarters = yearsToQuarters; +var _index = __nccwpck_require__(64278); + +/** + * @name yearsToQuarters + * @category Conversion Helpers + * @summary Convert years to quarters. + * + * @description + * Convert a number of years to a full number of quarters. + * + * @param years - The number of years to be converted + * + * @returns The number of years converted in quarters + * + * @example + * // Convert 2 years to quarters + * const result = yearsToQuarters(2) + * //=> 8 + */ +function yearsToQuarters(years) { + return Math.trunc(years * _index.quartersInYear); +} /***/ }),