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AS,EAET,EAAW,AAAA,CAAA,EAAA,EAAA,WAAW,AAAX,EAAY,CAAC,EAAQ,IAClC,AAAyB,IAArB,EAAU,MAAM,GAIpB,EAAS,EAAO,SAAS,CAAC,OAC1B,EAAY,EAAU,SAAS,CAAC,OACzB,AAAiE,IAAjE,EAAS,OAAO,CAAC,EAAO,KAAK,CAAC,CAAC,EAAU,MAAM,EAAG,IACxD,CAAC,EAAS,EAET,EAAW,AAAA,CAAA,EAAA,EAAA,WAAW,AAAX,EAAY,CAAC,EAAQ,KAClC,GAAI,AAAqB,IAArB,EAAU,MAAM,CAClB,MAAO,CAAA,EAGT,EAAS,EAAO,SAAS,CAAC,OAG1B,IAAI,EAAO,EACP,EAAW,AAHf,CAAA,EAAY,EAAU,SAAS,CAAC,MAAhC,EAGyB,MAAM,CAC/B,KAAO,EAAO,GAAY,EAAO,MAAM,CAAE,IAAQ,CAC/C,IAAI,EAAQ,EAAO,KAAK,CAAC,EAAM,EAAO,GACtC,GAAI,AAAuC,IAAvC,EAAS,OAAO,CAAC,EAAW,GAC9B,MAAO,CAAA,CAEX,CAEA,MAAO,CAAA,CACT,EAAG,CAAC,EAAS,EAEb,MAAO,AAAA,CAAA,EAAA,EAAA,OAAO,AAAP,EAAQ,IAAO,CAAA,CACpB,WAAA,EACA,SAAA,EACA,SAAA,CACF,CAAA,EAAI,CAAC,EAAY,EAAU,EAAS,CACtC,C,E,C,M,Q,gB,Q,iD,O,E,E,E,C,E","sources":["<anon>","packages/@react-aria/i18n/src/index.ts","packages/@react-aria/i18n/src/context.tsx","packages/@react-aria/i18n/src/utils.ts","packages/@react-aria/i18n/src/useDefaultLocale.ts","packages/@react-aria/i18n/src/useLocalizedStringFormatter.ts","packages/@internationalized/string/src/index.ts","packages/@internationalized/string/src/LocalizedStringDictionary.ts","packages/@internationalized/string/src/LocalizedStringFormatter.ts","packages/@react-aria/i18n/src/useListFormatter.tsx","packages/@react-aria/i18n/src/useDateFormatter.ts","packages/@internationalized/date/src/index.ts","packages/@internationalized/date/src/CalendarDate.ts","packages/@internationalized/date/src/manipulation.ts","packages/@internationalized/date/src/conversion.ts","packages/@internationalized/date/src/calendars/GregorianCalendar.ts","packages/@internationalized/date/src/utils.ts","packages/@internationalized/date/src/queries.ts","packages/@internationalized/date/src/weekStartData.ts","packages/@internationalized/date/src/string.ts","packages/@internationalized/date/src/calendars/JapaneseCalendar.ts","packages/@internationalized/date/src/calendars/BuddhistCalendar.ts","packages/@internationalized/date/src/calendars/TaiwanCalendar.ts","packages/@internationalized/date/src/calendars/PersianCalendar.ts","packages/@internationalized/date/src/calendars/IndianCalendar.ts","packages/@internationalized/date/src/calendars/IslamicCalendar.ts","packages/@internationalized/date/src/calendars/HebrewCalendar.ts","packages/@internationalized/date/src/calendars/EthiopicCalendar.ts","packages/@internationalized/date/src/createCalendar.ts","packages/@internationalized/date/src/DateFormatter.ts","packages/@react-aria/i18n/src/useNumberFormatter.ts","packages/@internationalized/number/src/index.ts","packages/@internationalized/number/src/NumberFormatter.ts","packages/@internationalized/number/src/NumberParser.ts","packages/@react-aria/i18n/src/useCollator.ts","packages/@react-aria/i18n/src/useFilter.ts"],"sourcesContent":["// modules are defined as an array\n// [ module function, map of requires ]\n//\n// map of requires is short require name -> numeric require\n//\n// anything defined in a previous bundle is accessed via the\n// orig method which is the require for previous bundles\n\n(function (modules, entry, mainEntry, parcelRequireName, globalName) {\n /* eslint-disable no-undef */\n var globalObject =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n /* eslint-enable no-undef */\n\n // Save the require from previous bundle to this closure if any\n var previousRequire =\n typeof globalObject[parcelRequireName] === 'function' &&\n globalObject[parcelRequireName];\n\n var cache = previousRequire.cache || {};\n // Do not use `require` to prevent Webpack from trying to bundle this call\n var nodeRequire =\n typeof module !== 'undefined' &&\n typeof module.require === 'function' &&\n module.require.bind(module);\n\n function newRequire(name, jumped) {\n if (!cache[name]) {\n if (!modules[name]) {\n // if we cannot find the module within our internal map or\n // cache jump to the current global require ie. the last bundle\n // that was added to the page.\n var currentRequire =\n typeof globalObject[parcelRequireName] === 'function' &&\n globalObject[parcelRequireName];\n if (!jumped && currentRequire) {\n return currentRequire(name, true);\n }\n\n // If there are other bundles on this page the require from the\n // previous one is saved to 'previousRequire'. Repeat this as\n // many times as there are bundles until the module is found or\n // we exhaust the require chain.\n if (previousRequire) {\n return previousRequire(name, true);\n }\n\n // Try the node require function if it exists.\n if (nodeRequire && typeof name === 'string') {\n return nodeRequire(name);\n }\n\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n }\n\n localRequire.resolve = resolve;\n localRequire.cache = {};\n\n var module = (cache[name] = new newRequire.Module(name));\n\n modules[name][0].call(\n module.exports,\n localRequire,\n module,\n module.exports,\n globalObject\n );\n }\n\n return cache[name].exports;\n\n function localRequire(x) {\n var res = localRequire.resolve(x);\n return res === false ? {} : newRequire(res);\n }\n\n function resolve(x) {\n var id = modules[name][1][x];\n return id != null ? id : x;\n }\n }\n\n function Module(moduleName) {\n this.id = moduleName;\n this.bundle = newRequire;\n this.exports = {};\n }\n\n newRequire.isParcelRequire = true;\n newRequire.Module = Module;\n newRequire.modules = modules;\n newRequire.cache = cache;\n newRequire.parent = previousRequire;\n newRequire.register = function (id, exports) {\n modules[id] = [\n function (require, module) {\n module.exports = exports;\n },\n {},\n ];\n };\n\n Object.defineProperty(newRequire, 'root', {\n get: function () {\n return globalObject[parcelRequireName];\n },\n });\n\n globalObject[parcelRequireName] = newRequire;\n\n for (var i = 0; i < entry.length; i++) {\n newRequire(entry[i]);\n }\n\n if (mainEntry) {\n // Expose entry point to Node, AMD or browser globals\n // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js\n var mainExports = newRequire(mainEntry);\n\n // CommonJS\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n module.exports = mainExports;\n\n // RequireJS\n } else if (typeof define === 'function' && define.amd) {\n define(function () {\n return mainExports;\n });\n\n // <script>\n } else if (globalName) {\n this[globalName] = mainExports;\n }\n }\n})({\"hFrKJ\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"I18nProvider\", ()=>(0, _context.I18nProvider));\nparcelHelpers.export(exports, \"useLocale\", ()=>(0, _context.useLocale));\nparcelHelpers.export(exports, \"useMessageFormatter\", ()=>(0, _useMessageFormatter.useMessageFormatter));\nparcelHelpers.export(exports, \"useLocalizedStringFormatter\", ()=>(0, _useLocalizedStringFormatter.useLocalizedStringFormatter));\nparcelHelpers.export(exports, \"useLocalizedStringDictionary\", ()=>(0, _useLocalizedStringFormatter.useLocalizedStringDictionary));\nparcelHelpers.export(exports, \"useListFormatter\", ()=>(0, _useListFormatter.useListFormatter));\nparcelHelpers.export(exports, \"useDateFormatter\", ()=>(0, _useDateFormatter.useDateFormatter));\nparcelHelpers.export(exports, \"useNumberFormatter\", ()=>(0, _useNumberFormatter.useNumberFormatter));\nparcelHelpers.export(exports, \"useCollator\", ()=>(0, _useCollator.useCollator));\nparcelHelpers.export(exports, \"useFilter\", ()=>(0, _useFilter.useFilter));\nvar _context = require(\"./context\");\nvar _useMessageFormatter = require(\"./useMessageFormatter\");\nvar _useLocalizedStringFormatter = require(\"./useLocalizedStringFormatter\");\nvar _useListFormatter = require(\"./useListFormatter\");\nvar _useDateFormatter = require(\"./useDateFormatter\");\nvar _useNumberFormatter = require(\"./useNumberFormatter\");\nvar _useCollator = require(\"./useCollator\");\nvar _useFilter = require(\"./useFilter\");\n\n},{\"./context\":\"bPV6W\",\"./useMessageFormatter\":false,\"./useLocalizedStringFormatter\":\"iyZuB\",\"./useListFormatter\":\"3rRCd\",\"./useDateFormatter\":\"eAoPT\",\"./useNumberFormatter\":\"9i0Ex\",\"./useCollator\":\"150sj\",\"./useFilter\":\"jnqDt\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"bPV6W\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Provides the locale for the application to all child components.\n */ parcelHelpers.export(exports, \"I18nProvider\", ()=>I18nProvider);\n/**\n * Returns the current locale and layout direction.\n */ parcelHelpers.export(exports, \"useLocale\", ()=>useLocale);\nvar _utils = require(\"./utils\");\nvar _useDefaultLocale = require(\"./useDefaultLocale\");\nvar _react = require(\"react\");\nvar _reactDefault = parcelHelpers.interopDefault(_react);\nconst I18nContext = /*#__PURE__*/ (0, _reactDefault.default).createContext(null);\nfunction I18nProvider(props) {\n let { locale, children } = props;\n let defaultLocale = (0, _useDefaultLocale.useDefaultLocale)();\n let value = (0, _reactDefault.default).useMemo(()=>{\n if (!locale) return defaultLocale;\n return {\n locale,\n direction: (0, _utils.isRTL)(locale) ? 'rtl' : 'ltr'\n };\n }, [\n defaultLocale,\n locale\n ]);\n return /*#__PURE__*/ (0, _reactDefault.default).createElement(I18nContext.Provider, {\n value: value\n }, children);\n}\nfunction useLocale() {\n let defaultLocale = (0, _useDefaultLocale.useDefaultLocale)();\n let context = (0, _react.useContext)(I18nContext);\n return context || defaultLocale;\n}\n\n},{\"./utils\":\"dtyct\",\"./useDefaultLocale\":\"5B2MK\",\"react\":\"jEiK2\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"dtyct\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // https://en.wikipedia.org/wiki/Right-to-left\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.\n */ parcelHelpers.export(exports, \"isRTL\", ()=>isRTL);\nconst RTL_SCRIPTS = new Set([\n 'Arab',\n 'Syrc',\n 'Samr',\n 'Mand',\n 'Thaa',\n 'Mend',\n 'Nkoo',\n 'Adlm',\n 'Rohg',\n 'Hebr'\n]);\nconst RTL_LANGS = new Set([\n 'ae',\n 'ar',\n 'arc',\n 'bcc',\n 'bqi',\n 'ckb',\n 'dv',\n 'fa',\n 'glk',\n 'he',\n 'ku',\n 'mzn',\n 'nqo',\n 'pnb',\n 'ps',\n 'sd',\n 'ug',\n 'ur',\n 'yi'\n]);\nfunction isRTL(localeString) {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n if (Intl.Locale) {\n let locale = new Intl.Locale(localeString).maximize();\n // Use the text info object to get the direction if possible.\n // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo\n let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;\n if (textInfo) return textInfo.direction === 'rtl';\n // Fallback: guess using the script.\n // This is more accurate than guessing by language, since languages can be written in multiple scripts.\n if (locale.script) return RTL_SCRIPTS.has(locale.script);\n }\n // If not, just guess by the language (first part of the locale)\n let lang = localeString.split('-')[0];\n return RTL_LANGS.has(lang);\n}\n\n},{\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"5B2MK\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Gets the locale setting of the browser.\n */ parcelHelpers.export(exports, \"getDefaultLocale\", ()=>getDefaultLocale);\n/**\n * Returns the current browser/system language, and updates when it changes.\n */ parcelHelpers.export(exports, \"useDefaultLocale\", ()=>useDefaultLocale);\nvar _utils = require(\"./utils\");\nvar _react = require(\"react\");\nvar _ssr = require(\"@react-aria/ssr\");\n// Locale passed from server by PackageLocalizationProvider.\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nfunction getDefaultLocale() {\n let locale = typeof window !== 'undefined' && window[localeSymbol] || typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';\n try {\n Intl.DateTimeFormat.supportedLocalesOf([\n locale\n ]);\n } catch {\n locale = 'en-US';\n }\n return {\n locale,\n direction: (0, _utils.isRTL)(locale) ? 'rtl' : 'ltr'\n };\n}\nlet currentLocale = getDefaultLocale();\nlet listeners = new Set();\nfunction updateLocale() {\n currentLocale = getDefaultLocale();\n for (let listener of listeners)listener(currentLocale);\n}\nfunction useDefaultLocale() {\n let isSSR = (0, _ssr.useIsSSR)();\n let [defaultLocale, setDefaultLocale] = (0, _react.useState)(currentLocale);\n (0, _react.useEffect)(()=>{\n if (listeners.size === 0) window.addEventListener('languagechange', updateLocale);\n listeners.add(setDefaultLocale);\n return ()=>{\n listeners.delete(setDefaultLocale);\n if (listeners.size === 0) window.removeEventListener('languagechange', updateLocale);\n };\n }, []);\n // We cannot determine the browser's language on the server, so default to\n // en-US. This will be updated after hydration on the client to the correct value.\n if (isSSR) return {\n locale: 'en-US',\n direction: 'ltr'\n };\n return defaultLocale;\n}\n\n},{\"./utils\":\"dtyct\",\"react\":\"jEiK2\",\"@react-aria/ssr\":\"jNw7O\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"iyZuB\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Returns a cached LocalizedStringDictionary for the given strings.\n */ parcelHelpers.export(exports, \"useLocalizedStringDictionary\", ()=>useLocalizedStringDictionary);\n/**\n * Provides localized string formatting for the current locale. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers. Automatically updates when the locale changes.\n * @param strings - A mapping of languages to localized strings by key.\n */ parcelHelpers.export(exports, \"useLocalizedStringFormatter\", ()=>useLocalizedStringFormatter);\nvar _string = require(\"@internationalized/string\");\nvar _context = require(\"./context\");\nvar _react = require(\"react\");\nconst cache = new WeakMap();\nfunction getCachedDictionary(strings) {\n let dictionary = cache.get(strings);\n if (!dictionary) {\n dictionary = new (0, _string.LocalizedStringDictionary)(strings);\n cache.set(strings, dictionary);\n }\n return dictionary;\n}\nfunction useLocalizedStringDictionary(strings, packageName) {\n return packageName && (0, _string.LocalizedStringDictionary).getGlobalDictionaryForPackage(packageName) || getCachedDictionary(strings);\n}\nfunction useLocalizedStringFormatter(strings, packageName) {\n let { locale } = (0, _context.useLocale)();\n let dictionary = useLocalizedStringDictionary(strings, packageName);\n return (0, _react.useMemo)(()=>new (0, _string.LocalizedStringFormatter)(locale, dictionary), [\n locale,\n dictionary\n ]);\n}\n\n},{\"@internationalized/string\":\"3Ip8P\",\"./context\":\"bPV6W\",\"react\":\"jEiK2\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"3Ip8P\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"LocalizedStringDictionary\", ()=>(0, _localizedStringDictionary.LocalizedStringDictionary));\nparcelHelpers.export(exports, \"LocalizedStringFormatter\", ()=>(0, _localizedStringFormatter.LocalizedStringFormatter));\nvar _localizedStringDictionary = require(\"./LocalizedStringDictionary\");\nvar _localizedStringFormatter = require(\"./LocalizedStringFormatter\");\n\n},{\"./LocalizedStringDictionary\":\"52tI1\",\"./LocalizedStringFormatter\":\"gbCSK\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"52tI1\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Stores a mapping of localized strings. Can be used to find the\n * closest available string for a given locale.\n */ parcelHelpers.export(exports, \"LocalizedStringDictionary\", ()=>LocalizedStringDictionary);\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nconst stringsSymbol = Symbol.for('react-aria.i18n.strings');\nlet cachedGlobalStrings = undefined;\nclass LocalizedStringDictionary {\n constructor(messages, defaultLocale = 'en-US'){\n // Clone messages so we don't modify the original object.\n // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.\n this.strings = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));\n this.defaultLocale = defaultLocale;\n }\n /** Returns a localized string for the given key and locale. */ getStringForLocale(key, locale) {\n let strings = this.getStringsForLocale(locale);\n let string = strings[key];\n if (!string) throw new Error(`Could not find intl message ${key} in ${locale} locale`);\n return string;\n }\n /** Returns all localized strings for the given locale. */ getStringsForLocale(locale) {\n let strings = this.strings[locale];\n if (!strings) {\n strings = getStringsForLocale(locale, this.strings, this.defaultLocale);\n this.strings[locale] = strings;\n }\n return strings;\n }\n static getGlobalDictionaryForPackage(packageName) {\n if (typeof window === 'undefined') return null;\n let locale = window[localeSymbol];\n if (cachedGlobalStrings === undefined) {\n let globalStrings = window[stringsSymbol];\n if (!globalStrings) return null;\n cachedGlobalStrings = {};\n for(let pkg in globalStrings)cachedGlobalStrings[pkg] = new LocalizedStringDictionary({\n [locale]: globalStrings[pkg]\n }, locale);\n }\n let dictionary = cachedGlobalStrings?.[packageName];\n if (!dictionary) throw new Error(`Strings for package \"${packageName}\" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);\n return dictionary;\n }\n}\nfunction getStringsForLocale(locale, strings, defaultLocale = 'en-US') {\n // If there is an exact match, use it.\n if (strings[locale]) return strings[locale];\n // Attempt to find the closest match by language.\n // For example, if the locale is fr-CA (French Canadian), but there is only\n // an fr-FR (France) set of strings, use that.\n // This could be replaced with Intl.LocaleMatcher once it is supported.\n // https://github.com/tc39/proposal-intl-localematcher\n let language = getLanguage(locale);\n if (strings[language]) return strings[language];\n for(let key in strings){\n if (key.startsWith(language + '-')) return strings[key];\n }\n // Nothing close, use english.\n return strings[defaultLocale];\n}\nfunction getLanguage(locale) {\n // @ts-ignore\n if (Intl.Locale) // @ts-ignore\n return new Intl.Locale(locale).language;\n return locale.split('-')[0];\n}\n\n},{\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"gbCSK\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */ parcelHelpers.export(exports, \"LocalizedStringFormatter\", ()=>LocalizedStringFormatter);\nconst pluralRulesCache = new Map();\nconst numberFormatCache = new Map();\nclass LocalizedStringFormatter {\n constructor(locale, strings){\n this.locale = locale;\n this.strings = strings;\n }\n /** Formats a localized string for the given key with the provided variables. */ format(key, variables) {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n plural(count, options, type = 'cardinal') {\n let opt = options['=' + count];\n if (opt) return typeof opt === 'function' ? opt() : opt;\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {\n type\n });\n pluralRulesCache.set(key, pluralRules);\n }\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n number(value) {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n select(options, value) {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n\n},{\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"3rRCd\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Provides localized list formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the list formatter for performance.\n * @param options - Formatting options.\n */ parcelHelpers.export(exports, \"useListFormatter\", ()=>useListFormatter);\nvar _context = require(\"./context\");\nvar _react = require(\"react\");\nfunction useListFormatter(options = {}) {\n let { locale } = (0, _context.useLocale)();\n return (0, _react.useMemo)(()=>new Intl.ListFormat(locale, options), [\n locale,\n options\n ]);\n}\n\n},{\"./context\":\"bPV6W\",\"react\":\"jEiK2\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"eAoPT\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Provides localized date formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the date formatter for performance.\n * @param options - Formatting options.\n */ parcelHelpers.export(exports, \"useDateFormatter\", ()=>useDateFormatter);\nvar _date = require(\"@internationalized/date\");\nvar _utils = require(\"@react-aria/utils\");\nvar _context = require(\"./context\");\nvar _react = require(\"react\");\nfunction useDateFormatter(options) {\n // Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused.\n options = (0, _utils.useDeepMemo)(options ?? {}, isEqual);\n let { locale } = (0, _context.useLocale)();\n return (0, _react.useMemo)(()=>new (0, _date.DateFormatter)(locale, options), [\n locale,\n options\n ]);\n}\nfunction isEqual(a, b) {\n if (a === b) return true;\n let aKeys = Object.keys(a);\n let bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) return false;\n for (let key of aKeys){\n if (b[key] !== a[key]) return false;\n }\n return true;\n}\n\n},{\"@internationalized/date\":\"hIRVa\",\"@react-aria/utils\":\"e9Yvo\",\"./context\":\"bPV6W\",\"react\":\"jEiK2\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"hIRVa\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"CalendarDate\", ()=>(0, _calendarDate.CalendarDate));\nparcelHelpers.export(exports, \"CalendarDateTime\", ()=>(0, _calendarDate.CalendarDateTime));\nparcelHelpers.export(exports, \"Time\", ()=>(0, _calendarDate.Time));\nparcelHelpers.export(exports, \"ZonedDateTime\", ()=>(0, _calendarDate.ZonedDateTime));\nparcelHelpers.export(exports, \"GregorianCalendar\", ()=>(0, _gregorianCalendar.GregorianCalendar));\nparcelHelpers.export(exports, \"JapaneseCalendar\", ()=>(0, _japaneseCalendar.JapaneseCalendar));\nparcelHelpers.export(exports, \"BuddhistCalendar\", ()=>(0, _buddhistCalendar.BuddhistCalendar));\nparcelHelpers.export(exports, \"TaiwanCalendar\", ()=>(0, _taiwanCalendar.TaiwanCalendar));\nparcelHelpers.export(exports, \"PersianCalendar\", ()=>(0, _persianCalendar.PersianCalendar));\nparcelHelpers.export(exports, \"IndianCalendar\", ()=>(0, _indianCalendar.IndianCalendar));\nparcelHelpers.export(exports, \"IslamicCivilCalendar\", ()=>(0, _islamicCalendar.IslamicCivilCalendar));\nparcelHelpers.export(exports, \"IslamicTabularCalendar\", ()=>(0, _islamicCalendar.IslamicTabularCalendar));\nparcelHelpers.export(exports, \"IslamicUmalquraCalendar\", ()=>(0, _islamicCalendar.IslamicUmalquraCalendar));\nparcelHelpers.export(exports, \"HebrewCalendar\", ()=>(0, _hebrewCalendar.HebrewCalendar));\nparcelHelpers.export(exports, \"EthiopicCalendar\", ()=>(0, _ethiopicCalendar.EthiopicCalendar));\nparcelHelpers.export(exports, \"EthiopicAmeteAlemCalendar\", ()=>(0, _ethiopicCalendar.EthiopicAmeteAlemCalendar));\nparcelHelpers.export(exports, \"CopticCalendar\", ()=>(0, _ethiopicCalendar.CopticCalendar));\nparcelHelpers.export(exports, \"createCalendar\", ()=>(0, _createCalendar.createCalendar));\nparcelHelpers.export(exports, \"toCalendarDate\", ()=>(0, _conversion.toCalendarDate));\nparcelHelpers.export(exports, \"toCalendarDateTime\", ()=>(0, _conversion.toCalendarDateTime));\nparcelHelpers.export(exports, \"toTime\", ()=>(0, _conversion.toTime));\nparcelHelpers.export(exports, \"toCalendar\", ()=>(0, _conversion.toCalendar));\nparcelHelpers.export(exports, \"toZoned\", ()=>(0, _conversion.toZoned));\nparcelHelpers.export(exports, \"toTimeZone\", ()=>(0, _conversion.toTimeZone));\nparcelHelpers.export(exports, \"toLocalTimeZone\", ()=>(0, _conversion.toLocalTimeZone));\nparcelHelpers.export(exports, \"fromDate\", ()=>(0, _conversion.fromDate));\nparcelHelpers.export(exports, \"fromAbsolute\", ()=>(0, _conversion.fromAbsolute));\nparcelHelpers.export(exports, \"isSameDay\", ()=>(0, _queries.isSameDay));\nparcelHelpers.export(exports, \"isSameMonth\", ()=>(0, _queries.isSameMonth));\nparcelHelpers.export(exports, \"isSameYear\", ()=>(0, _queries.isSameYear));\nparcelHelpers.export(exports, \"isEqualDay\", ()=>(0, _queries.isEqualDay));\nparcelHelpers.export(exports, \"isEqualMonth\", ()=>(0, _queries.isEqualMonth));\nparcelHelpers.export(exports, \"isEqualYear\", ()=>(0, _queries.isEqualYear));\nparcelHelpers.export(exports, \"isToday\", ()=>(0, _queries.isToday));\nparcelHelpers.export(exports, \"getDayOfWeek\", ()=>(0, _queries.getDayOfWeek));\nparcelHelpers.export(exports, \"now\", ()=>(0, _queries.now));\nparcelHelpers.export(exports, \"today\", ()=>(0, _queries.today));\nparcelHelpers.export(exports, \"getHoursInDay\", ()=>(0, _queries.getHoursInDay));\nparcelHelpers.export(exports, \"getLocalTimeZone\", ()=>(0, _queries.getLocalTimeZone));\nparcelHelpers.export(exports, \"startOfMonth\", ()=>(0, _queries.startOfMonth));\nparcelHelpers.export(exports, \"startOfWeek\", ()=>(0, _queries.startOfWeek));\nparcelHelpers.export(exports, \"startOfYear\", ()=>(0, _queries.startOfYear));\nparcelHelpers.export(exports, \"endOfMonth\", ()=>(0, _queries.endOfMonth));\nparcelHelpers.export(exports, \"endOfWeek\", ()=>(0, _queries.endOfWeek));\nparcelHelpers.export(exports, \"endOfYear\", ()=>(0, _queries.endOfYear));\nparcelHelpers.export(exports, \"getMinimumMonthInYear\", ()=>(0, _queries.getMinimumMonthInYear));\nparcelHelpers.export(exports, \"getMinimumDayInMonth\", ()=>(0, _queries.getMinimumDayInMonth));\nparcelHelpers.export(exports, \"getWeeksInMonth\", ()=>(0, _queries.getWeeksInMonth));\nparcelHelpers.export(exports, \"minDate\", ()=>(0, _queries.minDate));\nparcelHelpers.export(exports, \"maxDate\", ()=>(0, _queries.maxDate));\nparcelHelpers.export(exports, \"isWeekend\", ()=>(0, _queries.isWeekend));\nparcelHelpers.export(exports, \"isWeekday\", ()=>(0, _queries.isWeekday));\nparcelHelpers.export(exports, \"parseDate\", ()=>(0, _string.parseDate));\nparcelHelpers.export(exports, \"parseDateTime\", ()=>(0, _string.parseDateTime));\nparcelHelpers.export(exports, \"parseTime\", ()=>(0, _string.parseTime));\nparcelHelpers.export(exports, \"parseAbsolute\", ()=>(0, _string.parseAbsolute));\nparcelHelpers.export(exports, \"parseAbsoluteToLocal\", ()=>(0, _string.parseAbsoluteToLocal));\nparcelHelpers.export(exports, \"parseZonedDateTime\", ()=>(0, _string.parseZonedDateTime));\nparcelHelpers.export(exports, \"parseDuration\", ()=>(0, _string.parseDuration));\nparcelHelpers.export(exports, \"DateFormatter\", ()=>(0, _dateFormatter.DateFormatter));\nvar _calendarDate = require(\"./CalendarDate\");\nvar _gregorianCalendar = require(\"./calendars/GregorianCalendar\");\nvar _japaneseCalendar = require(\"./calendars/JapaneseCalendar\");\nvar _buddhistCalendar = require(\"./calendars/BuddhistCalendar\");\nvar _taiwanCalendar = require(\"./calendars/TaiwanCalendar\");\nvar _persianCalendar = require(\"./calendars/PersianCalendar\");\nvar _indianCalendar = require(\"./calendars/IndianCalendar\");\nvar _islamicCalendar = require(\"./calendars/IslamicCalendar\");\nvar _hebrewCalendar = require(\"./calendars/HebrewCalendar\");\nvar _ethiopicCalendar = require(\"./calendars/EthiopicCalendar\");\nvar _createCalendar = require(\"./createCalendar\");\nvar _conversion = require(\"./conversion\");\nvar _queries = require(\"./queries\");\nvar _string = require(\"./string\");\nvar _dateFormatter = require(\"./DateFormatter\");\n\n},{\"./CalendarDate\":\"jKRe7\",\"./calendars/GregorianCalendar\":\"5KBzD\",\"./calendars/JapaneseCalendar\":false,\"./calendars/BuddhistCalendar\":false,\"./calendars/TaiwanCalendar\":false,\"./calendars/PersianCalendar\":false,\"./calendars/IndianCalendar\":false,\"./calendars/IslamicCalendar\":false,\"./calendars/HebrewCalendar\":false,\"./calendars/EthiopicCalendar\":false,\"./createCalendar\":\"l2thl\",\"./conversion\":\"8UTRc\",\"./queries\":\"fAxo9\",\"./string\":\"iwOHm\",\"./DateFormatter\":\"dowtt\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"jKRe7\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/** A CalendarDate represents a date without any time components in a specific calendar system. */ parcelHelpers.export(exports, \"CalendarDate\", ()=>CalendarDate);\n/** A Time represents a clock time without any date components. */ parcelHelpers.export(exports, \"Time\", ()=>Time);\n/** A CalendarDateTime represents a date and time without a time zone, in a specific calendar system. */ parcelHelpers.export(exports, \"CalendarDateTime\", ()=>CalendarDateTime);\n/** A ZonedDateTime represents a date and time in a specific time zone and calendar system. */ parcelHelpers.export(exports, \"ZonedDateTime\", ()=>ZonedDateTime);\nvar _manipulation = require(\"./manipulation\");\nvar _queries = require(\"./queries\");\nvar _string = require(\"./string\");\nvar _gregorianCalendar = require(\"./calendars/GregorianCalendar\");\nvar _conversion = require(\"./conversion\");\nfunction shiftArgs(args) {\n let calendar = typeof args[0] === 'object' ? args.shift() : new (0, _gregorianCalendar.GregorianCalendar)();\n let era;\n if (typeof args[0] === 'string') era = args.shift();\n else {\n let eras = calendar.getEras();\n era = eras[eras.length - 1];\n }\n let year = args.shift();\n let month = args.shift();\n let day = args.shift();\n return [\n calendar,\n era,\n year,\n month,\n day\n ];\n}\nclass CalendarDate {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.\n // If that behavior is desired, use the AnyCalendarDate interface instead.\n // @ts-ignore\n #type;\n constructor(...args){\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n (0, _manipulation.constrain)(this);\n }\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new CalendarDate(this.calendar, this.era, this.year, this.month, this.day);\n else return new CalendarDate(this.calendar, this.year, this.month, this.day);\n }\n /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {\n return (0, _manipulation.add)(this, duration);\n }\n /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {\n return (0, _manipulation.subtract)(this, duration);\n }\n /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, _manipulation.set)(this, fields);\n }\n /**\n * Returns a new `CalendarDate` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, _manipulation.cycleDate)(this, field, amount, options);\n }\n /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {\n return (0, _conversion.toDate)(this, timeZone);\n }\n /** Converts the date to an ISO 8601 formatted string. */ toString() {\n return (0, _string.dateToString)(this);\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n return (0, _queries.compareDate)(this, b);\n }\n}\nclass Time {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n constructor(hour = 0, minute = 0, second = 0, millisecond = 0){\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond;\n (0, _manipulation.constrainTime)(this);\n }\n /** Returns a copy of this time. */ copy() {\n return new Time(this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `Time` with the given duration added to it. */ add(duration) {\n return (0, _manipulation.addTime)(this, duration);\n }\n /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {\n return (0, _manipulation.subtractTime)(this, duration);\n }\n /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, _manipulation.setTime)(this, fields);\n }\n /**\n * Returns a new `Time` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, _manipulation.cycleTime)(this, field, amount, options);\n }\n /** Converts the time to an ISO 8601 formatted string. */ toString() {\n return (0, _string.timeToString)(this);\n }\n /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {\n return (0, _queries.compareTime)(this, b);\n }\n}\nclass CalendarDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n constructor(...args){\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n (0, _manipulation.constrain)(this);\n }\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new CalendarDateTime(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n else return new CalendarDateTime(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {\n return (0, _manipulation.add)(this, duration);\n }\n /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {\n return (0, _manipulation.subtract)(this, duration);\n }\n /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, _manipulation.set)((0, _manipulation.setTime)(this, fields), fields);\n }\n /**\n * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n switch(field){\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return (0, _manipulation.cycleDate)(this, field, amount, options);\n default:\n return (0, _manipulation.cycleTime)(this, field, amount, options);\n }\n }\n /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {\n return (0, _conversion.toDate)(this, timeZone, disambiguation);\n }\n /** Converts the date to an ISO 8601 formatted string. */ toString() {\n return (0, _string.dateTimeToString)(this);\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n let res = (0, _queries.compareDate)(this, b);\n if (res === 0) return (0, _queries.compareTime)(this, (0, _conversion.toCalendarDateTime)(b));\n return res;\n }\n}\nclass ZonedDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n constructor(...args){\n let [calendar, era, year, month, day] = shiftArgs(args);\n let timeZone = args.shift();\n let offset = args.shift();\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.timeZone = timeZone;\n this.offset = offset;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n (0, _manipulation.constrain)(this);\n }\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new ZonedDateTime(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n else return new ZonedDateTime(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {\n return (0, _manipulation.addZoned)(this, duration);\n }\n /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {\n return (0, _manipulation.subtractZoned)(this, duration);\n }\n /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {\n return (0, _manipulation.setZoned)(this, fields, disambiguation);\n }\n /**\n * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, _manipulation.cycleZoned)(this, field, amount, options);\n }\n /** Converts the date to a native JavaScript Date object. */ toDate() {\n return (0, _conversion.zonedToDate)(this);\n }\n /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {\n return (0, _string.zonedDateTimeToString)(this);\n }\n /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {\n return this.toDate().toISOString();\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n // TODO: Is this a bad idea??\n return this.toDate().getTime() - (0, _conversion.toZoned)(b, this.timeZone).toDate().getTime();\n }\n}\n\n},{\"./manipulation\":\"26dQB\",\"./queries\":\"fAxo9\",\"./string\":\"iwOHm\",\"./calendars/GregorianCalendar\":\"5KBzD\",\"./conversion\":\"8UTRc\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"26dQB\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"add\", ()=>add);\nparcelHelpers.export(exports, \"constrain\", ()=>constrain);\nparcelHelpers.export(exports, \"invertDuration\", ()=>invertDuration);\nparcelHelpers.export(exports, \"subtract\", ()=>subtract);\nparcelHelpers.export(exports, \"set\", ()=>set);\nparcelHelpers.export(exports, \"setTime\", ()=>setTime);\nparcelHelpers.export(exports, \"constrainTime\", ()=>constrainTime);\nparcelHelpers.export(exports, \"addTime\", ()=>addTime);\nparcelHelpers.export(exports, \"subtractTime\", ()=>subtractTime);\nparcelHelpers.export(exports, \"cycleDate\", ()=>cycleDate);\nparcelHelpers.export(exports, \"cycleTime\", ()=>cycleTime);\nparcelHelpers.export(exports, \"addZoned\", ()=>addZoned);\nparcelHelpers.export(exports, \"subtractZoned\", ()=>subtractZoned);\nparcelHelpers.export(exports, \"cycleZoned\", ()=>cycleZoned);\nparcelHelpers.export(exports, \"setZoned\", ()=>setZoned);\nvar _conversion = require(\"./conversion\");\nvar _gregorianCalendar = require(\"./calendars/GregorianCalendar\");\nconst ONE_HOUR = 3600000;\nfunction add(date, duration) {\n let mutableDate = date.copy();\n let days = 'hour' in mutableDate ? addTimeFields(mutableDate, duration) : 0;\n addYears(mutableDate, duration.years || 0);\n if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);\n mutableDate.month += duration.months || 0;\n balanceYearMonth(mutableDate);\n constrainMonthDay(mutableDate);\n mutableDate.day += (duration.weeks || 0) * 7;\n mutableDate.day += duration.days || 0;\n mutableDate.day += days;\n balanceDay(mutableDate);\n if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);\n // Constrain in case adding ended up with a date outside the valid range for the calendar system.\n // The behavior here is slightly different than when constraining in the `set` function in that\n // we adjust smaller fields to their minimum/maximum values rather than constraining each field\n // individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.\n if (mutableDate.year < 1) {\n mutableDate.year = 1;\n mutableDate.month = 1;\n mutableDate.day = 1;\n }\n let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);\n if (mutableDate.year > maxYear) {\n let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);\n mutableDate.year = maxYear;\n mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);\n mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);\n }\n if (mutableDate.month < 1) {\n mutableDate.month = 1;\n mutableDate.day = 1;\n }\n let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);\n if (mutableDate.month > maxMonth) {\n mutableDate.month = maxMonth;\n mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);\n }\n mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));\n return mutableDate;\n}\nfunction addYears(date, years) {\n if (date.calendar.isInverseEra?.(date)) years = -years;\n date.year += years;\n}\nfunction balanceYearMonth(date) {\n while(date.month < 1){\n addYears(date, -1);\n date.month += date.calendar.getMonthsInYear(date);\n }\n let monthsInYear = 0;\n while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){\n date.month -= monthsInYear;\n addYears(date, 1);\n }\n}\nfunction balanceDay(date) {\n while(date.day < 1){\n date.month--;\n balanceYearMonth(date);\n date.day += date.calendar.getDaysInMonth(date);\n }\n while(date.day > date.calendar.getDaysInMonth(date)){\n date.day -= date.calendar.getDaysInMonth(date);\n date.month++;\n balanceYearMonth(date);\n }\n}\nfunction constrainMonthDay(date) {\n date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));\n date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));\n}\nfunction constrain(date) {\n if (date.calendar.constrainDate) date.calendar.constrainDate(date);\n date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));\n constrainMonthDay(date);\n}\nfunction invertDuration(duration) {\n let inverseDuration = {};\n for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];\n return inverseDuration;\n}\nfunction subtract(date, duration) {\n return add(date, invertDuration(duration));\n}\nfunction set(date, fields) {\n let mutableDate = date.copy();\n if (fields.era != null) mutableDate.era = fields.era;\n if (fields.year != null) mutableDate.year = fields.year;\n if (fields.month != null) mutableDate.month = fields.month;\n if (fields.day != null) mutableDate.day = fields.day;\n constrain(mutableDate);\n return mutableDate;\n}\nfunction setTime(value, fields) {\n let mutableValue = value.copy();\n if (fields.hour != null) mutableValue.hour = fields.hour;\n if (fields.minute != null) mutableValue.minute = fields.minute;\n if (fields.second != null) mutableValue.second = fields.second;\n if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;\n constrainTime(mutableValue);\n return mutableValue;\n}\nfunction balanceTime(time) {\n time.second += Math.floor(time.millisecond / 1000);\n time.millisecond = nonNegativeMod(time.millisecond, 1000);\n time.minute += Math.floor(time.second / 60);\n time.second = nonNegativeMod(time.second, 60);\n time.hour += Math.floor(time.minute / 60);\n time.minute = nonNegativeMod(time.minute, 60);\n let days = Math.floor(time.hour / 24);\n time.hour = nonNegativeMod(time.hour, 24);\n return days;\n}\nfunction constrainTime(time) {\n time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));\n time.second = Math.max(0, Math.min(time.second, 59));\n time.minute = Math.max(0, Math.min(time.minute, 59));\n time.hour = Math.max(0, Math.min(time.hour, 23));\n}\nfunction nonNegativeMod(a, b) {\n let result = a % b;\n if (result < 0) result += b;\n return result;\n}\nfunction addTimeFields(time, duration) {\n time.hour += duration.hours || 0;\n time.minute += duration.minutes || 0;\n time.second += duration.seconds || 0;\n time.millisecond += duration.milliseconds || 0;\n return balanceTime(time);\n}\nfunction addTime(time, duration) {\n let res = time.copy();\n addTimeFields(res, duration);\n return res;\n}\nfunction subtractTime(time, duration) {\n return addTime(time, invertDuration(duration));\n}\nfunction cycleDate(value, field, amount, options) {\n let mutable = value.copy();\n switch(field){\n case 'era':\n {\n let eras = value.calendar.getEras();\n let eraIndex = eras.indexOf(value.era);\n if (eraIndex < 0) throw new Error('Invalid era: ' + value.era);\n eraIndex = cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);\n mutable.era = eras[eraIndex];\n // Constrain the year and other fields within the era, so the era doesn't change when we balance below.\n constrain(mutable);\n break;\n }\n case 'year':\n if (mutable.calendar.isInverseEra?.(mutable)) amount = -amount;\n // The year field should not cycle within the era as that can cause weird behavior affecting other fields.\n // We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back\n // we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.\n mutable.year = cycleValue(value.year, amount, -Infinity, 9999, options?.round);\n if (mutable.year === -Infinity) mutable.year = 1;\n if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);\n break;\n case 'month':\n mutable.month = cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);\n break;\n case 'day':\n mutable.day = cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);\n break;\n default:\n throw new Error('Unsupported field ' + field);\n }\n if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);\n constrain(mutable);\n return mutable;\n}\nfunction cycleTime(value, field, amount, options) {\n let mutable = value.copy();\n switch(field){\n case 'hour':\n {\n let hours = value.hour;\n let min = 0;\n let max = 23;\n if (options?.hourCycle === 12) {\n let isPM = hours >= 12;\n min = isPM ? 12 : 0;\n max = isPM ? 23 : 11;\n }\n mutable.hour = cycleValue(hours, amount, min, max, options?.round);\n break;\n }\n case 'minute':\n mutable.minute = cycleValue(value.minute, amount, 0, 59, options?.round);\n break;\n case 'second':\n mutable.second = cycleValue(value.second, amount, 0, 59, options?.round);\n break;\n case 'millisecond':\n mutable.millisecond = cycleValue(value.millisecond, amount, 0, 999, options?.round);\n break;\n default:\n throw new Error('Unsupported field ' + field);\n }\n return mutable;\n}\nfunction cycleValue(value, amount, min, max, round = false) {\n if (round) {\n value += Math.sign(amount);\n if (value < min) value = max;\n let div = Math.abs(amount);\n if (amount > 0) value = Math.ceil(value / div) * div;\n else value = Math.floor(value / div) * div;\n if (value > max) value = min;\n } else {\n value += amount;\n if (value < min) value = max - (min - value - 1);\n else if (value > max) value = min + (value - max - 1);\n }\n return value;\n}\nfunction addZoned(dateTime, duration) {\n let ms;\n if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {\n let res = add((0, _conversion.toCalendarDateTime)(dateTime), {\n years: duration.years,\n months: duration.months,\n weeks: duration.weeks,\n days: duration.days\n });\n // Changing the date may change the timezone offset, so we need to recompute\n // using the 'compatible' disambiguation.\n ms = (0, _conversion.toAbsolute)(res, dateTime.timeZone);\n } else // Otherwise, preserve the offset of the original date.\n ms = (0, _conversion.epochFromDate)(dateTime) - dateTime.offset;\n // Perform time manipulation in milliseconds rather than on the original time fields to account for DST.\n // For example, adding one hour during a DST transition may result in the hour field staying the same or\n // skipping an hour. This results in the offset field changing value instead of the specified field.\n ms += duration.milliseconds || 0;\n ms += (duration.seconds || 0) * 1000;\n ms += (duration.minutes || 0) * 60000;\n ms += (duration.hours || 0) * 3600000;\n let res = (0, _conversion.fromAbsolute)(ms, dateTime.timeZone);\n return (0, _conversion.toCalendar)(res, dateTime.calendar);\n}\nfunction subtractZoned(dateTime, duration) {\n return addZoned(dateTime, invertDuration(duration));\n}\nfunction cycleZoned(dateTime, field, amount, options) {\n // For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.\n // For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC\n // offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.\n switch(field){\n case 'hour':\n {\n let min = 0;\n let max = 23;\n if (options?.hourCycle === 12) {\n let isPM = dateTime.hour >= 12;\n min = isPM ? 12 : 0;\n max = isPM ? 23 : 11;\n }\n // The minimum and maximum hour may be affected by daylight saving time.\n // For example, it might jump forward at midnight, and skip 1am.\n // Or it might end at midnight and repeat the 11pm hour. To handle this, we get\n // the possible absolute times for the min and max, and find the maximum range\n // that is within the current day.\n let plainDateTime = (0, _conversion.toCalendarDateTime)(dateTime);\n let minDate = (0, _conversion.toCalendar)(setTime(plainDateTime, {\n hour: min\n }), new (0, _gregorianCalendar.GregorianCalendar)());\n let minAbsolute = [\n (0, _conversion.toAbsolute)(minDate, dateTime.timeZone, 'earlier'),\n (0, _conversion.toAbsolute)(minDate, dateTime.timeZone, 'later')\n ].filter((ms)=>(0, _conversion.fromAbsolute)(ms, dateTime.timeZone).day === minDate.day)[0];\n let maxDate = (0, _conversion.toCalendar)(setTime(plainDateTime, {\n hour: max\n }), new (0, _gregorianCalendar.GregorianCalendar)());\n let maxAbsolute = [\n (0, _conversion.toAbsolute)(maxDate, dateTime.timeZone, 'earlier'),\n (0, _conversion.toAbsolute)(maxDate, dateTime.timeZone, 'later')\n ].filter((ms)=>(0, _conversion.fromAbsolute)(ms, dateTime.timeZone).day === maxDate.day).pop();\n // Since hours may repeat, we need to operate on the absolute time in milliseconds.\n // This is done in hours from the Unix epoch so that cycleValue works correctly,\n // and then converted back to milliseconds.\n let ms = (0, _conversion.epochFromDate)(dateTime) - dateTime.offset;\n let hours = Math.floor(ms / ONE_HOUR);\n let remainder = ms % ONE_HOUR;\n ms = cycleValue(hours, amount, Math.floor(minAbsolute / ONE_HOUR), Math.floor(maxAbsolute / ONE_HOUR), options?.round) * ONE_HOUR + remainder;\n // Now compute the new timezone offset, and convert the absolute time back to local time.\n return (0, _conversion.toCalendar)((0, _conversion.fromAbsolute)(ms, dateTime.timeZone), dateTime.calendar);\n }\n case 'minute':\n case 'second':\n case 'millisecond':\n // @ts-ignore\n return cycleTime(dateTime, field, amount, options);\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n {\n let res = cycleDate((0, _conversion.toCalendarDateTime)(dateTime), field, amount, options);\n let ms = (0, _conversion.toAbsolute)(res, dateTime.timeZone);\n return (0, _conversion.toCalendar)((0, _conversion.fromAbsolute)(ms, dateTime.timeZone), dateTime.calendar);\n }\n default:\n throw new Error('Unsupported field ' + field);\n }\n}\nfunction setZoned(dateTime, fields, disambiguation) {\n // Set the date/time fields, and recompute the UTC offset to account for DST changes.\n // We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.\n let plainDateTime = (0, _conversion.toCalendarDateTime)(dateTime);\n let res = setTime(set(plainDateTime, fields), fields);\n // If the resulting plain date time values are equal, return the original time.\n // We don't want to change the offset when setting the time to the same value.\n if (res.compare(plainDateTime) === 0) return dateTime;\n let ms = (0, _conversion.toAbsolute)(res, dateTime.timeZone, disambiguation);\n return (0, _conversion.toCalendar)((0, _conversion.fromAbsolute)(ms, dateTime.timeZone), dateTime.calendar);\n}\n\n},{\"./conversion\":\"8UTRc\",\"./calendars/GregorianCalendar\":\"5KBzD\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"8UTRc\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"epochFromDate\", ()=>epochFromDate);\nparcelHelpers.export(exports, \"getTimeZoneOffset\", ()=>getTimeZoneOffset);\nparcelHelpers.export(exports, \"possibleAbsolutes\", ()=>possibleAbsolutes);\nparcelHelpers.export(exports, \"toAbsolute\", ()=>toAbsolute);\nparcelHelpers.export(exports, \"toDate\", ()=>toDate);\n/**\n * Takes a Unix epoch (milliseconds since 1970) and converts it to the provided time zone.\n */ parcelHelpers.export(exports, \"fromAbsolute\", ()=>fromAbsolute);\n/**\n * Takes a `Date` object and converts it to the provided time zone.\n */ parcelHelpers.export(exports, \"fromDate\", ()=>fromDate);\nparcelHelpers.export(exports, \"fromDateToLocal\", ()=>fromDateToLocal);\n/** Converts a value with date components such as a `CalendarDateTime` or `ZonedDateTime` into a `CalendarDate`. */ parcelHelpers.export(exports, \"toCalendarDate\", ()=>toCalendarDate);\nparcelHelpers.export(exports, \"toDateFields\", ()=>toDateFields);\nparcelHelpers.export(exports, \"toTimeFields\", ()=>toTimeFields);\n/**\n * Converts a date value to a `CalendarDateTime`. An optional `Time` value can be passed to set the time\n * of the resulting value, otherwise it will default to midnight.\n */ parcelHelpers.export(exports, \"toCalendarDateTime\", ()=>toCalendarDateTime);\n/** Extracts the time components from a value containing a date and time. */ parcelHelpers.export(exports, \"toTime\", ()=>toTime);\n/** Converts a date from one calendar system to another. */ parcelHelpers.export(exports, \"toCalendar\", ()=>toCalendar);\n/**\n * Converts a date value to a `ZonedDateTime` in the provided time zone. The `disambiguation` option can be set\n * to control how values that fall on daylight saving time changes are interpreted.\n */ parcelHelpers.export(exports, \"toZoned\", ()=>toZoned);\nparcelHelpers.export(exports, \"zonedToDate\", ()=>zonedToDate);\n/** Converts a `ZonedDateTime` from one time zone to another. */ parcelHelpers.export(exports, \"toTimeZone\", ()=>toTimeZone);\n/** Converts the given `ZonedDateTime` into the user's local time zone. */ parcelHelpers.export(exports, \"toLocalTimeZone\", ()=>toLocalTimeZone);\nvar _calendarDate = require(\"./CalendarDate\");\nvar _manipulation = require(\"./manipulation\");\nvar _gregorianCalendar = require(\"./calendars/GregorianCalendar\");\nvar _queries = require(\"./queries\");\nfunction epochFromDate(date) {\n date = toCalendar(date, new (0, _gregorianCalendar.GregorianCalendar)());\n let year = (0, _gregorianCalendar.getExtendedYear)(date.era, date.year);\n return epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n}\nfunction epochFromParts(year, month, day, hour, minute, second, millisecond) {\n // Note: Date.UTC() interprets one and two-digit years as being in the\n // 20th century, so don't use it\n let date = new Date();\n date.setUTCHours(hour, minute, second, millisecond);\n date.setUTCFullYear(year, month - 1, day);\n return date.getTime();\n}\nfunction getTimeZoneOffset(ms, timeZone) {\n // Fast path for UTC.\n if (timeZone === 'UTC') return 0;\n // Fast path: for local timezone after 1970, use native Date.\n if (ms > 0 && timeZone === (0, _queries.getLocalTimeZone)()) return new Date(ms).getTimezoneOffset() * -60000;\n let { year, month, day, hour, minute, second } = getTimeZoneParts(ms, timeZone);\n let utc = epochFromParts(year, month, day, hour, minute, second, 0);\n return utc - Math.floor(ms / 1000) * 1000;\n}\nconst formattersByTimeZone = new Map();\nfunction getTimeZoneParts(ms, timeZone) {\n let formatter = formattersByTimeZone.get(timeZone);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-US', {\n timeZone,\n hour12: false,\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n });\n formattersByTimeZone.set(timeZone, formatter);\n }\n let parts = formatter.formatToParts(new Date(ms));\n let namedParts = {};\n for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;\n return {\n // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253\n year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,\n month: +namedParts.month,\n day: +namedParts.day,\n hour: namedParts.hour === '24' ? 0 : +namedParts.hour,\n minute: +namedParts.minute,\n second: +namedParts.second\n };\n}\nconst DAYMILLIS = 86400000;\nfunction possibleAbsolutes(date, timeZone) {\n let ms = epochFromDate(date);\n let earlier = ms - getTimeZoneOffset(ms - DAYMILLIS, timeZone);\n let later = ms - getTimeZoneOffset(ms + DAYMILLIS, timeZone);\n return getValidWallTimes(date, timeZone, earlier, later);\n}\nfunction getValidWallTimes(date, timeZone, earlier, later) {\n let found = earlier === later ? [\n earlier\n ] : [\n earlier,\n later\n ];\n return found.filter((absolute)=>isValidWallTime(date, timeZone, absolute));\n}\nfunction isValidWallTime(date, timeZone, absolute) {\n let parts = getTimeZoneParts(absolute, timeZone);\n return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;\n}\nfunction toAbsolute(date, timeZone, disambiguation = 'compatible') {\n let dateTime = toCalendarDateTime(date);\n // Fast path: if the time zone is UTC, use native Date.\n if (timeZone === 'UTC') return epochFromDate(dateTime);\n // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.\n if (timeZone === (0, _queries.getLocalTimeZone)() && disambiguation === 'compatible') {\n dateTime = toCalendar(dateTime, new (0, _gregorianCalendar.GregorianCalendar)());\n // Don't use Date constructor here because two-digit years are interpreted in the 20th century.\n let date = new Date();\n let year = (0, _gregorianCalendar.getExtendedYear)(dateTime.era, dateTime.year);\n date.setFullYear(year, dateTime.month - 1, dateTime.day);\n date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n return date.getTime();\n }\n let ms = epochFromDate(dateTime);\n let offsetBefore = getTimeZoneOffset(ms - DAYMILLIS, timeZone);\n let offsetAfter = getTimeZoneOffset(ms + DAYMILLIS, timeZone);\n let valid = getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);\n if (valid.length === 1) return valid[0];\n if (valid.length > 1) switch(disambiguation){\n // 'compatible' means 'earlier' for \"fall back\" transitions\n case 'compatible':\n case 'earlier':\n return valid[0];\n case 'later':\n return valid[valid.length - 1];\n case 'reject':\n throw new RangeError('Multiple possible absolute times found');\n }\n switch(disambiguation){\n case 'earlier':\n return Math.min(ms - offsetBefore, ms - offsetAfter);\n // 'compatible' means 'later' for \"spring forward\" transitions\n case 'compatible':\n case 'later':\n return Math.max(ms - offsetBefore, ms - offsetAfter);\n case 'reject':\n throw new RangeError('No such absolute time found');\n }\n}\nfunction toDate(dateTime, timeZone, disambiguation = 'compatible') {\n return new Date(toAbsolute(dateTime, timeZone, disambiguation));\n}\nfunction fromAbsolute(ms, timeZone) {\n let offset = getTimeZoneOffset(ms, timeZone);\n let date = new Date(ms + offset);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth() + 1;\n let day = date.getUTCDate();\n let hour = date.getUTCHours();\n let minute = date.getUTCMinutes();\n let second = date.getUTCSeconds();\n let millisecond = date.getUTCMilliseconds();\n return new (0, _calendarDate.ZonedDateTime)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);\n}\nfunction fromDate(date, timeZone) {\n return fromAbsolute(date.getTime(), timeZone);\n}\nfunction fromDateToLocal(date) {\n return fromDate(date, (0, _queries.getLocalTimeZone)());\n}\nfunction toCalendarDate(dateTime) {\n return new (0, _calendarDate.CalendarDate)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);\n}\nfunction toDateFields(date) {\n return {\n era: date.era,\n year: date.year,\n month: date.month,\n day: date.day\n };\n}\nfunction toTimeFields(date) {\n return {\n hour: date.hour,\n minute: date.minute,\n second: date.second,\n millisecond: date.millisecond\n };\n}\nfunction toCalendarDateTime(date, time) {\n let hour = 0, minute = 0, second = 0, millisecond = 0;\n if ('timeZone' in date) ({ hour, minute, second, millisecond } = date);\n else if ('hour' in date && !time) return date;\n if (time) ({ hour, minute, second, millisecond } = time);\n return new (0, _calendarDate.CalendarDateTime)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);\n}\nfunction toTime(dateTime) {\n return new (0, _calendarDate.Time)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n}\nfunction toCalendar(date, calendar) {\n if (date.calendar.identifier === calendar.identifier) return date;\n let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));\n let copy = date.copy();\n copy.calendar = calendar;\n copy.era = calendarDate.era;\n copy.year = calendarDate.year;\n copy.month = calendarDate.month;\n copy.day = calendarDate.day;\n (0, _manipulation.constrain)(copy);\n return copy;\n}\nfunction toZoned(date, timeZone, disambiguation) {\n if (date instanceof (0, _calendarDate.ZonedDateTime)) {\n if (date.timeZone === timeZone) return date;\n return toTimeZone(date, timeZone);\n }\n let ms = toAbsolute(date, timeZone, disambiguation);\n return fromAbsolute(ms, timeZone);\n}\nfunction zonedToDate(date) {\n let ms = epochFromDate(date) - date.offset;\n return new Date(ms);\n}\nfunction toTimeZone(date, timeZone) {\n let ms = epochFromDate(date) - date.offset;\n return toCalendar(fromAbsolute(ms, timeZone), date.calendar);\n}\nfunction toLocalTimeZone(date) {\n return toTimeZone(date, (0, _queries.getLocalTimeZone)());\n}\n\n},{\"./CalendarDate\":\"jKRe7\",\"./manipulation\":\"26dQB\",\"./calendars/GregorianCalendar\":\"5KBzD\",\"./queries\":\"fAxo9\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"5KBzD\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"gregorianToJulianDay\", ()=>gregorianToJulianDay);\nparcelHelpers.export(exports, \"isLeapYear\", ()=>isLeapYear);\nparcelHelpers.export(exports, \"getExtendedYear\", ()=>getExtendedYear);\nparcelHelpers.export(exports, \"fromExtendedYear\", ()=>fromExtendedYear);\n/**\n * The Gregorian calendar is the most commonly used calendar system in the world. It supports two eras: BC, and AD.\n * Years always contain 12 months, and 365 or 366 days depending on whether it is a leap year.\n */ parcelHelpers.export(exports, \"GregorianCalendar\", ()=>GregorianCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nvar _utils = require(\"../utils\");\nconst EPOCH = 1721426; // 001/01/03 Julian C.E.\nfunction gregorianToJulianDay(era, year, month, day) {\n year = getExtendedYear(era, year);\n let y1 = year - 1;\n let monthOffset = -2;\n if (month <= 2) monthOffset = 0;\n else if (isLeapYear(year)) monthOffset = -1;\n return EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);\n}\nfunction isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\nfunction getExtendedYear(era, year) {\n return era === 'BC' ? 1 - year : year;\n}\nfunction fromExtendedYear(year) {\n let era = 'AD';\n if (year <= 0) {\n era = 'BC';\n year = 1 - year;\n }\n return [\n era,\n year\n ];\n}\nconst daysInMonth = {\n standard: [\n 31,\n 28,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n ],\n leapyear: [\n 31,\n 29,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n ]\n};\nclass GregorianCalendar {\n fromJulianDay(jd) {\n let jd0 = jd;\n let depoch = jd0 - EPOCH;\n let quadricent = Math.floor(depoch / 146097);\n let dqc = (0, _utils.mod)(depoch, 146097);\n let cent = Math.floor(dqc / 36524);\n let dcent = (0, _utils.mod)(dqc, 36524);\n let quad = Math.floor(dcent / 1461);\n let dquad = (0, _utils.mod)(dcent, 1461);\n let yindex = Math.floor(dquad / 365);\n let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);\n let [era, year] = fromExtendedYear(extendedYear);\n let yearDay = jd0 - gregorianToJulianDay(era, year, 1, 1);\n let leapAdj = 2;\n if (jd0 < gregorianToJulianDay(era, year, 3, 1)) leapAdj = 0;\n else if (isLeapYear(year)) leapAdj = 1;\n let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);\n let day = jd0 - gregorianToJulianDay(era, year, month, 1) + 1;\n return new (0, _calendarDate.CalendarDate)(era, year, month, day);\n }\n toJulianDay(date) {\n return gregorianToJulianDay(date.era, date.year, date.month, date.day);\n }\n getDaysInMonth(date) {\n return daysInMonth[isLeapYear(date.year) ? 'leapyear' : 'standard'][date.month - 1];\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getMonthsInYear(date) {\n return 12;\n }\n getDaysInYear(date) {\n return isLeapYear(date.year) ? 366 : 365;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getYearsInEra(date) {\n return 9999;\n }\n getEras() {\n return [\n 'BC',\n 'AD'\n ];\n }\n isInverseEra(date) {\n return date.era === 'BC';\n }\n balanceDate(date) {\n if (date.year <= 0) {\n date.era = date.era === 'BC' ? 'AD' : 'BC';\n date.year = 1 - date.year;\n }\n }\n constructor(){\n this.identifier = 'gregory';\n }\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"../utils\":\"9RHLU\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"9RHLU\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"mod\", ()=>mod);\nparcelHelpers.export(exports, \"copy\", ()=>copy);\nparcelHelpers.export(exports, \"copyDateTime\", ()=>copyDateTime);\nvar _calendarDate = require(\"./CalendarDate\");\nfunction mod(amount, numerator) {\n return amount - numerator * Math.floor(amount / numerator);\n}\nfunction copy(date) {\n if (date.era) return new (0, _calendarDate.CalendarDate)(date.calendar, date.era, date.year, date.month, date.day);\n else return new (0, _calendarDate.CalendarDate)(date.calendar, date.year, date.month, date.day);\n}\nfunction copyDateTime(date) {\n if (date.era) return new (0, _calendarDate.CalendarDateTime)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n else return new (0, _calendarDate.CalendarDateTime)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);\n}\n\n},{\"./CalendarDate\":\"jKRe7\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"fAxo9\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/** Returns whether the given dates occur on the same day, regardless of the time or calendar system. */ parcelHelpers.export(exports, \"isSameDay\", ()=>isSameDay);\n/** Returns whether the given dates occur in the same month, using the calendar system of the first date. */ parcelHelpers.export(exports, \"isSameMonth\", ()=>isSameMonth);\n/** Returns whether the given dates occur in the same year, using the calendar system of the first date. */ parcelHelpers.export(exports, \"isSameYear\", ()=>isSameYear);\n/** Returns whether the given dates occur on the same day, and are of the same calendar system. */ parcelHelpers.export(exports, \"isEqualDay\", ()=>isEqualDay);\n/** Returns whether the given dates occur in the same month, and are of the same calendar system. */ parcelHelpers.export(exports, \"isEqualMonth\", ()=>isEqualMonth);\n/** Returns whether the given dates occur in the same year, and are of the same calendar system. */ parcelHelpers.export(exports, \"isEqualYear\", ()=>isEqualYear);\n/** Returns whether the date is today in the given time zone. */ parcelHelpers.export(exports, \"isToday\", ()=>isToday);\n/**\n * Returns the day of week for the given date and locale. Days are numbered from zero to six,\n * where zero is the first day of the week in the given locale. For example, in the United States,\n * the first day of the week is Sunday, but in France it is Monday.\n */ parcelHelpers.export(exports, \"getDayOfWeek\", ()=>getDayOfWeek);\n/** Returns the current time in the given time zone. */ parcelHelpers.export(exports, \"now\", ()=>now);\n/** Returns today's date in the given time zone. */ parcelHelpers.export(exports, \"today\", ()=>today);\nparcelHelpers.export(exports, \"compareDate\", ()=>compareDate);\nparcelHelpers.export(exports, \"compareTime\", ()=>compareTime);\n/**\n * Returns the number of hours in the given date and time zone.\n * Usually this is 24, but it could be 23 or 25 if the date is on a daylight saving transition.\n */ parcelHelpers.export(exports, \"getHoursInDay\", ()=>getHoursInDay);\n/** Returns the time zone identifier for the current user. */ parcelHelpers.export(exports, \"getLocalTimeZone\", ()=>getLocalTimeZone);\nparcelHelpers.export(exports, \"startOfMonth\", ()=>startOfMonth);\nparcelHelpers.export(exports, \"endOfMonth\", ()=>endOfMonth);\nparcelHelpers.export(exports, \"startOfYear\", ()=>startOfYear);\nparcelHelpers.export(exports, \"endOfYear\", ()=>endOfYear);\nparcelHelpers.export(exports, \"getMinimumMonthInYear\", ()=>getMinimumMonthInYear);\nparcelHelpers.export(exports, \"getMinimumDayInMonth\", ()=>getMinimumDayInMonth);\nparcelHelpers.export(exports, \"startOfWeek\", ()=>startOfWeek);\nparcelHelpers.export(exports, \"endOfWeek\", ()=>endOfWeek);\n/** Returns the number of weeks in the given month and locale. */ parcelHelpers.export(exports, \"getWeeksInMonth\", ()=>getWeeksInMonth);\n/** Returns the lesser of the two provider dates. */ parcelHelpers.export(exports, \"minDate\", ()=>minDate);\n/** Returns the greater of the two provider dates. */ parcelHelpers.export(exports, \"maxDate\", ()=>maxDate);\n/** Returns whether the given date is on a weekend in the given locale. */ parcelHelpers.export(exports, \"isWeekend\", ()=>isWeekend);\n/** Returns whether the given date is on a weekday in the given locale. */ parcelHelpers.export(exports, \"isWeekday\", ()=>isWeekday);\nvar _conversion = require(\"./conversion\");\nvar _weekStartData = require(\"./weekStartData\");\nfunction isSameDay(a, b) {\n b = (0, _conversion.toCalendar)(b, a.calendar);\n return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\nfunction isSameMonth(a, b) {\n b = (0, _conversion.toCalendar)(b, a.calendar);\n // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.\n a = startOfMonth(a);\n b = startOfMonth(b);\n return a.era === b.era && a.year === b.year && a.month === b.month;\n}\nfunction isSameYear(a, b) {\n b = (0, _conversion.toCalendar)(b, a.calendar);\n a = startOfYear(a);\n b = startOfYear(b);\n return a.era === b.era && a.year === b.year;\n}\nfunction isEqualDay(a, b) {\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\nfunction isEqualMonth(a, b) {\n a = startOfMonth(a);\n b = startOfMonth(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;\n}\nfunction isEqualYear(a, b) {\n a = startOfYear(a);\n b = startOfYear(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;\n}\nfunction isToday(date, timeZone) {\n return isSameDay(date, today(timeZone));\n}\nfunction getDayOfWeek(date, locale) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1 - getWeekStart(locale)) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n return dayOfWeek;\n}\nfunction now(timeZone) {\n return (0, _conversion.fromAbsolute)(Date.now(), timeZone);\n}\nfunction today(timeZone) {\n return (0, _conversion.toCalendarDate)(now(timeZone));\n}\nfunction compareDate(a, b) {\n return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);\n}\nfunction compareTime(a, b) {\n return timeToMs(a) - timeToMs(b);\n}\nfunction timeToMs(a) {\n return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;\n}\nfunction getHoursInDay(a, timeZone) {\n let ms = (0, _conversion.toAbsolute)(a, timeZone);\n let tomorrow = a.add({\n days: 1\n });\n let tomorrowMs = (0, _conversion.toAbsolute)(tomorrow, timeZone);\n return (tomorrowMs - ms) / 3600000;\n}\nlet localTimeZone = null;\nfunction getLocalTimeZone() {\n // TODO: invalidate this somehow?\n if (localTimeZone == null) localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;\n return localTimeZone;\n}\nfunction startOfMonth(date) {\n // Use `subtract` instead of `set` so we don't get constrained in an era.\n return date.subtract({\n days: date.day - 1\n });\n}\nfunction endOfMonth(date) {\n return date.add({\n days: date.calendar.getDaysInMonth(date) - date.day\n });\n}\nfunction startOfYear(date) {\n return startOfMonth(date.subtract({\n months: date.month - 1\n }));\n}\nfunction endOfYear(date) {\n return endOfMonth(date.add({\n months: date.calendar.getMonthsInYear(date) - date.month\n }));\n}\nfunction getMinimumMonthInYear(date) {\n if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);\n return 1;\n}\nfunction getMinimumDayInMonth(date) {\n if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);\n return 1;\n}\nfunction startOfWeek(date, locale) {\n let dayOfWeek = getDayOfWeek(date, locale);\n return date.subtract({\n days: dayOfWeek\n });\n}\nfunction endOfWeek(date, locale) {\n return startOfWeek(date, locale).add({\n days: 6\n });\n}\nconst cachedRegions = new Map();\nfunction getRegion(locale) {\n // If the Intl.Locale API is available, use it to get the region for the locale.\n // @ts-ignore\n if (Intl.Locale) {\n // Constructing an Intl.Locale is expensive, so cache the result.\n let region = cachedRegions.get(locale);\n if (!region) {\n // @ts-ignore\n region = new Intl.Locale(locale).maximize().region;\n if (region) cachedRegions.set(locale, region);\n }\n return region;\n }\n // If not, just try splitting the string.\n // If the second part of the locale string is 'u',\n // then this is a unicode extension, so ignore it.\n // Otherwise, it should be the region.\n let part = locale.split('-')[1];\n return part === 'u' ? undefined : part;\n}\nfunction getWeekStart(locale) {\n // TODO: use Intl.Locale for this once browsers support the weekInfo property\n // https://github.com/tc39/proposal-intl-locale-info\n let region = getRegion(locale);\n return region ? (0, _weekStartData.weekStartData)[region] || 0 : 0;\n}\nfunction getWeeksInMonth(date, locale) {\n let days = date.calendar.getDaysInMonth(date);\n return Math.ceil((getDayOfWeek(startOfMonth(date), locale) + days) / 7);\n}\nfunction minDate(a, b) {\n if (a && b) return a.compare(b) <= 0 ? a : b;\n return a || b;\n}\nfunction maxDate(a, b) {\n if (a && b) return a.compare(b) >= 0 ? a : b;\n return a || b;\n}\nconst WEEKEND_DATA = {\n AF: [\n 4,\n 5\n ],\n AE: [\n 5,\n 6\n ],\n BH: [\n 5,\n 6\n ],\n DZ: [\n 5,\n 6\n ],\n EG: [\n 5,\n 6\n ],\n IL: [\n 5,\n 6\n ],\n IQ: [\n 5,\n 6\n ],\n IR: [\n 5,\n 5\n ],\n JO: [\n 5,\n 6\n ],\n KW: [\n 5,\n 6\n ],\n LY: [\n 5,\n 6\n ],\n OM: [\n 5,\n 6\n ],\n QA: [\n 5,\n 6\n ],\n SA: [\n 5,\n 6\n ],\n SD: [\n 5,\n 6\n ],\n SY: [\n 5,\n 6\n ],\n YE: [\n 5,\n 6\n ]\n};\nfunction isWeekend(date, locale) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n let region = getRegion(locale);\n // Use Intl.Locale for this once weekInfo is supported.\n // https://github.com/tc39/proposal-intl-locale-info\n let [start, end] = WEEKEND_DATA[region] || [\n 6,\n 0\n ];\n return dayOfWeek === start || dayOfWeek === end;\n}\nfunction isWeekday(date, locale) {\n return !isWeekend(date, locale);\n}\n\n},{\"./conversion\":\"8UTRc\",\"./weekStartData\":\"gHPJZ\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"gHPJZ\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Data from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json\n// Locales starting on Sunday have been removed for compression.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"weekStartData\", ()=>weekStartData);\nconst weekStartData = {\n '001': 1,\n AD: 1,\n AE: 6,\n AF: 6,\n AI: 1,\n AL: 1,\n AM: 1,\n AN: 1,\n AR: 1,\n AT: 1,\n AU: 1,\n AX: 1,\n AZ: 1,\n BA: 1,\n BE: 1,\n BG: 1,\n BH: 6,\n BM: 1,\n BN: 1,\n BY: 1,\n CH: 1,\n CL: 1,\n CM: 1,\n CN: 1,\n CR: 1,\n CY: 1,\n CZ: 1,\n DE: 1,\n DJ: 6,\n DK: 1,\n DZ: 6,\n EC: 1,\n EE: 1,\n EG: 6,\n ES: 1,\n FI: 1,\n FJ: 1,\n FO: 1,\n FR: 1,\n GB: 1,\n GE: 1,\n GF: 1,\n GP: 1,\n GR: 1,\n HR: 1,\n HU: 1,\n IE: 1,\n IQ: 6,\n IR: 6,\n IS: 1,\n IT: 1,\n JO: 6,\n KG: 1,\n KW: 6,\n KZ: 1,\n LB: 1,\n LI: 1,\n LK: 1,\n LT: 1,\n LU: 1,\n LV: 1,\n LY: 6,\n MC: 1,\n MD: 1,\n ME: 1,\n MK: 1,\n MN: 1,\n MQ: 1,\n MV: 5,\n MY: 1,\n NL: 1,\n NO: 1,\n NZ: 1,\n OM: 6,\n PL: 1,\n QA: 6,\n RE: 1,\n RO: 1,\n RS: 1,\n RU: 1,\n SD: 6,\n SE: 1,\n SI: 1,\n SK: 1,\n SM: 1,\n SY: 6,\n TJ: 1,\n TM: 1,\n TR: 1,\n UA: 1,\n UY: 1,\n UZ: 1,\n VA: 1,\n VN: 1,\n XK: 1\n};\n\n},{\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"iwOHm\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/** Parses an ISO 8601 time string. */ parcelHelpers.export(exports, \"parseTime\", ()=>parseTime);\n/** Parses an ISO 8601 date string, with no time components. */ parcelHelpers.export(exports, \"parseDate\", ()=>parseDate);\n/** Parses an ISO 8601 date and time string, with no time zone. */ parcelHelpers.export(exports, \"parseDateTime\", ()=>parseDateTime);\n/**\n * Parses an ISO 8601 date and time string with a time zone extension and optional UTC offset\n * (e.g. \"2021-11-07T00:45[America/Los_Angeles]\" or \"2021-11-07T00:45-07:00[America/Los_Angeles]\").\n * Ambiguous times due to daylight saving time transitions are resolved according to the `disambiguation`\n * parameter.\n */ parcelHelpers.export(exports, \"parseZonedDateTime\", ()=>parseZonedDateTime);\n/**\n * Parses an ISO 8601 date and time string with a UTC offset (e.g. \"2021-11-07T07:45:00Z\"\n * or \"2021-11-07T07:45:00-07:00\"). The result is converted to the provided time zone.\n */ parcelHelpers.export(exports, \"parseAbsolute\", ()=>parseAbsolute);\n/**\n * Parses an ISO 8601 date and time string with a UTC offset (e.g. \"2021-11-07T07:45:00Z\"\n * or \"2021-11-07T07:45:00-07:00\"). The result is converted to the user's local time zone.\n */ parcelHelpers.export(exports, \"parseAbsoluteToLocal\", ()=>parseAbsoluteToLocal);\nparcelHelpers.export(exports, \"timeToString\", ()=>timeToString);\nparcelHelpers.export(exports, \"dateToString\", ()=>dateToString);\nparcelHelpers.export(exports, \"dateTimeToString\", ()=>dateTimeToString);\nparcelHelpers.export(exports, \"zonedDateTimeToString\", ()=>zonedDateTimeToString);\n/**\n * Parses an ISO 8601 duration string (e.g. \"P3Y6M6W4DT12H30M5S\").\n * @param value An ISO 8601 duration string.\n * @returns A DateTimeDuration object.\n */ parcelHelpers.export(exports, \"parseDuration\", ()=>parseDuration);\nvar _calendarDate = require(\"./CalendarDate\");\nvar _conversion = require(\"./conversion\");\nvar _queries = require(\"./queries\");\nvar _gregorianCalendar = require(\"./calendars/GregorianCalendar\");\nconst TIME_RE = /^(\\d{2})(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?$/;\nconst DATE_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})$/;\nconst DATE_TIME_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?$/;\nconst ZONED_DATE_TIME_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?(?:([+-]\\d{2})(?::?(\\d{2}))?)?\\[(.*?)\\]$/;\nconst ABSOLUTE_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?(?:(?:([+-]\\d{2})(?::?(\\d{2}))?)|Z)$/;\nconst DATE_TIME_DURATION_RE = /^((?<negative>-)|\\+)?P((?<years>\\d*)Y)?((?<months>\\d*)M)?((?<weeks>\\d*)W)?((?<days>\\d*)D)?((?<time>T)((?<hours>\\d*[.,]?\\d{1,9})H)?((?<minutes>\\d*[.,]?\\d{1,9})M)?((?<seconds>\\d*[.,]?\\d{1,9})S)?)?$/;\nconst requiredDurationTimeGroups = [\n 'hours',\n 'minutes',\n 'seconds'\n];\nconst requiredDurationGroups = [\n 'years',\n 'months',\n 'weeks',\n 'days',\n ...requiredDurationTimeGroups\n];\nfunction parseTime(value) {\n let m = value.match(TIME_RE);\n if (!m) throw new Error('Invalid ISO 8601 time string: ' + value);\n return new (0, _calendarDate.Time)(parseNumber(m[1], 0, 23), m[2] ? parseNumber(m[2], 0, 59) : 0, m[3] ? parseNumber(m[3], 0, 59) : 0, m[4] ? parseNumber(m[4], 0, Infinity) * 1000 : 0);\n}\nfunction parseDate(value) {\n let m = value.match(DATE_RE);\n if (!m) throw new Error('Invalid ISO 8601 date string: ' + value);\n let date = new (0, _calendarDate.CalendarDate)(parseNumber(m[1], 0, 9999), parseNumber(m[2], 1, 12), 1);\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n return date;\n}\nfunction parseDateTime(value) {\n let m = value.match(DATE_TIME_RE);\n if (!m) throw new Error('Invalid ISO 8601 date time string: ' + value);\n let year = parseNumber(m[1], -9999, 9999);\n let era = year < 1 ? 'BC' : 'AD';\n let date = new (0, _calendarDate.CalendarDateTime)(era, year < 1 ? -year + 1 : year, parseNumber(m[2], 1, 12), 1, m[4] ? parseNumber(m[4], 0, 23) : 0, m[5] ? parseNumber(m[5], 0, 59) : 0, m[6] ? parseNumber(m[6], 0, 59) : 0, m[7] ? parseNumber(m[7], 0, Infinity) * 1000 : 0);\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n return date;\n}\nfunction parseZonedDateTime(value, disambiguation) {\n let m = value.match(ZONED_DATE_TIME_RE);\n if (!m) throw new Error('Invalid ISO 8601 date time string: ' + value);\n let year = parseNumber(m[1], -9999, 9999);\n let era = year < 1 ? 'BC' : 'AD';\n let date = new (0, _calendarDate.ZonedDateTime)(era, year < 1 ? -year + 1 : year, parseNumber(m[2], 1, 12), 1, m[10], 0, m[4] ? parseNumber(m[4], 0, 23) : 0, m[5] ? parseNumber(m[5], 0, 59) : 0, m[6] ? parseNumber(m[6], 0, 59) : 0, m[7] ? parseNumber(m[7], 0, Infinity) * 1000 : 0);\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n let plainDateTime = (0, _conversion.toCalendarDateTime)(date);\n let ms;\n if (m[8]) {\n date.offset = parseNumber(m[8], -23, 23) * 3600000 + parseNumber(m[9] ?? '0', 0, 59) * 60000;\n ms = (0, _conversion.epochFromDate)(date) - date.offset;\n // Validate offset against parsed date.\n let absolutes = (0, _conversion.possibleAbsolutes)(plainDateTime, date.timeZone);\n if (!absolutes.includes(ms)) throw new Error(`Offset ${offsetToString(date.offset)} is invalid for ${dateTimeToString(date)} in ${date.timeZone}`);\n } else // Convert to absolute and back to fix invalid times due to DST.\n ms = (0, _conversion.toAbsolute)((0, _conversion.toCalendarDateTime)(plainDateTime), date.timeZone, disambiguation);\n return (0, _conversion.fromAbsolute)(ms, date.timeZone);\n}\nfunction parseAbsolute(value, timeZone) {\n let m = value.match(ABSOLUTE_RE);\n if (!m) throw new Error('Invalid ISO 8601 date time string: ' + value);\n let year = parseNumber(m[1], -9999, 9999);\n let era = year < 1 ? 'BC' : 'AD';\n let date = new (0, _calendarDate.ZonedDateTime)(era, year < 1 ? -year + 1 : year, parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? parseNumber(m[4], 0, 23) : 0, m[5] ? parseNumber(m[5], 0, 59) : 0, m[6] ? parseNumber(m[6], 0, 59) : 0, m[7] ? parseNumber(m[7], 0, Infinity) * 1000 : 0);\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n if (m[8]) date.offset = parseNumber(m[8], -23, 23) * 3600000 + parseNumber(m[9] ?? '0', 0, 59) * 60000;\n return (0, _conversion.toTimeZone)(date, timeZone);\n}\nfunction parseAbsoluteToLocal(value) {\n return parseAbsolute(value, (0, _queries.getLocalTimeZone)());\n}\nfunction parseNumber(value, min, max) {\n let val = Number(value);\n if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);\n return val;\n}\nfunction timeToString(time) {\n return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;\n}\nfunction dateToString(date) {\n let gregorianDate = (0, _conversion.toCalendar)(date, new (0, _gregorianCalendar.GregorianCalendar)());\n let year;\n if (gregorianDate.era === 'BC') year = gregorianDate.year === 1 ? '0000' : '-' + String(Math.abs(1 - gregorianDate.year)).padStart(6, '00');\n else year = String(gregorianDate.year).padStart(4, '0');\n return `${year}-${String(gregorianDate.month).padStart(2, '0')}-${String(gregorianDate.day).padStart(2, '0')}`;\n}\nfunction dateTimeToString(date) {\n // @ts-ignore\n return `${dateToString(date)}T${timeToString(date)}`;\n}\nfunction offsetToString(offset) {\n let sign = Math.sign(offset) < 0 ? '-' : '+';\n offset = Math.abs(offset);\n let offsetHours = Math.floor(offset / 3600000);\n let offsetMinutes = offset % 3600000 / 60000;\n return `${sign}${String(offsetHours).padStart(2, '0')}:${String(offsetMinutes).padStart(2, '0')}`;\n}\nfunction zonedDateTimeToString(date) {\n return `${dateTimeToString(date)}${offsetToString(date.offset)}[${date.timeZone}]`;\n}\nfunction parseDuration(value) {\n const match = value.match(DATE_TIME_DURATION_RE);\n if (!match) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n const parseDurationGroup = (group, isNegative, min, max)=>{\n if (!group) return 0;\n try {\n const sign = isNegative ? -1 : 1;\n return sign * parseNumber(group.replace(',', '.'), min, max);\n } catch {\n throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n }\n };\n const isNegative = !!match.groups?.negative;\n const hasRequiredGroups = requiredDurationGroups.some((group)=>match.groups?.[group]);\n if (!hasRequiredGroups) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n const durationStringIncludesTime = match.groups?.time;\n if (durationStringIncludesTime) {\n const hasRequiredDurationTimeGroups = requiredDurationTimeGroups.some((group)=>match.groups?.[group]);\n if (!hasRequiredDurationTimeGroups) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n }\n const duration = {\n years: parseDurationGroup(match.groups?.years, isNegative, 0, 9999),\n months: parseDurationGroup(match.groups?.months, isNegative, 0, 12),\n weeks: parseDurationGroup(match.groups?.weeks, isNegative, 0, Infinity),\n days: parseDurationGroup(match.groups?.days, isNegative, 0, 31),\n hours: parseDurationGroup(match.groups?.hours, isNegative, 0, 23),\n minutes: parseDurationGroup(match.groups?.minutes, isNegative, 0, 59),\n seconds: parseDurationGroup(match.groups?.seconds, isNegative, 0, 59)\n };\n if (duration.hours !== undefined && duration.hours % 1 !== 0 && (duration.minutes || duration.seconds)) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);\n if (duration.minutes !== undefined && duration.minutes % 1 !== 0 && duration.seconds) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);\n return duration;\n}\n\n},{\"./CalendarDate\":\"jKRe7\",\"./conversion\":\"8UTRc\",\"./queries\":\"fAxo9\",\"./calendars/GregorianCalendar\":\"5KBzD\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"4n2ag\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Japanese calendar is based on the Gregorian calendar, but with eras for the reign of each Japanese emperor.\n * Whenever a new emperor ascends to the throne, a new era begins and the year starts again from 1.\n * Note that eras before 1868 (Gregorian) are not currently supported by this implementation.\n */ parcelHelpers.export(exports, \"JapaneseCalendar\", ()=>JapaneseCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nvar _gregorianCalendar = require(\"./GregorianCalendar\");\nconst ERA_START_DATES = [\n [\n 1868,\n 9,\n 8\n ],\n [\n 1912,\n 7,\n 30\n ],\n [\n 1926,\n 12,\n 25\n ],\n [\n 1989,\n 1,\n 8\n ],\n [\n 2019,\n 5,\n 1\n ]\n];\nconst ERA_END_DATES = [\n [\n 1912,\n 7,\n 29\n ],\n [\n 1926,\n 12,\n 24\n ],\n [\n 1989,\n 1,\n 7\n ],\n [\n 2019,\n 4,\n 30\n ]\n];\nconst ERA_ADDENDS = [\n 1867,\n 1911,\n 1925,\n 1988,\n 2018\n];\nconst ERA_NAMES = [\n 'meiji',\n 'taisho',\n 'showa',\n 'heisei',\n 'reiwa'\n];\nfunction findEraFromGregorianDate(date) {\n const idx = ERA_START_DATES.findIndex(([year, month, day])=>{\n if (date.year < year) return true;\n if (date.year === year && date.month < month) return true;\n if (date.year === year && date.month === month && date.day < day) return true;\n return false;\n });\n if (idx === -1) return ERA_START_DATES.length - 1;\n if (idx === 0) return 0;\n return idx - 1;\n}\nfunction toGregorian(date) {\n let eraAddend = ERA_ADDENDS[ERA_NAMES.indexOf(date.era)];\n if (!eraAddend) throw new Error('Unknown era: ' + date.era);\n return new (0, _calendarDate.CalendarDate)(date.year + eraAddend, date.month, date.day);\n}\nclass JapaneseCalendar extends (0, _gregorianCalendar.GregorianCalendar) {\n fromJulianDay(jd) {\n let date = super.fromJulianDay(jd);\n let era = findEraFromGregorianDate(date);\n return new (0, _calendarDate.CalendarDate)(this, ERA_NAMES[era], date.year - ERA_ADDENDS[era], date.month, date.day);\n }\n toJulianDay(date) {\n return super.toJulianDay(toGregorian(date));\n }\n balanceDate(date) {\n let gregorianDate = toGregorian(date);\n let era = findEraFromGregorianDate(gregorianDate);\n if (ERA_NAMES[era] !== date.era) {\n date.era = ERA_NAMES[era];\n date.year = gregorianDate.year - ERA_ADDENDS[era];\n }\n // Constrain in case we went before the first supported era.\n this.constrainDate(date);\n }\n constrainDate(date) {\n let idx = ERA_NAMES.indexOf(date.era);\n let end = ERA_END_DATES[idx];\n if (end != null) {\n let [endYear, endMonth, endDay] = end;\n // Constrain the year to the maximum possible value in the era.\n // Then constrain the month and day fields within that.\n let maxYear = endYear - ERA_ADDENDS[idx];\n date.year = Math.max(1, Math.min(maxYear, date.year));\n if (date.year === maxYear) {\n date.month = Math.min(endMonth, date.month);\n if (date.month === endMonth) date.day = Math.min(endDay, date.day);\n }\n }\n if (date.year === 1 && idx >= 0) {\n let [, startMonth, startDay] = ERA_START_DATES[idx];\n date.month = Math.max(startMonth, date.month);\n if (date.month === startMonth) date.day = Math.max(startDay, date.day);\n }\n }\n getEras() {\n return ERA_NAMES;\n }\n getYearsInEra(date) {\n // Get the number of years in the era, taking into account the date's month and day fields.\n let era = ERA_NAMES.indexOf(date.era);\n let cur = ERA_START_DATES[era];\n let next = ERA_START_DATES[era + 1];\n if (next == null) // 9999 gregorian is the maximum year allowed.\n return 9999 - cur[0] + 1;\n let years = next[0] - cur[0];\n if (date.month < next[1] || date.month === next[1] && date.day < next[2]) years++;\n return years;\n }\n getDaysInMonth(date) {\n return super.getDaysInMonth(toGregorian(date));\n }\n getMinimumMonthInYear(date) {\n let start = getMinimums(date);\n return start ? start[1] : 1;\n }\n getMinimumDayInMonth(date) {\n let start = getMinimums(date);\n return start && date.month === start[1] ? start[2] : 1;\n }\n constructor(...args){\n super(...args), this.identifier = 'japanese';\n }\n}\nfunction getMinimums(date) {\n if (date.year === 1) {\n let idx = ERA_NAMES.indexOf(date.era);\n return ERA_START_DATES[idx];\n }\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"./GregorianCalendar\":\"5KBzD\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"gdq13\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Buddhist calendar is the same as the Gregorian calendar, but counts years\n * starting from the birth of Buddha in 543 BC (Gregorian). It supports only one\n * era, identified as 'BE'.\n */ parcelHelpers.export(exports, \"BuddhistCalendar\", ()=>BuddhistCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nvar _gregorianCalendar = require(\"./GregorianCalendar\");\nconst BUDDHIST_ERA_START = -543;\nclass BuddhistCalendar extends (0, _gregorianCalendar.GregorianCalendar) {\n fromJulianDay(jd) {\n let gregorianDate = super.fromJulianDay(jd);\n let year = (0, _gregorianCalendar.getExtendedYear)(gregorianDate.era, gregorianDate.year);\n return new (0, _calendarDate.CalendarDate)(this, year - BUDDHIST_ERA_START, gregorianDate.month, gregorianDate.day);\n }\n toJulianDay(date) {\n return super.toJulianDay(toGregorian(date));\n }\n getEras() {\n return [\n 'BE'\n ];\n }\n getDaysInMonth(date) {\n return super.getDaysInMonth(toGregorian(date));\n }\n balanceDate() {}\n constructor(...args){\n super(...args), this.identifier = 'buddhist';\n }\n}\nfunction toGregorian(date) {\n let [era, year] = (0, _gregorianCalendar.fromExtendedYear)(date.year + BUDDHIST_ERA_START);\n return new (0, _calendarDate.CalendarDate)(era, year, date.month, date.day);\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"./GregorianCalendar\":\"5KBzD\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"fEpdK\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Taiwanese calendar is the same as the Gregorian calendar, but years\n * are numbered starting from 1912 (Gregorian). Two eras are supported:\n * 'before_minguo' and 'minguo'.\n */ parcelHelpers.export(exports, \"TaiwanCalendar\", ()=>TaiwanCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nvar _gregorianCalendar = require(\"./GregorianCalendar\");\nconst TAIWAN_ERA_START = 1911;\nfunction gregorianYear(date) {\n return date.era === 'minguo' ? date.year + TAIWAN_ERA_START : 1 - date.year + TAIWAN_ERA_START;\n}\nfunction gregorianToTaiwan(year) {\n let y = year - TAIWAN_ERA_START;\n if (y > 0) return [\n 'minguo',\n y\n ];\n else return [\n 'before_minguo',\n 1 - y\n ];\n}\nclass TaiwanCalendar extends (0, _gregorianCalendar.GregorianCalendar) {\n fromJulianDay(jd) {\n let date = super.fromJulianDay(jd);\n let extendedYear = (0, _gregorianCalendar.getExtendedYear)(date.era, date.year);\n let [era, year] = gregorianToTaiwan(extendedYear);\n return new (0, _calendarDate.CalendarDate)(this, era, year, date.month, date.day);\n }\n toJulianDay(date) {\n return super.toJulianDay(toGregorian(date));\n }\n getEras() {\n return [\n 'before_minguo',\n 'minguo'\n ];\n }\n balanceDate(date) {\n let [era, year] = gregorianToTaiwan(gregorianYear(date));\n date.era = era;\n date.year = year;\n }\n isInverseEra(date) {\n return date.era === 'before_minguo';\n }\n getDaysInMonth(date) {\n return super.getDaysInMonth(toGregorian(date));\n }\n getYearsInEra(date) {\n return date.era === 'before_minguo' ? 9999 : 9999 - TAIWAN_ERA_START;\n }\n constructor(...args){\n super(...args), this.identifier = 'roc' // Republic of China\n ;\n }\n}\nfunction toGregorian(date) {\n let [era, year] = (0, _gregorianCalendar.fromExtendedYear)(gregorianYear(date));\n return new (0, _calendarDate.CalendarDate)(era, year, date.month, date.day);\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"./GregorianCalendar\":\"5KBzD\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"gqXuG\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Persian calendar is the main calendar used in Iran and Afghanistan. It has 12 months\n * in each year, the first 6 of which have 31 days, and the next 5 have 30 days. The 12th month\n * has either 29 or 30 days depending on whether it is a leap year. The Persian year starts\n * around the March equinox.\n */ parcelHelpers.export(exports, \"PersianCalendar\", ()=>PersianCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nvar _utils = require(\"../utils\");\nconst PERSIAN_EPOCH = 1948320;\n// Number of days from the start of the year to the start of each month.\nconst MONTH_START = [\n 0,\n 31,\n 62,\n 93,\n 124,\n 155,\n 186,\n 216,\n 246,\n 276,\n 306,\n 336 // Esfand\n];\nclass PersianCalendar {\n fromJulianDay(jd) {\n let daysSinceEpoch = jd - PERSIAN_EPOCH;\n let year = 1 + Math.floor((33 * daysSinceEpoch + 3) / 12053);\n let farvardin1 = 365 * (year - 1) + Math.floor((8 * year + 21) / 33);\n let dayOfYear = daysSinceEpoch - farvardin1;\n let month = dayOfYear < 216 ? Math.floor(dayOfYear / 31) : Math.floor((dayOfYear - 6) / 30);\n let day = dayOfYear - MONTH_START[month] + 1;\n return new (0, _calendarDate.CalendarDate)(this, year, month + 1, day);\n }\n toJulianDay(date) {\n let jd = PERSIAN_EPOCH - 1 + 365 * (date.year - 1) + Math.floor((8 * date.year + 21) / 33);\n jd += MONTH_START[date.month - 1];\n jd += date.day;\n return jd;\n }\n getMonthsInYear() {\n return 12;\n }\n getDaysInMonth(date) {\n if (date.month <= 6) return 31;\n if (date.month <= 11) return 30;\n let isLeapYear = (0, _utils.mod)(25 * date.year + 11, 33) < 8;\n return isLeapYear ? 30 : 29;\n }\n getEras() {\n return [\n 'AP'\n ];\n }\n getYearsInEra() {\n // 9378-10-10 persian is 9999-12-31 gregorian.\n // Round down to 9377 to set the maximum full year.\n return 9377;\n }\n constructor(){\n this.identifier = 'persian';\n }\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"../utils\":\"9RHLU\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"2Ty6g\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Indian National Calendar is similar to the Gregorian calendar, but with\n * years numbered since the Saka era in 78 AD (Gregorian). There are 12 months\n * in each year, with either 30 or 31 days. Only one era identifier is supported: 'saka'.\n */ parcelHelpers.export(exports, \"IndianCalendar\", ()=>IndianCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nvar _gregorianCalendar = require(\"./GregorianCalendar\");\n// Starts in 78 AD,\nconst INDIAN_ERA_START = 78;\n// The Indian year starts 80 days later than the Gregorian year.\nconst INDIAN_YEAR_START = 80;\nclass IndianCalendar extends (0, _gregorianCalendar.GregorianCalendar) {\n fromJulianDay(jd) {\n // Gregorian date for Julian day\n let date = super.fromJulianDay(jd);\n // Year in Saka era\n let indianYear = date.year - INDIAN_ERA_START;\n // Day number in Gregorian year (starting from 0)\n let yDay = jd - (0, _gregorianCalendar.gregorianToJulianDay)(date.era, date.year, 1, 1);\n let leapMonth;\n if (yDay < INDIAN_YEAR_START) {\n // Day is at the end of the preceding Saka year\n indianYear--;\n // Days in leapMonth this year, previous Gregorian year\n leapMonth = (0, _gregorianCalendar.isLeapYear)(date.year - 1) ? 31 : 30;\n yDay += leapMonth + 155 + 90 + 10;\n } else {\n // Days in leapMonth this year\n leapMonth = (0, _gregorianCalendar.isLeapYear)(date.year) ? 31 : 30;\n yDay -= INDIAN_YEAR_START;\n }\n let indianMonth;\n let indianDay;\n if (yDay < leapMonth) {\n indianMonth = 1;\n indianDay = yDay + 1;\n } else {\n let mDay = yDay - leapMonth;\n if (mDay < 155) {\n indianMonth = Math.floor(mDay / 31) + 2;\n indianDay = mDay % 31 + 1;\n } else {\n mDay -= 155;\n indianMonth = Math.floor(mDay / 30) + 7;\n indianDay = mDay % 30 + 1;\n }\n }\n return new (0, _calendarDate.CalendarDate)(this, indianYear, indianMonth, indianDay);\n }\n toJulianDay(date) {\n let extendedYear = date.year + INDIAN_ERA_START;\n let [era, year] = (0, _gregorianCalendar.fromExtendedYear)(extendedYear);\n let leapMonth;\n let jd;\n if ((0, _gregorianCalendar.isLeapYear)(year)) {\n leapMonth = 31;\n jd = (0, _gregorianCalendar.gregorianToJulianDay)(era, year, 3, 21);\n } else {\n leapMonth = 30;\n jd = (0, _gregorianCalendar.gregorianToJulianDay)(era, year, 3, 22);\n }\n if (date.month === 1) return jd + date.day - 1;\n jd += leapMonth + Math.min(date.month - 2, 5) * 31;\n if (date.month >= 8) jd += (date.month - 7) * 30;\n jd += date.day - 1;\n return jd;\n }\n getDaysInMonth(date) {\n if (date.month === 1 && (0, _gregorianCalendar.isLeapYear)(date.year + INDIAN_ERA_START)) return 31;\n if (date.month >= 2 && date.month <= 6) return 31;\n return 30;\n }\n getYearsInEra() {\n // 9999-12-31 gregorian is 9920-10-10 indian.\n // Round down to 9919 for the last full year.\n return 9919;\n }\n getEras() {\n return [\n 'saka'\n ];\n }\n balanceDate() {}\n constructor(...args){\n super(...args), this.identifier = 'indian';\n }\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"./GregorianCalendar\":\"5KBzD\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"5KQee\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Islamic calendar, also known as the \"Hijri\" calendar, is used throughout much of the Arab world.\n * The civil variant uses simple arithmetic rules rather than astronomical calculations to approximate\n * the traditional calendar, which is based on sighting of the crescent moon. It uses Friday, July 16 622 CE (Julian) as the epoch.\n * Each year has 12 months, with either 354 or 355 days depending on whether it is a leap year.\n * Learn more about the available Islamic calendars [here](https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types).\n */ parcelHelpers.export(exports, \"IslamicCivilCalendar\", ()=>IslamicCivilCalendar);\n/**\n * The Islamic calendar, also known as the \"Hijri\" calendar, is used throughout much of the Arab world.\n * The tabular variant uses simple arithmetic rules rather than astronomical calculations to approximate\n * the traditional calendar, which is based on sighting of the crescent moon. It uses Thursday, July 15 622 CE (Julian) as the epoch.\n * Each year has 12 months, with either 354 or 355 days depending on whether it is a leap year.\n * Learn more about the available Islamic calendars [here](https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types).\n */ parcelHelpers.export(exports, \"IslamicTabularCalendar\", ()=>IslamicTabularCalendar);\n/**\n * The Islamic calendar, also known as the \"Hijri\" calendar, is used throughout much of the Arab world.\n * The Umalqura variant is primarily used in Saudi Arabia. It is a lunar calendar, based on astronomical\n * calculations that predict the sighting of a crescent moon. Month and year lengths vary between years\n * depending on these calculations.\n * Learn more about the available Islamic calendars [here](https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types).\n */ parcelHelpers.export(exports, \"IslamicUmalquraCalendar\", ()=>IslamicUmalquraCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nconst CIVIL_EPOC = 1948440; // CE 622 July 16 Friday (Julian calendar) / CE 622 July 19 (Gregorian calendar)\nconst ASTRONOMICAL_EPOC = 1948439; // CE 622 July 15 Thursday (Julian calendar)\nconst UMALQURA_YEAR_START = 1300;\nconst UMALQURA_YEAR_END = 1600;\nconst UMALQURA_START_DAYS = 460322;\nfunction islamicToJulianDay(epoch, year, month, day) {\n return day + Math.ceil(29.5 * (month - 1)) + (year - 1) * 354 + Math.floor((3 + 11 * year) / 30) + epoch - 1;\n}\nfunction julianDayToIslamic(calendar, epoch, jd) {\n let year = Math.floor((30 * (jd - epoch) + 10646) / 10631);\n let month = Math.min(12, Math.ceil((jd - (29 + islamicToJulianDay(epoch, year, 1, 1))) / 29.5) + 1);\n let day = jd - islamicToJulianDay(epoch, year, month, 1) + 1;\n return new (0, _calendarDate.CalendarDate)(calendar, year, month, day);\n}\nfunction isLeapYear(year) {\n return (14 + 11 * year) % 30 < 11;\n}\nclass IslamicCivilCalendar {\n fromJulianDay(jd) {\n return julianDayToIslamic(this, CIVIL_EPOC, jd);\n }\n toJulianDay(date) {\n return islamicToJulianDay(CIVIL_EPOC, date.year, date.month, date.day);\n }\n getDaysInMonth(date) {\n let length = 29 + date.month % 2;\n if (date.month === 12 && isLeapYear(date.year)) length++;\n return length;\n }\n getMonthsInYear() {\n return 12;\n }\n getDaysInYear(date) {\n return isLeapYear(date.year) ? 355 : 354;\n }\n getYearsInEra() {\n // 9999 gregorian\n return 9665;\n }\n getEras() {\n return [\n 'AH'\n ];\n }\n constructor(){\n this.identifier = 'islamic-civil';\n }\n}\nclass IslamicTabularCalendar extends IslamicCivilCalendar {\n fromJulianDay(jd) {\n return julianDayToIslamic(this, ASTRONOMICAL_EPOC, jd);\n }\n toJulianDay(date) {\n return islamicToJulianDay(ASTRONOMICAL_EPOC, date.year, date.month, date.day);\n }\n constructor(...args){\n super(...args), this.identifier = 'islamic-tbla';\n }\n}\n// Generated by scripts/generate-umalqura.js\nconst UMALQURA_DATA = 'qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=';\nlet UMALQURA_MONTHLENGTH;\nlet UMALQURA_YEAR_START_TABLE;\nfunction umalquraYearStart(year) {\n return UMALQURA_START_DAYS + UMALQURA_YEAR_START_TABLE[year - UMALQURA_YEAR_START];\n}\nfunction umalquraMonthLength(year, month) {\n let idx = year - UMALQURA_YEAR_START;\n let mask = 0x01 << 11 - (month - 1);\n if ((UMALQURA_MONTHLENGTH[idx] & mask) === 0) return 29;\n else return 30;\n}\nfunction umalquraMonthStart(year, month) {\n let day = umalquraYearStart(year);\n for(let i = 1; i < month; i++)day += umalquraMonthLength(year, i);\n return day;\n}\nfunction umalquraYearLength(year) {\n return UMALQURA_YEAR_START_TABLE[year + 1 - UMALQURA_YEAR_START] - UMALQURA_YEAR_START_TABLE[year - UMALQURA_YEAR_START];\n}\nclass IslamicUmalquraCalendar extends IslamicCivilCalendar {\n constructor(){\n super(), this.identifier = 'islamic-umalqura';\n if (!UMALQURA_MONTHLENGTH) UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob(UMALQURA_DATA), (c)=>c.charCodeAt(0)).buffer);\n if (!UMALQURA_YEAR_START_TABLE) {\n UMALQURA_YEAR_START_TABLE = new Uint32Array(UMALQURA_YEAR_END - UMALQURA_YEAR_START + 1);\n let yearStart = 0;\n for(let year = UMALQURA_YEAR_START; year <= UMALQURA_YEAR_END; year++){\n UMALQURA_YEAR_START_TABLE[year - UMALQURA_YEAR_START] = yearStart;\n for(let i = 1; i <= 12; i++)yearStart += umalquraMonthLength(year, i);\n }\n }\n }\n fromJulianDay(jd) {\n let days = jd - CIVIL_EPOC;\n let startDays = umalquraYearStart(UMALQURA_YEAR_START);\n let endDays = umalquraYearStart(UMALQURA_YEAR_END);\n if (days < startDays || days > endDays) return super.fromJulianDay(jd);\n else {\n let y = UMALQURA_YEAR_START - 1;\n let m = 1;\n let d = 1;\n while(d > 0){\n y++;\n d = days - umalquraYearStart(y) + 1;\n let yearLength = umalquraYearLength(y);\n if (d === yearLength) {\n m = 12;\n break;\n } else if (d < yearLength) {\n let monthLength = umalquraMonthLength(y, m);\n m = 1;\n while(d > monthLength){\n d -= monthLength;\n m++;\n monthLength = umalquraMonthLength(y, m);\n }\n break;\n }\n }\n return new (0, _calendarDate.CalendarDate)(this, y, m, days - umalquraMonthStart(y, m) + 1);\n }\n }\n toJulianDay(date) {\n if (date.year < UMALQURA_YEAR_START || date.year > UMALQURA_YEAR_END) return super.toJulianDay(date);\n return CIVIL_EPOC + umalquraMonthStart(date.year, date.month) + (date.day - 1);\n }\n getDaysInMonth(date) {\n if (date.year < UMALQURA_YEAR_START || date.year > UMALQURA_YEAR_END) return super.getDaysInMonth(date);\n return umalquraMonthLength(date.year, date.month);\n }\n getDaysInYear(date) {\n if (date.year < UMALQURA_YEAR_START || date.year > UMALQURA_YEAR_END) return super.getDaysInYear(date);\n return umalquraYearLength(date.year);\n }\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"61C0Y\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Hebrew calendar is used in Israel and around the world by the Jewish faith.\n * Years include either 12 or 13 months depending on whether it is a leap year.\n * In leap years, an extra month is inserted at month 6.\n */ parcelHelpers.export(exports, \"HebrewCalendar\", ()=>HebrewCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nvar _utils = require(\"../utils\");\nconst HEBREW_EPOCH = 347997;\n// Hebrew date calculations are performed in terms of days, hours, and\n// \"parts\" (or halakim), which are 1/1080 of an hour, or 3 1/3 seconds.\nconst HOUR_PARTS = 1080;\nconst DAY_PARTS = 24 * HOUR_PARTS;\n// An approximate value for the length of a lunar month.\n// It is used to calculate the approximate year and month of a given\n// absolute date.\nconst MONTH_DAYS = 29;\nconst MONTH_FRACT = 12 * HOUR_PARTS + 793;\nconst MONTH_PARTS = MONTH_DAYS * DAY_PARTS + MONTH_FRACT;\nfunction isLeapYear(year) {\n return (0, _utils.mod)(year * 7 + 1, 19) < 7;\n}\n// Test for delay of start of new year and to avoid\n// Sunday, Wednesday, and Friday as start of the new year.\nfunction hebrewDelay1(year) {\n let months = Math.floor((235 * year - 234) / 19);\n let parts = 12084 + 13753 * months;\n let day = months * 29 + Math.floor(parts / 25920);\n if ((0, _utils.mod)(3 * (day + 1), 7) < 3) day += 1;\n return day;\n}\n// Check for delay in start of new year due to length of adjacent years\nfunction hebrewDelay2(year) {\n let last = hebrewDelay1(year - 1);\n let present = hebrewDelay1(year);\n let next = hebrewDelay1(year + 1);\n if (next - present === 356) return 2;\n if (present - last === 382) return 1;\n return 0;\n}\nfunction startOfYear(year) {\n return hebrewDelay1(year) + hebrewDelay2(year);\n}\nfunction getDaysInYear(year) {\n return startOfYear(year + 1) - startOfYear(year);\n}\nfunction getYearType(year) {\n let yearLength = getDaysInYear(year);\n if (yearLength > 380) yearLength -= 30; // Subtract length of leap month.\n switch(yearLength){\n case 353:\n return 0; // deficient\n case 354:\n return 1; // normal\n case 355:\n return 2; // complete\n }\n}\nfunction getDaysInMonth(year, month) {\n // Normalize month numbers from 1 - 13, even on non-leap years\n if (month >= 6 && !isLeapYear(year)) month++;\n // First of all, dispose of fixed-length 29 day months\n if (month === 4 || month === 7 || month === 9 || month === 11 || month === 13) return 29;\n let yearType = getYearType(year);\n // If it's Heshvan, days depend on length of year\n if (month === 2) return yearType === 2 ? 30 : 29;\n // Similarly, Kislev varies with the length of year\n if (month === 3) return yearType === 0 ? 29 : 30;\n // Adar I only exists in leap years\n if (month === 6) return isLeapYear(year) ? 30 : 0;\n return 30;\n}\nclass HebrewCalendar {\n fromJulianDay(jd) {\n let d = jd - HEBREW_EPOCH;\n let m = d * DAY_PARTS / MONTH_PARTS; // Months (approx)\n let year = Math.floor((19 * m + 234) / 235) + 1; // Years (approx)\n let ys = startOfYear(year); // 1st day of year\n let dayOfYear = Math.floor(d - ys);\n // Because of the postponement rules, it's possible to guess wrong. Fix it.\n while(dayOfYear < 1){\n year--;\n ys = startOfYear(year);\n dayOfYear = Math.floor(d - ys);\n }\n // Now figure out which month we're in, and the date within that month\n let month = 1;\n let monthStart = 0;\n while(monthStart < dayOfYear){\n monthStart += getDaysInMonth(year, month);\n month++;\n }\n month--;\n monthStart -= getDaysInMonth(year, month);\n let day = dayOfYear - monthStart;\n return new (0, _calendarDate.CalendarDate)(this, year, month, day);\n }\n toJulianDay(date) {\n let jd = startOfYear(date.year);\n for(let month = 1; month < date.month; month++)jd += getDaysInMonth(date.year, month);\n return jd + date.day + HEBREW_EPOCH;\n }\n getDaysInMonth(date) {\n return getDaysInMonth(date.year, date.month);\n }\n getMonthsInYear(date) {\n return isLeapYear(date.year) ? 13 : 12;\n }\n getDaysInYear(date) {\n return getDaysInYear(date.year);\n }\n getYearsInEra() {\n // 6239 gregorian\n return 9999;\n }\n getEras() {\n return [\n 'AM'\n ];\n }\n balanceYearMonth(date, previousDate) {\n // Keep date in the same month when switching between leap years and non leap years\n if (previousDate.year !== date.year) {\n if (isLeapYear(previousDate.year) && !isLeapYear(date.year) && previousDate.month > 6) date.month--;\n else if (!isLeapYear(previousDate.year) && isLeapYear(date.year) && previousDate.month > 6) date.month++;\n }\n }\n constructor(){\n this.identifier = 'hebrew';\n }\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"../utils\":\"9RHLU\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"ceCwg\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * The Ethiopic calendar system is the official calendar used in Ethiopia.\n * It includes 12 months of 30 days each, plus 5 or 6 intercalary days depending\n * on whether it is a leap year. Two eras are supported: 'AA' and 'AM'.\n */ parcelHelpers.export(exports, \"EthiopicCalendar\", ()=>EthiopicCalendar);\n/**\n * The Ethiopic (Amete Alem) calendar is the same as the modern Ethiopic calendar,\n * except years were measured from a different epoch. Only one era is supported: 'AA'.\n */ parcelHelpers.export(exports, \"EthiopicAmeteAlemCalendar\", ()=>EthiopicAmeteAlemCalendar);\n/**\n * The Coptic calendar is similar to the Ethiopic calendar.\n * It includes 12 months of 30 days each, plus 5 or 6 intercalary days depending\n * on whether it is a leap year. Two eras are supported: 'BCE' and 'CE'.\n */ parcelHelpers.export(exports, \"CopticCalendar\", ()=>CopticCalendar);\nvar _calendarDate = require(\"../CalendarDate\");\nconst ETHIOPIC_EPOCH = 1723856;\nconst COPTIC_EPOCH = 1824665;\n// The delta between Amete Alem 1 and Amete Mihret 1\n// AA 5501 = AM 1\nconst AMETE_MIHRET_DELTA = 5500;\nfunction ceToJulianDay(epoch, year, month, day) {\n return epoch // difference from Julian epoch to 1,1,1\n + 365 * year // number of days from years\n + Math.floor(year / 4) // extra day of leap year\n + 30 * (month - 1 // number of days from months (1 based)\n ) + day - 1 // number of days for present month (1 based)\n ;\n}\nfunction julianDayToCE(epoch, jd) {\n let year = Math.floor(4 * (jd - epoch) / 1461);\n let month = 1 + Math.floor((jd - ceToJulianDay(epoch, year, 1, 1)) / 30);\n let day = jd + 1 - ceToJulianDay(epoch, year, month, 1);\n return [\n year,\n month,\n day\n ];\n}\nfunction getLeapDay(year) {\n return Math.floor(year % 4 / 3);\n}\nfunction getDaysInMonth(year, month) {\n // The Ethiopian and Coptic calendars have 13 months, 12 of 30 days each and\n // an intercalary month at the end of the year of 5 or 6 days, depending whether\n // the year is a leap year or not. The Leap Year follows the same rules as the\n // Julian Calendar so that the extra month always has six days in the year before\n // a Julian Leap Year.\n if (month % 13 !== 0) // not intercalary month\n return 30;\n else // intercalary month 5 days + possible leap day\n return getLeapDay(year) + 5;\n}\nclass EthiopicCalendar {\n fromJulianDay(jd) {\n let [year, month, day] = julianDayToCE(ETHIOPIC_EPOCH, jd);\n let era = 'AM';\n if (year <= 0) {\n era = 'AA';\n year += AMETE_MIHRET_DELTA;\n }\n return new (0, _calendarDate.CalendarDate)(this, era, year, month, day);\n }\n toJulianDay(date) {\n let year = date.year;\n if (date.era === 'AA') year -= AMETE_MIHRET_DELTA;\n return ceToJulianDay(ETHIOPIC_EPOCH, year, date.month, date.day);\n }\n getDaysInMonth(date) {\n return getDaysInMonth(date.year, date.month);\n }\n getMonthsInYear() {\n return 13;\n }\n getDaysInYear(date) {\n return 365 + getLeapDay(date.year);\n }\n getYearsInEra(date) {\n // 9999-12-31 gregorian is 9992-20-02 ethiopic.\n // Round down to 9991 for the last full year.\n // AA 9999-01-01 ethiopic is 4506-09-30 gregorian.\n return date.era === 'AA' ? 9999 : 9991;\n }\n getEras() {\n return [\n 'AA',\n 'AM'\n ];\n }\n constructor(){\n this.identifier = 'ethiopic';\n }\n}\nclass EthiopicAmeteAlemCalendar extends EthiopicCalendar {\n fromJulianDay(jd) {\n let [year, month, day] = julianDayToCE(ETHIOPIC_EPOCH, jd);\n year += AMETE_MIHRET_DELTA;\n return new (0, _calendarDate.CalendarDate)(this, 'AA', year, month, day);\n }\n getEras() {\n return [\n 'AA'\n ];\n }\n getYearsInEra() {\n // 9999-13-04 ethioaa is the maximum date, which is equivalent to 4506-09-29 gregorian.\n return 9999;\n }\n constructor(...args){\n super(...args), this.identifier = 'ethioaa' // also known as 'ethiopic-amete-alem' in ICU\n ;\n }\n}\nclass CopticCalendar extends EthiopicCalendar {\n fromJulianDay(jd) {\n let [year, month, day] = julianDayToCE(COPTIC_EPOCH, jd);\n let era = 'CE';\n if (year <= 0) {\n era = 'BCE';\n year = 1 - year;\n }\n return new (0, _calendarDate.CalendarDate)(this, era, year, month, day);\n }\n toJulianDay(date) {\n let year = date.year;\n if (date.era === 'BCE') year = 1 - year;\n return ceToJulianDay(COPTIC_EPOCH, year, date.month, date.day);\n }\n getDaysInMonth(date) {\n let year = date.year;\n if (date.era === 'BCE') year = 1 - year;\n return getDaysInMonth(year, date.month);\n }\n isInverseEra(date) {\n return date.era === 'BCE';\n }\n balanceDate(date) {\n if (date.year <= 0) {\n date.era = date.era === 'BCE' ? 'CE' : 'BCE';\n date.year = 1 - date.year;\n }\n }\n getEras() {\n return [\n 'BCE',\n 'CE'\n ];\n }\n getYearsInEra(date) {\n // 9999-12-30 gregorian is 9716-02-20 coptic.\n // Round down to 9715 for the last full year.\n // BCE 9999-01-01 coptic is BC 9716-06-15 gregorian.\n return date.era === 'BCE' ? 9999 : 9715;\n }\n constructor(...args){\n super(...args), this.identifier = 'coptic';\n }\n}\n\n},{\"../CalendarDate\":\"jKRe7\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"l2thl\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/** Creates a `Calendar` instance from a Unicode calendar identifier string. */ parcelHelpers.export(exports, \"createCalendar\", ()=>createCalendar);\nvar _buddhistCalendar = require(\"./calendars/BuddhistCalendar\");\nvar _ethiopicCalendar = require(\"./calendars/EthiopicCalendar\");\nvar _gregorianCalendar = require(\"./calendars/GregorianCalendar\");\nvar _hebrewCalendar = require(\"./calendars/HebrewCalendar\");\nvar _indianCalendar = require(\"./calendars/IndianCalendar\");\nvar _islamicCalendar = require(\"./calendars/IslamicCalendar\");\nvar _japaneseCalendar = require(\"./calendars/JapaneseCalendar\");\nvar _persianCalendar = require(\"./calendars/PersianCalendar\");\nvar _taiwanCalendar = require(\"./calendars/TaiwanCalendar\");\nfunction createCalendar(name) {\n switch(name){\n case 'buddhist':\n return new (0, _buddhistCalendar.BuddhistCalendar)();\n case 'ethiopic':\n return new (0, _ethiopicCalendar.EthiopicCalendar)();\n case 'ethioaa':\n return new (0, _ethiopicCalendar.EthiopicAmeteAlemCalendar)();\n case 'coptic':\n return new (0, _ethiopicCalendar.CopticCalendar)();\n case 'hebrew':\n return new (0, _hebrewCalendar.HebrewCalendar)();\n case 'indian':\n return new (0, _indianCalendar.IndianCalendar)();\n case 'islamic-civil':\n return new (0, _islamicCalendar.IslamicCivilCalendar)();\n case 'islamic-tbla':\n return new (0, _islamicCalendar.IslamicTabularCalendar)();\n case 'islamic-umalqura':\n return new (0, _islamicCalendar.IslamicUmalquraCalendar)();\n case 'japanese':\n return new (0, _japaneseCalendar.JapaneseCalendar)();\n case 'persian':\n return new (0, _persianCalendar.PersianCalendar)();\n case 'roc':\n return new (0, _taiwanCalendar.TaiwanCalendar)();\n case 'gregory':\n default:\n return new (0, _gregorianCalendar.GregorianCalendar)();\n }\n}\n\n},{\"./calendars/BuddhistCalendar\":\"gdq13\",\"./calendars/EthiopicCalendar\":\"ceCwg\",\"./calendars/GregorianCalendar\":\"5KBzD\",\"./calendars/HebrewCalendar\":\"61C0Y\",\"./calendars/IndianCalendar\":\"2Ty6g\",\"./calendars/IslamicCalendar\":\"5KQee\",\"./calendars/JapaneseCalendar\":\"4n2ag\",\"./calendars/PersianCalendar\":\"gqXuG\",\"./calendars/TaiwanCalendar\":\"fEpdK\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"dowtt\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/** A wrapper around Intl.DateTimeFormat that fixes various browser bugs, and polyfills new features. */ parcelHelpers.export(exports, \"DateFormatter\", ()=>DateFormatter);\nlet formatterCache = new Map();\nclass DateFormatter {\n constructor(locale, options = {}){\n this.formatter = getCachedDateFormatter(locale, options);\n this.options = options;\n }\n /** Formats a date as a string according to the locale and format options passed to the constructor. */ format(value) {\n return this.formatter.format(value);\n }\n /** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */ formatToParts(value) {\n return this.formatter.formatToParts(value);\n }\n /** Formats a date range as a string. */ formatRange(start, end) {\n // @ts-ignore\n if (typeof this.formatter.formatRange === 'function') // @ts-ignore\n return this.formatter.formatRange(start, end);\n if (end < start) throw new RangeError('End date must be >= start date');\n // Very basic fallback for old browsers.\n return `${this.formatter.format(start)} \\u{2013} ${this.formatter.format(end)}`;\n }\n /** Formats a date range as an array of parts. */ formatRangeToParts(start, end) {\n // @ts-ignore\n if (typeof this.formatter.formatRangeToParts === 'function') // @ts-ignore\n return this.formatter.formatRangeToParts(start, end);\n if (end < start) throw new RangeError('End date must be >= start date');\n let startParts = this.formatter.formatToParts(start);\n let endParts = this.formatter.formatToParts(end);\n return [\n ...startParts.map((p)=>({\n ...p,\n source: 'startRange'\n })),\n {\n type: 'literal',\n value: \" \\u2013 \",\n source: 'shared'\n },\n ...endParts.map((p)=>({\n ...p,\n source: 'endRange'\n }))\n ];\n }\n /** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {\n let resolvedOptions = this.formatter.resolvedOptions();\n if (hasBuggyResolvedHourCycle()) {\n if (!this.resolvedHourCycle) this.resolvedHourCycle = getResolvedHourCycle(resolvedOptions.locale, this.options);\n resolvedOptions.hourCycle = this.resolvedHourCycle;\n resolvedOptions.hour12 = this.resolvedHourCycle === 'h11' || this.resolvedHourCycle === 'h12';\n }\n // Safari uses a different name for the Ethiopic (Amete Alem) calendar.\n // https://bugs.webkit.org/show_bug.cgi?id=241564\n if (resolvedOptions.calendar === 'ethiopic-amete-alem') resolvedOptions.calendar = 'ethioaa';\n return resolvedOptions;\n }\n}\n// There are multiple bugs involving the hour12 and hourCycle options in various browser engines.\n// - Chrome [1] (and the ECMA 402 spec [2]) resolve hour12: false in English and other locales to h24 (24:00 - 23:59)\n// rather than h23 (00:00 - 23:59). Same can happen with hour12: true in French, which Chrome resolves to h11 (00:00 - 11:59)\n// rather than h12 (12:00 - 11:59).\n// - WebKit returns an incorrect hourCycle resolved option in the French locale due to incorrect parsing of 'h' literal\n// in the resolved pattern. It also formats incorrectly when specifying the hourCycle option for the same reason. [3]\n// [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1045791\n// [2] https://github.com/tc39/ecma402/issues/402\n// [3] https://bugs.webkit.org/show_bug.cgi?id=229313\n// https://github.com/unicode-org/cldr/blob/018b55eff7ceb389c7e3fc44e2f657eae3b10b38/common/supplemental/supplementalData.xml#L4774-L4802\nconst hour12Preferences = {\n true: {\n // Only Japanese uses the h11 style for 12 hour time. All others use h12.\n ja: 'h11'\n },\n false: {\n }\n};\nfunction getCachedDateFormatter(locale, options = {}) {\n // Work around buggy hour12 behavior in Chrome / ECMA 402 spec by using hourCycle instead.\n // Only apply the workaround if the issue is detected, because the hourCycle option is buggy in Safari.\n if (typeof options.hour12 === 'boolean' && hasBuggyHour12Behavior()) {\n options = {\n ...options\n };\n let pref = hour12Preferences[String(options.hour12)][locale.split('-')[0]];\n let defaultHourCycle = options.hour12 ? 'h12' : 'h23';\n options.hourCycle = pref ?? defaultHourCycle;\n delete options.hour12;\n }\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : '');\n if (formatterCache.has(cacheKey)) return formatterCache.get(cacheKey);\n let numberFormatter = new Intl.DateTimeFormat(locale, options);\n formatterCache.set(cacheKey, numberFormatter);\n return numberFormatter;\n}\nlet _hasBuggyHour12Behavior = null;\nfunction hasBuggyHour12Behavior() {\n if (_hasBuggyHour12Behavior == null) _hasBuggyHour12Behavior = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n hour12: false\n }).format(new Date(2020, 2, 3, 0)) === '24';\n return _hasBuggyHour12Behavior;\n}\nlet _hasBuggyResolvedHourCycle = null;\nfunction hasBuggyResolvedHourCycle() {\n if (_hasBuggyResolvedHourCycle == null) _hasBuggyResolvedHourCycle = new Intl.DateTimeFormat('fr', {\n hour: 'numeric',\n hour12: false\n }).resolvedOptions().hourCycle === 'h12';\n return _hasBuggyResolvedHourCycle;\n}\nfunction getResolvedHourCycle(locale, options) {\n if (!options.timeStyle && !options.hour) return undefined;\n // Work around buggy results in resolved hourCycle and hour12 options in WebKit.\n // Format the minimum possible hour and maximum possible hour in a day and parse the results.\n locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, '');\n locale += (locale.includes('-u-') ? '' : '-u') + '-nu-latn';\n let formatter = getCachedDateFormatter(locale, {\n ...options,\n timeZone: undefined // use local timezone\n });\n let min = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 0)).find((p)=>p.type === 'hour').value, 10);\n let max = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 23)).find((p)=>p.type === 'hour').value, 10);\n if (min === 0 && max === 23) return 'h23';\n if (min === 24 && max === 23) return 'h24';\n if (min === 0 && max === 11) return 'h11';\n if (min === 12 && max === 11) return 'h12';\n throw new Error('Unexpected hour cycle result');\n}\n\n},{\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"9i0Ex\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Provides localized number formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the number formatter for performance.\n * @param options - Formatting options.\n */ parcelHelpers.export(exports, \"useNumberFormatter\", ()=>useNumberFormatter);\nvar _number = require(\"@internationalized/number\");\nvar _context = require(\"./context\");\nvar _react = require(\"react\");\nfunction useNumberFormatter(options = {}) {\n let { locale } = (0, _context.useLocale)();\n return (0, _react.useMemo)(()=>new (0, _number.NumberFormatter)(locale, options), [\n locale,\n options\n ]);\n}\n\n},{\"@internationalized/number\":\"jmZjH\",\"./context\":\"bPV6W\",\"react\":\"jEiK2\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"jmZjH\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"NumberFormatter\", ()=>(0, _numberFormatter.NumberFormatter));\nparcelHelpers.export(exports, \"NumberParser\", ()=>(0, _numberParser.NumberParser));\nvar _numberFormatter = require(\"./NumberFormatter\");\nvar _numberParser = require(\"./NumberParser\");\n\n},{\"./NumberFormatter\":\"6Vu3K\",\"./NumberParser\":\"dZIMR\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"6Vu3K\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * A wrapper around Intl.NumberFormat providing additional options, polyfills, and caching for performance.\n */ parcelHelpers.export(exports, \"NumberFormatter\", ()=>NumberFormatter);\n/** @private - exported for tests */ parcelHelpers.export(exports, \"numberFormatSignDisplayPolyfill\", ()=>numberFormatSignDisplayPolyfill);\nlet formatterCache = new Map();\nlet supportsSignDisplay = false;\ntry {\n supportsSignDisplay = new Intl.NumberFormat('de-DE', {\n signDisplay: 'exceptZero'\n }).resolvedOptions().signDisplay === 'exceptZero';\n// eslint-disable-next-line no-empty\n} catch {}\nlet supportsUnit = false;\ntry {\n supportsUnit = new Intl.NumberFormat('de-DE', {\n style: 'unit',\n unit: 'degree'\n }).resolvedOptions().style === 'unit';\n// eslint-disable-next-line no-empty\n} catch {}\n// Polyfill for units since Safari doesn't support them yet. See https://bugs.webkit.org/show_bug.cgi?id=215438.\n// Currently only polyfilling the unit degree in narrow format for ColorSlider in our supported locales.\n// Values were determined by switching to each locale manually in Chrome.\nconst UNITS = {\n degree: {\n narrow: {\n default: \"\\xb0\",\n 'ja-JP': \" \\u5EA6\",\n 'zh-TW': \"\\u5EA6\",\n 'sl-SI': \" \\xb0\"\n }\n }\n};\nclass NumberFormatter {\n constructor(locale, options = {}){\n this.numberFormatter = getCachedNumberFormatter(locale, options);\n this.options = options;\n }\n /** Formats a number value as a string, according to the locale and options provided to the constructor. */ format(value) {\n let res = '';\n if (!supportsSignDisplay && this.options.signDisplay != null) res = numberFormatSignDisplayPolyfill(this.numberFormatter, this.options.signDisplay, value);\n else res = this.numberFormatter.format(value);\n if (this.options.style === 'unit' && !supportsUnit) {\n let { unit, unitDisplay = 'short', locale } = this.resolvedOptions();\n if (!unit) return res;\n let values = UNITS[unit]?.[unitDisplay];\n res += values[locale] || values.default;\n }\n return res;\n }\n /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */ formatToParts(value) {\n // TODO: implement signDisplay for formatToParts\n return this.numberFormatter.formatToParts(value);\n }\n /** Formats a number range as a string. */ formatRange(start, end) {\n if (typeof this.numberFormatter.formatRange === 'function') return this.numberFormatter.formatRange(start, end);\n if (end < start) throw new RangeError('End date must be >= start date');\n // Very basic fallback for old browsers.\n return `${this.format(start)} \\u{2013} ${this.format(end)}`;\n }\n /** Formats a number range as an array of parts. */ formatRangeToParts(start, end) {\n if (typeof this.numberFormatter.formatRangeToParts === 'function') return this.numberFormatter.formatRangeToParts(start, end);\n if (end < start) throw new RangeError('End date must be >= start date');\n let startParts = this.numberFormatter.formatToParts(start);\n let endParts = this.numberFormatter.formatToParts(end);\n return [\n ...startParts.map((p)=>({\n ...p,\n source: 'startRange'\n })),\n {\n type: 'literal',\n value: \" \\u2013 \",\n source: 'shared'\n },\n ...endParts.map((p)=>({\n ...p,\n source: 'endRange'\n }))\n ];\n }\n /** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {\n let options = this.numberFormatter.resolvedOptions();\n if (!supportsSignDisplay && this.options.signDisplay != null) options = {\n ...options,\n signDisplay: this.options.signDisplay\n };\n if (!supportsUnit && this.options.style === 'unit') options = {\n ...options,\n style: 'unit',\n unit: this.options.unit,\n unitDisplay: this.options.unitDisplay\n };\n return options;\n }\n}\nfunction getCachedNumberFormatter(locale, options = {}) {\n let { numberingSystem } = options;\n if (numberingSystem && locale.includes('-nu-')) {\n if (!locale.includes('-u-')) locale += '-u-';\n locale += `-nu-${numberingSystem}`;\n }\n if (options.style === 'unit' && !supportsUnit) {\n let { unit, unitDisplay = 'short' } = options;\n if (!unit) throw new Error('unit option must be provided with style: \"unit\"');\n if (!UNITS[unit]?.[unitDisplay]) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);\n options = {\n ...options,\n style: 'decimal'\n };\n }\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : '');\n if (formatterCache.has(cacheKey)) return formatterCache.get(cacheKey);\n let numberFormatter = new Intl.NumberFormat(locale, options);\n formatterCache.set(cacheKey, numberFormatter);\n return numberFormatter;\n}\nfunction numberFormatSignDisplayPolyfill(numberFormat, signDisplay, num) {\n if (signDisplay === 'auto') return numberFormat.format(num);\n else if (signDisplay === 'never') return numberFormat.format(Math.abs(num));\n else {\n let needsPositiveSign = false;\n if (signDisplay === 'always') needsPositiveSign = num > 0 || Object.is(num, 0);\n else if (signDisplay === 'exceptZero') {\n if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);\n else needsPositiveSign = num > 0;\n }\n if (needsPositiveSign) {\n let negative = numberFormat.format(-num);\n let noSign = numberFormat.format(num);\n // ignore RTL/LTR marker character\n let minus = negative.replace(noSign, '').replace(/\\u200e|\\u061C/, '');\n if ([\n ...minus\n ].length !== 1) console.warn('@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case');\n let positive = negative.replace(noSign, '!!!').replace(minus, '+').replace('!!!', noSign);\n return positive;\n } else return numberFormat.format(num);\n }\n}\n\n},{\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"dZIMR\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * A NumberParser can be used to perform locale-aware parsing of numbers from Unicode strings,\n * as well as validation of partial user input. It automatically detects the numbering system\n * used in the input, and supports parsing decimals, percentages, currency values, and units\n * according to the locale.\n */ parcelHelpers.export(exports, \"NumberParser\", ()=>NumberParser);\nvar _numberFormatter = require(\"./NumberFormatter\");\nconst CURRENCY_SIGN_REGEX = new RegExp('^.*\\\\(.*\\\\).*$');\nconst NUMBERING_SYSTEMS = [\n 'latn',\n 'arab',\n 'hanidec',\n 'deva',\n 'beng'\n];\nclass NumberParser {\n constructor(locale, options = {}){\n this.locale = locale;\n this.options = options;\n }\n /**\n * Parses the given string to a number. Returns NaN if a valid number could not be parsed.\n */ parse(value) {\n return getNumberParserImpl(this.locale, this.options, value).parse(value);\n }\n /**\n * Returns whether the given string could potentially be a valid number. This should be used to\n * validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity\n * of the minus/plus sign characters can be checked.\n */ isValidPartialNumber(value, minValue, maxValue) {\n return getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);\n }\n /**\n * Returns a numbering system for which the given string is valid in the current locale.\n * If no numbering system could be detected, the default numbering system for the current\n * locale is returned.\n */ getNumberingSystem(value) {\n return getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;\n }\n}\nconst numberParserCache = new Map();\nfunction getNumberParserImpl(locale, options, value) {\n // First try the default numbering system for the provided locale\n let defaultParser = getCachedNumberParser(locale, options);\n // If that doesn't match, and the locale doesn't include a hard coded numbering system,\n // try each of the other supported numbering systems until we find one that matches.\n if (!locale.includes('-nu-') && !defaultParser.isValidPartialNumber(value)) {\n for (let numberingSystem of NUMBERING_SYSTEMS)if (numberingSystem !== defaultParser.options.numberingSystem) {\n let parser = getCachedNumberParser(locale + (locale.includes('-u-') ? '-nu-' : '-u-nu-') + numberingSystem, options);\n if (parser.isValidPartialNumber(value)) return parser;\n }\n }\n return defaultParser;\n}\nfunction getCachedNumberParser(locale, options) {\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : '');\n let parser = numberParserCache.get(cacheKey);\n if (!parser) {\n parser = new NumberParserImpl(locale, options);\n numberParserCache.set(cacheKey, parser);\n }\n return parser;\n}\n// The actual number parser implementation. Instances of this class are cached\n// based on the locale, options, and detected numbering system.\nclass NumberParserImpl {\n constructor(locale, options = {}){\n this.locale = locale;\n this.formatter = new Intl.NumberFormat(locale, options);\n this.options = this.formatter.resolvedOptions();\n this.symbols = getSymbols(locale, this.formatter, this.options, options);\n if (this.options.style === 'percent' && ((this.options.minimumFractionDigits ?? 0) > 18 || (this.options.maximumFractionDigits ?? 0) > 18)) console.warn('NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.');\n }\n parse(value) {\n // to parse the number, we need to remove anything that isn't actually part of the number, for example we want '-10.40' not '-10.40 USD'\n let fullySanitizedValue = this.sanitize(value);\n if (this.symbols.group) // Remove group characters, and replace decimal points and numerals with ASCII values.\n fullySanitizedValue = replaceAll(fullySanitizedValue, this.symbols.group, '');\n if (this.symbols.decimal) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal, '.');\n if (this.symbols.minusSign) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign, '-');\n fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);\n if (this.options.style === 'percent') {\n // javascript is bad at dividing by 100 and maintaining the same significant figures, so perform it on the string before parsing\n let isNegative = fullySanitizedValue.indexOf('-');\n fullySanitizedValue = fullySanitizedValue.replace('-', '');\n let index = fullySanitizedValue.indexOf('.');\n if (index === -1) index = fullySanitizedValue.length;\n fullySanitizedValue = fullySanitizedValue.replace('.', '');\n if (index - 2 === 0) fullySanitizedValue = `0.${fullySanitizedValue}`;\n else if (index - 2 === -1) fullySanitizedValue = `0.0${fullySanitizedValue}`;\n else if (index - 2 === -2) fullySanitizedValue = '0.00';\n else fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;\n if (isNegative > -1) fullySanitizedValue = `-${fullySanitizedValue}`;\n }\n let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;\n if (isNaN(newValue)) return NaN;\n if (this.options.style === 'percent') {\n // extra step for rounding percents to what our formatter would output\n let options = {\n ...this.options,\n style: 'decimal',\n minimumFractionDigits: Math.min((this.options.minimumFractionDigits ?? 0) + 2, 20),\n maximumFractionDigits: Math.min((this.options.maximumFractionDigits ?? 0) + 2, 20)\n };\n return new NumberParser(this.locale, options).parse(new (0, _numberFormatter.NumberFormatter)(this.locale, options).format(newValue));\n }\n // accounting will always be stripped to a positive number, so if it's accounting and has a () around everything, then we need to make it negative again\n if (this.options.currencySign === 'accounting' && CURRENCY_SIGN_REGEX.test(value)) newValue = -1 * newValue;\n return newValue;\n }\n sanitize(value) {\n // Remove literals and whitespace, which are allowed anywhere in the string\n value = value.replace(this.symbols.literals, '');\n // Replace the ASCII minus sign with the minus sign used in the current locale\n // so that both are allowed in case the user's keyboard doesn't have the locale's minus sign.\n if (this.symbols.minusSign) value = value.replace('-', this.symbols.minusSign);\n // In arab numeral system, their decimal character is 1643, but most keyboards don't type that\n // instead they use the , (44) character or apparently the (1548) character.\n if (this.options.numberingSystem === 'arab') {\n if (this.symbols.decimal) {\n value = value.replace(',', this.symbols.decimal);\n value = value.replace(String.fromCharCode(1548), this.symbols.decimal);\n }\n if (this.symbols.group) value = replaceAll(value, '.', this.symbols.group);\n }\n // fr-FR group character is char code 8239, but that's not a key on the french keyboard,\n // so allow 'period' as a group char and replace it with a space\n if (this.options.locale === 'fr-FR') value = replaceAll(value, '.', String.fromCharCode(8239));\n return value;\n }\n isValidPartialNumber(value, minValue = -Infinity, maxValue = Infinity) {\n value = this.sanitize(value);\n // Remove minus or plus sign, which must be at the start of the string.\n if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) value = value.slice(this.symbols.minusSign.length);\n else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) value = value.slice(this.symbols.plusSign.length);\n // Numbers cannot start with a group separator\n if (this.symbols.group && value.startsWith(this.symbols.group)) return false;\n // Numbers that can't have any decimal values fail if a decimal character is typed\n if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) return false;\n // Remove numerals, groups, and decimals\n if (this.symbols.group) value = replaceAll(value, this.symbols.group, '');\n value = value.replace(this.symbols.numeral, '');\n if (this.symbols.decimal) value = value.replace(this.symbols.decimal, '');\n // The number is valid if there are no remaining characters\n return value.length === 0;\n }\n}\nconst nonLiteralParts = new Set([\n 'decimal',\n 'fraction',\n 'integer',\n 'minusSign',\n 'plusSign',\n 'group'\n]);\n// This list is derived from https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html#comparison and includes\n// all unique numbers which we need to check in order to determine all the plural forms for a given locale.\n// See: https://github.com/adobe/react-spectrum/pull/5134/files#r1337037855 for used script\nconst pluralNumbers = [\n 0,\n 4,\n 2,\n 1,\n 11,\n 20,\n 3,\n 7,\n 100,\n 21,\n 0.1,\n 1.1\n];\nfunction getSymbols(locale, formatter, intlOptions, originalOptions) {\n // formatter needs access to all decimal places in order to generate the correct literal strings for the plural set\n let symbolFormatter = new Intl.NumberFormat(locale, {\n ...intlOptions,\n // Resets so we get the full range of symbols\n minimumSignificantDigits: 1,\n maximumSignificantDigits: 21,\n roundingIncrement: 1,\n roundingPriority: 'auto',\n roundingMode: 'halfExpand'\n });\n // Note: some locale's don't add a group symbol until there is a ten thousands place\n let allParts = symbolFormatter.formatToParts(-10000.111);\n let posAllParts = symbolFormatter.formatToParts(10000.111);\n let pluralParts = pluralNumbers.map((n)=>symbolFormatter.formatToParts(n));\n let minusSign = allParts.find((p)=>p.type === 'minusSign')?.value ?? '-';\n let plusSign = posAllParts.find((p)=>p.type === 'plusSign')?.value;\n // Safari does not support the signDisplay option, but our number parser polyfills it.\n // If no plus sign was returned, but the original options contained signDisplay, default to the '+' character.\n if (!plusSign && (originalOptions?.signDisplay === 'exceptZero' || originalOptions?.signDisplay === 'always')) plusSign = '+';\n // If maximumSignificantDigits is 1 (the minimum) then we won't get decimal characters out of the above formatters\n // Percent also defaults to 0 fractionDigits, so we need to make a new one that isn't percent to get an accurate decimal\n let decimalParts = new Intl.NumberFormat(locale, {\n ...intlOptions,\n minimumFractionDigits: 2,\n maximumFractionDigits: 2\n }).formatToParts(0.001);\n let decimal = decimalParts.find((p)=>p.type === 'decimal')?.value;\n let group = allParts.find((p)=>p.type === 'group')?.value;\n // this set is also for a regex, it's all literals that might be in the string we want to eventually parse that\n // don't contribute to the numerical value\n let allPartsLiterals = allParts.filter((p)=>!nonLiteralParts.has(p.type)).map((p)=>escapeRegex(p.value));\n let pluralPartsLiterals = pluralParts.flatMap((p)=>p.filter((p)=>!nonLiteralParts.has(p.type)).map((p)=>escapeRegex(p.value)));\n let sortedLiterals = [\n ...new Set([\n ...allPartsLiterals,\n ...pluralPartsLiterals\n ])\n ].sort((a, b)=>b.length - a.length);\n let literals = sortedLiterals.length === 0 ? new RegExp('[\\\\p{White_Space}]', 'gu') : new RegExp(`${sortedLiterals.join('|')}|[\\\\p{White_Space}]`, 'gu');\n // These are for replacing non-latn characters with the latn equivalent\n let numerals = [\n ...new Intl.NumberFormat(intlOptions.locale, {\n useGrouping: false\n }).format(9876543210)\n ].reverse();\n let indexes = new Map(numerals.map((d, i)=>[\n d,\n i\n ]));\n let numeral = new RegExp(`[${numerals.join('')}]`, 'g');\n let index = (d)=>String(indexes.get(d));\n return {\n minusSign,\n plusSign,\n decimal,\n group,\n literals,\n numeral,\n index\n };\n}\nfunction replaceAll(str, find, replace) {\n if (str.replaceAll) return str.replaceAll(find, replace);\n return str.split(find).join(replace);\n}\nfunction escapeRegex(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n},{\"./NumberFormatter\":\"6Vu3K\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"150sj\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Provides localized string collation for the current locale. Automatically updates when the locale changes,\n * and handles caching of the collator for performance.\n * @param options - Collator options.\n */ parcelHelpers.export(exports, \"useCollator\", ()=>useCollator);\nvar _context = require(\"./context\");\nlet cache = new Map();\nfunction useCollator(options) {\n let { locale } = (0, _context.useLocale)();\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : '');\n if (cache.has(cacheKey)) return cache.get(cacheKey);\n let formatter = new Intl.Collator(locale, options);\n cache.set(cacheKey, formatter);\n return formatter;\n}\n\n},{\"./context\":\"bPV6W\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"jnqDt\":[function(require,module,exports,__globalThis) {\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ var parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\n/**\n * Provides localized string search functionality that is useful for filtering or matching items\n * in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.\n */ parcelHelpers.export(exports, \"useFilter\", ()=>useFilter);\nvar _react = require(\"react\");\nvar _useCollator = require(\"./useCollator\");\nfunction useFilter(options) {\n let collator = (0, _useCollator.useCollator)({\n usage: 'search',\n ...options\n });\n // TODO(later): these methods don't currently support the ignorePunctuation option.\n let startsWith = (0, _react.useCallback)((string, substring)=>{\n if (substring.length === 0) return true;\n // Normalize both strings so we can slice safely\n // TODO: take into account the ignorePunctuation option as well...\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(0, substring.length), substring) === 0;\n }, [\n collator\n ]);\n let endsWith = (0, _react.useCallback)((string, substring)=>{\n if (substring.length === 0) return true;\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(-substring.length), substring) === 0;\n }, [\n collator\n ]);\n let contains = (0, _react.useCallback)((string, substring)=>{\n if (substring.length === 0) return true;\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n let scan = 0;\n let sliceLen = substring.length;\n for(; scan + sliceLen <= string.length; scan++){\n let slice = string.slice(scan, scan + sliceLen);\n if (collator.compare(substring, slice) === 0) return true;\n }\n return false;\n }, [\n collator\n ]);\n return (0, _react.useMemo)(()=>({\n startsWith,\n endsWith,\n contains\n }), [\n startsWith,\n endsWith,\n contains\n ]);\n}\n\n},{\"react\":\"jEiK2\",\"./useCollator\":\"150sj\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}]},[], null, \"parcelRequire94c2\")\n\n//# sourceMappingURL=useButton.stories.ff0b63b2.js.map\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {I18nProvider, useLocale} from './context';\nexport {useMessageFormatter} from './useMessageFormatter';\nexport {useLocalizedStringFormatter, useLocalizedStringDictionary} from './useLocalizedStringFormatter';\nexport {useListFormatter} from './useListFormatter';\nexport {useDateFormatter} from './useDateFormatter';\nexport {useNumberFormatter} from './useNumberFormatter';\nexport {useCollator} from './useCollator';\nexport {useFilter} from './useFilter';\n\nexport type {FormatMessage} from './useMessageFormatter';\nexport type {LocalizedStringFormatter} from '@internationalized/string';\nexport type {I18nProviderProps} from './context';\nexport type {Locale} from './useDefaultLocale';\nexport type {LocalizedStrings} from '@internationalized/message';\nexport type {DateFormatterOptions} from './useDateFormatter';\nexport type {DateFormatter} from '@internationalized/date';\nexport type {Filter} from './useFilter';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isRTL} from './utils';\nimport {Locale, useDefaultLocale} from './useDefaultLocale';\nimport React, {ReactNode, useContext} from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode,\n /** The locale to apply to the children. */\n locale?: string\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps) {\n let {locale, children} = props;\n let defaultLocale = useDefaultLocale();\n\n let value: Locale = React.useMemo(() => {\n if (!locale) {\n return defaultLocale;\n }\n\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n };\n }, [defaultLocale, locale]);\n\n return (\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n );\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);\nconst RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']);\n\n/**\n * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.\n */\nexport function isRTL(localeString: string) {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n if (Intl.Locale) {\n let locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo\n let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;\n if (textInfo) {\n return textInfo.direction === 'rtl';\n }\n\n // Fallback: guess using the script.\n // This is more accurate than guessing by language, since languages can be written in multiple scripts.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n let lang = localeString.split('-')[0];\n return RTL_LANGS.has(lang);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Direction} from '@react-types/shared';\nimport {isRTL} from './utils';\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\n\nexport interface Locale {\n /** The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. */\n locale: string,\n /** The writing direction for the locale. */\n direction: Direction\n}\n\n// Locale passed from server by PackageLocalizationProvider.\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\n\n/**\n * Gets the locale setting of the browser.\n */\nexport function getDefaultLocale(): Locale {\n let locale = typeof window !== 'undefined' && window[localeSymbol]\n // @ts-ignore\n || (typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage))\n || 'en-US';\n\n try {\n Intl.DateTimeFormat.supportedLocalesOf([locale]);\n } catch {\n locale = 'en-US';\n }\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n };\n}\n\nlet currentLocale = getDefaultLocale();\nlet listeners = new Set<(locale: Locale) => void>();\n\nfunction updateLocale() {\n currentLocale = getDefaultLocale();\n for (let listener of listeners) {\n listener(currentLocale);\n }\n}\n\n/**\n * Returns the current browser/system language, and updates when it changes.\n */\nexport function useDefaultLocale(): Locale {\n let isSSR = useIsSSR();\n let [defaultLocale, setDefaultLocale] = useState(currentLocale);\n\n useEffect(() => {\n if (listeners.size === 0) {\n window.addEventListener('languagechange', updateLocale);\n }\n\n listeners.add(setDefaultLocale);\n\n return () => {\n listeners.delete(setDefaultLocale);\n if (listeners.size === 0) {\n window.removeEventListener('languagechange', updateLocale);\n }\n };\n }, []);\n\n // We cannot determine the browser's language on the server, so default to\n // en-US. This will be updated after hydration on the client to the correct value.\n if (isSSR) {\n return {\n locale: 'en-US',\n direction: 'ltr'\n };\n }\n\n return defaultLocale;\n}\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {LocalizedString, LocalizedStringDictionary, LocalizedStringFormatter, LocalizedStrings} from '@internationalized/string';\nimport {useLocale} from './context';\nimport {useMemo} from 'react';\n\nconst cache = new WeakMap();\nfunction getCachedDictionary<K extends string, T extends LocalizedString>(strings: LocalizedStrings<K, T>): LocalizedStringDictionary<K, T> {\n let dictionary = cache.get(strings);\n if (!dictionary) {\n dictionary = new LocalizedStringDictionary(strings);\n cache.set(strings, dictionary);\n }\n\n return dictionary;\n}\n\n/**\n * Returns a cached LocalizedStringDictionary for the given strings.\n */\nexport function useLocalizedStringDictionary<K extends string = string, T extends LocalizedString = string>(strings: LocalizedStrings<K, T>, packageName?: string): LocalizedStringDictionary<K, T> {\n return (packageName && LocalizedStringDictionary.getGlobalDictionaryForPackage(packageName)) || getCachedDictionary(strings);\n}\n\n/**\n * Provides localized string formatting for the current locale. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers. Automatically updates when the locale changes.\n * @param strings - A mapping of languages to localized strings by key.\n */\nexport function useLocalizedStringFormatter<K extends string = string, T extends LocalizedString = string>(strings: LocalizedStrings<K, T>, packageName?: string): LocalizedStringFormatter<K, T> {\n let {locale} = useLocale();\n let dictionary = useLocalizedStringDictionary(strings, packageName);\n return useMemo(() => new LocalizedStringFormatter(locale, dictionary), [locale, dictionary]);\n}\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {Variables, LocalizedString} from './LocalizedStringFormatter';\nexport type {LocalizedStrings} from './LocalizedStringDictionary';\nexport {LocalizedStringDictionary} from './LocalizedStringDictionary';\nexport {LocalizedStringFormatter} from './LocalizedStringFormatter';\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedString} from './LocalizedStringFormatter';\n\nexport type LocalizedStrings<K extends string, T extends LocalizedString> = {\n [lang: string]: Record<K, T>\n};\n\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nconst stringsSymbol = Symbol.for('react-aria.i18n.strings');\nlet cachedGlobalStrings: {[packageName: string]: LocalizedStringDictionary<any, any>} | null | undefined = undefined;\n\n/**\n * Stores a mapping of localized strings. Can be used to find the\n * closest available string for a given locale.\n */\nexport class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {\n private strings: LocalizedStrings<K, T>;\n private defaultLocale: string;\n\n constructor(messages: LocalizedStrings<K, T>, defaultLocale: string = 'en-US') {\n // Clone messages so we don't modify the original object.\n // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.\n this.strings = Object.fromEntries(\n Object.entries(messages).filter(([, v]) => v)\n );\n this.defaultLocale = defaultLocale;\n }\n\n /** Returns a localized string for the given key and locale. */\n getStringForLocale(key: K, locale: string): T {\n let strings = this.getStringsForLocale(locale);\n let string = strings[key];\n if (!string) {\n throw new Error(`Could not find intl message ${key} in ${locale} locale`);\n }\n\n return string;\n }\n\n /** Returns all localized strings for the given locale. */\n getStringsForLocale(locale: string): Record<K, T> {\n let strings = this.strings[locale];\n if (!strings) {\n strings = getStringsForLocale(locale, this.strings, this.defaultLocale);\n this.strings[locale] = strings;\n }\n\n return strings;\n }\n\n static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null {\n if (typeof window === 'undefined') {\n return null;\n }\n\n let locale = window[localeSymbol];\n if (cachedGlobalStrings === undefined) {\n let globalStrings = window[stringsSymbol];\n if (!globalStrings) {\n return null;\n }\n\n cachedGlobalStrings = {};\n for (let pkg in globalStrings) {\n cachedGlobalStrings[pkg] = new LocalizedStringDictionary({[locale]: globalStrings[pkg]}, locale);\n }\n }\n\n let dictionary = cachedGlobalStrings?.[packageName];\n if (!dictionary) {\n throw new Error(`Strings for package \"${packageName}\" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);\n }\n\n return dictionary;\n }\n}\n\nfunction getStringsForLocale<K extends string, T extends LocalizedString>(locale: string, strings: LocalizedStrings<K, T>, defaultLocale = 'en-US') {\n // If there is an exact match, use it.\n if (strings[locale]) {\n return strings[locale];\n }\n\n // Attempt to find the closest match by language.\n // For example, if the locale is fr-CA (French Canadian), but there is only\n // an fr-FR (France) set of strings, use that.\n // This could be replaced with Intl.LocaleMatcher once it is supported.\n // https://github.com/tc39/proposal-intl-localematcher\n let language = getLanguage(locale);\n if (strings[language]) {\n return strings[language];\n }\n\n for (let key in strings) {\n if (key.startsWith(language + '-')) {\n return strings[key];\n }\n }\n\n // Nothing close, use english.\n return strings[defaultLocale];\n}\n\nfunction getLanguage(locale: string) {\n // @ts-ignore\n if (Intl.Locale) {\n // @ts-ignore\n return new Intl.Locale(locale).language;\n }\n\n return locale.split('-')[0];\n}\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedStringDictionary} from './LocalizedStringDictionary';\n\nexport type Variables = Record<string, string | number | boolean> | undefined;\nexport type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);\ntype InternalString = string | (() => string);\n\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */\nexport class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {\n private locale: string;\n private strings: LocalizedStringDictionary<K, T>;\n\n constructor(locale: string, strings: LocalizedStringDictionary<K, T>) {\n this.locale = locale;\n this.strings = strings;\n }\n\n /** Formats a localized string for the given key with the provided variables. */\n format(key: K, variables?: Variables): string {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n\n protected plural(count: number, options: Record<string, InternalString>, type: Intl.PluralRuleType = 'cardinal') {\n let opt = options['=' + count];\n if (opt) {\n return typeof opt === 'function' ? opt() : opt;\n }\n\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {type});\n pluralRulesCache.set(key, pluralRules);\n }\n\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n\n protected number(value: number) {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n\n protected select(options: Record<string, InternalString>, value: string) {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useLocale} from './context';\nimport {useMemo} from 'react';\n\n/**\n * Provides localized list formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the list formatter for performance.\n * @param options - Formatting options.\n */\nexport function useListFormatter(options: Intl.ListFormatOptions = {}): Intl.ListFormat {\n let {locale} = useLocale();\n return useMemo(() => new Intl.ListFormat(locale, options), [locale, options]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DateFormatter} from '@internationalized/date';\nimport {useDeepMemo} from '@react-aria/utils';\nimport {useLocale} from './context';\nimport {useMemo} from 'react';\n\nexport interface DateFormatterOptions extends Intl.DateTimeFormatOptions {\n calendar?: string\n}\n\n/**\n * Provides localized date formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the date formatter for performance.\n * @param options - Formatting options.\n */\nexport function useDateFormatter(options?: DateFormatterOptions): DateFormatter {\n // Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused.\n options = useDeepMemo(options ?? {}, isEqual);\n let {locale} = useLocale();\n return useMemo(() => new DateFormatter(locale, options), [locale, options]);\n}\n\nfunction isEqual(a: DateFormatterOptions, b: DateFormatterOptions) {\n if (a === b) {\n return true;\n }\n\n let aKeys = Object.keys(a);\n let bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n for (let key of aKeys) {\n if (b[key] !== a[key]) {\n return false;\n }\n }\n\n return true;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {\n AnyCalendarDate,\n AnyTime,\n AnyDateTime,\n Calendar,\n DateDuration,\n TimeDuration,\n DateTimeDuration,\n DateFields,\n TimeFields,\n DateField,\n TimeField,\n Disambiguation,\n CycleOptions,\n CycleTimeOptions\n} from './types';\n\nexport {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from './CalendarDate';\nexport {GregorianCalendar} from './calendars/GregorianCalendar';\nexport {JapaneseCalendar} from './calendars/JapaneseCalendar';\nexport {BuddhistCalendar} from './calendars/BuddhistCalendar';\nexport {TaiwanCalendar} from './calendars/TaiwanCalendar';\nexport {PersianCalendar} from './calendars/PersianCalendar';\nexport {IndianCalendar} from './calendars/IndianCalendar';\nexport {IslamicCivilCalendar, IslamicTabularCalendar, IslamicUmalquraCalendar} from './calendars/IslamicCalendar';\nexport {HebrewCalendar} from './calendars/HebrewCalendar';\nexport {EthiopicCalendar, EthiopicAmeteAlemCalendar, CopticCalendar} from './calendars/EthiopicCalendar';\nexport {createCalendar} from './createCalendar';\nexport {\n toCalendarDate,\n toCalendarDateTime,\n toTime,\n toCalendar,\n toZoned,\n toTimeZone,\n toLocalTimeZone,\n fromDate,\n fromAbsolute\n} from './conversion';\nexport {\n isSameDay,\n isSameMonth,\n isSameYear,\n isEqualDay,\n isEqualMonth,\n isEqualYear,\n isToday,\n getDayOfWeek,\n now,\n today,\n getHoursInDay,\n getLocalTimeZone,\n startOfMonth,\n startOfWeek,\n startOfYear,\n endOfMonth,\n endOfWeek,\n endOfYear,\n getMinimumMonthInYear,\n getMinimumDayInMonth,\n getWeeksInMonth,\n minDate,\n maxDate,\n isWeekend,\n isWeekday\n} from './queries';\nexport {\n parseDate,\n parseDateTime,\n parseTime,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseZonedDateTime,\n parseDuration\n} from './string';\nexport {DateFormatter} from './DateFormatter';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {add, addTime, addZoned, constrain, constrainTime, cycleDate, cycleTime, cycleZoned, set, setTime, setZoned, subtract, subtractTime, subtractZoned} from './manipulation';\nimport {AnyCalendarDate, AnyTime, Calendar, CycleOptions, CycleTimeOptions, DateDuration, DateField, DateFields, DateTimeDuration, Disambiguation, TimeDuration, TimeField, TimeFields} from './types';\nimport {compareDate, compareTime} from './queries';\nimport {dateTimeToString, dateToString, timeToString, zonedDateTimeToString} from './string';\nimport {GregorianCalendar} from './calendars/GregorianCalendar';\nimport {toCalendarDateTime, toDate, toZoned, zonedToDate} from './conversion';\n\nfunction shiftArgs(args: any[]) {\n let calendar: Calendar = typeof args[0] === 'object'\n ? args.shift()\n : new GregorianCalendar();\n\n let era: string;\n if (typeof args[0] === 'string') {\n era = args.shift();\n } else {\n let eras = calendar.getEras();\n era = eras[eras.length - 1];\n }\n\n let year = args.shift();\n let month = args.shift();\n let day = args.shift();\n\n return [calendar, era, year, month, day];\n}\n\n/** A CalendarDate represents a date without any time components in a specific calendar system. */\nexport class CalendarDate {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.\n // If that behavior is desired, use the AnyCalendarDate interface instead.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n\n constructor(year: number, month: number, day: number);\n constructor(era: string, year: number, month: number, day: number);\n constructor(calendar: Calendar, year: number, month: number, day: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): CalendarDate {\n if (this.era) {\n return new CalendarDate(this.calendar, this.era, this.year, this.month, this.day);\n } else {\n return new CalendarDate(this.calendar, this.year, this.month, this.day);\n }\n }\n\n /** Returns a new `CalendarDate` with the given duration added to it. */\n add(duration: DateDuration): CalendarDate {\n return add(this, duration);\n }\n\n /** Returns a new `CalendarDate` with the given duration subtracted from it. */\n subtract(duration: DateDuration): CalendarDate {\n return subtract(this, duration);\n }\n\n /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields): CalendarDate {\n return set(this, fields);\n }\n\n /**\n * Returns a new `CalendarDate` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField, amount: number, options?: CycleOptions): CalendarDate {\n return cycleDate(this, field, amount, options);\n }\n\n /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */\n toDate(timeZone: string): Date {\n return toDate(this, timeZone);\n }\n\n /** Converts the date to an ISO 8601 formatted string. */\n toString(): string {\n return dateToString(this);\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: AnyCalendarDate): number {\n return compareDate(this, b);\n }\n}\n\n/** A Time represents a clock time without any date components. */\nexport class Time {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The hour, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n\n constructor(\n hour: number = 0,\n minute: number = 0,\n second: number = 0,\n millisecond: number = 0\n ) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond;\n constrainTime(this);\n }\n\n /** Returns a copy of this time. */\n copy(): Time {\n return new Time(this.hour, this.minute, this.second, this.millisecond);\n }\n\n /** Returns a new `Time` with the given duration added to it. */\n add(duration: TimeDuration) {\n return addTime(this, duration);\n }\n\n /** Returns a new `Time` with the given duration subtracted from it. */\n subtract(duration: TimeDuration) {\n return subtractTime(this, duration);\n }\n\n /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: TimeFields) {\n return setTime(this, fields);\n }\n\n /**\n * Returns a new `Time` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: TimeField, amount: number, options?: CycleTimeOptions) {\n return cycleTime(this, field, amount, options);\n }\n\n /** Converts the time to an ISO 8601 formatted string. */\n toString() {\n return timeToString(this);\n }\n\n /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */\n compare(b: AnyTime) {\n return compareTime(this, b);\n }\n}\n\n/** A CalendarDateTime represents a date and time without a time zone, in a specific calendar system. */\nexport class CalendarDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n /** The hour in the day, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n\n constructor(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(era: string, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): CalendarDateTime {\n if (this.era) {\n return new CalendarDateTime(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n } else {\n return new CalendarDateTime(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n }\n }\n\n /** Returns a new `CalendarDateTime` with the given duration added to it. */\n add(duration: DateTimeDuration): CalendarDateTime {\n return add(this, duration);\n }\n\n /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */\n subtract(duration: DateTimeDuration): CalendarDateTime {\n return subtract(this, duration);\n }\n\n /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields & TimeFields): CalendarDateTime {\n return set(setTime(this, fields), fields);\n }\n\n /**\n * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField | TimeField, amount: number, options?: CycleTimeOptions): CalendarDateTime {\n switch (field) {\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return cycleDate(this, field, amount, options);\n default:\n return cycleTime(this, field, amount, options);\n }\n }\n\n /** Converts the date to a native JavaScript Date object in the given time zone. */\n toDate(timeZone: string, disambiguation?: Disambiguation): Date {\n return toDate(this, timeZone, disambiguation);\n }\n\n /** Converts the date to an ISO 8601 formatted string. */\n toString(): string {\n return dateTimeToString(this);\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: CalendarDate | CalendarDateTime | ZonedDateTime): number {\n let res = compareDate(this, b);\n if (res === 0) {\n return compareTime(this, toCalendarDateTime(b));\n }\n\n return res;\n }\n}\n\n/** A ZonedDateTime represents a date and time in a specific time zone and calendar system. */\nexport class ZonedDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n /** The hour in the day, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n /** The IANA time zone identifier that this date and time is represented in. */\n public readonly timeZone: string;\n /** The UTC offset for this time, in milliseconds. */\n public readonly offset: number;\n\n constructor(year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(era: string, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n let timeZone = args.shift();\n let offset = args.shift();\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.timeZone = timeZone;\n this.offset = offset;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): ZonedDateTime {\n if (this.era) {\n return new ZonedDateTime(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n } else {\n return new ZonedDateTime(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n }\n }\n\n /** Returns a new `ZonedDateTime` with the given duration added to it. */\n add(duration: DateTimeDuration) {\n return addZoned(this, duration);\n }\n\n /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */\n subtract(duration: DateTimeDuration) {\n return subtractZoned(this, duration);\n }\n\n /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields & TimeFields, disambiguation?: Disambiguation) {\n return setZoned(this, fields, disambiguation);\n }\n\n /**\n * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField | TimeField, amount: number, options?: CycleTimeOptions) {\n return cycleZoned(this, field, amount, options);\n }\n\n /** Converts the date to a native JavaScript Date object. */\n toDate() {\n return zonedToDate(this);\n }\n\n /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */\n toString() {\n return zonedDateTimeToString(this);\n }\n\n /** Converts the date to an ISO 8601 formatted string in UTC. */\n toAbsoluteString() {\n return this.toDate().toISOString();\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: CalendarDate | CalendarDateTime | ZonedDateTime) {\n // TODO: Is this a bad idea??\n return this.toDate().getTime() - toZoned(b, this.timeZone).toDate().getTime();\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AnyCalendarDate, AnyDateTime, AnyTime, CycleOptions, CycleTimeOptions, DateDuration, DateField, DateFields, DateTimeDuration, Disambiguation, TimeDuration, TimeField, TimeFields} from './types';\nimport {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from './CalendarDate';\nimport {epochFromDate, fromAbsolute, toAbsolute, toCalendar, toCalendarDateTime} from './conversion';\nimport {GregorianCalendar} from './calendars/GregorianCalendar';\nimport {Mutable} from './utils';\n\nconst ONE_HOUR = 3600000;\n\nexport function add(date: CalendarDateTime, duration: DateTimeDuration): CalendarDateTime;\nexport function add(date: CalendarDate, duration: DateDuration): CalendarDate;\nexport function add(date: CalendarDate | CalendarDateTime, duration: DateTimeDuration): CalendarDate | CalendarDateTime;\nexport function add(date: CalendarDate | CalendarDateTime, duration: DateTimeDuration) {\n let mutableDate: Mutable<AnyCalendarDate | AnyDateTime> = date.copy();\n let days = 'hour' in mutableDate ? addTimeFields(mutableDate, duration) : 0;\n\n addYears(mutableDate, duration.years || 0);\n if (mutableDate.calendar.balanceYearMonth) {\n mutableDate.calendar.balanceYearMonth(mutableDate, date);\n }\n\n mutableDate.month += duration.months || 0;\n\n balanceYearMonth(mutableDate);\n constrainMonthDay(mutableDate);\n\n mutableDate.day += (duration.weeks || 0) * 7;\n mutableDate.day += duration.days || 0;\n mutableDate.day += days;\n\n balanceDay(mutableDate);\n\n if (mutableDate.calendar.balanceDate) {\n mutableDate.calendar.balanceDate(mutableDate);\n }\n\n // Constrain in case adding ended up with a date outside the valid range for the calendar system.\n // The behavior here is slightly different than when constraining in the `set` function in that\n // we adjust smaller fields to their minimum/maximum values rather than constraining each field\n // individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.\n if (mutableDate.year < 1) {\n mutableDate.year = 1;\n mutableDate.month = 1;\n mutableDate.day = 1;\n }\n\n let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);\n if (mutableDate.year > maxYear) {\n let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);\n mutableDate.year = maxYear;\n mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);\n mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);\n }\n\n if (mutableDate.month < 1) {\n mutableDate.month = 1;\n mutableDate.day = 1;\n }\n\n let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);\n if (mutableDate.month > maxMonth) {\n mutableDate.month = maxMonth;\n mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);\n }\n\n mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));\n return mutableDate;\n}\n\nfunction addYears(date: Mutable<AnyCalendarDate>, years: number) {\n if (date.calendar.isInverseEra?.(date)) {\n years = -years;\n }\n\n date.year += years;\n}\n\nfunction balanceYearMonth(date: Mutable<AnyCalendarDate>) {\n while (date.month < 1) {\n addYears(date, -1);\n date.month += date.calendar.getMonthsInYear(date);\n }\n\n let monthsInYear = 0;\n while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {\n date.month -= monthsInYear;\n addYears(date, 1);\n }\n}\n\nfunction balanceDay(date: Mutable<AnyCalendarDate>) {\n while (date.day < 1) {\n date.month--;\n balanceYearMonth(date);\n date.day += date.calendar.getDaysInMonth(date);\n }\n\n while (date.day > date.calendar.getDaysInMonth(date)) {\n date.day -= date.calendar.getDaysInMonth(date);\n date.month++;\n balanceYearMonth(date);\n }\n}\n\nfunction constrainMonthDay(date: Mutable<AnyCalendarDate>) {\n date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));\n date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));\n}\n\nexport function constrain(date: Mutable<AnyCalendarDate>) {\n if (date.calendar.constrainDate) {\n date.calendar.constrainDate(date);\n }\n\n date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));\n constrainMonthDay(date);\n}\n\nexport function invertDuration(duration: DateTimeDuration): DateTimeDuration {\n let inverseDuration = {};\n for (let key in duration) {\n if (typeof duration[key] === 'number') {\n inverseDuration[key] = -duration[key];\n }\n }\n\n return inverseDuration;\n}\n\nexport function subtract(date: CalendarDateTime, duration: DateTimeDuration): CalendarDateTime;\nexport function subtract(date: CalendarDate, duration: DateDuration): CalendarDate;\nexport function subtract(date: CalendarDate | CalendarDateTime, duration: DateTimeDuration): CalendarDate | CalendarDateTime {\n return add(date, invertDuration(duration));\n}\n\nexport function set(date: CalendarDateTime, fields: DateFields): CalendarDateTime;\nexport function set(date: CalendarDate, fields: DateFields): CalendarDate;\nexport function set(date: CalendarDate | CalendarDateTime, fields: DateFields) {\n let mutableDate: Mutable<AnyCalendarDate> = date.copy();\n\n if (fields.era != null) {\n mutableDate.era = fields.era;\n }\n\n if (fields.year != null) {\n mutableDate.year = fields.year;\n }\n\n if (fields.month != null) {\n mutableDate.month = fields.month;\n }\n\n if (fields.day != null) {\n mutableDate.day = fields.day;\n }\n\n constrain(mutableDate);\n return mutableDate;\n}\n\nexport function setTime(value: CalendarDateTime, fields: TimeFields): CalendarDateTime;\nexport function setTime(value: Time, fields: TimeFields): Time;\nexport function setTime(value: Time | CalendarDateTime, fields: TimeFields) {\n let mutableValue: Mutable<Time | CalendarDateTime> = value.copy();\n\n if (fields.hour != null) {\n mutableValue.hour = fields.hour;\n }\n\n if (fields.minute != null) {\n mutableValue.minute = fields.minute;\n }\n\n if (fields.second != null) {\n mutableValue.second = fields.second;\n }\n\n if (fields.millisecond != null) {\n mutableValue.millisecond = fields.millisecond;\n }\n\n constrainTime(mutableValue);\n return mutableValue;\n}\n\nfunction balanceTime(time: Mutable<AnyTime>): number {\n time.second += Math.floor(time.millisecond / 1000);\n time.millisecond = nonNegativeMod(time.millisecond, 1000);\n\n time.minute += Math.floor(time.second / 60);\n time.second = nonNegativeMod(time.second, 60);\n\n time.hour += Math.floor(time.minute / 60);\n time.minute = nonNegativeMod(time.minute, 60);\n\n let days = Math.floor(time.hour / 24);\n time.hour = nonNegativeMod(time.hour, 24);\n\n return days;\n}\n\nexport function constrainTime(time: Mutable<AnyTime>) {\n time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));\n time.second = Math.max(0, Math.min(time.second, 59));\n time.minute = Math.max(0, Math.min(time.minute, 59));\n time.hour = Math.max(0, Math.min(time.hour, 23));\n}\n\nfunction nonNegativeMod(a: number, b: number) {\n let result = a % b;\n if (result < 0) {\n result += b;\n }\n return result;\n}\n\nfunction addTimeFields(time: Mutable<AnyTime>, duration: TimeDuration): number {\n time.hour += duration.hours || 0;\n time.minute += duration.minutes || 0;\n time.second += duration.seconds || 0;\n time.millisecond += duration.milliseconds || 0;\n return balanceTime(time);\n}\n\nexport function addTime(time: Time, duration: TimeDuration): Time {\n let res = time.copy();\n addTimeFields(res, duration);\n return res;\n}\n\nexport function subtractTime(time: Time, duration: TimeDuration): Time {\n return addTime(time, invertDuration(duration));\n}\n\nexport function cycleDate(value: CalendarDateTime, field: DateField, amount: number, options?: CycleOptions): CalendarDateTime;\nexport function cycleDate(value: CalendarDate, field: DateField, amount: number, options?: CycleOptions): CalendarDate;\nexport function cycleDate(value: CalendarDate | CalendarDateTime, field: DateField, amount: number, options?: CycleOptions) {\n let mutable: Mutable<CalendarDate | CalendarDateTime> = value.copy();\n\n switch (field) {\n case 'era': {\n let eras = value.calendar.getEras();\n let eraIndex = eras.indexOf(value.era);\n if (eraIndex < 0) {\n throw new Error('Invalid era: ' + value.era);\n }\n eraIndex = cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);\n mutable.era = eras[eraIndex];\n\n // Constrain the year and other fields within the era, so the era doesn't change when we balance below.\n constrain(mutable);\n break;\n }\n case 'year': {\n if (mutable.calendar.isInverseEra?.(mutable)) {\n amount = -amount;\n }\n\n // The year field should not cycle within the era as that can cause weird behavior affecting other fields.\n // We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back\n // we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.\n mutable.year = cycleValue(value.year, amount, -Infinity, 9999, options?.round);\n if (mutable.year === -Infinity) {\n mutable.year = 1;\n }\n\n if (mutable.calendar.balanceYearMonth) {\n mutable.calendar.balanceYearMonth(mutable, value);\n }\n break;\n }\n case 'month':\n mutable.month = cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);\n break;\n case 'day':\n mutable.day = cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);\n break;\n default:\n throw new Error('Unsupported field ' + field);\n }\n\n if (value.calendar.balanceDate) {\n value.calendar.balanceDate(mutable);\n }\n\n constrain(mutable);\n return mutable;\n}\n\nexport function cycleTime(value: CalendarDateTime, field: TimeField, amount: number, options?: CycleTimeOptions): CalendarDateTime;\nexport function cycleTime(value: Time, field: TimeField, amount: number, options?: CycleTimeOptions): Time;\nexport function cycleTime(value: Time | CalendarDateTime, field: TimeField, amount: number, options?: CycleTimeOptions) {\n let mutable: Mutable<Time | CalendarDateTime> = value.copy();\n\n switch (field) {\n case 'hour': {\n let hours = value.hour;\n let min = 0;\n let max = 23;\n if (options?.hourCycle === 12) {\n let isPM = hours >= 12;\n min = isPM ? 12 : 0;\n max = isPM ? 23 : 11;\n }\n mutable.hour = cycleValue(hours, amount, min, max, options?.round);\n break;\n }\n case 'minute':\n mutable.minute = cycleValue(value.minute, amount, 0, 59, options?.round);\n break;\n case 'second':\n mutable.second = cycleValue(value.second, amount, 0, 59, options?.round);\n break;\n case 'millisecond':\n mutable.millisecond = cycleValue(value.millisecond, amount, 0, 999, options?.round);\n break;\n default:\n throw new Error('Unsupported field ' + field);\n }\n\n return mutable;\n}\n\nfunction cycleValue(value: number, amount: number, min: number, max: number, round = false) {\n if (round) {\n value += Math.sign(amount);\n\n if (value < min) {\n value = max;\n }\n\n let div = Math.abs(amount);\n if (amount > 0) {\n value = Math.ceil(value / div) * div;\n } else {\n value = Math.floor(value / div) * div;\n }\n\n if (value > max) {\n value = min;\n }\n } else {\n value += amount;\n if (value < min) {\n value = max - (min - value - 1);\n } else if (value > max) {\n value = min + (value - max - 1);\n }\n }\n\n return value;\n}\n\nexport function addZoned(dateTime: ZonedDateTime, duration: DateTimeDuration): ZonedDateTime {\n let ms: number;\n if ((duration.years != null && duration.years !== 0) || (duration.months != null && duration.months !== 0) || (duration.weeks != null && duration.weeks !== 0) || (duration.days != null && duration.days !== 0)) {\n let res = add(toCalendarDateTime(dateTime), {\n years: duration.years,\n months: duration.months,\n weeks: duration.weeks,\n days: duration.days\n });\n\n // Changing the date may change the timezone offset, so we need to recompute\n // using the 'compatible' disambiguation.\n ms = toAbsolute(res, dateTime.timeZone);\n } else {\n // Otherwise, preserve the offset of the original date.\n ms = epochFromDate(dateTime) - dateTime.offset;\n }\n\n // Perform time manipulation in milliseconds rather than on the original time fields to account for DST.\n // For example, adding one hour during a DST transition may result in the hour field staying the same or\n // skipping an hour. This results in the offset field changing value instead of the specified field.\n ms += duration.milliseconds || 0;\n ms += (duration.seconds || 0) * 1000;\n ms += (duration.minutes || 0) * 60 * 1000;\n ms += (duration.hours || 0) * 60 * 60 * 1000;\n\n let res = fromAbsolute(ms, dateTime.timeZone);\n return toCalendar(res, dateTime.calendar);\n}\n\nexport function subtractZoned(dateTime: ZonedDateTime, duration: DateTimeDuration): ZonedDateTime {\n return addZoned(dateTime, invertDuration(duration));\n}\n\nexport function cycleZoned(dateTime: ZonedDateTime, field: DateField | TimeField, amount: number, options?: CycleTimeOptions): ZonedDateTime {\n // For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.\n // For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC\n // offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.\n switch (field) {\n case 'hour': {\n let min = 0;\n let max = 23;\n if (options?.hourCycle === 12) {\n let isPM = dateTime.hour >= 12;\n min = isPM ? 12 : 0;\n max = isPM ? 23 : 11;\n }\n\n // The minimum and maximum hour may be affected by daylight saving time.\n // For example, it might jump forward at midnight, and skip 1am.\n // Or it might end at midnight and repeat the 11pm hour. To handle this, we get\n // the possible absolute times for the min and max, and find the maximum range\n // that is within the current day.\n let plainDateTime = toCalendarDateTime(dateTime);\n let minDate = toCalendar(setTime(plainDateTime, {hour: min}), new GregorianCalendar());\n let minAbsolute = [toAbsolute(minDate, dateTime.timeZone, 'earlier'), toAbsolute(minDate, dateTime.timeZone, 'later')]\n .filter(ms => fromAbsolute(ms, dateTime.timeZone).day === minDate.day)[0];\n\n let maxDate = toCalendar(setTime(plainDateTime, {hour: max}), new GregorianCalendar());\n let maxAbsolute = [toAbsolute(maxDate, dateTime.timeZone, 'earlier'), toAbsolute(maxDate, dateTime.timeZone, 'later')]\n .filter(ms => fromAbsolute(ms, dateTime.timeZone).day === maxDate.day).pop()!;\n\n // Since hours may repeat, we need to operate on the absolute time in milliseconds.\n // This is done in hours from the Unix epoch so that cycleValue works correctly,\n // and then converted back to milliseconds.\n let ms = epochFromDate(dateTime) - dateTime.offset;\n let hours = Math.floor(ms / ONE_HOUR);\n let remainder = ms % ONE_HOUR;\n ms = cycleValue(\n hours,\n amount,\n Math.floor(minAbsolute / ONE_HOUR),\n Math.floor(maxAbsolute / ONE_HOUR),\n options?.round\n ) * ONE_HOUR + remainder;\n\n // Now compute the new timezone offset, and convert the absolute time back to local time.\n return toCalendar(fromAbsolute(ms, dateTime.timeZone), dateTime.calendar);\n }\n case 'minute':\n case 'second':\n case 'millisecond':\n // @ts-ignore\n return cycleTime(dateTime, field, amount, options);\n case 'era':\n case 'year':\n case 'month':\n case 'day': {\n let res = cycleDate(toCalendarDateTime(dateTime), field, amount, options);\n let ms = toAbsolute(res, dateTime.timeZone);\n return toCalendar(fromAbsolute(ms, dateTime.timeZone), dateTime.calendar);\n }\n default:\n throw new Error('Unsupported field ' + field);\n }\n}\n\nexport function setZoned(dateTime: ZonedDateTime, fields: DateFields & TimeFields, disambiguation?: Disambiguation): ZonedDateTime {\n // Set the date/time fields, and recompute the UTC offset to account for DST changes.\n // We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.\n let plainDateTime = toCalendarDateTime(dateTime);\n let res = setTime(set(plainDateTime, fields), fields);\n\n // If the resulting plain date time values are equal, return the original time.\n // We don't want to change the offset when setting the time to the same value.\n if (res.compare(plainDateTime) === 0) {\n return dateTime;\n }\n\n let ms = toAbsolute(res, dateTime.timeZone, disambiguation);\n return toCalendar(fromAbsolute(ms, dateTime.timeZone), dateTime.calendar);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, AnyDateTime, AnyTime, Calendar, DateFields, Disambiguation, TimeFields} from './types';\nimport {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from './CalendarDate';\nimport {constrain} from './manipulation';\nimport {getExtendedYear, GregorianCalendar} from './calendars/GregorianCalendar';\nimport {getLocalTimeZone} from './queries';\nimport {Mutable} from './utils';\n\nexport function epochFromDate(date: AnyDateTime) {\n date = toCalendar(date, new GregorianCalendar());\n let year = getExtendedYear(date.era, date.year);\n return epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n}\n\nfunction epochFromParts(year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number) {\n // Note: Date.UTC() interprets one and two-digit years as being in the\n // 20th century, so don't use it\n let date = new Date();\n date.setUTCHours(hour, minute, second, millisecond);\n date.setUTCFullYear(year, month - 1, day);\n return date.getTime();\n}\n\nexport function getTimeZoneOffset(ms: number, timeZone: string) {\n // Fast path for UTC.\n if (timeZone === 'UTC') {\n return 0;\n }\n\n // Fast path: for local timezone after 1970, use native Date.\n if (ms > 0 && timeZone === getLocalTimeZone()) {\n return new Date(ms).getTimezoneOffset() * -60 * 1000;\n }\n\n let {year, month, day, hour, minute, second} = getTimeZoneParts(ms, timeZone);\n let utc = epochFromParts(year, month, day, hour, minute, second, 0);\n return utc - Math.floor(ms / 1000) * 1000;\n}\n\nconst formattersByTimeZone = new Map<string, Intl.DateTimeFormat>();\n\nfunction getTimeZoneParts(ms: number, timeZone: string) {\n let formatter = formattersByTimeZone.get(timeZone);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-US', {\n timeZone,\n hour12: false,\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n });\n\n formattersByTimeZone.set(timeZone, formatter);\n }\n\n let parts = formatter.formatToParts(new Date(ms));\n let namedParts: {[name: string]: string} = {};\n for (let part of parts) {\n if (part.type !== 'literal') {\n namedParts[part.type] = part.value;\n }\n }\n\n\n return {\n // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253\n year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,\n month: +namedParts.month,\n day: +namedParts.day,\n hour: namedParts.hour === '24' ? 0 : +namedParts.hour, // bugs.chromium.org/p/chromium/issues/detail?id=1045791\n minute: +namedParts.minute,\n second: +namedParts.second\n };\n}\n\nconst DAYMILLIS = 86400000;\n\nexport function possibleAbsolutes(date: CalendarDateTime, timeZone: string): number[] {\n let ms = epochFromDate(date);\n let earlier = ms - getTimeZoneOffset(ms - DAYMILLIS, timeZone);\n let later = ms - getTimeZoneOffset(ms + DAYMILLIS, timeZone);\n return getValidWallTimes(date, timeZone, earlier, later);\n}\n\nfunction getValidWallTimes(date: CalendarDateTime, timeZone: string, earlier: number, later: number): number[] {\n let found = earlier === later ? [earlier] : [earlier, later];\n return found.filter(absolute => isValidWallTime(date, timeZone, absolute));\n}\n\nfunction isValidWallTime(date: CalendarDateTime, timeZone: string, absolute: number) {\n let parts = getTimeZoneParts(absolute, timeZone);\n return date.year === parts.year\n && date.month === parts.month\n && date.day === parts.day\n && date.hour === parts.hour\n && date.minute === parts.minute\n && date.second === parts.second;\n}\n\nexport function toAbsolute(date: CalendarDate | CalendarDateTime, timeZone: string, disambiguation: Disambiguation = 'compatible'): number {\n let dateTime = toCalendarDateTime(date);\n\n // Fast path: if the time zone is UTC, use native Date.\n if (timeZone === 'UTC') {\n return epochFromDate(dateTime);\n }\n\n // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.\n if (timeZone === getLocalTimeZone() && disambiguation === 'compatible') {\n dateTime = toCalendar(dateTime, new GregorianCalendar());\n\n // Don't use Date constructor here because two-digit years are interpreted in the 20th century.\n let date = new Date();\n let year = getExtendedYear(dateTime.era, dateTime.year);\n date.setFullYear(year, dateTime.month - 1, dateTime.day);\n date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n return date.getTime();\n }\n\n let ms = epochFromDate(dateTime);\n let offsetBefore = getTimeZoneOffset(ms - DAYMILLIS, timeZone);\n let offsetAfter = getTimeZoneOffset(ms + DAYMILLIS, timeZone);\n let valid = getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);\n\n if (valid.length === 1) {\n return valid[0];\n }\n\n if (valid.length > 1) {\n switch (disambiguation) {\n // 'compatible' means 'earlier' for \"fall back\" transitions\n case 'compatible':\n case 'earlier':\n return valid[0];\n case 'later':\n return valid[valid.length - 1];\n case 'reject':\n throw new RangeError('Multiple possible absolute times found');\n }\n }\n\n switch (disambiguation) {\n case 'earlier':\n return Math.min(ms - offsetBefore, ms - offsetAfter);\n // 'compatible' means 'later' for \"spring forward\" transitions\n case 'compatible':\n case 'later':\n return Math.max(ms - offsetBefore, ms - offsetAfter);\n case 'reject':\n throw new RangeError('No such absolute time found');\n }\n}\n\nexport function toDate(dateTime: CalendarDate | CalendarDateTime, timeZone: string, disambiguation: Disambiguation = 'compatible'): Date {\n return new Date(toAbsolute(dateTime, timeZone, disambiguation));\n}\n\n/**\n * Takes a Unix epoch (milliseconds since 1970) and converts it to the provided time zone.\n */\nexport function fromAbsolute(ms: number, timeZone: string): ZonedDateTime {\n let offset = getTimeZoneOffset(ms, timeZone);\n let date = new Date(ms + offset);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth() + 1;\n let day = date.getUTCDate();\n let hour = date.getUTCHours();\n let minute = date.getUTCMinutes();\n let second = date.getUTCSeconds();\n let millisecond = date.getUTCMilliseconds();\n\n return new ZonedDateTime(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);\n}\n\n/**\n * Takes a `Date` object and converts it to the provided time zone.\n */\nexport function fromDate(date: Date, timeZone: string): ZonedDateTime {\n return fromAbsolute(date.getTime(), timeZone);\n}\n\nexport function fromDateToLocal(date: Date): ZonedDateTime {\n return fromDate(date, getLocalTimeZone());\n}\n\n/** Converts a value with date components such as a `CalendarDateTime` or `ZonedDateTime` into a `CalendarDate`. */\nexport function toCalendarDate(dateTime: AnyCalendarDate): CalendarDate {\n return new CalendarDate(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);\n}\n\nexport function toDateFields(date: AnyCalendarDate): DateFields {\n return {\n era: date.era,\n year: date.year,\n month: date.month,\n day: date.day\n };\n}\n\nexport function toTimeFields(date: AnyTime): TimeFields {\n return {\n hour: date.hour,\n minute: date.minute,\n second: date.second,\n millisecond: date.millisecond\n };\n}\n\n/**\n * Converts a date value to a `CalendarDateTime`. An optional `Time` value can be passed to set the time\n * of the resulting value, otherwise it will default to midnight.\n */\nexport function toCalendarDateTime(date: CalendarDate | CalendarDateTime | ZonedDateTime, time?: AnyTime): CalendarDateTime {\n let hour = 0, minute = 0, second = 0, millisecond = 0;\n if ('timeZone' in date) {\n ({hour, minute, second, millisecond} = date);\n } else if ('hour' in date && !time) {\n return date;\n }\n\n if (time) {\n ({hour, minute, second, millisecond} = time);\n }\n\n return new CalendarDateTime(\n date.calendar,\n date.era,\n date.year,\n date.month,\n date.day,\n hour,\n minute,\n second,\n millisecond\n );\n}\n\n/** Extracts the time components from a value containing a date and time. */\nexport function toTime(dateTime: CalendarDateTime | ZonedDateTime): Time {\n return new Time(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n}\n\n/** Converts a date from one calendar system to another. */\nexport function toCalendar<T extends AnyCalendarDate>(date: T, calendar: Calendar): T {\n if (date.calendar.identifier === calendar.identifier) {\n return date;\n }\n\n let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));\n let copy: Mutable<T> = date.copy();\n copy.calendar = calendar;\n copy.era = calendarDate.era;\n copy.year = calendarDate.year;\n copy.month = calendarDate.month;\n copy.day = calendarDate.day;\n constrain(copy);\n return copy;\n}\n\n/**\n * Converts a date value to a `ZonedDateTime` in the provided time zone. The `disambiguation` option can be set\n * to control how values that fall on daylight saving time changes are interpreted.\n */\nexport function toZoned(date: CalendarDate | CalendarDateTime | ZonedDateTime, timeZone: string, disambiguation?: Disambiguation): ZonedDateTime {\n if (date instanceof ZonedDateTime) {\n if (date.timeZone === timeZone) {\n return date;\n }\n\n return toTimeZone(date, timeZone);\n }\n\n let ms = toAbsolute(date, timeZone, disambiguation);\n return fromAbsolute(ms, timeZone);\n}\n\nexport function zonedToDate(date: ZonedDateTime) {\n let ms = epochFromDate(date) - date.offset;\n return new Date(ms);\n}\n\n/** Converts a `ZonedDateTime` from one time zone to another. */\nexport function toTimeZone(date: ZonedDateTime, timeZone: string): ZonedDateTime {\n let ms = epochFromDate(date) - date.offset;\n return toCalendar(fromAbsolute(ms, timeZone), date.calendar);\n}\n\n/** Converts the given `ZonedDateTime` into the user's local time zone. */\nexport function toLocalTimeZone(date: ZonedDateTime): ZonedDateTime {\n return toTimeZone(date, getLocalTimeZone());\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, Calendar} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {mod, Mutable} from '../utils';\n\nconst EPOCH = 1721426; // 001/01/03 Julian C.E.\nexport function gregorianToJulianDay(era: string, year: number, month: number, day: number): number {\n year = getExtendedYear(era, year);\n\n let y1 = year - 1;\n let monthOffset = -2;\n if (month <= 2) {\n monthOffset = 0;\n } else if (isLeapYear(year)) {\n monthOffset = -1;\n }\n\n return (\n EPOCH -\n 1 +\n 365 * y1 +\n Math.floor(y1 / 4) -\n Math.floor(y1 / 100) +\n Math.floor(y1 / 400) +\n Math.floor((367 * month - 362) / 12 + monthOffset + day)\n );\n}\n\nexport function isLeapYear(year: number): boolean {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function getExtendedYear(era: string, year: number): number {\n return era === 'BC' ? 1 - year : year;\n}\n\nexport function fromExtendedYear(year: number): [string, number] {\n let era = 'AD';\n if (year <= 0) {\n era = 'BC';\n year = 1 - year;\n }\n\n return [era, year];\n}\n\nconst daysInMonth = {\n standard: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n leapyear: [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n};\n\n/**\n * The Gregorian calendar is the most commonly used calendar system in the world. It supports two eras: BC, and AD.\n * Years always contain 12 months, and 365 or 366 days depending on whether it is a leap year.\n */\nexport class GregorianCalendar implements Calendar {\n identifier = 'gregory';\n\n fromJulianDay(jd: number): CalendarDate {\n let jd0 = jd;\n let depoch = jd0 - EPOCH;\n let quadricent = Math.floor(depoch / 146097);\n let dqc = mod(depoch, 146097);\n let cent = Math.floor(dqc / 36524);\n let dcent = mod(dqc, 36524);\n let quad = Math.floor(dcent / 1461);\n let dquad = mod(dcent, 1461);\n let yindex = Math.floor(dquad / 365);\n\n let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);\n let [era, year] = fromExtendedYear(extendedYear);\n let yearDay = jd0 - gregorianToJulianDay(era, year, 1, 1);\n let leapAdj = 2;\n if (jd0 < gregorianToJulianDay(era, year, 3, 1)) {\n leapAdj = 0;\n } else if (isLeapYear(year)) {\n leapAdj = 1;\n }\n let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);\n let day = jd0 - gregorianToJulianDay(era, year, month, 1) + 1;\n\n return new CalendarDate(era, year, month, day);\n }\n\n toJulianDay(date: AnyCalendarDate): number {\n return gregorianToJulianDay(date.era, date.year, date.month, date.day);\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return daysInMonth[isLeapYear(date.year) ? 'leapyear' : 'standard'][date.month - 1];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getMonthsInYear(date: AnyCalendarDate): number {\n return 12;\n }\n\n getDaysInYear(date: AnyCalendarDate): number {\n return isLeapYear(date.year) ? 366 : 365;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getYearsInEra(date: AnyCalendarDate): number {\n return 9999;\n }\n\n getEras() {\n return ['BC', 'AD'];\n }\n\n isInverseEra(date: AnyCalendarDate): boolean {\n return date.era === 'BC';\n }\n\n balanceDate(date: Mutable<AnyCalendarDate>) {\n if (date.year <= 0) {\n date.era = date.era === 'BC' ? 'AD' : 'BC';\n date.year = 1 - date.year;\n }\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, CalendarDateTime} from './CalendarDate';\n\nexport type Mutable<T> = {\n -readonly[P in keyof T]: T[P]\n};\n\nexport function mod(amount: number, numerator: number): number {\n return amount - numerator * Math.floor(amount / numerator);\n}\n\nexport function copy(date: CalendarDate): Mutable<CalendarDate> {\n if (date.era) {\n return new CalendarDate(date.calendar, date.era, date.year, date.month, date.day);\n } else {\n return new CalendarDate(date.calendar, date.year, date.month, date.day);\n }\n}\n\nexport function copyDateTime(date: CalendarDateTime): Mutable<CalendarDateTime> {\n if (date.era) {\n return new CalendarDateTime(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n } else {\n return new CalendarDateTime(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AnyCalendarDate, AnyTime} from './types';\nimport {CalendarDate, CalendarDateTime, ZonedDateTime} from './CalendarDate';\nimport {fromAbsolute, toAbsolute, toCalendar, toCalendarDate} from './conversion';\nimport {weekStartData} from './weekStartData';\n\ntype DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;\n\n/** Returns whether the given dates occur on the same day, regardless of the time or calendar system. */\nexport function isSameDay(a: DateValue, b: DateValue): boolean {\n b = toCalendar(b, a.calendar);\n return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\n\n/** Returns whether the given dates occur in the same month, using the calendar system of the first date. */\nexport function isSameMonth(a: DateValue, b: DateValue): boolean {\n b = toCalendar(b, a.calendar);\n // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.\n a = startOfMonth(a);\n b = startOfMonth(b);\n return a.era === b.era && a.year === b.year && a.month === b.month;\n}\n\n/** Returns whether the given dates occur in the same year, using the calendar system of the first date. */\nexport function isSameYear(a: DateValue, b: DateValue): boolean {\n b = toCalendar(b, a.calendar);\n a = startOfYear(a);\n b = startOfYear(b);\n return a.era === b.era && a.year === b.year;\n}\n\n/** Returns whether the given dates occur on the same day, and are of the same calendar system. */\nexport function isEqualDay(a: DateValue, b: DateValue): boolean {\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\n\n/** Returns whether the given dates occur in the same month, and are of the same calendar system. */\nexport function isEqualMonth(a: DateValue, b: DateValue): boolean {\n a = startOfMonth(a);\n b = startOfMonth(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;\n}\n\n/** Returns whether the given dates occur in the same year, and are of the same calendar system. */\nexport function isEqualYear(a: DateValue, b: DateValue): boolean {\n a = startOfYear(a);\n b = startOfYear(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;\n}\n\n/** Returns whether the date is today in the given time zone. */\nexport function isToday(date: DateValue, timeZone: string): boolean {\n return isSameDay(date, today(timeZone));\n}\n\n/**\n * Returns the day of week for the given date and locale. Days are numbered from zero to six,\n * where zero is the first day of the week in the given locale. For example, in the United States,\n * the first day of the week is Sunday, but in France it is Monday.\n */\nexport function getDayOfWeek(date: DateValue, locale: string): number {\n let julian = date.calendar.toJulianDay(date);\n\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1 - getWeekStart(locale)) % 7;\n if (dayOfWeek < 0) {\n dayOfWeek += 7;\n }\n\n return dayOfWeek;\n}\n\n/** Returns the current time in the given time zone. */\nexport function now(timeZone: string): ZonedDateTime {\n return fromAbsolute(Date.now(), timeZone);\n}\n\n/** Returns today's date in the given time zone. */\nexport function today(timeZone: string): CalendarDate {\n return toCalendarDate(now(timeZone));\n}\n\nexport function compareDate(a: AnyCalendarDate, b: AnyCalendarDate): number {\n return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);\n}\n\nexport function compareTime(a: AnyTime, b: AnyTime): number {\n return timeToMs(a) - timeToMs(b);\n}\n\nfunction timeToMs(a: AnyTime): number {\n return a.hour * 60 * 60 * 1000 + a.minute * 60 * 1000 + a.second * 1000 + a.millisecond;\n}\n\n/**\n * Returns the number of hours in the given date and time zone.\n * Usually this is 24, but it could be 23 or 25 if the date is on a daylight saving transition.\n */\nexport function getHoursInDay(a: CalendarDate, timeZone: string): number {\n let ms = toAbsolute(a, timeZone);\n let tomorrow = a.add({days: 1});\n let tomorrowMs = toAbsolute(tomorrow, timeZone);\n return (tomorrowMs - ms) / 3600000;\n}\n\nlet localTimeZone: string | null = null;\n\n/** Returns the time zone identifier for the current user. */\nexport function getLocalTimeZone(): string {\n // TODO: invalidate this somehow?\n if (localTimeZone == null) {\n localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n return localTimeZone!;\n}\n\n/** Returns the first date of the month for the given date. */\nexport function startOfMonth(date: ZonedDateTime): ZonedDateTime;\nexport function startOfMonth(date: CalendarDateTime): CalendarDateTime;\nexport function startOfMonth(date: CalendarDate): CalendarDate;\nexport function startOfMonth(date: DateValue): DateValue;\nexport function startOfMonth(date: DateValue): DateValue {\n // Use `subtract` instead of `set` so we don't get constrained in an era.\n return date.subtract({days: date.day - 1});\n}\n\n/** Returns the last date of the month for the given date. */\nexport function endOfMonth(date: ZonedDateTime): ZonedDateTime;\nexport function endOfMonth(date: CalendarDateTime): CalendarDateTime;\nexport function endOfMonth(date: CalendarDate): CalendarDate;\nexport function endOfMonth(date: DateValue): DateValue;\nexport function endOfMonth(date: DateValue): DateValue {\n return date.add({days: date.calendar.getDaysInMonth(date) - date.day});\n}\n\n/** Returns the first day of the year for the given date. */\nexport function startOfYear(date: ZonedDateTime): ZonedDateTime;\nexport function startOfYear(date: CalendarDateTime): CalendarDateTime;\nexport function startOfYear(date: CalendarDate): CalendarDate;\nexport function startOfYear(date: DateValue): DateValue;\nexport function startOfYear(date: DateValue): DateValue {\n return startOfMonth(date.subtract({months: date.month - 1}));\n}\n\n/** Returns the last day of the year for the given date. */\nexport function endOfYear(date: ZonedDateTime): ZonedDateTime;\nexport function endOfYear(date: CalendarDateTime): CalendarDateTime;\nexport function endOfYear(date: CalendarDate): CalendarDate;\nexport function endOfYear(date: DateValue): DateValue;\nexport function endOfYear(date: DateValue): DateValue {\n return endOfMonth(date.add({months: date.calendar.getMonthsInYear(date) - date.month}));\n}\n\nexport function getMinimumMonthInYear(date: AnyCalendarDate) {\n if (date.calendar.getMinimumMonthInYear) {\n return date.calendar.getMinimumMonthInYear(date);\n }\n\n return 1;\n}\n\nexport function getMinimumDayInMonth(date: AnyCalendarDate) {\n if (date.calendar.getMinimumDayInMonth) {\n return date.calendar.getMinimumDayInMonth(date);\n }\n\n return 1;\n}\n\n/** Returns the first date of the week for the given date and locale. */\nexport function startOfWeek(date: ZonedDateTime, locale: string): ZonedDateTime;\nexport function startOfWeek(date: CalendarDateTime, locale: string): CalendarDateTime;\nexport function startOfWeek(date: CalendarDate, locale: string): CalendarDate;\nexport function startOfWeek(date: DateValue, locale: string): DateValue;\nexport function startOfWeek(date: DateValue, locale: string): DateValue {\n let dayOfWeek = getDayOfWeek(date, locale);\n return date.subtract({days: dayOfWeek});\n}\n\n/** Returns the last date of the week for the given date and locale. */\nexport function endOfWeek(date: ZonedDateTime, locale: string): ZonedDateTime;\nexport function endOfWeek(date: CalendarDateTime, locale: string): CalendarDateTime;\nexport function endOfWeek(date: CalendarDate, locale: string): CalendarDate;\nexport function endOfWeek(date: DateValue, locale: string): DateValue;\nexport function endOfWeek(date: DateValue, locale: string): DateValue {\n return startOfWeek(date, locale).add({days: 6});\n}\n\nconst cachedRegions = new Map<string, string>();\n\nfunction getRegion(locale: string): string | undefined {\n // If the Intl.Locale API is available, use it to get the region for the locale.\n // @ts-ignore\n if (Intl.Locale) {\n // Constructing an Intl.Locale is expensive, so cache the result.\n let region = cachedRegions.get(locale);\n if (!region) {\n // @ts-ignore\n region = new Intl.Locale(locale).maximize().region;\n if (region) {\n cachedRegions.set(locale, region);\n }\n }\n return region;\n }\n\n // If not, just try splitting the string.\n // If the second part of the locale string is 'u',\n // then this is a unicode extension, so ignore it.\n // Otherwise, it should be the region.\n let part = locale.split('-')[1];\n return part === 'u' ? undefined : part;\n}\n\nfunction getWeekStart(locale: string): number {\n // TODO: use Intl.Locale for this once browsers support the weekInfo property\n // https://github.com/tc39/proposal-intl-locale-info\n let region = getRegion(locale);\n return region ? weekStartData[region] || 0 : 0;\n}\n\n/** Returns the number of weeks in the given month and locale. */\nexport function getWeeksInMonth(date: DateValue, locale: string): number {\n let days = date.calendar.getDaysInMonth(date);\n return Math.ceil((getDayOfWeek(startOfMonth(date), locale) + days) / 7);\n}\n\n/** Returns the lesser of the two provider dates. */\nexport function minDate<A extends DateValue, B extends DateValue>(a?: A | null, b?: B | null): A | B | null | undefined {\n if (a && b) {\n return a.compare(b) <= 0 ? a : b;\n }\n\n return a || b;\n}\n\n/** Returns the greater of the two provider dates. */\nexport function maxDate<A extends DateValue, B extends DateValue>(a?: A | null, b?: B | null): A | B | null | undefined {\n if (a && b) {\n return a.compare(b) >= 0 ? a : b;\n }\n\n return a || b;\n}\n\nconst WEEKEND_DATA = {\n AF: [4, 5],\n AE: [5, 6],\n BH: [5, 6],\n DZ: [5, 6],\n EG: [5, 6],\n IL: [5, 6],\n IQ: [5, 6],\n IR: [5, 5],\n JO: [5, 6],\n KW: [5, 6],\n LY: [5, 6],\n OM: [5, 6],\n QA: [5, 6],\n SA: [5, 6],\n SD: [5, 6],\n SY: [5, 6],\n YE: [5, 6]\n};\n\n/** Returns whether the given date is on a weekend in the given locale. */\nexport function isWeekend(date: DateValue, locale: string): boolean {\n let julian = date.calendar.toJulianDay(date);\n\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1) % 7;\n if (dayOfWeek < 0) {\n dayOfWeek += 7;\n }\n\n let region = getRegion(locale);\n // Use Intl.Locale for this once weekInfo is supported.\n // https://github.com/tc39/proposal-intl-locale-info\n let [start, end] = WEEKEND_DATA[region!] || [6, 0];\n return dayOfWeek === start || dayOfWeek === end;\n}\n\n/** Returns whether the given date is on a weekday in the given locale. */\nexport function isWeekday(date: DateValue, locale: string): boolean {\n return !isWeekend(date, locale);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Data from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json\n// Locales starting on Sunday have been removed for compression.\nexport const weekStartData = {\n '001': 1,\n AD: 1,\n AE: 6,\n AF: 6,\n AI: 1,\n AL: 1,\n AM: 1,\n AN: 1,\n AR: 1,\n AT: 1,\n AU: 1,\n AX: 1,\n AZ: 1,\n BA: 1,\n BE: 1,\n BG: 1,\n BH: 6,\n BM: 1,\n BN: 1,\n BY: 1,\n CH: 1,\n CL: 1,\n CM: 1,\n CN: 1,\n CR: 1,\n CY: 1,\n CZ: 1,\n DE: 1,\n DJ: 6,\n DK: 1,\n DZ: 6,\n EC: 1,\n EE: 1,\n EG: 6,\n ES: 1,\n FI: 1,\n FJ: 1,\n FO: 1,\n FR: 1,\n GB: 1,\n GE: 1,\n GF: 1,\n GP: 1,\n GR: 1,\n HR: 1,\n HU: 1,\n IE: 1,\n IQ: 6,\n IR: 6,\n IS: 1,\n IT: 1,\n JO: 6,\n KG: 1,\n KW: 6,\n KZ: 1,\n LB: 1,\n LI: 1,\n LK: 1,\n LT: 1,\n LU: 1,\n LV: 1,\n LY: 6,\n MC: 1,\n MD: 1,\n ME: 1,\n MK: 1,\n MN: 1,\n MQ: 1,\n MV: 5,\n MY: 1,\n NL: 1,\n NO: 1,\n NZ: 1,\n OM: 6,\n PL: 1,\n QA: 6,\n RE: 1,\n RO: 1,\n RS: 1,\n RU: 1,\n SD: 6,\n SE: 1,\n SI: 1,\n SK: 1,\n SM: 1,\n SY: 6,\n TJ: 1,\n TM: 1,\n TR: 1,\n UA: 1,\n UY: 1,\n UZ: 1,\n VA: 1,\n VN: 1,\n XK: 1\n};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AnyDateTime, DateTimeDuration, Disambiguation} from './types';\nimport {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from './CalendarDate';\nimport {epochFromDate, fromAbsolute, possibleAbsolutes, toAbsolute, toCalendar, toCalendarDateTime, toTimeZone} from './conversion';\nimport {getLocalTimeZone} from './queries';\nimport {GregorianCalendar} from './calendars/GregorianCalendar';\nimport {Mutable} from './utils';\n\nconst TIME_RE = /^(\\d{2})(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?$/;\nconst DATE_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})$/;\nconst DATE_TIME_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?$/;\nconst ZONED_DATE_TIME_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?(?:([+-]\\d{2})(?::?(\\d{2}))?)?\\[(.*?)\\]$/;\nconst ABSOLUTE_RE = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?(?:(?:([+-]\\d{2})(?::?(\\d{2}))?)|Z)$/;\nconst DATE_TIME_DURATION_RE =\n /^((?<negative>-)|\\+)?P((?<years>\\d*)Y)?((?<months>\\d*)M)?((?<weeks>\\d*)W)?((?<days>\\d*)D)?((?<time>T)((?<hours>\\d*[.,]?\\d{1,9})H)?((?<minutes>\\d*[.,]?\\d{1,9})M)?((?<seconds>\\d*[.,]?\\d{1,9})S)?)?$/;\nconst requiredDurationTimeGroups = ['hours', 'minutes', 'seconds'];\nconst requiredDurationGroups = ['years', 'months', 'weeks', 'days', ...requiredDurationTimeGroups];\n\n/** Parses an ISO 8601 time string. */\nexport function parseTime(value: string): Time {\n let m = value.match(TIME_RE);\n if (!m) {\n throw new Error('Invalid ISO 8601 time string: ' + value);\n }\n\n return new Time(\n parseNumber(m[1], 0, 23),\n m[2] ? parseNumber(m[2], 0, 59) : 0,\n m[3] ? parseNumber(m[3], 0, 59) : 0,\n m[4] ? parseNumber(m[4], 0, Infinity) * 1000 : 0\n );\n}\n\n/** Parses an ISO 8601 date string, with no time components. */\nexport function parseDate(value: string): CalendarDate {\n let m = value.match(DATE_RE);\n if (!m) {\n throw new Error('Invalid ISO 8601 date string: ' + value);\n }\n\n let date: Mutable<CalendarDate> = new CalendarDate(\n parseNumber(m[1], 0, 9999),\n parseNumber(m[2], 1, 12),\n 1\n );\n\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n return date as CalendarDate;\n}\n\n/** Parses an ISO 8601 date and time string, with no time zone. */\nexport function parseDateTime(value: string): CalendarDateTime {\n let m = value.match(DATE_TIME_RE);\n if (!m) {\n throw new Error('Invalid ISO 8601 date time string: ' + value);\n }\n\n let year = parseNumber(m[1], -9999, 9999);\n let era = year < 1 ? 'BC' : 'AD';\n\n let date: Mutable<CalendarDateTime> = new CalendarDateTime(\n era,\n year < 1 ? -year + 1 : year,\n parseNumber(m[2], 1, 12),\n 1,\n m[4] ? parseNumber(m[4], 0, 23) : 0,\n m[5] ? parseNumber(m[5], 0, 59) : 0,\n m[6] ? parseNumber(m[6], 0, 59) : 0,\n m[7] ? parseNumber(m[7], 0, Infinity) * 1000 : 0\n );\n\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n return date as CalendarDateTime;\n}\n\n/**\n * Parses an ISO 8601 date and time string with a time zone extension and optional UTC offset\n * (e.g. \"2021-11-07T00:45[America/Los_Angeles]\" or \"2021-11-07T00:45-07:00[America/Los_Angeles]\").\n * Ambiguous times due to daylight saving time transitions are resolved according to the `disambiguation`\n * parameter.\n */\nexport function parseZonedDateTime(value: string, disambiguation?: Disambiguation): ZonedDateTime {\n let m = value.match(ZONED_DATE_TIME_RE);\n if (!m) {\n throw new Error('Invalid ISO 8601 date time string: ' + value);\n }\n\n let year = parseNumber(m[1], -9999, 9999);\n let era = year < 1 ? 'BC' : 'AD';\n\n let date: Mutable<ZonedDateTime> = new ZonedDateTime(\n era,\n year < 1 ? -year + 1 : year,\n parseNumber(m[2], 1, 12),\n 1,\n m[10],\n 0,\n m[4] ? parseNumber(m[4], 0, 23) : 0,\n m[5] ? parseNumber(m[5], 0, 59) : 0,\n m[6] ? parseNumber(m[6], 0, 59) : 0,\n m[7] ? parseNumber(m[7], 0, Infinity) * 1000 : 0\n );\n\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n\n let plainDateTime = toCalendarDateTime(date as ZonedDateTime);\n\n let ms: number;\n if (m[8]) {\n date.offset = parseNumber(m[8], -23, 23) * 60 * 60 * 1000 + parseNumber(m[9] ?? '0', 0, 59) * 60 * 1000;\n ms = epochFromDate(date as ZonedDateTime) - date.offset;\n\n // Validate offset against parsed date.\n let absolutes = possibleAbsolutes(plainDateTime, date.timeZone);\n if (!absolutes.includes(ms)) {\n throw new Error(`Offset ${offsetToString(date.offset)} is invalid for ${dateTimeToString(date)} in ${date.timeZone}`);\n }\n } else {\n // Convert to absolute and back to fix invalid times due to DST.\n ms = toAbsolute(toCalendarDateTime(plainDateTime), date.timeZone, disambiguation);\n }\n\n return fromAbsolute(ms, date.timeZone);\n}\n\n/**\n * Parses an ISO 8601 date and time string with a UTC offset (e.g. \"2021-11-07T07:45:00Z\"\n * or \"2021-11-07T07:45:00-07:00\"). The result is converted to the provided time zone.\n */\nexport function parseAbsolute(value: string, timeZone: string): ZonedDateTime {\n let m = value.match(ABSOLUTE_RE);\n if (!m) {\n throw new Error('Invalid ISO 8601 date time string: ' + value);\n }\n\n let year = parseNumber(m[1], -9999, 9999);\n let era = year < 1 ? 'BC' : 'AD';\n\n let date: Mutable<ZonedDateTime> = new ZonedDateTime(\n era,\n year < 1 ? -year + 1 : year,\n parseNumber(m[2], 1, 12),\n 1,\n timeZone,\n 0,\n m[4] ? parseNumber(m[4], 0, 23) : 0,\n m[5] ? parseNumber(m[5], 0, 59) : 0,\n m[6] ? parseNumber(m[6], 0, 59) : 0,\n m[7] ? parseNumber(m[7], 0, Infinity) * 1000 : 0\n );\n\n date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));\n\n if (m[8]) {\n date.offset = parseNumber(m[8], -23, 23) * 60 * 60 * 1000 + parseNumber(m[9] ?? '0', 0, 59) * 60 * 1000;\n }\n\n return toTimeZone(date as ZonedDateTime, timeZone);\n}\n\n/**\n * Parses an ISO 8601 date and time string with a UTC offset (e.g. \"2021-11-07T07:45:00Z\"\n * or \"2021-11-07T07:45:00-07:00\"). The result is converted to the user's local time zone.\n */\nexport function parseAbsoluteToLocal(value: string): ZonedDateTime {\n return parseAbsolute(value, getLocalTimeZone());\n}\n\nfunction parseNumber(value: string, min: number, max: number) {\n let val = Number(value);\n if (val < min || val > max) {\n throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);\n }\n\n return val;\n}\n\nexport function timeToString(time: Time): string {\n return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;\n}\n\nexport function dateToString(date: CalendarDate): string {\n let gregorianDate = toCalendar(date, new GregorianCalendar());\n let year: string;\n if (gregorianDate.era === 'BC') {\n year = gregorianDate.year === 1 \n ? '0000'\n : '-' + String(Math.abs(1 - gregorianDate.year)).padStart(6, '00');\n } else {\n year = String(gregorianDate.year).padStart(4, '0');\n }\n return `${year}-${String(gregorianDate.month).padStart(2, '0')}-${String(gregorianDate.day).padStart(2, '0')}`;\n}\n\nexport function dateTimeToString(date: AnyDateTime): string {\n // @ts-ignore\n return `${dateToString(date)}T${timeToString(date)}`;\n}\n\nfunction offsetToString(offset: number) {\n let sign = Math.sign(offset) < 0 ? '-' : '+';\n offset = Math.abs(offset);\n let offsetHours = Math.floor(offset / (60 * 60 * 1000));\n let offsetMinutes = (offset % (60 * 60 * 1000)) / (60 * 1000);\n return `${sign}${String(offsetHours).padStart(2, '0')}:${String(offsetMinutes).padStart(2, '0')}`;\n}\n\nexport function zonedDateTimeToString(date: ZonedDateTime): string {\n return `${dateTimeToString(date)}${offsetToString(date.offset)}[${date.timeZone}]`;\n}\n\n/**\n * Parses an ISO 8601 duration string (e.g. \"P3Y6M6W4DT12H30M5S\").\n * @param value An ISO 8601 duration string.\n * @returns A DateTimeDuration object.\n */\nexport function parseDuration(value: string): Required<DateTimeDuration> {\n const match = value.match(DATE_TIME_DURATION_RE);\n\n if (!match) {\n throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n }\n\n const parseDurationGroup = (\n group: string | undefined,\n isNegative: boolean,\n min: number,\n max: number\n ): number => {\n if (!group) {\n return 0;\n }\n try {\n const sign = isNegative ? -1 : 1;\n return sign * parseNumber(group.replace(',', '.'), min, max);\n } catch {\n throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n }\n };\n\n const isNegative = !!match.groups?.negative;\n\n const hasRequiredGroups = requiredDurationGroups.some(group => match.groups?.[group]);\n\n if (!hasRequiredGroups) {\n throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n }\n\n const durationStringIncludesTime = match.groups?.time;\n\n if (durationStringIncludesTime) {\n const hasRequiredDurationTimeGroups = requiredDurationTimeGroups.some(group => match.groups?.[group]);\n if (!hasRequiredDurationTimeGroups) {\n throw new Error(`Invalid ISO 8601 Duration string: ${value}`);\n }\n }\n\n const duration: Mutable<DateTimeDuration> = {\n years: parseDurationGroup(match.groups?.years, isNegative, 0, 9999),\n months: parseDurationGroup(match.groups?.months, isNegative, 0, 12),\n weeks: parseDurationGroup(match.groups?.weeks, isNegative, 0, Infinity),\n days: parseDurationGroup(match.groups?.days, isNegative, 0, 31),\n hours: parseDurationGroup(match.groups?.hours, isNegative, 0, 23),\n minutes: parseDurationGroup(match.groups?.minutes, isNegative, 0, 59),\n seconds: parseDurationGroup(match.groups?.seconds, isNegative, 0, 59)\n };\n\n if (duration.hours !== undefined && ((duration.hours % 1) !== 0) && (duration.minutes || duration.seconds)) {\n throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);\n }\n\n if (duration.minutes !== undefined && ((duration.minutes % 1) !== 0) && duration.seconds) {\n throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);\n }\n\n return duration as Required<DateTimeDuration>;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {GregorianCalendar} from './GregorianCalendar';\nimport {Mutable} from '../utils';\n\nconst ERA_START_DATES = [[1868, 9, 8], [1912, 7, 30], [1926, 12, 25], [1989, 1, 8], [2019, 5, 1]];\nconst ERA_END_DATES = [[1912, 7, 29], [1926, 12, 24], [1989, 1, 7], [2019, 4, 30]];\nconst ERA_ADDENDS = [1867, 1911, 1925, 1988, 2018];\nconst ERA_NAMES = ['meiji', 'taisho', 'showa', 'heisei', 'reiwa'];\n\nfunction findEraFromGregorianDate(date: AnyCalendarDate) {\n const idx = ERA_START_DATES.findIndex(([year, month, day]) => {\n if (date.year < year) {\n return true;\n }\n\n if (date.year === year && date.month < month) {\n return true;\n }\n\n if (date.year === year && date.month === month && date.day < day) {\n return true;\n }\n\n return false;\n });\n\n if (idx === -1) {\n return ERA_START_DATES.length - 1;\n }\n\n if (idx === 0) {\n return 0;\n }\n\n return idx - 1;\n}\n\nfunction toGregorian(date: AnyCalendarDate) {\n let eraAddend = ERA_ADDENDS[ERA_NAMES.indexOf(date.era)];\n if (!eraAddend) {\n throw new Error('Unknown era: ' + date.era);\n }\n\n return new CalendarDate(\n date.year + eraAddend,\n date.month,\n date.day\n );\n}\n\n/**\n * The Japanese calendar is based on the Gregorian calendar, but with eras for the reign of each Japanese emperor.\n * Whenever a new emperor ascends to the throne, a new era begins and the year starts again from 1.\n * Note that eras before 1868 (Gregorian) are not currently supported by this implementation.\n */\nexport class JapaneseCalendar extends GregorianCalendar {\n identifier = 'japanese';\n\n fromJulianDay(jd: number): CalendarDate {\n let date = super.fromJulianDay(jd);\n let era = findEraFromGregorianDate(date);\n\n return new CalendarDate(\n this,\n ERA_NAMES[era],\n date.year - ERA_ADDENDS[era],\n date.month,\n date.day\n );\n }\n\n toJulianDay(date: AnyCalendarDate) {\n return super.toJulianDay(toGregorian(date));\n }\n\n balanceDate(date: Mutable<AnyCalendarDate>) {\n let gregorianDate = toGregorian(date);\n let era = findEraFromGregorianDate(gregorianDate);\n\n if (ERA_NAMES[era] !== date.era) {\n date.era = ERA_NAMES[era];\n date.year = gregorianDate.year - ERA_ADDENDS[era];\n }\n\n // Constrain in case we went before the first supported era.\n this.constrainDate(date);\n }\n\n constrainDate(date: Mutable<AnyCalendarDate>) {\n let idx = ERA_NAMES.indexOf(date.era);\n let end = ERA_END_DATES[idx];\n if (end != null) {\n let [endYear, endMonth, endDay] = end;\n\n // Constrain the year to the maximum possible value in the era.\n // Then constrain the month and day fields within that.\n let maxYear = endYear - ERA_ADDENDS[idx];\n date.year = Math.max(1, Math.min(maxYear, date.year));\n if (date.year === maxYear) {\n date.month = Math.min(endMonth, date.month);\n\n if (date.month === endMonth) {\n date.day = Math.min(endDay, date.day);\n }\n }\n }\n\n if (date.year === 1 && idx >= 0) {\n let [, startMonth, startDay] = ERA_START_DATES[idx];\n date.month = Math.max(startMonth, date.month);\n\n if (date.month === startMonth) {\n date.day = Math.max(startDay, date.day);\n }\n }\n }\n\n getEras() {\n return ERA_NAMES;\n }\n\n getYearsInEra(date: AnyCalendarDate): number {\n // Get the number of years in the era, taking into account the date's month and day fields.\n let era = ERA_NAMES.indexOf(date.era);\n let cur = ERA_START_DATES[era];\n let next = ERA_START_DATES[era + 1];\n if (next == null) {\n // 9999 gregorian is the maximum year allowed.\n return 9999 - cur[0] + 1;\n }\n\n let years = next[0] - cur[0];\n\n if (date.month < next[1] || (date.month === next[1] && date.day < next[2])) {\n years++;\n }\n\n return years;\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return super.getDaysInMonth(toGregorian(date));\n }\n\n getMinimumMonthInYear(date: AnyCalendarDate): number {\n let start = getMinimums(date);\n return start ? start[1] : 1;\n }\n\n getMinimumDayInMonth(date: AnyCalendarDate): number {\n let start = getMinimums(date);\n return start && date.month === start[1] ? start[2] : 1;\n }\n}\n\nfunction getMinimums(date: AnyCalendarDate) {\n if (date.year === 1) {\n let idx = ERA_NAMES.indexOf(date.era);\n return ERA_START_DATES[idx];\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {fromExtendedYear, getExtendedYear, GregorianCalendar} from './GregorianCalendar';\n\nconst BUDDHIST_ERA_START = -543;\n\n/**\n * The Buddhist calendar is the same as the Gregorian calendar, but counts years\n * starting from the birth of Buddha in 543 BC (Gregorian). It supports only one\n * era, identified as 'BE'.\n */\nexport class BuddhistCalendar extends GregorianCalendar {\n identifier = 'buddhist';\n\n fromJulianDay(jd: number): CalendarDate {\n let gregorianDate = super.fromJulianDay(jd);\n let year = getExtendedYear(gregorianDate.era, gregorianDate.year);\n return new CalendarDate(\n this,\n year - BUDDHIST_ERA_START,\n gregorianDate.month,\n gregorianDate.day\n );\n }\n\n toJulianDay(date: AnyCalendarDate) {\n return super.toJulianDay(toGregorian(date));\n }\n\n getEras() {\n return ['BE'];\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return super.getDaysInMonth(toGregorian(date));\n }\n\n balanceDate() {}\n}\n\nfunction toGregorian(date: AnyCalendarDate) {\n let [era, year] = fromExtendedYear(date.year + BUDDHIST_ERA_START);\n return new CalendarDate(\n era,\n year,\n date.month,\n date.day\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {fromExtendedYear, getExtendedYear, GregorianCalendar} from './GregorianCalendar';\nimport {Mutable} from '../utils';\n\nconst TAIWAN_ERA_START = 1911;\n\nfunction gregorianYear(date: AnyCalendarDate) {\n return date.era === 'minguo'\n ? date.year + TAIWAN_ERA_START\n : 1 - date.year + TAIWAN_ERA_START;\n}\n\nfunction gregorianToTaiwan(year: number): [string, number] {\n let y = year - TAIWAN_ERA_START;\n if (y > 0) {\n return ['minguo', y];\n } else {\n return ['before_minguo', 1 - y];\n }\n}\n\n/**\n * The Taiwanese calendar is the same as the Gregorian calendar, but years\n * are numbered starting from 1912 (Gregorian). Two eras are supported:\n * 'before_minguo' and 'minguo'.\n */\nexport class TaiwanCalendar extends GregorianCalendar {\n identifier = 'roc'; // Republic of China\n\n fromJulianDay(jd: number): CalendarDate {\n let date = super.fromJulianDay(jd);\n let extendedYear = getExtendedYear(date.era, date.year);\n let [era, year] = gregorianToTaiwan(extendedYear);\n return new CalendarDate(this, era, year, date.month, date.day);\n }\n\n toJulianDay(date: AnyCalendarDate) {\n return super.toJulianDay(toGregorian(date));\n }\n\n getEras() {\n return ['before_minguo', 'minguo'];\n }\n\n balanceDate(date: Mutable<AnyCalendarDate>) {\n let [era, year] = gregorianToTaiwan(gregorianYear(date));\n date.era = era;\n date.year = year;\n }\n\n isInverseEra(date: AnyCalendarDate): boolean {\n return date.era === 'before_minguo';\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return super.getDaysInMonth(toGregorian(date));\n }\n\n getYearsInEra(date: AnyCalendarDate): number {\n return date.era === 'before_minguo' ? 9999 : 9999 - TAIWAN_ERA_START;\n }\n}\n\nfunction toGregorian(date: AnyCalendarDate) {\n let [era, year] = fromExtendedYear(gregorianYear(date));\n return new CalendarDate(\n era,\n year,\n date.month,\n date.day\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, Calendar} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {mod} from '../utils';\n\nconst PERSIAN_EPOCH = 1948320;\n\n// Number of days from the start of the year to the start of each month.\nconst MONTH_START = [\n 0, // Farvardin\n 31, // Ordibehesht\n 62, // Khordad\n 93, // Tir\n 124, // Mordad\n 155, // Shahrivar\n 186, // Mehr\n 216, // Aban\n 246, // Azar\n 276, // Dey\n 306, // Bahman\n 336 // Esfand\n];\n\n/**\n * The Persian calendar is the main calendar used in Iran and Afghanistan. It has 12 months\n * in each year, the first 6 of which have 31 days, and the next 5 have 30 days. The 12th month\n * has either 29 or 30 days depending on whether it is a leap year. The Persian year starts\n * around the March equinox.\n */\nexport class PersianCalendar implements Calendar {\n identifier = 'persian';\n\n fromJulianDay(jd: number): CalendarDate {\n let daysSinceEpoch = jd - PERSIAN_EPOCH;\n let year = 1 + Math.floor((33 * daysSinceEpoch + 3) / 12053);\n let farvardin1 = 365 * (year - 1) + Math.floor((8 * year + 21) / 33);\n let dayOfYear = daysSinceEpoch - farvardin1;\n let month = dayOfYear < 216\n ? Math.floor(dayOfYear / 31)\n : Math.floor((dayOfYear - 6) / 30);\n let day = dayOfYear - MONTH_START[month] + 1;\n return new CalendarDate(this, year, month + 1, day);\n }\n\n toJulianDay(date: AnyCalendarDate): number {\n let jd = PERSIAN_EPOCH - 1 + 365 * (date.year - 1) + Math.floor((8 * date.year + 21) / 33);\n jd += MONTH_START[date.month - 1];\n jd += date.day;\n return jd;\n }\n\n getMonthsInYear(): number {\n return 12;\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n if (date.month <= 6) {\n return 31;\n }\n\n if (date.month <= 11) {\n return 30;\n }\n\n let isLeapYear = mod(25 * date.year + 11, 33) < 8;\n return isLeapYear ? 30 : 29;\n }\n\n getEras() {\n return ['AP'];\n }\n\n getYearsInEra(): number {\n // 9378-10-10 persian is 9999-12-31 gregorian.\n // Round down to 9377 to set the maximum full year.\n return 9377;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {fromExtendedYear, GregorianCalendar, gregorianToJulianDay, isLeapYear} from './GregorianCalendar';\n\n// Starts in 78 AD,\nconst INDIAN_ERA_START = 78;\n\n// The Indian year starts 80 days later than the Gregorian year.\nconst INDIAN_YEAR_START = 80;\n\n/**\n * The Indian National Calendar is similar to the Gregorian calendar, but with\n * years numbered since the Saka era in 78 AD (Gregorian). There are 12 months\n * in each year, with either 30 or 31 days. Only one era identifier is supported: 'saka'.\n */\nexport class IndianCalendar extends GregorianCalendar {\n identifier = 'indian';\n\n fromJulianDay(jd: number): CalendarDate {\n // Gregorian date for Julian day\n let date = super.fromJulianDay(jd);\n\n // Year in Saka era\n let indianYear = date.year - INDIAN_ERA_START;\n\n // Day number in Gregorian year (starting from 0)\n let yDay = jd - gregorianToJulianDay(date.era, date.year, 1, 1);\n\n let leapMonth: number;\n if (yDay < INDIAN_YEAR_START) {\n // Day is at the end of the preceding Saka year\n indianYear--;\n\n // Days in leapMonth this year, previous Gregorian year\n leapMonth = isLeapYear(date.year - 1) ? 31 : 30;\n yDay += leapMonth + (31 * 5) + (30 * 3) + 10;\n } else {\n // Days in leapMonth this year\n leapMonth = isLeapYear(date.year) ? 31 : 30;\n yDay -= INDIAN_YEAR_START;\n }\n\n let indianMonth: number;\n let indianDay: number;\n if (yDay < leapMonth) {\n indianMonth = 1;\n indianDay = yDay + 1;\n } else {\n let mDay = yDay - leapMonth;\n if (mDay < (31 * 5)) {\n indianMonth = Math.floor(mDay / 31) + 2;\n indianDay = (mDay % 31) + 1;\n } else {\n mDay -= 31 * 5;\n indianMonth = Math.floor(mDay / 30) + 7;\n indianDay = (mDay % 30) + 1;\n }\n }\n\n return new CalendarDate(this, indianYear, indianMonth, indianDay);\n }\n\n toJulianDay(date: AnyCalendarDate) {\n let extendedYear = date.year + INDIAN_ERA_START;\n let [era, year] = fromExtendedYear(extendedYear);\n\n let leapMonth: number;\n let jd: number;\n if (isLeapYear(year)) {\n leapMonth = 31;\n jd = gregorianToJulianDay(era, year, 3, 21);\n } else {\n leapMonth = 30;\n jd = gregorianToJulianDay(era, year, 3, 22);\n }\n\n if (date.month === 1) {\n return jd + date.day - 1;\n }\n\n jd += leapMonth + Math.min(date.month - 2, 5) * 31;\n\n if (date.month >= 8) {\n jd += (date.month - 7) * 30;\n }\n\n jd += date.day - 1;\n return jd;\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n if (date.month === 1 && isLeapYear(date.year + INDIAN_ERA_START)) {\n return 31;\n }\n\n if (date.month >= 2 && date.month <= 6) {\n return 31;\n }\n\n return 30;\n }\n\n getYearsInEra(): number {\n // 9999-12-31 gregorian is 9920-10-10 indian.\n // Round down to 9919 for the last full year.\n return 9919;\n }\n\n getEras() {\n return ['saka'];\n }\n\n balanceDate() {}\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, Calendar} from '../types';\nimport {CalendarDate} from '../CalendarDate';\n\nconst CIVIL_EPOC = 1948440; // CE 622 July 16 Friday (Julian calendar) / CE 622 July 19 (Gregorian calendar)\nconst ASTRONOMICAL_EPOC = 1948439; // CE 622 July 15 Thursday (Julian calendar)\nconst UMALQURA_YEAR_START = 1300;\nconst UMALQURA_YEAR_END = 1600;\nconst UMALQURA_START_DAYS = 460322;\n\nfunction islamicToJulianDay(epoch: number, year: number, month: number, day: number): number {\n return day +\n Math.ceil(29.5 * (month - 1)) +\n (year - 1) * 354 +\n Math.floor((3 + 11 * year) / 30) +\n epoch - 1;\n}\n\nfunction julianDayToIslamic(calendar: Calendar, epoch: number, jd: number) {\n let year = Math.floor((30 * (jd - epoch) + 10646) / 10631);\n let month = Math.min(12, Math.ceil((jd - (29 + islamicToJulianDay(epoch, year, 1, 1))) / 29.5) + 1);\n let day = jd - islamicToJulianDay(epoch, year, month, 1) + 1;\n\n return new CalendarDate(calendar, year, month, day);\n}\n\nfunction isLeapYear(year: number): boolean {\n return (14 + 11 * year) % 30 < 11;\n}\n\n/**\n * The Islamic calendar, also known as the \"Hijri\" calendar, is used throughout much of the Arab world.\n * The civil variant uses simple arithmetic rules rather than astronomical calculations to approximate\n * the traditional calendar, which is based on sighting of the crescent moon. It uses Friday, July 16 622 CE (Julian) as the epoch.\n * Each year has 12 months, with either 354 or 355 days depending on whether it is a leap year.\n * Learn more about the available Islamic calendars [here](https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types).\n */\nexport class IslamicCivilCalendar implements Calendar {\n identifier = 'islamic-civil';\n\n fromJulianDay(jd: number): CalendarDate {\n return julianDayToIslamic(this, CIVIL_EPOC, jd);\n }\n\n toJulianDay(date: AnyCalendarDate) {\n return islamicToJulianDay(CIVIL_EPOC, date.year, date.month, date.day);\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n let length = 29 + date.month % 2;\n if (date.month === 12 && isLeapYear(date.year)) {\n length++;\n }\n\n return length;\n }\n\n getMonthsInYear(): number {\n return 12;\n }\n\n getDaysInYear(date: AnyCalendarDate): number {\n return isLeapYear(date.year) ? 355 : 354;\n }\n\n getYearsInEra(): number {\n // 9999 gregorian\n return 9665;\n }\n\n getEras() {\n return ['AH'];\n }\n}\n\n/**\n * The Islamic calendar, also known as the \"Hijri\" calendar, is used throughout much of the Arab world.\n * The tabular variant uses simple arithmetic rules rather than astronomical calculations to approximate\n * the traditional calendar, which is based on sighting of the crescent moon. It uses Thursday, July 15 622 CE (Julian) as the epoch.\n * Each year has 12 months, with either 354 or 355 days depending on whether it is a leap year.\n * Learn more about the available Islamic calendars [here](https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types).\n */\nexport class IslamicTabularCalendar extends IslamicCivilCalendar {\n identifier = 'islamic-tbla';\n\n fromJulianDay(jd: number): CalendarDate {\n return julianDayToIslamic(this, ASTRONOMICAL_EPOC, jd);\n }\n\n toJulianDay(date: AnyCalendarDate) {\n return islamicToJulianDay(ASTRONOMICAL_EPOC, date.year, date.month, date.day);\n }\n}\n\n// Generated by scripts/generate-umalqura.js\nconst UMALQURA_DATA = 'qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=';\nlet UMALQURA_MONTHLENGTH: Uint16Array;\nlet UMALQURA_YEAR_START_TABLE: Uint32Array;\n\nfunction umalquraYearStart(year: number): number {\n return UMALQURA_START_DAYS + UMALQURA_YEAR_START_TABLE[year - UMALQURA_YEAR_START];\n}\n\nfunction umalquraMonthLength(year: number, month: number): number {\n let idx = (year - UMALQURA_YEAR_START);\n let mask = (0x01 << (11 - (month - 1)));\n if ((UMALQURA_MONTHLENGTH[idx] & mask) === 0) {\n return 29;\n } else {\n return 30;\n }\n}\n\nfunction umalquraMonthStart(year: number, month: number): number {\n let day = umalquraYearStart(year);\n for (let i = 1; i < month; i++) {\n day += umalquraMonthLength(year, i);\n }\n return day;\n}\n\nfunction umalquraYearLength(year: number): number {\n return UMALQURA_YEAR_START_TABLE[year + 1 - UMALQURA_YEAR_START] - UMALQURA_YEAR_START_TABLE[year - UMALQURA_YEAR_START];\n}\n\n/**\n * The Islamic calendar, also known as the \"Hijri\" calendar, is used throughout much of the Arab world.\n * The Umalqura variant is primarily used in Saudi Arabia. It is a lunar calendar, based on astronomical\n * calculations that predict the sighting of a crescent moon. Month and year lengths vary between years\n * depending on these calculations.\n * Learn more about the available Islamic calendars [here](https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types).\n */\nexport class IslamicUmalquraCalendar extends IslamicCivilCalendar {\n identifier = 'islamic-umalqura';\n\n constructor() {\n super();\n if (!UMALQURA_MONTHLENGTH) {\n UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob(UMALQURA_DATA), c => c.charCodeAt(0)).buffer);\n }\n\n if (!UMALQURA_YEAR_START_TABLE) {\n UMALQURA_YEAR_START_TABLE = new Uint32Array(UMALQURA_YEAR_END - UMALQURA_YEAR_START + 1);\n\n let yearStart = 0;\n for (let year = UMALQURA_YEAR_START; year <= UMALQURA_YEAR_END; year++) {\n UMALQURA_YEAR_START_TABLE[year - UMALQURA_YEAR_START] = yearStart;\n for (let i = 1; i <= 12; i++) {\n yearStart += umalquraMonthLength(year, i);\n }\n }\n }\n }\n\n fromJulianDay(jd: number): CalendarDate {\n let days = jd - CIVIL_EPOC;\n let startDays = umalquraYearStart(UMALQURA_YEAR_START);\n let endDays = umalquraYearStart(UMALQURA_YEAR_END);\n if (days < startDays || days > endDays) {\n return super.fromJulianDay(jd);\n } else {\n let y = UMALQURA_YEAR_START - 1;\n let m = 1;\n let d = 1;\n while (d > 0) {\n y++;\n d = days - umalquraYearStart(y) + 1;\n let yearLength = umalquraYearLength(y);\n if (d === yearLength) {\n m = 12;\n break;\n } else if (d < yearLength) {\n let monthLength = umalquraMonthLength(y, m);\n m = 1;\n while (d > monthLength) {\n d -= monthLength;\n m++;\n monthLength = umalquraMonthLength(y, m);\n }\n break;\n }\n }\n\n return new CalendarDate(this, y, m, (days - umalquraMonthStart(y, m) + 1));\n }\n }\n\n toJulianDay(date: AnyCalendarDate): number {\n if (date.year < UMALQURA_YEAR_START || date.year > UMALQURA_YEAR_END) {\n return super.toJulianDay(date);\n }\n\n return CIVIL_EPOC + umalquraMonthStart(date.year, date.month) + (date.day - 1);\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n if (date.year < UMALQURA_YEAR_START || date.year > UMALQURA_YEAR_END) {\n return super.getDaysInMonth(date);\n }\n\n return umalquraMonthLength(date.year, date.month);\n }\n\n getDaysInYear(date: AnyCalendarDate): number {\n if (date.year < UMALQURA_YEAR_START || date.year > UMALQURA_YEAR_END) {\n return super.getDaysInYear(date);\n }\n\n return umalquraYearLength(date.year);\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, Calendar} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {mod, Mutable} from '../utils';\n\nconst HEBREW_EPOCH = 347997;\n\n// Hebrew date calculations are performed in terms of days, hours, and\n// \"parts\" (or halakim), which are 1/1080 of an hour, or 3 1/3 seconds.\nconst HOUR_PARTS = 1080;\nconst DAY_PARTS = 24 * HOUR_PARTS;\n\n// An approximate value for the length of a lunar month.\n// It is used to calculate the approximate year and month of a given\n// absolute date.\nconst MONTH_DAYS = 29;\nconst MONTH_FRACT = 12 * HOUR_PARTS + 793;\nconst MONTH_PARTS = MONTH_DAYS * DAY_PARTS + MONTH_FRACT;\n\nfunction isLeapYear(year: number) {\n return mod(year * 7 + 1, 19) < 7;\n}\n\n// Test for delay of start of new year and to avoid\n// Sunday, Wednesday, and Friday as start of the new year.\nfunction hebrewDelay1(year: number) {\n let months = Math.floor((235 * year - 234) / 19);\n let parts = 12084 + 13753 * months;\n let day = months * 29 + Math.floor(parts / 25920);\n\n if (mod(3 * (day + 1), 7) < 3) {\n day += 1;\n }\n\n return day;\n}\n\n// Check for delay in start of new year due to length of adjacent years\nfunction hebrewDelay2(year: number) {\n let last = hebrewDelay1(year - 1);\n let present = hebrewDelay1(year);\n let next = hebrewDelay1(year + 1);\n\n if (next - present === 356) {\n return 2;\n }\n\n if (present - last === 382) {\n return 1;\n }\n\n return 0;\n}\n\nfunction startOfYear(year: number) {\n return hebrewDelay1(year) + hebrewDelay2(year);\n}\n\nfunction getDaysInYear(year: number) {\n return startOfYear(year + 1) - startOfYear(year);\n}\n\nfunction getYearType(year: number) {\n let yearLength = getDaysInYear(year);\n\n if (yearLength > 380) {\n yearLength -= 30; // Subtract length of leap month.\n }\n\n switch (yearLength) {\n case 353:\n return 0; // deficient\n case 354:\n return 1; // normal\n case 355:\n return 2; // complete\n }\n}\n\nfunction getDaysInMonth(year: number, month: number): number {\n // Normalize month numbers from 1 - 13, even on non-leap years\n if (month >= 6 && !isLeapYear(year)) {\n month++;\n }\n\n // First of all, dispose of fixed-length 29 day months\n if (month === 4 || month === 7 || month === 9 || month === 11 || month === 13) {\n return 29;\n }\n\n let yearType = getYearType(year);\n\n // If it's Heshvan, days depend on length of year\n if (month === 2) {\n return yearType === 2 ? 30 : 29;\n }\n\n // Similarly, Kislev varies with the length of year\n if (month === 3) {\n return yearType === 0 ? 29 : 30;\n }\n\n // Adar I only exists in leap years\n if (month === 6) {\n return isLeapYear(year) ? 30 : 0;\n }\n\n return 30;\n}\n\n/**\n * The Hebrew calendar is used in Israel and around the world by the Jewish faith.\n * Years include either 12 or 13 months depending on whether it is a leap year.\n * In leap years, an extra month is inserted at month 6.\n */\nexport class HebrewCalendar implements Calendar {\n identifier = 'hebrew';\n\n fromJulianDay(jd: number): CalendarDate {\n let d = jd - HEBREW_EPOCH;\n let m = (d * DAY_PARTS) / MONTH_PARTS; // Months (approx)\n let year = Math.floor((19 * m + 234) / 235) + 1; // Years (approx)\n let ys = startOfYear(year); // 1st day of year\n let dayOfYear = Math.floor(d - ys);\n\n // Because of the postponement rules, it's possible to guess wrong. Fix it.\n while (dayOfYear < 1) {\n year--;\n ys = startOfYear(year);\n dayOfYear = Math.floor(d - ys);\n }\n\n // Now figure out which month we're in, and the date within that month\n let month = 1;\n let monthStart = 0;\n while (monthStart < dayOfYear) {\n monthStart += getDaysInMonth(year, month);\n month++;\n }\n\n month--;\n monthStart -= getDaysInMonth(year, month);\n\n let day = dayOfYear - monthStart;\n return new CalendarDate(this, year, month, day);\n }\n\n toJulianDay(date: AnyCalendarDate) {\n let jd = startOfYear(date.year);\n for (let month = 1; month < date.month; month++) {\n jd += getDaysInMonth(date.year, month);\n }\n\n return jd + date.day + HEBREW_EPOCH;\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return getDaysInMonth(date.year, date.month);\n }\n\n getMonthsInYear(date: AnyCalendarDate): number {\n return isLeapYear(date.year) ? 13 : 12;\n }\n\n getDaysInYear(date: AnyCalendarDate): number {\n return getDaysInYear(date.year);\n }\n\n getYearsInEra(): number {\n // 6239 gregorian\n return 9999;\n }\n\n getEras() {\n return ['AM'];\n }\n\n balanceYearMonth(date: Mutable<AnyCalendarDate>, previousDate: AnyCalendarDate) {\n // Keep date in the same month when switching between leap years and non leap years\n if (previousDate.year !== date.year) {\n if (isLeapYear(previousDate.year) && !isLeapYear(date.year) && previousDate.month > 6) {\n date.month--;\n } else if (!isLeapYear(previousDate.year) && isLeapYear(date.year) && previousDate.month > 6) {\n date.month++;\n }\n }\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, Calendar} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {Mutable} from '../utils';\n\nconst ETHIOPIC_EPOCH = 1723856;\nconst COPTIC_EPOCH = 1824665;\n\n// The delta between Amete Alem 1 and Amete Mihret 1\n// AA 5501 = AM 1\nconst AMETE_MIHRET_DELTA = 5500;\n\nfunction ceToJulianDay(epoch: number, year: number, month: number, day: number): number {\n return (\n epoch // difference from Julian epoch to 1,1,1\n + 365 * year // number of days from years\n + Math.floor(year / 4) // extra day of leap year\n + 30 * (month - 1) // number of days from months (1 based)\n + day - 1 // number of days for present month (1 based)\n );\n}\n\nfunction julianDayToCE(epoch: number, jd: number) {\n let year = Math.floor((4 * (jd - epoch)) / 1461);\n let month = 1 + Math.floor((jd - ceToJulianDay(epoch, year, 1, 1)) / 30);\n let day = jd + 1 - ceToJulianDay(epoch, year, month, 1);\n return [year, month, day];\n}\n\nfunction getLeapDay(year: number) {\n return Math.floor((year % 4) / 3);\n}\n\nfunction getDaysInMonth(year: number, month: number) {\n // The Ethiopian and Coptic calendars have 13 months, 12 of 30 days each and\n // an intercalary month at the end of the year of 5 or 6 days, depending whether\n // the year is a leap year or not. The Leap Year follows the same rules as the\n // Julian Calendar so that the extra month always has six days in the year before\n // a Julian Leap Year.\n if (month % 13 !== 0) {\n // not intercalary month\n return 30;\n } else {\n // intercalary month 5 days + possible leap day\n return getLeapDay(year) + 5;\n }\n}\n\n/**\n * The Ethiopic calendar system is the official calendar used in Ethiopia.\n * It includes 12 months of 30 days each, plus 5 or 6 intercalary days depending\n * on whether it is a leap year. Two eras are supported: 'AA' and 'AM'.\n */\nexport class EthiopicCalendar implements Calendar {\n identifier = 'ethiopic';\n\n fromJulianDay(jd: number): CalendarDate {\n let [year, month, day] = julianDayToCE(ETHIOPIC_EPOCH, jd);\n let era = 'AM';\n if (year <= 0) {\n era = 'AA';\n year += AMETE_MIHRET_DELTA;\n }\n\n return new CalendarDate(this, era, year, month, day);\n }\n\n toJulianDay(date: AnyCalendarDate) {\n let year = date.year;\n if (date.era === 'AA') {\n year -= AMETE_MIHRET_DELTA;\n }\n\n return ceToJulianDay(ETHIOPIC_EPOCH, year, date.month, date.day);\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return getDaysInMonth(date.year, date.month);\n }\n\n getMonthsInYear(): number {\n return 13;\n }\n\n getDaysInYear(date: AnyCalendarDate): number {\n return 365 + getLeapDay(date.year);\n }\n\n getYearsInEra(date: AnyCalendarDate): number {\n // 9999-12-31 gregorian is 9992-20-02 ethiopic.\n // Round down to 9991 for the last full year.\n // AA 9999-01-01 ethiopic is 4506-09-30 gregorian.\n return date.era === 'AA' ? 9999 : 9991;\n }\n\n getEras() {\n return ['AA', 'AM'];\n }\n}\n\n/**\n * The Ethiopic (Amete Alem) calendar is the same as the modern Ethiopic calendar,\n * except years were measured from a different epoch. Only one era is supported: 'AA'.\n */\nexport class EthiopicAmeteAlemCalendar extends EthiopicCalendar {\n identifier = 'ethioaa'; // also known as 'ethiopic-amete-alem' in ICU\n\n fromJulianDay(jd: number): CalendarDate {\n let [year, month, day] = julianDayToCE(ETHIOPIC_EPOCH, jd);\n year += AMETE_MIHRET_DELTA;\n return new CalendarDate(this, 'AA', year, month, day);\n }\n\n getEras() {\n return ['AA'];\n }\n\n getYearsInEra(): number {\n // 9999-13-04 ethioaa is the maximum date, which is equivalent to 4506-09-29 gregorian.\n return 9999;\n }\n}\n\n/**\n * The Coptic calendar is similar to the Ethiopic calendar.\n * It includes 12 months of 30 days each, plus 5 or 6 intercalary days depending\n * on whether it is a leap year. Two eras are supported: 'BCE' and 'CE'.\n */\nexport class CopticCalendar extends EthiopicCalendar {\n identifier = 'coptic';\n\n fromJulianDay(jd: number): CalendarDate {\n let [year, month, day] = julianDayToCE(COPTIC_EPOCH, jd);\n let era = 'CE';\n if (year <= 0) {\n era = 'BCE';\n year = 1 - year;\n }\n\n return new CalendarDate(this, era, year, month, day);\n }\n\n toJulianDay(date: AnyCalendarDate) {\n let year = date.year;\n if (date.era === 'BCE') {\n year = 1 - year;\n }\n\n return ceToJulianDay(COPTIC_EPOCH, year, date.month, date.day);\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n let year = date.year;\n if (date.era === 'BCE') {\n year = 1 - year;\n }\n\n return getDaysInMonth(year, date.month);\n }\n\n isInverseEra(date: AnyCalendarDate): boolean {\n return date.era === 'BCE';\n }\n\n balanceDate(date: Mutable<AnyCalendarDate>) {\n if (date.year <= 0) {\n date.era = date.era === 'BCE' ? 'CE' : 'BCE';\n date.year = 1 - date.year;\n }\n }\n\n getEras() {\n return ['BCE', 'CE'];\n }\n\n getYearsInEra(date: AnyCalendarDate): number {\n // 9999-12-30 gregorian is 9716-02-20 coptic.\n // Round down to 9715 for the last full year.\n // BCE 9999-01-01 coptic is BC 9716-06-15 gregorian.\n return date.era === 'BCE' ? 9999 : 9715;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {BuddhistCalendar} from './calendars/BuddhistCalendar';\nimport {Calendar} from './types';\nimport {CopticCalendar, EthiopicAmeteAlemCalendar, EthiopicCalendar} from './calendars/EthiopicCalendar';\nimport {GregorianCalendar} from './calendars/GregorianCalendar';\nimport {HebrewCalendar} from './calendars/HebrewCalendar';\nimport {IndianCalendar} from './calendars/IndianCalendar';\nimport {IslamicCivilCalendar, IslamicTabularCalendar, IslamicUmalquraCalendar} from './calendars/IslamicCalendar';\nimport {JapaneseCalendar} from './calendars/JapaneseCalendar';\nimport {PersianCalendar} from './calendars/PersianCalendar';\nimport {TaiwanCalendar} from './calendars/TaiwanCalendar';\n\n/** Creates a `Calendar` instance from a Unicode calendar identifier string. */\nexport function createCalendar(name: string): Calendar {\n switch (name) {\n case 'buddhist':\n return new BuddhistCalendar();\n case 'ethiopic':\n return new EthiopicCalendar();\n case 'ethioaa':\n return new EthiopicAmeteAlemCalendar();\n case 'coptic':\n return new CopticCalendar();\n case 'hebrew':\n return new HebrewCalendar();\n case 'indian':\n return new IndianCalendar();\n case 'islamic-civil':\n return new IslamicCivilCalendar();\n case 'islamic-tbla':\n return new IslamicTabularCalendar();\n case 'islamic-umalqura':\n return new IslamicUmalquraCalendar();\n case 'japanese':\n return new JapaneseCalendar();\n case 'persian':\n return new PersianCalendar();\n case 'roc':\n return new TaiwanCalendar();\n case 'gregory':\n default:\n return new GregorianCalendar();\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nlet formatterCache = new Map<string, Intl.DateTimeFormat>();\n\ninterface DateRangeFormatPart extends Intl.DateTimeFormatPart {\n source: 'startRange' | 'endRange' | 'shared'\n}\n\n/** A wrapper around Intl.DateTimeFormat that fixes various browser bugs, and polyfills new features. */\nexport class DateFormatter implements Intl.DateTimeFormat {\n private formatter: Intl.DateTimeFormat;\n private options: Intl.DateTimeFormatOptions;\n private resolvedHourCycle: Intl.DateTimeFormatOptions['hourCycle'];\n\n constructor(locale: string, options: Intl.DateTimeFormatOptions = {}) {\n this.formatter = getCachedDateFormatter(locale, options);\n this.options = options;\n }\n\n /** Formats a date as a string according to the locale and format options passed to the constructor. */\n format(value: Date): string {\n return this.formatter.format(value);\n }\n\n /** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */\n formatToParts(value: Date): Intl.DateTimeFormatPart[] {\n return this.formatter.formatToParts(value);\n }\n\n /** Formats a date range as a string. */\n formatRange(start: Date, end: Date): string {\n // @ts-ignore\n if (typeof this.formatter.formatRange === 'function') {\n // @ts-ignore\n return this.formatter.formatRange(start, end);\n }\n\n if (end < start) {\n throw new RangeError('End date must be >= start date');\n }\n\n // Very basic fallback for old browsers.\n return `${this.formatter.format(start)} – ${this.formatter.format(end)}`;\n }\n\n /** Formats a date range as an array of parts. */\n formatRangeToParts(start: Date, end: Date): DateRangeFormatPart[] {\n // @ts-ignore\n if (typeof this.formatter.formatRangeToParts === 'function') {\n // @ts-ignore\n return this.formatter.formatRangeToParts(start, end);\n }\n\n if (end < start) {\n throw new RangeError('End date must be >= start date');\n }\n\n let startParts = this.formatter.formatToParts(start);\n let endParts = this.formatter.formatToParts(end);\n return [\n ...startParts.map(p => ({...p, source: 'startRange'} as DateRangeFormatPart)),\n {type: 'literal', value: ' – ', source: 'shared'},\n ...endParts.map(p => ({...p, source: 'endRange'} as DateRangeFormatPart))\n ];\n }\n\n /** Returns the resolved formatting options based on the values passed to the constructor. */\n resolvedOptions(): Intl.ResolvedDateTimeFormatOptions {\n let resolvedOptions = this.formatter.resolvedOptions();\n if (hasBuggyResolvedHourCycle()) {\n if (!this.resolvedHourCycle) {\n this.resolvedHourCycle = getResolvedHourCycle(resolvedOptions.locale, this.options);\n }\n resolvedOptions.hourCycle = this.resolvedHourCycle;\n resolvedOptions.hour12 = this.resolvedHourCycle === 'h11' || this.resolvedHourCycle === 'h12';\n }\n\n // Safari uses a different name for the Ethiopic (Amete Alem) calendar.\n // https://bugs.webkit.org/show_bug.cgi?id=241564\n if (resolvedOptions.calendar === 'ethiopic-amete-alem') {\n resolvedOptions.calendar = 'ethioaa';\n }\n\n return resolvedOptions;\n }\n}\n\n// There are multiple bugs involving the hour12 and hourCycle options in various browser engines.\n// - Chrome [1] (and the ECMA 402 spec [2]) resolve hour12: false in English and other locales to h24 (24:00 - 23:59)\n// rather than h23 (00:00 - 23:59). Same can happen with hour12: true in French, which Chrome resolves to h11 (00:00 - 11:59)\n// rather than h12 (12:00 - 11:59).\n// - WebKit returns an incorrect hourCycle resolved option in the French locale due to incorrect parsing of 'h' literal\n// in the resolved pattern. It also formats incorrectly when specifying the hourCycle option for the same reason. [3]\n// [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1045791\n// [2] https://github.com/tc39/ecma402/issues/402\n// [3] https://bugs.webkit.org/show_bug.cgi?id=229313\n\n// https://github.com/unicode-org/cldr/blob/018b55eff7ceb389c7e3fc44e2f657eae3b10b38/common/supplemental/supplementalData.xml#L4774-L4802\nconst hour12Preferences = {\n true: {\n // Only Japanese uses the h11 style for 12 hour time. All others use h12.\n ja: 'h11'\n },\n false: {\n // All locales use h23 for 24 hour time. None use h24.\n }\n};\n\nfunction getCachedDateFormatter(locale: string, options: Intl.DateTimeFormatOptions = {}): Intl.DateTimeFormat {\n // Work around buggy hour12 behavior in Chrome / ECMA 402 spec by using hourCycle instead.\n // Only apply the workaround if the issue is detected, because the hourCycle option is buggy in Safari.\n if (typeof options.hour12 === 'boolean' && hasBuggyHour12Behavior()) {\n options = {...options};\n let pref = hour12Preferences[String(options.hour12)][locale.split('-')[0]];\n let defaultHourCycle = options.hour12 ? 'h12' : 'h23';\n options.hourCycle = pref ?? defaultHourCycle;\n delete options.hour12;\n }\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (formatterCache.has(cacheKey)) {\n return formatterCache.get(cacheKey)!;\n }\n\n let numberFormatter = new Intl.DateTimeFormat(locale, options);\n formatterCache.set(cacheKey, numberFormatter);\n return numberFormatter;\n}\n\nlet _hasBuggyHour12Behavior: boolean | null = null;\nfunction hasBuggyHour12Behavior() {\n if (_hasBuggyHour12Behavior == null) {\n _hasBuggyHour12Behavior = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n hour12: false\n }).format(new Date(2020, 2, 3, 0)) === '24';\n }\n\n return _hasBuggyHour12Behavior;\n}\n\nlet _hasBuggyResolvedHourCycle: boolean | null = null;\nfunction hasBuggyResolvedHourCycle() {\n if (_hasBuggyResolvedHourCycle == null) {\n _hasBuggyResolvedHourCycle = new Intl.DateTimeFormat('fr', {\n hour: 'numeric',\n hour12: false\n }).resolvedOptions().hourCycle === 'h12';\n }\n\n return _hasBuggyResolvedHourCycle;\n}\n\nfunction getResolvedHourCycle(locale: string, options: Intl.DateTimeFormatOptions) {\n if (!options.timeStyle && !options.hour) {\n return undefined;\n }\n\n // Work around buggy results in resolved hourCycle and hour12 options in WebKit.\n // Format the minimum possible hour and maximum possible hour in a day and parse the results.\n locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, '');\n locale += (locale.includes('-u-') ? '' : '-u') + '-nu-latn';\n let formatter = getCachedDateFormatter(locale, {\n ...options,\n timeZone: undefined // use local timezone\n });\n\n let min = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 0)).find(p => p.type === 'hour')!.value, 10);\n let max = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 23)).find(p => p.type === 'hour')!.value, 10);\n\n if (min === 0 && max === 23) {\n return 'h23';\n }\n\n if (min === 24 && max === 23) {\n return 'h24';\n }\n\n if (min === 0 && max === 11) {\n return 'h11';\n }\n\n if (min === 12 && max === 11) {\n return 'h12';\n }\n\n throw new Error('Unexpected hour cycle result');\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {NumberFormatOptions, NumberFormatter} from '@internationalized/number';\nimport {useLocale} from './context';\nimport {useMemo} from 'react';\n\n/**\n * Provides localized number formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the number formatter for performance.\n * @param options - Formatting options.\n */\nexport function useNumberFormatter(options: NumberFormatOptions = {}): Intl.NumberFormat {\n let {locale} = useLocale();\n return useMemo(() => new NumberFormatter(locale, options), [locale, options]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {NumberFormatOptions} from './NumberFormatter';\n\nexport {NumberFormatter} from './NumberFormatter';\nexport {NumberParser} from './NumberParser';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nlet formatterCache = new Map<string, Intl.NumberFormat>();\n\nlet supportsSignDisplay = false;\ntry {\n supportsSignDisplay = (new Intl.NumberFormat('de-DE', {signDisplay: 'exceptZero'})).resolvedOptions().signDisplay === 'exceptZero';\n // eslint-disable-next-line no-empty\n} catch {}\n\nlet supportsUnit = false;\ntry {\n supportsUnit = (new Intl.NumberFormat('de-DE', {style: 'unit', unit: 'degree'})).resolvedOptions().style === 'unit';\n // eslint-disable-next-line no-empty\n} catch {}\n\n// Polyfill for units since Safari doesn't support them yet. See https://bugs.webkit.org/show_bug.cgi?id=215438.\n// Currently only polyfilling the unit degree in narrow format for ColorSlider in our supported locales.\n// Values were determined by switching to each locale manually in Chrome.\nconst UNITS = {\n degree: {\n narrow: {\n default: '°',\n 'ja-JP': ' 度',\n 'zh-TW': '度',\n 'sl-SI': ' °'\n // Arabic?? But Safari already doesn't use Arabic digits so might be ok...\n // https://bugs.webkit.org/show_bug.cgi?id=218139\n }\n }\n};\n\nexport interface NumberFormatOptions extends Intl.NumberFormatOptions {\n /** Overrides default numbering system for the current locale. */\n numberingSystem?: string\n}\n\ninterface NumberRangeFormatPart extends Intl.NumberFormatPart {\n source: 'startRange' | 'endRange' | 'shared'\n}\n\n/**\n * A wrapper around Intl.NumberFormat providing additional options, polyfills, and caching for performance.\n */\nexport class NumberFormatter implements Intl.NumberFormat {\n private numberFormatter: Intl.NumberFormat;\n private options: NumberFormatOptions;\n\n constructor(locale: string, options: NumberFormatOptions = {}) {\n this.numberFormatter = getCachedNumberFormatter(locale, options);\n this.options = options;\n }\n\n /** Formats a number value as a string, according to the locale and options provided to the constructor. */\n format(value: number): string {\n let res = '';\n if (!supportsSignDisplay && this.options.signDisplay != null) {\n res = numberFormatSignDisplayPolyfill(this.numberFormatter, this.options.signDisplay, value);\n } else {\n res = this.numberFormatter.format(value);\n }\n\n if (this.options.style === 'unit' && !supportsUnit) {\n let {unit, unitDisplay = 'short', locale} = this.resolvedOptions();\n if (!unit) {\n return res;\n }\n let values = UNITS[unit]?.[unitDisplay];\n res += values[locale] || values.default;\n }\n\n return res;\n }\n\n /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */\n formatToParts(value: number): Intl.NumberFormatPart[] {\n // TODO: implement signDisplay for formatToParts\n return this.numberFormatter.formatToParts(value);\n }\n\n /** Formats a number range as a string. */\n formatRange(start: number, end: number): string {\n if (typeof this.numberFormatter.formatRange === 'function') {\n return this.numberFormatter.formatRange(start, end);\n }\n\n if (end < start) {\n throw new RangeError('End date must be >= start date');\n }\n\n // Very basic fallback for old browsers.\n return `${this.format(start)} – ${this.format(end)}`;\n }\n\n /** Formats a number range as an array of parts. */\n formatRangeToParts(start: number, end: number): NumberRangeFormatPart[] {\n if (typeof this.numberFormatter.formatRangeToParts === 'function') {\n return this.numberFormatter.formatRangeToParts(start, end);\n }\n\n if (end < start) {\n throw new RangeError('End date must be >= start date');\n }\n\n let startParts = this.numberFormatter.formatToParts(start);\n let endParts = this.numberFormatter.formatToParts(end);\n return [\n ...startParts.map(p => ({...p, source: 'startRange'} as NumberRangeFormatPart)),\n {type: 'literal', value: ' – ', source: 'shared'},\n ...endParts.map(p => ({...p, source: 'endRange'} as NumberRangeFormatPart))\n ];\n }\n\n /** Returns the resolved formatting options based on the values passed to the constructor. */\n resolvedOptions(): Intl.ResolvedNumberFormatOptions {\n let options = this.numberFormatter.resolvedOptions();\n if (!supportsSignDisplay && this.options.signDisplay != null) {\n options = {...options, signDisplay: this.options.signDisplay};\n }\n\n if (!supportsUnit && this.options.style === 'unit') {\n options = {...options, style: 'unit', unit: this.options.unit, unitDisplay: this.options.unitDisplay};\n }\n\n return options;\n }\n}\n\nfunction getCachedNumberFormatter(locale: string, options: NumberFormatOptions = {}): Intl.NumberFormat {\n let {numberingSystem} = options;\n if (numberingSystem && locale.includes('-nu-')) {\n if (!locale.includes('-u-')) {\n locale += '-u-';\n }\n locale += `-nu-${numberingSystem}`;\n }\n\n if (options.style === 'unit' && !supportsUnit) {\n let {unit, unitDisplay = 'short'} = options;\n if (!unit) {\n throw new Error('unit option must be provided with style: \"unit\"');\n }\n if (!UNITS[unit]?.[unitDisplay]) {\n throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);\n }\n options = {...options, style: 'decimal'};\n }\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (formatterCache.has(cacheKey)) {\n return formatterCache.get(cacheKey)!;\n }\n\n let numberFormatter = new Intl.NumberFormat(locale, options);\n formatterCache.set(cacheKey, numberFormatter);\n return numberFormatter;\n}\n\n/** @private - exported for tests */\nexport function numberFormatSignDisplayPolyfill(numberFormat: Intl.NumberFormat, signDisplay: string, num: number) {\n if (signDisplay === 'auto') {\n return numberFormat.format(num);\n } else if (signDisplay === 'never') {\n return numberFormat.format(Math.abs(num));\n } else {\n let needsPositiveSign = false;\n if (signDisplay === 'always') {\n needsPositiveSign = num > 0 || Object.is(num, 0);\n } else if (signDisplay === 'exceptZero') {\n if (Object.is(num, -0) || Object.is(num, 0)) {\n num = Math.abs(num);\n } else {\n needsPositiveSign = num > 0;\n }\n }\n\n if (needsPositiveSign) {\n let negative = numberFormat.format(-num);\n let noSign = numberFormat.format(num);\n // ignore RTL/LTR marker character\n let minus = negative.replace(noSign, '').replace(/\\u200e|\\u061C/, '');\n if ([...minus].length !== 1) {\n console.warn('@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case');\n }\n let positive = negative.replace(noSign, '!!!').replace(minus, '+').replace('!!!', noSign);\n return positive;\n } else {\n return numberFormat.format(num);\n }\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {NumberFormatter} from './NumberFormatter';\n\ninterface Symbols {\n minusSign?: string,\n plusSign?: string,\n decimal?: string,\n group?: string,\n literals: RegExp,\n numeral: RegExp,\n index: (v: string) => string\n}\n\nconst CURRENCY_SIGN_REGEX = new RegExp('^.*\\\\(.*\\\\).*$');\nconst NUMBERING_SYSTEMS = ['latn', 'arab', 'hanidec', 'deva', 'beng'];\n\n/**\n * A NumberParser can be used to perform locale-aware parsing of numbers from Unicode strings,\n * as well as validation of partial user input. It automatically detects the numbering system\n * used in the input, and supports parsing decimals, percentages, currency values, and units\n * according to the locale.\n */\nexport class NumberParser {\n private locale: string;\n private options: Intl.NumberFormatOptions;\n\n constructor(locale: string, options: Intl.NumberFormatOptions = {}) {\n this.locale = locale;\n this.options = options;\n }\n\n /**\n * Parses the given string to a number. Returns NaN if a valid number could not be parsed.\n */\n parse(value: string): number {\n return getNumberParserImpl(this.locale, this.options, value).parse(value);\n }\n\n /**\n * Returns whether the given string could potentially be a valid number. This should be used to\n * validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity\n * of the minus/plus sign characters can be checked.\n */\n isValidPartialNumber(value: string, minValue?: number, maxValue?: number): boolean {\n return getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);\n }\n\n /**\n * Returns a numbering system for which the given string is valid in the current locale.\n * If no numbering system could be detected, the default numbering system for the current\n * locale is returned.\n */\n getNumberingSystem(value: string): string {\n return getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;\n }\n}\n\nconst numberParserCache = new Map<string, NumberParserImpl>();\nfunction getNumberParserImpl(locale: string, options: Intl.NumberFormatOptions, value: string) {\n // First try the default numbering system for the provided locale\n let defaultParser = getCachedNumberParser(locale, options);\n\n // If that doesn't match, and the locale doesn't include a hard coded numbering system,\n // try each of the other supported numbering systems until we find one that matches.\n if (!locale.includes('-nu-') && !defaultParser.isValidPartialNumber(value)) {\n for (let numberingSystem of NUMBERING_SYSTEMS) {\n if (numberingSystem !== defaultParser.options.numberingSystem) {\n let parser = getCachedNumberParser(locale + (locale.includes('-u-') ? '-nu-' : '-u-nu-') + numberingSystem, options);\n if (parser.isValidPartialNumber(value)) {\n return parser;\n }\n }\n }\n }\n\n return defaultParser;\n}\n\nfunction getCachedNumberParser(locale: string, options: Intl.NumberFormatOptions) {\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n let parser = numberParserCache.get(cacheKey);\n if (!parser) {\n parser = new NumberParserImpl(locale, options);\n numberParserCache.set(cacheKey, parser);\n }\n\n return parser;\n}\n\n// The actual number parser implementation. Instances of this class are cached\n// based on the locale, options, and detected numbering system.\nclass NumberParserImpl {\n formatter: Intl.NumberFormat;\n options: Intl.ResolvedNumberFormatOptions;\n symbols: Symbols;\n locale: string;\n\n constructor(locale: string, options: Intl.NumberFormatOptions = {}) {\n this.locale = locale;\n this.formatter = new Intl.NumberFormat(locale, options);\n this.options = this.formatter.resolvedOptions();\n this.symbols = getSymbols(locale, this.formatter, this.options, options);\n if (this.options.style === 'percent' && ((this.options.minimumFractionDigits ?? 0) > 18 || (this.options.maximumFractionDigits ?? 0) > 18)) {\n console.warn('NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.');\n }\n }\n\n parse(value: string) {\n // to parse the number, we need to remove anything that isn't actually part of the number, for example we want '-10.40' not '-10.40 USD'\n let fullySanitizedValue = this.sanitize(value);\n\n if (this.symbols.group) {\n // Remove group characters, and replace decimal points and numerals with ASCII values.\n fullySanitizedValue = replaceAll(fullySanitizedValue, this.symbols.group, '');\n }\n if (this.symbols.decimal) {\n fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal!, '.');\n }\n if (this.symbols.minusSign) {\n fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign!, '-');\n }\n fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);\n\n if (this.options.style === 'percent') {\n // javascript is bad at dividing by 100 and maintaining the same significant figures, so perform it on the string before parsing\n let isNegative = fullySanitizedValue.indexOf('-');\n fullySanitizedValue = fullySanitizedValue.replace('-', '');\n let index = fullySanitizedValue.indexOf('.');\n if (index === -1) {\n index = fullySanitizedValue.length;\n }\n fullySanitizedValue = fullySanitizedValue.replace('.', '');\n if (index - 2 === 0) {\n fullySanitizedValue = `0.${fullySanitizedValue}`;\n } else if (index - 2 === -1) {\n fullySanitizedValue = `0.0${fullySanitizedValue}`;\n } else if (index - 2 === -2) {\n fullySanitizedValue = '0.00';\n } else {\n fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;\n }\n if (isNegative > -1) {\n fullySanitizedValue = `-${fullySanitizedValue}`;\n }\n }\n\n let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;\n if (isNaN(newValue)) {\n return NaN;\n }\n\n if (this.options.style === 'percent') {\n // extra step for rounding percents to what our formatter would output\n let options = {\n ...this.options,\n style: 'decimal' as const,\n minimumFractionDigits: Math.min((this.options.minimumFractionDigits ?? 0) + 2, 20),\n maximumFractionDigits: Math.min((this.options.maximumFractionDigits ?? 0) + 2, 20)\n };\n return (new NumberParser(this.locale, options)).parse(new NumberFormatter(this.locale, options).format(newValue));\n }\n\n // accounting will always be stripped to a positive number, so if it's accounting and has a () around everything, then we need to make it negative again\n if (this.options.currencySign === 'accounting' && CURRENCY_SIGN_REGEX.test(value)) {\n newValue = -1 * newValue;\n }\n\n return newValue;\n }\n\n sanitize(value: string) {\n // Remove literals and whitespace, which are allowed anywhere in the string\n value = value.replace(this.symbols.literals, '');\n\n // Replace the ASCII minus sign with the minus sign used in the current locale\n // so that both are allowed in case the user's keyboard doesn't have the locale's minus sign.\n if (this.symbols.minusSign) {\n value = value.replace('-', this.symbols.minusSign);\n }\n\n // In arab numeral system, their decimal character is 1643, but most keyboards don't type that\n // instead they use the , (44) character or apparently the (1548) character.\n if (this.options.numberingSystem === 'arab') {\n if (this.symbols.decimal) {\n value = value.replace(',', this.symbols.decimal);\n value = value.replace(String.fromCharCode(1548), this.symbols.decimal);\n }\n if (this.symbols.group) {\n value = replaceAll(value, '.', this.symbols.group);\n }\n }\n\n // fr-FR group character is char code 8239, but that's not a key on the french keyboard,\n // so allow 'period' as a group char and replace it with a space\n if (this.options.locale === 'fr-FR') {\n value = replaceAll(value, '.', String.fromCharCode(8239));\n }\n\n return value;\n }\n\n isValidPartialNumber(value: string, minValue: number = -Infinity, maxValue: number = Infinity): boolean {\n value = this.sanitize(value);\n\n // Remove minus or plus sign, which must be at the start of the string.\n if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) {\n value = value.slice(this.symbols.minusSign.length);\n } else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) {\n value = value.slice(this.symbols.plusSign.length);\n }\n\n // Numbers cannot start with a group separator\n if (this.symbols.group && value.startsWith(this.symbols.group)) {\n return false;\n }\n\n // Numbers that can't have any decimal values fail if a decimal character is typed\n if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) {\n return false;\n }\n\n // Remove numerals, groups, and decimals\n if (this.symbols.group) {\n value = replaceAll(value, this.symbols.group, '');\n }\n value = value.replace(this.symbols.numeral, '');\n if (this.symbols.decimal) {\n value = value.replace(this.symbols.decimal, '');\n }\n\n // The number is valid if there are no remaining characters\n return value.length === 0;\n }\n}\n\nconst nonLiteralParts = new Set(['decimal', 'fraction', 'integer', 'minusSign', 'plusSign', 'group']);\n\n// This list is derived from https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html#comparison and includes\n// all unique numbers which we need to check in order to determine all the plural forms for a given locale.\n// See: https://github.com/adobe/react-spectrum/pull/5134/files#r1337037855 for used script\nconst pluralNumbers = [\n 0, 4, 2, 1, 11, 20, 3, 7, 100, 21, 0.1, 1.1\n];\n\nfunction getSymbols(locale: string, formatter: Intl.NumberFormat, intlOptions: Intl.ResolvedNumberFormatOptions, originalOptions: Intl.NumberFormatOptions): Symbols {\n // formatter needs access to all decimal places in order to generate the correct literal strings for the plural set\n let symbolFormatter = new Intl.NumberFormat(locale, {...intlOptions,\n // Resets so we get the full range of symbols\n minimumSignificantDigits: 1,\n maximumSignificantDigits: 21,\n roundingIncrement: 1,\n roundingPriority: 'auto',\n roundingMode: 'halfExpand'\n });\n // Note: some locale's don't add a group symbol until there is a ten thousands place\n let allParts = symbolFormatter.formatToParts(-10000.111);\n let posAllParts = symbolFormatter.formatToParts(10000.111);\n let pluralParts = pluralNumbers.map(n => symbolFormatter.formatToParts(n));\n\n let minusSign = allParts.find(p => p.type === 'minusSign')?.value ?? '-';\n let plusSign = posAllParts.find(p => p.type === 'plusSign')?.value;\n\n // Safari does not support the signDisplay option, but our number parser polyfills it.\n // If no plus sign was returned, but the original options contained signDisplay, default to the '+' character.\n if (!plusSign && (originalOptions?.signDisplay === 'exceptZero' || originalOptions?.signDisplay === 'always')) {\n plusSign = '+';\n }\n\n // If maximumSignificantDigits is 1 (the minimum) then we won't get decimal characters out of the above formatters\n // Percent also defaults to 0 fractionDigits, so we need to make a new one that isn't percent to get an accurate decimal\n let decimalParts = new Intl.NumberFormat(locale, {...intlOptions, minimumFractionDigits: 2, maximumFractionDigits: 2}).formatToParts(0.001);\n\n let decimal = decimalParts.find(p => p.type === 'decimal')?.value;\n let group = allParts.find(p => p.type === 'group')?.value;\n\n // this set is also for a regex, it's all literals that might be in the string we want to eventually parse that\n // don't contribute to the numerical value\n let allPartsLiterals = allParts.filter(p => !nonLiteralParts.has(p.type)).map(p => escapeRegex(p.value));\n let pluralPartsLiterals = pluralParts.flatMap(p => p.filter(p => !nonLiteralParts.has(p.type)).map(p => escapeRegex(p.value)));\n let sortedLiterals = [...new Set([...allPartsLiterals, ...pluralPartsLiterals])].sort((a, b) => b.length - a.length);\n\n let literals = sortedLiterals.length === 0 ?\n new RegExp('[\\\\p{White_Space}]', 'gu') :\n new RegExp(`${sortedLiterals.join('|')}|[\\\\p{White_Space}]`, 'gu');\n\n // These are for replacing non-latn characters with the latn equivalent\n let numerals = [...new Intl.NumberFormat(intlOptions.locale, {useGrouping: false}).format(9876543210)].reverse();\n let indexes = new Map(numerals.map((d, i) => [d, i]));\n let numeral = new RegExp(`[${numerals.join('')}]`, 'g');\n let index = d => String(indexes.get(d));\n\n return {minusSign, plusSign, decimal, group, literals, numeral, index};\n}\n\nfunction replaceAll(str: string, find: string, replace: string) {\n if (str.replaceAll) {\n return str.replaceAll(find, replace);\n }\n\n return str.split(find).join(replace);\n}\n\nfunction escapeRegex(string: string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useLocale} from './context';\n\nlet cache = new Map<string, Intl.Collator>();\n\n/**\n * Provides localized string collation for the current locale. Automatically updates when the locale changes,\n * and handles caching of the collator for performance.\n * @param options - Collator options.\n */\nexport function useCollator(options?: Intl.CollatorOptions): Intl.Collator {\n let {locale} = useLocale();\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey)!;\n }\n\n let formatter = new Intl.Collator(locale, options);\n cache.set(cacheKey, formatter);\n return formatter;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useMemo} from 'react';\nimport {useCollator} from './useCollator';\n\nexport interface Filter {\n /** Returns whether a string starts with a given substring. */\n startsWith(string: string, substring: string): boolean,\n /** Returns whether a string ends with a given substring. */\n endsWith(string: string, substring: string): boolean,\n /** Returns whether a string contains a given substring. */\n contains(string: string, substring: string): boolean\n}\n\n/**\n * Provides localized string search functionality that is useful for filtering or matching items\n * in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.\n */\nexport function useFilter(options?: Intl.CollatorOptions): Filter {\n let collator = useCollator({\n usage: 'search',\n ...options\n });\n\n // TODO(later): these methods don't currently support the ignorePunctuation option.\n let startsWith = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n // Normalize both strings so we can slice safely\n // TODO: take into account the ignorePunctuation option as well...\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(0, substring.length), substring) === 0;\n }, [collator]);\n\n let endsWith = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(-substring.length), substring) === 0;\n }, [collator]);\n\n let contains = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n\n let scan = 0;\n let sliceLen = substring.length;\n for (; scan + sliceLen <= string.length; scan++) {\n let slice = string.slice(scan, scan + sliceLen);\n if (collator.compare(substring, slice) === 0) {\n return true;\n }\n }\n\n return false;\n }, [collator]);\n\n return useMemo(() => ({\n startsWith,\n endsWith,\n contains\n }), [startsWith, endsWith, contains]);\n}\n"],"names":["modules","entry","mainEntry","parcelRequireName","globalName","globalObject","globalThis","self","window","global","previousRequire","cache","nodeRequire","module","require","bind","newRequire","name","jumped","currentRequire","err","Error","code","localRequire","resolve","x","id","Module","call","exports","res","isParcelRequire","moduleName","bundle","parent","register","Object","defineProperty","get","i","length","__globalThis","parcelHelpers","defineInteropFlag","export","_context","I18nProvider","useLocale","_useMessageFormatter","useMessageFormatter","_useLocalizedStringFormatter","useLocalizedStringFormatter","useLocalizedStringDictionary","_useListFormatter","useListFormatter","_useDateFormatter","useDateFormatter","_useNumberFormatter","useNumberFormatter","_useCollator","useCollator","_useFilter","useFilter","_utils","_useDefaultLocale","_react","_reactDefault","interopDefault","I18nContext","default","createContext","props","locale","children","defaultLocale","useDefaultLocale","value","useMemo","direction","isRTL","createElement","Provider","context","useContext","RTL_SCRIPTS","Set","RTL_LANGS","localeString","Intl","Locale","maximize","textInfo","getTextInfo","script","has","lang","split","getDefaultLocale","_ssr","localeSymbol","Symbol","for","navigator","language","userLanguage","DateTimeFormat","supportedLocalesOf","currentLocale","listeners","updateLocale","listener","isSSR","useIsSSR","setDefaultLocale","useState","useEffect","size","addEventListener","add","delete","removeEventListener","_string","WeakMap","strings","packageName","dictionary","LocalizedStringDictionary","getGlobalDictionaryForPackage","set","LocalizedStringFormatter","_localizedStringDictionary","_localizedStringFormatter","cachedGlobalStrings","stringsSymbol","constructor","messages","fromEntries","entries","filter","v","getStringForLocale","key","string","getStringsForLocale","startsWith","undefined","globalStrings","pkg","pluralRulesCache","Map","numberFormatCache","format","variables","message","plural","count","options","type","opt","pluralRules","PluralRules","select","other","number","numberFormat","NumberFormat","ListFormat","_date","useDeepMemo","isEqual","DateFormatter","a","b","aKeys","keys","bKeys","_calendarDate","CalendarDate","CalendarDateTime","Time","ZonedDateTime","_gregorianCalendar","GregorianCalendar","_japaneseCalendar","JapaneseCalendar","_buddhistCalendar","BuddhistCalendar","_taiwanCalendar","TaiwanCalendar","_persianCalendar","PersianCalendar","_indianCalendar","IndianCalendar","_islamicCalendar","IslamicCivilCalendar","IslamicTabularCalendar","IslamicUmalquraCalendar","_hebrewCalendar","HebrewCalendar","_ethiopicCalendar","EthiopicCalendar","EthiopicAmeteAlemCalendar","CopticCalendar","_createCalendar","createCalendar","_conversion","toCalendarDate","toCalendarDateTime","toTime","toCalendar","toZoned","toTimeZone","toLocalTimeZone","fromDate","fromAbsolute","_queries","isSameDay","isSameMonth","isSameYear","isEqualDay","isEqualMonth","isEqualYear","isToday","getDayOfWeek","now","today","getHoursInDay","getLocalTimeZone","startOfMonth","startOfWeek","startOfYear","endOfMonth","endOfWeek","endOfYear","getMinimumMonthInYear","getMinimumDayInMonth","getWeeksInMonth","minDate","maxDate","isWeekend","isWeekday","parseDate","parseDateTime","parseTime","parseAbsolute","parseAbsoluteToLocal","parseZonedDateTime","parseDuration","_dateFormatter","_manipulation","shiftArgs","args","era","calendar","shift","eras","getEras","year","month","day","constrain","copy","duration","subtract","fields","cycle","field","amount","cycleDate","toDate","timeZone","toString","dateToString","compare","compareDate","hour","minute","second","millisecond","constrainTime","addTime","subtractTime","setTime","cycleTime","timeToString","compareTime","disambiguation","dateTimeToString","offset","addZoned","subtractZoned","setZoned","cycleZoned","zonedToDate","zonedDateTimeToString","toAbsoluteString","toISOString","getTime","invertDuration","date","mutableDate","days","addTimeFields","addYears","years","balanceYearMonth","months","constrainMonthDay","weeks","balanceDay","getDaysInMonth","balanceDate","maxYear","getYearsInEra","isInverseEra","getMonthsInYear","maxMonth","Math","max","min","monthsInYear","constrainDate","inverseDuration","mutableValue","time","nonNegativeMod","result","hours","minutes","seconds","milliseconds","floor","mutable","eraIndex","indexOf","cycleValue","round","Infinity","hourCycle","isPM","sign","div","abs","ceil","dateTime","ms","toAbsolute","epochFromDate","plainDateTime","minAbsolute","maxAbsolute","pop","remainder","getTimeZoneOffset","possibleAbsolutes","fromDateToLocal","toDateFields","toTimeFields","epochFromParts","getExtendedYear","Date","setUTCHours","setUTCFullYear","getTimezoneOffset","getTimeZoneParts","utc","formattersByTimeZone","formatter","hour12","parts","formatToParts","namedParts","part","earlier","later","getValidWallTimes","found","absolute","setFullYear","setHours","offsetBefore","offsetAfter","valid","RangeError","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","identifier","calendarDate","fromJulianDay","toJulianDay","gregorianToJulianDay","isLeapYear","fromExtendedYear","y1","monthOffset","EPOCH","daysInMonth","standard","leapyear","jd","depoch","jd0","quadricent","dqc","mod","cent","dcent","quad","yindex","dquad","yearDay","leapAdj","getDaysInYear","copyDateTime","numerator","_weekStartData","region","dayOfWeek","julian","getRegion","weekStartData","timeToMs","tomorrow","tomorrowMs","localTimeZone","resolvedOptions","cachedRegions","WEEKEND_DATA","AF","AE","BH","DZ","EG","IL","IQ","IR","JO","KW","LY","OM","QA","SA","SD","SY","YE","start","end","AD","AI","AL","AM","AN","AR","AT","AU","AX","AZ","BA","BE","BG","BM","BN","BY","CH","CL","CM","CN","CR","CY","CZ","DE","DJ","DK","EC","EE","ES","FI","FJ","FO","FR","GB","GE","GF","GP","GR","HR","HU","IE","IS","IT","KG","KZ","LB","LI","LK","LT","LU","LV","MC","MD","ME","MK","MN","MQ","MV","MY","NL","NO","NZ","PL","RE","RO","RS","RU","SE","SI","SK","SM","TJ","TM","TR","UA","UY","UZ","VA","VN","XK","TIME_RE","DATE_RE","DATE_TIME_RE","ZONED_DATE_TIME_RE","ABSOLUTE_RE","DATE_TIME_DURATION_RE","requiredDurationTimeGroups","requiredDurationGroups","m","match","parseNumber","absolutes","includes","offsetToString","val","Number","String","padStart","slice","gregorianDate","offsetHours","offsetMinutes","parseDurationGroup","group","isNegative","replace","groups","negative","some","durationStringIncludesTime","ERA_START_DATES","ERA_END_DATES","ERA_ADDENDS","ERA_NAMES","findEraFromGregorianDate","idx","findIndex","toGregorian","eraAddend","endYear","endMonth","endDay","startMonth","startDay","cur","next","getMinimums","gregorianYear","gregorianToTaiwan","y","MONTH_START","daysSinceEpoch","dayOfYear","PERSIAN_EPOCH","leapMonth","indianMonth","indianDay","indianYear","yDay","mDay","extendedYear","UMALQURA_MONTHLENGTH","UMALQURA_YEAR_START_TABLE","islamicToJulianDay","epoch","julianDayToIslamic","umalquraYearStart","UMALQURA_START_DAYS","umalquraMonthLength","umalquraMonthStart","umalquraYearLength","Uint16Array","Uint8Array","from","atob","c","charCodeAt","buffer","Uint32Array","UMALQURA_YEAR_END","yearStart","startDays","endDays","UMALQURA_YEAR_START","d","yearLength","monthLength","CIVIL_EPOC","hebrewDelay1","last","present","yearType","getYearType","MONTH_DAYS","ys","monthStart","previousDate","ceToJulianDay","julianDayToCE","getLeapDay","formatterCache","getCachedDateFormatter","formatRange","formatRangeToParts","startParts","endParts","map","p","source","_hasBuggyResolvedHourCycle","resolvedHourCycle","getResolvedHourCycle","timeStyle","parseInt","find","hour12Preferences","true","ja","false","_hasBuggyHour12Behavior","pref","defaultHourCycle","cacheKey","sort","join","numberFormatter","_number","NumberFormatter","_numberFormatter","_numberParser","NumberParser","numberFormatSignDisplayPolyfill","supportsSignDisplay","signDisplay","supportsUnit","style","unit","UNITS","degree","narrow","getCachedNumberFormatter","numberingSystem","unitDisplay","values","num","needsPositiveSign","is","noSign","minus","console","warn","CURRENCY_SIGN_REGEX","RegExp","NUMBERING_SYSTEMS","parse","getNumberParserImpl","isValidPartialNumber","minValue","maxValue","getNumberingSystem","numberParserCache","defaultParser","getCachedNumberParser","parser","NumberParserImpl","intlOptions","symbolFormatter","allParts","posAllParts","pluralParts","minusSign","plusSign","decimalParts","decimal","sortedLiterals","literals","numerals","indexes","symbols","minimumSignificantDigits","maximumSignificantDigits","roundingIncrement","roundingPriority","roundingMode","pluralNumbers","n","originalOptions","minimumFractionDigits","maximumFractionDigits","nonLiteralParts","escapeRegex","flatMap","useGrouping","reverse","numeral","index","fullySanitizedValue","sanitize","replaceAll","newValue","NaN","isNaN","currencySign","test","fromCharCode","str","Collator","collator","usage","useCallback","substring","normalize","endsWith","contains","scan","sliceLen"],"version":3,"file":"useButton.stories.ff0b63b2.js.map"}