{"version":3,"file":"chunk-api-CR1r4R-8.js","sources":["../../../node_modules/luxon/src/errors.js","../../../node_modules/luxon/src/impl/formats.js","../../../node_modules/luxon/src/zone.js","../../../node_modules/luxon/src/zones/systemZone.js","../../../node_modules/luxon/src/zones/IANAZone.js","../../../node_modules/luxon/src/impl/locale.js","../../../node_modules/luxon/src/zones/fixedOffsetZone.js","../../../node_modules/luxon/src/zones/invalidZone.js","../../../node_modules/luxon/src/impl/zoneUtil.js","../../../node_modules/luxon/src/impl/digits.js","../../../node_modules/luxon/src/settings.js","../../../node_modules/luxon/src/impl/invalid.js","../../../node_modules/luxon/src/impl/conversions.js","../../../node_modules/luxon/src/impl/util.js","../../../node_modules/luxon/src/impl/english.js","../../../node_modules/luxon/src/impl/formatter.js","../../../node_modules/luxon/src/impl/regexParser.js","../../../node_modules/luxon/src/duration.js","../../../node_modules/luxon/src/interval.js","../../../node_modules/luxon/src/info.js","../../../node_modules/luxon/src/impl/diff.js","../../../node_modules/luxon/src/impl/tokenParser.js","../../../node_modules/luxon/src/datetime.js","../../../node_modules/redux/dist/redux.mjs","../../../node_modules/immer/dist/immer.mjs","../../../node_modules/reselect/dist/reselect.mjs","../../../node_modules/redux-thunk/dist/redux-thunk.mjs","../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs","../../../app/frontend/features/MobileDrawerContent/mobileDrawerContentSlice.ts","../../../app/frontend/features/Cohort/cohortSlice.ts","../../../app/frontend/features/Dashboard/dashboardSlice.ts","../../../app/frontend/features/ModalWithState/modalWithStateSlice.ts","../../../app/frontend/features/Program/utils.ts","../../../app/frontend/features/Program/programSlice.ts"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nlet digitRegexCache = {};\nexport function resetDigitRegexCache() {\n digitRegexCache = {};\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n if (!digitRegexCache[ns]) {\n digitRegexCache[ns] = {};\n }\n if (!digitRegexCache[ns][append]) {\n digitRegexCache[ns][append] = new RegExp(`${numberingSystems[ns]}${append}`);\n }\n\n return digitRegexCache[ns][append];\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\nfunction guessOffsetForZone(zone) {\n if (!zoneOffsetGuessCache[zone]) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n zoneOffsetGuessCache[zone] = zone.offset(zoneOffsetTs);\n }\n return zoneOffsetGuessCache[zone];\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nlet zoneOffsetGuessCache = {};\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache = {};\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? \"keys\" : \"key\"} \"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. Expected to find one of the known reducer keys instead: \"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : \"(unknown type)\"}, the slice reducer for key \"${key}\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","// src/utils/env.ts\nvar NOTHING = Symbol.for(\"immer-nothing\");\nvar DRAFTABLE = Symbol.for(\"immer-draftable\");\nvar DRAFT_STATE = Symbol.for(\"immer-state\");\n\n// src/utils/errors.ts\nvar errors = process.env.NODE_ENV !== \"production\" ? [\n // All error codes, starting by 0:\n function(plugin) {\n return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`;\n },\n function(thing) {\n return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;\n },\n \"This object has been frozen and should not be mutated\",\n function(data) {\n return \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + data;\n },\n \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n \"Immer forbids circular references\",\n \"The first or second argument to `produce` must be a function\",\n \"The third argument to `produce` must be a function or undefined\",\n \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n function(thing) {\n return `'current' expects a draft, got: ${thing}`;\n },\n \"Object.defineProperty() cannot be used on an Immer draft\",\n \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n \"Immer only supports deleting array indices\",\n \"Immer only supports setting array indices and the 'length' property\",\n function(thing) {\n return `'original' expects a draft, got: ${thing}`;\n }\n // Note: if more errors are added, the errorOffset in Patches.ts should be increased\n // See Patches.ts for additional errors\n] : [];\nfunction die(error, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const e = errors[error];\n const msg = typeof e === \"function\" ? e.apply(null, args) : e;\n throw new Error(`[Immer] ${msg}`);\n }\n throw new Error(\n `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n );\n}\n\n// src/utils/common.ts\nvar getPrototypeOf = Object.getPrototypeOf;\nfunction isDraft(value) {\n return !!value && !!value[DRAFT_STATE];\n}\nfunction isDraftable(value) {\n if (!value)\n return false;\n return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = Object.prototype.constructor.toString();\nfunction isPlainObject(value) {\n if (!value || typeof value !== \"object\")\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n if (Ctor === Object)\n return true;\n return typeof Ctor == \"function\" && Function.toString.call(Ctor) === objectCtorString;\n}\nfunction original(value) {\n if (!isDraft(value))\n die(15, value);\n return value[DRAFT_STATE].base_;\n}\nfunction each(obj, iter) {\n if (getArchtype(obj) === 0 /* Object */) {\n Object.entries(obj).forEach(([key, value]) => {\n iter(key, value, obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n}\nfunction getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nfunction has(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n}\nfunction get(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];\n}\nfunction set(thing, propOrOldValue, value) {\n const t = getArchtype(thing);\n if (t === 2 /* Map */)\n thing.set(propOrOldValue, value);\n else if (t === 3 /* Set */) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n}\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction isMap(target) {\n return target instanceof Map;\n}\nfunction isSet(target) {\n return target instanceof Set;\n}\nfunction latest(state) {\n return state.copy_ || state.base_;\n}\nfunction shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (Array.isArray(base))\n return Array.prototype.slice.call(base);\n if (!strict && isPlainObject(base)) {\n if (!getPrototypeOf(base)) {\n const obj = /* @__PURE__ */ Object.create(null);\n return Object.assign(obj, base);\n }\n return { ...base };\n }\n const descriptors = Object.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc.writable === false) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n configurable: true,\n writable: true,\n // could live with !!desc.set as well here...\n enumerable: desc.enumerable,\n value: base[key]\n };\n }\n return Object.create(getPrototypeOf(base), descriptors);\n}\nfunction freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections;\n }\n Object.freeze(obj);\n if (deep)\n each(obj, (_key, value) => freeze(value, true), true);\n return obj;\n}\nfunction dontMutateFrozenCollections() {\n die(2);\n}\nfunction isFrozen(obj) {\n return Object.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n}\nfunction loadPlugin(pluginKey, implementation) {\n if (!plugins[pluginKey])\n plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nfunction getCurrentScope() {\n return currentScope;\n}\nfunction createScope(parent_, immer_) {\n return {\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0\n };\n}\nfunction usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n getPlugin(\"Patches\");\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n}\nfunction revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n}\nfunction enterScope(immer2) {\n return currentScope = createScope(currentScope, immer2);\n}\nfunction revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)\n state.revoke_();\n else\n state.revoked_ = true;\n}\n\n// src/core/finalize.ts\nfunction processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n if (!scope.parent_)\n maybeFreeze(scope, result);\n }\n if (scope.patches_) {\n getPlugin(\"Patches\").generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope.patches_,\n scope.inversePatches_\n );\n }\n } else {\n result = finalize(scope, baseDraft, []);\n }\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value, path) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n each(\n value,\n (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path),\n true\n // See #590, don't recurse into non-enumerable of non drafted objects\n );\n return value;\n }\n if (state.scope_ !== rootScope)\n return value;\n if (!state.modified_) {\n maybeFreeze(rootScope, state.base_, true);\n return state.base_;\n }\n if (!state.finalized_) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n const result = state.copy_;\n let resultEach = result;\n let isSet2 = false;\n if (state.type_ === 3 /* Set */) {\n resultEach = new Set(result);\n result.clear();\n isSet2 = true;\n }\n each(\n resultEach,\n (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)\n );\n maybeFreeze(rootScope, result, false);\n if (path && rootScope.patches_) {\n getPlugin(\"Patches\").generatePatches_(\n state,\n path,\n rootScope.patches_,\n rootScope.inversePatches_\n );\n }\n }\n return state.copy_;\n}\nfunction finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n if (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n die(5);\n if (isDraft(childValue)) {\n const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.\n !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n const res = finalize(rootScope, childValue, path);\n set(targetObject, prop, res);\n if (isDraft(res)) {\n rootScope.canAutoFreeze_ = false;\n } else\n return;\n } else if (targetIsSet) {\n targetObject.add(childValue);\n }\n if (isDraftable(childValue) && !isFrozen(childValue)) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return;\n }\n finalize(rootScope, childValue);\n if (!parentState || !parentState.scope_.parent_)\n maybeFreeze(rootScope, childValue);\n }\n}\nfunction maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n const isArray = Array.isArray(base);\n const state = {\n type_: isArray ? 1 /* Array */ : 0 /* Object */,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n assigned_: {},\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false\n };\n let target = state;\n let traps = objectTraps;\n if (isArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return proxy;\n}\nvar objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n const source = latest(state);\n if (!has(source, prop)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value === peek(state.base_, prop)) {\n prepareCopy(state);\n return state.copy_[prop] = createProxy(value, state);\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_[prop] = false;\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || prop in state.copy_) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_[prop] = true;\n return true;\n },\n deleteProperty(state, prop) {\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_[prop] = false;\n prepareCopy(state);\n markChanged(state);\n } else {\n delete state.assigned_[prop];\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n writable: true,\n configurable: state.type_ !== 1 /* Array */ || prop !== \"length\",\n enumerable: desc.enumerable,\n value: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n};\nvar arrayTraps = {};\neach(objectTraps, (key, fn) => {\n arrayTraps[key] = function() {\n arguments[0] = arguments[0][0];\n return fn.apply(this, arguments);\n };\n});\narrayTraps.deleteProperty = function(state, prop) {\n if (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop)))\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n if (process.env.NODE_ENV !== \"production\" && prop !== \"length\" && isNaN(parseInt(prop)))\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n}\nfunction readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? `value` in desc ? desc.value : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n}\nfunction markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n}\nfunction prepareCopy(state) {\n if (!state.copy_) {\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n}\n\n// src/core/immerClass.ts\nvar Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n /**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\n this.produce = (base, recipe, patchListener) => {\n if (typeof base === \"function\" && typeof recipe !== \"function\") {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (typeof recipe !== \"function\")\n die(6);\n if (patchListener !== void 0 && typeof patchListener !== \"function\")\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || typeof base !== \"object\") {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (typeof base === \"function\") {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (typeof config?.autoFreeze === \"boolean\")\n this.setAutoFreeze(config.autoFreeze);\n if (typeof config?.useStrictShallowCopy === \"boolean\")\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(\"Patches\").applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n};\nfunction createProxy(value, parent) {\n const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent ? parent.scope_ : getCurrentScope();\n scope.drafts_.push(draft);\n return draft;\n}\n\n// src/core/current.ts\nfunction current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n}\nfunction currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n } else {\n copy = shallowCopy(value, true);\n }\n each(copy, (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n });\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n}\n\n// src/plugins/patches.ts\nfunction enablePatches() {\n const errorOffset = 16;\n if (process.env.NODE_ENV !== \"production\") {\n errors.push(\n 'Sets cannot have \"replace\" patches.',\n function(op) {\n return \"Unsupported patch operation: \" + op;\n },\n function(path) {\n return \"Cannot apply patch, path doesn't resolve: \" + path;\n },\n \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n );\n }\n const REPLACE = \"replace\";\n const ADD = \"add\";\n const REMOVE = \"remove\";\n function generatePatches_(state, basePath, patches, inversePatches) {\n switch (state.type_) {\n case 0 /* Object */:\n case 2 /* Map */:\n return generatePatchesFromAssigned(\n state,\n basePath,\n patches,\n inversePatches\n );\n case 1 /* Array */:\n return generateArrayPatches(state, basePath, patches, inversePatches);\n case 3 /* Set */:\n return generateSetPatches(\n state,\n basePath,\n patches,\n inversePatches\n );\n }\n }\n function generateArrayPatches(state, basePath, patches, inversePatches) {\n let { base_, assigned_ } = state;\n let copy_ = state.copy_;\n if (copy_.length < base_.length) {\n ;\n [base_, copy_] = [copy_, base_];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let i = 0; i < base_.length; i++) {\n if (assigned_[i] && copy_[i] !== base_[i]) {\n const path = basePath.concat([i]);\n patches.push({\n op: REPLACE,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n inversePatches.push({\n op: REPLACE,\n path,\n value: clonePatchValueIfNeeded(base_[i])\n });\n }\n }\n for (let i = base_.length; i < copy_.length; i++) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n }\n for (let i = copy_.length - 1; base_.length <= i; --i) {\n const path = basePath.concat([i]);\n inversePatches.push({\n op: REMOVE,\n path\n });\n }\n }\n function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n const { base_, copy_ } = state;\n each(state.assigned_, (key, assignedValue) => {\n const origValue = get(base_, key);\n const value = get(copy_, key);\n const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n if (origValue === value && op === REPLACE)\n return;\n const path = basePath.concat(key);\n patches.push(op === REMOVE ? { op, path } : { op, path, value });\n inversePatches.push(\n op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) }\n );\n });\n }\n function generateSetPatches(state, basePath, patches, inversePatches) {\n let { base_, copy_ } = state;\n let i = 0;\n base_.forEach((value) => {\n if (!copy_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: REMOVE,\n path,\n value\n });\n inversePatches.unshift({\n op: ADD,\n path,\n value\n });\n }\n i++;\n });\n i = 0;\n copy_.forEach((value) => {\n if (!base_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n value\n });\n inversePatches.unshift({\n op: REMOVE,\n path,\n value\n });\n }\n i++;\n });\n }\n function generateReplacementPatches_(baseValue, replacement, patches, inversePatches) {\n patches.push({\n op: REPLACE,\n path: [],\n value: replacement === NOTHING ? void 0 : replacement\n });\n inversePatches.push({\n op: REPLACE,\n path: [],\n value: baseValue\n });\n }\n function applyPatches_(draft, patches) {\n patches.forEach((patch) => {\n const { path, op } = patch;\n let base = draft;\n for (let i = 0; i < path.length - 1; i++) {\n const parentType = getArchtype(base);\n let p = path[i];\n if (typeof p !== \"string\" && typeof p !== \"number\") {\n p = \"\" + p;\n }\n if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === \"__proto__\" || p === \"constructor\"))\n die(errorOffset + 3);\n if (typeof base === \"function\" && p === \"prototype\")\n die(errorOffset + 3);\n base = get(base, p);\n if (typeof base !== \"object\")\n die(errorOffset + 2, path.join(\"/\"));\n }\n const type = getArchtype(base);\n const value = deepClonePatchValue(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case REPLACE:\n switch (type) {\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n die(errorOffset);\n default:\n return base[key] = value;\n }\n case ADD:\n switch (type) {\n case 1 /* Array */:\n return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n return base.add(value);\n default:\n return base[key] = value;\n }\n case REMOVE:\n switch (type) {\n case 1 /* Array */:\n return base.splice(key, 1);\n case 2 /* Map */:\n return base.delete(key);\n case 3 /* Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n die(errorOffset + 1, op);\n }\n });\n return draft;\n }\n function deepClonePatchValue(obj) {\n if (!isDraftable(obj))\n return obj;\n if (Array.isArray(obj))\n return obj.map(deepClonePatchValue);\n if (isMap(obj))\n return new Map(\n Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n );\n if (isSet(obj))\n return new Set(Array.from(obj).map(deepClonePatchValue));\n const cloned = Object.create(getPrototypeOf(obj));\n for (const key in obj)\n cloned[key] = deepClonePatchValue(obj[key]);\n if (has(obj, DRAFTABLE))\n cloned[DRAFTABLE] = obj[DRAFTABLE];\n return cloned;\n }\n function clonePatchValueIfNeeded(obj) {\n if (isDraft(obj)) {\n return deepClonePatchValue(obj);\n } else\n return obj;\n }\n loadPlugin(\"Patches\", {\n applyPatches_,\n generatePatches_,\n generateReplacementPatches_\n });\n}\n\n// src/plugins/mapset.ts\nfunction enableMapSet() {\n class DraftMap extends Map {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 2 /* Map */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n assigned_: void 0,\n base_: target,\n draft_: this,\n isManual_: false,\n revoked_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(key) {\n return latest(this[DRAFT_STATE]).has(key);\n }\n set(key, value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!latest(state).has(key) || latest(state).get(key) !== value) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_.set(key, true);\n state.copy_.set(key, value);\n state.assigned_.set(key, true);\n }\n return this;\n }\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareMapCopy(state);\n markChanged(state);\n if (state.base_.has(key)) {\n state.assigned_.set(key, false);\n } else {\n state.assigned_.delete(key);\n }\n state.copy_.delete(key);\n return true;\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_ = /* @__PURE__ */ new Map();\n each(state.base_, (key) => {\n state.assigned_.set(key, false);\n });\n state.copy_.clear();\n }\n }\n forEach(cb, thisArg) {\n const state = this[DRAFT_STATE];\n latest(state).forEach((_value, key, _map) => {\n cb.call(thisArg, this.get(key), key, this);\n });\n }\n get(key) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n const value = latest(state).get(key);\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value !== state.base_.get(key)) {\n return value;\n }\n const draft = createProxy(value, state);\n prepareMapCopy(state);\n state.copy_.set(key, draft);\n return draft;\n }\n keys() {\n return latest(this[DRAFT_STATE]).keys();\n }\n values() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value\n };\n }\n };\n }\n entries() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value: [r.value, value]\n };\n }\n };\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.entries();\n }\n }\n function proxyMap_(target, parent) {\n return new DraftMap(target, parent);\n }\n function prepareMapCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = new Map(state.base_);\n }\n }\n class DraftSet extends Set {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 3 /* Set */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n base_: target,\n draft_: this,\n drafts_: /* @__PURE__ */ new Map(),\n revoked_: false,\n isManual_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!state.copy_) {\n return state.base_.has(value);\n }\n if (state.copy_.has(value))\n return true;\n if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n return true;\n return false;\n }\n add(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!this.has(value)) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.add(value);\n }\n return this;\n }\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n markChanged(state);\n return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (\n /* istanbul ignore next */\n false\n ));\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.clear();\n }\n }\n values() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.values();\n }\n entries() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.entries();\n }\n keys() {\n return this.values();\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.values();\n }\n forEach(cb, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n cb.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n }\n }\n function proxySet_(target, parent) {\n return new DraftSet(target, parent);\n }\n function prepareSetCopy(state) {\n if (!state.copy_) {\n state.copy_ = /* @__PURE__ */ new Set();\n state.base_.forEach((value) => {\n if (isDraftable(value)) {\n const draft = createProxy(value, state);\n state.drafts_.set(value, draft);\n state.copy_.add(draft);\n } else {\n state.copy_.add(value);\n }\n });\n }\n }\n function assertUnrevoked(state) {\n if (state.revoked_)\n die(3, JSON.stringify(latest(state)));\n }\n loadPlugin(\"MapSet\", { proxyMap_, proxySet_ });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = immer.produceWithPatches.bind(\n immer\n);\nvar setAutoFreeze = immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer);\nvar applyPatches = immer.applyPatches.bind(immer);\nvar createDraft = immer.createDraft.bind(immer);\nvar finishDraft = immer.finishDraft.bind(immer);\nfunction castDraft(value) {\n return value;\n}\nfunction castImmutable(value) {\n return value;\n}\nexport {\n Immer2 as Immer,\n applyPatches,\n castDraft,\n castImmutable,\n createDraft,\n current,\n enableMapSet,\n enablePatches,\n finishDraft,\n freeze,\n DRAFTABLE as immerable,\n isDraft,\n isDraftable,\n NOTHING as nothing,\n original,\n produce,\n produceWithPatches,\n setAutoFreeze,\n setUseStrictShallowCopy\n};\n//# sourceMappingURL=immer.mjs.map","// src/devModeChecks/identityFunctionCheck.ts\nvar runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {\n if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {\n let isInputSameAsOutput = false;\n try {\n const emptyObject = {};\n if (resultFunc(emptyObject) === emptyObject)\n isInputSameAsOutput = true;\n } catch {\n }\n if (isInputSameAsOutput) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"The result function returned its own inputs without modification. e.g\\n`createSelector([state => state.todos], todos => todos)`\\nThis could lead to inefficient memoization and unnecessary re-renders.\\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.\",\n { stack }\n );\n }\n }\n};\n\n// src/devModeChecks/inputStabilityCheck.ts\nvar runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {\n const { memoize, memoizeOptions } = options;\n const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;\n const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);\n const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);\n if (!areInputSelectorResultsEqual) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"An input selector returned a different result when passed same arguments.\\nThis means your output selector will likely run more frequently than intended.\\nAvoid returning a new reference inside your input selector, e.g.\\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`\",\n {\n arguments: inputSelectorArgs,\n firstInputs: inputSelectorResults,\n secondInputs: inputSelectorResultsCopy,\n stack\n }\n );\n }\n};\n\n// src/devModeChecks/setGlobalDevModeChecks.ts\nvar globalDevModeChecks = {\n inputStabilityCheck: \"once\",\n identityFunctionCheck: \"once\"\n};\nvar setGlobalDevModeChecks = (devModeChecks) => {\n Object.assign(globalDevModeChecks, devModeChecks);\n};\n\n// src/utils.ts\nvar NOT_FOUND = \"NOT_FOUND\";\nfunction assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {\n if (typeof func !== \"function\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {\n if (typeof object !== \"object\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {\n if (!array.every((item) => typeof item === \"function\")) {\n const itemTypes = array.map(\n (item) => typeof item === \"function\" ? `function ${item.name || \"unnamed\"}()` : typeof item\n ).join(\", \");\n throw new TypeError(`${errorMessage}[${itemTypes}]`);\n }\n}\nvar ensureIsArray = (item) => {\n return Array.isArray(item) ? item : [item];\n};\nfunction getDependencies(createSelectorArgs) {\n const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n );\n return dependencies;\n}\nfunction collectInputSelectorResults(dependencies, inputSelectorArgs) {\n const inputSelectorResults = [];\n const { length } = dependencies;\n for (let i = 0; i < length; i++) {\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));\n }\n return inputSelectorResults;\n}\nvar getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n };\n return {\n identityFunctionCheck: {\n shouldRun: identityFunctionCheck === \"always\" || identityFunctionCheck === \"once\" && firstRun,\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun: inputStabilityCheck === \"always\" || inputStabilityCheck === \"once\" && firstRun,\n run: runInputStabilityCheck\n }\n };\n};\n\n// src/autotrackMemoize/autotracking.ts\nvar $REVISION = 0;\nvar CURRENT_TRACKER = null;\nvar Cell = class {\n revision = $REVISION;\n _value;\n _lastValue;\n _isEqual = tripleEq;\n constructor(initialValue, isEqual = tripleEq) {\n this._value = this._lastValue = initialValue;\n this._isEqual = isEqual;\n }\n // Whenever a storage value is read, it'll add itself to the current tracker if\n // one exists, entangling its state with that cache.\n get value() {\n CURRENT_TRACKER?.add(this);\n return this._value;\n }\n // Whenever a storage value is updated, we bump the global revision clock,\n // assign the revision for this storage to the new value, _and_ we schedule a\n // rerender. This is important, and it's what makes autotracking _pull_\n // based. We don't actively tell the caches which depend on the storage that\n // anything has happened. Instead, we recompute the caches when needed.\n set value(newValue) {\n if (this.value === newValue)\n return;\n this._value = newValue;\n this.revision = ++$REVISION;\n }\n};\nfunction tripleEq(a, b) {\n return a === b;\n}\nvar TrackingCache = class {\n _cachedValue;\n _cachedRevision = -1;\n _deps = [];\n hits = 0;\n fn;\n constructor(fn) {\n this.fn = fn;\n }\n clear() {\n this._cachedValue = void 0;\n this._cachedRevision = -1;\n this._deps = [];\n this.hits = 0;\n }\n get value() {\n if (this.revision > this._cachedRevision) {\n const { fn } = this;\n const currentTracker = /* @__PURE__ */ new Set();\n const prevTracker = CURRENT_TRACKER;\n CURRENT_TRACKER = currentTracker;\n this._cachedValue = fn();\n CURRENT_TRACKER = prevTracker;\n this.hits++;\n this._deps = Array.from(currentTracker);\n this._cachedRevision = this.revision;\n }\n CURRENT_TRACKER?.add(this);\n return this._cachedValue;\n }\n get revision() {\n return Math.max(...this._deps.map((d) => d.revision), 0);\n }\n};\nfunction getValue(cell) {\n if (!(cell instanceof Cell)) {\n console.warn(\"Not a valid cell! \", cell);\n }\n return cell.value;\n}\nfunction setValue(storage, value) {\n if (!(storage instanceof Cell)) {\n throw new TypeError(\n \"setValue must be passed a tracked store created with `createStorage`.\"\n );\n }\n storage.value = storage._lastValue = value;\n}\nfunction createCell(initialValue, isEqual = tripleEq) {\n return new Cell(initialValue, isEqual);\n}\nfunction createCache(fn) {\n assertIsFunction(\n fn,\n \"the first parameter to `createCache` must be a function\"\n );\n return new TrackingCache(fn);\n}\n\n// src/autotrackMemoize/tracking.ts\nvar neverEq = (a, b) => false;\nfunction createTag() {\n return createCell(null, neverEq);\n}\nfunction dirtyTag(tag, value) {\n setValue(tag, value);\n}\nvar consumeCollection = (node) => {\n let tag = node.collectionTag;\n if (tag === null) {\n tag = node.collectionTag = createTag();\n }\n getValue(tag);\n};\nvar dirtyCollection = (node) => {\n const tag = node.collectionTag;\n if (tag !== null) {\n dirtyTag(tag, null);\n }\n};\n\n// src/autotrackMemoize/proxy.ts\nvar REDUX_PROXY_LABEL = Symbol();\nvar nextId = 0;\nvar proto = Object.getPrototypeOf({});\nvar ObjectTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy(this, objectProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar objectProxyHandler = {\n get(node, key) {\n function calculateResult() {\n const { value } = node;\n const childValue = Reflect.get(value, key);\n if (typeof key === \"symbol\") {\n return childValue;\n }\n if (key in proto) {\n return childValue;\n }\n if (typeof childValue === \"object\" && childValue !== null) {\n let childNode = node.children[key];\n if (childNode === void 0) {\n childNode = node.children[key] = createNode(childValue);\n }\n if (childNode.tag) {\n getValue(childNode.tag);\n }\n return childNode.proxy;\n } else {\n let tag = node.tags[key];\n if (tag === void 0) {\n tag = node.tags[key] = createTag();\n tag.value = childValue;\n }\n getValue(tag);\n return childValue;\n }\n }\n const res = calculateResult();\n return res;\n },\n ownKeys(node) {\n consumeCollection(node);\n return Reflect.ownKeys(node.value);\n },\n getOwnPropertyDescriptor(node, prop) {\n return Reflect.getOwnPropertyDescriptor(node.value, prop);\n },\n has(node, prop) {\n return Reflect.has(node.value, prop);\n }\n};\nvar ArrayTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy([this], arrayProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar arrayProxyHandler = {\n get([node], key) {\n if (key === \"length\") {\n consumeCollection(node);\n }\n return objectProxyHandler.get(node, key);\n },\n ownKeys([node]) {\n return objectProxyHandler.ownKeys(node);\n },\n getOwnPropertyDescriptor([node], prop) {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop);\n },\n has([node], prop) {\n return objectProxyHandler.has(node, prop);\n }\n};\nfunction createNode(value) {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value);\n }\n return new ObjectTreeNode(value);\n}\nfunction updateNode(node, newValue) {\n const { value, tags, children } = node;\n node.value = newValue;\n if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {\n dirtyCollection(node);\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0;\n let newKeysSize = 0;\n let anyKeysAdded = false;\n for (const _key in value) {\n oldKeysSize++;\n }\n for (const key in newValue) {\n newKeysSize++;\n if (!(key in value)) {\n anyKeysAdded = true;\n break;\n }\n }\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;\n if (isDifferent) {\n dirtyCollection(node);\n }\n }\n }\n for (const key in tags) {\n const childValue = value[key];\n const newChildValue = newValue[key];\n if (childValue !== newChildValue) {\n dirtyCollection(node);\n dirtyTag(tags[key], newChildValue);\n }\n if (typeof newChildValue === \"object\" && newChildValue !== null) {\n delete tags[key];\n }\n }\n for (const key in children) {\n const childNode = children[key];\n const newChildValue = newValue[key];\n const childValue = childNode.value;\n if (childValue === newChildValue) {\n continue;\n } else if (typeof newChildValue === \"object\" && newChildValue !== null) {\n updateNode(childNode, newChildValue);\n } else {\n deleteNode(childNode);\n delete children[key];\n }\n }\n}\nfunction deleteNode(node) {\n if (node.tag) {\n dirtyTag(node.tag, null);\n }\n dirtyCollection(node);\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null);\n }\n for (const key in node.children) {\n deleteNode(node.children[key]);\n }\n}\n\n// src/lruMemoize.ts\nfunction createSingletonCache(equals) {\n let entry;\n return {\n get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n return NOT_FOUND;\n },\n put(key, value) {\n entry = { key, value };\n },\n getEntries() {\n return entry ? [entry] : [];\n },\n clear() {\n entry = void 0;\n }\n };\n}\nfunction createLruCache(maxSize, equals) {\n let entries = [];\n function get(key) {\n const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));\n if (cacheIndex > -1) {\n const entry = entries[cacheIndex];\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n return entry.value;\n }\n return NOT_FOUND;\n }\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n entries.unshift({ key, value });\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n function getEntries() {\n return entries;\n }\n function clear() {\n entries = [];\n }\n return { get, put, getEntries, clear };\n}\nvar referenceEqualityCheck = (a, b) => a === b;\nfunction createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n const { length } = prev;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n return true;\n };\n}\nfunction lruMemoize(func, equalityCheckOrOptions) {\n const providedOptions = typeof equalityCheckOrOptions === \"object\" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };\n const {\n equalityCheck = referenceEqualityCheck,\n maxSize = 1,\n resultEqualityCheck\n } = providedOptions;\n const comparator = createCacheKeyComparator(equalityCheck);\n let resultsCount = 0;\n const cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);\n function memoized() {\n let value = cache.get(arguments);\n if (value === NOT_FOUND) {\n value = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const entries = cache.getEntries();\n const matchingEntry = entries.find(\n (entry) => resultEqualityCheck(entry.value, value)\n );\n if (matchingEntry) {\n value = matchingEntry.value;\n resultsCount !== 0 && resultsCount--;\n }\n }\n cache.put(arguments, value);\n }\n return value;\n }\n memoized.clearCache = () => {\n cache.clear();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/autotrackMemoize/autotrackMemoize.ts\nfunction autotrackMemoize(func) {\n const node = createNode(\n []\n );\n let lastArgs = null;\n const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);\n const cache = createCache(() => {\n const res = func.apply(null, node.proxy);\n return res;\n });\n function memoized() {\n if (!shallowEqual(lastArgs, arguments)) {\n updateNode(node, arguments);\n lastArgs = arguments;\n }\n return cache.value;\n }\n memoized.clearCache = () => {\n return cache.clear();\n };\n return memoized;\n}\n\n// src/weakMapMemoize.ts\nvar StrongRef = class {\n constructor(value) {\n this.value = value;\n }\n deref() {\n return this.value;\n }\n};\nvar Ref = typeof WeakRef !== \"undefined\" ? WeakRef : StrongRef;\nvar UNTERMINATED = 0;\nvar TERMINATED = 1;\nfunction createCacheNode() {\n return {\n s: UNTERMINATED,\n v: void 0,\n o: null,\n p: null\n };\n}\nfunction weakMapMemoize(func, options = {}) {\n let fnNode = createCacheNode();\n const { resultEqualityCheck } = options;\n let lastResult;\n let resultsCount = 0;\n function memoized() {\n let cacheNode = fnNode;\n const { length } = arguments;\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i];\n if (typeof arg === \"function\" || typeof arg === \"object\" && arg !== null) {\n let objectCache = cacheNode.o;\n if (objectCache === null) {\n cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();\n }\n const objectNode = objectCache.get(arg);\n if (objectNode === void 0) {\n cacheNode = createCacheNode();\n objectCache.set(arg, cacheNode);\n } else {\n cacheNode = objectNode;\n }\n } else {\n let primitiveCache = cacheNode.p;\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();\n }\n const primitiveNode = primitiveCache.get(arg);\n if (primitiveNode === void 0) {\n cacheNode = createCacheNode();\n primitiveCache.set(arg, cacheNode);\n } else {\n cacheNode = primitiveNode;\n }\n }\n }\n const terminatedNode = cacheNode;\n let result;\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v;\n } else {\n result = func.apply(null, arguments);\n resultsCount++;\n }\n terminatedNode.s = TERMINATED;\n if (resultEqualityCheck) {\n const lastResultValue = lastResult?.deref?.() ?? lastResult;\n if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {\n result = lastResultValue;\n resultsCount !== 0 && resultsCount--;\n }\n const needsWeakRef = typeof result === \"object\" && result !== null || typeof result === \"function\";\n lastResult = needsWeakRef ? new Ref(result) : result;\n }\n terminatedNode.v = result;\n return result;\n }\n memoized.clearCache = () => {\n fnNode = createCacheNode();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/createSelectorCreator.ts\nfunction createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {\n const createSelectorCreatorOptions = typeof memoizeOrOptions === \"function\" ? {\n memoize: memoizeOrOptions,\n memoizeOptions: memoizeOptionsFromArgs\n } : memoizeOrOptions;\n const createSelector2 = (...createSelectorArgs) => {\n let recomputations = 0;\n let dependencyRecomputations = 0;\n let lastResult;\n let directlyPassedOptions = {};\n let resultFunc = createSelectorArgs.pop();\n if (typeof resultFunc === \"object\") {\n directlyPassedOptions = resultFunc;\n resultFunc = createSelectorArgs.pop();\n }\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n );\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n };\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = [],\n devModeChecks = {}\n } = combinedOptions;\n const finalMemoizeOptions = ensureIsArray(memoizeOptions);\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);\n const dependencies = getDependencies(createSelectorArgs);\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++;\n return resultFunc.apply(\n null,\n arguments\n );\n }, ...finalMemoizeOptions);\n let firstRun = true;\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++;\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n );\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults);\n if (process.env.NODE_ENV !== \"production\") {\n const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc,\n inputSelectorResults,\n lastResult\n );\n }\n if (inputStabilityCheck.shouldRun) {\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n );\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n );\n }\n if (firstRun)\n firstRun = false;\n }\n return lastResult;\n }, ...finalArgsMemoizeOptions);\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0;\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0;\n },\n memoize,\n argsMemoize\n });\n };\n Object.assign(createSelector2, {\n withTypes: () => createSelector2\n });\n return createSelector2;\n}\nvar createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);\n\n// src/createStructuredSelector.ts\nvar createStructuredSelector = Object.assign(\n (inputSelectorsObject, selectorCreator = createSelector) => {\n assertIsObject(\n inputSelectorsObject,\n `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n );\n const inputSelectorKeys = Object.keys(inputSelectorsObject);\n const dependencies = inputSelectorKeys.map(\n (key) => inputSelectorsObject[key]\n );\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value;\n return composition;\n }, {});\n }\n );\n return structuredSelector;\n },\n { withTypes: () => createStructuredSelector }\n);\nexport {\n createSelector,\n createSelectorCreator,\n createStructuredSelector,\n lruMemoize,\n referenceEqualityCheck,\n setGlobalDevModeChecks,\n autotrackMemoize as unstable_autotrackMemoize,\n weakMapMemoize\n};\n//# sourceMappingURL=reselect.mjs.map","// src/index.ts\nfunction createThunkMiddleware(extraArgument) {\n const middleware = ({ dispatch, getState }) => (next) => (action) => {\n if (typeof action === \"function\") {\n return action(dispatch, getState, extraArgument);\n }\n return next(action);\n };\n return middleware;\n}\nvar thunk = createThunkMiddleware();\nvar withExtraArgument = createThunkMiddleware;\nexport {\n thunk,\n withExtraArgument\n};\n","// src/index.ts\nexport * from \"redux\";\nimport { produce, current as current3, freeze, original as original2, isDraft as isDraft5 } from \"immer\";\nimport { createSelector, createSelectorCreator as createSelectorCreator2, lruMemoize, weakMapMemoize as weakMapMemoize2 } from \"reselect\";\n\n// src/createDraftSafeSelector.ts\nimport { current, isDraft } from \"immer\";\nimport { createSelectorCreator, weakMapMemoize } from \"reselect\";\nvar createDraftSafeSelectorCreator = (...args) => {\n const createSelector2 = createSelectorCreator(...args);\n const createDraftSafeSelector2 = Object.assign((...args2) => {\n const selector = createSelector2(...args2);\n const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest);\n Object.assign(wrappedSelector, selector);\n return wrappedSelector;\n }, {\n withTypes: () => createDraftSafeSelector2\n });\n return createDraftSafeSelector2;\n};\nvar createDraftSafeSelector = /* @__PURE__ */ createDraftSafeSelectorCreator(weakMapMemoize);\n\n// src/configureStore.ts\nimport { applyMiddleware, createStore, compose as compose2, combineReducers, isPlainObject as isPlainObject2 } from \"redux\";\n\n// src/devtoolsExtension.ts\nimport { compose } from \"redux\";\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {\n if (arguments.length === 0) return void 0;\n if (typeof arguments[0] === \"object\") return compose;\n return compose.apply(null, arguments);\n};\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {\n return function(noop3) {\n return noop3;\n };\n};\n\n// src/getDefaultMiddleware.ts\nimport { thunk as thunkMiddleware, withExtraArgument } from \"redux-thunk\";\n\n// src/createAction.ts\nimport { isAction } from \"redux\";\n\n// src/tsHelpers.ts\nvar hasMatchFunction = (v) => {\n return v && typeof v.match === \"function\";\n};\n\n// src/createAction.ts\nfunction createAction(type, prepareAction) {\n function actionCreator(...args) {\n if (prepareAction) {\n let prepared = prepareAction(...args);\n if (!prepared) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"prepareAction did not return an object\");\n }\n return {\n type,\n payload: prepared.payload,\n ...\"meta\" in prepared && {\n meta: prepared.meta\n },\n ...\"error\" in prepared && {\n error: prepared.error\n }\n };\n }\n return {\n type,\n payload: args[0]\n };\n }\n actionCreator.toString = () => `${type}`;\n actionCreator.type = type;\n actionCreator.match = (action) => isAction(action) && action.type === type;\n return actionCreator;\n}\nfunction isActionCreator(action) {\n return typeof action === \"function\" && \"type\" in action && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it\n hasMatchFunction(action);\n}\nfunction isFSA(action) {\n return isAction(action) && Object.keys(action).every(isValidKey);\n}\nfunction isValidKey(key) {\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\n}\n\n// src/actionCreatorInvariantMiddleware.ts\nfunction getMessage(type) {\n const splitType = type ? `${type}`.split(\"/\") : [];\n const actionName = splitType[splitType.length - 1] || \"actionCreator\";\n return `Detected an action creator with type \"${type || \"unknown\"}\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \\`dispatch(${actionName}())\\` instead of \\`dispatch(${actionName})\\`. This is necessary even if the action has no payload.`;\n}\nfunction createActionCreatorInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n }\n const {\n isActionCreator: isActionCreator2 = isActionCreator\n } = options;\n return () => (next) => (action) => {\n if (isActionCreator2(action)) {\n console.warn(getMessage(action.type));\n }\n return next(action);\n };\n}\n\n// src/utils.ts\nimport { produce as createNextState, isDraftable } from \"immer\";\nfunction getTimeMeasureUtils(maxDelay, fnName) {\n let elapsed = 0;\n return {\n measureTime(fn) {\n const started = Date.now();\n try {\n return fn();\n } finally {\n const finished = Date.now();\n elapsed += finished - started;\n }\n },\n warnIfExceeded() {\n if (elapsed > maxDelay) {\n console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`);\n }\n }\n };\n}\nfunction find(iterable, comparator) {\n for (const entry of iterable) {\n if (comparator(entry)) {\n return entry;\n }\n }\n return void 0;\n}\nvar Tuple = class _Tuple extends Array {\n constructor(...items) {\n super(...items);\n Object.setPrototypeOf(this, _Tuple.prototype);\n }\n static get [Symbol.species]() {\n return _Tuple;\n }\n concat(...arr) {\n return super.concat.apply(this, arr);\n }\n prepend(...arr) {\n if (arr.length === 1 && Array.isArray(arr[0])) {\n return new _Tuple(...arr[0].concat(this));\n }\n return new _Tuple(...arr.concat(this));\n }\n};\nfunction freezeDraftable(val) {\n return isDraftable(val) ? createNextState(val, () => {\n }) : val;\n}\nfunction emplace(map, key, handler) {\n if (map.has(key)) {\n let value = map.get(key);\n if (handler.update) {\n value = handler.update(value, key, map);\n map.set(key, value);\n }\n return value;\n }\n if (!handler.insert) throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"No insert provided for key not already in map\");\n const inserted = handler.insert(key, map);\n map.set(key, inserted);\n return inserted;\n}\n\n// src/immutableStateInvariantMiddleware.ts\nfunction isImmutableDefault(value) {\n return typeof value !== \"object\" || value == null || Object.isFrozen(value);\n}\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\n const trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\n return {\n detectMutations() {\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\n }\n };\n}\nfunction trackProperties(isImmutable, ignorePaths = [], obj, path = \"\", checkedObjects = /* @__PURE__ */ new Set()) {\n const tracked = {\n value: obj\n };\n if (!isImmutable(obj) && !checkedObjects.has(obj)) {\n checkedObjects.add(obj);\n tracked.children = {};\n for (const key in obj) {\n const childPath = path ? path + \".\" + key : key;\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\n continue;\n }\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\n }\n }\n return tracked;\n}\nfunction detectMutations(isImmutable, ignoredPaths = [], trackedProperty, obj, sameParentRef = false, path = \"\") {\n const prevObj = trackedProperty ? trackedProperty.value : void 0;\n const sameRef = prevObj === obj;\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\n return {\n wasMutated: true,\n path\n };\n }\n if (isImmutable(prevObj) || isImmutable(obj)) {\n return {\n wasMutated: false\n };\n }\n const keysToDetect = {};\n for (let key in trackedProperty.children) {\n keysToDetect[key] = true;\n }\n for (let key in obj) {\n keysToDetect[key] = true;\n }\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (let key in keysToDetect) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n const result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);\n if (result.wasMutated) {\n return result;\n }\n }\n return {\n wasMutated: false\n };\n}\nfunction createImmutableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n let stringify2 = function(obj, serializer, indent, decycler) {\n return JSON.stringify(obj, getSerialize2(serializer, decycler), indent);\n }, getSerialize2 = function(serializer, decycler) {\n let stack = [], keys = [];\n if (!decycler) decycler = function(_, value) {\n if (stack[0] === value) return \"[Circular ~]\";\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\n };\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this);\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n if (~stack.indexOf(value)) value = decycler.call(this, key, value);\n } else stack.push(value);\n return serializer == null ? value : serializer.call(this, key, value);\n };\n };\n var stringify = stringify2, getSerialize = getSerialize2;\n let {\n isImmutable = isImmutableDefault,\n ignoredPaths,\n warnAfter = 32\n } = options;\n const track = trackForMutations.bind(null, isImmutable, ignoredPaths);\n return ({\n getState\n }) => {\n let state = getState();\n let tracker = track(state);\n let result;\n return (next) => (action) => {\n const measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(19) : `A state mutation was detected between dispatches, in the path '${result.path || \"\"}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);\n }\n });\n const dispatchedAction = next(action);\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(20) : `A state mutation was detected inside a dispatch, in the path: ${result.path || \"\"}. Take a look at the reducer(s) handling the action ${stringify2(action)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);\n }\n });\n measureUtils.warnIfExceeded();\n return dispatchedAction;\n };\n };\n }\n}\n\n// src/serializableStateInvariantMiddleware.ts\nimport { isAction as isAction2, isPlainObject } from \"redux\";\nfunction isPlain(val) {\n const type = typeof val;\n return val == null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\n}\nfunction findNonSerializableValue(value, path = \"\", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) {\n let foundNestedSerializable;\n if (!isSerializable(value)) {\n return {\n keyPath: path || \"\",\n value\n };\n }\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n if (cache?.has(value)) return false;\n const entries = getEntries != null ? getEntries(value) : Object.entries(value);\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (const [key, nestedValue] of entries) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n if (!isSerializable(nestedValue)) {\n return {\n keyPath: nestedPath,\n value: nestedValue\n };\n }\n if (typeof nestedValue === \"object\") {\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);\n if (foundNestedSerializable) {\n return foundNestedSerializable;\n }\n }\n }\n if (cache && isNestedFrozen(value)) cache.add(value);\n return false;\n}\nfunction isNestedFrozen(value) {\n if (!Object.isFrozen(value)) return false;\n for (const nestedValue of Object.values(value)) {\n if (typeof nestedValue !== \"object\" || nestedValue === null) continue;\n if (!isNestedFrozen(nestedValue)) return false;\n }\n return true;\n}\nfunction createSerializableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n const {\n isSerializable = isPlain,\n getEntries,\n ignoredActions = [],\n ignoredActionPaths = [\"meta.arg\", \"meta.baseQueryMeta\"],\n ignoredPaths = [],\n warnAfter = 32,\n ignoreState = false,\n ignoreActions = false,\n disableCache = false\n } = options;\n const cache = !disableCache && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;\n return (storeAPI) => (next) => (action) => {\n if (!isAction2(action)) {\n return next(action);\n }\n const result = next(action);\n const measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\n measureUtils.measureTime(() => {\n const foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths, cache);\n if (foundActionNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundActionNonSerializableValue;\n console.error(`A non-serializable value was detected in an action, in the path: \\`${keyPath}\\`. Value:`, value, \"\\nTake a look at the logic that dispatched this action: \", action, \"\\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)\", \"\\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\");\n }\n });\n }\n if (!ignoreState) {\n measureUtils.measureTime(() => {\n const state = storeAPI.getState();\n const foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths, cache);\n if (foundStateNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundStateNonSerializableValue;\n console.error(`A non-serializable value was detected in the state, in the path: \\`${keyPath}\\`. Value:`, value, `\nTake a look at the reducer(s) handling this action type: ${action.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`);\n }\n });\n measureUtils.warnIfExceeded();\n }\n return result;\n };\n }\n}\n\n// src/getDefaultMiddleware.ts\nfunction isBoolean(x) {\n return typeof x === \"boolean\";\n}\nvar buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {\n const {\n thunk = true,\n immutableCheck = true,\n serializableCheck = true,\n actionCreatorCheck = true\n } = options ?? {};\n let middlewareArray = new Tuple();\n if (thunk) {\n if (isBoolean(thunk)) {\n middlewareArray.push(thunkMiddleware);\n } else {\n middlewareArray.push(withExtraArgument(thunk.extraArgument));\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (immutableCheck) {\n let immutableOptions = {};\n if (!isBoolean(immutableCheck)) {\n immutableOptions = immutableCheck;\n }\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\n }\n if (serializableCheck) {\n let serializableOptions = {};\n if (!isBoolean(serializableCheck)) {\n serializableOptions = serializableCheck;\n }\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\n }\n if (actionCreatorCheck) {\n let actionCreatorOptions = {};\n if (!isBoolean(actionCreatorCheck)) {\n actionCreatorOptions = actionCreatorCheck;\n }\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\n }\n }\n return middlewareArray;\n};\n\n// src/autoBatchEnhancer.ts\nvar SHOULD_AUTOBATCH = \"RTK_autoBatch\";\nvar prepareAutoBatched = () => (payload) => ({\n payload,\n meta: {\n [SHOULD_AUTOBATCH]: true\n }\n});\nvar createQueueWithTimer = (timeout) => {\n return (notify) => {\n setTimeout(notify, timeout);\n };\n};\nvar rAF = typeof window !== \"undefined\" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);\nvar autoBatchEnhancer = (options = {\n type: \"raf\"\n}) => (next) => (...args) => {\n const store = next(...args);\n let notifying = true;\n let shouldNotifyAtEndOfTick = false;\n let notificationQueued = false;\n const listeners = /* @__PURE__ */ new Set();\n const queueCallback = options.type === \"tick\" ? queueMicrotask : options.type === \"raf\" ? rAF : options.type === \"callback\" ? options.queueNotification : createQueueWithTimer(options.timeout);\n const notifyListeners = () => {\n notificationQueued = false;\n if (shouldNotifyAtEndOfTick) {\n shouldNotifyAtEndOfTick = false;\n listeners.forEach((l) => l());\n }\n };\n return Object.assign({}, store, {\n // Override the base `store.subscribe` method to keep original listeners\n // from running if we're delaying notifications\n subscribe(listener2) {\n const wrappedListener = () => notifying && listener2();\n const unsubscribe = store.subscribe(wrappedListener);\n listeners.add(listener2);\n return () => {\n unsubscribe();\n listeners.delete(listener2);\n };\n },\n // Override the base `store.dispatch` method so that we can check actions\n // for the `shouldAutoBatch` flag and determine if batching is active\n dispatch(action) {\n try {\n notifying = !action?.meta?.[SHOULD_AUTOBATCH];\n shouldNotifyAtEndOfTick = !notifying;\n if (shouldNotifyAtEndOfTick) {\n if (!notificationQueued) {\n notificationQueued = true;\n queueCallback(notifyListeners);\n }\n }\n return store.dispatch(action);\n } finally {\n notifying = true;\n }\n }\n });\n};\n\n// src/getDefaultEnhancers.ts\nvar buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {\n const {\n autoBatch = true\n } = options ?? {};\n let enhancerArray = new Tuple(middlewareEnhancer);\n if (autoBatch) {\n enhancerArray.push(autoBatchEnhancer(typeof autoBatch === \"object\" ? autoBatch : void 0));\n }\n return enhancerArray;\n};\n\n// src/configureStore.ts\nfunction configureStore(options) {\n const getDefaultMiddleware = buildGetDefaultMiddleware();\n const {\n reducer = void 0,\n middleware,\n devTools = true,\n preloadedState = void 0,\n enhancers = void 0\n } = options || {};\n let rootReducer;\n if (typeof reducer === \"function\") {\n rootReducer = reducer;\n } else if (isPlainObject2(reducer)) {\n rootReducer = combineReducers(reducer);\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers\");\n }\n if (process.env.NODE_ENV !== \"production\" && middleware && typeof middleware !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"`middleware` field must be a callback\");\n }\n let finalMiddleware;\n if (typeof middleware === \"function\") {\n finalMiddleware = middleware(getDefaultMiddleware);\n if (process.env.NODE_ENV !== \"production\" && !Array.isArray(finalMiddleware)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"when using a middleware builder function, an array of middleware must be returned\");\n }\n } else {\n finalMiddleware = getDefaultMiddleware();\n }\n if (process.env.NODE_ENV !== \"production\" && finalMiddleware.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"each middleware provided to configureStore must be a function\");\n }\n let finalCompose = compose2;\n if (devTools) {\n finalCompose = composeWithDevTools({\n // Enable capture of stack traces for dispatched Redux actions\n trace: process.env.NODE_ENV !== \"production\",\n ...typeof devTools === \"object\" && devTools\n });\n }\n const middlewareEnhancer = applyMiddleware(...finalMiddleware);\n const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);\n if (process.env.NODE_ENV !== \"production\" && enhancers && typeof enhancers !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"`enhancers` field must be a callback\");\n }\n let storeEnhancers = typeof enhancers === \"function\" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();\n if (process.env.NODE_ENV !== \"production\" && !Array.isArray(storeEnhancers)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"`enhancers` callback must return an array\");\n }\n if (process.env.NODE_ENV !== \"production\" && storeEnhancers.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"each enhancer provided to configureStore must be a function\");\n }\n if (process.env.NODE_ENV !== \"production\" && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) {\n console.error(\"middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`\");\n }\n const composedEnhancer = finalCompose(...storeEnhancers);\n return createStore(rootReducer, preloadedState, composedEnhancer);\n}\n\n// src/createReducer.ts\nimport { produce as createNextState2, isDraft as isDraft2, isDraftable as isDraftable2 } from \"immer\";\n\n// src/mapBuilders.ts\nfunction executeReducerBuilderCallback(builderCallback) {\n const actionsMap = {};\n const actionMatchers = [];\n let defaultCaseReducer;\n const builder = {\n addCase(typeOrActionCreator, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (actionMatchers.length > 0) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(26) : \"`builder.addCase` should only be called before calling `builder.addMatcher`\");\n }\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(27) : \"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(28) : \"`builder.addCase` cannot be called with an empty action type\");\n }\n if (type in actionsMap) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(29) : `\\`builder.addCase\\` cannot be called with two reducers for the same action type '${type}'`);\n }\n actionsMap[type] = reducer;\n return builder;\n },\n addMatcher(matcher, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(30) : \"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n actionMatchers.push({\n matcher,\n reducer\n });\n return builder;\n },\n addDefaultCase(reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(31) : \"`builder.addDefaultCase` can only be called once\");\n }\n }\n defaultCaseReducer = reducer;\n return builder;\n }\n };\n builderCallback(builder);\n return [actionsMap, actionMatchers, defaultCaseReducer];\n}\n\n// src/createReducer.ts\nfunction isStateFunction(x) {\n return typeof x === \"function\";\n}\nfunction createReducer(initialState, mapOrBuilderCallback) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof mapOrBuilderCallback === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : \"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\n }\n }\n let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);\n let getInitialState;\n if (isStateFunction(initialState)) {\n getInitialState = () => freezeDraftable(initialState());\n } else {\n const frozenInitialState = freezeDraftable(initialState);\n getInitialState = () => frozenInitialState;\n }\n function reducer(state = getInitialState(), action) {\n let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({\n matcher\n }) => matcher(action)).map(({\n reducer: reducer2\n }) => reducer2)];\n if (caseReducers.filter((cr) => !!cr).length === 0) {\n caseReducers = [finalDefaultCaseReducer];\n }\n return caseReducers.reduce((previousState, caseReducer) => {\n if (caseReducer) {\n if (isDraft2(previousState)) {\n const draft = previousState;\n const result = caseReducer(draft, action);\n if (result === void 0) {\n return previousState;\n }\n return result;\n } else if (!isDraftable2(previousState)) {\n const result = caseReducer(previousState, action);\n if (result === void 0) {\n if (previousState === null) {\n return previousState;\n }\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"A case reducer on a non-draftable value must not return undefined\");\n }\n return result;\n } else {\n return createNextState2(previousState, (draft) => {\n return caseReducer(draft, action);\n });\n }\n }\n return previousState;\n }, state);\n }\n reducer.getInitialState = getInitialState;\n return reducer;\n}\n\n// src/matchers.ts\nvar matches = (matcher, action) => {\n if (hasMatchFunction(matcher)) {\n return matcher.match(action);\n } else {\n return matcher(action);\n }\n};\nfunction isAnyOf(...matchers) {\n return (action) => {\n return matchers.some((matcher) => matches(matcher, action));\n };\n}\nfunction isAllOf(...matchers) {\n return (action) => {\n return matchers.every((matcher) => matches(matcher, action));\n };\n}\nfunction hasExpectedRequestMetadata(action, validStatus) {\n if (!action || !action.meta) return false;\n const hasValidRequestId = typeof action.meta.requestId === \"string\";\n const hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\n return hasValidRequestId && hasValidRequestStatus;\n}\nfunction isAsyncThunkArray(a) {\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\n}\nfunction isPending(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isPending()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.pending));\n}\nfunction isRejected(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejected()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.rejected));\n}\nfunction isRejectedWithValue(...asyncThunks) {\n const hasFlag = (action) => {\n return action && action.meta && action.meta.rejectedWithValue;\n };\n if (asyncThunks.length === 0) {\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejectedWithValue()(asyncThunks[0]);\n }\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n}\nfunction isFulfilled(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"fulfilled\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isFulfilled()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.fulfilled));\n}\nfunction isAsyncThunkAction(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isAsyncThunkAction()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.flatMap((asyncThunk) => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled]));\n}\n\n// src/nanoid.ts\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\nvar nanoid = (size = 21) => {\n let id = \"\";\n let i = size;\n while (i--) {\n id += urlAlphabet[Math.random() * 64 | 0];\n }\n return id;\n};\n\n// src/createAsyncThunk.ts\nvar commonProperties = [\"name\", \"message\", \"stack\", \"code\"];\nvar RejectWithValue = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar FulfillWithMeta = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar miniSerializeError = (value) => {\n if (typeof value === \"object\" && value !== null) {\n const simpleError = {};\n for (const property of commonProperties) {\n if (typeof value[property] === \"string\") {\n simpleError[property] = value[property];\n }\n }\n return simpleError;\n }\n return {\n message: String(value)\n };\n};\nvar createAsyncThunk = /* @__PURE__ */ (() => {\n function createAsyncThunk2(typePrefix, payloadCreator, options) {\n const fulfilled = createAction(typePrefix + \"/fulfilled\", (payload, requestId, arg, meta) => ({\n payload,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"fulfilled\"\n }\n }));\n const pending = createAction(typePrefix + \"/pending\", (requestId, arg, meta) => ({\n payload: void 0,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"pending\"\n }\n }));\n const rejected = createAction(typePrefix + \"/rejected\", (error, requestId, arg, payload, meta) => ({\n payload,\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\n meta: {\n ...meta || {},\n arg,\n requestId,\n rejectedWithValue: !!payload,\n requestStatus: \"rejected\",\n aborted: error?.name === \"AbortError\",\n condition: error?.name === \"ConditionError\"\n }\n }));\n function actionCreator(arg) {\n return (dispatch, getState, extra) => {\n const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid();\n const abortController = new AbortController();\n let abortHandler;\n let abortReason;\n function abort(reason) {\n abortReason = reason;\n abortController.abort();\n }\n const promise = async function() {\n let finalAction;\n try {\n let conditionResult = options?.condition?.(arg, {\n getState,\n extra\n });\n if (isThenable(conditionResult)) {\n conditionResult = await conditionResult;\n }\n if (conditionResult === false || abortController.signal.aborted) {\n throw {\n name: \"ConditionError\",\n message: \"Aborted due to condition callback returning false.\"\n };\n }\n const abortedPromise = new Promise((_, reject) => {\n abortHandler = () => {\n reject({\n name: \"AbortError\",\n message: abortReason || \"Aborted\"\n });\n };\n abortController.signal.addEventListener(\"abort\", abortHandler);\n });\n dispatch(pending(requestId, arg, options?.getPendingMeta?.({\n requestId,\n arg\n }, {\n getState,\n extra\n })));\n finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, {\n dispatch,\n getState,\n extra,\n requestId,\n signal: abortController.signal,\n abort,\n rejectWithValue: (value, meta) => {\n return new RejectWithValue(value, meta);\n },\n fulfillWithValue: (value, meta) => {\n return new FulfillWithMeta(value, meta);\n }\n })).then((result) => {\n if (result instanceof RejectWithValue) {\n throw result;\n }\n if (result instanceof FulfillWithMeta) {\n return fulfilled(result.payload, requestId, arg, result.meta);\n }\n return fulfilled(result, requestId, arg);\n })]);\n } catch (err) {\n finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg);\n } finally {\n if (abortHandler) {\n abortController.signal.removeEventListener(\"abort\", abortHandler);\n }\n }\n const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\n if (!skipDispatch) {\n dispatch(finalAction);\n }\n return finalAction;\n }();\n return Object.assign(promise, {\n abort,\n requestId,\n arg,\n unwrap() {\n return promise.then(unwrapResult);\n }\n });\n };\n }\n return Object.assign(actionCreator, {\n pending,\n rejected,\n fulfilled,\n settled: isAnyOf(rejected, fulfilled),\n typePrefix\n });\n }\n createAsyncThunk2.withTypes = () => createAsyncThunk2;\n return createAsyncThunk2;\n})();\nfunction unwrapResult(action) {\n if (action.meta && action.meta.rejectedWithValue) {\n throw action.payload;\n }\n if (action.error) {\n throw action.error;\n }\n return action.payload;\n}\nfunction isThenable(value) {\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\n}\n\n// src/createSlice.ts\nvar asyncThunkSymbol = /* @__PURE__ */ Symbol.for(\"rtk-slice-createasyncthunk\");\nvar asyncThunkCreator = {\n [asyncThunkSymbol]: createAsyncThunk\n};\nvar ReducerType = /* @__PURE__ */ ((ReducerType2) => {\n ReducerType2[\"reducer\"] = \"reducer\";\n ReducerType2[\"reducerWithPrepare\"] = \"reducerWithPrepare\";\n ReducerType2[\"asyncThunk\"] = \"asyncThunk\";\n return ReducerType2;\n})(ReducerType || {});\nfunction getType(slice, actionKey) {\n return `${slice}/${actionKey}`;\n}\nfunction buildCreateSlice({\n creators\n} = {}) {\n const cAT = creators?.asyncThunk?.[asyncThunkSymbol];\n return function createSlice2(options) {\n const {\n name,\n reducerPath = name\n } = options;\n if (!name) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"`name` is a required option for createSlice\");\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (options.initialState === void 0) {\n console.error(\"You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`\");\n }\n }\n const reducers = (typeof options.reducers === \"function\" ? options.reducers(buildReducerCreators()) : options.reducers) || {};\n const reducerNames = Object.keys(reducers);\n const context = {\n sliceCaseReducersByName: {},\n sliceCaseReducersByType: {},\n actionCreators: {},\n sliceMatchers: []\n };\n const contextMethods = {\n addCase(typeOrActionCreator, reducer2) {\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"`context.addCase` cannot be called with an empty action type\");\n }\n if (type in context.sliceCaseReducersByType) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"`context.addCase` cannot be called with two reducers for the same action type: \" + type);\n }\n context.sliceCaseReducersByType[type] = reducer2;\n return contextMethods;\n },\n addMatcher(matcher, reducer2) {\n context.sliceMatchers.push({\n matcher,\n reducer: reducer2\n });\n return contextMethods;\n },\n exposeAction(name2, actionCreator) {\n context.actionCreators[name2] = actionCreator;\n return contextMethods;\n },\n exposeCaseReducer(name2, reducer2) {\n context.sliceCaseReducersByName[name2] = reducer2;\n return contextMethods;\n }\n };\n reducerNames.forEach((reducerName) => {\n const reducerDefinition = reducers[reducerName];\n const reducerDetails = {\n reducerName,\n type: getType(name, reducerName),\n createNotation: typeof options.reducers === \"function\"\n };\n if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) {\n handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);\n } else {\n handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);\n }\n });\n function buildReducer() {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options.extraReducers === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\n }\n }\n const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];\n const finalCaseReducers = {\n ...extraReducers,\n ...context.sliceCaseReducersByType\n };\n return createReducer(options.initialState, (builder) => {\n for (let key in finalCaseReducers) {\n builder.addCase(key, finalCaseReducers[key]);\n }\n for (let sM of context.sliceMatchers) {\n builder.addMatcher(sM.matcher, sM.reducer);\n }\n for (let m of actionMatchers) {\n builder.addMatcher(m.matcher, m.reducer);\n }\n if (defaultCaseReducer) {\n builder.addDefaultCase(defaultCaseReducer);\n }\n });\n }\n const selectSelf = (state) => state;\n const injectedSelectorCache = /* @__PURE__ */ new Map();\n let _reducer;\n function reducer(state, action) {\n if (!_reducer) _reducer = buildReducer();\n return _reducer(state, action);\n }\n function getInitialState() {\n if (!_reducer) _reducer = buildReducer();\n return _reducer.getInitialState();\n }\n function makeSelectorProps(reducerPath2, injected = false) {\n function selectSlice(state) {\n let sliceState = state[reducerPath2];\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"selectSlice returned undefined for an uninjected slice reducer\");\n }\n }\n return sliceState;\n }\n function getSelectors(selectState = selectSelf) {\n const selectorCache = emplace(injectedSelectorCache, injected, {\n insert: () => /* @__PURE__ */ new WeakMap()\n });\n return emplace(selectorCache, selectState, {\n insert: () => {\n const map = {};\n for (const [name2, selector] of Object.entries(options.selectors ?? {})) {\n map[name2] = wrapSelector(selector, selectState, getInitialState, injected);\n }\n return map;\n }\n });\n }\n return {\n reducerPath: reducerPath2,\n getSelectors,\n get selectors() {\n return getSelectors(selectSlice);\n },\n selectSlice\n };\n }\n const slice = {\n name,\n reducer,\n actions: context.actionCreators,\n caseReducers: context.sliceCaseReducersByName,\n getInitialState,\n ...makeSelectorProps(reducerPath),\n injectInto(injectable, {\n reducerPath: pathOpt,\n ...config\n } = {}) {\n const newReducerPath = pathOpt ?? reducerPath;\n injectable.inject({\n reducerPath: newReducerPath,\n reducer\n }, config);\n return {\n ...slice,\n ...makeSelectorProps(newReducerPath, true)\n };\n }\n };\n return slice;\n };\n}\nfunction wrapSelector(selector, selectState, getInitialState, injected) {\n function wrapper(rootState, ...args) {\n let sliceState = selectState(rootState);\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"selectState returned undefined for an uninjected slice reducer\");\n }\n }\n return selector(sliceState, ...args);\n }\n wrapper.unwrapped = selector;\n return wrapper;\n}\nvar createSlice = /* @__PURE__ */ buildCreateSlice();\nfunction buildReducerCreators() {\n function asyncThunk(payloadCreator, config) {\n return {\n _reducerDefinitionType: \"asyncThunk\" /* asyncThunk */,\n payloadCreator,\n ...config\n };\n }\n asyncThunk.withTypes = () => asyncThunk;\n return {\n reducer(caseReducer) {\n return Object.assign({\n // hack so the wrapping function has the same name as the original\n // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original\n [caseReducer.name](...args) {\n return caseReducer(...args);\n }\n }[caseReducer.name], {\n _reducerDefinitionType: \"reducer\" /* reducer */\n });\n },\n preparedReducer(prepare, reducer) {\n return {\n _reducerDefinitionType: \"reducerWithPrepare\" /* reducerWithPrepare */,\n prepare,\n reducer\n };\n },\n asyncThunk\n };\n}\nfunction handleNormalReducerDefinition({\n type,\n reducerName,\n createNotation\n}, maybeReducerWithPrepare, context) {\n let caseReducer;\n let prepareCallback;\n if (\"reducer\" in maybeReducerWithPrepare) {\n if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : \"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.\");\n }\n caseReducer = maybeReducerWithPrepare.reducer;\n prepareCallback = maybeReducerWithPrepare.prepare;\n } else {\n caseReducer = maybeReducerWithPrepare;\n }\n context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));\n}\nfunction isAsyncThunkSliceReducerDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"asyncThunk\" /* asyncThunk */;\n}\nfunction isCaseReducerWithPrepareDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"reducerWithPrepare\" /* reducerWithPrepare */;\n}\nfunction handleThunkCaseReducerDefinition({\n type,\n reducerName\n}, reducerDefinition, context, cAT) {\n if (!cAT) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(18) : \"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.\");\n }\n const {\n payloadCreator,\n fulfilled,\n pending,\n rejected,\n settled,\n options\n } = reducerDefinition;\n const thunk = cAT(type, payloadCreator, options);\n context.exposeAction(reducerName, thunk);\n if (fulfilled) {\n context.addCase(thunk.fulfilled, fulfilled);\n }\n if (pending) {\n context.addCase(thunk.pending, pending);\n }\n if (rejected) {\n context.addCase(thunk.rejected, rejected);\n }\n if (settled) {\n context.addMatcher(thunk.settled, settled);\n }\n context.exposeCaseReducer(reducerName, {\n fulfilled: fulfilled || noop,\n pending: pending || noop,\n rejected: rejected || noop,\n settled: settled || noop\n });\n}\nfunction noop() {\n}\n\n// src/entities/entity_state.ts\nfunction getInitialEntityState() {\n return {\n ids: [],\n entities: {}\n };\n}\nfunction createInitialStateFactory(stateAdapter) {\n function getInitialState(additionalState = {}, entities) {\n const state = Object.assign(getInitialEntityState(), additionalState);\n return entities ? stateAdapter.setAll(state, entities) : state;\n }\n return {\n getInitialState\n };\n}\n\n// src/entities/state_selectors.ts\nfunction createSelectorsFactory() {\n function getSelectors(selectState, options = {}) {\n const {\n createSelector: createSelector2 = createDraftSafeSelector\n } = options;\n const selectIds = (state) => state.ids;\n const selectEntities = (state) => state.entities;\n const selectAll = createSelector2(selectIds, selectEntities, (ids, entities) => ids.map((id) => entities[id]));\n const selectId = (_, id) => id;\n const selectById = (entities, id) => entities[id];\n const selectTotal = createSelector2(selectIds, (ids) => ids.length);\n if (!selectState) {\n return {\n selectIds,\n selectEntities,\n selectAll,\n selectTotal,\n selectById: createSelector2(selectEntities, selectId, selectById)\n };\n }\n const selectGlobalizedEntities = createSelector2(selectState, selectEntities);\n return {\n selectIds: createSelector2(selectState, selectIds),\n selectEntities: selectGlobalizedEntities,\n selectAll: createSelector2(selectState, selectAll),\n selectTotal: createSelector2(selectState, selectTotal),\n selectById: createSelector2(selectGlobalizedEntities, selectId, selectById)\n };\n }\n return {\n getSelectors\n };\n}\n\n// src/entities/state_adapter.ts\nimport { produce as createNextState3, isDraft as isDraft3 } from \"immer\";\nvar isDraftTyped = isDraft3;\nfunction createSingleArgumentStateOperator(mutator) {\n const operator = createStateOperator((_, state) => mutator(state));\n return function operation(state) {\n return operator(state, void 0);\n };\n}\nfunction createStateOperator(mutator) {\n return function operation(state, arg) {\n function isPayloadActionArgument(arg2) {\n return isFSA(arg2);\n }\n const runMutator = (draft) => {\n if (isPayloadActionArgument(arg)) {\n mutator(arg.payload, draft);\n } else {\n mutator(arg, draft);\n }\n };\n if (isDraftTyped(state)) {\n runMutator(state);\n return state;\n }\n return createNextState3(state, runMutator);\n };\n}\n\n// src/entities/utils.ts\nimport { current as current2, isDraft as isDraft4 } from \"immer\";\nfunction selectIdValue(entity, selectId) {\n const key = selectId(entity);\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\n }\n return key;\n}\nfunction ensureEntitiesArray(entities) {\n if (!Array.isArray(entities)) {\n entities = Object.values(entities);\n }\n return entities;\n}\nfunction getCurrent(value) {\n return isDraft4(value) ? current2(value) : value;\n}\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingIdsArray = getCurrent(state.ids);\n const existingIds = new Set(existingIdsArray);\n const added = [];\n const updated = [];\n for (const entity of newEntities) {\n const id = selectIdValue(entity, selectId);\n if (existingIds.has(id)) {\n updated.push({\n id,\n changes: entity\n });\n } else {\n added.push(entity);\n }\n }\n return [added, updated, existingIdsArray];\n}\n\n// src/entities/unsorted_state_adapter.ts\nfunction createUnsortedStateAdapter(selectId) {\n function addOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (key in state.entities) {\n return;\n }\n state.ids.push(key);\n state.entities[key] = entity;\n }\n function addManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n addOneMutably(entity, state);\n }\n }\n function setOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (!(key in state.entities)) {\n state.ids.push(key);\n }\n ;\n state.entities[key] = entity;\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n setOneMutably(entity, state);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.ids = [];\n state.entities = {};\n addManyMutably(newEntities, state);\n }\n function removeOneMutably(key, state) {\n return removeManyMutably([key], state);\n }\n function removeManyMutably(keys, state) {\n let didMutate = false;\n keys.forEach((key) => {\n if (key in state.entities) {\n delete state.entities[key];\n didMutate = true;\n }\n });\n if (didMutate) {\n state.ids = state.ids.filter((id) => id in state.entities);\n }\n }\n function removeAllMutably(state) {\n Object.assign(state, {\n ids: [],\n entities: {}\n });\n }\n function takeNewKey(keys, update, state) {\n const original3 = state.entities[update.id];\n if (original3 === void 0) {\n return false;\n }\n const updated = Object.assign({}, original3, update.changes);\n const newKey = selectIdValue(updated, selectId);\n const hasNewKey = newKey !== update.id;\n if (hasNewKey) {\n keys[update.id] = newKey;\n delete state.entities[update.id];\n }\n ;\n state.entities[newKey] = updated;\n return hasNewKey;\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n const newKeys = {};\n const updatesPerEntity = {};\n updates.forEach((update) => {\n if (update.id in state.entities) {\n updatesPerEntity[update.id] = {\n id: update.id,\n // Spreads ignore falsy values, so this works even if there isn't\n // an existing update already at this key\n changes: {\n ...updatesPerEntity[update.id]?.changes,\n ...update.changes\n }\n };\n }\n });\n updates = Object.values(updatesPerEntity);\n const didMutateEntities = updates.length > 0;\n if (didMutateEntities) {\n const didMutateIds = updates.filter((update) => takeNewKey(newKeys, update, state)).length > 0;\n if (didMutateIds) {\n state.ids = Object.values(state.entities).map((e) => selectIdValue(e, selectId));\n }\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated] = splitAddedUpdatedEntities(newEntities, selectId, state);\n updateManyMutably(updated, state);\n addManyMutably(added, state);\n }\n return {\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\n addOne: createStateOperator(addOneMutably),\n addMany: createStateOperator(addManyMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n updateOne: createStateOperator(updateOneMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n upsertMany: createStateOperator(upsertManyMutably),\n removeOne: createStateOperator(removeOneMutably),\n removeMany: createStateOperator(removeManyMutably)\n };\n}\n\n// src/entities/sorted_state_adapter.ts\nfunction findInsertIndex(sortedItems, item, comparisonFunction) {\n let lowIndex = 0;\n let highIndex = sortedItems.length;\n while (lowIndex < highIndex) {\n let middleIndex = lowIndex + highIndex >>> 1;\n const currentItem = sortedItems[middleIndex];\n const res = comparisonFunction(item, currentItem);\n if (res >= 0) {\n lowIndex = middleIndex + 1;\n } else {\n highIndex = middleIndex;\n }\n }\n return lowIndex;\n}\nfunction insert(sortedItems, item, comparisonFunction) {\n const insertAtIndex = findInsertIndex(sortedItems, item, comparisonFunction);\n sortedItems.splice(insertAtIndex, 0, item);\n return sortedItems;\n}\nfunction createSortedStateAdapter(selectId, comparer) {\n const {\n removeOne,\n removeMany,\n removeAll\n } = createUnsortedStateAdapter(selectId);\n function addOneMutably(entity, state) {\n return addManyMutably([entity], state);\n }\n function addManyMutably(newEntities, state, existingIds) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingKeys = new Set(existingIds ?? getCurrent(state.ids));\n const models = newEntities.filter((model) => !existingKeys.has(selectIdValue(model, selectId)));\n if (models.length !== 0) {\n mergeFunction(state, models);\n }\n }\n function setOneMutably(entity, state) {\n return setManyMutably([entity], state);\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n if (newEntities.length !== 0) {\n for (const item of newEntities) {\n delete state.entities[selectId(item)];\n }\n mergeFunction(state, newEntities);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.entities = {};\n state.ids = [];\n addManyMutably(newEntities, state, []);\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n let appliedUpdates = false;\n let replacedIds = false;\n for (let update of updates) {\n const entity = state.entities[update.id];\n if (!entity) {\n continue;\n }\n appliedUpdates = true;\n Object.assign(entity, update.changes);\n const newId = selectId(entity);\n if (update.id !== newId) {\n replacedIds = true;\n delete state.entities[update.id];\n const oldIndex = state.ids.indexOf(update.id);\n state.ids[oldIndex] = newId;\n state.entities[newId] = entity;\n }\n }\n if (appliedUpdates) {\n mergeFunction(state, [], appliedUpdates, replacedIds);\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated, existingIdsArray] = splitAddedUpdatedEntities(newEntities, selectId, state);\n if (updated.length) {\n updateManyMutably(updated, state);\n }\n if (added.length) {\n addManyMutably(added, state, existingIdsArray);\n }\n }\n function areArraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] === b[i]) {\n continue;\n }\n return false;\n }\n return true;\n }\n const mergeFunction = (state, addedItems, appliedUpdates, replacedIds) => {\n const currentEntities = getCurrent(state.entities);\n const currentIds = getCurrent(state.ids);\n const stateEntities = state.entities;\n let ids = currentIds;\n if (replacedIds) {\n ids = new Set(currentIds);\n }\n let sortedEntities = [];\n for (const id of ids) {\n const entity = currentEntities[id];\n if (entity) {\n sortedEntities.push(entity);\n }\n }\n const wasPreviouslyEmpty = sortedEntities.length === 0;\n for (const item of addedItems) {\n stateEntities[selectId(item)] = item;\n if (!wasPreviouslyEmpty) {\n insert(sortedEntities, item, comparer);\n }\n }\n if (wasPreviouslyEmpty) {\n sortedEntities = addedItems.slice().sort(comparer);\n } else if (appliedUpdates) {\n sortedEntities.sort(comparer);\n }\n const newSortedIds = sortedEntities.map(selectId);\n if (!areArraysEqual(currentIds, newSortedIds)) {\n state.ids = newSortedIds;\n }\n };\n return {\n removeOne,\n removeMany,\n removeAll,\n addOne: createStateOperator(addOneMutably),\n updateOne: createStateOperator(updateOneMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n addMany: createStateOperator(addManyMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertMany: createStateOperator(upsertManyMutably)\n };\n}\n\n// src/entities/create_adapter.ts\nfunction createEntityAdapter(options = {}) {\n const {\n selectId,\n sortComparer\n } = {\n sortComparer: false,\n selectId: (instance) => instance.id,\n ...options\n };\n const stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\n const stateFactory = createInitialStateFactory(stateAdapter);\n const selectorsFactory = createSelectorsFactory();\n return {\n selectId,\n sortComparer,\n ...stateFactory,\n ...selectorsFactory,\n ...stateAdapter\n };\n}\n\n// src/listenerMiddleware/index.ts\nimport { isAction as isAction3 } from \"redux\";\n\n// src/listenerMiddleware/exceptions.ts\nvar task = \"task\";\nvar listener = \"listener\";\nvar completed = \"completed\";\nvar cancelled = \"cancelled\";\nvar taskCancelled = `task-${cancelled}`;\nvar taskCompleted = `task-${completed}`;\nvar listenerCancelled = `${listener}-${cancelled}`;\nvar listenerCompleted = `${listener}-${completed}`;\nvar TaskAbortError = class {\n constructor(code) {\n this.code = code;\n this.message = `${task} ${cancelled} (reason: ${code})`;\n }\n name = \"TaskAbortError\";\n message;\n};\n\n// src/listenerMiddleware/utils.ts\nvar assertFunction = (func, expected) => {\n if (typeof func !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(32) : `${expected} is not a function`);\n }\n};\nvar noop2 = () => {\n};\nvar catchRejection = (promise, onError = noop2) => {\n promise.catch(onError);\n return promise;\n};\nvar addAbortSignalListener = (abortSignal, callback) => {\n abortSignal.addEventListener(\"abort\", callback, {\n once: true\n });\n return () => abortSignal.removeEventListener(\"abort\", callback);\n};\nvar abortControllerWithReason = (abortController, reason) => {\n const signal = abortController.signal;\n if (signal.aborted) {\n return;\n }\n if (!(\"reason\" in signal)) {\n Object.defineProperty(signal, \"reason\", {\n enumerable: true,\n value: reason,\n configurable: true,\n writable: true\n });\n }\n ;\n abortController.abort(reason);\n};\n\n// src/listenerMiddleware/task.ts\nvar validateActive = (signal) => {\n if (signal.aborted) {\n const {\n reason\n } = signal;\n throw new TaskAbortError(reason);\n }\n};\nfunction raceWithSignal(signal, promise) {\n let cleanup = noop2;\n return new Promise((resolve, reject) => {\n const notifyRejection = () => reject(new TaskAbortError(signal.reason));\n if (signal.aborted) {\n notifyRejection();\n return;\n }\n cleanup = addAbortSignalListener(signal, notifyRejection);\n promise.finally(() => cleanup()).then(resolve, reject);\n }).finally(() => {\n cleanup = noop2;\n });\n}\nvar runTask = async (task2, cleanUp) => {\n try {\n await Promise.resolve();\n const value = await task2();\n return {\n status: \"ok\",\n value\n };\n } catch (error) {\n return {\n status: error instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\n error\n };\n } finally {\n cleanUp?.();\n }\n};\nvar createPause = (signal) => {\n return (promise) => {\n return catchRejection(raceWithSignal(signal, promise).then((output) => {\n validateActive(signal);\n return output;\n }));\n };\n};\nvar createDelay = (signal) => {\n const pause = createPause(signal);\n return (timeoutMs) => {\n return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs)));\n };\n};\n\n// src/listenerMiddleware/index.ts\nvar {\n assign\n} = Object;\nvar INTERNAL_NIL_TOKEN = {};\nvar alm = \"listenerMiddleware\";\nvar createFork = (parentAbortSignal, parentBlockingPromises) => {\n const linkControllers = (controller) => addAbortSignalListener(parentAbortSignal, () => abortControllerWithReason(controller, parentAbortSignal.reason));\n return (taskExecutor, opts) => {\n assertFunction(taskExecutor, \"taskExecutor\");\n const childAbortController = new AbortController();\n linkControllers(childAbortController);\n const result = runTask(async () => {\n validateActive(parentAbortSignal);\n validateActive(childAbortController.signal);\n const result2 = await taskExecutor({\n pause: createPause(childAbortController.signal),\n delay: createDelay(childAbortController.signal),\n signal: childAbortController.signal\n });\n validateActive(childAbortController.signal);\n return result2;\n }, () => abortControllerWithReason(childAbortController, taskCompleted));\n if (opts?.autoJoin) {\n parentBlockingPromises.push(result.catch(noop2));\n }\n return {\n result: createPause(parentAbortSignal)(result),\n cancel() {\n abortControllerWithReason(childAbortController, taskCancelled);\n }\n };\n };\n};\nvar createTakePattern = (startListening, signal) => {\n const take = async (predicate, timeout) => {\n validateActive(signal);\n let unsubscribe = () => {\n };\n const tuplePromise = new Promise((resolve, reject) => {\n let stopListening = startListening({\n predicate,\n effect: (action, listenerApi) => {\n listenerApi.unsubscribe();\n resolve([action, listenerApi.getState(), listenerApi.getOriginalState()]);\n }\n });\n unsubscribe = () => {\n stopListening();\n reject();\n };\n });\n const promises = [tuplePromise];\n if (timeout != null) {\n promises.push(new Promise((resolve) => setTimeout(resolve, timeout, null)));\n }\n try {\n const output = await raceWithSignal(signal, Promise.race(promises));\n validateActive(signal);\n return output;\n } finally {\n unsubscribe();\n }\n };\n return (predicate, timeout) => catchRejection(take(predicate, timeout));\n};\nvar getListenerEntryPropsFrom = (options) => {\n let {\n type,\n actionCreator,\n matcher,\n predicate,\n effect\n } = options;\n if (type) {\n predicate = createAction(type).match;\n } else if (actionCreator) {\n type = actionCreator.type;\n predicate = actionCreator.match;\n } else if (matcher) {\n predicate = matcher;\n } else if (predicate) {\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(21) : \"Creating or removing a listener requires one of the known fields for matching an action\");\n }\n assertFunction(effect, \"options.listener\");\n return {\n predicate,\n type,\n effect\n };\n};\nvar createListenerEntry = /* @__PURE__ */ assign((options) => {\n const {\n type,\n predicate,\n effect\n } = getListenerEntryPropsFrom(options);\n const id = nanoid();\n const entry = {\n id,\n effect,\n type,\n predicate,\n pending: /* @__PURE__ */ new Set(),\n unsubscribe: () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(22) : \"Unsubscribe not initialized\");\n }\n };\n return entry;\n}, {\n withTypes: () => createListenerEntry\n});\nvar cancelActiveListeners = (entry) => {\n entry.pending.forEach((controller) => {\n abortControllerWithReason(controller, listenerCancelled);\n });\n};\nvar createClearListenerMiddleware = (listenerMap) => {\n return () => {\n listenerMap.forEach(cancelActiveListeners);\n listenerMap.clear();\n };\n};\nvar safelyNotifyError = (errorHandler, errorToNotify, errorInfo) => {\n try {\n errorHandler(errorToNotify, errorInfo);\n } catch (errorHandlerError) {\n setTimeout(() => {\n throw errorHandlerError;\n }, 0);\n }\n};\nvar addListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/add`), {\n withTypes: () => addListener\n});\nvar clearAllListeners = /* @__PURE__ */ createAction(`${alm}/removeAll`);\nvar removeListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/remove`), {\n withTypes: () => removeListener\n});\nvar defaultErrorHandler = (...args) => {\n console.error(`${alm}/error`, ...args);\n};\nvar createListenerMiddleware = (middlewareOptions = {}) => {\n const listenerMap = /* @__PURE__ */ new Map();\n const {\n extra,\n onError = defaultErrorHandler\n } = middlewareOptions;\n assertFunction(onError, \"onError\");\n const insertEntry = (entry) => {\n entry.unsubscribe = () => listenerMap.delete(entry.id);\n listenerMap.set(entry.id, entry);\n return (cancelOptions) => {\n entry.unsubscribe();\n if (cancelOptions?.cancelActive) {\n cancelActiveListeners(entry);\n }\n };\n };\n const startListening = (options) => {\n let entry = find(Array.from(listenerMap.values()), (existingEntry) => existingEntry.effect === options.effect);\n if (!entry) {\n entry = createListenerEntry(options);\n }\n return insertEntry(entry);\n };\n assign(startListening, {\n withTypes: () => startListening\n });\n const stopListening = (options) => {\n const {\n type,\n effect,\n predicate\n } = getListenerEntryPropsFrom(options);\n const entry = find(Array.from(listenerMap.values()), (entry2) => {\n const matchPredicateOrType = typeof type === \"string\" ? entry2.type === type : entry2.predicate === predicate;\n return matchPredicateOrType && entry2.effect === effect;\n });\n if (entry) {\n entry.unsubscribe();\n if (options.cancelActive) {\n cancelActiveListeners(entry);\n }\n }\n return !!entry;\n };\n assign(stopListening, {\n withTypes: () => stopListening\n });\n const notifyListener = async (entry, action, api, getOriginalState) => {\n const internalTaskController = new AbortController();\n const take = createTakePattern(startListening, internalTaskController.signal);\n const autoJoinPromises = [];\n try {\n entry.pending.add(internalTaskController);\n await Promise.resolve(entry.effect(\n action,\n // Use assign() rather than ... to avoid extra helper functions added to bundle\n assign({}, api, {\n getOriginalState,\n condition: (predicate, timeout) => take(predicate, timeout).then(Boolean),\n take,\n delay: createDelay(internalTaskController.signal),\n pause: createPause(internalTaskController.signal),\n extra,\n signal: internalTaskController.signal,\n fork: createFork(internalTaskController.signal, autoJoinPromises),\n unsubscribe: entry.unsubscribe,\n subscribe: () => {\n listenerMap.set(entry.id, entry);\n },\n cancelActiveListeners: () => {\n entry.pending.forEach((controller, _, set) => {\n if (controller !== internalTaskController) {\n abortControllerWithReason(controller, listenerCancelled);\n set.delete(controller);\n }\n });\n },\n cancel: () => {\n abortControllerWithReason(internalTaskController, listenerCancelled);\n entry.pending.delete(internalTaskController);\n },\n throwIfCancelled: () => {\n validateActive(internalTaskController.signal);\n }\n })\n ));\n } catch (listenerError) {\n if (!(listenerError instanceof TaskAbortError)) {\n safelyNotifyError(onError, listenerError, {\n raisedBy: \"effect\"\n });\n }\n } finally {\n await Promise.all(autoJoinPromises);\n abortControllerWithReason(internalTaskController, listenerCompleted);\n entry.pending.delete(internalTaskController);\n }\n };\n const clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\n const middleware = (api) => (next) => (action) => {\n if (!isAction3(action)) {\n return next(action);\n }\n if (addListener.match(action)) {\n return startListening(action.payload);\n }\n if (clearAllListeners.match(action)) {\n clearListenerMiddleware();\n return;\n }\n if (removeListener.match(action)) {\n return stopListening(action.payload);\n }\n let originalState = api.getState();\n const getOriginalState = () => {\n if (originalState === INTERNAL_NIL_TOKEN) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(23) : `${alm}: getOriginalState can only be called synchronously`);\n }\n return originalState;\n };\n let result;\n try {\n result = next(action);\n if (listenerMap.size > 0) {\n const currentState = api.getState();\n const listenerEntries = Array.from(listenerMap.values());\n for (const entry of listenerEntries) {\n let runListener = false;\n try {\n runListener = entry.predicate(action, currentState, originalState);\n } catch (predicateError) {\n runListener = false;\n safelyNotifyError(onError, predicateError, {\n raisedBy: \"predicate\"\n });\n }\n if (!runListener) {\n continue;\n }\n notifyListener(entry, action, api, getOriginalState);\n }\n }\n } finally {\n originalState = INTERNAL_NIL_TOKEN;\n }\n return result;\n };\n return {\n middleware,\n startListening,\n stopListening,\n clearListeners: clearListenerMiddleware\n };\n};\n\n// src/dynamicMiddleware/index.ts\nimport { compose as compose3 } from \"redux\";\nvar createMiddlewareEntry = (middleware) => ({\n id: nanoid(),\n middleware,\n applied: /* @__PURE__ */ new Map()\n});\nvar matchInstance = (instanceId) => (action) => action?.meta?.instanceId === instanceId;\nvar createDynamicMiddleware = () => {\n const instanceId = nanoid();\n const middlewareMap = /* @__PURE__ */ new Map();\n const withMiddleware = Object.assign(createAction(\"dynamicMiddleware/add\", (...middlewares) => ({\n payload: middlewares,\n meta: {\n instanceId\n }\n })), {\n withTypes: () => withMiddleware\n });\n const addMiddleware = Object.assign(function addMiddleware2(...middlewares) {\n middlewares.forEach((middleware2) => {\n let entry = find(Array.from(middlewareMap.values()), (entry2) => entry2.middleware === middleware2);\n if (!entry) {\n entry = createMiddlewareEntry(middleware2);\n }\n middlewareMap.set(entry.id, entry);\n });\n }, {\n withTypes: () => addMiddleware\n });\n const getFinalMiddleware = (api) => {\n const appliedMiddleware = Array.from(middlewareMap.values()).map((entry) => emplace(entry.applied, api, {\n insert: () => entry.middleware(api)\n }));\n return compose3(...appliedMiddleware);\n };\n const isWithMiddleware = isAllOf(withMiddleware, matchInstance(instanceId));\n const middleware = (api) => (next) => (action) => {\n if (isWithMiddleware(action)) {\n addMiddleware(...action.payload);\n return api.dispatch;\n }\n return getFinalMiddleware(api)(next)(action);\n };\n return {\n middleware,\n addMiddleware,\n withMiddleware,\n instanceId\n };\n};\n\n// src/combineSlices.ts\nimport { combineReducers as combineReducers2 } from \"redux\";\nvar isSliceLike = (maybeSliceLike) => \"reducerPath\" in maybeSliceLike && typeof maybeSliceLike.reducerPath === \"string\";\nvar getReducers = (slices) => slices.flatMap((sliceOrMap) => isSliceLike(sliceOrMap) ? [[sliceOrMap.reducerPath, sliceOrMap.reducer]] : Object.entries(sliceOrMap));\nvar ORIGINAL_STATE = Symbol.for(\"rtk-state-proxy-original\");\nvar isStateProxy = (value) => !!value && !!value[ORIGINAL_STATE];\nvar stateProxyMap = /* @__PURE__ */ new WeakMap();\nvar createStateProxy = (state, reducerMap) => emplace(stateProxyMap, state, {\n insert: () => new Proxy(state, {\n get: (target, prop, receiver) => {\n if (prop === ORIGINAL_STATE) return target;\n const result = Reflect.get(target, prop, receiver);\n if (typeof result === \"undefined\") {\n const reducer = reducerMap[prop.toString()];\n if (reducer) {\n const reducerResult = reducer(void 0, {\n type: nanoid()\n });\n if (typeof reducerResult === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(24) : `The slice reducer for key \"${prop.toString()}\" returned undefined when called for selector(). If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n return reducerResult;\n }\n }\n return result;\n }\n })\n});\nvar original = (state) => {\n if (!isStateProxy(state)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(25) : \"original must be used on state Proxy\");\n }\n return state[ORIGINAL_STATE];\n};\nvar noopReducer = (state = {}) => state;\nfunction combineSlices(...slices) {\n const reducerMap = Object.fromEntries(getReducers(slices));\n const getReducer = () => Object.keys(reducerMap).length ? combineReducers2(reducerMap) : noopReducer;\n let reducer = getReducer();\n function combinedReducer(state, action) {\n return reducer(state, action);\n }\n combinedReducer.withLazyLoadedSlices = () => combinedReducer;\n const inject = (slice, config = {}) => {\n const {\n reducerPath,\n reducer: reducerToInject\n } = slice;\n const currentReducer = reducerMap[reducerPath];\n if (!config.overrideExisting && currentReducer && currentReducer !== reducerToInject) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n console.error(`called \\`inject\\` to override already-existing reducer ${reducerPath} without specifying \\`overrideExisting: true\\``);\n }\n return combinedReducer;\n }\n reducerMap[reducerPath] = reducerToInject;\n reducer = getReducer();\n return combinedReducer;\n };\n const selector = Object.assign(function makeSelector(selectorFn, selectState) {\n return function selector2(state, ...args) {\n return selectorFn(createStateProxy(selectState ? selectState(state, ...args) : state, reducerMap), ...args);\n };\n }, {\n original\n });\n return Object.assign(combinedReducer, {\n inject,\n selector\n });\n}\n\n// src/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\nexport {\n ReducerType,\n SHOULD_AUTOBATCH,\n TaskAbortError,\n Tuple,\n addListener,\n asyncThunkCreator,\n autoBatchEnhancer,\n buildCreateSlice,\n clearAllListeners,\n combineSlices,\n configureStore,\n createAction,\n createActionCreatorInvariantMiddleware,\n createAsyncThunk,\n createDraftSafeSelector,\n createDraftSafeSelectorCreator,\n createDynamicMiddleware,\n createEntityAdapter,\n createImmutableStateInvariantMiddleware,\n createListenerMiddleware,\n produce as createNextState,\n createReducer,\n createSelector,\n createSelectorCreator2 as createSelectorCreator,\n createSerializableStateInvariantMiddleware,\n createSlice,\n current3 as current,\n findNonSerializableValue,\n formatProdErrorMessage,\n freeze,\n isActionCreator,\n isAllOf,\n isAnyOf,\n isAsyncThunkAction,\n isDraft5 as isDraft,\n isFSA as isFluxStandardAction,\n isFulfilled,\n isImmutableDefault,\n isPending,\n isPlain,\n isRejected,\n isRejectedWithValue,\n lruMemoize,\n miniSerializeError,\n nanoid,\n original2 as original,\n prepareAutoBatched,\n removeListener,\n unwrapResult,\n weakMapMemoize2 as weakMapMemoize\n};\n//# sourceMappingURL=redux-toolkit.modern.mjs.map","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\n\nexport type DrawerContent = \"default\" | \"careTeam\" | \"account\";\n\ninterface State {\n drawerContent: DrawerContent;\n}\n\nconst initialState: State = {\n drawerContent: \"default\",\n};\n\nconst mobileDrawerContentSlice = createSlice({\n name: \"mobileDrawerContent\",\n initialState,\n reducers: {\n setMobileDrawerContent(state, action: PayloadAction) {\n state.drawerContent = action.payload;\n },\n },\n});\n\nexport const { setMobileDrawerContent } = mobileDrawerContentSlice.actions;\n\nexport const mobileDrawerContentSliceReducer = mobileDrawerContentSlice.reducer;\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\n\ninterface StoredSelectedParticipant {\n id: string;\n}\n\ninterface CohortState {\n selectedParticipantId: string | null;\n}\n\nconst initialState: CohortState = {\n selectedParticipantId: null,\n};\n\nconst cohortSlice = createSlice({\n name: \"cohort\",\n initialState,\n reducers: {\n setSelectedParticipantId(\n state,\n action: PayloadAction,\n ) {\n const selectedParticipantId = action.payload.id;\n\n state.selectedParticipantId = selectedParticipantId;\n },\n },\n});\n\nexport const { setSelectedParticipantId } = cohortSlice.actions;\n\nexport const cohortSliceReducer = cohortSlice.reducer;\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\n\ntype SavedTab = \"task\" | \"tip\";\n\ninterface StoredActiveSavedTab {\n activeTab: SavedTab;\n}\n\ninterface SavedRecommendationTabState {\n activeTab: SavedTab;\n}\n\nconst initialState: SavedRecommendationTabState = {\n activeTab: \"task\",\n};\n\nconst dashboardSlice = createSlice({\n name: \"dashboard\",\n initialState,\n reducers: {\n setSavedTab(state, action: PayloadAction) {\n const { activeTab } = action.payload;\n\n state.activeTab = activeTab;\n },\n },\n});\n\nexport const { setSavedTab } = dashboardSlice.actions;\n\nexport const dashboardSliceReducer = dashboardSlice.reducer;\n","import { PayloadAction, createSlice } from \"@reduxjs/toolkit\";\nimport { ModalState, ModalStateType, OpenModalPayload } from \"./types\";\n\nconst initialState: ModalState = {\n isOpen: false,\n type: null,\n payload: {},\n};\n\nexport const modalSlice = createSlice({\n name: \"modal\",\n initialState,\n reducers: {\n openModal: (\n state,\n action: PayloadAction<{ type: ModalStateType; data?: OpenModalPayload }>,\n ) => {\n state.isOpen = true;\n state.type = action.payload.type;\n state.payload = action.payload.data || {};\n },\n closeModal: (state) => {\n state.isOpen = false;\n state.type = null;\n state.payload = {};\n },\n changeModal: (\n state,\n action: PayloadAction<{ type: ModalStateType; data?: OpenModalPayload }>,\n ) => {\n state.isOpen = true;\n state.type = action.payload.type;\n state.payload = action.payload.data || {};\n },\n },\n});\n\nexport const { openModal, closeModal, changeModal } = modalSlice.actions;\n\nexport const modalWithStateSliceReducer = modalSlice.reducer;\n","import { DateTime } from \"luxon\";\n\nexport const getAutoSelectWeek = (startDate: string): number => {\n const start = DateTime.fromISO(startDate).startOf(\"day\");\n const today = DateTime.now().startOf(\"day\");\n\n if (today < start) return 0;\n\n const weeksDiff = today.diff(start, \"weeks\").weeks;\n\n return Math.floor(weeksDiff) + 1;\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { getAutoSelectWeek } from \"./utils\";\n\ninterface State {\n currentWeekIndex: number;\n weekIndex: number;\n}\n\nconst initialState: State = {\n currentWeekIndex: 0,\n weekIndex: 0,\n};\n\ninterface AutoSelectWeek {\n numWeeks: number;\n startDate: string;\n}\n\ninterface SetWeekIndex {\n weekIndex: number;\n}\n\nconst programSlice = createSlice({\n name: \"program\",\n initialState,\n reducers: {\n autoSelectWeek(state, action: PayloadAction) {\n const { numWeeks, startDate } = action.payload;\n\n const weekIndex = getAutoSelectWeek(startDate);\n\n const value = Math.min(weekIndex, numWeeks - 1);\n\n state.weekIndex = value;\n state.currentWeekIndex = value;\n },\n setWeekIndex(state, action: PayloadAction) {\n state.weekIndex = action.payload.weekIndex;\n },\n },\n});\n\nexport const { autoSelectWeek, setWeekIndex } = programSlice.actions;\n\nexport const programSliceReducer = programSlice.reducer;\n"],"names":["LuxonError","InvalidDateTimeError","reason","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","n","s","l","DATE_SHORT","DATE_MED","DATE_MED_WITH_WEEKDAY","DATE_FULL","DATE_HUGE","TIME_SIMPLE","TIME_WITH_SECONDS","TIME_WITH_SHORT_OFFSET","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","ts","opts","format","otherZone","singleton","SystemZone","locale","parseZoneInfo","formatOffset","dtfCache","makeDTF","zone","typeToPos","hackyOffset","dtf","date","formatted","parsed","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","filled","i","type","value","pos","isUndefined","ianaZoneCache","IANAZone","name","year","month","day","adOrBc","hour","minute","second","asUTC","objToLocalTS","asTS","over","intlLFCache","getCachedLF","locString","key","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","intlRelCache","getCachedRTF","base","cacheKeyOpts","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","parseLocaleString","localeStr","xIndex","uIndex","options","selectedStr","smaller","numberingSystem","calendar","intlConfigString","outputCalendar","mapMonths","f","ms","dt","DateTime","mapWeekdays","listStuff","loc","length","englishFn","intlFn","mode","supportsFastNumbers","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","intlOpts","fixed","roundTo","padStart","PolyDateFormatter","z","gmtOffset","offsetZ","parts","part","offsetName","PolyRelFormatter","isEnglish","hasRelative","count","English.formatRelativeTime","fallbackWeekSettings","Locale","weekSettings","defaultToEN","specifiedLocale","Settings","localeR","numberingSystemR","outputCalendarR","weekSettingsR","validateWeekSettings","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","isActuallyEn","hasNoWeirdness","alts","English.months","formatStr","English.weekdays","English.meridiems","English.eras","field","df","results","matching","m","hasLocaleWeekInfo","other","FixedOffsetZone","offset","signedOffset","InvalidZone","zoneName","normalizeZone","input","defaultZone","isString","lowered","isNumber","numberingSystems","numberingSystemsUTF16","hanidecChars","parseDigits","str","code","min","max","digitRegexCache","resetDigitRegexCache","digitRegex","append","ns","now","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","twoDigitCutoffYear","throwOnInvalid","defaultWeekSettings","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","js","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekday","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","usesLocalWeekValues","obj","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","millisecond","validHour","validMinute","validSecond","validMillisecond","o","isDate","maybeArray","thing","bestBy","arr","by","compare","best","next","pair","pick","keys","a","k","hasOwnProperty","prop","settings","v","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseMillis","fraction","number","digits","towardZero","factor","modMonth","modYear","firstWeekOffset","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","timeZone","modified","offHourStr","offMinuteStr","offHour","offMin","offMinSigned","asNumber","numericValue","normalizeObject","normalizer","normalized","u","hours","minutes","sign","monthsLong","monthsShort","monthsNarrow","months","weekdaysLong","weekdaysShort","weekdaysNarrow","weekdays","meridiems","erasLong","erasShort","erasNarrow","eras","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","numeric","narrow","units","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","token","macroTokenToFormatOpts","Formats.DATE_SHORT","Formats.DATE_MED","Formats.DATE_FULL","Formats.DATE_HUGE","Formats.TIME_SIMPLE","Formats.TIME_WITH_SECONDS","Formats.TIME_WITH_SHORT_OFFSET","Formats.TIME_WITH_LONG_OFFSET","Formats.TIME_24_SIMPLE","Formats.TIME_24_WITH_SECONDS","Formats.TIME_24_WITH_SHORT_OFFSET","Formats.TIME_24_WITH_LONG_OFFSET","Formats.DATETIME_SHORT","Formats.DATETIME_MED","Formats.DATETIME_FULL","Formats.DATETIME_HUGE","Formats.DATETIME_SHORT_WITH_SECONDS","Formats.DATETIME_MED_WITH_SECONDS","Formats.DATETIME_FULL_WITH_SECONDS","Formats.DATETIME_HUGE_WITH_SECONDS","Formatter","fmt","current","currentFull","bracketed","c","formatOpts","interval","p","knownEnglish","useDateTimeFormatter","extract","meridiem","English.meridiemForDateTime","standalone","English.monthForDateTime","English.weekdayForDateTime","maybeMacro","era","English.eraForDateTime","dur","tokenToField","lildur","mapped","tokens","realTokens","found","literal","val","collapsed","ianaRegex","combineRegexes","regexes","full","r","combineExtractors","extractors","mergedVals","mergedZone","cursor","ex","parse","patterns","regex","extractor","simpleParse","match","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","extractISOTime","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","num","force","obsOffsets","fromStrings","weekdayStr","result","English.monthsShort","English.weekdaysLong","English.weekdaysShort","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","clone","clear","conf","Duration","durationToMillis","matrix","vals","sum","normalizeValues","previous","previousVal","conv","rollUp","removeZeroes","newVals","config","accurate","durationLike","text","invalid","fmtOpts","millis","duration","fn","values","mixed","conversionAccuracy","built","accumulated","lastUnit","own","ak","negated","eq","v1","v2","validateStartEnd","start","end","Interval","builtStart","friendlyDateTime","builtEnd","validateError","e","startIsValid","endIsValid","dateTime","dateTimes","sorted","b","added","idx","numberOfParts","intervals","final","sofar","item","currentCount","ends","flattened","dateFormat","separator","mapFn","Info","proto","locObj","dayDiff","earlier","later","utcDayStart","highOrderDiffs","differs","days","lowestOrder","highWater","differ","diff","remainingMillis","lowerOrderUnits","MISSING_FTP","intUnit","post","NBSP","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","partTypeStyleToTokenVal","tokenForPart","resolvedOpts","isSpace","style","actualType","buildRegex","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","TokenParser","regexString","rawMatches","explainFromTokens","parseFromTokens","invalidReason","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","inst","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","setZone","interpretationZone","toTechFormat","allowZ","toISODate","extended","longFormat","toISOTime","suppressSeconds","suppressMilliseconds","includeOffset","extendedZone","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","normalizeUnit","normalizeUnitWithLocalWeeks","guessOffsetForZone","zoneOffsetGuessCache","zoneOffsetTs","quickDT","offsetProvis","diffRelative","round","lastOpts","argList","args","ot","zoneToUse","milliseconds","seconds","tsNow","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","gregorian","tsFinal","offsetFinal","localeToUse","localeOpts","tokenList","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","keepLocalTime","keepCalendarTime","newTS","offsetGuess","asObj","settingWeekStuff","useLocaleWeeks","normalizedUnit","q","ext","includePrefix","includeZone","includeOffsetSpace","otherDateTime","durOpts","otherIsLater","diffed","inputMs","adjustedToZone","padding","formatParser","Formats.DATE_MED_WITH_WEEKDAY","Formats.DATETIME_MED_WITH_WEEKDAY","dateTimeish","formatProdErrorMessage","$$observable","symbol_observable_default","randomString","ActionTypes","actionTypes_default","isPlainObject","createStore","reducer","preloadedState","enhancer","currentReducer","currentState","currentListeners","nextListeners","listenerIdCounter","isDispatching","ensureCanMutateNextListeners","listener","getState","subscribe","isSubscribed","listenerId","dispatch","action","replaceReducer","nextReducer","observable","outerSubscribe","observer","observeState","observerAsObserver","assertReducerShape","reducers","combineReducers","reducerKeys","finalReducers","finalReducerKeys","shapeAssertionError","state","hasChanged","nextState","previousStateForKey","nextStateForKey","compose","funcs","arg","applyMiddleware","middlewares","createStore2","store","middlewareAPI","chain","middleware","isAction","NOTHING","DRAFTABLE","DRAFT_STATE","die","error","getPrototypeOf","isDraft","isDraftable","_a","isMap","isSet","objectCtorString","Ctor","original","each","iter","getArchtype","entry","index","has","get","set","propOrOldValue","is","y","target","latest","shallowCopy","strict","descriptors","desc","freeze","deep","isFrozen","dontMutateFrozenCollections","_key","plugins","getPlugin","pluginKey","plugin","loadPlugin","implementation","currentScope","getCurrentScope","createScope","parent_","immer_","usePatchesInScope","scope","patchListener","revokeScope","leaveScope","revokeDraft","enterScope","immer2","draft","processResult","baseDraft","finalize","maybeFreeze","rootScope","path","childValue","finalizeProperty","resultEach","isSet2","parentState","targetObject","rootPath","targetIsSet","res","createProxyProxy","parent","isArray","traps","objectTraps","arrayTraps","revoke","proxy","source","readPropFromProto","peek","prepareCopy","createProxy","getDescriptorFromProto","current2","markChanged","owner","Immer2","recipe","defaultBase","self","base2","hasError","ip","patches","inversePatches","patch","applyPatchesImpl","currentImpl","copy","enablePatches","REPLACE","ADD","REMOVE","generatePatches_","basePath","generatePatchesFromAssigned","generateArrayPatches","generateSetPatches","base_","assigned_","copy_","clonePatchValueIfNeeded","assignedValue","origValue","op","generateReplacementPatches_","baseValue","replacement","applyPatches_","parentType","deepClonePatchValue","cloned","immer","produce","produceWithPatches","applyPatches","assertIsFunction","func","errorMessage","assertIsObject","object","assertIsArrayOfFunctions","array","itemTypes","ensureIsArray","getDependencies","createSelectorArgs","dependencies","collectInputSelectorResults","inputSelectorArgs","inputSelectorResults","StrongRef","Ref","UNTERMINATED","TERMINATED","createCacheNode","weakMapMemoize","fnNode","resultEqualityCheck","lastResult","resultsCount","memoized","cacheNode","objectCache","objectNode","primitiveCache","primitiveNode","terminatedNode","lastResultValue","createSelectorCreator","memoizeOrOptions","memoizeOptionsFromArgs","createSelectorCreatorOptions","createSelector2","recomputations","dependencyRecomputations","directlyPassedOptions","resultFunc","combinedOptions","memoize","memoizeOptions","argsMemoize","argsMemoizeOptions","devModeChecks","finalMemoizeOptions","finalArgsMemoizeOptions","memoizedResultFunc","selector","createSelector","createStructuredSelector","inputSelectorsObject","selectorCreator","inputSelectorKeys","composition","createThunkMiddleware","extraArgument","thunk","withExtraArgument","composeWithDevTools","hasMatchFunction","createAction","prepareAction","actionCreator","prepared","Tuple","_Tuple","items","freezeDraftable","createNextState","emplace","map","handler","inserted","isBoolean","buildGetDefaultMiddleware","immutableCheck","serializableCheck","actionCreatorCheck","middlewareArray","thunkMiddleware","SHOULD_AUTOBATCH","prepareAutoBatched","payload","createQueueWithTimer","timeout","notify","rAF","autoBatchEnhancer","notifying","shouldNotifyAtEndOfTick","notificationQueued","listeners","queueCallback","notifyListeners","listener2","wrappedListener","unsubscribe","buildGetDefaultEnhancers","middlewareEnhancer","autoBatch","enhancerArray","configureStore","getDefaultMiddleware","devTools","enhancers","rootReducer","isPlainObject2","finalMiddleware","finalCompose","compose2","getDefaultEnhancers","storeEnhancers","composedEnhancer","executeReducerBuilderCallback","builderCallback","actionsMap","actionMatchers","defaultCaseReducer","builder","typeOrActionCreator","matcher","isStateFunction","createReducer","initialState","mapOrBuilderCallback","finalActionMatchers","finalDefaultCaseReducer","getInitialState","frozenInitialState","caseReducers","reducer2","cr","previousState","caseReducer","isDraft2","isDraftable2","createNextState2","isAnyOf","matchers","isAllOf","hasExpectedRequestMetadata","validStatus","hasValidRequestId","hasValidRequestStatus","isAsyncThunkArray","isPending","asyncThunks","asyncThunk","isRejected","isRejectedWithValue","hasFlag","isFulfilled","isAsyncThunkAction","urlAlphabet","nanoid","size","id","commonProperties","RejectWithValue","meta","__publicField","FulfillWithMeta","miniSerializeError","simpleError","property","createAsyncThunk","createAsyncThunk2","typePrefix","payloadCreator","fulfilled","requestId","pending","rejected","extra","abortController","abortHandler","abortReason","abort","promise","_b","finalAction","conditionResult","isThenable","abortedPromise","_","reject","err","unwrapResult","asyncThunkSymbol","getType","slice","actionKey","buildCreateSlice","creators","cAT","reducerPath","buildReducerCreators","reducerNames","context","contextMethods","name2","reducerName","reducerDefinition","reducerDetails","isAsyncThunkSliceReducerDefinition","handleThunkCaseReducerDefinition","handleNormalReducerDefinition","buildReducer","extraReducers","finalCaseReducers","sM","selectSelf","injectedSelectorCache","_reducer","makeSelectorProps","reducerPath2","injected","selectSlice","sliceState","getSelectors","selectState","selectorCache","wrapSelector","injectable","pathOpt","newReducerPath","wrapper","rootState","createSlice","prepare","createNotation","maybeReducerWithPrepare","prepareCallback","isCaseReducerWithPrepareDefinition","settled","noop","mobileDrawerContentSlice","setMobileDrawerContent","mobileDrawerContentSliceReducer","cohortSlice","selectedParticipantId","setSelectedParticipantId","cohortSliceReducer","dashboardSlice","activeTab","setSavedTab","dashboardSliceReducer","modalSlice","openModal","closeModal","changeModal","modalWithStateSliceReducer","getAutoSelectWeek","startDate","today","weeksDiff","programSlice","numWeeks","weekIndex","autoSelectWeek","setWeekIndex","programSliceReducer"],"mappings":"yKAKA,MAAMA,WAAmB,KAAM,CAAE,CAK1B,MAAMC,WAA6BD,EAAW,CACnD,YAAYE,EAAQ,CAClB,MAAM,qBAAqBA,EAAO,UAAW,CAAA,EAAE,CAChD,CACH,CAKO,MAAMC,WAA6BH,EAAW,CACnD,YAAYE,EAAQ,CAClB,MAAM,qBAAqBA,EAAO,UAAW,CAAA,EAAE,CAChD,CACH,CAKO,MAAME,WAA6BJ,EAAW,CACnD,YAAYE,EAAQ,CAClB,MAAM,qBAAqBA,EAAO,UAAW,CAAA,EAAE,CAChD,CACH,CAKO,MAAMG,WAAsCL,EAAW,CAAE,CAKzD,MAAMM,WAAyBN,EAAW,CAC/C,YAAYO,EAAM,CAChB,MAAM,gBAAgBA,CAAI,EAAE,CAC7B,CACH,CAKO,MAAMC,UAA6BR,EAAW,CAAE,CAKhD,MAAMS,WAA4BT,EAAW,CAClD,aAAc,CACZ,MAAM,2BAA2B,CAClC,CACH,CCxDA,MAAMU,EAAI,UACRC,EAAI,QACJC,EAAI,OAEOC,GAAa,CACxB,KAAMH,EACN,MAAOA,EACP,IAAKA,CACP,EAEaI,GAAW,CACtB,KAAMJ,EACN,MAAOC,EACP,IAAKD,CACP,EAEaK,GAAwB,CACnC,KAAML,EACN,MAAOC,EACP,IAAKD,EACL,QAASC,CACX,EAEaK,GAAY,CACvB,KAAMN,EACN,MAAOE,EACP,IAAKF,CACP,EAEaO,GAAY,CACvB,KAAMP,EACN,MAAOE,EACP,IAAKF,EACL,QAASE,CACX,EAEaM,GAAc,CACzB,KAAMR,EACN,OAAQA,CACV,EAEaS,GAAoB,CAC/B,KAAMT,EACN,OAAQA,EAC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